strapi-plugin-navigation 3.0.7-beta.3 → 3.0.7

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.
@@ -1,17 +1,17 @@
1
- "use strict";const Vr=require("zod"),B=require("lodash"),S=require("lodash/fp"),Ju=require("crypto"),ec=require("child_process"),tc=require("lodash/has"),nc=require("lodash/mapValues"),rc=require("lodash/snakeCase"),ic=require("lodash/camelCase"),oc=require("lodash/mapKeys"),sc=require("os"),ac=require("path"),uc=require("fs"),cc=require("assert"),lc=require("events"),fc=require("buffer"),pc=require("stream"),dc=require("util"),hc=require("constants");require("node:stream");const mc=require("@sindresorhus/slugify"),gc=require("pluralize"),ae=e=>e&&e.__esModule?e:{default:e};function yc(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=yc(Vr),fe=ae(B),Gi=ae(Ju),mn=ae(ec),gn=ae(tc),Es=ae(nc),qi=ae(rc),vc=ae(ic),Ec=ae(oc),Hn=ae(sc),Ee=ae(ac),We=ae(uc),ws=ae(cc),wc=ae(lc),bc=ae(fc),Bn=ae(pc),at=ae(dc),_c=ae(hc),xc=ae(mc),Ki=ae(gc),Qr=y.object({name:y.string().refine(e=>!e.includes(" "),{message:"No space allowed"}),label:y.string(),required:y.boolean().optional(),enabled:y.boolean().optional()}),Ac=Qr.extend({type:y.literal("select"),multi:y.boolean(),options:y.array(y.string())}),Sc=Qr.extend({type:y.enum(["boolean","string"]),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),Tc=Qr.extend({type:y.literal("media"),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),Cc=y.union([Sc,Tc,Ac]),Rc=y.union([y.literal("audience"),Cc]),Le=y.object({additionalFields:y.array(Rc),allowedLevels:y.number(),contentTypes:y.array(y.string()),contentTypesNameFields:y.record(y.string(),y.array(y.string())),contentTypesPopulate:y.record(y.string(),y.array(y.string())),gql:y.object({navigationItemRelated:y.array(y.string())}),pathDefaultFields:y.record(y.string(),y.any()),cascadeMenuAttached:y.boolean(),preferCustomContentTypes:y.boolean(),isCacheEnabled:y.boolean().optional()}),$c=y.enum(["collectionType","singleType"]),Fc=y.object({singularName:y.string(),pluralName:y.string(),displayName:y.string(),description:y.string().optional(),name:y.string().optional()}),bs=y.object({required:y.boolean().optional(),max:y.number().optional(),min:y.number().optional(),minLength:y.number().optional(),maxLength:y.number().optional(),private:y.boolean().optional(),configurable:y.boolean().optional(),default:y.any().optional()}),Ic=y.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),Oc=bs.extend({type:Ic}),Nc=bs.extend({type:y.literal("enumeration"),enum:y.string().array()}),Pc=y.object({type:y.literal("component"),component:y.string(),repeatable:y.boolean().optional()}),Lc=y.object({type:y.literal("dynamiczone"),components:y.string().array()}),Dc=y.object({type:y.literal("uid")}),Mc=y.object({type:y.literal("media"),allowedTypes:y.enum(["images","videos","audios","files"]).array(),required:y.boolean().optional()}),kc=y.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),jc=y.object({type:y.literal("relation"),relation:kc,target:y.string(),mappedBy:y.string().optional(),inversedBy:y.string().optional()}),Hc=y.record(y.string(),y.union([Oc,Nc,Pc,Lc,jc,Mc,Dc])),Rr=y.object({kind:$c,collectionName:y.string(),info:Fc,options:y.object({draftAndPublish:y.boolean().optional(),hidden:y.boolean().optional(),templateName:y.string().optional()}).optional(),attributes:Hc,actions:y.record(y.string(),y.any()).optional(),lifecycles:y.record(y.string(),y.any()).optional(),uid:y.string(),apiName:y.string().optional(),associations:y.object({model:y.string(),alias:y.string()}).array().optional(),modelName:y.string().optional(),plugin:y.string().optional(),pluginOptions:y.record(y.string(),y.any()).optional(),isSingle:y.boolean().optional()});Rr.pick({info:!0,kind:!0,attributes:!0,options:!0});const _s=y.object({id:y.number(),documentId:y.string(),name:y.string(),key:y.string()}),Bc=y.enum(["INTERNAL","EXTERNAL","WRAPPER"]),Xr=y.object({id:y.number(),documentId:y.string(),title:y.string(),type:Bc,path:y.string().or(y.null()).optional(),slug:y.string().or(y.null()).optional(),externalPath:y.string().or(y.null()).optional(),uiRouterKey:y.string(),menuAttached:y.boolean(),order:y.number().int(),collapsed:y.boolean(),related:y.object({documentId:y.string().optional(),__type:y.string()}).catchall(y.unknown()).nullish(),additionalFields:y.record(y.string(),y.unknown()).or(y.null()).optional(),audience:y.array(_s).or(y.null()).optional(),autoSync:y.boolean().or(y.null()).optional()}),Uc=Xr.omit({related:!0}).pick({path:!0,type:!0,uiRouterKey:!0,title:!0,externalPath:!0}).extend({related:y.unknown()}),Bt=Xr.extend({parent:y.lazy(()=>Bt.or(y.null())).optional(),items:y.lazy(()=>Bt.array()).optional(),master:y.lazy(()=>Je(!1)).optional()}),zi=y.array(Bt),Je=e=>y.object({id:y.number(),documentId:y.string(),name:y.string(),slug:y.string(),locale:y.string(),visible:y.boolean(),items:e?y.array(Bt):Bt.array().optional()}),Gc=Je(!1).omit({items:!0,id:!0,documentId:!0,slug:!0,locale:!0}).extend({documentId:y.string().optional(),id:y.undefined().optional()}),qc=Xr.omit({id:!0,documentId:!0}).extend({id:y.number().optional(),documentId:y.string().optional(),items:y.lazy(()=>xs).or(y.null()).optional(),updated:y.boolean().optional(),removed:y.boolean().optional()}),xs=y.array(qc),Kc=Je(!1).extend({items:xs}).partial().required({id:!0,documentId:!0}),zc=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,Wc=["beforeCreate","beforeCreateMany","afterCreate","afterCreateMany","beforeUpdate","beforeUpdateMany","afterUpdate","afterUpdateMany","beforeDelete","beforeDeleteMany","afterDelete","afterDeleteMany","beforeCount","afterCount","beforeFindOne","afterFindOne","beforeFindMany","afterFindMany"],Yc="$",As=["api::","plugin::"],Ss=["admin::","plugin::content-releases","plugin::i18n.locale","plugin::navigation","plugin::review-workflows","plugin::users-permissions","plugin::upload.folder"],Vc=["title","subject","name"],Wi={SINGLE:"singleType",COLLECTION:"collectionType"},Yi=["title","type","path","externalPath","uiRouterKey","menuAttached","order","collapsed","related","parent","master","audience","additionalFields"],Qc=e=>e.filter(t=>t!=="audience"),Ts=e=>{const t=Qc(e);if(t.length!==B.uniqBy(t,"name").length)throw new Error("All names of custom fields must be unique.");if(!B.isNil(B.find(t,n=>typeof n=="object"&&B.includes(Yi,n.name))))throw new Error(`Name of custom field cannot be one of: ${Yi.join(", ")}`)},Cs=(e,t)=>{if(e==null)throw t??new Error("Non-empty value expected, empty given")},Xc=(e="")=>{const t=s=>s.split("-").map(o=>B.capitalize(o)).join(""),[n,r,i]=Zc(e);return n==="api"?t(i):`${t(r)}${t(i)}`},Zc=(e="")=>e.split(zc).filter(t=>t&&t.length>0),Jc=(e,t)=>n=>[n,async r=>{await oe(t,"common").runLifeCycleHook({contentTypeName:e,hookName:n,event:r})}],Rs=(e,t)=>Object.fromEntries(Wc.map(Jc(e,t))),be=({strapi:e})=>{const t=e.plugin("navigation");return{masterModel:t.contentType("navigation"),itemModel:t.contentType("navigation-item"),relatedModel:t.contentType("navigations-items-related"),audienceModel:t.contentType("audience")}};function oe({strapi:e},t){return e.plugin("navigation").service(t)}const Zt=e=>e==="*"?"*":typeof e=="string"?[e]:e===!1?[]:e===!0?"*":e,el=(e="")=>{const t=!!As.find(r=>e.includes(r)),n=!Ss.find(r=>e.includes(r)||e===r);return!!e&&t&&n},Vi=(e="")=>B.last(e)==="s"?e.substr(0,e.length-1):e,$s=async({strapi:e})=>{const t=e.store({type:"plugin",name:"navigation"}),n=await e.plugin("navigation").config,r={...$r.default,...await t.get({key:"config"})??$r.default};let i=Le.parse(r);const s=tl(i,n);return i={additionalFields:s("additionalFields"),contentTypes:s("contentTypes"),contentTypesNameFields:s("contentTypesNameFields"),contentTypesPopulate:s("contentTypesPopulate"),allowedLevels:s("allowedLevels"),gql:s("gql"),pathDefaultFields:s("pathDefaultFields"),cascadeMenuAttached:s("cascadeMenuAttached"),preferCustomContentTypes:s("preferCustomContentTypes"),isCacheEnabled:s("isCacheEnabled")},nl(i,{strapi:e}),Ts(i.additionalFields),await t.set({key:"config",value:i}),i},tl=(e,t)=>n=>{const r=e?.[n]??t(n);return Cs(r,new Error(`[Navigation] Config "${n}" is undefined`)),r},nl=(e,{strapi:t})=>{const n=e.contentTypes.filter(i=>!t.contentTypes[i]);if(n.length===0)return;const r=n.map(Xc);e.contentTypes=e.contentTypes.filter(i=>!n.includes(i)),e.contentTypesNameFields=Object.fromEntries(Object.entries(e.contentTypesNameFields).filter(([i])=>!n.includes(i))),e.gql.navigationItemRelated=e.gql.navigationItemRelated.filter(i=>!r.includes(i))},$r={default:{additionalFields:[],allowedLevels:2,contentTypes:[],contentTypesNameFields:{},contentTypesPopulate:{},gql:{navigationItemRelated:[]},i18nEnabled:!1,pathDefaultFields:{},pruneObsoleteI18nNavigations:!1,cascadeMenuAttached:!0,preferCustomContentTypes:!1,isCacheEnabled:!1}},rl=B.once(e=>({find(t,n){const{audienceModel:{uid:r}}=be(e);return e.strapi.query(r).findMany({where:t,limit:n}).then(_s.array().parse)}})),yn=(e,t)=>({findFirst(n,r,i={}){return e.strapi.documents(t).findFirst({populate:Zt(n),status:r,...i})},findById(n,r,i,s={}){return e.strapi.documents(t).findOne({documentId:n,populate:Zt(r),status:i,...s})},findManyById(n,r,i){return e.strapi.documents(t).findMany({where:{documentId:{$in:n}},populate:Zt(r),status:i})},findMany(n,r,i,s){return e.strapi.documents(t).findMany({where:n,populate:Zt(r),status:i,locale:s})},count(n,r){return e.strapi.documents(t).count({where:n,status:r})}}),Ne=B.once(e=>({async save({item:t,locale:n}){const{itemModel:r}=be(e),{__type:i,documentId:s}=t?.related??{},o=i?yn(e,i):void 0,a=i&&o?s?await o.findById(s,void 0,void 0,{locale:n}):await o.findFirst(void 0,void 0,{locale:n}):void 0;if(typeof t.documentId=="string"){const{documentId:u,...l}=t;return e.strapi.documents(r.uid).update({documentId:t.documentId,data:{...l,related:a?{...a,__type:i}:void 0},locale:n})}else return e.strapi.documents(r.uid).create({data:{...t,related:a?{...a,__type:i}:void 0},locale:n})},find({filters:t,locale:n,limit:r,order:i,populate:s}){const{itemModel:o}=be(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:s,orderBy:i}).then(a=>a.map(Fr)).then(zi.parse).then(a=>a.map(vn))},count(t){const{itemModel:n}=be(e);return e.strapi.query(n.uid).count({where:t})},remove(t){const{itemModel:n}=be(e);return e.strapi.query(n.uid).delete({where:{documentId:t.documentId}})},removeForIds(t){const{itemModel:n}=be(e);return e.strapi.query(n.uid).deleteMany({where:{documentId:t}})},findForMasterIds(t){const{itemModel:n}=be(e);return e.strapi.query(n.uid).findMany({where:{$or:t.map(r=>({master:r}))},limit:Number.MAX_SAFE_INTEGER}).then(zi.parse)}})),il=["id","publishedAt","createdAt","updatedAt","locale"],vn=({related:e,items:t=[],...n})=>({...n,items:t.map(vn),related:e?B.omit(e,il):void 0}),Fr=({related:e,...t})=>({...t,related:e?.[0]});class At extends Error{constructor(t,n){super(t),this.additionalInfo=n,this.type="NavigationError"}}class sr extends At{constructor(){super(...arguments),this.type="FillNavigationError"}}class ol extends At{constructor(){super(...arguments),this.type="InvalidParamNavigationError"}}const Qi=e=>e===!0?!0:Array.isArray(e)?e.includes("items"):!1,Oe=B.once(e=>({find({filters:t,locale:n,limit:r,orderBy:i,populate:s}){const{masterModel:o}=be(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:s,orderBy:i}).then(a=>a.map(({items:u,...l})=>({...l,items:u?.map(Fr)}))).then(a=>a.map(({items:u,...l})=>({...l,items:u?.map(vn)}))).then(a=>Je(Qi(s)).array().parse(a))},findOne({locale:t,filters:n,populate:r}){const{masterModel:i}=be(e);return e.strapi.documents(i.uid).findOne({documentId:n.documentId,locale:t,populate:r}).then(s=>s&&{...s,items:s.items?.map(Fr)}).then(s=>Je(Qi(r)).parse(s)).then(s=>({...s,items:s.items?.map(vn)}))},async save(t){const{masterModel:n}=be(e),{documentId:r,locale:i,...s}=t;return r?e.strapi.documents(n.uid).update({locale:i,documentId:r,data:B.omit(s,["id","documentId"]),populate:["items"]}).then(Je(!1).parse):e.strapi.documents(n.uid).create({locale:i,data:{...s,populate:["items"]}}).then(Je(!1).parse)},remove(t){const{masterModel:n}=be(e);if(!t.documentId&&!t.id)throw new At("Some kind of id required. None given.");return e.strapi.query(n.uid).deleteMany({where:t})}})),sl="Navigation",al="navigation",ul=async e=>{const t=oe(e,"common"),{defaultLocale:n,restLocale:r=[]}=await t.readLocale(),i=Oe(e),s=await i.find({limit:Number.MAX_SAFE_INTEGER,filters:{},locale:"*"});s.length===0&&s.push(await i.save({name:sl,visible:!0,locale:n,slug:al}));const o=s.filter(({locale:a})=>a===n);for(const a of o)for(const u of r)!s.find(({locale:c,documentId:f})=>f===a.documentId&&u===c)&&await i.save({documentId:a.documentId,name:a.name,locale:u,visible:a.visible,slug:a.slug})},he={render:function(e){return`plugin::navigation.${e}`},navigation:{read:"read",update:"update",settings:"settings"}},cl=async({strapi:e})=>{const t=[{section:"plugins",displayName:"Read",uid:he.navigation.read,pluginName:"navigation"},{section:"plugins",displayName:"Update",uid:he.navigation.update,pluginName:"navigation"},{section:"plugins",displayName:"Settings",uid:he.navigation.settings,pluginName:"navigation"}];await e.admin.services.permission.actionProvider.registerMany(t)},ll=({nexus:e})=>e.objectType({name:"ContentTypes",definition(t){t.nonNull.string("uid"),t.nonNull.string("name"),t.nonNull.boolean("isSingle"),t.nonNull.string("collectionName"),t.nonNull.string("contentTypeName"),t.nonNull.string("label"),t.nonNull.string("relatedField"),t.nonNull.string("labelSingular"),t.nonNull.string("endpoint"),t.nonNull.boolean("available"),t.nonNull.boolean("visible")}}),fl=({nexus:e,strapi:t})=>e.objectType({name:"ContentTypesNameFields",async definition(n){n.nonNull.list.nonNull.string("default");const i=await oe({strapi:t},"common").getPluginStore(),o=Le.parse(await i.get({key:"config"})).contentTypesNameFields;Object.keys(o||{}).forEach(a=>n.nonNull.list.string(a))}}),pl=({nexus:e})=>e.inputObjectType({name:"CreateNavigation",definition(t){t.nonNull.string("name"),t.nonNull.list.field("items",{type:"CreateNavigationItem"})}}),dl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationItem",definition(t){t.nonNull.string("title"),t.nonNull.field("type",{type:"NavigationItemType"}),t.string("path"),t.string("externalPath"),t.nonNull.string("uiRouterKey"),t.nonNull.boolean("menuAttached"),t.nonNull.int("order"),t.string("parent"),t.string("master"),t.list.field("items",{type:"CreateNavigationItem"}),t.list.string("audience"),t.field("related",{type:"CreateNavigationRelated"})}}),hl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationRelated",definition(t){t.nonNull.string("ref"),t.nonNull.string("field"),t.nonNull.string("refId")}}),ml=({nexus:e})=>e.objectType({name:"Navigation",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible")}}),gl=({nexus:e})=>e.objectType({name:"NavigationConfig",definition(t){t.int("allowedLevels"),t.nonNull.list.string("additionalFields"),t.field("contentTypesNameFields",{type:"ContentTypesNameFields"}),t.list.field("contentTypes",{type:"ContentTypes"})}}),yl=({nexus:e})=>e.objectType({name:"NavigationDetails",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible"),t.nonNull.list.field("items",{type:"NavigationItem"})}}),vl=({nexus:e,config:t})=>e.objectType({name:"NavigationItem",definition(n){n.nonNull.int("id"),n.nonNull.string("documentId"),n.nonNull.string("title"),n.nonNull.field("type",{type:"NavigationItemType"}),n.string("path"),n.string("externalPath"),n.nonNull.string("uiRouterKey"),n.nonNull.boolean("menuAttached"),n.nonNull.int("order"),n.field("parent",{type:"NavigationItem"}),n.string("master"),n.list.field("items",{type:"NavigationItem"}),n.field("related",{type:"NavigationItemRelated"}),t.additionalFields.find(r=>r==="audience")&&n.list.string("audience"),n.field("additionalFields",{type:"NavigationItemAdditionalFields"}),n.string("created_at"),n.string("updated_at"),n.string("created_by"),n.string("updated_by"),n.string("createdAt"),n.string("updatedAt"),n.string("createdBy"),n.string("updatedBy")}}),El=({nexus:e,config:t})=>e.objectType({name:"NavigationItemAdditionalFields",definition(n){t.additionalFields.forEach(r=>{if(r!=="audience"&&r.enabled)switch(r.type){case"media":n.field(r.name,{type:"NavigationItemAdditionalFieldMedia"});break;case"string":n.string(r.name);break;case"boolean":n.boolean(r.name);break;case"select":r.multi?n.list.string(r.name):n.string(r.name);break;default:throw new Error(`Type "${JSON.stringify(r.type)}" is unsupported by custom fields`)}})}}),wl=({nexus:e})=>e.objectType({name:"NavigationItemAdditionalFieldMedia",definition(t){t.nonNull.string("name"),t.nonNull.string("url"),t.nonNull.string("mime"),t.nonNull.int("width"),t.nonNull.int("height"),t.string("previewUrl")}}),bl=({strapi:e,nexus:t,config:n})=>{const r=n.gql?.navigationItemRelated,i="NavigationItemRelated";return r?.length?t.unionType({name:i,definition(s){s.members(...r)},resolveType:s=>e.contentTypes[s.__type]?.globalId}):t.objectType({name:i,definition(s){s.int("id"),s.string("documentId"),s.string("title"),s.string("name")}})},_l=({nexus:e})=>e.enumType({name:"NavigationItemType",members:["INTERNAL","EXTERNAL","WRAPPER"]}),xl=({nexus:e})=>e.enumType({name:"NavigationRenderType",members:["FLAT","TREE"]}),Al=[wl,El,bl,vl,xl,ml,yl,fl,ll,gl,hl,dl,pl,_l],Sl=e=>Al.map(t=>t(e)),Tl="I18NLocaleCode",Cl=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:s}=t;return{args:{navigationIdOrSlug:n(i()),type:"NavigationRenderType",menuOnly:s(),path:i(),locale:t.arg({type:Tl})},type:n(r("NavigationItem")),resolve(u,{navigationIdOrSlug:l,type:c,menuOnly:f,path:p,locale:d}){const h=Vr.z.string().parse(l);return oe({strapi:e},"client").render({idOrSlug:h,type:c,rootPath:p,locale:d,menuOnly:f,wrapRelated:!0})}}},Rl=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:s}=t;return{type:n(r("NavigationItem")),args:{documentId:n(i()),childUiKey:n(i()),type:"NavigationRenderType",menuOnly:s()},resolve(o,a){const{documentId:u,childUIKey:l,type:c,menuOnly:f}=a,p=Vr.z.string().parse(u);return oe({strapi:e},"client").renderChildren({idOrSlug:p,childUIKey:l,type:c,menuOnly:f,wrapRelated:!0})}}},$l=e=>{const t={renderNavigationChild:Rl,renderNavigation:Cl};return e.nexus.extendType({type:"Query",definition(n){for(const[r,i]of Object.entries(t)){const s=i(e);n.field(r,s)}}})},Fl=()=>({"Query.renderNavigationChild":{auth:!1},"Query.renderNavigation":{auth:!1}}),Il=async({strapi:e})=>{const t=e.plugin("graphql").service("extension");t.shadowCRUD("plugin::navigation.audience").disable(),t.shadowCRUD("plugin::navigation.navigation").disable(),t.shadowCRUD("plugin::navigation.navigation-item").disable(),t.shadowCRUD("plugin::navigation.navigations-items-related").disable();const r=await oe({strapi:e},"common").getPluginStore(),i=Le.parse(await r.get({key:"config"}));t.use(({strapi:s,nexus:o})=>{const a=Sl({strapi:s,nexus:o,config:i}),u=$l({strapi:s,nexus:o}),l=Fl();return{types:[a,u],resolversConfig:l}})},Ol=async({strapi:e})=>{!!e.plugin("graphql")&&await Il({strapi:e})},Nl=async e=>{await $s(e),await ul(e),await cl(e),await Ol(e)},Pl=({strapi:e})=>{},Ll=({strapi:e})=>{},Dl={collectionName:"audience",info:{singularName:"audience",pluralName:"audiences",displayName:"Audience",name:"audience"},options:{increments:!0,comment:"Audience"},attributes:{name:{type:"string",required:!0},key:{type:"uid",targetField:"name"}}},Ml={schema:Dl},kl=Rs("navigation",{strapi}),jl={collectionName:"navigations",info:{singularName:"navigation",pluralName:"navigations",displayName:"Navigation",name:"navigation"},options:{comment:""},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!0}},attributes:{name:{type:"text",configurable:!1,required:!0},slug:{type:"uid",target:"name",configurable:!1,required:!0},visible:{type:"boolean",default:!1,configurable:!1},items:{type:"relation",relation:"oneToMany",target:"plugin::navigation.navigation-item",configurable:!1,mappedBy:"master"}}},Hl={schema:jl,lifecycles:kl},Bl=Rs("navigation-item",{strapi}),Ul={collectionName:"navigations_items",info:{singularName:"navigation-item",pluralName:"navigation-items",displayName:"Navigation Item",name:"navigation-item"},options:{increments:!0,timestamps:!0,comment:"Navigation Item"},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!1}},attributes:{title:{type:"text",configurable:!1,required:!0,pluginOptions:{i18n:{localized:!1}}},type:{type:"enumeration",enum:["INTERNAL","EXTERNAL","WRAPPER"],default:"INTERNAL",configurable:!1},path:{type:"text",targetField:"title",configurable:!1},externalPath:{type:"text",configurable:!1},uiRouterKey:{type:"string",configurable:!1},menuAttached:{type:"boolean",default:!1,configurable:!1},order:{type:"integer",default:0,configurable:!1},collapsed:{type:"boolean",default:!1,configurable:!1},autoSync:{type:"boolean",default:!0,configurable:!1},related:{type:"relation",relation:"morphToMany",required:!0,configurable:!1},parent:{type:"relation",relation:"oneToOne",target:"plugin::navigation.navigation-item",configurable:!1,default:null},master:{type:"relation",relation:"manyToOne",target:"plugin::navigation.navigation",configurable:!1,inversedBy:"items"},audience:{type:"relation",relation:"oneToMany",target:"plugin::navigation.audience"},additionalFields:{type:"json",require:!1,default:{}}}},Gl={schema:Ul,lifecycles:Bl},ql={audience:Ml,navigation:Hl,"navigation-item":Gl},Fs=y.enum(["true","false"]),Jt=y.string(),Kl=y.object({locale:y.string().optional(),orderBy:y.string().optional(),orderDirection:y.enum(["DESC","ASC"]).optional()}),Is=y.enum(["FLAT","TREE","RFR"]),Os=y.union([y.boolean(),y.string(),y.string().array(),y.undefined()]),zl=y.object({type:Is.optional(),menu:Fs.optional(),path:y.string().optional(),locale:y.string().optional(),populate:Os.optional()}),Wl=y.object({type:Is.optional(),menu:Fs.optional(),locale:y.string().optional()}),Yl=y.object({source:y.string().min(1),target:y.string().min(1),documentId:y.string().min(1)});function Vl(e){return{getAdminService(){return oe(e,"admin")},getCommonService(){return oe(e,"common")},async get(){return await this.getAdminService().get({})},post(t){const{auditLog:n}=t;return this.getAdminService().post({payload:Gc.parse(t.request.body),auditLog:n})},put(t){const{params:{documentId:n},auditLog:r}=t,i=y.record(y.string(),y.unknown()).parse(t.request.body);return this.getAdminService().put({auditLog:r,payload:Kc.parse({...i,documentId:n})})},async delete(t){const{auditLog:n,params:{documentId:r}}=t;return await this.getAdminService().delete({documentId:Jt.parse(r),auditLog:n}),{}},config(){return this.getAdminService().config({viaSettingsPage:!1})},async updateConfig(t){return await this.getAdminService().updateConfig({config:Le.parse(t.request.body)}),{}},async restoreConfig(){return await this.getAdminService().restoreConfig(),{}},settingsConfig(){return this.getAdminService().config({viaSettingsPage:!0})},async settingsRestart(){return await this.getAdminService().restart(),{}},getById(t){const{params:{documentId:n}}=t;return this.getAdminService().getById({documentId:Jt.parse(n)})},getContentTypeItems(t){const{params:{model:n},query:r={}}=t;return this.getAdminService().getContentTypeItems({query:y.record(y.string(),y.unknown()).parse(r),uid:y.string().parse(n)})},async fillFromOtherLocale(t){const{params:n,auditLog:r}=t,{source:i,target:s,documentId:o}=Yl.parse(n);return await this.getAdminService().fillFromOtherLocale({source:i,target:s,documentId:o,auditLog:r})},readNavigationItemFromLocale(t){const{params:{source:n,target:r},query:{path:i}}=t;return this.getAdminService().readNavigationItemFromLocale({path:y.string().parse(i),source:Jt.parse(n),target:Jt.parse(r)})},getSlug(t){const{query:{q:n}}=t;return this.getCommonService().getSlug({query:y.string().parse(n)}).then(r=>({slug:r}))},settingsLocale(){return this.getCommonService().readLocale()}}}const Ql=e=>{if(!(!e||e===!0||e==="*")&&typeof e!="object")return Array.isArray(e),e};function Xl(e){return{getService(){return oe(e,"client")},async readAll(t){try{const{query:n={}}=t,{locale:r,orderBy:i,orderDirection:s}=Kl.parse(n);return await this.getService().readAll({locale:r,orderBy:i,orderDirection:s})}catch(n){if(n instanceof Error)return t.badRequest(n.message);throw n}},async render(t){const{params:n,query:r={}}=t,{type:i,menu:s,path:o,locale:a,populate:u}=zl.parse(r),l=y.string().parse(n.idOrSlug);return await this.getService().render({idOrSlug:l,type:i,menuOnly:s==="true",rootPath:o,locale:a,populate:Ql(Os.parse(u==="true"?!0:u==="false"?!1:Array.isArray(u)?u.map(c=>c==="true"?!0:c==="false"?!1:u):u))})},async renderChild(t){const{params:n,query:r={}}=t,{type:i,menu:s,locale:o}=Wl.parse(r),a=y.string().parse(n.documentId),u=y.string().parse(n.childUIKey);return await this.getService().renderChildren({idOrSlug:a,childUIKey:u,type:i,menuOnly:s==="true",locale:o})}}}const Zl={admin:Vl,client:Xl},Jl={},ef={},tf={type:"admin",routes:[{method:"GET",path:"/",handler:"admin.get",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"POST",path:"/",handler:"admin.post",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/config",handler:"admin.config",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/config",handler:"admin.updateConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"DELETE",path:"/config",handler:"admin.restoreConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"GET",path:"/slug",handler:"admin.getSlug",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/:documentId",handler:"admin.getById",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/:documentId",handler:"admin.put",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"DELETE",path:"/:documentId",handler:"admin.delete",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/content-type-items/:model",handler:"admin.getContentTypeItems",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/locale",handler:"admin.settingsLocale",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/config",handler:"admin.settingsConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"GET",path:"/settings/restart",handler:"admin.settingsRestart",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"PUT",path:"/i18n/copy/:documentId/:source/:target",handler:"admin.fillFromOtherLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/i18n/item/read/:source/:target",handler:"admin.readNavigationItemFromLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}}]},nf={type:"content-api",routes:[{method:"GET",path:"/render/:idOrSlug",handler:"client.render",config:{policies:[]}},{method:"GET",path:"/render/:idOrSlug/:childUIKey",handler:"client.renderChild",config:{policies:[]}},{method:"GET",path:"/",handler:"client.readAll",config:{policies:[]}}]},rf={admin:tf,"content-api":nf};var ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ns(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var of={exports:{}};(function(e,t){(function(n,r){e.exports=r(mn.default,Gi.default)})(ye,function(n,r){return function(i){function s(a){if(o[a])return o[a].exports;var u=o[a]={exports:{},id:a,loaded:!1};return i[a].call(u.exports,u,u.exports,s),u.loaded=!0,u.exports}var o={};return s.m=i,s.c=o,s.p="",s(0)}([function(i,s,o){i.exports=o(34)},function(i,s,o){var a=o(29)("wks"),u=o(33),l=o(2).Symbol,c=typeof l=="function",f=i.exports=function(p){return a[p]||(a[p]=c&&l[p]||(c?l:u)("Symbol."+p))};f.store=a},function(i,s){var o=i.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=o)},function(i,s,o){var a=o(9);i.exports=function(u){if(!a(u))throw TypeError(u+" is not an object!");return u}},function(i,s,o){i.exports=!o(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(i,s,o){var a=o(12),u=o(17);i.exports=o(4)?function(l,c,f){return a.f(l,c,u(1,f))}:function(l,c,f){return l[c]=f,l}},function(i,s){var o=i.exports={version:"2.4.0"};typeof __e=="number"&&(__e=o)},function(i,s,o){var a=o(14);i.exports=function(u,l,c){if(a(u),l===void 0)return u;switch(c){case 1:return function(f){return u.call(l,f)};case 2:return function(f,p){return u.call(l,f,p)};case 3:return function(f,p,d){return u.call(l,f,p,d)}}return function(){return u.apply(l,arguments)}}},function(i,s){var o={}.hasOwnProperty;i.exports=function(a,u){return o.call(a,u)}},function(i,s){i.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},function(i,s){i.exports={}},function(i,s){var o={}.toString;i.exports=function(a){return o.call(a).slice(8,-1)}},function(i,s,o){var a=o(3),u=o(26),l=o(32),c=Object.defineProperty;s.f=o(4)?Object.defineProperty:function(f,p,d){if(a(f),p=l(p,!0),a(d),u)try{return c(f,p,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(f[p]=d.value),f}},function(i,s,o){var a=o(42),u=o(15);i.exports=function(l){return a(u(l))}},function(i,s){i.exports=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o}},function(i,s){i.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},function(i,s,o){var a=o(9),u=o(2).document,l=a(u)&&a(u.createElement);i.exports=function(c){return l?u.createElement(c):{}}},function(i,s){i.exports=function(o,a){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:a}}},function(i,s,o){var a=o(12).f,u=o(8),l=o(1)("toStringTag");i.exports=function(c,f,p){c&&!u(c=p?c:c.prototype,l)&&a(c,l,{configurable:!0,value:f})}},function(i,s,o){var a=o(29)("keys"),u=o(33);i.exports=function(l){return a[l]||(a[l]=u(l))}},function(i,s){var o=Math.ceil,a=Math.floor;i.exports=function(u){return isNaN(u=+u)?0:(u>0?a:o)(u)}},function(i,s,o){var a=o(11),u=o(1)("toStringTag"),l=a(function(){return arguments}())=="Arguments",c=function(f,p){try{return f[p]}catch{}};i.exports=function(f){var p,d,h;return f===void 0?"Undefined":f===null?"Null":typeof(d=c(p=Object(f),u))=="string"?d:l?a(p):(h=a(p))=="Object"&&typeof p.callee=="function"?"Arguments":h}},function(i,s){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(i,s,o){var a=o(2),u=o(6),l=o(7),c=o(5),f="prototype",p=function(d,h,g){var m,w,_,C=d&p.F,T=d&p.G,R=d&p.S,F=d&p.P,j=d&p.B,x=d&p.W,A=T?u:u[h]||(u[h]={}),N=A[f],v=T?a:R?a[h]:(a[h]||{})[f];T&&(g=h);for(m in g)w=!C&&v&&v[m]!==void 0,w&&m in A||(_=w?v[m]:g[m],A[m]=T&&typeof v[m]!="function"?g[m]:j&&w?l(_,a):x&&v[m]==_?function(k){var H=function(K,E,b){if(this instanceof k){switch(arguments.length){case 0:return new k;case 1:return new k(K);case 2:return new k(K,E)}return new k(K,E,b)}return k.apply(this,arguments)};return H[f]=k[f],H}(_):F&&typeof _=="function"?l(Function.call,_):_,F&&((A.virtual||(A.virtual={}))[m]=_,d&p.R&&N&&!N[m]&&c(N,m,_)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,i.exports=p},function(i,s){i.exports=function(o){try{return!!o()}catch{return!0}}},function(i,s,o){i.exports=o(2).document&&document.documentElement},function(i,s,o){i.exports=!o(4)&&!o(24)(function(){return Object.defineProperty(o(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(i,s,o){var a=o(28),u=o(23),l=o(57),c=o(5),f=o(8),p=o(10),d=o(45),h=o(18),g=o(52),m=o(1)("iterator"),w=!([].keys&&"next"in[].keys()),_="@@iterator",C="keys",T="values",R=function(){return this};i.exports=function(F,j,x,A,N,v,k){d(x,j,A);var H,K,E,b=function(M){if(!w&&M in z)return z[M];switch(M){case C:return function(){return new x(this,M)};case T:return function(){return new x(this,M)}}return function(){return new x(this,M)}},$=j+" Iterator",D=N==T,U=!1,z=F.prototype,V=z[m]||z[_]||N&&z[N],J=V||b(N),Ae=N?D?b("entries"):J:void 0,I=j=="Array"&&z.entries||V;if(I&&(E=g(I.call(new F)),E!==Object.prototype&&(h(E,$,!0),a||f(E,m)||c(E,m,R))),D&&V&&V.name!==T&&(U=!0,J=function(){return V.call(this)}),a&&!k||!w&&!U&&z[m]||c(z,m,J),p[j]=J,p[$]=R,N)if(H={values:D?J:b(T),keys:v?J:b(C),entries:Ae},k)for(K in H)K in z||l(z,K,H[K]);else u(u.P+u.F*(w||U),j,H);return H}},function(i,s){i.exports=!0},function(i,s,o){var a=o(2),u="__core-js_shared__",l=a[u]||(a[u]={});i.exports=function(c){return l[c]||(l[c]={})}},function(i,s,o){var a,u,l,c=o(7),f=o(41),p=o(25),d=o(16),h=o(2),g=h.process,m=h.setImmediate,w=h.clearImmediate,_=h.MessageChannel,C=0,T={},R="onreadystatechange",F=function(){var x=+this;if(T.hasOwnProperty(x)){var A=T[x];delete T[x],A()}},j=function(x){F.call(x.data)};m&&w||(m=function(x){for(var A=[],N=1;arguments.length>N;)A.push(arguments[N++]);return T[++C]=function(){f(typeof x=="function"?x:Function(x),A)},a(C),C},w=function(x){delete T[x]},o(11)(g)=="process"?a=function(x){g.nextTick(c(F,x,1))}:_?(u=new _,l=u.port2,u.port1.onmessage=j,a=c(l.postMessage,l,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(a=function(x){h.postMessage(x+"","*")},h.addEventListener("message",j,!1)):a=R in d("script")?function(x){p.appendChild(d("script"))[R]=function(){p.removeChild(this),F.call(x)}}:function(x){setTimeout(c(F,x,1),0)}),i.exports={set:m,clear:w}},function(i,s,o){var a=o(20),u=Math.min;i.exports=function(l){return l>0?u(a(l),9007199254740991):0}},function(i,s,o){var a=o(9);i.exports=function(u,l){if(!a(u))return u;var c,f;if(l&&typeof(c=u.toString)=="function"&&!a(f=c.call(u))||typeof(c=u.valueOf)=="function"&&!a(f=c.call(u))||!l&&typeof(c=u.toString)=="function"&&!a(f=c.call(u)))return f;throw TypeError("Can't convert object to primitive value")}},function(i,s){var o=0,a=Math.random();i.exports=function(u){return"Symbol(".concat(u===void 0?"":u,")_",(++o+a).toString(36))}},function(i,s,o){function a(R){return R&&R.__esModule?R:{default:R}}function u(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function l(R){return(0,m.createHash)("sha256").update(R).digest("hex")}function c(R){switch(_){case"darwin":return R.split("IOPlatformUUID")[1].split(`
2
- `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return R.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return R.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return R.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function f(R){var F=c((0,g.execSync)(T[_]).toString());return R?F:l(F)}function p(R){return new h.default(function(F,j){return(0,g.exec)(T[_],{},function(x,A,N){if(x)return j(new Error("Error while obtaining machine id: "+x.stack));var v=c(A.toString());return F(R?v:l(v))})})}Object.defineProperty(s,"__esModule",{value:!0});var d=o(35),h=a(d);s.machineIdSync=f,s.machineId=p;var g=o(70),m=o(71),w=process,_=w.platform,C={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},T={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:C[u()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(i,s,o){i.exports={default:o(36),__esModule:!0}},function(i,s,o){o(66),o(68),o(69),o(67),i.exports=o(6).Promise},function(i,s){i.exports=function(){}},function(i,s){i.exports=function(o,a,u,l){if(!(o instanceof a)||l!==void 0&&l in o)throw TypeError(u+": incorrect invocation!");return o}},function(i,s,o){var a=o(13),u=o(31),l=o(62);i.exports=function(c){return function(f,p,d){var h,g=a(f),m=u(g.length),w=l(d,m);if(c&&p!=p){for(;m>w;)if(h=g[w++],h!=h)return!0}else for(;m>w;w++)if((c||w in g)&&g[w]===p)return c||w||0;return!c&&-1}}},function(i,g,o){var a=o(7),u=o(44),l=o(43),c=o(3),f=o(31),p=o(64),d={},h={},g=i.exports=function(m,w,_,C,T){var R,F,j,x,A=T?function(){return m}:p(m),N=a(_,C,w?2:1),v=0;if(typeof A!="function")throw TypeError(m+" is not iterable!");if(l(A)){for(R=f(m.length);R>v;v++)if(x=w?N(c(F=m[v])[0],F[1]):N(m[v]),x===d||x===h)return x}else for(j=A.call(m);!(F=j.next()).done;)if(x=u(j,N,F.value,w),x===d||x===h)return x};g.BREAK=d,g.RETURN=h},function(i,s){i.exports=function(o,a,u){var l=u===void 0;switch(a.length){case 0:return l?o():o.call(u);case 1:return l?o(a[0]):o.call(u,a[0]);case 2:return l?o(a[0],a[1]):o.call(u,a[0],a[1]);case 3:return l?o(a[0],a[1],a[2]):o.call(u,a[0],a[1],a[2]);case 4:return l?o(a[0],a[1],a[2],a[3]):o.call(u,a[0],a[1],a[2],a[3])}return o.apply(u,a)}},function(i,s,o){var a=o(11);i.exports=Object("z").propertyIsEnumerable(0)?Object:function(u){return a(u)=="String"?u.split(""):Object(u)}},function(i,s,o){var a=o(10),u=o(1)("iterator"),l=Array.prototype;i.exports=function(c){return c!==void 0&&(a.Array===c||l[u]===c)}},function(i,s,o){var a=o(3);i.exports=function(u,l,c,f){try{return f?l(a(c)[0],c[1]):l(c)}catch(d){var p=u.return;throw p!==void 0&&a(p.call(u)),d}}},function(i,s,o){var a=o(49),u=o(17),l=o(18),c={};o(5)(c,o(1)("iterator"),function(){return this}),i.exports=function(f,p,d){f.prototype=a(c,{next:u(1,d)}),l(f,p+" Iterator")}},function(i,s,o){var a=o(1)("iterator"),u=!1;try{var l=[7][a]();l.return=function(){u=!0},Array.from(l,function(){throw 2})}catch{}i.exports=function(c,f){if(!f&&!u)return!1;var p=!1;try{var d=[7],h=d[a]();h.next=function(){return{done:p=!0}},d[a]=function(){return h},c(d)}catch{}return p}},function(i,s){i.exports=function(o,a){return{value:a,done:!!o}}},function(i,s,o){var a=o(2),u=o(30).set,l=a.MutationObserver||a.WebKitMutationObserver,c=a.process,f=a.Promise,p=o(11)(c)=="process";i.exports=function(){var d,h,g,m=function(){var T,R;for(p&&(T=c.domain)&&T.exit();d;){R=d.fn,d=d.next;try{R()}catch(F){throw d?g():h=void 0,F}}h=void 0,T&&T.enter()};if(p)g=function(){c.nextTick(m)};else if(l){var w=!0,_=document.createTextNode("");new l(m).observe(_,{characterData:!0}),g=function(){_.data=w=!w}}else if(f&&f.resolve){var C=f.resolve();g=function(){C.then(m)}}else g=function(){u.call(a,m)};return function(T){var R={fn:T,next:void 0};h&&(h.next=R),d||(d=R,g()),h=R}}},function(i,s,o){var a=o(3),u=o(50),l=o(22),c=o(19)("IE_PROTO"),f=function(){},p="prototype",d=function(){var h,g=o(16)("iframe"),m=l.length,w=">";for(g.style.display="none",o(25).appendChild(g),g.src="javascript:",h=g.contentWindow.document,h.open(),h.write("<script>document.F=Object<\/script"+w),h.close(),d=h.F;m--;)delete d[p][l[m]];return d()};i.exports=Object.create||function(h,g){var m;return h!==null?(f[p]=a(h),m=new f,f[p]=null,m[c]=h):m=d(),g===void 0?m:u(m,g)}},function(i,s,o){var a=o(12),u=o(3),l=o(54);i.exports=o(4)?Object.defineProperties:function(c,f){u(c);for(var p,d=l(f),h=d.length,g=0;h>g;)a.f(c,p=d[g++],f[p]);return c}},function(i,s,o){var a=o(55),u=o(17),l=o(13),c=o(32),f=o(8),p=o(26),d=Object.getOwnPropertyDescriptor;s.f=o(4)?d:function(h,g){if(h=l(h),g=c(g,!0),p)try{return d(h,g)}catch{}if(f(h,g))return u(!a.f.call(h,g),h[g])}},function(i,s,o){var a=o(8),u=o(63),l=o(19)("IE_PROTO"),c=Object.prototype;i.exports=Object.getPrototypeOf||function(f){return f=u(f),a(f,l)?f[l]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?c:null}},function(i,s,o){var a=o(8),u=o(13),l=o(39)(!1),c=o(19)("IE_PROTO");i.exports=function(f,p){var d,h=u(f),g=0,m=[];for(d in h)d!=c&&a(h,d)&&m.push(d);for(;p.length>g;)a(h,d=p[g++])&&(~l(m,d)||m.push(d));return m}},function(i,s,o){var a=o(53),u=o(22);i.exports=Object.keys||function(l){return a(l,u)}},function(i,s){s.f={}.propertyIsEnumerable},function(i,s,o){var a=o(5);i.exports=function(u,l,c){for(var f in l)c&&u[f]?u[f]=l[f]:a(u,f,l[f]);return u}},function(i,s,o){i.exports=o(5)},function(i,s,o){var a=o(9),u=o(3),l=function(c,f){if(u(c),!a(f)&&f!==null)throw TypeError(f+": can't set as prototype!")};i.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(c,f,p){try{p=o(7)(Function.call,o(51).f(Object.prototype,"__proto__").set,2),p(c,[]),f=!(c instanceof Array)}catch{f=!0}return function(d,h){return l(d,h),f?d.__proto__=h:p(d,h),d}}({},!1):void 0),check:l}},function(i,s,o){var a=o(2),u=o(6),l=o(12),c=o(4),f=o(1)("species");i.exports=function(p){var d=typeof u[p]=="function"?u[p]:a[p];c&&d&&!d[f]&&l.f(d,f,{configurable:!0,get:function(){return this}})}},function(i,s,o){var a=o(3),u=o(14),l=o(1)("species");i.exports=function(c,f){var p,d=a(c).constructor;return d===void 0||(p=a(d)[l])==null?f:u(p)}},function(i,s,o){var a=o(20),u=o(15);i.exports=function(l){return function(c,f){var p,d,h=String(u(c)),g=a(f),m=h.length;return g<0||g>=m?l?"":void 0:(p=h.charCodeAt(g),p<55296||p>56319||g+1===m||(d=h.charCodeAt(g+1))<56320||d>57343?l?h.charAt(g):p:l?h.slice(g,g+2):(p-55296<<10)+(d-56320)+65536)}}},function(i,s,o){var a=o(20),u=Math.max,l=Math.min;i.exports=function(c,f){return c=a(c),c<0?u(c+f,0):l(c,f)}},function(i,s,o){var a=o(15);i.exports=function(u){return Object(a(u))}},function(i,s,o){var a=o(21),u=o(1)("iterator"),l=o(10);i.exports=o(6).getIteratorMethod=function(c){if(c!=null)return c[u]||c["@@iterator"]||l[a(c)]}},function(i,s,o){var a=o(37),u=o(47),l=o(10),c=o(13);i.exports=o(27)(Array,"Array",function(f,p){this._t=c(f),this._i=0,this._k=p},function(){var f=this._t,p=this._k,d=this._i++;return!f||d>=f.length?(this._t=void 0,u(1)):p=="keys"?u(0,d):p=="values"?u(0,f[d]):u(0,[d,f[d]])},"values"),l.Arguments=l.Array,a("keys"),a("values"),a("entries")},function(i,s){},function(i,s,o){var a,u,l,c=o(28),f=o(2),p=o(7),d=o(21),h=o(23),g=o(9),m=(o(3),o(14)),w=o(38),_=o(40),C=(o(58).set,o(60)),T=o(30).set,R=o(48)(),F="Promise",j=f.TypeError,A=f.process,x=f[F],A=f.process,N=d(A)=="process",v=function(){},k=!!function(){try{var I=x.resolve(1),M=(I.constructor={})[o(1)("species")]=function(P){P(v,v)};return(N||typeof PromiseRejectionEvent=="function")&&I.then(v)instanceof M}catch{}}(),H=function(I,M){return I===M||I===x&&M===l},K=function(I){var M;return!(!g(I)||typeof(M=I.then)!="function")&&M},E=function(I){return H(x,I)?new b(I):new u(I)},b=u=function(I){var M,P;this.promise=new I(function(Y,ue){if(M!==void 0||P!==void 0)throw j("Bad Promise constructor");M=Y,P=ue}),this.resolve=m(M),this.reject=m(P)},$=function(I){try{I()}catch(M){return{error:M}}},D=function(I,M){if(!I._n){I._n=!0;var P=I._c;R(function(){for(var Y=I._v,ue=I._s==1,L=0,W=function(O){var q,Q,re=ue?O.ok:O.fail,X=O.resolve,Fe=O.reject,je=O.domain;try{re?(ue||(I._h==2&&V(I),I._h=1),re===!0?q=Y:(je&&je.enter(),q=re(Y),je&&je.exit()),q===O.promise?Fe(j("Promise-chain cycle")):(Q=K(q))?Q.call(q,X,Fe):X(q)):Fe(Y)}catch(Zu){Fe(Zu)}};P.length>L;)W(P[L++]);I._c=[],I._n=!1,M&&!I._h&&U(I)})}},U=function(I){T.call(f,function(){var M,P,Y,ue=I._v;if(z(I)&&(M=$(function(){N?A.emit("unhandledRejection",ue,I):(P=f.onunhandledrejection)?P({promise:I,reason:ue}):(Y=f.console)&&Y.error&&Y.error("Unhandled promise rejection",ue)}),I._h=N||z(I)?2:1),I._a=void 0,M)throw M.error})},z=function(I){if(I._h==1)return!1;for(var M,P=I._a||I._c,Y=0;P.length>Y;)if(M=P[Y++],M.fail||!z(M.promise))return!1;return!0},V=function(I){T.call(f,function(){var M;N?A.emit("rejectionHandled",I):(M=f.onrejectionhandled)&&M({promise:I,reason:I._v})})},J=function(I){var M=this;M._d||(M._d=!0,M=M._w||M,M._v=I,M._s=2,M._a||(M._a=M._c.slice()),D(M,!0))},Ae=function(I){var M,P=this;if(!P._d){P._d=!0,P=P._w||P;try{if(P===I)throw j("Promise can't be resolved itself");(M=K(I))?R(function(){var Y={_w:P,_d:!1};try{M.call(I,p(Ae,Y,1),p(J,Y,1))}catch(ue){J.call(Y,ue)}}):(P._v=I,P._s=1,D(P,!1))}catch(Y){J.call({_w:P,_d:!1},Y)}}};k||(x=function(I){w(this,x,F,"_h"),m(I),a.call(this);try{I(p(Ae,this,1),p(J,this,1))}catch(M){J.call(this,M)}},a=function(I){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},a.prototype=o(56)(x.prototype,{then:function(I,M){var P=E(C(this,x));return P.ok=typeof I!="function"||I,P.fail=typeof M=="function"&&M,P.domain=N?A.domain:void 0,this._c.push(P),this._a&&this._a.push(P),this._s&&D(this,!1),P.promise},catch:function(I){return this.then(void 0,I)}}),b=function(){var I=new a;this.promise=I,this.resolve=p(Ae,I,1),this.reject=p(J,I,1)}),h(h.G+h.W+h.F*!k,{Promise:x}),o(18)(x,F),o(59)(F),l=o(6)[F],h(h.S+h.F*!k,F,{reject:function(I){var M=E(this),P=M.reject;return P(I),M.promise}}),h(h.S+h.F*(c||!k),F,{resolve:function(I){if(I instanceof x&&H(I.constructor,this))return I;var M=E(this),P=M.resolve;return P(I),M.promise}}),h(h.S+h.F*!(k&&o(46)(function(I){x.all(I).catch(v)})),F,{all:function(I){var M=this,P=E(M),Y=P.resolve,ue=P.reject,L=$(function(){var W=[],O=0,q=1;_(I,!1,function(Q){var re=O++,X=!1;W.push(void 0),q++,M.resolve(Q).then(function(Fe){X||(X=!0,W[re]=Fe,--q||Y(W))},ue)}),--q||Y(W)});return L&&ue(L.error),P.promise},race:function(I){var M=this,P=E(M),Y=P.reject,ue=$(function(){_(I,!1,function(L){M.resolve(L).then(P.resolve,Y)})});return ue&&Y(ue.error),P.promise}})},function(i,s,o){var a=o(61)(!0);o(27)(String,"String",function(u){this._t=String(u),this._i=0},function(){var u,l=this._t,c=this._i;return c>=l.length?{value:void 0,done:!0}:(u=a(l,c),this._i+=u.length,{value:u,done:!1})})},function(i,s,o){o(65);for(var a=o(2),u=o(5),l=o(10),c=o(1)("toStringTag"),f=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var d=f[p],h=a[d],g=h&&h.prototype;g&&!g[c]&&u(g,c,d),l[d]=l.Array}},function(i,s){i.exports=mn.default},function(i,s){i.exports=Gi.default}])})})(of);var Ir;try{Ir=Map}catch{}var Or;try{Or=Set}catch{}function Ps(e,t,n){if(!e||typeof e!="object"||typeof e=="function")return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(Nr);if(Ir&&e instanceof Ir)return new Map(Array.from(e.entries()));if(Or&&e instanceof Or)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);n.push(r);for(var i in e){var s=t.findIndex(function(o){return o===e[i]});r[i]=s>-1?n[s]:Ps(e[i],t,n)}return r}return e}function Nr(e){return Ps(e,[],[])}const sf=Object.prototype.toString,af=Error.prototype.toString,uf=RegExp.prototype.toString,cf=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",lf=/^Symbol\((.*)\)(.*)$/;function ff(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Xi(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return ff(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return cf.call(e).replace(lf,"Symbol($1)");const r=sf.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+af.call(e)+"]":r==="RegExp"?uf.call(e):null}function St(e,t){let n=Xi(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=Xi(this[r],t);return s!==null?s:i},2)}let Ve={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=r!=null&&r!==n,s=`${e} must be a \`${t}\` type, but the final value was: \`${St(n,!0)}\``+(i?` (cast from the value \`${St(r,!0)}\`).`:".");return n===null&&(s+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),s},defined:"${path} must be defined"},Re={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},pf={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Pr={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},df={isValue:"${path} field must be ${value}"},Lr={noUnknown:"${path} field has unspecified keys: ${unknown}"},un={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};const hf=Object.assign(Object.create(null),{mixed:Ve,string:Re,number:pf,date:Pr,object:Lr,array:un,boolean:df}),Un=e=>e&&e.__isYupSchema__;class mf{constructor(t,n){if(this.refs=t,this.refs=t,typeof n=="function"){this.fn=n;return}if(!gn.default(n,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(u=>u===r);this.fn=function(...a){let u=a.pop(),l=a.pop(),c=o(...a)?i:s;if(c)return typeof c=="function"?c(l):l.concat(c.resolve(u))}}resolve(t,n){let r=this.refs.map(s=>s.getValue(n?.value,n?.parent,n?.context)),i=this.fn.apply(t,r.concat(t,n));if(i===void 0||i===t)return t;if(!Un(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}function Ls(e){return e==null?[]:[].concat(e)}function Dr(){return Dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dr.apply(this,arguments)}let gf=/\$\{\s*(\w+)\s*\}/g,Te=class Mr extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Dr({},n,{path:r})),typeof t=="string"?t.replace(gf,(i,s)=>St(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Ls(t).forEach(s=>{Mr.isError(s)?(this.errors.push(...s.errors),this.inner=this.inner.concat(s.inner.length?s.inner:s)):this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,Mr)}};const yf=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function En(e,t){let{endEarly:n,tests:r,args:i,value:s,errors:o,sort:a,path:u}=e,l=yf(t),c=r.length;const f=[];if(o=o||[],!c)return o.length?l(new Te(o,s,u)):l(null,s);for(let p=0;p<r.length;p++){const d=r[p];d(i,function(g){if(g){if(!Te.isError(g))return l(g,s);if(n)return g.value=s,l(g,s);f.push(g)}if(--c<=0){if(f.length&&(a&&f.sort(a),o.length&&f.push(...o),o=f),o.length){l(new Te(o,s,u),s);return}l(null,s)}})}}function ut(e){this._maxSize=e,this.clear()}ut.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ut.prototype.get=function(e){return this._values[e]};ut.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var vf=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ds=/^\d+$/,Ef=/^\d/,wf=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,bf=/^\s*(['"]?)(.*?)(\1)\s*$/,Zr=512,Zi=new ut(Zr),Ji=new ut(Zr),eo=new ut(Zr),Gn={Cache:ut,split:kr,normalizePath:ar,setter:function(e){var t=ar(e);return Ji.get(e)||Ji.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var u=t[s];if(u==="__proto__"||u==="constructor"||u==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=ar(e);return eo.get(e)||eo.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Jr(n)||Ds.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){_f(Array.isArray(e)?e:kr(e),t,n)}};function ar(e){return Zi.get(e)||Zi.set(e,kr(e).map(function(t){return t.replace(bf,"$2")}))}function kr(e){return e.match(vf)||[""]}function _f(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(Sf(i)&&(i='"'+i+'"'),a=Jr(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Jr(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function xf(e){return e.match(Ef)&&!e.match(Ds)}function Af(e){return wf.test(e)}function Sf(e){return!Jr(e)&&(xf(e)||Af(e))}const en={context:"$",value:"."};class it{constructor(t,n={}){if(typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===en.context,this.isValue=this.key[0]===en.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?en.context:this.isValue?en.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Gn.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n?.parent,n?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}it.prototype.__isYupRef=!0;function wn(){return wn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wn.apply(this,arguments)}function Tf(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function tn(e){function t(n,r){let{value:i,path:s="",label:o,options:a,originalValue:u,sync:l}=n,c=Tf(n,["value","path","label","options","originalValue","sync"]);const{name:f,test:p,params:d,message:h}=e;let{parent:g,context:m}=a;function w(F){return it.isRef(F)?F.getValue(i,g,m):F}function _(F={}){const j=Es.default(wn({value:i,originalValue:u,label:o,path:F.path||s},d,F.params),w),x=new Te(Te.formatError(F.message||h,j),i,j.path,F.type||f);return x.params=j,x}let C=wn({path:s,parent:g,type:f,createError:_,resolve:w,options:a,originalValue:u},c);if(!l){try{Promise.resolve(p.call(C,i,C)).then(F=>{Te.isError(F)?r(F):F?r(null,F):r(_())})}catch(F){r(F)}return}let T;try{var R;if(T=p.call(C,i,C),typeof((R=T)==null?void 0:R.then)=="function")throw new Error(`Validation test of type: "${C.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(F){r(F);return}Te.isError(T)?r(T):T?r(null,T):r(_())}return t.OPTIONS=e,t}let Cf=e=>e.substr(0,e.length-1).substr(1);function Rf(e,t,n,r=n){let i,s,o;return t?(Gn.forEach(t,(a,u,l)=>{let c=u?Cf(a):a;if(e=e.resolve({context:r,parent:i,value:n}),e.innerType){let f=l?parseInt(c,10):0;if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[f],e=e.innerType}if(!l){if(!e.fields||!e.fields[c])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[c],e=e.fields[c]}s=c,o=u?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class bn{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const t=[];for(const n of this.list)t.push(n);for(const[,n]of this.refs)t.push(n.describe());return t}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(t){it.isRef(t)?this.refs.set(t.key,t):this.list.add(t)}delete(t){it.isRef(t)?this.refs.delete(t.key):this.list.delete(t)}has(t,n){if(this.list.has(t))return!0;let r,i=this.refs.values();for(;r=i.next(),!r.done;)if(n(r.value)===t)return!0;return!1}clone(){const t=new bn;return t.list=new Set(this.list),t.refs=new Map(this.refs),t}merge(t,n){const r=this.clone();return t.list.forEach(i=>r.add(i)),t.refs.forEach(i=>r.add(i)),n.list.forEach(i=>r.delete(i)),n.refs.forEach(i=>r.delete(i)),r}}function Se(){return Se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Se.apply(this,arguments)}class me{constructor(t){this.deps=[],this.conditions=[],this._whitelist=new bn,this._blacklist=new bn,this.exclusiveTests=Object.create(null),this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Ve.notType)}),this.type=t?.type||"mixed",this.spec=Se({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},t?.spec)}get _type(){return this.type}_typeCheck(t){return!0}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeError=this._typeError,n._whitelistError=this._whitelistError,n._blacklistError=this._blacklistError,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.exclusiveTests=Se({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Nr(Se({},this.spec,t)),n}label(t){var n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Se({},n.spec,r.spec);return r.spec=i,r._typeError||(r._typeError=n._typeError),r._whitelistError||(r._whitelistError=n._whitelistError),r._blacklistError||(r._blacklistError=n._blacklistError),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r}isType(t){return this.spec.nullable&&t===null?!0:this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}cast(t,n={}){let r=this.resolve(Se({value:t},n)),i=r._cast(t,n);if(t!==void 0&&n.assert!==!1&&r.isType(i)!==!0){let s=St(t),o=St(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r._type}".
1
+ "use strict";const Wr=require("zod"),H=require("lodash"),A=require("lodash/fp"),Zu=require("crypto"),Ju=require("child_process"),ec=require("lodash/has"),tc=require("lodash/mapValues"),nc=require("lodash/snakeCase"),rc=require("lodash/camelCase"),ic=require("lodash/mapKeys"),oc=require("os"),sc=require("path"),ac=require("fs"),uc=require("assert"),cc=require("events"),lc=require("buffer"),fc=require("stream"),pc=require("util"),dc=require("constants");require("node:stream");const hc=require("@sindresorhus/slugify"),mc=require("pluralize"),ae=e=>e&&e.__esModule?e:{default:e};function gc(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=gc(Wr),fe=ae(H),Hi=ae(Zu),mn=ae(Ju),gn=ae(ec),Es=ae(tc),Ui=ae(nc),yc=ae(rc),vc=ae(ic),Bn=ae(oc),Ee=ae(sc),Ye=ae(ac),ws=ae(uc),Ec=ae(cc),wc=ae(lc),Hn=ae(fc),ut=ae(pc),bc=ae(dc),_c=ae(hc),Gi=ae(mc),Yr=y.object({name:y.string().refine(e=>!e.includes(" "),{message:"No space allowed"}),label:y.string(),required:y.boolean().optional(),enabled:y.boolean().optional()}),xc=Yr.extend({type:y.literal("select"),multi:y.boolean(),options:y.array(y.string())}),Sc=Yr.extend({type:y.enum(["boolean","string"]),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),Ac=Yr.extend({type:y.literal("media"),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),Tc=y.union([Sc,Ac,xc]),Cc=y.union([y.literal("audience"),Tc]),De=y.object({additionalFields:y.array(Cc),allowedLevels:y.number(),contentTypes:y.array(y.string()),contentTypesNameFields:y.record(y.string(),y.array(y.string())),contentTypesPopulate:y.record(y.string(),y.array(y.string())),gql:y.object({navigationItemRelated:y.array(y.string())}),pathDefaultFields:y.record(y.string(),y.any()),cascadeMenuAttached:y.boolean(),preferCustomContentTypes:y.boolean(),isCacheEnabled:y.boolean().optional()}),Rc=y.enum(["collectionType","singleType"]),$c=y.object({singularName:y.string(),pluralName:y.string(),displayName:y.string(),description:y.string().optional(),name:y.string().optional()}),bs=y.object({required:y.boolean().optional(),max:y.number().optional(),min:y.number().optional(),minLength:y.number().optional(),maxLength:y.number().optional(),private:y.boolean().optional(),configurable:y.boolean().optional(),default:y.any().optional()}),Fc=y.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),Ic=bs.extend({type:Fc}),Oc=bs.extend({type:y.literal("enumeration"),enum:y.string().array()}),Nc=y.object({type:y.literal("component"),component:y.string(),repeatable:y.boolean().optional()}),Pc=y.object({type:y.literal("dynamiczone"),components:y.string().array()}),Lc=y.object({type:y.literal("uid")}),Dc=y.object({type:y.literal("media"),allowedTypes:y.enum(["images","videos","audios","files"]).array(),required:y.boolean().optional()}),kc=y.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),Mc=y.object({type:y.literal("relation"),relation:kc,target:y.string(),mappedBy:y.string().optional(),inversedBy:y.string().optional()}),jc=y.record(y.string(),y.union([Ic,Oc,Nc,Pc,Mc,Dc,Lc])),Rr=y.object({kind:Rc,collectionName:y.string(),info:$c,options:y.object({draftAndPublish:y.boolean().optional(),hidden:y.boolean().optional(),templateName:y.string().optional()}).optional(),attributes:jc,actions:y.record(y.string(),y.any()).optional(),lifecycles:y.record(y.string(),y.any()).optional(),uid:y.string(),apiName:y.string().optional(),associations:y.object({model:y.string(),alias:y.string()}).array().optional(),modelName:y.string().optional(),plugin:y.string().optional(),pluginOptions:y.record(y.string(),y.any()).optional(),isSingle:y.boolean().optional()});Rr.pick({info:!0,kind:!0,attributes:!0,options:!0});const _s=y.object({id:y.number(),documentId:y.string(),name:y.string(),key:y.string()}),Bc=y.enum(["INTERNAL","EXTERNAL","WRAPPER"]),Vr=y.object({id:y.number(),documentId:y.string(),title:y.string(),type:Bc,path:y.string().or(y.null()).optional(),slug:y.string().or(y.null()).optional(),externalPath:y.string().or(y.null()).optional(),uiRouterKey:y.string(),menuAttached:y.boolean(),order:y.number().int(),collapsed:y.boolean(),related:y.object({documentId:y.string().optional(),__type:y.string()}).catchall(y.unknown()).nullish(),additionalFields:y.record(y.string(),y.unknown()).or(y.null()).optional(),audience:y.array(_s).or(y.null()).optional(),autoSync:y.boolean().or(y.null()).optional()}),Hc=Vr.omit({related:!0}).pick({path:!0,type:!0,uiRouterKey:!0,title:!0,externalPath:!0}).extend({related:y.unknown()}),Ht=Vr.extend({parent:y.lazy(()=>Ht.or(y.null())).optional(),items:y.lazy(()=>Ht.array()).optional(),master:y.lazy(()=>et(!1)).optional()}),qi=y.array(Ht),et=e=>y.object({id:y.number(),documentId:y.string(),name:y.string(),slug:y.string(),locale:y.string(),visible:y.boolean(),items:e?y.array(Ht):Ht.array().optional()}),Uc=et(!1).omit({items:!0,id:!0,documentId:!0,slug:!0,locale:!0}).extend({documentId:y.string().optional(),id:y.undefined().optional()}),Gc=Vr.omit({id:!0,documentId:!0}).extend({id:y.number().optional(),documentId:y.string().optional(),items:y.lazy(()=>xs).or(y.null()).optional(),updated:y.boolean().optional(),removed:y.boolean().optional()}),xs=y.array(Gc),qc=et(!1).extend({items:xs}).partial().required({id:!0,documentId:!0}),zc=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,Kc=["beforeCreate","beforeCreateMany","afterCreate","afterCreateMany","beforeUpdate","beforeUpdateMany","afterUpdate","afterUpdateMany","beforeDelete","beforeDeleteMany","afterDelete","afterDeleteMany","beforeCount","afterCount","beforeFindOne","afterFindOne","beforeFindMany","afterFindMany"],Wc="$",Ss=["api::","plugin::"],As=["admin::","plugin::content-releases","plugin::i18n.locale","plugin::navigation","plugin::review-workflows","plugin::users-permissions","plugin::upload.folder"],Yc=["title","subject","name"],zi={SINGLE:"singleType"},Ki=["title","type","path","externalPath","uiRouterKey","menuAttached","order","collapsed","related","parent","master","audience","additionalFields"],Vc=e=>e.filter(t=>t!=="audience"),Ts=e=>{const t=Vc(e);if(t.length!==H.uniqBy(t,"name").length)throw new Error("All names of custom fields must be unique.");if(!H.isNil(H.find(t,n=>typeof n=="object"&&H.includes(Ki,n.name))))throw new Error(`Name of custom field cannot be one of: ${Ki.join(", ")}`)},Cs=(e,t)=>{if(e==null)throw t??new Error("Non-empty value expected, empty given")},Qc=(e="")=>{const t=s=>s.split("-").map(o=>H.capitalize(o)).join(""),[n,r,i]=Xc(e);return n==="api"?t(i):`${t(r)}${t(i)}`},Xc=(e="")=>e.split(zc).filter(t=>t&&t.length>0),Zc=(e,t)=>n=>[n,async r=>{await oe(t,"common").runLifeCycleHook({contentTypeName:e,hookName:n,event:r})}],Rs=(e,t)=>Object.fromEntries(Kc.map(Zc(e,t))),be=({strapi:e})=>{const t=e.plugin("navigation");return{masterModel:t.contentType("navigation"),itemModel:t.contentType("navigation-item"),relatedModel:t.contentType("navigations-items-related"),audienceModel:t.contentType("audience")}};function oe({strapi:e},t){return e.plugin("navigation").service(t)}const Zt=e=>e==="*"?"*":typeof e=="string"?[e]:e===!1?[]:e===!0?"*":e,Jc=(e="")=>{const t=!!Ss.find(r=>e.includes(r)),n=!As.find(r=>e.includes(r)||e===r);return!!e&&t&&n},Wi=(e="")=>H.last(e)==="s"?e.substr(0,e.length-1):e,$s=async({strapi:e})=>{const t=e.store({type:"plugin",name:"navigation"}),n=await e.plugin("navigation").config,r={...$r.default,...await t.get({key:"config"})??$r.default};let i=De.parse(r);const s=el(i,n);return i={additionalFields:s("additionalFields"),contentTypes:s("contentTypes"),contentTypesNameFields:s("contentTypesNameFields"),contentTypesPopulate:s("contentTypesPopulate"),allowedLevels:s("allowedLevels"),gql:s("gql"),pathDefaultFields:s("pathDefaultFields"),cascadeMenuAttached:s("cascadeMenuAttached"),preferCustomContentTypes:s("preferCustomContentTypes"),isCacheEnabled:s("isCacheEnabled")},tl(i,{strapi:e}),Ts(i.additionalFields),await t.set({key:"config",value:i}),i},el=(e,t)=>n=>{const r=e?.[n]??t(n);return Cs(r,new Error(`[Navigation] Config "${n}" is undefined`)),r},tl=(e,{strapi:t})=>{const n=e.contentTypes.filter(i=>!t.contentTypes[i]);if(n.length===0)return;const r=n.map(Qc);e.contentTypes=e.contentTypes.filter(i=>!n.includes(i)),e.contentTypesNameFields=Object.fromEntries(Object.entries(e.contentTypesNameFields).filter(([i])=>!n.includes(i))),e.gql.navigationItemRelated=e.gql.navigationItemRelated.filter(i=>!r.includes(i))},$r={default:{additionalFields:[],allowedLevels:2,contentTypes:[],contentTypesNameFields:{},contentTypesPopulate:{},gql:{navigationItemRelated:[]},i18nEnabled:!1,pathDefaultFields:{},pruneObsoleteI18nNavigations:!1,cascadeMenuAttached:!0,preferCustomContentTypes:!1,isCacheEnabled:!1}},nl=H.once(e=>({find(t,n){const{audienceModel:{uid:r}}=be(e);return e.strapi.query(r).findMany({where:t,limit:n}).then(_s.array().parse)}})),yn=(e,t)=>({findFirst(n,r,i={}){return e.strapi.documents(t).findFirst({populate:Zt(n),status:r,...i})},findById(n,r,i,s={}){return e.strapi.documents(t).findOne({documentId:n,populate:Zt(r),status:i,...s})},findManyById(n,r,i){return e.strapi.documents(t).findMany({where:{documentId:{$in:n}},populate:Zt(r),status:i})},findMany(n,r,i,s){return e.strapi.documents(t).findMany({where:n,populate:Zt(r),status:i,locale:s})},count(n,r){return e.strapi.documents(t).count({where:n,status:r})}}),Pe=H.once(e=>({async save({item:t,locale:n}){const{itemModel:r}=be(e),{__type:i,documentId:s}=t?.related??{},o=i?yn(e,i):void 0,a=i&&o?s?await o.findById(s,void 0,void 0,{locale:n}):await o.findFirst(void 0,void 0,{locale:n}):void 0;if(typeof t.documentId=="string"){const{documentId:u,...f}=t;return e.strapi.documents(r.uid).update({documentId:t.documentId,data:{...f,related:a?{...a,__type:i}:void 0},locale:n})}else return e.strapi.documents(r.uid).create({data:{...t,related:a?{...a,__type:i}:void 0},locale:n})},find({filters:t,locale:n,limit:r,order:i,populate:s}){const{itemModel:o}=be(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:s,orderBy:i}).then(a=>a.map(Fr)).then(qi.parse).then(a=>a.map(vn))},count(t){const{itemModel:n}=be(e);return e.strapi.query(n.uid).count({where:t})},remove(t){const{itemModel:n}=be(e);return e.strapi.query(n.uid).delete({where:{documentId:t.documentId}})},removeForIds(t){const{itemModel:n}=be(e);return e.strapi.query(n.uid).deleteMany({where:{documentId:t}})},findForMasterIds(t){const{itemModel:n}=be(e);return e.strapi.query(n.uid).findMany({where:{$or:t.map(r=>({master:r}))},limit:Number.MAX_SAFE_INTEGER}).then(qi.parse)}})),rl=["id","publishedAt","createdAt","updatedAt","locale"],vn=({related:e,items:t=[],...n})=>({...n,items:t.map(vn),related:e?H.omit(e,rl):void 0}),Fr=({related:e,...t})=>({...t,related:e?.[0]});class At extends Error{constructor(t,n){super(t),this.additionalInfo=n,this.type="NavigationError"}}class sr extends At{constructor(){super(...arguments),this.type="FillNavigationError"}}class il extends At{constructor(){super(...arguments),this.type="InvalidParamNavigationError"}}const Yi=e=>e===!0?!0:Array.isArray(e)?e.includes("items"):!1,Ne=H.once(e=>({find({filters:t,locale:n,limit:r,orderBy:i,populate:s}){const{masterModel:o}=be(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:s,orderBy:i}).then(a=>a.map(({items:u,...f})=>({...f,items:u?.map(Fr)}))).then(a=>a.map(({items:u,...f})=>({...f,items:u?.map(vn)}))).then(a=>et(Yi(s)).array().parse(a))},findOne({locale:t,filters:n,populate:r}){const{masterModel:i}=be(e);return e.strapi.documents(i.uid).findOne({documentId:n.documentId,locale:t,populate:r}).then(s=>s&&{...s,items:s.items?.map(Fr)}).then(s=>et(Yi(r)).parse(s)).then(s=>({...s,items:s.items?.map(vn)}))},async save(t){const{masterModel:n}=be(e),{documentId:r,locale:i,...s}=t;return r?e.strapi.documents(n.uid).update({locale:i,documentId:r,data:H.omit(s,["id","documentId"]),populate:["items"]}).then(et(!1).parse):e.strapi.documents(n.uid).create({locale:i,data:{...s,populate:["items"]}}).then(et(!1).parse)},remove(t){const{masterModel:n}=be(e);if(!t.documentId&&!t.id)throw new At("Some kind of id required. None given.");return e.strapi.query(n.uid).deleteMany({where:t})}})),ol="Navigation",sl="navigation",al=async e=>{const t=oe(e,"common"),{defaultLocale:n,restLocale:r=[]}=await t.readLocale(),i=Ne(e),s=await i.find({limit:Number.MAX_SAFE_INTEGER,filters:{},locale:"*"});s.length===0&&s.push(await i.save({name:ol,visible:!0,locale:n,slug:sl}));const o=s.filter(({locale:a})=>a===n);for(const a of o)for(const u of r)!s.find(({locale:c,documentId:l})=>l===a.documentId&&u===c)&&await i.save({documentId:a.documentId,name:a.name,locale:u,visible:a.visible,slug:a.slug})},he={render:function(e){return`plugin::navigation.${e}`},navigation:{read:"read",update:"update",settings:"settings"}},ul=async({strapi:e})=>{const t=[{section:"plugins",displayName:"Read",uid:he.navigation.read,pluginName:"navigation"},{section:"plugins",displayName:"Update",uid:he.navigation.update,pluginName:"navigation"},{section:"plugins",displayName:"Settings",uid:he.navigation.settings,pluginName:"navigation"}];await e.admin.services.permission.actionProvider.registerMany(t)},cl=({nexus:e})=>e.objectType({name:"ContentTypes",definition(t){t.nonNull.string("uid"),t.nonNull.string("name"),t.nonNull.boolean("isSingle"),t.nonNull.string("collectionName"),t.nonNull.string("contentTypeName"),t.nonNull.string("label"),t.nonNull.string("relatedField"),t.nonNull.string("labelSingular"),t.nonNull.string("endpoint"),t.nonNull.boolean("available"),t.nonNull.boolean("visible")}}),ll=({nexus:e,strapi:t})=>e.objectType({name:"ContentTypesNameFields",async definition(n){n.nonNull.list.nonNull.string("default");const i=await oe({strapi:t},"common").getPluginStore(),o=De.parse(await i.get({key:"config"})).contentTypesNameFields;Object.keys(o||{}).forEach(a=>n.nonNull.list.string(a))}}),fl=({nexus:e})=>e.inputObjectType({name:"CreateNavigation",definition(t){t.nonNull.string("name"),t.nonNull.list.field("items",{type:"CreateNavigationItem"})}}),pl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationItem",definition(t){t.nonNull.string("title"),t.nonNull.field("type",{type:"NavigationItemType"}),t.string("path"),t.string("externalPath"),t.nonNull.string("uiRouterKey"),t.nonNull.boolean("menuAttached"),t.nonNull.int("order"),t.string("parent"),t.string("master"),t.list.field("items",{type:"CreateNavigationItem"}),t.list.string("audience"),t.field("related",{type:"CreateNavigationRelated"})}}),dl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationRelated",definition(t){t.nonNull.string("ref"),t.nonNull.string("field"),t.nonNull.string("refId")}}),hl=({nexus:e})=>e.objectType({name:"Navigation",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible")}}),ml=({nexus:e})=>e.objectType({name:"NavigationConfig",definition(t){t.int("allowedLevels"),t.nonNull.list.string("additionalFields"),t.field("contentTypesNameFields",{type:"ContentTypesNameFields"}),t.list.field("contentTypes",{type:"ContentTypes"})}}),gl=({nexus:e})=>e.objectType({name:"NavigationDetails",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible"),t.nonNull.list.field("items",{type:"NavigationItem"})}}),yl=({nexus:e,config:t})=>e.objectType({name:"NavigationItem",definition(n){n.nonNull.int("id"),n.nonNull.string("documentId"),n.nonNull.string("title"),n.nonNull.field("type",{type:"NavigationItemType"}),n.string("path"),n.string("externalPath"),n.nonNull.string("uiRouterKey"),n.nonNull.boolean("menuAttached"),n.nonNull.int("order"),n.field("parent",{type:"NavigationItem"}),n.string("master"),n.list.field("items",{type:"NavigationItem"}),n.field("related",{type:"NavigationItemRelated"}),t.additionalFields.find(r=>r==="audience")&&n.list.string("audience"),n.field("additionalFields",{type:"NavigationItemAdditionalFields"}),n.string("created_at"),n.string("updated_at"),n.string("created_by"),n.string("updated_by"),n.string("createdAt"),n.string("updatedAt"),n.string("createdBy"),n.string("updatedBy")}}),vl=({nexus:e,config:t})=>e.objectType({name:"NavigationItemAdditionalFields",definition(n){t.additionalFields.forEach(r=>{if(r!=="audience"&&r.enabled)switch(r.type){case"media":n.field(r.name,{type:"NavigationItemAdditionalFieldMedia"});break;case"string":n.string(r.name);break;case"boolean":n.boolean(r.name);break;case"select":r.multi?n.list.string(r.name):n.string(r.name);break;default:throw new Error(`Type "${JSON.stringify(r.type)}" is unsupported by custom fields`)}})}}),El=({nexus:e})=>e.objectType({name:"NavigationItemAdditionalFieldMedia",definition(t){t.nonNull.string("name"),t.nonNull.string("url"),t.nonNull.string("mime"),t.nonNull.int("width"),t.nonNull.int("height"),t.string("previewUrl")}}),wl=({strapi:e,nexus:t,config:n})=>{const r=n.gql?.navigationItemRelated,i="NavigationItemRelated";return r?.length?t.unionType({name:i,definition(s){s.members(...r)},resolveType:s=>e.contentTypes[s.__type]?.globalId}):t.objectType({name:i,definition(s){s.int("id"),s.string("documentId"),s.string("title"),s.string("name")}})},bl=({nexus:e})=>e.enumType({name:"NavigationItemType",members:["INTERNAL","EXTERNAL","WRAPPER"]}),_l=({nexus:e})=>e.enumType({name:"NavigationRenderType",members:["FLAT","TREE"]}),xl=[El,vl,wl,yl,_l,hl,gl,ll,cl,ml,dl,pl,fl,bl],Sl=e=>xl.map(t=>t(e)),Al="I18NLocaleCode",Tl=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:s}=t;return{args:{navigationIdOrSlug:n(i()),type:"NavigationRenderType",menuOnly:s(),path:i(),locale:t.arg({type:Al})},type:n(r("NavigationItem")),resolve(u,{navigationIdOrSlug:f,type:c,menuOnly:l,path:p,locale:d}){const h=Wr.z.string().parse(f);return oe({strapi:e},"client").render({idOrSlug:h,type:c,rootPath:p,locale:d,menuOnly:l,wrapRelated:!0})}}},Cl=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:s}=t;return{type:n(r("NavigationItem")),args:{documentId:n(i()),childUiKey:n(i()),type:"NavigationRenderType",menuOnly:s()},resolve(o,a){const{documentId:u,childUIKey:f,type:c,menuOnly:l}=a,p=Wr.z.string().parse(u);return oe({strapi:e},"client").renderChildren({idOrSlug:p,childUIKey:f,type:c,menuOnly:l,wrapRelated:!0})}}},Rl=e=>{const t={renderNavigationChild:Cl,renderNavigation:Tl};return e.nexus.extendType({type:"Query",definition(n){for(const[r,i]of Object.entries(t)){const s=i(e);n.field(r,s)}}})},$l=()=>({"Query.renderNavigationChild":{auth:!1},"Query.renderNavigation":{auth:!1}}),Fl=async({strapi:e})=>{const t=e.plugin("graphql").service("extension");t.shadowCRUD("plugin::navigation.audience").disable(),t.shadowCRUD("plugin::navigation.navigation").disable(),t.shadowCRUD("plugin::navigation.navigation-item").disable(),t.shadowCRUD("plugin::navigation.navigations-items-related").disable();const r=await oe({strapi:e},"common").getPluginStore(),i=De.parse(await r.get({key:"config"}));t.use(({strapi:s,nexus:o})=>{const a=Sl({strapi:s,nexus:o,config:i}),u=Rl({strapi:s,nexus:o}),f=$l();return{types:[a,u],resolversConfig:f}})},Il=async({strapi:e})=>{!!e.plugin("graphql")&&await Fl({strapi:e})},Ol=async e=>{await $s(e),await al(e),await ul(e),await Il(e)},Nl=({strapi:e})=>{},Pl=({strapi:e})=>{},Ll={collectionName:"audience",info:{singularName:"audience",pluralName:"audiences",displayName:"Audience",name:"audience"},options:{increments:!0,comment:"Audience"},attributes:{name:{type:"string",required:!0},key:{type:"uid",targetField:"name"}}},Dl={schema:Ll},kl=Rs("navigation",{strapi}),Ml={collectionName:"navigations",info:{singularName:"navigation",pluralName:"navigations",displayName:"Navigation",name:"navigation"},options:{comment:""},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!0}},attributes:{name:{type:"text",configurable:!1,required:!0},slug:{type:"uid",target:"name",configurable:!1,required:!0},visible:{type:"boolean",default:!1,configurable:!1},items:{type:"relation",relation:"oneToMany",target:"plugin::navigation.navigation-item",configurable:!1,mappedBy:"master"}}},jl={schema:Ml,lifecycles:kl},Bl=Rs("navigation-item",{strapi}),Hl={collectionName:"navigations_items",info:{singularName:"navigation-item",pluralName:"navigation-items",displayName:"Navigation Item",name:"navigation-item"},options:{increments:!0,timestamps:!0,comment:"Navigation Item"},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!1}},attributes:{title:{type:"text",configurable:!1,required:!0,pluginOptions:{i18n:{localized:!1}}},type:{type:"enumeration",enum:["INTERNAL","EXTERNAL","WRAPPER"],default:"INTERNAL",configurable:!1},path:{type:"text",targetField:"title",configurable:!1},externalPath:{type:"text",configurable:!1},uiRouterKey:{type:"string",configurable:!1},menuAttached:{type:"boolean",default:!1,configurable:!1},order:{type:"integer",default:0,configurable:!1},collapsed:{type:"boolean",default:!1,configurable:!1},autoSync:{type:"boolean",default:!0,configurable:!1},related:{type:"relation",relation:"morphToMany",required:!0,configurable:!1},parent:{type:"relation",relation:"oneToOne",target:"plugin::navigation.navigation-item",configurable:!1,default:null},master:{type:"relation",relation:"manyToOne",target:"plugin::navigation.navigation",configurable:!1,inversedBy:"items"},audience:{type:"relation",relation:"oneToMany",target:"plugin::navigation.audience"},additionalFields:{type:"json",require:!1,default:{}}}},Ul={schema:Hl,lifecycles:Bl},Gl={audience:Dl,navigation:jl,"navigation-item":Ul},Fs=y.enum(["true","false"]),Jt=y.string(),ql=y.object({locale:y.string().optional(),orderBy:y.string().optional(),orderDirection:y.enum(["DESC","ASC"]).optional()}),Is=y.enum(["FLAT","TREE","RFR"]),Os=y.union([y.boolean(),y.string(),y.string().array(),y.undefined()]),zl=y.object({type:Is.optional(),menu:Fs.optional(),path:y.string().optional(),locale:y.string().optional(),populate:Os.optional()}),Kl=y.object({type:Is.optional(),menu:Fs.optional(),locale:y.string().optional()}),Wl=y.object({source:y.string().min(1),target:y.string().min(1),documentId:y.string().min(1)});function Yl(e){return{getAdminService(){return oe(e,"admin")},getCommonService(){return oe(e,"common")},async get(){return await this.getAdminService().get({})},post(t){const{auditLog:n}=t;return this.getAdminService().post({payload:Uc.parse(t.request.body),auditLog:n})},put(t){const{params:{documentId:n},auditLog:r}=t,i=y.record(y.string(),y.unknown()).parse(t.request.body);return this.getAdminService().put({auditLog:r,payload:qc.parse({...i,documentId:n})})},async delete(t){const{auditLog:n,params:{documentId:r}}=t;return await this.getAdminService().delete({documentId:Jt.parse(r),auditLog:n}),{}},config(){return this.getAdminService().config({viaSettingsPage:!1})},async updateConfig(t){return await this.getAdminService().updateConfig({config:De.parse(t.request.body)}),{}},async restoreConfig(){return await this.getAdminService().restoreConfig(),{}},settingsConfig(){return this.getAdminService().config({viaSettingsPage:!0})},async settingsRestart(){return await this.getAdminService().restart(),{}},getById(t){const{params:{documentId:n}}=t;return this.getAdminService().getById({documentId:Jt.parse(n)})},getContentTypeItems(t){const{params:{model:n},query:r={}}=t;return this.getAdminService().getContentTypeItems({query:y.record(y.string(),y.unknown()).parse(r),uid:y.string().parse(n)})},async fillFromOtherLocale(t){const{params:n,auditLog:r}=t,{source:i,target:s,documentId:o}=Wl.parse(n);return await this.getAdminService().fillFromOtherLocale({source:i,target:s,documentId:o,auditLog:r})},readNavigationItemFromLocale(t){const{params:{source:n,target:r},query:{path:i}}=t;return this.getAdminService().readNavigationItemFromLocale({path:y.string().parse(i),source:Jt.parse(n),target:Jt.parse(r)})},getSlug(t){const{query:{q:n}}=t;return this.getCommonService().getSlug({query:y.string().parse(n)}).then(r=>({slug:r}))},settingsLocale(){return this.getCommonService().readLocale()}}}const Vl=e=>{if(!(!e||e===!0||e==="*")&&typeof e!="object")return Array.isArray(e),e};function Ql(e){return{getService(){return oe(e,"client")},async readAll(t){try{const{query:n={}}=t,{locale:r,orderBy:i,orderDirection:s}=ql.parse(n);return await this.getService().readAll({locale:r,orderBy:i,orderDirection:s})}catch(n){if(n instanceof Error)return t.badRequest(n.message);throw n}},async render(t){const{params:n,query:r={}}=t,{type:i,menu:s,path:o,locale:a,populate:u}=zl.parse(r),f=y.string().parse(n.idOrSlug);return await this.getService().render({idOrSlug:f,type:i,menuOnly:s==="true",rootPath:o,locale:a,populate:Vl(Os.parse(u==="true"?!0:u==="false"?!1:Array.isArray(u)?u.map(c=>c==="true"?!0:c==="false"?!1:u):u))})},async renderChild(t){const{params:n,query:r={}}=t,{type:i,menu:s,locale:o}=Kl.parse(r),a=y.string().parse(n.documentId),u=y.string().parse(n.childUIKey);return await this.getService().renderChildren({idOrSlug:a,childUIKey:u,type:i,menuOnly:s==="true",locale:o})}}}const Xl={admin:Yl,client:Ql},Zl={},Jl={},ef={type:"admin",routes:[{method:"GET",path:"/",handler:"admin.get",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"POST",path:"/",handler:"admin.post",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/config",handler:"admin.config",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/config",handler:"admin.updateConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"DELETE",path:"/config",handler:"admin.restoreConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"GET",path:"/slug",handler:"admin.getSlug",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/:documentId",handler:"admin.getById",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/:documentId",handler:"admin.put",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"DELETE",path:"/:documentId",handler:"admin.delete",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/content-type-items/:model",handler:"admin.getContentTypeItems",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/locale",handler:"admin.settingsLocale",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/config",handler:"admin.settingsConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"GET",path:"/settings/restart",handler:"admin.settingsRestart",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"PUT",path:"/i18n/copy/:documentId/:source/:target",handler:"admin.fillFromOtherLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/i18n/item/read/:source/:target",handler:"admin.readNavigationItemFromLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}}]},tf={type:"content-api",routes:[{method:"GET",path:"/render/:idOrSlug",handler:"client.render",config:{policies:[]}},{method:"GET",path:"/render/:idOrSlug/:childUIKey",handler:"client.renderChild",config:{policies:[]}},{method:"GET",path:"/",handler:"client.readAll",config:{policies:[]}}]},nf={admin:ef,"content-api":tf};var ye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ns(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rf={exports:{}};(function(e,t){(function(n,r){e.exports=r(mn.default,Hi.default)})(ye,function(n,r){return function(i){function s(a){if(o[a])return o[a].exports;var u=o[a]={exports:{},id:a,loaded:!1};return i[a].call(u.exports,u,u.exports,s),u.loaded=!0,u.exports}var o={};return s.m=i,s.c=o,s.p="",s(0)}([function(i,s,o){i.exports=o(34)},function(i,s,o){var a=o(29)("wks"),u=o(33),f=o(2).Symbol,c=typeof f=="function",l=i.exports=function(p){return a[p]||(a[p]=c&&f[p]||(c?f:u)("Symbol."+p))};l.store=a},function(i,s){var o=i.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=o)},function(i,s,o){var a=o(9);i.exports=function(u){if(!a(u))throw TypeError(u+" is not an object!");return u}},function(i,s,o){i.exports=!o(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(i,s,o){var a=o(12),u=o(17);i.exports=o(4)?function(f,c,l){return a.f(f,c,u(1,l))}:function(f,c,l){return f[c]=l,f}},function(i,s){var o=i.exports={version:"2.4.0"};typeof __e=="number"&&(__e=o)},function(i,s,o){var a=o(14);i.exports=function(u,f,c){if(a(u),f===void 0)return u;switch(c){case 1:return function(l){return u.call(f,l)};case 2:return function(l,p){return u.call(f,l,p)};case 3:return function(l,p,d){return u.call(f,l,p,d)}}return function(){return u.apply(f,arguments)}}},function(i,s){var o={}.hasOwnProperty;i.exports=function(a,u){return o.call(a,u)}},function(i,s){i.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},function(i,s){i.exports={}},function(i,s){var o={}.toString;i.exports=function(a){return o.call(a).slice(8,-1)}},function(i,s,o){var a=o(3),u=o(26),f=o(32),c=Object.defineProperty;s.f=o(4)?Object.defineProperty:function(l,p,d){if(a(l),p=f(p,!0),a(d),u)try{return c(l,p,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(l[p]=d.value),l}},function(i,s,o){var a=o(42),u=o(15);i.exports=function(f){return a(u(f))}},function(i,s){i.exports=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o}},function(i,s){i.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},function(i,s,o){var a=o(9),u=o(2).document,f=a(u)&&a(u.createElement);i.exports=function(c){return f?u.createElement(c):{}}},function(i,s){i.exports=function(o,a){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:a}}},function(i,s,o){var a=o(12).f,u=o(8),f=o(1)("toStringTag");i.exports=function(c,l,p){c&&!u(c=p?c:c.prototype,f)&&a(c,f,{configurable:!0,value:l})}},function(i,s,o){var a=o(29)("keys"),u=o(33);i.exports=function(f){return a[f]||(a[f]=u(f))}},function(i,s){var o=Math.ceil,a=Math.floor;i.exports=function(u){return isNaN(u=+u)?0:(u>0?a:o)(u)}},function(i,s,o){var a=o(11),u=o(1)("toStringTag"),f=a(function(){return arguments}())=="Arguments",c=function(l,p){try{return l[p]}catch{}};i.exports=function(l){var p,d,h;return l===void 0?"Undefined":l===null?"Null":typeof(d=c(p=Object(l),u))=="string"?d:f?a(p):(h=a(p))=="Object"&&typeof p.callee=="function"?"Arguments":h}},function(i,s){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(i,s,o){var a=o(2),u=o(6),f=o(7),c=o(5),l="prototype",p=function(d,h,m){var g,w,_,C=d&p.F,T=d&p.G,R=d&p.S,F=d&p.P,j=d&p.B,x=d&p.W,S=T?u:u[h]||(u[h]={}),N=S[l],v=T?a:R?a[h]:(a[h]||{})[l];T&&(m=h);for(g in m)w=!C&&v&&v[g]!==void 0,w&&g in S||(_=w?v[g]:m[g],S[g]=T&&typeof v[g]!="function"?m[g]:j&&w?f(_,a):x&&v[g]==_?function(M){var B=function(z,E,b){if(this instanceof M){switch(arguments.length){case 0:return new M;case 1:return new M(z);case 2:return new M(z,E)}return new M(z,E,b)}return M.apply(this,arguments)};return B[l]=M[l],B}(_):F&&typeof _=="function"?f(Function.call,_):_,F&&((S.virtual||(S.virtual={}))[g]=_,d&p.R&&N&&!N[g]&&c(N,g,_)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,i.exports=p},function(i,s){i.exports=function(o){try{return!!o()}catch{return!0}}},function(i,s,o){i.exports=o(2).document&&document.documentElement},function(i,s,o){i.exports=!o(4)&&!o(24)(function(){return Object.defineProperty(o(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(i,s,o){var a=o(28),u=o(23),f=o(57),c=o(5),l=o(8),p=o(10),d=o(45),h=o(18),m=o(52),g=o(1)("iterator"),w=!([].keys&&"next"in[].keys()),_="@@iterator",C="keys",T="values",R=function(){return this};i.exports=function(F,j,x,S,N,v,M){d(x,j,S);var B,z,E,b=function(k){if(!w&&k in K)return K[k];switch(k){case C:return function(){return new x(this,k)};case T:return function(){return new x(this,k)}}return function(){return new x(this,k)}},$=j+" Iterator",D=N==T,U=!1,K=F.prototype,V=K[g]||K[_]||N&&K[N],J=V||b(N),Se=N?D?b("entries"):J:void 0,I=j=="Array"&&K.entries||V;if(I&&(E=m(I.call(new F)),E!==Object.prototype&&(h(E,$,!0),a||l(E,g)||c(E,g,R))),D&&V&&V.name!==T&&(U=!0,J=function(){return V.call(this)}),a&&!M||!w&&!U&&K[g]||c(K,g,J),p[j]=J,p[$]=R,N)if(B={values:D?J:b(T),keys:v?J:b(C),entries:Se},M)for(z in B)z in K||f(K,z,B[z]);else u(u.P+u.F*(w||U),j,B);return B}},function(i,s){i.exports=!0},function(i,s,o){var a=o(2),u="__core-js_shared__",f=a[u]||(a[u]={});i.exports=function(c){return f[c]||(f[c]={})}},function(i,s,o){var a,u,f,c=o(7),l=o(41),p=o(25),d=o(16),h=o(2),m=h.process,g=h.setImmediate,w=h.clearImmediate,_=h.MessageChannel,C=0,T={},R="onreadystatechange",F=function(){var x=+this;if(T.hasOwnProperty(x)){var S=T[x];delete T[x],S()}},j=function(x){F.call(x.data)};g&&w||(g=function(x){for(var S=[],N=1;arguments.length>N;)S.push(arguments[N++]);return T[++C]=function(){l(typeof x=="function"?x:Function(x),S)},a(C),C},w=function(x){delete T[x]},o(11)(m)=="process"?a=function(x){m.nextTick(c(F,x,1))}:_?(u=new _,f=u.port2,u.port1.onmessage=j,a=c(f.postMessage,f,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(a=function(x){h.postMessage(x+"","*")},h.addEventListener("message",j,!1)):a=R in d("script")?function(x){p.appendChild(d("script"))[R]=function(){p.removeChild(this),F.call(x)}}:function(x){setTimeout(c(F,x,1),0)}),i.exports={set:g,clear:w}},function(i,s,o){var a=o(20),u=Math.min;i.exports=function(f){return f>0?u(a(f),9007199254740991):0}},function(i,s,o){var a=o(9);i.exports=function(u,f){if(!a(u))return u;var c,l;if(f&&typeof(c=u.toString)=="function"&&!a(l=c.call(u))||typeof(c=u.valueOf)=="function"&&!a(l=c.call(u))||!f&&typeof(c=u.toString)=="function"&&!a(l=c.call(u)))return l;throw TypeError("Can't convert object to primitive value")}},function(i,s){var o=0,a=Math.random();i.exports=function(u){return"Symbol(".concat(u===void 0?"":u,")_",(++o+a).toString(36))}},function(i,s,o){function a(R){return R&&R.__esModule?R:{default:R}}function u(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function f(R){return(0,g.createHash)("sha256").update(R).digest("hex")}function c(R){switch(_){case"darwin":return R.split("IOPlatformUUID")[1].split(`
2
+ `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return R.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return R.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return R.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(R){var F=c((0,m.execSync)(T[_]).toString());return R?F:f(F)}function p(R){return new h.default(function(F,j){return(0,m.exec)(T[_],{},function(x,S,N){if(x)return j(new Error("Error while obtaining machine id: "+x.stack));var v=c(S.toString());return F(R?v:f(v))})})}Object.defineProperty(s,"__esModule",{value:!0});var d=o(35),h=a(d);s.machineIdSync=l,s.machineId=p;var m=o(70),g=o(71),w=process,_=w.platform,C={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},T={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:C[u()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(i,s,o){i.exports={default:o(36),__esModule:!0}},function(i,s,o){o(66),o(68),o(69),o(67),i.exports=o(6).Promise},function(i,s){i.exports=function(){}},function(i,s){i.exports=function(o,a,u,f){if(!(o instanceof a)||f!==void 0&&f in o)throw TypeError(u+": incorrect invocation!");return o}},function(i,s,o){var a=o(13),u=o(31),f=o(62);i.exports=function(c){return function(l,p,d){var h,m=a(l),g=u(m.length),w=f(d,g);if(c&&p!=p){for(;g>w;)if(h=m[w++],h!=h)return!0}else for(;g>w;w++)if((c||w in m)&&m[w]===p)return c||w||0;return!c&&-1}}},function(i,m,o){var a=o(7),u=o(44),f=o(43),c=o(3),l=o(31),p=o(64),d={},h={},m=i.exports=function(g,w,_,C,T){var R,F,j,x,S=T?function(){return g}:p(g),N=a(_,C,w?2:1),v=0;if(typeof S!="function")throw TypeError(g+" is not iterable!");if(f(S)){for(R=l(g.length);R>v;v++)if(x=w?N(c(F=g[v])[0],F[1]):N(g[v]),x===d||x===h)return x}else for(j=S.call(g);!(F=j.next()).done;)if(x=u(j,N,F.value,w),x===d||x===h)return x};m.BREAK=d,m.RETURN=h},function(i,s){i.exports=function(o,a,u){var f=u===void 0;switch(a.length){case 0:return f?o():o.call(u);case 1:return f?o(a[0]):o.call(u,a[0]);case 2:return f?o(a[0],a[1]):o.call(u,a[0],a[1]);case 3:return f?o(a[0],a[1],a[2]):o.call(u,a[0],a[1],a[2]);case 4:return f?o(a[0],a[1],a[2],a[3]):o.call(u,a[0],a[1],a[2],a[3])}return o.apply(u,a)}},function(i,s,o){var a=o(11);i.exports=Object("z").propertyIsEnumerable(0)?Object:function(u){return a(u)=="String"?u.split(""):Object(u)}},function(i,s,o){var a=o(10),u=o(1)("iterator"),f=Array.prototype;i.exports=function(c){return c!==void 0&&(a.Array===c||f[u]===c)}},function(i,s,o){var a=o(3);i.exports=function(u,f,c,l){try{return l?f(a(c)[0],c[1]):f(c)}catch(d){var p=u.return;throw p!==void 0&&a(p.call(u)),d}}},function(i,s,o){var a=o(49),u=o(17),f=o(18),c={};o(5)(c,o(1)("iterator"),function(){return this}),i.exports=function(l,p,d){l.prototype=a(c,{next:u(1,d)}),f(l,p+" Iterator")}},function(i,s,o){var a=o(1)("iterator"),u=!1;try{var f=[7][a]();f.return=function(){u=!0},Array.from(f,function(){throw 2})}catch{}i.exports=function(c,l){if(!l&&!u)return!1;var p=!1;try{var d=[7],h=d[a]();h.next=function(){return{done:p=!0}},d[a]=function(){return h},c(d)}catch{}return p}},function(i,s){i.exports=function(o,a){return{value:a,done:!!o}}},function(i,s,o){var a=o(2),u=o(30).set,f=a.MutationObserver||a.WebKitMutationObserver,c=a.process,l=a.Promise,p=o(11)(c)=="process";i.exports=function(){var d,h,m,g=function(){var T,R;for(p&&(T=c.domain)&&T.exit();d;){R=d.fn,d=d.next;try{R()}catch(F){throw d?m():h=void 0,F}}h=void 0,T&&T.enter()};if(p)m=function(){c.nextTick(g)};else if(f){var w=!0,_=document.createTextNode("");new f(g).observe(_,{characterData:!0}),m=function(){_.data=w=!w}}else if(l&&l.resolve){var C=l.resolve();m=function(){C.then(g)}}else m=function(){u.call(a,g)};return function(T){var R={fn:T,next:void 0};h&&(h.next=R),d||(d=R,m()),h=R}}},function(i,s,o){var a=o(3),u=o(50),f=o(22),c=o(19)("IE_PROTO"),l=function(){},p="prototype",d=function(){var h,m=o(16)("iframe"),g=f.length,w=">";for(m.style.display="none",o(25).appendChild(m),m.src="javascript:",h=m.contentWindow.document,h.open(),h.write("<script>document.F=Object<\/script"+w),h.close(),d=h.F;g--;)delete d[p][f[g]];return d()};i.exports=Object.create||function(h,m){var g;return h!==null?(l[p]=a(h),g=new l,l[p]=null,g[c]=h):g=d(),m===void 0?g:u(g,m)}},function(i,s,o){var a=o(12),u=o(3),f=o(54);i.exports=o(4)?Object.defineProperties:function(c,l){u(c);for(var p,d=f(l),h=d.length,m=0;h>m;)a.f(c,p=d[m++],l[p]);return c}},function(i,s,o){var a=o(55),u=o(17),f=o(13),c=o(32),l=o(8),p=o(26),d=Object.getOwnPropertyDescriptor;s.f=o(4)?d:function(h,m){if(h=f(h),m=c(m,!0),p)try{return d(h,m)}catch{}if(l(h,m))return u(!a.f.call(h,m),h[m])}},function(i,s,o){var a=o(8),u=o(63),f=o(19)("IE_PROTO"),c=Object.prototype;i.exports=Object.getPrototypeOf||function(l){return l=u(l),a(l,f)?l[f]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(i,s,o){var a=o(8),u=o(13),f=o(39)(!1),c=o(19)("IE_PROTO");i.exports=function(l,p){var d,h=u(l),m=0,g=[];for(d in h)d!=c&&a(h,d)&&g.push(d);for(;p.length>m;)a(h,d=p[m++])&&(~f(g,d)||g.push(d));return g}},function(i,s,o){var a=o(53),u=o(22);i.exports=Object.keys||function(f){return a(f,u)}},function(i,s){s.f={}.propertyIsEnumerable},function(i,s,o){var a=o(5);i.exports=function(u,f,c){for(var l in f)c&&u[l]?u[l]=f[l]:a(u,l,f[l]);return u}},function(i,s,o){i.exports=o(5)},function(i,s,o){var a=o(9),u=o(3),f=function(c,l){if(u(c),!a(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};i.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(c,l,p){try{p=o(7)(Function.call,o(51).f(Object.prototype,"__proto__").set,2),p(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(d,h){return f(d,h),l?d.__proto__=h:p(d,h),d}}({},!1):void 0),check:f}},function(i,s,o){var a=o(2),u=o(6),f=o(12),c=o(4),l=o(1)("species");i.exports=function(p){var d=typeof u[p]=="function"?u[p]:a[p];c&&d&&!d[l]&&f.f(d,l,{configurable:!0,get:function(){return this}})}},function(i,s,o){var a=o(3),u=o(14),f=o(1)("species");i.exports=function(c,l){var p,d=a(c).constructor;return d===void 0||(p=a(d)[f])==null?l:u(p)}},function(i,s,o){var a=o(20),u=o(15);i.exports=function(f){return function(c,l){var p,d,h=String(u(c)),m=a(l),g=h.length;return m<0||m>=g?f?"":void 0:(p=h.charCodeAt(m),p<55296||p>56319||m+1===g||(d=h.charCodeAt(m+1))<56320||d>57343?f?h.charAt(m):p:f?h.slice(m,m+2):(p-55296<<10)+(d-56320)+65536)}}},function(i,s,o){var a=o(20),u=Math.max,f=Math.min;i.exports=function(c,l){return c=a(c),c<0?u(c+l,0):f(c,l)}},function(i,s,o){var a=o(15);i.exports=function(u){return Object(a(u))}},function(i,s,o){var a=o(21),u=o(1)("iterator"),f=o(10);i.exports=o(6).getIteratorMethod=function(c){if(c!=null)return c[u]||c["@@iterator"]||f[a(c)]}},function(i,s,o){var a=o(37),u=o(47),f=o(10),c=o(13);i.exports=o(27)(Array,"Array",function(l,p){this._t=c(l),this._i=0,this._k=p},function(){var l=this._t,p=this._k,d=this._i++;return!l||d>=l.length?(this._t=void 0,u(1)):p=="keys"?u(0,d):p=="values"?u(0,l[d]):u(0,[d,l[d]])},"values"),f.Arguments=f.Array,a("keys"),a("values"),a("entries")},function(i,s){},function(i,s,o){var a,u,f,c=o(28),l=o(2),p=o(7),d=o(21),h=o(23),m=o(9),g=(o(3),o(14)),w=o(38),_=o(40),C=(o(58).set,o(60)),T=o(30).set,R=o(48)(),F="Promise",j=l.TypeError,S=l.process,x=l[F],S=l.process,N=d(S)=="process",v=function(){},M=!!function(){try{var I=x.resolve(1),k=(I.constructor={})[o(1)("species")]=function(P){P(v,v)};return(N||typeof PromiseRejectionEvent=="function")&&I.then(v)instanceof k}catch{}}(),B=function(I,k){return I===k||I===x&&k===f},z=function(I){var k;return!(!m(I)||typeof(k=I.then)!="function")&&k},E=function(I){return B(x,I)?new b(I):new u(I)},b=u=function(I){var k,P;this.promise=new I(function(Y,ue){if(k!==void 0||P!==void 0)throw j("Bad Promise constructor");k=Y,P=ue}),this.resolve=g(k),this.reject=g(P)},$=function(I){try{I()}catch(k){return{error:k}}},D=function(I,k){if(!I._n){I._n=!0;var P=I._c;R(function(){for(var Y=I._v,ue=I._s==1,L=0,W=function(O){var q,Q,re=ue?O.ok:O.fail,X=O.resolve,Ie=O.reject,Be=O.domain;try{re?(ue||(I._h==2&&V(I),I._h=1),re===!0?q=Y:(Be&&Be.enter(),q=re(Y),Be&&Be.exit()),q===O.promise?Ie(j("Promise-chain cycle")):(Q=z(q))?Q.call(q,X,Ie):X(q)):Ie(Y)}catch(Xu){Ie(Xu)}};P.length>L;)W(P[L++]);I._c=[],I._n=!1,k&&!I._h&&U(I)})}},U=function(I){T.call(l,function(){var k,P,Y,ue=I._v;if(K(I)&&(k=$(function(){N?S.emit("unhandledRejection",ue,I):(P=l.onunhandledrejection)?P({promise:I,reason:ue}):(Y=l.console)&&Y.error&&Y.error("Unhandled promise rejection",ue)}),I._h=N||K(I)?2:1),I._a=void 0,k)throw k.error})},K=function(I){if(I._h==1)return!1;for(var k,P=I._a||I._c,Y=0;P.length>Y;)if(k=P[Y++],k.fail||!K(k.promise))return!1;return!0},V=function(I){T.call(l,function(){var k;N?S.emit("rejectionHandled",I):(k=l.onrejectionhandled)&&k({promise:I,reason:I._v})})},J=function(I){var k=this;k._d||(k._d=!0,k=k._w||k,k._v=I,k._s=2,k._a||(k._a=k._c.slice()),D(k,!0))},Se=function(I){var k,P=this;if(!P._d){P._d=!0,P=P._w||P;try{if(P===I)throw j("Promise can't be resolved itself");(k=z(I))?R(function(){var Y={_w:P,_d:!1};try{k.call(I,p(Se,Y,1),p(J,Y,1))}catch(ue){J.call(Y,ue)}}):(P._v=I,P._s=1,D(P,!1))}catch(Y){J.call({_w:P,_d:!1},Y)}}};M||(x=function(I){w(this,x,F,"_h"),g(I),a.call(this);try{I(p(Se,this,1),p(J,this,1))}catch(k){J.call(this,k)}},a=function(I){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},a.prototype=o(56)(x.prototype,{then:function(I,k){var P=E(C(this,x));return P.ok=typeof I!="function"||I,P.fail=typeof k=="function"&&k,P.domain=N?S.domain:void 0,this._c.push(P),this._a&&this._a.push(P),this._s&&D(this,!1),P.promise},catch:function(I){return this.then(void 0,I)}}),b=function(){var I=new a;this.promise=I,this.resolve=p(Se,I,1),this.reject=p(J,I,1)}),h(h.G+h.W+h.F*!M,{Promise:x}),o(18)(x,F),o(59)(F),f=o(6)[F],h(h.S+h.F*!M,F,{reject:function(I){var k=E(this),P=k.reject;return P(I),k.promise}}),h(h.S+h.F*(c||!M),F,{resolve:function(I){if(I instanceof x&&B(I.constructor,this))return I;var k=E(this),P=k.resolve;return P(I),k.promise}}),h(h.S+h.F*!(M&&o(46)(function(I){x.all(I).catch(v)})),F,{all:function(I){var k=this,P=E(k),Y=P.resolve,ue=P.reject,L=$(function(){var W=[],O=0,q=1;_(I,!1,function(Q){var re=O++,X=!1;W.push(void 0),q++,k.resolve(Q).then(function(Ie){X||(X=!0,W[re]=Ie,--q||Y(W))},ue)}),--q||Y(W)});return L&&ue(L.error),P.promise},race:function(I){var k=this,P=E(k),Y=P.reject,ue=$(function(){_(I,!1,function(L){k.resolve(L).then(P.resolve,Y)})});return ue&&Y(ue.error),P.promise}})},function(i,s,o){var a=o(61)(!0);o(27)(String,"String",function(u){this._t=String(u),this._i=0},function(){var u,f=this._t,c=this._i;return c>=f.length?{value:void 0,done:!0}:(u=a(f,c),this._i+=u.length,{value:u,done:!1})})},function(i,s,o){o(65);for(var a=o(2),u=o(5),f=o(10),c=o(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var d=l[p],h=a[d],m=h&&h.prototype;m&&!m[c]&&u(m,c,d),f[d]=f.Array}},function(i,s){i.exports=mn.default},function(i,s){i.exports=Hi.default}])})})(rf);var Ir;try{Ir=Map}catch{}var Or;try{Or=Set}catch{}function Ps(e,t,n){if(!e||typeof e!="object"||typeof e=="function")return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map(Nr);if(Ir&&e instanceof Ir)return new Map(Array.from(e.entries()));if(Or&&e instanceof Or)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);n.push(r);for(var i in e){var s=t.findIndex(function(o){return o===e[i]});r[i]=s>-1?n[s]:Ps(e[i],t,n)}return r}return e}function Nr(e){return Ps(e,[],[])}const of=Object.prototype.toString,sf=Error.prototype.toString,af=RegExp.prototype.toString,uf=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",cf=/^Symbol\((.*)\)(.*)$/;function lf(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Vi(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return lf(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return uf.call(e).replace(cf,"Symbol($1)");const r=of.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+sf.call(e)+"]":r==="RegExp"?af.call(e):null}function Tt(e,t){let n=Vi(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let s=Vi(this[r],t);return s!==null?s:i},2)}let Qe={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=r!=null&&r!==n,s=`${e} must be a \`${t}\` type, but the final value was: \`${Tt(n,!0)}\``+(i?` (cast from the value \`${Tt(r,!0)}\`).`:".");return n===null&&(s+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),s},defined:"${path} must be defined"},Re={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},ff={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Pr={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},pf={isValue:"${path} field must be ${value}"},Lr={noUnknown:"${path} field has unspecified keys: ${unknown}"},un={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};const df=Object.assign(Object.create(null),{mixed:Qe,string:Re,number:ff,date:Pr,object:Lr,array:un,boolean:pf}),Un=e=>e&&e.__isYupSchema__;class hf{constructor(t,n){if(this.refs=t,this.refs=t,typeof n=="function"){this.fn=n;return}if(!gn.default(n,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:s}=n,o=typeof r=="function"?r:(...a)=>a.every(u=>u===r);this.fn=function(...a){let u=a.pop(),f=a.pop(),c=o(...a)?i:s;if(c)return typeof c=="function"?c(f):f.concat(c.resolve(u))}}resolve(t,n){let r=this.refs.map(s=>s.getValue(n?.value,n?.parent,n?.context)),i=this.fn.apply(t,r.concat(t,n));if(i===void 0||i===t)return t;if(!Un(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}function Ls(e){return e==null?[]:[].concat(e)}function Dr(){return Dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dr.apply(this,arguments)}let mf=/\$\{\s*(\w+)\s*\}/g,Te=class kr extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Dr({},n,{path:r})),typeof t=="string"?t.replace(mf,(i,s)=>Tt(n[s])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Ls(t).forEach(s=>{kr.isError(s)?(this.errors.push(...s.errors),this.inner=this.inner.concat(s.inner.length?s.inner:s)):this.errors.push(s)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,kr)}};const gf=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function En(e,t){let{endEarly:n,tests:r,args:i,value:s,errors:o,sort:a,path:u}=e,f=gf(t),c=r.length;const l=[];if(o=o||[],!c)return o.length?f(new Te(o,s,u)):f(null,s);for(let p=0;p<r.length;p++){const d=r[p];d(i,function(m){if(m){if(!Te.isError(m))return f(m,s);if(n)return m.value=s,f(m,s);l.push(m)}if(--c<=0){if(l.length&&(a&&l.sort(a),o.length&&l.push(...o),o=l),o.length){f(new Te(o,s,u),s);return}f(null,s)}})}}function ct(e){this._maxSize=e,this.clear()}ct.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ct.prototype.get=function(e){return this._values[e]};ct.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var yf=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Ds=/^\d+$/,vf=/^\d/,Ef=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,wf=/^\s*(['"]?)(.*?)(\1)\s*$/,Qr=512,Qi=new ct(Qr),Xi=new ct(Qr),Zi=new ct(Qr),Gn={Cache:ct,split:Mr,normalizePath:ar,setter:function(e){var t=ar(e);return Xi.get(e)||Xi.set(e,function(r,i){for(var s=0,o=t.length,a=r;s<o-1;){var u=t[s];if(u==="__proto__"||u==="constructor"||u==="prototype")return r;a=a[t[s++]]}a[t[s]]=i})},getter:function(e,t){var n=ar(e);return Zi.get(e)||Zi.set(e,function(i){for(var s=0,o=n.length;s<o;)if(i!=null||!t)i=i[n[s++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(Xr(n)||Ds.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){bf(Array.isArray(e)?e:Mr(e),t,n)}};function ar(e){return Qi.get(e)||Qi.set(e,Mr(e).map(function(t){return t.replace(wf,"$2")}))}function Mr(e){return e.match(yf)||[""]}function bf(e,t,n){var r=e.length,i,s,o,a;for(s=0;s<r;s++)i=e[s],i&&(Sf(i)&&(i='"'+i+'"'),a=Xr(i),o=!a&&/^\d+$/.test(i),t.call(n,i,a,o,s,e))}function Xr(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function _f(e){return e.match(vf)&&!e.match(Ds)}function xf(e){return Ef.test(e)}function Sf(e){return!Xr(e)&&(_f(e)||xf(e))}const en={context:"$",value:"."};class ot{constructor(t,n={}){if(typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===en.context,this.isValue=this.key[0]===en.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?en.context:this.isValue?en.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Gn.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n?.parent,n?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ot.prototype.__isYupRef=!0;function wn(){return wn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wn.apply(this,arguments)}function Af(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function tn(e){function t(n,r){let{value:i,path:s="",label:o,options:a,originalValue:u,sync:f}=n,c=Af(n,["value","path","label","options","originalValue","sync"]);const{name:l,test:p,params:d,message:h}=e;let{parent:m,context:g}=a;function w(F){return ot.isRef(F)?F.getValue(i,m,g):F}function _(F={}){const j=Es.default(wn({value:i,originalValue:u,label:o,path:F.path||s},d,F.params),w),x=new Te(Te.formatError(F.message||h,j),i,j.path,F.type||l);return x.params=j,x}let C=wn({path:s,parent:m,type:l,createError:_,resolve:w,options:a,originalValue:u},c);if(!f){try{Promise.resolve(p.call(C,i,C)).then(F=>{Te.isError(F)?r(F):F?r(null,F):r(_())})}catch(F){r(F)}return}let T;try{var R;if(T=p.call(C,i,C),typeof((R=T)==null?void 0:R.then)=="function")throw new Error(`Validation test of type: "${C.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(F){r(F);return}Te.isError(T)?r(T):T?r(null,T):r(_())}return t.OPTIONS=e,t}let Tf=e=>e.substr(0,e.length-1).substr(1);function Cf(e,t,n,r=n){let i,s,o;return t?(Gn.forEach(t,(a,u,f)=>{let c=u?Tf(a):a;if(e=e.resolve({context:r,parent:i,value:n}),e.innerType){let l=f?parseInt(c,10):0;if(n&&l>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[l],e=e.innerType}if(!f){if(!e.fields||!e.fields[c])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[c],e=e.fields[c]}s=c,o=u?"["+a+"]":"."+a}),{schema:e,parent:i,parentPath:s}):{parent:i,parentPath:t,schema:e}}class bn{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const t=[];for(const n of this.list)t.push(n);for(const[,n]of this.refs)t.push(n.describe());return t}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(t){ot.isRef(t)?this.refs.set(t.key,t):this.list.add(t)}delete(t){ot.isRef(t)?this.refs.delete(t.key):this.list.delete(t)}has(t,n){if(this.list.has(t))return!0;let r,i=this.refs.values();for(;r=i.next(),!r.done;)if(n(r.value)===t)return!0;return!1}clone(){const t=new bn;return t.list=new Set(this.list),t.refs=new Map(this.refs),t}merge(t,n){const r=this.clone();return t.list.forEach(i=>r.add(i)),t.refs.forEach(i=>r.add(i)),n.list.forEach(i=>r.delete(i)),n.refs.forEach(i=>r.delete(i)),r}}function Ae(){return Ae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ae.apply(this,arguments)}class me{constructor(t){this.deps=[],this.conditions=[],this._whitelist=new bn,this._blacklist=new bn,this.exclusiveTests=Object.create(null),this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Qe.notType)}),this.type=t?.type||"mixed",this.spec=Ae({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},t?.spec)}get _type(){return this.type}_typeCheck(t){return!0}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeError=this._typeError,n._whitelistError=this._whitelistError,n._blacklistError=this._blacklistError,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.exclusiveTests=Ae({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Nr(Ae({},this.spec,t)),n}label(t){var n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Ae({},n.spec,r.spec);return r.spec=i,r._typeError||(r._typeError=n._typeError),r._whitelistError||(r._whitelistError=n._whitelistError),r._blacklistError||(r._blacklistError=n._blacklistError),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(s=>{t.tests.forEach(o=>{s.test(o.OPTIONS)})}),r}isType(t){return this.spec.nullable&&t===null?!0:this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,s)=>s.resolve(i,t),n),n=n.resolve(t)}return n}cast(t,n={}){let r=this.resolve(Ae({value:t},n)),i=r._cast(t,n);if(t!==void 0&&n.assert!==!1&&r.isType(i)!==!0){let s=Tt(t),o=Tt(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r._type}".
3
3
 
4
4
  attempted value: ${s}
5
- `+(o!==s?`result of cast: ${o}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault()),r}_validate(t,n={},r){let{sync:i,path:s,from:o=[],originalValue:a=t,strict:u=this.spec.strict,abortEarly:l=this.spec.abortEarly}=n,c=t;u||(c=this._cast(c,Se({assert:!1},n)));let f={value:c,path:s,options:n,originalValue:a,schema:this,label:this.spec.label,sync:i,from:o},p=[];this._typeError&&p.push(this._typeError),this._whitelistError&&p.push(this._whitelistError),this._blacklistError&&p.push(this._blacklistError),En({args:f,value:c,path:s,sync:i,tests:p,endEarly:l},d=>{if(d)return void r(d,c);En({tests:this.tests,args:f,path:s,sync:i,value:c,endEarly:l},r)})}validate(t,n,r){let i=this.resolve(Se({},n,{value:t}));return typeof r=="function"?i._validate(t,n,r):new Promise((s,o)=>i._validate(t,n,(a,u)=>{a?o(a):s(u)}))}validateSync(t,n){let r=this.resolve(Se({},n,{value:t})),i;return r._validate(t,Se({},n,{sync:!0}),(s,o)=>{if(s)throw s;i=o}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Te.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Te.isError(r))return!1;throw r}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):Nr(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){var n=this.clone();return n.spec.strict=t,n}_isPresent(t){return t!=null}defined(t=Ve.defined){return this.test({message:t,name:"defined",exclusive:!0,test(n){return n!==void 0}})}required(t=Ve.required){return this.clone({presence:"required"}).withMutation(n=>n.test({message:t,name:"required",exclusive:!0,test(r){return this.schema._isPresent(r)}}))}notRequired(){var t=this.clone({presence:"optional"});return t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t}nullable(t=!0){var n=this.clone({nullable:t!==!1});return n}transform(t){var n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Ve.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=tn(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=Ls(t).map(s=>new it(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(new mf(i,n)),r}typeError(t){var n=this.clone();return n._typeError=tn({message:t,name:"typeError",test(r){return r!==void 0&&!this.schema.isType(r)?this.createError({params:{type:this.schema._type}}):!0}}),n}oneOf(t,n=Ve.oneOf){var r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r._whitelistError=tn({message:n,name:"oneOf",test(i){if(i===void 0)return!0;let s=this.schema._whitelist;return s.has(i,this.resolve)?!0:this.createError({params:{values:s.toArray().join(", ")}})}}),r}notOneOf(t,n=Ve.notOneOf){var r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r._blacklistError=tn({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist;return s.has(i,this.resolve)?this.createError({params:{values:s.toArray().join(", ")}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(){const t=this.clone(),{label:n,meta:r}=t.spec;return{meta:r,label:n,type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(s=>({name:s.OPTIONS.name,params:s.OPTIONS.params})).filter((s,o,a)=>a.findIndex(u=>u.name===s.name)===o)}}}me.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])me.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=Rf(this,t,n,r.context);return o[e](i&&i[s],Se({},r,{parent:i,path:t}))};for(const e of["equals","is"])me.prototype[e]=me.prototype.oneOf;for(const e of["not","nope"])me.prototype[e]=me.prototype.notOneOf;me.prototype.optional=me.prototype.notRequired;const Ms=me;function qn(){return new Ms}qn.prototype=Ms.prototype;const ge=e=>e==null;let $f=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,Ff=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,If=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Of=e=>ge(e)||e===e.trim(),Nf={}.toString();function ei(){return new ks}class ks extends me{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(t){if(this.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===Nf?t:n})})}_typeCheck(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}_isPresent(t){return super._isPresent(t)&&!!t.length}length(t,n=Re.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ge(r)||r.length===this.resolve(t)}})}min(t,n=Re.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ge(r)||r.length>=this.resolve(t)}})}max(t,n=Re.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},test(r){return ge(r)||r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||Re.matches,params:{regex:t},test:o=>ge(o)||o===""&&r||o.search(t)!==-1})}email(t=Re.email){return this.matches($f,{name:"email",message:t,excludeEmptyString:!0})}url(t=Re.url){return this.matches(Ff,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Re.uuid){return this.matches(If,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Re.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:Of})}lowercase(t=Re.lowercase){return this.transform(n=>ge(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ge(n)||n===n.toLowerCase()})}uppercase(t=Re.uppercase){return this.transform(n=>ge(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ge(n)||n===n.toUpperCase()})}}ei.prototype=ks.prototype;var Pf=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function Lf(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=Pf.exec(e)){for(var s=0,o;o=t[s];++s)i[o]=+i[o]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let js=new Date(""),Df=e=>Object.prototype.toString.call(e)==="[object Date]";class Hs extends me{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(t){return this.isType(t)?t:(t=Lf(t),isNaN(t)?js:new Date(t))})})}_typeCheck(t){return Df(t)&&!isNaN(t.getTime())}prepareParam(t,n){let r;if(it.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Pr.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(i){return ge(i)||i>=this.resolve(r)}})}max(t,n=Pr.max){var r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(i){return ge(i)||i<=this.resolve(r)}})}}Hs.INVALID_DATE=js;Hs.prototype;var ti={exports:{}};ti.exports=function(e){return Bs(Mf(e),e)};ti.exports.array=Bs;function Bs(e,t){var n=e.length,r=new Array(n),i={},s=n,o=kf(t),a=jf(e);for(t.forEach(function(l){if(!a.has(l[0])||!a.has(l[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||u(e[s],s,new Set);return r;function u(l,c,f){if(f.has(l)){var p;try{p=", node was:"+JSON.stringify(l)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!a.has(l))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(l));if(!i[c]){i[c]=!0;var d=o.get(l)||new Set;if(d=Array.from(d),c=d.length){f.add(l);do{var h=d[--c];u(h,a.get(h),f)}while(c);f.delete(l)}r[--n]=l}}}function Mf(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function kf(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function jf(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var Hf=ti.exports;const Bf=Ns(Hf);function Uf(e,t=[]){let n=[],r=[];function i(s,o){var a=Gn.split(s)[0];~r.indexOf(a)||r.push(a),~t.indexOf(`${o}-${a}`)||n.push([o,a])}for(const s in e)if(gn.default(e,s)){let o=e[s];~r.indexOf(s)||r.push(s),it.isRef(o)&&o.isSibling?i(o.path,s):Un(o)&&"deps"in o&&o.deps.forEach(a=>i(a,s))}return Bf.array(r,n).reverse()}function to(e,t){let n=1/0;return e.some((r,i)=>{var s;if(((s=t.path)==null?void 0:s.indexOf(r))!==-1)return n=i,!0}),n}function Us(e){return(t,n)=>to(e,t)-to(e,n)}function Et(){return Et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Et.apply(this,arguments)}let no=e=>Object.prototype.toString.call(e)==="[object Object]";function Gf(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const qf=Us([]);class Gs extends me{constructor(t){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=qf,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(r){if(typeof r=="string")try{r=JSON.parse(r)}catch{r=null}return this.isType(r)?r:null}),t&&this.shape(t)})}_typeCheck(t){return no(t)||typeof t=="function"}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=this._nodes.concat(Object.keys(i).filter(f=>this._nodes.indexOf(f)===-1)),u={},l=Et({},n,{parent:u,__validating:n.__validating||!1}),c=!1;for(const f of a){let p=s[f],d=gn.default(i,f);if(p){let h,g=i[f];l.path=(n.path?`${n.path}.`:"")+f,p=p.resolve({value:g,context:n.context,parent:u});let m="spec"in p?p.spec:void 0,w=m?.strict;if(m?.strip){c=c||f in i;continue}h=!n.__validating||!w?p.cast(i[f],l):i[f],h!==void 0&&(u[f]=h)}else d&&!o&&(u[f]=i[f]);u[f]!==i[f]&&(c=!0)}return c?u:i}_validate(t,n={},r){let i=[],{sync:s,from:o=[],originalValue:a=t,abortEarly:u=this.spec.abortEarly,recursive:l=this.spec.recursive}=n;o=[{schema:this,value:a},...o],n.__validating=!0,n.originalValue=a,n.from=o,super._validate(t,n,(c,f)=>{if(c){if(!Te.isError(c)||u)return void r(c,f);i.push(c)}if(!l||!no(f)){r(i[0]||null,f);return}a=a||f;let p=this._nodes.map(d=>(h,g)=>{let m=d.indexOf(".")===-1?(n.path?`${n.path}.`:"")+d:`${n.path||""}["${d}"]`,w=this.fields[d];if(w&&"validate"in w){w.validate(f[d],Et({},n,{path:m,from:o,strict:!0,parent:f,originalValue:a[d]}),g);return}g(null)});En({sync:s,tests:p,value:f,errors:i,endEarly:u,sort:this._sortErrors,path:n.path},r)})}clone(t){const n=super.clone(t);return n.fields=Et({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];o===void 0?r[i]=s:o instanceof me&&s instanceof me&&(r[i]=s.concat(o))}return n.withMutation(()=>n.shape(r))}getDefaultFromShape(){let t={};return this._nodes.forEach(n=>{const r=this.fields[n];t[n]="default"in r?r.getDefault():void 0}),t}_getDefault(){if("default"in this.spec)return super._getDefault();if(this._nodes.length)return this.getDefaultFromShape()}shape(t,n=[]){let r=this.clone(),i=Object.assign(r.fields,t);if(r.fields=i,r._sortErrors=Us(Object.keys(i)),n.length){Array.isArray(n[0])||(n=[n]);let s=n.map(([o,a])=>`${o}-${a}`);r._excludedEdges=r._excludedEdges.concat(s)}return r._nodes=Uf(i,r._excludedEdges),r}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.clone().withMutation(r=>(r.fields={},r.shape(n)))}omit(t){const n=this.clone(),r=n.fields;n.fields={};for(const i of t)delete r[i];return n.withMutation(()=>n.shape(r))}from(t,n,r){let i=Gn.getter(t,!0);return this.transform(s=>{if(s==null)return s;let o=s;return gn.default(s,t)&&(o=Et({},s),r||delete o[t],o[n]=i(s)),o})}noUnknown(t=!0,n=Lr.noUnknown){typeof t=="string"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=Gf(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=Lr.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>n&&Ec.default(n,(r,i)=>t(i)))}camelCase(){return this.transformKeys(vc.default)}snakeCase(){return this.transformKeys(qi.default)}constantCase(){return this.transformKeys(t=>qi.default(t).toUpperCase())}describe(){let t=super.describe();return t.fields=Es.default(this.fields,n=>n.describe()),t}}function qs(e){return new Gs(e)}qs.prototype=Gs.prototype;function _n(){return _n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_n.apply(this,arguments)}function Ks(e){return new zs(e)}class zs extends me{constructor(t){super({type:"array"}),this.innerType=t,this.withMutation(()=>{this.transform(function(n){if(typeof n=="string")try{n=JSON.parse(n)}catch{n=null}return this.isType(n)?n:null})})}_typeCheck(t){return Array.isArray(t)}get _subType(){return this.innerType}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const s=r.map((o,a)=>{const u=this.innerType.cast(o,_n({},n,{path:`${n.path||""}[${a}]`}));return u!==o&&(i=!0),u});return i?s:r}_validate(t,n={},r){var i,s;let o=[],a=n.sync,u=n.path,l=this.innerType,c=(i=n.abortEarly)!=null?i:this.spec.abortEarly,f=(s=n.recursive)!=null?s:this.spec.recursive,p=n.originalValue!=null?n.originalValue:t;super._validate(t,n,(d,h)=>{if(d){if(!Te.isError(d)||c)return void r(d,h);o.push(d)}if(!f||!l||!this._typeCheck(h)){r(o[0]||null,h);return}p=p||h;let g=new Array(h.length);for(let m=0;m<h.length;m++){let w=h[m],_=`${n.path||""}[${m}]`,C=_n({},n,{path:_,strict:!0,parent:h,index:m,originalValue:p[m]});g[m]=(T,R)=>l.validate(w,C,R)}En({sync:a,path:u,value:h,errors:o,endEarly:c,tests:g},r)})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!Un(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+St(t));return n.innerType=t,n}length(t,n=un.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ge(r)||r.length===this.resolve(t)}})}min(t,n){return n=n||un.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ge(r)||r.length>=this.resolve(t)}})}max(t,n){return n=n||un.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(r){return ge(r)||r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,s)=>!t(r,i,s):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(){let t=super.describe();return this.innerType&&(t.innerType=this.innerType.describe()),t}nullable(t=!0){return super.nullable(t)}defined(){return super.defined()}required(t){return super.required(t)}}Ks.prototype=zs.prototype;function Kf(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(n=>{hf[t][n]=e[t][n]})})}function ct(e,t,n){if(!e||!Un(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof t!="string")throw new TypeError("A Method name must be provided");if(typeof n!="function")throw new TypeError("Method function must be provided");e.prototype[t]=n}var Ws={exports:{}};/*!
5
+ `+(o!==s?`result of cast: ${o}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,s)=>s.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault()),r}_validate(t,n={},r){let{sync:i,path:s,from:o=[],originalValue:a=t,strict:u=this.spec.strict,abortEarly:f=this.spec.abortEarly}=n,c=t;u||(c=this._cast(c,Ae({assert:!1},n)));let l={value:c,path:s,options:n,originalValue:a,schema:this,label:this.spec.label,sync:i,from:o},p=[];this._typeError&&p.push(this._typeError),this._whitelistError&&p.push(this._whitelistError),this._blacklistError&&p.push(this._blacklistError),En({args:l,value:c,path:s,tests:p,endEarly:f},d=>{if(d)return void r(d,c);En({tests:this.tests,args:l,path:s,sync:i,value:c,endEarly:f},r)})}validate(t,n,r){let i=this.resolve(Ae({},n,{value:t}));return typeof r=="function"?i._validate(t,n,r):new Promise((s,o)=>i._validate(t,n,(a,u)=>{a?o(a):s(u)}))}validateSync(t,n){let r=this.resolve(Ae({},n,{value:t})),i;return r._validate(t,Ae({},n,{sync:!0}),(s,o)=>{if(s)throw s;i=o}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(Te.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(Te.isError(r))return!1;throw r}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):Nr(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){var n=this.clone();return n.spec.strict=t,n}_isPresent(t){return t!=null}defined(t=Qe.defined){return this.test({message:t,name:"defined",exclusive:!0,test(n){return n!==void 0}})}required(t=Qe.required){return this.clone({presence:"required"}).withMutation(n=>n.test({message:t,name:"required",exclusive:!0,test(r){return this.schema._isPresent(r)}}))}notRequired(){var t=this.clone({presence:"optional"});return t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t}nullable(t=!0){var n=this.clone({nullable:t!==!1});return n}transform(t){var n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Qe.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=tn(n),s=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(s||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=Ls(t).map(s=>new ot(s));return i.forEach(s=>{s.isSibling&&r.deps.push(s.key)}),r.conditions.push(new hf(i,n)),r}typeError(t){var n=this.clone();return n._typeError=tn({message:t,name:"typeError",test(r){return r!==void 0&&!this.schema.isType(r)?this.createError({params:{type:this.schema._type}}):!0}}),n}oneOf(t,n=Qe.oneOf){var r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r._whitelistError=tn({message:n,name:"oneOf",test(i){if(i===void 0)return!0;let s=this.schema._whitelist;return s.has(i,this.resolve)?!0:this.createError({params:{values:s.toArray().join(", ")}})}}),r}notOneOf(t,n=Qe.notOneOf){var r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r._blacklistError=tn({message:n,name:"notOneOf",test(i){let s=this.schema._blacklist;return s.has(i,this.resolve)?this.createError({params:{values:s.toArray().join(", ")}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(){const t=this.clone(),{label:n,meta:r}=t.spec;return{meta:r,label:n,type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(s=>({name:s.OPTIONS.name,params:s.OPTIONS.params})).filter((s,o,a)=>a.findIndex(u=>u.name===s.name)===o)}}}me.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])me.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:s,schema:o}=Cf(this,t,n,r.context);return o[e](i&&i[s],Ae({},r,{parent:i,path:t}))};for(const e of["equals","is"])me.prototype[e]=me.prototype.oneOf;for(const e of["not","nope"])me.prototype[e]=me.prototype.notOneOf;me.prototype.optional=me.prototype.notRequired;const ks=me;function qn(){return new ks}qn.prototype=ks.prototype;const ge=e=>e==null;let Rf=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,$f=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ff=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,If=e=>ge(e)||e===e.trim(),Of={}.toString();function Zr(){return new Ms}class Ms extends me{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(t){if(this.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===Of?t:n})})}_typeCheck(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}_isPresent(t){return super._isPresent(t)&&!!t.length}length(t,n=Re.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ge(r)||r.length===this.resolve(t)}})}min(t,n=Re.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ge(r)||r.length>=this.resolve(t)}})}max(t,n=Re.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},test(r){return ge(r)||r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,s;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:s}=n:i=n),this.test({name:s||"matches",message:i||Re.matches,params:{regex:t},test:o=>ge(o)||o===""&&r||o.search(t)!==-1})}email(t=Re.email){return this.matches(Rf,{name:"email",message:t,excludeEmptyString:!0})}url(t=Re.url){return this.matches($f,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Re.uuid){return this.matches(Ff,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Re.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:If})}lowercase(t=Re.lowercase){return this.transform(n=>ge(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ge(n)||n===n.toLowerCase()})}uppercase(t=Re.uppercase){return this.transform(n=>ge(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ge(n)||n===n.toUpperCase()})}}Zr.prototype=Ms.prototype;var Nf=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function Pf(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=Nf.exec(e)){for(var s=0,o;o=t[s];++s)i[o]=+i[o]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let js=new Date(""),Lf=e=>Object.prototype.toString.call(e)==="[object Date]";class Df extends me{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(t){return this.isType(t)?t:(t=Pf(t),isNaN(t)?js:new Date(t))})})}_typeCheck(t){return Lf(t)&&!isNaN(t.getTime())}prepareParam(t,n){let r;if(ot.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Pr.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(i){return ge(i)||i>=this.resolve(r)}})}max(t,n=Pr.max){var r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(i){return ge(i)||i<=this.resolve(r)}})}}Df.INVALID_DATE=js;var Jr={exports:{}};Jr.exports=function(e){return Bs(kf(e),e)};Jr.exports.array=Bs;function Bs(e,t){var n=e.length,r=new Array(n),i={},s=n,o=Mf(t),a=jf(e);for(t.forEach(function(f){if(!a.has(f[0])||!a.has(f[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});s--;)i[s]||u(e[s],s,new Set);return r;function u(f,c,l){if(l.has(f)){var p;try{p=", node was:"+JSON.stringify(f)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!a.has(f))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(f));if(!i[c]){i[c]=!0;var d=o.get(f)||new Set;if(d=Array.from(d),c=d.length){l.add(f);do{var h=d[--c];u(h,a.get(h),l)}while(c);l.delete(f)}r[--n]=f}}}function kf(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function Mf(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function jf(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var Bf=Jr.exports;const Hf=Ns(Bf);function Uf(e,t=[]){let n=[],r=[];function i(s,o){var a=Gn.split(s)[0];~r.indexOf(a)||r.push(a),~t.indexOf(`${o}-${a}`)||n.push([o,a])}for(const s in e)if(gn.default(e,s)){let o=e[s];~r.indexOf(s)||r.push(s),ot.isRef(o)&&o.isSibling?i(o.path,s):Un(o)&&"deps"in o&&o.deps.forEach(a=>i(a,s))}return Hf.array(r,n).reverse()}function Ji(e,t){let n=1/0;return e.some((r,i)=>{var s;if(((s=t.path)==null?void 0:s.indexOf(r))!==-1)return n=i,!0}),n}function Hs(e){return(t,n)=>Ji(e,t)-Ji(e,n)}function wt(){return wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wt.apply(this,arguments)}let eo=e=>Object.prototype.toString.call(e)==="[object Object]";function Gf(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const qf=Hs([]);class Us extends me{constructor(t){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=qf,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(r){if(typeof r=="string")try{r=JSON.parse(r)}catch{r=null}return this.isType(r)?r:null}),t&&this.shape(t)})}_typeCheck(t){return eo(t)||typeof t=="function"}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let s=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=this._nodes.concat(Object.keys(i).filter(l=>this._nodes.indexOf(l)===-1)),u={},f=wt({},n,{parent:u,__validating:n.__validating||!1}),c=!1;for(const l of a){let p=s[l],d=gn.default(i,l);if(p){let h,m=i[l];f.path=(n.path?`${n.path}.`:"")+l,p=p.resolve({value:m,context:n.context,parent:u});let g="spec"in p?p.spec:void 0,w=g?.strict;if(g?.strip){c=c||l in i;continue}h=!n.__validating||!w?p.cast(i[l],f):i[l],h!==void 0&&(u[l]=h)}else d&&!o&&(u[l]=i[l]);u[l]!==i[l]&&(c=!0)}return c?u:i}_validate(t,n={},r){let i=[],{sync:s,from:o=[],originalValue:a=t,abortEarly:u=this.spec.abortEarly,recursive:f=this.spec.recursive}=n;o=[{schema:this,value:a},...o],n.__validating=!0,n.originalValue=a,n.from=o,super._validate(t,n,(c,l)=>{if(c){if(!Te.isError(c)||u)return void r(c,l);i.push(c)}if(!f||!eo(l)){r(i[0]||null,l);return}a=a||l;let p=this._nodes.map(d=>(h,m)=>{let g=d.indexOf(".")===-1?(n.path?`${n.path}.`:"")+d:`${n.path||""}["${d}"]`,w=this.fields[d];if(w&&"validate"in w){w.validate(l[d],wt({},n,{path:g,from:o,strict:!0,parent:l,originalValue:a[d]}),m);return}m(null)});En({tests:p,value:l,errors:i,endEarly:u,sort:this._sortErrors,path:n.path},r)})}clone(t){const n=super.clone(t);return n.fields=wt({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,s]of Object.entries(this.fields)){const o=r[i];o===void 0?r[i]=s:o instanceof me&&s instanceof me&&(r[i]=s.concat(o))}return n.withMutation(()=>n.shape(r))}getDefaultFromShape(){let t={};return this._nodes.forEach(n=>{const r=this.fields[n];t[n]="default"in r?r.getDefault():void 0}),t}_getDefault(){if("default"in this.spec)return super._getDefault();if(this._nodes.length)return this.getDefaultFromShape()}shape(t,n=[]){let r=this.clone(),i=Object.assign(r.fields,t);if(r.fields=i,r._sortErrors=Hs(Object.keys(i)),n.length){Array.isArray(n[0])||(n=[n]);let s=n.map(([o,a])=>`${o}-${a}`);r._excludedEdges=r._excludedEdges.concat(s)}return r._nodes=Uf(i,r._excludedEdges),r}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.clone().withMutation(r=>(r.fields={},r.shape(n)))}omit(t){const n=this.clone(),r=n.fields;n.fields={};for(const i of t)delete r[i];return n.withMutation(()=>n.shape(r))}from(t,n,r){let i=Gn.getter(t,!0);return this.transform(s=>{if(s==null)return s;let o=s;return gn.default(s,t)&&(o=wt({},s),r||delete o[t],o[n]=i(s)),o})}noUnknown(t=!0,n=Lr.noUnknown){typeof t=="string"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const s=Gf(this.schema,i);return!t||s.length===0||this.createError({params:{unknown:s.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=Lr.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>n&&vc.default(n,(r,i)=>t(i)))}camelCase(){return this.transformKeys(yc.default)}snakeCase(){return this.transformKeys(Ui.default)}constantCase(){return this.transformKeys(t=>Ui.default(t).toUpperCase())}describe(){let t=super.describe();return t.fields=Es.default(this.fields,n=>n.describe()),t}}function Gs(e){return new Us(e)}Gs.prototype=Us.prototype;function _n(){return _n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_n.apply(this,arguments)}function qs(e){return new zs(e)}class zs extends me{constructor(t){super({type:"array"}),this.innerType=t,this.withMutation(()=>{this.transform(function(n){if(typeof n=="string")try{n=JSON.parse(n)}catch{n=null}return this.isType(n)?n:null})})}_typeCheck(t){return Array.isArray(t)}get _subType(){return this.innerType}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const s=r.map((o,a)=>{const u=this.innerType.cast(o,_n({},n,{path:`${n.path||""}[${a}]`}));return u!==o&&(i=!0),u});return i?s:r}_validate(t,n={},r){var i,s;let o=[];n.sync;let a=n.path,u=this.innerType,f=(i=n.abortEarly)!=null?i:this.spec.abortEarly,c=(s=n.recursive)!=null?s:this.spec.recursive,l=n.originalValue!=null?n.originalValue:t;super._validate(t,n,(p,d)=>{if(p){if(!Te.isError(p)||f)return void r(p,d);o.push(p)}if(!c||!u||!this._typeCheck(d)){r(o[0]||null,d);return}l=l||d;let h=new Array(d.length);for(let m=0;m<d.length;m++){let g=d[m],w=`${n.path||""}[${m}]`,_=_n({},n,{path:w,strict:!0,parent:d,index:m,originalValue:l[m]});h[m]=(C,T)=>u.validate(g,_,T)}En({path:a,value:d,errors:o,endEarly:f,tests:h},r)})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!Un(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+Tt(t));return n.innerType=t,n}length(t,n=un.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ge(r)||r.length===this.resolve(t)}})}min(t,n){return n=n||un.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ge(r)||r.length>=this.resolve(t)}})}max(t,n){return n=n||un.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(r){return ge(r)||r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,s)=>!t(r,i,s):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(){let t=super.describe();return this.innerType&&(t.innerType=this.innerType.describe()),t}nullable(t=!0){return super.nullable(t)}defined(){return super.defined()}required(t){return super.required(t)}}qs.prototype=zs.prototype;function zf(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(n=>{df[t][n]=e[t][n]})})}function lt(e,t,n){if(!e||!Un(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof t!="string")throw new TypeError("A Method name must be provided");if(typeof n!="function")throw new TypeError("Method function must be provided");e.prototype[t]=n}var Ks={exports:{}};/*!
6
6
  * depd
7
7
  * Copyright(c) 2015 Douglas Christopher Wilson
8
8
  * MIT Licensed
9
- */var zf=Wf;function Wf(e){if(!e)throw new TypeError("argument namespace is required");function t(n){}return t._file=void 0,t._ignored=!0,t._namespace=e,t._traced=!1,t._warned=Object.create(null),t.function=Yf,t.property=Vf,t}function Yf(e,t){if(typeof e!="function")throw new TypeError("argument fn must be a function");return e}function Vf(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var r=Object.getOwnPropertyDescriptor(e,t);if(!r)throw new TypeError("must call property on owner object");if(!r.configurable)throw new TypeError("property must be configurable")}var Qf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?Xf:Zf);function Xf(e,t){return e.__proto__=t,e}function Zf(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e}const Jf={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};/*!
9
+ */var Kf=Wf;function Wf(e){if(!e)throw new TypeError("argument namespace is required");function t(n){}return t._file=void 0,t._ignored=!0,t._namespace=e,t._traced=!1,t._warned=Object.create(null),t.function=Yf,t.property=Vf,t}function Yf(e,t){if(typeof e!="function")throw new TypeError("argument fn must be a function");return e}function Vf(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var r=Object.getOwnPropertyDescriptor(e,t);if(!r)throw new TypeError("must call property on owner object");if(!r.configurable)throw new TypeError("property must be configurable")}var Qf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?Xf:Zf);function Xf(e,t){return e.__proto__=t,e}function Zf(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e}const Jf={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};/*!
10
10
  * statuses
11
11
  * Copyright(c) 2014 Jonathan Ong
12
12
  * Copyright(c) 2016 Douglas Christopher Wilson
13
13
  * MIT Licensed
14
- */var ni=Jf,ep=$e;$e.message=ni;$e.code=tp(ni);$e.codes=np(ni);$e.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};$e.empty={204:!0,205:!0,304:!0};$e.retry={502:!0,503:!0,504:!0};function tp(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r],s=Number(r);t[i.toLowerCase()]=s}),t}function np(e){return Object.keys(e).map(function(n){return Number(n)})}function rp(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call($e.code,t))throw new Error('invalid status message: "'+e+'"');return $e.code[t]}function ro(e){if(!Object.prototype.hasOwnProperty.call($e.message,e))throw new Error("invalid status code: "+e);return $e.message[e]}function $e(e){if(typeof e=="number")return ro(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?rp(e):ro(t)}var jr={exports:{}};typeof Object.create=="function"?jr.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:jr.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var ip=jr.exports;/*!
14
+ */var ei=Jf,ep=$e;$e.message=ei;$e.code=tp(ei);$e.codes=np(ei);$e.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};$e.empty={204:!0,205:!0,304:!0};$e.retry={502:!0,503:!0,504:!0};function tp(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r],s=Number(r);t[i.toLowerCase()]=s}),t}function np(e){return Object.keys(e).map(function(n){return Number(n)})}function rp(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call($e.code,t))throw new Error('invalid status message: "'+e+'"');return $e.code[t]}function to(e){if(!Object.prototype.hasOwnProperty.call($e.message,e))throw new Error("invalid status code: "+e);return $e.message[e]}function $e(e){if(typeof e=="number")return to(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?rp(e):to(t)}var jr={exports:{}};typeof Object.create=="function"?jr.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:jr.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var ip=jr.exports;/*!
15
15
  * toidentifier
16
16
  * Copyright(c) 2016 Douglas Christopher Wilson
17
17
  * MIT Licensed
@@ -20,14 +20,14 @@ attempted value: ${s}
20
20
  * Copyright(c) 2014 Jonathan Ong
21
21
  * Copyright(c) 2016 Douglas Christopher Wilson
22
22
  * MIT Licensed
23
- */(function(e){zf("http-errors");var t=Qf,n=ep,r=ip,i=op;e.exports=o,e.exports.HttpError=a(),e.exports.isHttpError=l(e.exports.HttpError),p(e.exports,n.codes,e.exports.HttpError);function s(h){return+(String(h).charAt(0)+"00")}function o(){for(var h,g,m=500,w={},_=0;_<arguments.length;_++){var C=arguments[_],T=typeof C;if(T==="object"&&C instanceof Error)h=C,m=h.status||h.statusCode||m;else if(T==="number"&&_===0)m=C;else if(T==="string")g=C;else if(T==="object")w=C;else throw new TypeError("argument #"+(_+1)+" unsupported type "+T)}(typeof m!="number"||!n.message[m]&&(m<400||m>=600))&&(m=500);var R=o[m]||o[s(m)];h||(h=R?new R(g):new Error(g||n.message[m]),Error.captureStackTrace(h,o)),(!R||!(h instanceof R)||h.status!==m)&&(h.expose=m<500,h.status=h.statusCode=m);for(var F in w)F!=="status"&&F!=="statusCode"&&(h[F]=w[F]);return h}function a(){function h(){throw new TypeError("cannot construct abstract class")}return r(h,Error),h}function u(h,g,m){var w=d(g);function _(C){var T=C??n.message[m],R=new Error(T);return Error.captureStackTrace(R,_),t(R,_.prototype),Object.defineProperty(R,"message",{enumerable:!0,configurable:!0,value:T,writable:!0}),Object.defineProperty(R,"name",{enumerable:!1,configurable:!0,value:w,writable:!0}),R}return r(_,h),f(_,w),_.prototype.status=m,_.prototype.statusCode=m,_.prototype.expose=!0,_}function l(h){return function(m){return!m||typeof m!="object"?!1:m instanceof h?!0:m instanceof Error&&typeof m.expose=="boolean"&&typeof m.statusCode=="number"&&m.status===m.statusCode}}function c(h,g,m){var w=d(g);function _(C){var T=C??n.message[m],R=new Error(T);return Error.captureStackTrace(R,_),t(R,_.prototype),Object.defineProperty(R,"message",{enumerable:!0,configurable:!0,value:T,writable:!0}),Object.defineProperty(R,"name",{enumerable:!1,configurable:!0,value:w,writable:!0}),R}return r(_,h),f(_,w),_.prototype.status=m,_.prototype.statusCode=m,_.prototype.expose=!1,_}function f(h,g){var m=Object.getOwnPropertyDescriptor(h,"name");m&&m.configurable&&(m.value=g,Object.defineProperty(h,"name",m))}function p(h,g,m){g.forEach(function(_){var C,T=i(n.message[_]);switch(s(_)){case 400:C=u(m,T,_);break;case 500:C=c(m,T,_);break}C&&(h[_]=C,h[T]=C)})}function d(h){return h.substr(-5)!=="Error"?h+"Error":h}})(Ws);var ap=Ws.exports,up=(e,t=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof n.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(t===0)return e;const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,n.indent.repeat(t))};const io=Hn.default,oo=/\s+at.*(?:\(|\s)(.*)\)?/,cp=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,lp=typeof io.homedir>"u"?"":io.homedir();var fp=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split(`
24
- `).filter(n=>{const r=n.match(oo);if(r===null||!r[1])return!0;const i=r[1];return i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")?!1:!cp.test(i)}).filter(n=>n.trim()!=="").map(n=>t.pretty?n.replace(oo,(r,i)=>r.replace(i,i.replace(lp,"~"))):n).join(`
23
+ */(function(e){Kf("http-errors");var t=Qf,n=ep,r=ip,i=op;e.exports=o,e.exports.HttpError=a(),e.exports.isHttpError=f(e.exports.HttpError),p(e.exports,n.codes,e.exports.HttpError);function s(h){return+(String(h).charAt(0)+"00")}function o(){for(var h,m,g=500,w={},_=0;_<arguments.length;_++){var C=arguments[_],T=typeof C;if(T==="object"&&C instanceof Error)h=C,g=h.status||h.statusCode||g;else if(T==="number"&&_===0)g=C;else if(T==="string")m=C;else if(T==="object")w=C;else throw new TypeError("argument #"+(_+1)+" unsupported type "+T)}(typeof g!="number"||!n.message[g]&&(g<400||g>=600))&&(g=500);var R=o[g]||o[s(g)];h||(h=R?new R(m):new Error(m||n.message[g]),Error.captureStackTrace(h,o)),(!R||!(h instanceof R)||h.status!==g)&&(h.expose=g<500,h.status=h.statusCode=g);for(var F in w)F!=="status"&&F!=="statusCode"&&(h[F]=w[F]);return h}function a(){function h(){throw new TypeError("cannot construct abstract class")}return r(h,Error),h}function u(h,m,g){var w=d(m);function _(C){var T=C??n.message[g],R=new Error(T);return Error.captureStackTrace(R,_),t(R,_.prototype),Object.defineProperty(R,"message",{enumerable:!0,configurable:!0,value:T,writable:!0}),Object.defineProperty(R,"name",{enumerable:!1,configurable:!0,value:w,writable:!0}),R}return r(_,h),l(_,w),_.prototype.status=g,_.prototype.statusCode=g,_.prototype.expose=!0,_}function f(h){return function(g){return!g||typeof g!="object"?!1:g instanceof h?!0:g instanceof Error&&typeof g.expose=="boolean"&&typeof g.statusCode=="number"&&g.status===g.statusCode}}function c(h,m,g){var w=d(m);function _(C){var T=C??n.message[g],R=new Error(T);return Error.captureStackTrace(R,_),t(R,_.prototype),Object.defineProperty(R,"message",{enumerable:!0,configurable:!0,value:T,writable:!0}),Object.defineProperty(R,"name",{enumerable:!1,configurable:!0,value:w,writable:!0}),R}return r(_,h),l(_,w),_.prototype.status=g,_.prototype.statusCode=g,_.prototype.expose=!1,_}function l(h,m){var g=Object.getOwnPropertyDescriptor(h,"name");g&&g.configurable&&(g.value=m,Object.defineProperty(h,"name",g))}function p(h,m,g){m.forEach(function(_){var C,T=i(n.message[_]);switch(s(_)){case 400:C=u(g,T,_);break;case 500:C=c(g,T,_);break}C&&(h[_]=C,h[T]=C)})}function d(h){return h.substr(-5)!=="Error"?h+"Error":h}})(Ks);var ap=Ks.exports,up=(e,t=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof n.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(t===0)return e;const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,n.indent.repeat(t))};const no=Bn.default,ro=/\s+at.*(?:\(|\s)(.*)\)?/,cp=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,lp=typeof no.homedir>"u"?"":no.homedir();var fp=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split(`
24
+ `).filter(n=>{const r=n.match(ro);if(r===null||!r[1])return!0;const i=r[1];return i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")?!1:!cp.test(i)}).filter(n=>n.trim()!=="").map(n=>t.pretty?n.replace(ro,(r,i)=>r.replace(i,i.replace(lp,"~"))):n).join(`
25
25
  `));const pp=up,dp=fp,hp=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let mp=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let n=t.map(r=>typeof r.stack=="string"?hp(dp(r.stack)):String(r)).join(`
26
26
  `);n=`
27
- `+pp(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}};var gp=mp;const yp=gp;var vp=async(e,t,{concurrency:n=1/0,stopOnError:r=!0}={})=>new Promise((i,s)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===1/0)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);const o=[],a=[],u=e[Symbol.iterator]();let l=!1,c=!1,f=0,p=0;const d=()=>{if(l)return;const h=u.next(),g=p;if(p++,h.done){c=!0,f===0&&(!r&&a.length!==0?s(new yp(a)):i(o));return}f++,(async()=>{try{const m=await h.value;o[g]=await t(m,g),f--,d()}catch(m){r?(l=!0,s(m)):(a.push(m),f--,d())}})()};for(let h=0;h<n&&(d(),!c);h++);});const Ep=Ns(vp);var qt={exports:{}},Ft={exports:{}},ur,so;function wp(){if(so)return ur;so=1,ur=r,r.sync=i;var e=We.default;function t(s,o){var a=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var u=0;u<a.length;u++){var l=a[u].toLowerCase();if(l&&s.substr(-l.length).toLowerCase()===l)return!0}return!1}function n(s,o,a){return!s.isSymbolicLink()&&!s.isFile()?!1:t(o,a)}function r(s,o,a){e.stat(s,function(u,l){a(u,u?!1:n(l,s,o))})}function i(s,o){return n(e.statSync(s),s,o)}return ur}var cr,ao;function bp(){if(ao)return cr;ao=1,cr=t,t.sync=n;var e=We.default;function t(s,o,a){e.stat(s,function(u,l){a(u,u?!1:r(l,o))})}function n(s,o){return r(e.statSync(s),o)}function r(s,o){return s.isFile()&&i(s,o)}function i(s,o){var a=s.mode,u=s.uid,l=s.gid,c=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),f=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),p=parseInt("100",8),d=parseInt("010",8),h=parseInt("001",8),g=p|d,m=a&h||a&d&&l===f||a&p&&u===c||a&g&&c===0;return m}return cr}var xn;process.platform==="win32"||ye.TESTING_WINDOWS?xn=wp():xn=bp();var _p=ri;ri.sync=xp;function ri(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){ri(e,t||{},function(s,o){s?i(s):r(o)})})}xn(e,t||{},function(r,i){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function xp(e,t){try{return xn.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const mt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ys=Ee.default,Ap=mt?";":":",Vs=_p,Qs=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Xs=(e,t)=>{const n=t.colon||Ap,r=e.match(/\//)||mt&&e.match(/\\/)?[""]:[...mt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],i=mt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=mt?i.split(n):[""];return mt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:i}},Zs=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:i,pathExtExe:s}=Xs(e,t),o=[],a=l=>new Promise((c,f)=>{if(l===r.length)return t.all&&o.length?c(o):f(Qs(e));const p=r[l],d=/^".*"$/.test(p)?p.slice(1,-1):p,h=Ys.join(d,e),g=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;c(u(g,l,0))}),u=(l,c,f)=>new Promise((p,d)=>{if(f===i.length)return p(a(c+1));const h=i[f];Vs(l+h,{pathExt:s},(g,m)=>{if(!g&&m)if(t.all)o.push(l+h);else return p(l+h);return p(u(l,c,f+1))})});return n?a(0).then(l=>n(null,l),n):a(0)},Sp=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:i}=Xs(e,t),s=[];for(let o=0;o<n.length;o++){const a=n[o],u=/^".*"$/.test(a)?a.slice(1,-1):a,l=Ys.join(u,e),c=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let f=0;f<r.length;f++){const p=c+r[f];try{if(Vs.sync(p,{pathExt:i}))if(t.all)s.push(p);else return p}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Qs(e)};var Tp=Zs;Zs.sync=Sp;var ii={exports:{}};const Js=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};ii.exports=Js;ii.exports.default=Js;var ea=ii.exports;const uo=Ee.default,Cp=Tp,Rp=ea;function co(e,t){const n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let o;try{o=Cp.sync(e.command,{path:n[Rp({env:n})],pathExt:t?uo.delimiter:void 0})}catch{}finally{s&&process.chdir(r)}return o&&(o=uo.resolve(i?e.options.cwd:"",o)),o}function $p(e){return co(e)||co(e,!0)}var Fp=$p,oi={};const Hr=/([()\][%!^"`<>&|;, *?])/g;function Ip(e){return e=e.replace(Hr,"^$1"),e}function Op(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Hr,"^$1"),t&&(e=e.replace(Hr,"^$1")),e}oi.command=Ip;oi.argument=Op;var Np=/^#!(.*)/;const Pp=Np;var Lp=(e="")=>{const t=e.match(Pp);if(!t)return null;const[n,r]=t[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i};const lr=We.default,Dp=Lp;function Mp(e){const n=Buffer.alloc(150);let r;try{r=lr.openSync(e,"r"),lr.readSync(r,n,0,150,0),lr.closeSync(r)}catch{}return Dp(n.toString())}var kp=Mp;const jp=Ee.default,lo=Fp,fo=oi,Hp=kp,Bp=process.platform==="win32",Up=/\.(?:com|exe)$/i,Gp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qp(e){e.file=lo(e);const t=e.file&&Hp(e.file);return t?(e.args.unshift(e.file),e.command=t,lo(e)):e.file}function Kp(e){if(!Bp)return e;const t=qp(e),n=!Up.test(t);if(e.options.forceShell||n){const r=Gp.test(t);e.command=jp.normalize(e.command),e.command=fo.command(e.command),e.args=e.args.map(s=>fo.argument(s,r));const i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function zp(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Kp(r)}var Wp=zp;const si=process.platform==="win32";function ai(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Yp(e,t){if(!si)return;const n=e.emit;e.emit=function(r,i){if(r==="exit"){const s=ta(i,t);if(s)return n.call(e,"error",s)}return n.apply(e,arguments)}}function ta(e,t){return si&&e===1&&!t.file?ai(t.original,"spawn"):null}function Vp(e,t){return si&&e===1&&!t.file?ai(t.original,"spawnSync"):null}var Qp={hookChildProcess:Yp,verifyENOENT:ta,verifyENOENTSync:Vp,notFoundError:ai};const na=mn.default,ui=Wp,ci=Qp;function ra(e,t,n){const r=ui(e,t,n),i=na.spawn(r.command,r.args,r.options);return ci.hookChildProcess(i,r),i}function Xp(e,t,n){const r=ui(e,t,n),i=na.spawnSync(r.command,r.args,r.options);return i.error=i.error||ci.verifyENOENTSync(i.status,r),i}Ft.exports=ra;Ft.exports.spawn=ra;Ft.exports.sync=Xp;Ft.exports._parse=ui;Ft.exports._enoent=ci;var Zp=Ft.exports,Jp=e=>{const t=typeof e=="string"?`
28
- `:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e},li={exports:{}};li.exports;(function(e){const t=Ee.default,n=ea,r=i=>{i={cwd:process.cwd(),path:process.env[n()],execPath:process.execPath,...i};let s,o=t.resolve(i.cwd);const a=[];for(;s!==o;)a.push(t.join(o,"node_modules/.bin")),s=o,o=t.resolve(o,"..");const u=t.resolve(i.cwd,i.execPath,"..");return a.push(u),a.concat(i.path).join(t.delimiter)};e.exports=r,e.exports.default=r,e.exports.env=i=>{i={env:process.env,...i};const s={...i.env},o=n({env:s});return i.path=s[o],s[o]=e.exports(i),s}})(li);var ed=li.exports,Kn={exports:{}},fi={exports:{}};const ia=(e,t)=>{for(const n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};fi.exports=ia;fi.exports.default=ia;var td=fi.exports;const nd=td,An=new WeakMap,oa=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0;const i=e.displayName||e.name||"<anonymous>",s=function(...o){if(An.set(s,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return nd(s,e),An.set(s,r),s};Kn.exports=oa;Kn.exports.default=oa;Kn.exports.callCount=e=>{if(!An.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return An.get(e)};var rd=Kn.exports,Tt={},zn={},Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.SIGNALS=void 0;const id=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Wn.SIGNALS=id;var ot={};Object.defineProperty(ot,"__esModule",{value:!0});ot.SIGRTMAX=ot.getRealtimeSignals=void 0;const od=function(){const e=aa-sa+1;return Array.from({length:e},sd)};ot.getRealtimeSignals=od;const sd=function(e,t){return{name:`SIGRT${t+1}`,number:sa+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},sa=34,aa=64;ot.SIGRTMAX=aa;Object.defineProperty(zn,"__esModule",{value:!0});zn.getSignals=void 0;var ad=Hn.default,ud=Wn,cd=ot;const ld=function(){const e=(0,cd.getRealtimeSignals)();return[...ud.SIGNALS,...e].map(fd)};zn.getSignals=ld;const fd=function({name:e,number:t,description:n,action:r,forced:i=!1,standard:s}){const{signals:{[e]:o}}=ad.constants,a=o!==void 0;return{name:e,number:a?o:t,description:n,supported:a,action:r,forced:i,standard:s}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.signalsByNumber=Tt.signalsByName=void 0;var pd=Hn.default,ua=zn,dd=ot;const hd=function(){return(0,ua.getSignals)().reduce(md,{})},md=function(e,{name:t,number:n,description:r,supported:i,action:s,forced:o,standard:a}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:s,forced:o,standard:a}}},gd=hd();Tt.signalsByName=gd;const yd=function(){const e=(0,ua.getSignals)(),t=dd.SIGRTMAX+1,n=Array.from({length:t},(r,i)=>vd(i,e));return Object.assign({},...n)},vd=function(e,t){const n=Ed(e,t);if(n===void 0)return{};const{name:r,description:i,supported:s,action:o,forced:a,standard:u}=n;return{[e]:{name:r,number:e,description:i,supported:s,action:o,forced:a,standard:u}}},Ed=function(e,t){const n=t.find(({name:r})=>pd.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},wd=yd();Tt.signalsByNumber=wd;const{signalsByName:bd}=Tt,_d=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:s,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:s!==void 0?`failed with exit code ${s}`:"failed",xd=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:s,command:o,escapedCommand:a,timedOut:u,isCanceled:l,killed:c,parsed:{options:{timeout:f}}})=>{s=s===null?void 0:s,i=i===null?void 0:i;const p=i===void 0?void 0:bd[i].description,d=r&&r.code,g=`Command ${_d({timedOut:u,timeout:f,errorCode:d,signal:i,signalDescription:p,exitCode:s,isCanceled:l})}: ${o}`,m=Object.prototype.toString.call(r)==="[object Error]",w=m?`${g}
29
- ${r.message}`:g,_=[w,t,e].filter(Boolean).join(`
30
- `);return m?(r.originalMessage=r.message,r.message=_):r=new Error(_),r.shortMessage=w,r.command=o,r.escapedCommand=a,r.exitCode=s,r.signal=i,r.signalDescription=p,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!u,r.isCanceled=l,r.killed=c&&!u,r};var Ad=xd,pi={exports:{}};const cn=["stdin","stdout","stderr"],Sd=e=>cn.some(t=>e[t]!==void 0),ca=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return cn.map(r=>e[r]);if(Sd(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${cn.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,cn.length);return Array.from({length:n},(r,i)=>t[i])};pi.exports=ca;pi.exports.node=e=>{const t=ca(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]};var Td=pi.exports,gt={exports:{}},fr={exports:{}},po;function Cd(){return po||(po=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(fr)),fr.exports}var ee=ye.process;const Ye=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!Ye(ee))gt.exports=function(){return function(){}};else{var Rd=ws.default,Pt=Cd(),$d=/^win/i.test(ee.platform),nn=wc.default;typeof nn!="function"&&(nn=nn.EventEmitter);var le;ee.__signal_exit_emitter__?le=ee.__signal_exit_emitter__:(le=ee.__signal_exit_emitter__=new nn,le.count=0,le.emitted={}),le.infinite||(le.setMaxListeners(1/0),le.infinite=!0),gt.exports=function(e,t){if(!Ye(ye.process))return function(){};Rd.equal(typeof e,"function","a callback must be provided for exit handler"),Lt===!1&&ho();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){le.removeListener(n,e),le.listeners("exit").length===0&&le.listeners("afterexit").length===0&&pr()};return le.on(n,e),r};var pr=function(){!Lt||!Ye(ye.process)||(Lt=!1,Pt.forEach(function(t){try{ee.removeListener(t,dr[t])}catch{}}),ee.emit=hr,ee.reallyExit=mo,le.count-=1)};gt.exports.unload=pr;var lt=function(t,n,r){le.emitted[t]||(le.emitted[t]=!0,le.emit(t,n,r))},dr={};Pt.forEach(function(e){dr[e]=function(){if(Ye(ye.process)){var n=ee.listeners(e);n.length===le.count&&(pr(),lt("exit",null,e),lt("afterexit",null,e),$d&&e==="SIGHUP"&&(e="SIGINT"),ee.kill(ee.pid,e))}}}),gt.exports.signals=function(){return Pt};var Lt=!1,ho=function(){Lt||!Ye(ye.process)||(Lt=!0,le.count+=1,Pt=Pt.filter(function(t){try{return ee.on(t,dr[t]),!0}catch{return!1}}),ee.emit=Id,ee.reallyExit=Fd)};gt.exports.load=ho;var mo=ee.reallyExit,Fd=function(t){Ye(ye.process)&&(ee.exitCode=t||0,lt("exit",ee.exitCode,null),lt("afterexit",ee.exitCode,null),mo.call(ee,ee.exitCode))},hr=ee.emit,Id=function(t,n){if(t==="exit"&&Ye(ye.process)){n!==void 0&&(ee.exitCode=n);var r=hr.apply(this,arguments);return lt("exit",ee.exitCode,null),lt("afterexit",ee.exitCode,null),r}else return hr.apply(this,arguments)}}var Od=gt.exports;const Nd=Hn.default,Pd=Od,Ld=1e3*5,Dd=(e,t="SIGTERM",n={})=>{const r=e(t);return Md(e,t,n,r),r},Md=(e,t,n,r)=>{if(!kd(t,n,r))return;const i=Hd(n),s=setTimeout(()=>{e("SIGKILL")},i);s.unref&&s.unref()},kd=(e,{forceKillAfterTimeout:t},n)=>jd(e)&&t!==!1&&n,jd=e=>e===Nd.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Hd=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Ld;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Bd=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Ud=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Gd=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let i;const s=new Promise((a,u)=>{i=setTimeout(()=>{Ud(e,n,u)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([s,o])},qd=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Kd=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;const i=Pd(()=>{e.kill()});return r.finally(()=>{i()})};var zd={spawnedKill:Dd,spawnedCancel:Bd,setupTimeout:Gd,validateTimeout:qd,setExitHandler:Kd};const De=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";De.writable=e=>De(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";De.readable=e=>De(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";De.duplex=e=>De.writable(e)&&De.readable(e);De.transform=e=>De.duplex(e)&&typeof e._transform=="function";var Wd=De,Kt={exports:{}};const{PassThrough:Yd}=Bn.default;var Vd=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const r=n==="buffer";let i=!1;t?i=!(n||r):n=n||"utf8",r&&(n=null);const s=new Yd({objectMode:i});n&&s.setEncoding(n);let o=0;const a=[];return s.on("data",u=>{a.push(u),i?o=a.length:o+=u.length}),s.getBufferedValue=()=>t?a:r?Buffer.concat(a,o):a.join(""),s.getBufferedLength=()=>o,s};const{constants:Qd}=bc.default,Xd=Bn.default,{promisify:Zd}=at.default,Jd=Vd,eh=Zd(Xd.pipeline);class la extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function di(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:n}=t,r=Jd(t);return await new Promise((i,s)=>{const o=a=>{a&&r.getBufferedLength()<=Qd.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),s(a)};(async()=>{try{await eh(e,r),i()}catch(a){o(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&o(new la)})}),r.getBufferedValue()}Kt.exports=di;Kt.exports.buffer=(e,t)=>di(e,{...t,encoding:"buffer"});Kt.exports.array=(e,t)=>di(e,{...t,array:!0});Kt.exports.MaxBufferError=la;var th=Kt.exports;const{PassThrough:nh}=Bn.default;var rh=function(){var e=[],t=new nh({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),t;function n(s){return Array.isArray(s)?(s.forEach(n),this):(e.push(s),s.once("end",i.bind(null,s)),s.once("error",t.emit.bind(t,"error")),s.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(s){e=e.filter(function(o){return o!==s}),!e.length&&t.readable&&t.end()}};const fa=Wd,go=th,ih=rh,oh=(e,t)=>{t===void 0||e.stdin===void 0||(fa(t)?t.pipe(e.stdin):e.stdin.end(t))},sh=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const n=ih();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},mr=async(e,t)=>{if(e){e.destroy();try{return await t}catch(n){return n.bufferedData}}},gr=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?go(e,{encoding:t,maxBuffer:r}):go.buffer(e,{maxBuffer:r})},ah=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:s},o)=>{const a=gr(e,{encoding:r,buffer:i,maxBuffer:s}),u=gr(t,{encoding:r,buffer:i,maxBuffer:s}),l=gr(n,{encoding:r,buffer:i,maxBuffer:s*2});try{return await Promise.all([o,a,u,l])}catch(c){return Promise.all([{error:c,signal:c.signal,timedOut:c.timedOut},mr(e,a),mr(t,u),mr(n,l)])}},uh=({input:e})=>{if(fa(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};var ch={handleInput:oh,makeAllStream:sh,getSpawnedResult:ah,validateInputSync:uh};const lh=(async()=>{})().constructor.prototype,fh=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(lh,e)]),ph=(e,t)=>{for(const[n,r]of fh){const i=typeof t=="function"?(...s)=>Reflect.apply(r.value,t(),s):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}return e},dh=e=>new Promise((t,n)=>{e.on("exit",(r,i)=>{t({exitCode:r,signal:i})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});var hh={mergePromise:ph,getSpawnedPromise:dh};const pa=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],mh=/^[\w.-]+$/,gh=/"/g,yh=e=>typeof e!="string"||mh.test(e)?e:`"${e.replace(gh,'\\"')}"`,vh=(e,t)=>pa(e,t).join(" "),Eh=(e,t)=>pa(e,t).map(n=>yh(n)).join(" "),wh=/ +/g,bh=e=>{const t=[];for(const n of e.trim().split(wh)){const r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t};var _h={joinCommand:vh,getEscapedCommand:Eh,parseCommand:bh};const xh=Ee.default,Br=mn.default,Ah=Zp,Sh=Jp,Th=ed,Ch=rd,Sn=Ad,da=Td,{spawnedKill:Rh,spawnedCancel:$h,setupTimeout:Fh,validateTimeout:Ih,setExitHandler:Oh}=zd,{handleInput:Nh,getSpawnedResult:Ph,makeAllStream:Lh,validateInputSync:Dh}=ch,{mergePromise:yo,getSpawnedPromise:Mh}=hh,{joinCommand:ha,parseCommand:ma,getEscapedCommand:ga}=_h,kh=1e3*1e3*100,jh=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{const s=t?{...process.env,...e}:e;return n?Th.env({env:s,cwd:r,execPath:i}):s},ya=(e,t,n={})=>{const r=Ah._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:kh,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=jh(n),n.stdio=da(n),process.platform==="win32"&&xh.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},kt=(e,t,n)=>typeof t!="string"&&!Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?Sh(t):t,Yn=(e,t,n)=>{const r=ya(e,t,n),i=ha(e,t),s=ga(e,t);Ih(r.options);let o;try{o=Br.spawn(r.file,r.args,r.options)}catch(d){const h=new Br.ChildProcess,g=Promise.reject(Sn({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return yo(h,g)}const a=Mh(o),u=Fh(o,r.options,a),l=Oh(o,r.options,u),c={isCanceled:!1};o.kill=Rh.bind(null,o.kill.bind(o)),o.cancel=$h.bind(null,o,c);const p=Ch(async()=>{const[{error:d,exitCode:h,signal:g,timedOut:m},w,_,C]=await Ph(o,r.options,l),T=kt(r.options,w),R=kt(r.options,_),F=kt(r.options,C);if(d||h!==0||g!==null){const j=Sn({error:d,exitCode:h,signal:g,stdout:T,stderr:R,all:F,command:i,escapedCommand:s,parsed:r,timedOut:m,isCanceled:c.isCanceled,killed:o.killed});if(!r.options.reject)return j;throw j}return{command:i,escapedCommand:s,exitCode:0,stdout:T,stderr:R,all:F,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Nh(o,r.options.input),o.all=Lh(o,r.options),yo(o,p)};qt.exports=Yn;qt.exports.sync=(e,t,n)=>{const r=ya(e,t,n),i=ha(e,t),s=ga(e,t);Dh(r.options);let o;try{o=Br.spawnSync(r.file,r.args,r.options)}catch(l){throw Sn({error:l,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}const a=kt(r.options,o.stdout,o.error),u=kt(r.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){const l=Sn({stdout:a,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:s,parsed:r,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!r.options.reject)return l;throw l}return{command:i,escapedCommand:s,exitCode:0,stdout:a,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};qt.exports.command=(e,t)=>{const[n,...r]=ma(e);return Yn(n,r,t)};qt.exports.commandSync=(e,t)=>{const[n,...r]=ma(e);return Yn.sync(n,r,t)};qt.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(n=t,t=[]);const r=da.node(n),i=process.execArgv.filter(a=>!a.startsWith("--inspect")),{nodePath:s=process.execPath,nodeOptions:o=i}=n;return Yn(s,[...o,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})};var _e={},Vn={exports:{}},va={exports:{}},hi={exports:{}},mi={exports:{}},gi={exports:{}},yi={exports:{}};const Ea=(e,...t)=>new Promise(n=>{n(e(...t))});yi.exports=Ea;yi.exports.default=Ea;var Hh=yi.exports;const Bh=Hh,wa=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));const t=[];let n=0;const r=()=>{n--,t.length>0&&t.shift()()},i=(a,u,...l)=>{n++;const c=Bh(a,...l);u(c),c.then(r,r)},s=(a,u,...l)=>{n<e?i(a,u,...l):t.push(i.bind(null,a,u,...l))},o=(a,...u)=>new Promise(l=>s(a,l,...u));return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}}),o};gi.exports=wa;gi.exports.default=wa;var Uh=gi.exports;const vo=Uh;let ba=class extends Error{constructor(t){super(),this.value=t}};const Gh=async(e,t)=>t(await e),qh=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new ba(t[0]);return!1},_a=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=vo(n.concurrency),i=[...e].map(o=>[o,r(Gh,o,t)]),s=vo(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>s(qh,o)))}catch(o){if(o instanceof ba)return o.value;throw o}};mi.exports=_a;mi.exports.default=_a;var Kh=mi.exports;const xa=Ee.default,Tn=We.default,{promisify:Aa}=at.default,zh=Kh,Wh=Aa(Tn.stat),Yh=Aa(Tn.lstat),Sa={directory:"isDirectory",file:"isFile"};function Ta({type:e}){if(!(e in Sa))throw new Error(`Invalid type specified: ${e}`)}const Ca=(e,t)=>e===void 0||t[Sa[e]]();hi.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Ta(t);const n=t.allowSymlinks?Wh:Yh;return zh(e,async r=>{try{const i=await n(xa.resolve(t.cwd,r));return Ca(t.type,i)}catch{return!1}},t)};hi.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Ta(t);const n=t.allowSymlinks?Tn.statSync:Tn.lstatSync;for(const r of e)try{const i=n(xa.resolve(t.cwd,r));if(Ca(t.type,i))return r}catch{}};var Vh=hi.exports,vi={exports:{}};const Ra=We.default,{promisify:Qh}=at.default,Xh=Qh(Ra.access);vi.exports=async e=>{try{return await Xh(e),!0}catch{return!1}};vi.exports.sync=e=>{try{return Ra.accessSync(e),!0}catch{return!1}};var $a=vi.exports;(function(e){const t=Ee.default,n=Vh,r=$a,i=Symbol("findUp.stop");e.exports=async(s,o={})=>{let a=t.resolve(o.cwd||"");const{root:u}=t.parse(a),l=[].concat(s),c=async f=>{if(typeof s!="function")return n(l,f);const p=await s(f.cwd);return typeof p=="string"?n([p],f):p};for(;;){const f=await c({...o,cwd:a});if(f===i)return;if(f)return t.resolve(a,f);if(a===u)return;a=t.dirname(a)}},e.exports.sync=(s,o={})=>{let a=t.resolve(o.cwd||"");const{root:u}=t.parse(a),l=[].concat(s),c=f=>{if(typeof s!="function")return n.sync(l,f);const p=s(f.cwd);return typeof p=="string"?n.sync([p],f):p};for(;;){const f=c({...o,cwd:a});if(f===i)return;if(f)return t.resolve(a,f);if(a===u)return;a=t.dirname(a)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(va);var Zh=va.exports;const Fa=Ee.default,Ia=Zh,Oa=async e=>{const t=await Ia("package.json",{cwd:e});return t&&Fa.dirname(t)};Vn.exports=Oa;Vn.exports.default=Oa;Vn.exports.sync=e=>{const t=Ia.sync("package.json",{cwd:e});return t&&Fa.dirname(t)};var Jh=Vn.exports,Qn={};(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,n)=>t.nodes.find(r=>r.type===n),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(t,n=0,r)=>{const i=t.nodes[n];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0),e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0,e.reduce=t=>t.reduce((n,r)=>(r.type==="text"&&n.push(r.value),r.type==="range"&&(r.type="text"),n),[]),e.flatten=(...t)=>{const n=[],r=i=>{for(let s=0;s<i.length;s++){const o=i[s];if(Array.isArray(o)){r(o);continue}o!==void 0&&n.push(o)}return n};return r(t),n}})(Qn);const Eo=Qn;var Ei=(e,t={})=>{const n=(r,i={})=>{const s=t.escapeInvalid&&Eo.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0;let a="";if(r.value)return(s||o)&&Eo.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(const u of r.nodes)a+=n(u);return a};return n(e)};/*!
27
+ `+pp(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}};var gp=mp;const yp=gp;var vp=async(e,t,{concurrency:n=1/0,stopOnError:r=!0}={})=>new Promise((i,s)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===1/0)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);const o=[],a=[],u=e[Symbol.iterator]();let f=!1,c=!1,l=0,p=0;const d=()=>{if(f)return;const h=u.next(),m=p;if(p++,h.done){c=!0,l===0&&(!r&&a.length!==0?s(new yp(a)):i(o));return}l++,(async()=>{try{const g=await h.value;o[m]=await t(g,m),l--,d()}catch(g){r?(f=!0,s(g)):(a.push(g),l--,d())}})()};for(let h=0;h<n&&(d(),!c);h++);});const Ep=Ns(vp);var qt={exports:{}},Ft={exports:{}},ur,io;function wp(){if(io)return ur;io=1,ur=r,r.sync=i;var e=Ye.default;function t(s,o){var a=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var u=0;u<a.length;u++){var f=a[u].toLowerCase();if(f&&s.substr(-f.length).toLowerCase()===f)return!0}return!1}function n(s,o,a){return!s.isSymbolicLink()&&!s.isFile()?!1:t(o,a)}function r(s,o,a){e.stat(s,function(u,f){a(u,u?!1:n(f,s,o))})}function i(s,o){return n(e.statSync(s),s,o)}return ur}var cr,oo;function bp(){if(oo)return cr;oo=1,cr=t,t.sync=n;var e=Ye.default;function t(s,o,a){e.stat(s,function(u,f){a(u,u?!1:r(f,o))})}function n(s,o){return r(e.statSync(s),o)}function r(s,o){return s.isFile()&&i(s,o)}function i(s,o){var a=s.mode,u=s.uid,f=s.gid,c=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),l=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),p=parseInt("100",8),d=parseInt("010",8),h=parseInt("001",8),m=p|d,g=a&h||a&d&&f===l||a&p&&u===c||a&m&&c===0;return g}return cr}var xn;process.platform==="win32"||ye.TESTING_WINDOWS?xn=wp():xn=bp();var _p=ti;ti.sync=xp;function ti(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){ti(e,t||{},function(s,o){s?i(s):r(o)})})}xn(e,t||{},function(r,i){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function xp(e,t){try{return xn.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const gt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ws=Ee.default,Sp=gt?";":":",Ys=_p,Vs=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Qs=(e,t)=>{const n=t.colon||Sp,r=e.match(/\//)||gt&&e.match(/\\/)?[""]:[...gt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],i=gt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=gt?i.split(n):[""];return gt&&e.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:r,pathExt:s,pathExtExe:i}},Xs=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:i,pathExtExe:s}=Qs(e,t),o=[],a=f=>new Promise((c,l)=>{if(f===r.length)return t.all&&o.length?c(o):l(Vs(e));const p=r[f],d=/^".*"$/.test(p)?p.slice(1,-1):p,h=Ws.join(d,e),m=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;c(u(m,f,0))}),u=(f,c,l)=>new Promise((p,d)=>{if(l===i.length)return p(a(c+1));const h=i[l];Ys(f+h,{pathExt:s},(m,g)=>{if(!m&&g)if(t.all)o.push(f+h);else return p(f+h);return p(u(f,c,l+1))})});return n?a(0).then(f=>n(null,f),n):a(0)},Ap=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:i}=Qs(e,t),s=[];for(let o=0;o<n.length;o++){const a=n[o],u=/^".*"$/.test(a)?a.slice(1,-1):a,f=Ws.join(u,e),c=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let l=0;l<r.length;l++){const p=c+r[l];try{if(Ys.sync(p,{pathExt:i}))if(t.all)s.push(p);else return p}catch{}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw Vs(e)};var Tp=Xs;Xs.sync=Ap;var ni={exports:{}};const Zs=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};ni.exports=Zs;ni.exports.default=Zs;var Js=ni.exports;const so=Ee.default,Cp=Tp,Rp=Js;function ao(e,t){const n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,s=i&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(e.options.cwd)}catch{}let o;try{o=Cp.sync(e.command,{path:n[Rp({env:n})],pathExt:t?so.delimiter:void 0})}catch{}finally{s&&process.chdir(r)}return o&&(o=so.resolve(i?e.options.cwd:"",o)),o}function $p(e){return ao(e)||ao(e,!0)}var Fp=$p,ri={};const Br=/([()\][%!^"`<>&|;, *?])/g;function Ip(e){return e=e.replace(Br,"^$1"),e}function Op(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Br,"^$1"),t&&(e=e.replace(Br,"^$1")),e}ri.command=Ip;ri.argument=Op;var Np=/^#!(.*)/;const Pp=Np;var Lp=(e="")=>{const t=e.match(Pp);if(!t)return null;const[n,r]=t[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i};const lr=Ye.default,Dp=Lp;function kp(e){const n=Buffer.alloc(150);let r;try{r=lr.openSync(e,"r"),lr.readSync(r,n,0,150,0),lr.closeSync(r)}catch{}return Dp(n.toString())}var Mp=kp;const jp=Ee.default,uo=Fp,co=ri,Bp=Mp,Hp=process.platform==="win32",Up=/\.(?:com|exe)$/i,Gp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function qp(e){e.file=uo(e);const t=e.file&&Bp(e.file);return t?(e.args.unshift(e.file),e.command=t,uo(e)):e.file}function zp(e){if(!Hp)return e;const t=qp(e),n=!Up.test(t);if(e.options.forceShell||n){const r=Gp.test(t);e.command=jp.normalize(e.command),e.command=co.command(e.command),e.args=e.args.map(s=>co.argument(s,r));const i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Kp(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:zp(r)}var Wp=Kp;const ii=process.platform==="win32";function oi(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Yp(e,t){if(!ii)return;const n=e.emit;e.emit=function(r,i){if(r==="exit"){const s=ea(i,t);if(s)return n.call(e,"error",s)}return n.apply(e,arguments)}}function ea(e,t){return ii&&e===1&&!t.file?oi(t.original,"spawn"):null}function Vp(e,t){return ii&&e===1&&!t.file?oi(t.original,"spawnSync"):null}var Qp={hookChildProcess:Yp,verifyENOENT:ea,verifyENOENTSync:Vp,notFoundError:oi};const ta=mn.default,si=Wp,ai=Qp;function na(e,t,n){const r=si(e,t,n),i=ta.spawn(r.command,r.args,r.options);return ai.hookChildProcess(i,r),i}function Xp(e,t,n){const r=si(e,t,n),i=ta.spawnSync(r.command,r.args,r.options);return i.error=i.error||ai.verifyENOENTSync(i.status,r),i}Ft.exports=na;Ft.exports.spawn=na;Ft.exports.sync=Xp;Ft.exports._parse=si;Ft.exports._enoent=ai;var Zp=Ft.exports,Jp=e=>{const t=typeof e=="string"?`
28
+ `:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e},ui={exports:{}};ui.exports;(function(e){const t=Ee.default,n=Js,r=i=>{i={cwd:process.cwd(),path:process.env[n()],execPath:process.execPath,...i};let s,o=t.resolve(i.cwd);const a=[];for(;s!==o;)a.push(t.join(o,"node_modules/.bin")),s=o,o=t.resolve(o,"..");const u=t.resolve(i.cwd,i.execPath,"..");return a.push(u),a.concat(i.path).join(t.delimiter)};e.exports=r,e.exports.default=r,e.exports.env=i=>{i={env:process.env,...i};const s={...i.env},o=n({env:s});return i.path=s[o],s[o]=e.exports(i),s}})(ui);var ed=ui.exports,zn={exports:{}},ci={exports:{}};const ra=(e,t)=>{for(const n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};ci.exports=ra;ci.exports.default=ra;var td=ci.exports;const nd=td,Sn=new WeakMap,ia=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0;const i=e.displayName||e.name||"<anonymous>",s=function(...o){if(Sn.set(s,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return nd(s,e),Sn.set(s,r),s};zn.exports=ia;zn.exports.default=ia;zn.exports.callCount=e=>{if(!Sn.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Sn.get(e)};var rd=zn.exports,Ct={},Kn={},Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.SIGNALS=void 0;const id=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Wn.SIGNALS=id;var st={};Object.defineProperty(st,"__esModule",{value:!0});st.SIGRTMAX=st.getRealtimeSignals=void 0;const od=function(){const e=sa-oa+1;return Array.from({length:e},sd)};st.getRealtimeSignals=od;const sd=function(e,t){return{name:`SIGRT${t+1}`,number:oa+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},oa=34,sa=64;st.SIGRTMAX=sa;Object.defineProperty(Kn,"__esModule",{value:!0});Kn.getSignals=void 0;var ad=Bn.default,ud=Wn,cd=st;const ld=function(){const e=(0,cd.getRealtimeSignals)();return[...ud.SIGNALS,...e].map(fd)};Kn.getSignals=ld;const fd=function({name:e,number:t,description:n,action:r,forced:i=!1,standard:s}){const{signals:{[e]:o}}=ad.constants,a=o!==void 0;return{name:e,number:a?o:t,description:n,supported:a,action:r,forced:i,standard:s}};Object.defineProperty(Ct,"__esModule",{value:!0});Ct.signalsByNumber=Ct.signalsByName=void 0;var pd=Bn.default,aa=Kn,dd=st;const hd=function(){return(0,aa.getSignals)().reduce(md,{})},md=function(e,{name:t,number:n,description:r,supported:i,action:s,forced:o,standard:a}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:s,forced:o,standard:a}}},gd=hd();Ct.signalsByName=gd;const yd=function(){const e=(0,aa.getSignals)(),t=dd.SIGRTMAX+1,n=Array.from({length:t},(r,i)=>vd(i,e));return Object.assign({},...n)},vd=function(e,t){const n=Ed(e,t);if(n===void 0)return{};const{name:r,description:i,supported:s,action:o,forced:a,standard:u}=n;return{[e]:{name:r,number:e,description:i,supported:s,action:o,forced:a,standard:u}}},Ed=function(e,t){const n=t.find(({name:r})=>pd.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},wd=yd();Ct.signalsByNumber=wd;const{signalsByName:bd}=Ct,_d=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:s,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:s!==void 0?`failed with exit code ${s}`:"failed",xd=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:s,command:o,escapedCommand:a,timedOut:u,isCanceled:f,killed:c,parsed:{options:{timeout:l}}})=>{s=s===null?void 0:s,i=i===null?void 0:i;const p=i===void 0?void 0:bd[i].description,d=r&&r.code,m=`Command ${_d({timedOut:u,timeout:l,errorCode:d,signal:i,signalDescription:p,exitCode:s,isCanceled:f})}: ${o}`,g=Object.prototype.toString.call(r)==="[object Error]",w=g?`${m}
29
+ ${r.message}`:m,_=[w,t,e].filter(Boolean).join(`
30
+ `);return g?(r.originalMessage=r.message,r.message=_):r=new Error(_),r.shortMessage=w,r.command=o,r.escapedCommand=a,r.exitCode=s,r.signal=i,r.signalDescription=p,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!u,r.isCanceled=f,r.killed=c&&!u,r};var Sd=xd,li={exports:{}};const cn=["stdin","stdout","stderr"],Ad=e=>cn.some(t=>e[t]!==void 0),ua=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return cn.map(r=>e[r]);if(Ad(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${cn.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,cn.length);return Array.from({length:n},(r,i)=>t[i])};li.exports=ua;li.exports.node=e=>{const t=ua(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]};var Td=li.exports,yt={exports:{}},fr={exports:{}},lo;function Cd(){return lo||(lo=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(fr)),fr.exports}var ee=ye.process;const Ve=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!Ve(ee))yt.exports=function(){return function(){}};else{var Rd=ws.default,Pt=Cd(),$d=/^win/i.test(ee.platform),nn=Ec.default;typeof nn!="function"&&(nn=nn.EventEmitter);var le;ee.__signal_exit_emitter__?le=ee.__signal_exit_emitter__:(le=ee.__signal_exit_emitter__=new nn,le.count=0,le.emitted={}),le.infinite||(le.setMaxListeners(1/0),le.infinite=!0),yt.exports=function(e,t){if(!Ve(ye.process))return function(){};Rd.equal(typeof e,"function","a callback must be provided for exit handler"),Lt===!1&&fo();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){le.removeListener(n,e),le.listeners("exit").length===0&&le.listeners("afterexit").length===0&&pr()};return le.on(n,e),r};var pr=function(){!Lt||!Ve(ye.process)||(Lt=!1,Pt.forEach(function(t){try{ee.removeListener(t,dr[t])}catch{}}),ee.emit=hr,ee.reallyExit=po,le.count-=1)};yt.exports.unload=pr;var ft=function(t,n,r){le.emitted[t]||(le.emitted[t]=!0,le.emit(t,n,r))},dr={};Pt.forEach(function(e){dr[e]=function(){if(Ve(ye.process)){var n=ee.listeners(e);n.length===le.count&&(pr(),ft("exit",null,e),ft("afterexit",null,e),$d&&e==="SIGHUP"&&(e="SIGINT"),ee.kill(ee.pid,e))}}}),yt.exports.signals=function(){return Pt};var Lt=!1,fo=function(){Lt||!Ve(ye.process)||(Lt=!0,le.count+=1,Pt=Pt.filter(function(t){try{return ee.on(t,dr[t]),!0}catch{return!1}}),ee.emit=Id,ee.reallyExit=Fd)};yt.exports.load=fo;var po=ee.reallyExit,Fd=function(t){Ve(ye.process)&&(ee.exitCode=t||0,ft("exit",ee.exitCode,null),ft("afterexit",ee.exitCode,null),po.call(ee,ee.exitCode))},hr=ee.emit,Id=function(t,n){if(t==="exit"&&Ve(ye.process)){n!==void 0&&(ee.exitCode=n);var r=hr.apply(this,arguments);return ft("exit",ee.exitCode,null),ft("afterexit",ee.exitCode,null),r}else return hr.apply(this,arguments)}}var Od=yt.exports;const Nd=Bn.default,Pd=Od,Ld=1e3*5,Dd=(e,t="SIGTERM",n={})=>{const r=e(t);return kd(e,t,n,r),r},kd=(e,t,n,r)=>{if(!Md(t,n,r))return;const i=Bd(n),s=setTimeout(()=>{e("SIGKILL")},i);s.unref&&s.unref()},Md=(e,{forceKillAfterTimeout:t},n)=>jd(e)&&t!==!1&&n,jd=e=>e===Nd.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Bd=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Ld;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Hd=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Ud=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Gd=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let i;const s=new Promise((a,u)=>{i=setTimeout(()=>{Ud(e,n,u)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([s,o])},qd=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},zd=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;const i=Pd(()=>{e.kill()});return r.finally(()=>{i()})};var Kd={spawnedKill:Dd,spawnedCancel:Hd,setupTimeout:Gd,validateTimeout:qd,setExitHandler:zd};const ke=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";ke.writable=e=>ke(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";ke.readable=e=>ke(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";ke.duplex=e=>ke.writable(e)&&ke.readable(e);ke.transform=e=>ke.duplex(e)&&typeof e._transform=="function";var Wd=ke,zt={exports:{}};const{PassThrough:Yd}=Hn.default;var Vd=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const r=n==="buffer";let i=!1;t?i=!(n||r):n=n||"utf8",r&&(n=null);const s=new Yd({objectMode:i});n&&s.setEncoding(n);let o=0;const a=[];return s.on("data",u=>{a.push(u),i?o=a.length:o+=u.length}),s.getBufferedValue=()=>t?a:r?Buffer.concat(a,o):a.join(""),s.getBufferedLength=()=>o,s};const{constants:Qd}=wc.default,Xd=Hn.default,{promisify:Zd}=ut.default,Jd=Vd,eh=Zd(Xd.pipeline);class ca extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function fi(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:n}=t,r=Jd(t);return await new Promise((i,s)=>{const o=a=>{a&&r.getBufferedLength()<=Qd.MAX_LENGTH&&(a.bufferedData=r.getBufferedValue()),s(a)};(async()=>{try{await eh(e,r),i()}catch(a){o(a)}})(),r.on("data",()=>{r.getBufferedLength()>n&&o(new ca)})}),r.getBufferedValue()}zt.exports=fi;zt.exports.buffer=(e,t)=>fi(e,{...t,encoding:"buffer"});zt.exports.array=(e,t)=>fi(e,{...t,array:!0});zt.exports.MaxBufferError=ca;var th=zt.exports;const{PassThrough:nh}=Hn.default;var rh=function(){var e=[],t=new nh({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),t;function n(s){return Array.isArray(s)?(s.forEach(n),this):(e.push(s),s.once("end",i.bind(null,s)),s.once("error",t.emit.bind(t,"error")),s.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(s){e=e.filter(function(o){return o!==s}),!e.length&&t.readable&&t.end()}};const la=Wd,ho=th,ih=rh,oh=(e,t)=>{t===void 0||e.stdin===void 0||(la(t)?t.pipe(e.stdin):e.stdin.end(t))},sh=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const n=ih();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},mr=async(e,t)=>{if(e){e.destroy();try{return await t}catch(n){return n.bufferedData}}},gr=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?ho(e,{encoding:t,maxBuffer:r}):ho.buffer(e,{maxBuffer:r})},ah=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:s},o)=>{const a=gr(e,{encoding:r,buffer:i,maxBuffer:s}),u=gr(t,{encoding:r,buffer:i,maxBuffer:s}),f=gr(n,{encoding:r,buffer:i,maxBuffer:s*2});try{return await Promise.all([o,a,u,f])}catch(c){return Promise.all([{error:c,signal:c.signal,timedOut:c.timedOut},mr(e,a),mr(t,u),mr(n,f)])}},uh=({input:e})=>{if(la(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};var ch={handleInput:oh,makeAllStream:sh,getSpawnedResult:ah,validateInputSync:uh};const lh=(async()=>{})().constructor.prototype,fh=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(lh,e)]),ph=(e,t)=>{for(const[n,r]of fh){const i=typeof t=="function"?(...s)=>Reflect.apply(r.value,t(),s):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}return e},dh=e=>new Promise((t,n)=>{e.on("exit",(r,i)=>{t({exitCode:r,signal:i})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});var hh={mergePromise:ph,getSpawnedPromise:dh};const fa=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],mh=/^[\w.-]+$/,gh=/"/g,yh=e=>typeof e!="string"||mh.test(e)?e:`"${e.replace(gh,'\\"')}"`,vh=(e,t)=>fa(e,t).join(" "),Eh=(e,t)=>fa(e,t).map(n=>yh(n)).join(" "),wh=/ +/g,bh=e=>{const t=[];for(const n of e.trim().split(wh)){const r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t};var _h={joinCommand:vh,getEscapedCommand:Eh,parseCommand:bh};const xh=Ee.default,Hr=mn.default,Sh=Zp,Ah=Jp,Th=ed,Ch=rd,An=Sd,pa=Td,{spawnedKill:Rh,spawnedCancel:$h,setupTimeout:Fh,validateTimeout:Ih,setExitHandler:Oh}=Kd,{handleInput:Nh,getSpawnedResult:Ph,makeAllStream:Lh,validateInputSync:Dh}=ch,{mergePromise:mo,getSpawnedPromise:kh}=hh,{joinCommand:da,parseCommand:ha,getEscapedCommand:ma}=_h,Mh=1e3*1e3*100,jh=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{const s=t?{...process.env,...e}:e;return n?Th.env({env:s,cwd:r,execPath:i}):s},ga=(e,t,n={})=>{const r=Sh._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:Mh,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=jh(n),n.stdio=pa(n),process.platform==="win32"&&xh.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},Mt=(e,t,n)=>typeof t!="string"&&!Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?Ah(t):t,Yn=(e,t,n)=>{const r=ga(e,t,n),i=da(e,t),s=ma(e,t);Ih(r.options);let o;try{o=Hr.spawn(r.file,r.args,r.options)}catch(d){const h=new Hr.ChildProcess,m=Promise.reject(An({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return mo(h,m)}const a=kh(o),u=Fh(o,r.options,a),f=Oh(o,r.options,u),c={isCanceled:!1};o.kill=Rh.bind(null,o.kill.bind(o)),o.cancel=$h.bind(null,o,c);const p=Ch(async()=>{const[{error:d,exitCode:h,signal:m,timedOut:g},w,_,C]=await Ph(o,r.options,f),T=Mt(r.options,w),R=Mt(r.options,_),F=Mt(r.options,C);if(d||h!==0||m!==null){const j=An({error:d,exitCode:h,signal:m,stdout:T,stderr:R,all:F,command:i,escapedCommand:s,parsed:r,timedOut:g,isCanceled:c.isCanceled,killed:o.killed});if(!r.options.reject)return j;throw j}return{command:i,escapedCommand:s,exitCode:0,stdout:T,stderr:R,all:F,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Nh(o,r.options.input),o.all=Lh(o,r.options),mo(o,p)};qt.exports=Yn;qt.exports.sync=(e,t,n)=>{const r=ga(e,t,n),i=da(e,t),s=ma(e,t);Dh(r.options);let o;try{o=Hr.spawnSync(r.file,r.args,r.options)}catch(f){throw An({error:f,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}const a=Mt(r.options,o.stdout,o.error),u=Mt(r.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){const f=An({stdout:a,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:s,parsed:r,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!r.options.reject)return f;throw f}return{command:i,escapedCommand:s,exitCode:0,stdout:a,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};qt.exports.command=(e,t)=>{const[n,...r]=ha(e);return Yn(n,r,t)};qt.exports.commandSync=(e,t)=>{const[n,...r]=ha(e);return Yn.sync(n,r,t)};qt.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(n=t,t=[]);const r=pa.node(n),i=process.execArgv.filter(a=>!a.startsWith("--inspect")),{nodePath:s=process.execPath,nodeOptions:o=i}=n;return Yn(s,[...o,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})};var _e={},Vn={exports:{}},ya={exports:{}},pi={exports:{}},di={exports:{}},hi={exports:{}},mi={exports:{}};const va=(e,...t)=>new Promise(n=>{n(e(...t))});mi.exports=va;mi.exports.default=va;var Bh=mi.exports;const Hh=Bh,Ea=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));const t=[];let n=0;const r=()=>{n--,t.length>0&&t.shift()()},i=(a,u,...f)=>{n++;const c=Hh(a,...f);u(c),c.then(r,r)},s=(a,u,...f)=>{n<e?i(a,u,...f):t.push(i.bind(null,a,u,...f))},o=(a,...u)=>new Promise(f=>s(a,f,...u));return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}}),o};hi.exports=Ea;hi.exports.default=Ea;var Uh=hi.exports;const go=Uh;let wa=class extends Error{constructor(t){super(),this.value=t}};const Gh=async(e,t)=>t(await e),qh=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new wa(t[0]);return!1},ba=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=go(n.concurrency),i=[...e].map(o=>[o,r(Gh,o,t)]),s=go(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>s(qh,o)))}catch(o){if(o instanceof wa)return o.value;throw o}};di.exports=ba;di.exports.default=ba;var zh=di.exports;const _a=Ee.default,Tn=Ye.default,{promisify:xa}=ut.default,Kh=zh,Wh=xa(Tn.stat),Yh=xa(Tn.lstat),Sa={directory:"isDirectory",file:"isFile"};function Aa({type:e}){if(!(e in Sa))throw new Error(`Invalid type specified: ${e}`)}const Ta=(e,t)=>e===void 0||t[Sa[e]]();pi.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Aa(t);const n=t.allowSymlinks?Wh:Yh;return Kh(e,async r=>{try{const i=await n(_a.resolve(t.cwd,r));return Ta(t.type,i)}catch{return!1}},t)};pi.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Aa(t);const n=t.allowSymlinks?Tn.statSync:Tn.lstatSync;for(const r of e)try{const i=n(_a.resolve(t.cwd,r));if(Ta(t.type,i))return r}catch{}};var Vh=pi.exports,gi={exports:{}};const Ca=Ye.default,{promisify:Qh}=ut.default,Xh=Qh(Ca.access);gi.exports=async e=>{try{return await Xh(e),!0}catch{return!1}};gi.exports.sync=e=>{try{return Ca.accessSync(e),!0}catch{return!1}};var Ra=gi.exports;(function(e){const t=Ee.default,n=Vh,r=Ra,i=Symbol("findUp.stop");e.exports=async(s,o={})=>{let a=t.resolve(o.cwd||"");const{root:u}=t.parse(a),f=[].concat(s),c=async l=>{if(typeof s!="function")return n(f,l);const p=await s(l.cwd);return typeof p=="string"?n([p],l):p};for(;;){const l=await c({...o,cwd:a});if(l===i)return;if(l)return t.resolve(a,l);if(a===u)return;a=t.dirname(a)}},e.exports.sync=(s,o={})=>{let a=t.resolve(o.cwd||"");const{root:u}=t.parse(a),f=[].concat(s),c=l=>{if(typeof s!="function")return n.sync(f,l);const p=s(l.cwd);return typeof p=="string"?n.sync([p],l):p};for(;;){const l=c({...o,cwd:a});if(l===i)return;if(l)return t.resolve(a,l);if(a===u)return;a=t.dirname(a)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(ya);var Zh=ya.exports;const $a=Ee.default,Fa=Zh,Ia=async e=>{const t=await Fa("package.json",{cwd:e});return t&&$a.dirname(t)};Vn.exports=Ia;Vn.exports.default=Ia;Vn.exports.sync=e=>{const t=Fa.sync("package.json",{cwd:e});return t&&$a.dirname(t)};var Jh=Vn.exports,Qn={};(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,n)=>t.nodes.find(r=>r.type===n),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(t,n=0,r)=>{const i=t.nodes[n];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0),e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0,e.reduce=t=>t.reduce((n,r)=>(r.type==="text"&&n.push(r.value),r.type==="range"&&(r.type="text"),n),[]),e.flatten=(...t)=>{const n=[],r=i=>{for(let s=0;s<i.length;s++){const o=i[s];if(Array.isArray(o)){r(o);continue}o!==void 0&&n.push(o)}return n};return r(t),n}})(Qn);const yo=Qn;var yi=(e,t={})=>{const n=(r,i={})=>{const s=t.escapeInvalid&&yo.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0;let a="";if(r.value)return(s||o)&&yo.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(const u of r.nodes)a+=n(u);return a};return n(e)};/*!
31
31
  * is-number <https://github.com/jonschlinkert/is-number>
32
32
  *
33
33
  * Copyright (c) 2014-present, Jon Schlinkert.
@@ -37,40 +37,39 @@ ${r.message}`:g,_=[w,t,e].filter(Boolean).join(`
37
37
  *
38
38
  * Copyright (c) 2015-present, Jon Schlinkert.
39
39
  * Released under the MIT License.
40
- */const wo=em,tt=(e,t,n)=>{if(wo(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(wo(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let i=String(r.relaxZeros),s=String(r.shorthand),o=String(r.capture),a=String(r.wrap),u=e+":"+t+"="+i+s+o+a;if(tt.cache.hasOwnProperty(u))return tt.cache[u].result;let l=Math.min(e,t),c=Math.max(e,t);if(Math.abs(l-c)===1){let g=e+"|"+t;return r.capture?`(${g})`:r.wrap===!1?g:`(?:${g})`}let f=To(e)||To(t),p={min:e,max:t,a:l,b:c},d=[],h=[];if(f&&(p.isPadded=f,p.maxLen=String(p.max).length),l<0){let g=c<0?Math.abs(c):1;h=bo(g,Math.abs(l),p,r),l=p.a=0}return c>=0&&(d=bo(l,c,p,r)),p.negatives=h,p.positives=d,p.result=tm(h,d),r.capture===!0?p.result=`(${p.result})`:r.wrap!==!1&&d.length+h.length>1&&(p.result=`(?:${p.result})`),tt.cache[u]=p,p.result};function tm(e,t,n){let r=yr(e,t,"-",!1),i=yr(t,e,"",!1),s=yr(e,t,"-?",!0);return r.concat(s).concat(i).join("|")}function nm(e,t){let n=1,r=1,i=xo(e,n),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),n+=1,i=xo(e,n);for(i=Ao(t+1,r)-1;e<i&&i<=t;)s.add(i),r+=1,i=Ao(t+1,r)-1;return s=[...s],s.sort(om),s}function rm(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=im(e,t),i=r.length,s="",o=0;for(let a=0;a<i;a++){let[u,l]=r[a];u===l?s+=u:u!=="0"||l!=="9"?s+=sm(u,l):o++}return o&&(s+=n.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function bo(e,t,n,r){let i=nm(e,t),s=[],o=e,a;for(let u=0;u<i.length;u++){let l=i[u],c=rm(String(o),String(l),r),f="";if(!n.isPadded&&a&&a.pattern===c.pattern){a.count.length>1&&a.count.pop(),a.count.push(c.count[0]),a.string=a.pattern+So(a.count),o=l+1;continue}n.isPadded&&(f=am(l,n,r)),c.string=f+c.pattern+So(c.count),s.push(c),o=l+1,a=c}return s}function yr(e,t,n,r,i){let s=[];for(let o of e){let{string:a}=o;!r&&!_o(t,"string",a)&&s.push(n+a),r&&_o(t,"string",a)&&s.push(n+a)}return s}function im(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function om(e,t){return e>t?1:t>e?-1:0}function _o(e,t,n){return e.some(r=>r[t]===n)}function xo(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Ao(e,t){return e-e%Math.pow(10,t)}function So(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function sm(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function To(e){return/^-?(0+)\d/.test(e)}function am(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}tt.cache={};tt.clearCache=()=>tt.cache={};var um=tt;/*!
40
+ */const vo=em,nt=(e,t,n)=>{if(vo(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(vo(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let i=String(r.relaxZeros),s=String(r.shorthand),o=String(r.capture),a=String(r.wrap),u=e+":"+t+"="+i+s+o+a;if(nt.cache.hasOwnProperty(u))return nt.cache[u].result;let f=Math.min(e,t),c=Math.max(e,t);if(Math.abs(f-c)===1){let m=e+"|"+t;return r.capture?`(${m})`:r.wrap===!1?m:`(?:${m})`}let l=So(e)||So(t),p={min:e,max:t,a:f,b:c},d=[],h=[];if(l&&(p.isPadded=l,p.maxLen=String(p.max).length),f<0){let m=c<0?Math.abs(c):1;h=Eo(m,Math.abs(f),p,r),f=p.a=0}return c>=0&&(d=Eo(f,c,p,r)),p.negatives=h,p.positives=d,p.result=tm(h,d),r.capture===!0?p.result=`(${p.result})`:r.wrap!==!1&&d.length+h.length>1&&(p.result=`(?:${p.result})`),nt.cache[u]=p,p.result};function tm(e,t,n){let r=yr(e,t,"-",!1)||[],i=yr(t,e,"",!1)||[],s=yr(e,t,"-?",!0)||[];return r.concat(s).concat(i).join("|")}function nm(e,t){let n=1,r=1,i=bo(e,n),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),n+=1,i=bo(e,n);for(i=_o(t+1,r)-1;e<i&&i<=t;)s.add(i),r+=1,i=_o(t+1,r)-1;return s=[...s],s.sort(om),s}function rm(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=im(e,t),i=r.length,s="",o=0;for(let a=0;a<i;a++){let[u,f]=r[a];u===f?s+=u:u!=="0"||f!=="9"?s+=sm(u,f):o++}return o&&(s+=n.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function Eo(e,t,n,r){let i=nm(e,t),s=[],o=e,a;for(let u=0;u<i.length;u++){let f=i[u],c=rm(String(o),String(f),r),l="";if(!n.isPadded&&a&&a.pattern===c.pattern){a.count.length>1&&a.count.pop(),a.count.push(c.count[0]),a.string=a.pattern+xo(a.count),o=f+1;continue}n.isPadded&&(l=am(f,n,r)),c.string=l+c.pattern+xo(c.count),s.push(c),o=f+1,a=c}return s}function yr(e,t,n,r,i){let s=[];for(let o of e){let{string:a}=o;!r&&!wo(t,"string",a)&&s.push(n+a),r&&wo(t,"string",a)&&s.push(n+a)}return s}function im(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function om(e,t){return e>t?1:t>e?-1:0}function wo(e,t,n){return e.some(r=>r[t]===n)}function bo(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function _o(e,t){return e-e%Math.pow(10,t)}function xo(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function sm(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function So(e){return/^-?(0+)\d/.test(e)}function am(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}nt.cache={};nt.clearCache=()=>nt.cache={};var um=nt;/*!
41
41
  * fill-range <https://github.com/jonschlinkert/fill-range>
42
42
  *
43
43
  * Copyright (c) 2014-present, Jon Schlinkert.
44
44
  * Licensed under the MIT License.
45
- */const cm=at.default,Na=um,Co=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),lm=e=>t=>e===!0?Number(t):String(t),vr=e=>typeof e=="number"||typeof e=="string"&&e!=="",jt=e=>Number.isInteger(+e),Er=e=>{let t=`${e}`,n=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++n]==="0";);return n>0},fm=(e,t,n)=>typeof e=="string"||typeof t=="string"?!0:n.stringify===!0,pm=(e,t,n)=>{if(t>0){let r=e[0]==="-"?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return n===!1?String(e):e},Cn=(e,t)=>{let n=e[0]==="-"?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},dm=(e,t,n)=>{e.negatives.sort((a,u)=>a<u?-1:a>u?1:0),e.positives.sort((a,u)=>a<u?-1:a>u?1:0);let r=t.capture?"":"?:",i="",s="",o;return e.positives.length&&(i=e.positives.map(a=>Cn(String(a),n)).join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.map(a=>Cn(String(a),n)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,t.wrap?`(${r}${o})`:o},Pa=(e,t,n,r)=>{if(n)return Na(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);if(e===t)return i;let s=String.fromCharCode(t);return`[${i}-${s}]`},La=(e,t,n)=>{if(Array.isArray(e)){let r=n.wrap===!0,i=n.capture?"":"?:";return r?`(${i}${e.join("|")})`:e.join("|")}return Na(e,t,n)},Da=(...e)=>new RangeError("Invalid range arguments: "+cm.inspect(...e)),Ma=(e,t,n)=>{if(n.strictRanges===!0)throw Da([e,t]);return[]},hm=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},mm=(e,t,n=1,r={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(r.strictRanges===!0)throw Da([e,t]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(e),u=String(t),l=String(n);n=Math.max(Math.abs(n),1);let c=Er(a)||Er(u)||Er(l),f=c?Math.max(a.length,u.length,l.length):0,p=c===!1&&fm(e,t,r)===!1,d=r.transform||lm(p);if(r.toRegex&&n===1)return Pa(Cn(e,f),Cn(t,f),!0,r);let h={negatives:[],positives:[]},g=_=>h[_<0?"negatives":"positives"].push(Math.abs(_)),m=[],w=0;for(;o?i>=s:i<=s;)r.toRegex===!0&&n>1?g(i):m.push(pm(d(i,w),f,p)),i=o?i-n:i+n,w++;return r.toRegex===!0?n>1?dm(h,r,f):La(m,null,{wrap:!1,...r}):m},gm=(e,t,n=1,r={})=>{if(!jt(e)&&e.length>1||!jt(t)&&t.length>1)return Ma(e,t,r);let i=r.transform||(p=>String.fromCharCode(p)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),a=s>o,u=Math.min(s,o),l=Math.max(s,o);if(r.toRegex&&n===1)return Pa(u,l,!1,r);let c=[],f=0;for(;a?s>=o:s<=o;)c.push(i(s,f)),s=a?s-n:s+n,f++;return r.toRegex===!0?La(c,null,{wrap:!1,options:r}):c},ln=(e,t,n,r={})=>{if(t==null&&vr(e))return[e];if(!vr(e)||!vr(t))return Ma(e,t,r);if(typeof n=="function")return ln(e,t,1,{transform:n});if(Co(n))return ln(e,t,0,n);let i={...r};return i.capture===!0&&(i.wrap=!0),n=n||i.step||1,jt(n)?jt(e)&&jt(t)?mm(e,t,n,i):gm(e,t,Math.max(Math.abs(n),1),i):n!=null&&!Co(n)?hm(n,i):ln(e,t,1,n)};var ka=ln;const ym=ka,Ro=Qn,vm=(e,t={})=>{const n=(r,i={})=>{const s=Ro.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0,a=s===!0||o===!0,u=t.escapeInvalid===!0?"\\":"";let l="";if(r.isOpen===!0)return u+r.value;if(r.isClose===!0)return console.log("node.isClose",u,r.value),u+r.value;if(r.type==="open")return a?u+r.value:"(";if(r.type==="close")return a?u+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":a?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){const c=Ro.reduce(r.nodes),f=ym(...c,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return c.length>1&&f.length>1?`(${f})`:f}if(r.nodes)for(const c of r.nodes)l+=n(c,r);return l};return n(e)};var Em=vm;const wm=ka,$o=Ei,wt=Qn,Ze=(e="",t="",n=!1)=>{const r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?wt.flatten(t).map(i=>`{${i}}`):t;for(const i of e)if(Array.isArray(i))for(const s of i)r.push(Ze(s,t,n));else for(let s of t)n===!0&&typeof s=="string"&&(s=`{${s}}`),r.push(Array.isArray(s)?Ze(i,s,n):i+s);return wt.flatten(r)},bm=(e,t={})=>{const n=t.rangeLimit===void 0?1e3:t.rangeLimit,r=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(Ze(a.pop(),$o(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Ze(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){const f=wt.reduce(i.nodes);if(wt.exceedsLimit(...f,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=wm(...f,t);p.length===0&&(p=$o(i,t)),a.push(Ze(a.pop(),p)),i.nodes=[];return}const u=wt.encloseBrace(i);let l=i.queue,c=i;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,l=c.queue;for(let f=0;f<i.nodes.length;f++){const p=i.nodes[f];if(p.type==="comma"&&i.type==="brace"){f===1&&l.push(""),l.push("");continue}if(p.type==="close"){a.push(Ze(a.pop(),l,u));continue}if(p.value&&p.type!=="open"){l.push(Ze(l.pop(),p.value));continue}p.nodes&&r(p,i)}return l};return wt.flatten(r(e))};var _m=bm,xm={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
46
- `,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const Am=Ei,{MAX_LENGTH:Fo,CHAR_BACKSLASH:wr,CHAR_BACKTICK:Sm,CHAR_COMMA:Tm,CHAR_DOT:Cm,CHAR_LEFT_PARENTHESES:Rm,CHAR_RIGHT_PARENTHESES:$m,CHAR_LEFT_CURLY_BRACE:Fm,CHAR_RIGHT_CURLY_BRACE:Im,CHAR_LEFT_SQUARE_BRACKET:Io,CHAR_RIGHT_SQUARE_BRACKET:Oo,CHAR_DOUBLE_QUOTE:Om,CHAR_SINGLE_QUOTE:Nm,CHAR_NO_BREAK_SPACE:Pm,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Lm}=xm,Dm=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");const n=t||{},r=typeof n.maxLength=="number"?Math.min(Fo,n.maxLength):Fo;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);const i={type:"root",input:e,nodes:[]},s=[i];let o=i,a=i,u=0;const l=e.length;let c=0,f=0,p;const d=()=>e[c++],h=g=>{if(g.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&g.type==="text"){a.value+=g.value;return}return o.nodes.push(g),g.parent=o,g.prev=a,a=g,g};for(h({type:"bos"});c<l;)if(o=s[s.length-1],p=d(),!(p===Lm||p===Pm)){if(p===wr){h({type:"text",value:(t.keepEscaping?p:"")+d()});continue}if(p===Oo){h({type:"text",value:"\\"+p});continue}if(p===Io){u++;let g;for(;c<l&&(g=d());){if(p+=g,g===Io){u++;continue}if(g===wr){p+=d();continue}if(g===Oo&&(u--,u===0))break}h({type:"text",value:p});continue}if(p===Rm){o=h({type:"paren",nodes:[]}),s.push(o),h({type:"text",value:p});continue}if(p===$m){if(o.type!=="paren"){h({type:"text",value:p});continue}o=s.pop(),h({type:"text",value:p}),o=s[s.length-1];continue}if(p===Om||p===Nm||p===Sm){const g=p;let m;for(t.keepQuotes!==!0&&(p="");c<l&&(m=d());){if(m===wr){p+=m+d();continue}if(m===g){t.keepQuotes===!0&&(p+=m);break}p+=m}h({type:"text",value:p});continue}if(p===Fm){f++;const m={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=h(m),s.push(o),h({type:"open",value:p});continue}if(p===Im){if(o.type!=="brace"){h({type:"text",value:p});continue}const g="close";o=s.pop(),o.close=!0,h({type:g,value:p}),f--,o=s[s.length-1];continue}if(p===Tm&&f>0){if(o.ranges>0){o.ranges=0;const g=o.nodes.shift();o.nodes=[g,{type:"text",value:Am(o)}]}h({type:"comma",value:p}),o.commas++;continue}if(p===Cm&&f>0&&o.commas===0){const g=o.nodes;if(f===0||g.length===0){h({type:"text",value:p});continue}if(a.type==="dot"){if(o.range=[],a.value+=p,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){g.pop();const m=g[g.length-1];m.value+=a.value+p,a=m,o.ranges--;continue}h({type:"dot",value:p});continue}h({type:"text",value:p})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});const g=s[s.length-1],m=g.nodes.indexOf(o);g.nodes.splice(m,1,...o.nodes)}while(s.length>0);return h({type:"eos"}),i};var Mm=Dm;const No=Ei,km=Em,jm=_m,Hm=Mm,xe=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const i=xe.create(r,t);Array.isArray(i)?n.push(...i):n.push(i)}else n=[].concat(xe.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};xe.parse=(e,t={})=>Hm(e,t);xe.stringify=(e,t={})=>No(typeof e=="string"?xe.parse(e,t):e,t);xe.compile=(e,t={})=>(typeof e=="string"&&(e=xe.parse(e,t)),km(e,t));xe.expand=(e,t={})=>{typeof e=="string"&&(e=xe.parse(e,t));let n=jm(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n};xe.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?xe.compile(e,t):xe.expand(e,t);var Bm=xe,zt={};const Um=Ee.default,Ie="\\\\/",Po=`[^${Ie}]`,He="\\.",Gm="\\+",qm="\\?",Xn="\\/",Km="(?=.)",ja="[^/]",wi=`(?:${Xn}|$)`,Ha=`(?:^|${Xn})`,bi=`${He}{1,2}${wi}`,zm=`(?!${He})`,Wm=`(?!${Ha}${bi})`,Ym=`(?!${He}{0,1}${wi})`,Vm=`(?!${bi})`,Qm=`[^.${Xn}]`,Xm=`${ja}*?`,Ba={DOT_LITERAL:He,PLUS_LITERAL:Gm,QMARK_LITERAL:qm,SLASH_LITERAL:Xn,ONE_CHAR:Km,QMARK:ja,END_ANCHOR:wi,DOTS_SLASH:bi,NO_DOT:zm,NO_DOTS:Wm,NO_DOT_SLASH:Ym,NO_DOTS_SLASH:Vm,QMARK_NO_DOT:Qm,STAR:Xm,START_ANCHOR:Ha},Zm={...Ba,SLASH_LITERAL:`[${Ie}]`,QMARK:Po,STAR:`${Po}*?`,DOTS_SLASH:`${He}{1,2}(?:[${Ie}]|$)`,NO_DOT:`(?!${He})`,NO_DOTS:`(?!(?:^|[${Ie}])${He}{1,2}(?:[${Ie}]|$))`,NO_DOT_SLASH:`(?!${He}{0,1}(?:[${Ie}]|$))`,NO_DOTS_SLASH:`(?!${He}{1,2}(?:[${Ie}]|$))`,QMARK_NO_DOT:`[^.${Ie}]`,START_ANCHOR:`(?:^|[${Ie}])`,END_ANCHOR:`(?:[${Ie}]|$)`},Jm={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var Zn={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Jm,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Um.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Zm:Ba}};(function(e){const t=Ee.default,n=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:o}=Zn;e.isObject=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),e.hasRegexChars=a=>s.test(a),e.isRegexChar=a=>a.length===1&&e.hasRegexChars(a),e.escapeRegex=a=>a.replace(o,"\\$1"),e.toPosixSlashes=a=>a.replace(r,"/"),e.removeBackslashes=a=>a.replace(i,u=>u==="\\"?"":u),e.supportsLookbehinds=()=>{const a=process.version.slice(1).split(".").map(Number);return a.length===3&&a[0]>=9||a[0]===8&&a[1]>=10},e.isWindows=a=>a&&typeof a.windows=="boolean"?a.windows:n===!0||t.sep==="\\",e.escapeLast=(a,u,l)=>{const c=a.lastIndexOf(u,l);return c===-1?a:a[c-1]==="\\"?e.escapeLast(a,u,c-1):`${a.slice(0,c)}\\${a.slice(c)}`},e.removePrefix=(a,u={})=>{let l=a;return l.startsWith("./")&&(l=l.slice(2),u.prefix="./"),l},e.wrapOutput=(a,u={},l={})=>{const c=l.contains?"":"^",f=l.contains?"":"$";let p=`${c}(?:${a})${f}`;return u.negated===!0&&(p=`(?:^(?!${p}).*$)`),p}})(zt);const Lo=zt,{CHAR_ASTERISK:br,CHAR_AT:eg,CHAR_BACKWARD_SLASH:Dt,CHAR_COMMA:tg,CHAR_DOT:_r,CHAR_EXCLAMATION_MARK:xr,CHAR_FORWARD_SLASH:Ua,CHAR_LEFT_CURLY_BRACE:Ar,CHAR_LEFT_PARENTHESES:Sr,CHAR_LEFT_SQUARE_BRACKET:ng,CHAR_PLUS:rg,CHAR_QUESTION_MARK:Do,CHAR_RIGHT_CURLY_BRACE:ig,CHAR_RIGHT_PARENTHESES:Mo,CHAR_RIGHT_SQUARE_BRACKET:og}=Zn,ko=e=>e===Ua||e===Dt,jo=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},sg=(e,t)=>{const n=t||{},r=e.length-1,i=n.parts===!0||n.scanToEnd===!0,s=[],o=[],a=[];let u=e,l=-1,c=0,f=0,p=!1,d=!1,h=!1,g=!1,m=!1,w=!1,_=!1,C=!1,T=!1,R=!1,F=0,j,x,A={value:"",depth:0,isGlob:!1};const N=()=>l>=r,v=()=>u.charCodeAt(l+1),k=()=>(j=x,u.charCodeAt(++l));for(;l<r;){x=k();let $;if(x===Dt){_=A.backslashes=!0,x=k(),x===Ar&&(w=!0);continue}if(w===!0||x===Ar){for(F++;N()!==!0&&(x=k());){if(x===Dt){_=A.backslashes=!0,k();continue}if(x===Ar){F++;continue}if(w!==!0&&x===_r&&(x=k())===_r){if(p=A.isBrace=!0,h=A.isGlob=!0,R=!0,i===!0)continue;break}if(w!==!0&&x===tg){if(p=A.isBrace=!0,h=A.isGlob=!0,R=!0,i===!0)continue;break}if(x===ig&&(F--,F===0)){w=!1,p=A.isBrace=!0,R=!0;break}}if(i===!0)continue;break}if(x===Ua){if(s.push(l),o.push(A),A={value:"",depth:0,isGlob:!1},R===!0)continue;if(j===_r&&l===c+1){c+=2;continue}f=l+1;continue}if(n.noext!==!0&&(x===rg||x===eg||x===br||x===Do||x===xr)===!0&&v()===Sr){if(h=A.isGlob=!0,g=A.isExtglob=!0,R=!0,x===xr&&l===c&&(T=!0),i===!0){for(;N()!==!0&&(x=k());){if(x===Dt){_=A.backslashes=!0,x=k();continue}if(x===Mo){h=A.isGlob=!0,R=!0;break}}continue}break}if(x===br){if(j===br&&(m=A.isGlobstar=!0),h=A.isGlob=!0,R=!0,i===!0)continue;break}if(x===Do){if(h=A.isGlob=!0,R=!0,i===!0)continue;break}if(x===ng){for(;N()!==!0&&($=k());){if($===Dt){_=A.backslashes=!0,k();continue}if($===og){d=A.isBracket=!0,h=A.isGlob=!0,R=!0;break}}if(i===!0)continue;break}if(n.nonegate!==!0&&x===xr&&l===c){C=A.negated=!0,c++;continue}if(n.noparen!==!0&&x===Sr){if(h=A.isGlob=!0,i===!0){for(;N()!==!0&&(x=k());){if(x===Sr){_=A.backslashes=!0,x=k();continue}if(x===Mo){R=!0;break}}continue}break}if(h===!0){if(R=!0,i===!0)continue;break}}n.noext===!0&&(g=!1,h=!1);let H=u,K="",E="";c>0&&(K=u.slice(0,c),u=u.slice(c),f-=c),H&&h===!0&&f>0?(H=u.slice(0,f),E=u.slice(f)):h===!0?(H="",E=u):H=u,H&&H!==""&&H!=="/"&&H!==u&&ko(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),n.unescape===!0&&(E&&(E=Lo.removeBackslashes(E)),H&&_===!0&&(H=Lo.removeBackslashes(H)));const b={prefix:K,input:e,start:c,base:H,glob:E,isBrace:p,isBracket:d,isGlob:h,isExtglob:g,isGlobstar:m,negated:C,negatedExtglob:T};if(n.tokens===!0&&(b.maxDepth=0,ko(x)||o.push(A),b.tokens=o),n.parts===!0||n.tokens===!0){let $;for(let D=0;D<s.length;D++){const U=$?$+1:c,z=s[D],V=e.slice(U,z);n.tokens&&(D===0&&c!==0?(o[D].isPrefix=!0,o[D].value=K):o[D].value=V,jo(o[D]),b.maxDepth+=o[D].depth),(D!==0||V!=="")&&a.push(V),$=z}if($&&$+1<e.length){const D=e.slice($+1);a.push(D),n.tokens&&(o[o.length-1].value=D,jo(o[o.length-1]),b.maxDepth+=o[o.length-1].depth)}b.slashes=s,b.parts=a}return b};var ag=sg;const Rn=Zn,we=zt,{MAX_LENGTH:$n,POSIX_REGEX_SOURCE:ug,REGEX_NON_SPECIAL_CHARS:cg,REGEX_SPECIAL_CHARS_BACKREF:lg,REPLACEMENTS:Ga}=Rn,fg=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch{return e.map(i=>we.escapeRegex(i)).join("..")}return n},ft=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,_i=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Ga[e]||e;const n={...t},r=typeof n.maxLength=="number"?Math.min($n,n.maxLength):$n;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const s={type:"bos",value:"",output:n.prepend||""},o=[s],a=n.capture?"":"?:",u=we.isWindows(t),l=Rn.globChars(u),c=Rn.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:p,SLASH_LITERAL:d,ONE_CHAR:h,DOTS_SLASH:g,NO_DOT:m,NO_DOT_SLASH:w,NO_DOTS_SLASH:_,QMARK:C,QMARK_NO_DOT:T,STAR:R,START_ANCHOR:F}=l,j=L=>`(${a}(?:(?!${F}${L.dot?g:f}).)*?)`,x=n.dot?"":m,A=n.dot?C:T;let N=n.bash===!0?j(n):R;n.capture&&(N=`(${N})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);const v={input:e,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=we.removePrefix(e,v),i=e.length;const k=[],H=[],K=[];let E=s,b;const $=()=>v.index===i-1,D=v.peek=(L=1)=>e[v.index+L],U=v.advance=()=>e[++v.index]||"",z=()=>e.slice(v.index+1),V=(L="",W=0)=>{v.consumed+=L,v.index+=W},J=L=>{v.output+=L.output!=null?L.output:L.value,V(L.value)},Ae=()=>{let L=1;for(;D()==="!"&&(D(2)!=="("||D(3)==="?");)U(),v.start++,L++;return L%2===0?!1:(v.negated=!0,v.start++,!0)},I=L=>{v[L]++,K.push(L)},M=L=>{v[L]--,K.pop()},P=L=>{if(E.type==="globstar"){const W=v.braces>0&&(L.type==="comma"||L.type==="brace"),O=L.extglob===!0||k.length&&(L.type==="pipe"||L.type==="paren");L.type!=="slash"&&L.type!=="paren"&&!W&&!O&&(v.output=v.output.slice(0,-E.output.length),E.type="star",E.value="*",E.output=N,v.output+=E.output)}if(k.length&&L.type!=="paren"&&(k[k.length-1].inner+=L.value),(L.value||L.output)&&J(L),E&&E.type==="text"&&L.type==="text"){E.value+=L.value,E.output=(E.output||"")+L.value;return}L.prev=E,o.push(L),E=L},Y=(L,W)=>{const O={...c[W],conditions:1,inner:""};O.prev=E,O.parens=v.parens,O.output=v.output;const q=(n.capture?"(":"")+O.open;I("parens"),P({type:L,value:W,output:v.output?"":h}),P({type:"paren",extglob:!0,value:U(),output:q}),k.push(O)},ue=L=>{let W=L.close+(n.capture?")":""),O;if(L.type==="negate"){let q=N;if(L.inner&&L.inner.length>1&&L.inner.includes("/")&&(q=j(n)),(q!==N||$()||/^\)+$/.test(z()))&&(W=L.close=`)$))${q}`),L.inner.includes("*")&&(O=z())&&/^\.[^\\/.]+$/.test(O)){const Q=_i(O,{...t,fastpaths:!1}).output;W=L.close=`)${Q})${q})`}L.prev.type==="bos"&&(v.negatedExtglob=!0)}P({type:"paren",extglob:!0,value:b,output:W}),M("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let L=!1,W=e.replace(lg,(O,q,Q,re,X,Fe)=>re==="\\"?(L=!0,O):re==="?"?q?q+re+(X?C.repeat(X.length):""):Fe===0?A+(X?C.repeat(X.length):""):C.repeat(Q.length):re==="."?f.repeat(Q.length):re==="*"?q?q+re+(X?N:""):N:q?O:`\\${O}`);return L===!0&&(n.unescape===!0?W=W.replace(/\\/g,""):W=W.replace(/\\+/g,O=>O.length%2===0?"\\\\":O?"\\":"")),W===e&&n.contains===!0?(v.output=e,v):(v.output=we.wrapOutput(W,v,t),v)}for(;!$();){if(b=U(),b==="\0")continue;if(b==="\\"){const O=D();if(O==="/"&&n.bash!==!0||O==="."||O===";")continue;if(!O){b+="\\",P({type:"text",value:b});continue}const q=/^\\+/.exec(z());let Q=0;if(q&&q[0].length>2&&(Q=q[0].length,v.index+=Q,Q%2!==0&&(b+="\\")),n.unescape===!0?b=U():b+=U(),v.brackets===0){P({type:"text",value:b});continue}}if(v.brackets>0&&(b!=="]"||E.value==="["||E.value==="[^")){if(n.posix!==!1&&b===":"){const O=E.value.slice(1);if(O.includes("[")&&(E.posix=!0,O.includes(":"))){const q=E.value.lastIndexOf("["),Q=E.value.slice(0,q),re=E.value.slice(q+2),X=ug[re];if(X){E.value=Q+X,v.backtrack=!0,U(),!s.output&&o.indexOf(E)===1&&(s.output=h);continue}}}(b==="["&&D()!==":"||b==="-"&&D()==="]")&&(b=`\\${b}`),b==="]"&&(E.value==="["||E.value==="[^")&&(b=`\\${b}`),n.posix===!0&&b==="!"&&E.value==="["&&(b="^"),E.value+=b,J({value:b});continue}if(v.quotes===1&&b!=='"'){b=we.escapeRegex(b),E.value+=b,J({value:b});continue}if(b==='"'){v.quotes=v.quotes===1?0:1,n.keepQuotes===!0&&P({type:"text",value:b});continue}if(b==="("){I("parens"),P({type:"paren",value:b});continue}if(b===")"){if(v.parens===0&&n.strictBrackets===!0)throw new SyntaxError(ft("opening","("));const O=k[k.length-1];if(O&&v.parens===O.parens+1){ue(k.pop());continue}P({type:"paren",value:b,output:v.parens?")":"\\)"}),M("parens");continue}if(b==="["){if(n.nobracket===!0||!z().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(ft("closing","]"));b=`\\${b}`}else I("brackets");P({type:"bracket",value:b});continue}if(b==="]"){if(n.nobracket===!0||E&&E.type==="bracket"&&E.value.length===1){P({type:"text",value:b,output:`\\${b}`});continue}if(v.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(ft("opening","["));P({type:"text",value:b,output:`\\${b}`});continue}M("brackets");const O=E.value.slice(1);if(E.posix!==!0&&O[0]==="^"&&!O.includes("/")&&(b=`/${b}`),E.value+=b,J({value:b}),n.literalBrackets===!1||we.hasRegexChars(O))continue;const q=we.escapeRegex(E.value);if(v.output=v.output.slice(0,-E.value.length),n.literalBrackets===!0){v.output+=q,E.value=q;continue}E.value=`(${a}${q}|${E.value})`,v.output+=E.value;continue}if(b==="{"&&n.nobrace!==!0){I("braces");const O={type:"brace",value:b,output:"(",outputIndex:v.output.length,tokensIndex:v.tokens.length};H.push(O),P(O);continue}if(b==="}"){const O=H[H.length-1];if(n.nobrace===!0||!O){P({type:"text",value:b,output:b});continue}let q=")";if(O.dots===!0){const Q=o.slice(),re=[];for(let X=Q.length-1;X>=0&&(o.pop(),Q[X].type!=="brace");X--)Q[X].type!=="dots"&&re.unshift(Q[X].value);q=fg(re,n),v.backtrack=!0}if(O.comma!==!0&&O.dots!==!0){const Q=v.output.slice(0,O.outputIndex),re=v.tokens.slice(O.tokensIndex);O.value=O.output="\\{",b=q="\\}",v.output=Q;for(const X of re)v.output+=X.output||X.value}P({type:"brace",value:b,output:q}),M("braces"),H.pop();continue}if(b==="|"){k.length>0&&k[k.length-1].conditions++,P({type:"text",value:b});continue}if(b===","){let O=b;const q=H[H.length-1];q&&K[K.length-1]==="braces"&&(q.comma=!0,O="|"),P({type:"comma",value:b,output:O});continue}if(b==="/"){if(E.type==="dot"&&v.index===v.start+1){v.start=v.index+1,v.consumed="",v.output="",o.pop(),E=s;continue}P({type:"slash",value:b,output:d});continue}if(b==="."){if(v.braces>0&&E.type==="dot"){E.value==="."&&(E.output=f);const O=H[H.length-1];E.type="dots",E.output+=b,E.value+=b,O.dots=!0;continue}if(v.braces+v.parens===0&&E.type!=="bos"&&E.type!=="slash"){P({type:"text",value:b,output:f});continue}P({type:"dot",value:b,output:f});continue}if(b==="?"){if(!(E&&E.value==="(")&&n.noextglob!==!0&&D()==="("&&D(2)!=="?"){Y("qmark",b);continue}if(E&&E.type==="paren"){const q=D();let Q=b;if(q==="<"&&!we.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(E.value==="("&&!/[!=<:]/.test(q)||q==="<"&&!/<([!=]|\w+>)/.test(z()))&&(Q=`\\${b}`),P({type:"text",value:b,output:Q});continue}if(n.dot!==!0&&(E.type==="slash"||E.type==="bos")){P({type:"qmark",value:b,output:T});continue}P({type:"qmark",value:b,output:C});continue}if(b==="!"){if(n.noextglob!==!0&&D()==="("&&(D(2)!=="?"||!/[!=<:]/.test(D(3)))){Y("negate",b);continue}if(n.nonegate!==!0&&v.index===0){Ae();continue}}if(b==="+"){if(n.noextglob!==!0&&D()==="("&&D(2)!=="?"){Y("plus",b);continue}if(E&&E.value==="("||n.regex===!1){P({type:"plus",value:b,output:p});continue}if(E&&(E.type==="bracket"||E.type==="paren"||E.type==="brace")||v.parens>0){P({type:"plus",value:b});continue}P({type:"plus",value:p});continue}if(b==="@"){if(n.noextglob!==!0&&D()==="("&&D(2)!=="?"){P({type:"at",extglob:!0,value:b,output:""});continue}P({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);const O=cg.exec(z());O&&(b+=O[0],v.index+=O[0].length),P({type:"text",value:b});continue}if(E&&(E.type==="globstar"||E.star===!0)){E.type="star",E.star=!0,E.value+=b,E.output=N,v.backtrack=!0,v.globstar=!0,V(b);continue}let L=z();if(n.noextglob!==!0&&/^\([^?]/.test(L)){Y("star",b);continue}if(E.type==="star"){if(n.noglobstar===!0){V(b);continue}const O=E.prev,q=O.prev,Q=O.type==="slash"||O.type==="bos",re=q&&(q.type==="star"||q.type==="globstar");if(n.bash===!0&&(!Q||L[0]&&L[0]!=="/")){P({type:"star",value:b,output:""});continue}const X=v.braces>0&&(O.type==="comma"||O.type==="brace"),Fe=k.length&&(O.type==="pipe"||O.type==="paren");if(!Q&&O.type!=="paren"&&!X&&!Fe){P({type:"star",value:b,output:""});continue}for(;L.slice(0,3)==="/**";){const je=e[v.index+4];if(je&&je!=="/")break;L=L.slice(3),V("/**",3)}if(O.type==="bos"&&$()){E.type="globstar",E.value+=b,E.output=j(n),v.output=E.output,v.globstar=!0,V(b);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&!re&&$()){v.output=v.output.slice(0,-(O.output+E.output).length),O.output=`(?:${O.output}`,E.type="globstar",E.output=j(n)+(n.strictSlashes?")":"|$)"),E.value+=b,v.globstar=!0,v.output+=O.output+E.output,V(b);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&L[0]==="/"){const je=L[1]!==void 0?"|$":"";v.output=v.output.slice(0,-(O.output+E.output).length),O.output=`(?:${O.output}`,E.type="globstar",E.output=`${j(n)}${d}|${d}${je})`,E.value+=b,v.output+=O.output+E.output,v.globstar=!0,V(b+U()),P({type:"slash",value:"/",output:""});continue}if(O.type==="bos"&&L[0]==="/"){E.type="globstar",E.value+=b,E.output=`(?:^|${d}|${j(n)}${d})`,v.output=E.output,v.globstar=!0,V(b+U()),P({type:"slash",value:"/",output:""});continue}v.output=v.output.slice(0,-E.output.length),E.type="globstar",E.output=j(n),E.value+=b,v.output+=E.output,v.globstar=!0,V(b);continue}const W={type:"star",value:b,output:N};if(n.bash===!0){W.output=".*?",(E.type==="bos"||E.type==="slash")&&(W.output=x+W.output),P(W);continue}if(E&&(E.type==="bracket"||E.type==="paren")&&n.regex===!0){W.output=b,P(W);continue}(v.index===v.start||E.type==="slash"||E.type==="dot")&&(E.type==="dot"?(v.output+=w,E.output+=w):n.dot===!0?(v.output+=_,E.output+=_):(v.output+=x,E.output+=x),D()!=="*"&&(v.output+=h,E.output+=h)),P(W)}for(;v.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing","]"));v.output=we.escapeLast(v.output,"["),M("brackets")}for(;v.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing",")"));v.output=we.escapeLast(v.output,"("),M("parens")}for(;v.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(ft("closing","}"));v.output=we.escapeLast(v.output,"{"),M("braces")}if(n.strictSlashes!==!0&&(E.type==="star"||E.type==="bracket")&&P({type:"maybe_slash",value:"",output:`${d}?`}),v.backtrack===!0){v.output="";for(const L of v.tokens)v.output+=L.output!=null?L.output:L.value,L.suffix&&(v.output+=L.suffix)}return v};_i.fastpaths=(e,t)=>{const n={...t},r=typeof n.maxLength=="number"?Math.min($n,n.maxLength):$n,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=Ga[e]||e;const s=we.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:l,NO_DOT:c,NO_DOTS:f,NO_DOTS_SLASH:p,STAR:d,START_ANCHOR:h}=Rn.globChars(s),g=n.dot?f:c,m=n.dot?p:c,w=n.capture?"":"?:",_={negated:!1,prefix:""};let C=n.bash===!0?".*?":d;n.capture&&(C=`(${C})`);const T=x=>x.noglobstar===!0?C:`(${w}(?:(?!${h}${x.dot?l:o}).)*?)`,R=x=>{switch(x){case"*":return`${g}${u}${C}`;case".*":return`${o}${u}${C}`;case"*.*":return`${g}${C}${o}${u}${C}`;case"*/*":return`${g}${C}${a}${u}${m}${C}`;case"**":return g+T(n);case"**/*":return`(?:${g}${T(n)}${a})?${m}${u}${C}`;case"**/*.*":return`(?:${g}${T(n)}${a})?${m}${C}${o}${u}${C}`;case"**/.*":return`(?:${g}${T(n)}${a})?${o}${u}${C}`;default:{const A=/^(.*?)\.(\w+)$/.exec(x);if(!A)return;const N=R(A[1]);return N?N+o+A[2]:void 0}}},F=we.removePrefix(e,_);let j=R(F);return j&&n.strictSlashes!==!0&&(j+=`${a}?`),j};var pg=_i;const dg=Ee.default,hg=ag,Ur=pg,xi=zt,mg=Zn,gg=e=>e&&typeof e=="object"&&!Array.isArray(e),ie=(e,t,n=!1)=>{if(Array.isArray(e)){const c=e.map(p=>ie(p,t,n));return p=>{for(const d of c){const h=d(p);if(h)return h}return!1}}const r=gg(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},s=xi.isWindows(t),o=r?ie.compileRe(e,t):ie.makeRe(e,t,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(i.ignore){const c={...t,ignore:null,onMatch:null,onResult:null};u=ie(i.ignore,c,n)}const l=(c,f=!1)=>{const{isMatch:p,match:d,output:h}=ie.test(c,o,t,{glob:e,posix:s}),g={glob:e,state:a,regex:o,posix:s,input:c,output:h,match:d,isMatch:p};return typeof i.onResult=="function"&&i.onResult(g),p===!1?(g.isMatch=!1,f?g:!1):u(c)?(typeof i.onIgnore=="function"&&i.onIgnore(g),g.isMatch=!1,f?g:!1):(typeof i.onMatch=="function"&&i.onMatch(g),f?g:!0)};return n&&(l.state=a),l};ie.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};const s=n||{},o=s.format||(i?xi.toPosixSlashes:null);let a=e===r,u=a&&o?o(e):e;return a===!1&&(u=o?o(e):e,a=u===r),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=ie.matchBase(e,t,n,i):a=t.exec(u)),{isMatch:!!a,match:a,output:u}};ie.matchBase=(e,t,n,r=xi.isWindows(n))=>(t instanceof RegExp?t:ie.makeRe(t,n)).test(dg.basename(e));ie.isMatch=(e,t,n)=>ie(t,n)(e);ie.parse=(e,t)=>Array.isArray(e)?e.map(n=>ie.parse(n,t)):Ur(e,{...t,fastpaths:!1});ie.scan=(e,t)=>hg(e,t);ie.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;const i=t||{},s=i.contains?"":"^",o=i.contains?"":"$";let a=`${s}(?:${e.output})${o}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);const u=ie.toRegex(a,t);return r===!0&&(u.state=e),u};ie.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=Ur.fastpaths(e,t)),i.output||(i=Ur(e,t)),ie.compileRe(i,t,n,r)};ie.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(n){if(t&&t.debug===!0)throw n;return/$^/}};ie.constants=mg;var yg=ie,vg=yg;const qa=at.default,Ka=Bm,ke=vg,Gr=zt,Ho=e=>e===""||e==="./",za=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},Z=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,i=new Set,s=new Set,o=0,a=c=>{s.add(c.output),n&&n.onResult&&n.onResult(c)};for(let c=0;c<t.length;c++){let f=ke(String(t[c]),{...n,onResult:a},!0),p=f.state.negated||f.state.negatedExtglob;p&&o++;for(let d of e){let h=f(d,!0);(p?!h.isMatch:h.isMatch)&&(p?r.add(h.output):(r.delete(h.output),i.add(h.output)))}}let l=(o===t.length?[...s]:[...i]).filter(c=>!r.has(c));if(n&&l.length===0){if(n.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(c=>c.replace(/\\/g,"")):t}return l};Z.match=Z;Z.matcher=(e,t)=>ke(e,t);Z.isMatch=(e,t,n)=>ke(t,n)(e);Z.any=Z.isMatch;Z.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],s=a=>{n.onResult&&n.onResult(a),i.push(a.output)},o=new Set(Z(e,t,{...n,onResult:s}));for(let a of i)o.has(a)||r.add(a);return[...r]};Z.contains=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${qa.inspect(e)}"`);if(Array.isArray(t))return t.some(r=>Z.contains(e,r,n));if(typeof t=="string"){if(Ho(e)||Ho(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return Z.isMatch(e,t,{...n,contains:!0})};Z.matchKeys=(e,t,n)=>{if(!Gr.isObject(e))throw new TypeError("Expected the first argument to be an object");let r=Z(Object.keys(e),t,n),i={};for(let s of r)i[s]=e[s];return i};Z.some=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let s=ke(String(i),n);if(r.some(o=>s(o)))return!0}return!1};Z.every=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let s=ke(String(i),n);if(!r.every(o=>s(o)))return!1}return!0};Z.all=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${qa.inspect(e)}"`);return[].concat(t).every(r=>ke(r,n)(e))};Z.capture=(e,t,n)=>{let r=Gr.isWindows(n),s=ke.makeRe(String(e),{...n,capture:!0}).exec(r?Gr.toPosixSlashes(t):t);if(s)return s.slice(1).map(o=>o===void 0?"":o)};Z.makeRe=(...e)=>ke.makeRe(...e);Z.scan=(...e)=>ke.scan(...e);Z.parse=(e,t)=>{let n=[];for(let r of[].concat(e||[]))for(let i of Ka(String(r),t))n.push(ke.parse(i,t));return n};Z.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!za(e)?[e]:Ka(e,t)};Z.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return Z.braces(e,{...t,expand:!0})};Z.hasBraces=za;var Eg=Z,Ai=ye&&ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_e,"__esModule",{value:!0});_e.readPackageJSON=_e.extractWorkspaces=_e.isMatchWorkspaces=_e.checkWorkspaces=_e.findWorkspaceRoot=void 0;const Fn=Ai(Ee.default),wg=Ai(Jh),Bo=We.default,bg=Ai(Eg);function Ue(e){e||(e=process.cwd());let t=wg.default.sync(e);if(!t)return null;e=Fn.default.normalize(t);let n=null,r=e;do{const i=er(r);Jn(i);let{done:s,found:o}=Wa(r,e);if(s)return o;n=r,r=Fn.default.dirname(r)}while(r!==n);return null}_e.findWorkspaceRoot=Ue;function Wa(e,t){const n=er(e),r=Jn(n);let i=!1,s,o;return r&&(i=!0,o=Fn.default.relative(e,t),o===""||Si(o,r)?s=e:s=null),{done:i,found:s,relativePath:o}}_e.checkWorkspaces=Wa;function Si(e,t){return bg.default([e],t).length>0}_e.isMatchWorkspaces=Si;function Jn(e){const t=(e||{}).workspaces;return t&&t.packages||(Array.isArray(t)?t:null)}_e.extractWorkspaces=Jn;function er(e){const t=Fn.default.join(e,"package.json");return Bo.existsSync(t)?JSON.parse(Bo.readFileSync(t,"utf8")):null}_e.readPackageJSON=er;Ue.findWorkspaceRoot=Ue;Ue.readPackageJSON=er;Ue.extractWorkspaces=Jn;Ue.isMatchWorkspaces=Si;Ue.default=Ue;_e.default=Ue;const _g=_e;_g.findWorkspaceRoot;var xg={exports:{}},Ti={exports:{}};class Ag{constructor(t){this.value=t,this.next=void 0}}let Sg=class{constructor(){this.clear()}enqueue(t){const n=new Ag(t);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){const t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};var Tg=Sg;const Cg=Tg,Rg=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=new Cg;let n=0;const r=()=>{n--,t.size>0&&t.dequeue()()},i=async(a,u,...l)=>{n++;const c=(async()=>a(...l))();u(c);try{await c}catch{}r()},s=(a,u,...l)=>{t.enqueue(i.bind(null,a,u,...l)),(async()=>(await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()))()},o=(a,...u)=>new Promise(l=>{s(a,l,...u)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o};var $g=Rg;const Uo=$g;class Ya extends Error{constructor(t){super(),this.value=t}}const Fg=async(e,t)=>t(await e),Ig=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new Ya(t[0]);return!1},Og=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=Uo(n.concurrency),i=[...e].map(o=>[o,r(Fg,o,t)]),s=Uo(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>s(Ig,o)))}catch(o){if(o instanceof Ya)return o.value;throw o}};var Ng=Og;const Va=Ee.default,In=We.default,{promisify:Qa}=at.default,Pg=Ng,Lg=Qa(In.stat),Dg=Qa(In.lstat),Xa={directory:"isDirectory",file:"isFile"};function Za({type:e}){if(!(e in Xa))throw new Error(`Invalid type specified: ${e}`)}const Ja=(e,t)=>e===void 0||t[Xa[e]]();Ti.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Za(t);const n=t.allowSymlinks?Lg:Dg;return Pg(e,async r=>{try{const i=await n(Va.resolve(t.cwd,r));return Ja(t.type,i)}catch{return!1}},t)};Ti.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Za(t);const n=t.allowSymlinks?In.statSync:In.lstatSync;for(const r of e)try{const i=n(Va.resolve(t.cwd,r));if(Ja(t.type,i))return r}catch{}};var Mg=Ti.exports;(function(e){const t=Ee.default,n=Mg,r=$a,i=Symbol("findUp.stop");e.exports=async(s,o={})=>{let a=t.resolve(o.cwd||"");const{root:u}=t.parse(a),l=[].concat(s),c=async f=>{if(typeof s!="function")return n(l,f);const p=await s(f.cwd);return typeof p=="string"?n([p],f):p};for(;;){const f=await c({...o,cwd:a});if(f===i)return;if(f)return t.resolve(a,f);if(a===u)return;a=t.dirname(a)}},e.exports.sync=(s,o={})=>{let a=t.resolve(o.cwd||"");const{root:u}=t.parse(a),l=[].concat(s),c=f=>{if(typeof s!="function")return n.sync(l,f);const p=s(f.cwd);return typeof p=="string"?n.sync([p],f):p};for(;;){const f=c({...o,cwd:a});if(f===i)return;if(f)return t.resolve(a,f);if(a===u)return;a=t.dirname(a)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(xg);var eu={exports:{}},qe=_c.default,kg=process.cwd,fn=null,jg=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return fn||(fn=kg.call(process)),fn};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var Go=process.chdir;process.chdir=function(e){fn=null,Go.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Go)}var Hg=Bg;function Bg(e){qe.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(c,f,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(c,f,p,d){d&&process.nextTick(d)},e.lchownSync=function(){}),jg==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(c){function f(p,d,h){var g=Date.now(),m=0;c(p,d,function w(_){if(_&&(_.code==="EACCES"||_.code==="EPERM"||_.code==="EBUSY")&&Date.now()-g<6e4){setTimeout(function(){e.stat(d,function(C,T){C&&C.code==="ENOENT"?c(p,d,w):h(_)})},m),m<100&&(m+=10);return}h&&h(_)})}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(e.rename)),e.read=typeof e.read!="function"?e.read:function(c){function f(p,d,h,g,m,w){var _;if(w&&typeof w=="function"){var C=0;_=function(T,R,F){if(T&&T.code==="EAGAIN"&&C<10)return C++,c.call(e,p,d,h,g,m,_);w.apply(this,arguments)}}return c.call(e,p,d,h,g,m,_)}return Object.setPrototypeOf&&Object.setPrototypeOf(f,c),f}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(c){return function(f,p,d,h,g){for(var m=0;;)try{return c.call(e,f,p,d,h,g)}catch(w){if(w.code==="EAGAIN"&&m<10){m++;continue}throw w}}}(e.readSync);function t(c){c.lchmod=function(f,p,d){c.open(f,qe.O_WRONLY|qe.O_SYMLINK,p,function(h,g){if(h){d&&d(h);return}c.fchmod(g,p,function(m){c.close(g,function(w){d&&d(m||w)})})})},c.lchmodSync=function(f,p){var d=c.openSync(f,qe.O_WRONLY|qe.O_SYMLINK,p),h=!0,g;try{g=c.fchmodSync(d,p),h=!1}finally{if(h)try{c.closeSync(d)}catch{}else c.closeSync(d)}return g}}function n(c){qe.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(f,p,d,h){c.open(f,qe.O_SYMLINK,function(g,m){if(g){h&&h(g);return}c.futimes(m,p,d,function(w){c.close(m,function(_){h&&h(w||_)})})})},c.lutimesSync=function(f,p,d){var h=c.openSync(f,qe.O_SYMLINK),g,m=!0;try{g=c.futimesSync(h,p,d),m=!1}finally{if(m)try{c.closeSync(h)}catch{}else c.closeSync(h)}return g}):c.futimes&&(c.lutimes=function(f,p,d,h){h&&process.nextTick(h)},c.lutimesSync=function(){})}function r(c){return c&&function(f,p,d){return c.call(e,f,p,function(h){l(h)&&(h=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(f,p){try{return c.call(e,f,p)}catch(d){if(!l(d))throw d}}}function s(c){return c&&function(f,p,d,h){return c.call(e,f,p,d,function(g){l(g)&&(g=null),h&&h.apply(this,arguments)})}}function o(c){return c&&function(f,p,d){try{return c.call(e,f,p,d)}catch(h){if(!l(h))throw h}}}function a(c){return c&&function(f,p,d){typeof p=="function"&&(d=p,p=null);function h(g,m){m&&(m.uid<0&&(m.uid+=4294967296),m.gid<0&&(m.gid+=4294967296)),d&&d.apply(this,arguments)}return p?c.call(e,f,p,h):c.call(e,f,h)}}function u(c){return c&&function(f,p){var d=p?c.call(e,f,p):c.call(e,f);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function l(c){if(!c||c.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(c.code==="EINVAL"||c.code==="EPERM"))}}var qo=Bn.default.Stream,Ug=Gg;function Gg(e){return{ReadStream:t,WriteStream:n};function t(r,i){if(!(this instanceof t))return new t(r,i);qo.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),a=0,u=o.length;a<u;a++){var l=o[a];this[l]=i[l]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}e.open(this.path,this.flags,this.mode,function(c,f){if(c){s.emit("error",c),s.readable=!1;return}s.fd=f,s.emit("open",f),s._read()})}function n(r,i){if(!(this instanceof n))return new n(r,i);qo.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o<a;o++){var u=s[o];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var qg=zg,Kg=Object.getPrototypeOf||function(e){return e.__proto__};function zg(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Kg(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}var te=We.default,Wg=Hg,Yg=Ug,Vg=qg,rn=at.default,pe,On;typeof Symbol=="function"&&typeof Symbol.for=="function"?(pe=Symbol.for("graceful-fs.queue"),On=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",On="___graceful-fs.previous");function Qg(){}function tu(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}var nt=Qg;rn.debuglog?nt=rn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(nt=function(){var e=rn.format.apply(rn,arguments);e="GFS4: "+e.split(/\n/).join(`
47
- GFS4: `),console.error(e)});if(!te[pe]){var Xg=ye[pe]||[];tu(te,Xg),te.close=function(e){function t(n,r){return e.call(te,n,function(i){i||Ko(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(t,On,{value:e}),t}(te.close),te.closeSync=function(e){function t(n){e.apply(te,arguments),Ko()}return Object.defineProperty(t,On,{value:e}),t}(te.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){nt(te[pe]),ws.default.equal(te[pe].length,0)})}ye[pe]||tu(ye,te[pe]);var nu=Ci(Vg(te));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!te.__patched&&(nu=Ci(te),te.__patched=!0);function Ci(e){Wg(e),e.gracefulify=Ci,e.createReadStream=R,e.createWriteStream=F;var t=e.readFile;e.readFile=n;function n(A,N,v){return typeof N=="function"&&(v=N,N=null),k(A,N,v);function k(H,K,E,b){return t(H,K,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?pt([k,[H,K,E],$,b||Date.now(),Date.now()]):typeof E=="function"&&E.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=i;function i(A,N,v,k){return typeof v=="function"&&(k=v,v=null),H(A,N,v,k);function H(K,E,b,$,D){return r(K,E,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=o);function o(A,N,v,k){return typeof v=="function"&&(k=v,v=null),H(A,N,v,k);function H(K,E,b,$,D){return s(K,E,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var a=e.copyFile;a&&(e.copyFile=u);function u(A,N,v,k){return typeof v=="function"&&(k=v,v=0),H(A,N,v,k);function H(K,E,b,$,D){return a(K,E,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var l=e.readdir;e.readdir=f;var c=/^v[0-5]\./;function f(A,N,v){typeof N=="function"&&(v=N,N=null);var k=c.test(process.version)?function(E,b,$,D){return l(E,H(E,b,$,D))}:function(E,b,$,D){return l(E,b,H(E,b,$,D))};return k(A,N,v);function H(K,E,b,$){return function(D,U){D&&(D.code==="EMFILE"||D.code==="ENFILE")?pt([k,[K,E,b],D,$||Date.now(),Date.now()]):(U&&U.sort&&U.sort(),typeof b=="function"&&b.call(this,D,U))}}}if(process.version.substr(0,4)==="v0.8"){var p=Yg(e);w=p.ReadStream,C=p.WriteStream}var d=e.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=_);var h=e.WriteStream;h&&(C.prototype=Object.create(h.prototype),C.prototype.open=T),Object.defineProperty(e,"ReadStream",{get:function(){return w},set:function(A){w=A},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return C},set:function(A){C=A},enumerable:!0,configurable:!0});var g=w;Object.defineProperty(e,"FileReadStream",{get:function(){return g},set:function(A){g=A},enumerable:!0,configurable:!0});var m=C;Object.defineProperty(e,"FileWriteStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});function w(A,N){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function _(){var A=this;x(A.path,A.flags,A.mode,function(N,v){N?(A.autoClose&&A.destroy(),A.emit("error",N)):(A.fd=v,A.emit("open",v),A.read())})}function C(A,N){return this instanceof C?(h.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function T(){var A=this;x(A.path,A.flags,A.mode,function(N,v){N?(A.destroy(),A.emit("error",N)):(A.fd=v,A.emit("open",v))})}function R(A,N){return new e.ReadStream(A,N)}function F(A,N){return new e.WriteStream(A,N)}var j=e.open;e.open=x;function x(A,N,v,k){return typeof v=="function"&&(k=v,v=null),H(A,N,v,k);function H(K,E,b,$,D){return j(K,E,b,function(U,z){U&&(U.code==="EMFILE"||U.code==="ENFILE")?pt([H,[K,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}return e}function pt(e){nt("ENQUEUE",e[0].name,e[1]),te[pe].push(e),Ri()}var on;function Ko(){for(var e=Date.now(),t=0;t<te[pe].length;++t)te[pe][t].length>2&&(te[pe][t][3]=e,te[pe][t][4]=e);Ri()}function Ri(){if(clearTimeout(on),on=void 0,te[pe].length!==0){var e=te[pe].shift(),t=e[0],n=e[1],r=e[2],i=e[3],s=e[4];if(i===void 0)nt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){nt("TIMEOUT",t.name,n);var o=n.pop();typeof o=="function"&&o.call(null,r)}else{var a=Date.now()-s,u=Math.max(s-i,1),l=Math.min(u*1.2,100);a>=l?(nt("RETRY",t.name,n),t.apply(null,n.concat([i]))):te[pe].push(e)}on===void 0&&(on=setTimeout(Ri,0))}}const zo=(e,t)=>function(...n){const r=t.promiseModule;return new r((i,s)=>{t.multiArgs?n.push((...o)=>{t.errorFirst?o[0]?s(o):(o.shift(),i(o)):i(o)}):t.errorFirst?n.push((o,a)=>{o?s(o):i(a)}):n.push(i),e.apply(this,n)})};var Zg=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);const r=s=>{const o=a=>typeof a=="string"?s===a:a.test(s);return t.include?t.include.some(o):!t.exclude.some(o)};let i;n==="function"?i=function(...s){return t.excludeMain?e(...s):zo(e,t).apply(this,s)}:i=Object.create(Object.getPrototypeOf(e));for(const s in e){const o=e[s];i[s]=typeof o=="function"&&r(s)?zo(o,t):o}return i},Jg=e=>{if(typeof e!="string")throw new TypeError("Expected a string, got "+typeof e);return e.charCodeAt(0)===65279?e.slice(1):e},ne={},Wt={},Ce={};function ru(e){return typeof e>"u"||e===null}function ey(e){return typeof e=="object"&&e!==null}function ty(e){return Array.isArray(e)?e:ru(e)?[]:[e]}function ny(e,t){var n,r,i,s;if(t)for(s=Object.keys(t),n=0,r=s.length;n<r;n+=1)i=s[n],e[i]=t[i];return e}function ry(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function iy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}Ce.isNothing=ru;Ce.isObject=ey;Ce.toArray=ty;Ce.repeat=ry;Ce.isNegativeZero=iy;Ce.extend=ny;function Ut(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ut.prototype=Object.create(Error.prototype);Ut.prototype.constructor=Ut;Ut.prototype.toString=function(t){var n=this.name+": ";return n+=this.reason||"(unknown reason)",!t&&this.mark&&(n+=" "+this.mark.toString()),n};var Yt=Ut,Wo=Ce;function $i(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}$i.prototype.getSnippet=function(t,n){var r,i,s,o,a;if(!this.buffer)return null;for(t=t||4,n=n||75,r="",i=this.position;i>0&&`\0\r
45
+ */const cm=ut.default,Oa=um,Ao=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),lm=e=>t=>e===!0?Number(t):String(t),vr=e=>typeof e=="number"||typeof e=="string"&&e!=="",jt=e=>Number.isInteger(+e),Er=e=>{let t=`${e}`,n=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++n]==="0";);return n>0},fm=(e,t,n)=>typeof e=="string"||typeof t=="string"?!0:n.stringify===!0,pm=(e,t,n)=>{if(t>0){let r=e[0]==="-"?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return n===!1?String(e):e},Cn=(e,t)=>{let n=e[0]==="-"?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},dm=(e,t,n)=>{e.negatives.sort((a,u)=>a<u?-1:a>u?1:0),e.positives.sort((a,u)=>a<u?-1:a>u?1:0);let r=t.capture?"":"?:",i="",s="",o;return e.positives.length&&(i=e.positives.map(a=>Cn(String(a),n)).join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.map(a=>Cn(String(a),n)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,t.wrap?`(${r}${o})`:o},Na=(e,t,n,r)=>{if(n)return Oa(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);if(e===t)return i;let s=String.fromCharCode(t);return`[${i}-${s}]`},Pa=(e,t,n)=>{if(Array.isArray(e)){let r=n.wrap===!0,i=n.capture?"":"?:";return r?`(${i}${e.join("|")})`:e.join("|")}return Oa(e,t,n)},La=(...e)=>new RangeError("Invalid range arguments: "+cm.inspect(...e)),Da=(e,t,n)=>{if(n.strictRanges===!0)throw La([e,t]);return[]},hm=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},mm=(e,t,n=1,r={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(r.strictRanges===!0)throw La([e,t]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(e),u=String(t),f=String(n);n=Math.max(Math.abs(n),1);let c=Er(a)||Er(u)||Er(f),l=c?Math.max(a.length,u.length,f.length):0,p=c===!1&&fm(e,t,r)===!1,d=r.transform||lm(p);if(r.toRegex&&n===1)return Na(Cn(e,l),Cn(t,l),!0,r);let h={negatives:[],positives:[]},m=_=>h[_<0?"negatives":"positives"].push(Math.abs(_)),g=[],w=0;for(;o?i>=s:i<=s;)r.toRegex===!0&&n>1?m(i):g.push(pm(d(i,w),l,p)),i=o?i-n:i+n,w++;return r.toRegex===!0?n>1?dm(h,r,l):Pa(g,null,{wrap:!1,...r}):g},gm=(e,t,n=1,r={})=>{if(!jt(e)&&e.length>1||!jt(t)&&t.length>1)return Da(e,t,r);let i=r.transform||(p=>String.fromCharCode(p)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),a=s>o,u=Math.min(s,o),f=Math.max(s,o);if(r.toRegex&&n===1)return Na(u,f,!1,r);let c=[],l=0;for(;a?s>=o:s<=o;)c.push(i(s,l)),s=a?s-n:s+n,l++;return r.toRegex===!0?Pa(c,null,{wrap:!1,options:r}):c},ln=(e,t,n,r={})=>{if(t==null&&vr(e))return[e];if(!vr(e)||!vr(t))return Da(e,t,r);if(typeof n=="function")return ln(e,t,1,{transform:n});if(Ao(n))return ln(e,t,0,n);let i={...r};return i.capture===!0&&(i.wrap=!0),n=n||i.step||1,jt(n)?jt(e)&&jt(t)?mm(e,t,n,i):gm(e,t,Math.max(Math.abs(n),1),i):n!=null&&!Ao(n)?hm(n,i):ln(e,t,1,n)};var ka=ln;const ym=ka,To=Qn,vm=(e,t={})=>{const n=(r,i={})=>{const s=To.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0,a=s===!0||o===!0,u=t.escapeInvalid===!0?"\\":"";let f="";if(r.isOpen===!0)return u+r.value;if(r.isClose===!0)return console.log("node.isClose",u,r.value),u+r.value;if(r.type==="open")return a?u+r.value:"(";if(r.type==="close")return a?u+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":a?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){const c=To.reduce(r.nodes),l=ym(...c,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(l.length!==0)return c.length>1&&l.length>1?`(${l})`:l}if(r.nodes)for(const c of r.nodes)f+=n(c,r);return f};return n(e)};var Em=vm;const wm=ka,Co=yi,bt=Qn,Je=(e="",t="",n=!1)=>{const r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?bt.flatten(t).map(i=>`{${i}}`):t;for(const i of e)if(Array.isArray(i))for(const s of i)r.push(Je(s,t,n));else for(let s of t)n===!0&&typeof s=="string"&&(s=`{${s}}`),r.push(Array.isArray(s)?Je(i,s,n):i+s);return bt.flatten(r)},bm=(e,t={})=>{const n=t.rangeLimit===void 0?1e3:t.rangeLimit,r=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(Je(a.pop(),Co(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Je(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){const l=bt.reduce(i.nodes);if(bt.exceedsLimit(...l,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=wm(...l,t);p.length===0&&(p=Co(i,t)),a.push(Je(a.pop(),p)),i.nodes=[];return}const u=bt.encloseBrace(i);let f=i.queue,c=i;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,f=c.queue;for(let l=0;l<i.nodes.length;l++){const p=i.nodes[l];if(p.type==="comma"&&i.type==="brace"){l===1&&f.push(""),f.push("");continue}if(p.type==="close"){a.push(Je(a.pop(),f,u));continue}if(p.value&&p.type!=="open"){f.push(Je(f.pop(),p.value));continue}p.nodes&&r(p,i)}return f};return bt.flatten(r(e))};var _m=bm,xm={MAX_LENGTH:1e4,CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_COMMA:",",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_NO_BREAK_SPACE:" ",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SINGLE_QUOTE:"'",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const Sm=yi,{MAX_LENGTH:Ro,CHAR_BACKSLASH:wr,CHAR_BACKTICK:Am,CHAR_COMMA:Tm,CHAR_DOT:Cm,CHAR_LEFT_PARENTHESES:Rm,CHAR_RIGHT_PARENTHESES:$m,CHAR_LEFT_CURLY_BRACE:Fm,CHAR_RIGHT_CURLY_BRACE:Im,CHAR_LEFT_SQUARE_BRACKET:$o,CHAR_RIGHT_SQUARE_BRACKET:Fo,CHAR_DOUBLE_QUOTE:Om,CHAR_SINGLE_QUOTE:Nm,CHAR_NO_BREAK_SPACE:Pm,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Lm}=xm,Dm=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");const n=t||{},r=typeof n.maxLength=="number"?Math.min(Ro,n.maxLength):Ro;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);const i={type:"root",input:e,nodes:[]},s=[i];let o=i,a=i,u=0;const f=e.length;let c=0,l=0,p;const d=()=>e[c++],h=m=>{if(m.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&m.type==="text"){a.value+=m.value;return}return o.nodes.push(m),m.parent=o,m.prev=a,a=m,m};for(h({type:"bos"});c<f;)if(o=s[s.length-1],p=d(),!(p===Lm||p===Pm)){if(p===wr){h({type:"text",value:(t.keepEscaping?p:"")+d()});continue}if(p===Fo){h({type:"text",value:"\\"+p});continue}if(p===$o){u++;let m;for(;c<f&&(m=d());){if(p+=m,m===$o){u++;continue}if(m===wr){p+=d();continue}if(m===Fo&&(u--,u===0))break}h({type:"text",value:p});continue}if(p===Rm){o=h({type:"paren",nodes:[]}),s.push(o),h({type:"text",value:p});continue}if(p===$m){if(o.type!=="paren"){h({type:"text",value:p});continue}o=s.pop(),h({type:"text",value:p}),o=s[s.length-1];continue}if(p===Om||p===Nm||p===Am){const m=p;let g;for(t.keepQuotes!==!0&&(p="");c<f&&(g=d());){if(g===wr){p+=g+d();continue}if(g===m){t.keepQuotes===!0&&(p+=g);break}p+=g}h({type:"text",value:p});continue}if(p===Fm){l++;const g={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:l,commas:0,ranges:0,nodes:[]};o=h(g),s.push(o),h({type:"open",value:p});continue}if(p===Im){if(o.type!=="brace"){h({type:"text",value:p});continue}const m="close";o=s.pop(),o.close=!0,h({type:m,value:p}),l--,o=s[s.length-1];continue}if(p===Tm&&l>0){if(o.ranges>0){o.ranges=0;const m=o.nodes.shift();o.nodes=[m,{type:"text",value:Sm(o)}]}h({type:"comma",value:p}),o.commas++;continue}if(p===Cm&&l>0&&o.commas===0){const m=o.nodes;if(l===0||m.length===0){h({type:"text",value:p});continue}if(a.type==="dot"){if(o.range=[],a.value+=p,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){m.pop();const g=m[m.length-1];g.value+=a.value+p,a=g,o.ranges--;continue}h({type:"dot",value:p});continue}h({type:"text",value:p})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});const m=s[s.length-1],g=m.nodes.indexOf(o);m.nodes.splice(g,1,...o.nodes)}while(s.length>0);return h({type:"eos"}),i};var km=Dm;const Io=yi,Mm=Em,jm=_m,Bm=km,xe=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const i=xe.create(r,t);Array.isArray(i)?n.push(...i):n.push(i)}else n=[].concat(xe.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};xe.parse=(e,t={})=>Bm(e,t);xe.stringify=(e,t={})=>Io(typeof e=="string"?xe.parse(e,t):e,t);xe.compile=(e,t={})=>(typeof e=="string"&&(e=xe.parse(e,t)),Mm(e,t));xe.expand=(e,t={})=>{typeof e=="string"&&(e=xe.parse(e,t));let n=jm(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n};xe.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?xe.compile(e,t):xe.expand(e,t);var Hm=xe,Kt={};const Um=Ee.default,Oe="\\\\/",Oo=`[^${Oe}]`,He="\\.",Gm="\\+",qm="\\?",Xn="\\/",zm="(?=.)",Ma="[^/]",vi=`(?:${Xn}|$)`,ja=`(?:^|${Xn})`,Ei=`${He}{1,2}${vi}`,Km=`(?!${He})`,Wm=`(?!${ja}${Ei})`,Ym=`(?!${He}{0,1}${vi})`,Vm=`(?!${Ei})`,Qm=`[^.${Xn}]`,Xm=`${Ma}*?`,Ba={DOT_LITERAL:He,PLUS_LITERAL:Gm,QMARK_LITERAL:qm,SLASH_LITERAL:Xn,ONE_CHAR:zm,QMARK:Ma,END_ANCHOR:vi,DOTS_SLASH:Ei,NO_DOT:Km,NO_DOTS:Wm,NO_DOT_SLASH:Ym,NO_DOTS_SLASH:Vm,QMARK_NO_DOT:Qm,STAR:Xm,START_ANCHOR:ja},Zm={...Ba,SLASH_LITERAL:`[${Oe}]`,QMARK:Oo,STAR:`${Oo}*?`,DOTS_SLASH:`${He}{1,2}(?:[${Oe}]|$)`,NO_DOT:`(?!${He})`,NO_DOTS:`(?!(?:^|[${Oe}])${He}{1,2}(?:[${Oe}]|$))`,NO_DOT_SLASH:`(?!${He}{0,1}(?:[${Oe}]|$))`,NO_DOTS_SLASH:`(?!${He}{1,2}(?:[${Oe}]|$))`,QMARK_NO_DOT:`[^.${Oe}]`,START_ANCHOR:`(?:^|[${Oe}])`,END_ANCHOR:`(?:[${Oe}]|$)`},Jm={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var Zn={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Jm,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Um.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Zm:Ba}};(function(e){const t=Ee.default,n=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:o}=Zn;e.isObject=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),e.hasRegexChars=a=>s.test(a),e.isRegexChar=a=>a.length===1&&e.hasRegexChars(a),e.escapeRegex=a=>a.replace(o,"\\$1"),e.toPosixSlashes=a=>a.replace(r,"/"),e.removeBackslashes=a=>a.replace(i,u=>u==="\\"?"":u),e.supportsLookbehinds=()=>{const a=process.version.slice(1).split(".").map(Number);return a.length===3&&a[0]>=9||a[0]===8&&a[1]>=10},e.isWindows=a=>a&&typeof a.windows=="boolean"?a.windows:n===!0||t.sep==="\\",e.escapeLast=(a,u,f)=>{const c=a.lastIndexOf(u,f);return c===-1?a:a[c-1]==="\\"?e.escapeLast(a,u,c-1):`${a.slice(0,c)}\\${a.slice(c)}`},e.removePrefix=(a,u={})=>{let f=a;return f.startsWith("./")&&(f=f.slice(2),u.prefix="./"),f},e.wrapOutput=(a,u={},f={})=>{const c=f.contains?"":"^",l=f.contains?"":"$";let p=`${c}(?:${a})${l}`;return u.negated===!0&&(p=`(?:^(?!${p}).*$)`),p}})(Kt);const No=Kt,{CHAR_ASTERISK:br,CHAR_AT:eg,CHAR_BACKWARD_SLASH:Dt,CHAR_COMMA:tg,CHAR_DOT:_r,CHAR_EXCLAMATION_MARK:xr,CHAR_FORWARD_SLASH:Ha,CHAR_LEFT_CURLY_BRACE:Sr,CHAR_LEFT_PARENTHESES:Ar,CHAR_LEFT_SQUARE_BRACKET:ng,CHAR_PLUS:rg,CHAR_QUESTION_MARK:Po,CHAR_RIGHT_CURLY_BRACE:ig,CHAR_RIGHT_PARENTHESES:Lo,CHAR_RIGHT_SQUARE_BRACKET:og}=Zn,Do=e=>e===Ha||e===Dt,ko=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},sg=(e,t)=>{const n=t||{},r=e.length-1,i=n.parts===!0||n.scanToEnd===!0,s=[],o=[],a=[];let u=e,f=-1,c=0,l=0,p=!1,d=!1,h=!1,m=!1,g=!1,w=!1,_=!1,C=!1,T=!1,R=!1,F=0,j,x,S={value:"",depth:0,isGlob:!1};const N=()=>f>=r,v=()=>u.charCodeAt(f+1),M=()=>(j=x,u.charCodeAt(++f));for(;f<r;){x=M();let $;if(x===Dt){_=S.backslashes=!0,x=M(),x===Sr&&(w=!0);continue}if(w===!0||x===Sr){for(F++;N()!==!0&&(x=M());){if(x===Dt){_=S.backslashes=!0,M();continue}if(x===Sr){F++;continue}if(w!==!0&&x===_r&&(x=M())===_r){if(p=S.isBrace=!0,h=S.isGlob=!0,R=!0,i===!0)continue;break}if(w!==!0&&x===tg){if(p=S.isBrace=!0,h=S.isGlob=!0,R=!0,i===!0)continue;break}if(x===ig&&(F--,F===0)){w=!1,p=S.isBrace=!0,R=!0;break}}if(i===!0)continue;break}if(x===Ha){if(s.push(f),o.push(S),S={value:"",depth:0,isGlob:!1},R===!0)continue;if(j===_r&&f===c+1){c+=2;continue}l=f+1;continue}if(n.noext!==!0&&(x===rg||x===eg||x===br||x===Po||x===xr)===!0&&v()===Ar){if(h=S.isGlob=!0,m=S.isExtglob=!0,R=!0,x===xr&&f===c&&(T=!0),i===!0){for(;N()!==!0&&(x=M());){if(x===Dt){_=S.backslashes=!0,x=M();continue}if(x===Lo){h=S.isGlob=!0,R=!0;break}}continue}break}if(x===br){if(j===br&&(g=S.isGlobstar=!0),h=S.isGlob=!0,R=!0,i===!0)continue;break}if(x===Po){if(h=S.isGlob=!0,R=!0,i===!0)continue;break}if(x===ng){for(;N()!==!0&&($=M());){if($===Dt){_=S.backslashes=!0,M();continue}if($===og){d=S.isBracket=!0,h=S.isGlob=!0,R=!0;break}}if(i===!0)continue;break}if(n.nonegate!==!0&&x===xr&&f===c){C=S.negated=!0,c++;continue}if(n.noparen!==!0&&x===Ar){if(h=S.isGlob=!0,i===!0){for(;N()!==!0&&(x=M());){if(x===Ar){_=S.backslashes=!0,x=M();continue}if(x===Lo){R=!0;break}}continue}break}if(h===!0){if(R=!0,i===!0)continue;break}}n.noext===!0&&(m=!1,h=!1);let B=u,z="",E="";c>0&&(z=u.slice(0,c),u=u.slice(c),l-=c),B&&h===!0&&l>0?(B=u.slice(0,l),E=u.slice(l)):h===!0?(B="",E=u):B=u,B&&B!==""&&B!=="/"&&B!==u&&Do(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),n.unescape===!0&&(E&&(E=No.removeBackslashes(E)),B&&_===!0&&(B=No.removeBackslashes(B)));const b={prefix:z,input:e,start:c,base:B,glob:E,isBrace:p,isBracket:d,isGlob:h,isExtglob:m,isGlobstar:g,negated:C,negatedExtglob:T};if(n.tokens===!0&&(b.maxDepth=0,Do(x)||o.push(S),b.tokens=o),n.parts===!0||n.tokens===!0){let $;for(let D=0;D<s.length;D++){const U=$?$+1:c,K=s[D],V=e.slice(U,K);n.tokens&&(D===0&&c!==0?(o[D].isPrefix=!0,o[D].value=z):o[D].value=V,ko(o[D]),b.maxDepth+=o[D].depth),(D!==0||V!=="")&&a.push(V),$=K}if($&&$+1<e.length){const D=e.slice($+1);a.push(D),n.tokens&&(o[o.length-1].value=D,ko(o[o.length-1]),b.maxDepth+=o[o.length-1].depth)}b.slashes=s,b.parts=a}return b};var ag=sg;const Rn=Zn,we=Kt,{MAX_LENGTH:$n,POSIX_REGEX_SOURCE:ug,REGEX_NON_SPECIAL_CHARS:cg,REGEX_SPECIAL_CHARS_BACKREF:lg,REPLACEMENTS:Ua}=Rn,fg=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch{return e.map(i=>we.escapeRegex(i)).join("..")}return n},pt=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,wi=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Ua[e]||e;const n={...t},r=typeof n.maxLength=="number"?Math.min($n,n.maxLength):$n;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const s={type:"bos",value:"",output:n.prepend||""},o=[s],a=n.capture?"":"?:",u=we.isWindows(t),f=Rn.globChars(u),c=Rn.extglobChars(f),{DOT_LITERAL:l,PLUS_LITERAL:p,SLASH_LITERAL:d,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:w,NO_DOTS_SLASH:_,QMARK:C,QMARK_NO_DOT:T,STAR:R,START_ANCHOR:F}=f,j=L=>`(${a}(?:(?!${F}${L.dot?m:l}).)*?)`,x=n.dot?"":g,S=n.dot?C:T;let N=n.bash===!0?j(n):R;n.capture&&(N=`(${N})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);const v={input:e,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=we.removePrefix(e,v),i=e.length;const M=[],B=[],z=[];let E=s,b;const $=()=>v.index===i-1,D=v.peek=(L=1)=>e[v.index+L],U=v.advance=()=>e[++v.index]||"",K=()=>e.slice(v.index+1),V=(L="",W=0)=>{v.consumed+=L,v.index+=W},J=L=>{v.output+=L.output!=null?L.output:L.value,V(L.value)},Se=()=>{let L=1;for(;D()==="!"&&(D(2)!=="("||D(3)==="?");)U(),v.start++,L++;return L%2===0?!1:(v.negated=!0,v.start++,!0)},I=L=>{v[L]++,z.push(L)},k=L=>{v[L]--,z.pop()},P=L=>{if(E.type==="globstar"){const W=v.braces>0&&(L.type==="comma"||L.type==="brace"),O=L.extglob===!0||M.length&&(L.type==="pipe"||L.type==="paren");L.type!=="slash"&&L.type!=="paren"&&!W&&!O&&(v.output=v.output.slice(0,-E.output.length),E.type="star",E.value="*",E.output=N,v.output+=E.output)}if(M.length&&L.type!=="paren"&&(M[M.length-1].inner+=L.value),(L.value||L.output)&&J(L),E&&E.type==="text"&&L.type==="text"){E.value+=L.value,E.output=(E.output||"")+L.value;return}L.prev=E,o.push(L),E=L},Y=(L,W)=>{const O={...c[W],conditions:1,inner:""};O.prev=E,O.parens=v.parens,O.output=v.output;const q=(n.capture?"(":"")+O.open;I("parens"),P({type:L,value:W,output:v.output?"":h}),P({type:"paren",extglob:!0,value:U(),output:q}),M.push(O)},ue=L=>{let W=L.close+(n.capture?")":""),O;if(L.type==="negate"){let q=N;if(L.inner&&L.inner.length>1&&L.inner.includes("/")&&(q=j(n)),(q!==N||$()||/^\)+$/.test(K()))&&(W=L.close=`)$))${q}`),L.inner.includes("*")&&(O=K())&&/^\.[^\\/.]+$/.test(O)){const Q=wi(O,{...t,fastpaths:!1}).output;W=L.close=`)${Q})${q})`}L.prev.type==="bos"&&(v.negatedExtglob=!0)}P({type:"paren",extglob:!0,value:b,output:W}),k("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let L=!1,W=e.replace(lg,(O,q,Q,re,X,Ie)=>re==="\\"?(L=!0,O):re==="?"?q?q+re+(X?C.repeat(X.length):""):Ie===0?S+(X?C.repeat(X.length):""):C.repeat(Q.length):re==="."?l.repeat(Q.length):re==="*"?q?q+re+(X?N:""):N:q?O:`\\${O}`);return L===!0&&(n.unescape===!0?W=W.replace(/\\/g,""):W=W.replace(/\\+/g,O=>O.length%2===0?"\\\\":O?"\\":"")),W===e&&n.contains===!0?(v.output=e,v):(v.output=we.wrapOutput(W,v,t),v)}for(;!$();){if(b=U(),b==="\0")continue;if(b==="\\"){const O=D();if(O==="/"&&n.bash!==!0||O==="."||O===";")continue;if(!O){b+="\\",P({type:"text",value:b});continue}const q=/^\\+/.exec(K());let Q=0;if(q&&q[0].length>2&&(Q=q[0].length,v.index+=Q,Q%2!==0&&(b+="\\")),n.unescape===!0?b=U():b+=U(),v.brackets===0){P({type:"text",value:b});continue}}if(v.brackets>0&&(b!=="]"||E.value==="["||E.value==="[^")){if(n.posix!==!1&&b===":"){const O=E.value.slice(1);if(O.includes("[")&&(E.posix=!0,O.includes(":"))){const q=E.value.lastIndexOf("["),Q=E.value.slice(0,q),re=E.value.slice(q+2),X=ug[re];if(X){E.value=Q+X,v.backtrack=!0,U(),!s.output&&o.indexOf(E)===1&&(s.output=h);continue}}}(b==="["&&D()!==":"||b==="-"&&D()==="]")&&(b=`\\${b}`),b==="]"&&(E.value==="["||E.value==="[^")&&(b=`\\${b}`),n.posix===!0&&b==="!"&&E.value==="["&&(b="^"),E.value+=b,J({value:b});continue}if(v.quotes===1&&b!=='"'){b=we.escapeRegex(b),E.value+=b,J({value:b});continue}if(b==='"'){v.quotes=v.quotes===1?0:1,n.keepQuotes===!0&&P({type:"text",value:b});continue}if(b==="("){I("parens"),P({type:"paren",value:b});continue}if(b===")"){if(v.parens===0&&n.strictBrackets===!0)throw new SyntaxError(pt("opening","("));const O=M[M.length-1];if(O&&v.parens===O.parens+1){ue(M.pop());continue}P({type:"paren",value:b,output:v.parens?")":"\\)"}),k("parens");continue}if(b==="["){if(n.nobracket===!0||!K().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(pt("closing","]"));b=`\\${b}`}else I("brackets");P({type:"bracket",value:b});continue}if(b==="]"){if(n.nobracket===!0||E&&E.type==="bracket"&&E.value.length===1){P({type:"text",value:b,output:`\\${b}`});continue}if(v.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(pt("opening","["));P({type:"text",value:b,output:`\\${b}`});continue}k("brackets");const O=E.value.slice(1);if(E.posix!==!0&&O[0]==="^"&&!O.includes("/")&&(b=`/${b}`),E.value+=b,J({value:b}),n.literalBrackets===!1||we.hasRegexChars(O))continue;const q=we.escapeRegex(E.value);if(v.output=v.output.slice(0,-E.value.length),n.literalBrackets===!0){v.output+=q,E.value=q;continue}E.value=`(${a}${q}|${E.value})`,v.output+=E.value;continue}if(b==="{"&&n.nobrace!==!0){I("braces");const O={type:"brace",value:b,output:"(",outputIndex:v.output.length,tokensIndex:v.tokens.length};B.push(O),P(O);continue}if(b==="}"){const O=B[B.length-1];if(n.nobrace===!0||!O){P({type:"text",value:b,output:b});continue}let q=")";if(O.dots===!0){const Q=o.slice(),re=[];for(let X=Q.length-1;X>=0&&(o.pop(),Q[X].type!=="brace");X--)Q[X].type!=="dots"&&re.unshift(Q[X].value);q=fg(re,n),v.backtrack=!0}if(O.comma!==!0&&O.dots!==!0){const Q=v.output.slice(0,O.outputIndex),re=v.tokens.slice(O.tokensIndex);O.value=O.output="\\{",b=q="\\}",v.output=Q;for(const X of re)v.output+=X.output||X.value}P({type:"brace",value:b,output:q}),k("braces"),B.pop();continue}if(b==="|"){M.length>0&&M[M.length-1].conditions++,P({type:"text",value:b});continue}if(b===","){let O=b;const q=B[B.length-1];q&&z[z.length-1]==="braces"&&(q.comma=!0,O="|"),P({type:"comma",value:b,output:O});continue}if(b==="/"){if(E.type==="dot"&&v.index===v.start+1){v.start=v.index+1,v.consumed="",v.output="",o.pop(),E=s;continue}P({type:"slash",value:b,output:d});continue}if(b==="."){if(v.braces>0&&E.type==="dot"){E.value==="."&&(E.output=l);const O=B[B.length-1];E.type="dots",E.output+=b,E.value+=b,O.dots=!0;continue}if(v.braces+v.parens===0&&E.type!=="bos"&&E.type!=="slash"){P({type:"text",value:b,output:l});continue}P({type:"dot",value:b,output:l});continue}if(b==="?"){if(!(E&&E.value==="(")&&n.noextglob!==!0&&D()==="("&&D(2)!=="?"){Y("qmark",b);continue}if(E&&E.type==="paren"){const q=D();let Q=b;if(q==="<"&&!we.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(E.value==="("&&!/[!=<:]/.test(q)||q==="<"&&!/<([!=]|\w+>)/.test(K()))&&(Q=`\\${b}`),P({type:"text",value:b,output:Q});continue}if(n.dot!==!0&&(E.type==="slash"||E.type==="bos")){P({type:"qmark",value:b,output:T});continue}P({type:"qmark",value:b,output:C});continue}if(b==="!"){if(n.noextglob!==!0&&D()==="("&&(D(2)!=="?"||!/[!=<:]/.test(D(3)))){Y("negate",b);continue}if(n.nonegate!==!0&&v.index===0){Se();continue}}if(b==="+"){if(n.noextglob!==!0&&D()==="("&&D(2)!=="?"){Y("plus",b);continue}if(E&&E.value==="("||n.regex===!1){P({type:"plus",value:b,output:p});continue}if(E&&(E.type==="bracket"||E.type==="paren"||E.type==="brace")||v.parens>0){P({type:"plus",value:b});continue}P({type:"plus",value:p});continue}if(b==="@"){if(n.noextglob!==!0&&D()==="("&&D(2)!=="?"){P({type:"at",extglob:!0,value:b,output:""});continue}P({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);const O=cg.exec(K());O&&(b+=O[0],v.index+=O[0].length),P({type:"text",value:b});continue}if(E&&(E.type==="globstar"||E.star===!0)){E.type="star",E.star=!0,E.value+=b,E.output=N,v.backtrack=!0,v.globstar=!0,V(b);continue}let L=K();if(n.noextglob!==!0&&/^\([^?]/.test(L)){Y("star",b);continue}if(E.type==="star"){if(n.noglobstar===!0){V(b);continue}const O=E.prev,q=O.prev,Q=O.type==="slash"||O.type==="bos",re=q&&(q.type==="star"||q.type==="globstar");if(n.bash===!0&&(!Q||L[0]&&L[0]!=="/")){P({type:"star",value:b,output:""});continue}const X=v.braces>0&&(O.type==="comma"||O.type==="brace"),Ie=M.length&&(O.type==="pipe"||O.type==="paren");if(!Q&&O.type!=="paren"&&!X&&!Ie){P({type:"star",value:b,output:""});continue}for(;L.slice(0,3)==="/**";){const Be=e[v.index+4];if(Be&&Be!=="/")break;L=L.slice(3),V("/**",3)}if(O.type==="bos"&&$()){E.type="globstar",E.value+=b,E.output=j(n),v.output=E.output,v.globstar=!0,V(b);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&!re&&$()){v.output=v.output.slice(0,-(O.output+E.output).length),O.output=`(?:${O.output}`,E.type="globstar",E.output=j(n)+(n.strictSlashes?")":"|$)"),E.value+=b,v.globstar=!0,v.output+=O.output+E.output,V(b);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&L[0]==="/"){const Be=L[1]!==void 0?"|$":"";v.output=v.output.slice(0,-(O.output+E.output).length),O.output=`(?:${O.output}`,E.type="globstar",E.output=`${j(n)}${d}|${d}${Be})`,E.value+=b,v.output+=O.output+E.output,v.globstar=!0,V(b+U()),P({type:"slash",value:"/",output:""});continue}if(O.type==="bos"&&L[0]==="/"){E.type="globstar",E.value+=b,E.output=`(?:^|${d}|${j(n)}${d})`,v.output=E.output,v.globstar=!0,V(b+U()),P({type:"slash",value:"/",output:""});continue}v.output=v.output.slice(0,-E.output.length),E.type="globstar",E.output=j(n),E.value+=b,v.output+=E.output,v.globstar=!0,V(b);continue}const W={type:"star",value:b,output:N};if(n.bash===!0){W.output=".*?",(E.type==="bos"||E.type==="slash")&&(W.output=x+W.output),P(W);continue}if(E&&(E.type==="bracket"||E.type==="paren")&&n.regex===!0){W.output=b,P(W);continue}(v.index===v.start||E.type==="slash"||E.type==="dot")&&(E.type==="dot"?(v.output+=w,E.output+=w):n.dot===!0?(v.output+=_,E.output+=_):(v.output+=x,E.output+=x),D()!=="*"&&(v.output+=h,E.output+=h)),P(W)}for(;v.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(pt("closing","]"));v.output=we.escapeLast(v.output,"["),k("brackets")}for(;v.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(pt("closing",")"));v.output=we.escapeLast(v.output,"("),k("parens")}for(;v.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(pt("closing","}"));v.output=we.escapeLast(v.output,"{"),k("braces")}if(n.strictSlashes!==!0&&(E.type==="star"||E.type==="bracket")&&P({type:"maybe_slash",value:"",output:`${d}?`}),v.backtrack===!0){v.output="";for(const L of v.tokens)v.output+=L.output!=null?L.output:L.value,L.suffix&&(v.output+=L.suffix)}return v};wi.fastpaths=(e,t)=>{const n={...t},r=typeof n.maxLength=="number"?Math.min($n,n.maxLength):$n,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=Ua[e]||e;const s=we.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:f,NO_DOT:c,NO_DOTS:l,NO_DOTS_SLASH:p,STAR:d,START_ANCHOR:h}=Rn.globChars(s),m=n.dot?l:c,g=n.dot?p:c,w=n.capture?"":"?:",_={negated:!1,prefix:""};let C=n.bash===!0?".*?":d;n.capture&&(C=`(${C})`);const T=x=>x.noglobstar===!0?C:`(${w}(?:(?!${h}${x.dot?f:o}).)*?)`,R=x=>{switch(x){case"*":return`${m}${u}${C}`;case".*":return`${o}${u}${C}`;case"*.*":return`${m}${C}${o}${u}${C}`;case"*/*":return`${m}${C}${a}${u}${g}${C}`;case"**":return m+T(n);case"**/*":return`(?:${m}${T(n)}${a})?${g}${u}${C}`;case"**/*.*":return`(?:${m}${T(n)}${a})?${g}${C}${o}${u}${C}`;case"**/.*":return`(?:${m}${T(n)}${a})?${o}${u}${C}`;default:{const S=/^(.*?)\.(\w+)$/.exec(x);if(!S)return;const N=R(S[1]);return N?N+o+S[2]:void 0}}},F=we.removePrefix(e,_);let j=R(F);return j&&n.strictSlashes!==!0&&(j+=`${a}?`),j};var pg=wi;const dg=Ee.default,hg=ag,Ur=pg,bi=Kt,mg=Zn,gg=e=>e&&typeof e=="object"&&!Array.isArray(e),ie=(e,t,n=!1)=>{if(Array.isArray(e)){const c=e.map(p=>ie(p,t,n));return p=>{for(const d of c){const h=d(p);if(h)return h}return!1}}const r=gg(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},s=bi.isWindows(t),o=r?ie.compileRe(e,t):ie.makeRe(e,t,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(i.ignore){const c={...t,ignore:null,onMatch:null,onResult:null};u=ie(i.ignore,c,n)}const f=(c,l=!1)=>{const{isMatch:p,match:d,output:h}=ie.test(c,o,t,{glob:e,posix:s}),m={glob:e,state:a,regex:o,posix:s,input:c,output:h,match:d,isMatch:p};return typeof i.onResult=="function"&&i.onResult(m),p===!1?(m.isMatch=!1,l?m:!1):u(c)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,l?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),l?m:!0)};return n&&(f.state=a),f};ie.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};const s=n||{},o=s.format||(i?bi.toPosixSlashes:null);let a=e===r,u=a&&o?o(e):e;return a===!1&&(u=o?o(e):e,a=u===r),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=ie.matchBase(e,t,n,i):a=t.exec(u)),{isMatch:!!a,match:a,output:u}};ie.matchBase=(e,t,n,r=bi.isWindows(n))=>(t instanceof RegExp?t:ie.makeRe(t,n)).test(dg.basename(e));ie.isMatch=(e,t,n)=>ie(t,n)(e);ie.parse=(e,t)=>Array.isArray(e)?e.map(n=>ie.parse(n,t)):Ur(e,{...t,fastpaths:!1});ie.scan=(e,t)=>hg(e,t);ie.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;const i=t||{},s=i.contains?"":"^",o=i.contains?"":"$";let a=`${s}(?:${e.output})${o}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);const u=ie.toRegex(a,t);return r===!0&&(u.state=e),u};ie.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=Ur.fastpaths(e,t)),i.output||(i=Ur(e,t)),ie.compileRe(i,t,n,r)};ie.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(n){if(t&&t.debug===!0)throw n;return/$^/}};ie.constants=mg;var yg=ie,vg=yg;const Ga=ut.default,qa=Hm,je=vg,Gr=Kt,Mo=e=>e===""||e==="./",za=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},Z=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,i=new Set,s=new Set,o=0,a=c=>{s.add(c.output),n&&n.onResult&&n.onResult(c)};for(let c=0;c<t.length;c++){let l=je(String(t[c]),{...n,onResult:a},!0),p=l.state.negated||l.state.negatedExtglob;p&&o++;for(let d of e){let h=l(d,!0);(p?!h.isMatch:h.isMatch)&&(p?r.add(h.output):(r.delete(h.output),i.add(h.output)))}}let f=(o===t.length?[...s]:[...i]).filter(c=>!r.has(c));if(n&&f.length===0){if(n.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(c=>c.replace(/\\/g,"")):t}return f};Z.match=Z;Z.matcher=(e,t)=>je(e,t);Z.isMatch=(e,t,n)=>je(t,n)(e);Z.any=Z.isMatch;Z.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],s=a=>{n.onResult&&n.onResult(a),i.push(a.output)},o=new Set(Z(e,t,{...n,onResult:s}));for(let a of i)o.has(a)||r.add(a);return[...r]};Z.contains=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Ga.inspect(e)}"`);if(Array.isArray(t))return t.some(r=>Z.contains(e,r,n));if(typeof t=="string"){if(Mo(e)||Mo(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return Z.isMatch(e,t,{...n,contains:!0})};Z.matchKeys=(e,t,n)=>{if(!Gr.isObject(e))throw new TypeError("Expected the first argument to be an object");let r=Z(Object.keys(e),t,n),i={};for(let s of r)i[s]=e[s];return i};Z.some=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let s=je(String(i),n);if(r.some(o=>s(o)))return!0}return!1};Z.every=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let s=je(String(i),n);if(!r.every(o=>s(o)))return!1}return!0};Z.all=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Ga.inspect(e)}"`);return[].concat(t).every(r=>je(r,n)(e))};Z.capture=(e,t,n)=>{let r=Gr.isWindows(n),s=je.makeRe(String(e),{...n,capture:!0}).exec(r?Gr.toPosixSlashes(t):t);if(s)return s.slice(1).map(o=>o===void 0?"":o)};Z.makeRe=(...e)=>je.makeRe(...e);Z.scan=(...e)=>je.scan(...e);Z.parse=(e,t)=>{let n=[];for(let r of[].concat(e||[]))for(let i of qa(String(r),t))n.push(je.parse(i,t));return n};Z.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!za(e)?[e]:qa(e,t)};Z.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return Z.braces(e,{...t,expand:!0})};Z.hasBraces=za;var Eg=Z,_i=ye&&ye.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_e,"__esModule",{value:!0});_e.readPackageJSON=_e.extractWorkspaces=_e.isMatchWorkspaces=_e.checkWorkspaces=_e.findWorkspaceRoot=void 0;const Fn=_i(Ee.default),wg=_i(Jh),jo=Ye.default,bg=_i(Eg);function Ge(e){e||(e=process.cwd());let t=wg.default.sync(e);if(!t)return null;e=Fn.default.normalize(t);let n=null,r=e;do{const i=er(r);Jn(i);let{done:s,found:o}=Ka(r,e);if(s)return o;n=r,r=Fn.default.dirname(r)}while(r!==n);return null}_e.findWorkspaceRoot=Ge;function Ka(e,t){const n=er(e),r=Jn(n);let i=!1,s,o;return r&&(i=!0,o=Fn.default.relative(e,t),o===""||xi(o,r)?s=e:s=null),{done:i,found:s,relativePath:o}}_e.checkWorkspaces=Ka;function xi(e,t){return bg.default([e],t).length>0}_e.isMatchWorkspaces=xi;function Jn(e){const t=(e||{}).workspaces;return t&&t.packages||(Array.isArray(t)?t:null)}_e.extractWorkspaces=Jn;function er(e){const t=Fn.default.join(e,"package.json");return jo.existsSync(t)?JSON.parse(jo.readFileSync(t,"utf8")):null}_e.readPackageJSON=er;Ge.findWorkspaceRoot=Ge;Ge.readPackageJSON=er;Ge.extractWorkspaces=Jn;Ge.isMatchWorkspaces=xi;Ge.default=Ge;_e.default=Ge;const _g=_e;_g.findWorkspaceRoot;var xg={exports:{}},Si={exports:{}};class Sg{constructor(t){this.value=t,this.next=void 0}}let Ag=class{constructor(){this.clear()}enqueue(t){const n=new Sg(t);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){const t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};var Tg=Ag;const Cg=Tg,Rg=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=new Cg;let n=0;const r=()=>{n--,t.size>0&&t.dequeue()()},i=async(a,u,...f)=>{n++;const c=(async()=>a(...f))();u(c);try{await c}catch{}r()},s=(a,u,...f)=>{t.enqueue(i.bind(null,a,u,...f)),(async()=>(await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()))()},o=(a,...u)=>new Promise(f=>{s(a,f,...u)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o};var $g=Rg;const Bo=$g;class Wa extends Error{constructor(t){super(),this.value=t}}const Fg=async(e,t)=>t(await e),Ig=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new Wa(t[0]);return!1},Og=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=Bo(n.concurrency),i=[...e].map(o=>[o,r(Fg,o,t)]),s=Bo(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>s(Ig,o)))}catch(o){if(o instanceof Wa)return o.value;throw o}};var Ng=Og;const Ya=Ee.default,In=Ye.default,{promisify:Va}=ut.default,Pg=Ng,Lg=Va(In.stat),Dg=Va(In.lstat),Qa={directory:"isDirectory",file:"isFile"};function Xa({type:e}){if(!(e in Qa))throw new Error(`Invalid type specified: ${e}`)}const Za=(e,t)=>e===void 0||t[Qa[e]]();Si.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Xa(t);const n=t.allowSymlinks?Lg:Dg;return Pg(e,async r=>{try{const i=await n(Ya.resolve(t.cwd,r));return Za(t.type,i)}catch{return!1}},t)};Si.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Xa(t);const n=t.allowSymlinks?In.statSync:In.lstatSync;for(const r of e)try{const i=n(Ya.resolve(t.cwd,r));if(Za(t.type,i))return r}catch{}};var kg=Si.exports;(function(e){const t=Ee.default,n=kg,r=Ra,i=Symbol("findUp.stop");e.exports=async(s,o={})=>{let a=t.resolve(o.cwd||"");const{root:u}=t.parse(a),f=[].concat(s),c=async l=>{if(typeof s!="function")return n(f,l);const p=await s(l.cwd);return typeof p=="string"?n([p],l):p};for(;;){const l=await c({...o,cwd:a});if(l===i)return;if(l)return t.resolve(a,l);if(a===u)return;a=t.dirname(a)}},e.exports.sync=(s,o={})=>{let a=t.resolve(o.cwd||"");const{root:u}=t.parse(a),f=[].concat(s),c=l=>{if(typeof s!="function")return n.sync(f,l);const p=s(l.cwd);return typeof p=="string"?n.sync([p],l):p};for(;;){const l=c({...o,cwd:a});if(l===i)return;if(l)return t.resolve(a,l);if(a===u)return;a=t.dirname(a)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(xg);var Ja={exports:{}},ze=bc.default,Mg=process.cwd,fn=null,jg=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return fn||(fn=Mg.call(process)),fn};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var Ho=process.chdir;process.chdir=function(e){fn=null,Ho.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ho)}var Bg=Hg;function Hg(e){ze.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=s(e.chown),e.fchown=s(e.fchown),e.lchown=s(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=a(e.stat),e.fstat=a(e.fstat),e.lstat=a(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(c,l,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(c,l,p,d){d&&process.nextTick(d)},e.lchownSync=function(){}),jg==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:function(c){function l(p,d,h){var m=Date.now(),g=0;c(p,d,function w(_){if(_&&(_.code==="EACCES"||_.code==="EPERM"||_.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(d,function(C,T){C&&C.code==="ENOENT"?c(p,d,w):h(_)})},g),g<100&&(g+=10);return}h&&h(_)})}return Object.setPrototypeOf&&Object.setPrototypeOf(l,c),l}(e.rename)),e.read=typeof e.read!="function"?e.read:function(c){function l(p,d,h,m,g,w){var _;if(w&&typeof w=="function"){var C=0;_=function(T,R,F){if(T&&T.code==="EAGAIN"&&C<10)return C++,c.call(e,p,d,h,m,g,_);w.apply(this,arguments)}}return c.call(e,p,d,h,m,g,_)}return Object.setPrototypeOf&&Object.setPrototypeOf(l,c),l}(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:function(c){return function(l,p,d,h,m){for(var g=0;;)try{return c.call(e,l,p,d,h,m)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}}(e.readSync);function t(c){c.lchmod=function(l,p,d){c.open(l,ze.O_WRONLY|ze.O_SYMLINK,p,function(h,m){if(h){d&&d(h);return}c.fchmod(m,p,function(g){c.close(m,function(w){d&&d(g||w)})})})},c.lchmodSync=function(l,p){var d=c.openSync(l,ze.O_WRONLY|ze.O_SYMLINK,p),h=!0,m;try{m=c.fchmodSync(d,p),h=!1}finally{if(h)try{c.closeSync(d)}catch{}else c.closeSync(d)}return m}}function n(c){ze.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(l,p,d,h){c.open(l,ze.O_SYMLINK,function(m,g){if(m){h&&h(m);return}c.futimes(g,p,d,function(w){c.close(g,function(_){h&&h(w||_)})})})},c.lutimesSync=function(l,p,d){var h=c.openSync(l,ze.O_SYMLINK),m,g=!0;try{m=c.futimesSync(h,p,d),g=!1}finally{if(g)try{c.closeSync(h)}catch{}else c.closeSync(h)}return m}):c.futimes&&(c.lutimes=function(l,p,d,h){h&&process.nextTick(h)},c.lutimesSync=function(){})}function r(c){return c&&function(l,p,d){return c.call(e,l,p,function(h){f(h)&&(h=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(l,p){try{return c.call(e,l,p)}catch(d){if(!f(d))throw d}}}function s(c){return c&&function(l,p,d,h){return c.call(e,l,p,d,function(m){f(m)&&(m=null),h&&h.apply(this,arguments)})}}function o(c){return c&&function(l,p,d){try{return c.call(e,l,p,d)}catch(h){if(!f(h))throw h}}}function a(c){return c&&function(l,p,d){typeof p=="function"&&(d=p,p=null);function h(m,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return p?c.call(e,l,p,h):c.call(e,l,h)}}function u(c){return c&&function(l,p){var d=p?c.call(e,l,p):c.call(e,l);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function f(c){if(!c||c.code==="ENOSYS")return!0;var l=!process.getuid||process.getuid()!==0;return!!(l&&(c.code==="EINVAL"||c.code==="EPERM"))}}var Uo=Hn.default.Stream,Ug=Gg;function Gg(e){return{ReadStream:t,WriteStream:n};function t(r,i){if(!(this instanceof t))return new t(r,i);Uo.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),a=0,u=o.length;a<u;a++){var f=o[a];this[f]=i[f]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}e.open(this.path,this.flags,this.mode,function(c,l){if(c){s.emit("error",c),s.readable=!1;return}s.fd=l,s.emit("open",l),s._read()})}function n(r,i){if(!(this instanceof n))return new n(r,i);Uo.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o<a;o++){var u=s[o];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var qg=Kg,zg=Object.getPrototypeOf||function(e){return e.__proto__};function Kg(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:zg(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}var te=Ye.default,Wg=Bg,Yg=Ug,Vg=qg,rn=ut.default,pe,On;typeof Symbol=="function"&&typeof Symbol.for=="function"?(pe=Symbol.for("graceful-fs.queue"),On=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",On="___graceful-fs.previous");function Qg(){}function eu(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}var rt=Qg;rn.debuglog?rt=rn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(rt=function(){var e=rn.format.apply(rn,arguments);e="GFS4: "+e.split(/\n/).join(`
46
+ GFS4: `),console.error(e)});if(!te[pe]){var Xg=ye[pe]||[];eu(te,Xg),te.close=function(e){function t(n,r){return e.call(te,n,function(i){i||Go(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(t,On,{value:e}),t}(te.close),te.closeSync=function(e){function t(n){e.apply(te,arguments),Go()}return Object.defineProperty(t,On,{value:e}),t}(te.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){rt(te[pe]),ws.default.equal(te[pe].length,0)})}ye[pe]||eu(ye,te[pe]);var tu=Ai(Vg(te));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!te.__patched&&(tu=Ai(te),te.__patched=!0);function Ai(e){Wg(e),e.gracefulify=Ai,e.createReadStream=R,e.createWriteStream=F;var t=e.readFile;e.readFile=n;function n(S,N,v){return typeof N=="function"&&(v=N,N=null),M(S,N,v);function M(B,z,E,b){return t(B,z,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?dt([M,[B,z,E],$,b||Date.now(),Date.now()]):typeof E=="function"&&E.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=i;function i(S,N,v,M){return typeof v=="function"&&(M=v,v=null),B(S,N,v,M);function B(z,E,b,$,D){return r(z,E,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?dt([B,[z,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var s=e.appendFile;s&&(e.appendFile=o);function o(S,N,v,M){return typeof v=="function"&&(M=v,v=null),B(S,N,v,M);function B(z,E,b,$,D){return s(z,E,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?dt([B,[z,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var a=e.copyFile;a&&(e.copyFile=u);function u(S,N,v,M){return typeof v=="function"&&(M=v,v=0),B(S,N,v,M);function B(z,E,b,$,D){return a(z,E,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?dt([B,[z,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var f=e.readdir;e.readdir=l;var c=/^v[0-5]\./;function l(S,N,v){typeof N=="function"&&(v=N,N=null);var M=c.test(process.version)?function(E,b,$,D){return f(E,B(E,b,$,D))}:function(E,b,$,D){return f(E,b,B(E,b,$,D))};return M(S,N,v);function B(z,E,b,$){return function(D,U){D&&(D.code==="EMFILE"||D.code==="ENFILE")?dt([M,[z,E,b],D,$||Date.now(),Date.now()]):(U&&U.sort&&U.sort(),typeof b=="function"&&b.call(this,D,U))}}}if(process.version.substr(0,4)==="v0.8"){var p=Yg(e);w=p.ReadStream,C=p.WriteStream}var d=e.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=_);var h=e.WriteStream;h&&(C.prototype=Object.create(h.prototype),C.prototype.open=T),Object.defineProperty(e,"ReadStream",{get:function(){return w},set:function(S){w=S},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return C},set:function(S){C=S},enumerable:!0,configurable:!0});var m=w;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(S){m=S},enumerable:!0,configurable:!0});var g=C;Object.defineProperty(e,"FileWriteStream",{get:function(){return g},set:function(S){g=S},enumerable:!0,configurable:!0});function w(S,N){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function _(){var S=this;x(S.path,S.flags,S.mode,function(N,v){N?(S.autoClose&&S.destroy(),S.emit("error",N)):(S.fd=v,S.emit("open",v),S.read())})}function C(S,N){return this instanceof C?(h.apply(this,arguments),this):C.apply(Object.create(C.prototype),arguments)}function T(){var S=this;x(S.path,S.flags,S.mode,function(N,v){N?(S.destroy(),S.emit("error",N)):(S.fd=v,S.emit("open",v))})}function R(S,N){return new e.ReadStream(S,N)}function F(S,N){return new e.WriteStream(S,N)}var j=e.open;e.open=x;function x(S,N,v,M){return typeof v=="function"&&(M=v,v=null),B(S,N,v,M);function B(z,E,b,$,D){return j(z,E,b,function(U,K){U&&(U.code==="EMFILE"||U.code==="ENFILE")?dt([B,[z,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}return e}function dt(e){rt("ENQUEUE",e[0].name,e[1]),te[pe].push(e),Ti()}var on;function Go(){for(var e=Date.now(),t=0;t<te[pe].length;++t)te[pe][t].length>2&&(te[pe][t][3]=e,te[pe][t][4]=e);Ti()}function Ti(){if(clearTimeout(on),on=void 0,te[pe].length!==0){var e=te[pe].shift(),t=e[0],n=e[1],r=e[2],i=e[3],s=e[4];if(i===void 0)rt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){rt("TIMEOUT",t.name,n);var o=n.pop();typeof o=="function"&&o.call(null,r)}else{var a=Date.now()-s,u=Math.max(s-i,1),f=Math.min(u*1.2,100);a>=f?(rt("RETRY",t.name,n),t.apply(null,n.concat([i]))):te[pe].push(e)}on===void 0&&(on=setTimeout(Ti,0))}}const qo=(e,t)=>function(...n){const r=t.promiseModule;return new r((i,s)=>{t.multiArgs?n.push((...o)=>{t.errorFirst?o[0]?s(o):(o.shift(),i(o)):i(o)}):t.errorFirst?n.push((o,a)=>{o?s(o):i(a)}):n.push(i),e.apply(this,n)})};var Zg=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);const r=s=>{const o=a=>typeof a=="string"?s===a:a.test(s);return t.include?t.include.some(o):!t.exclude.some(o)};let i;n==="function"?i=function(...s){return t.excludeMain?e(...s):qo(e,t).apply(this,s)}:i=Object.create(Object.getPrototypeOf(e));for(const s in e){const o=e[s];i[s]=typeof o=="function"&&r(s)?qo(o,t):o}return i},Jg=e=>{if(typeof e!="string")throw new TypeError("Expected a string, got "+typeof e);return e.charCodeAt(0)===65279?e.slice(1):e},ne={},Wt={},Ce={};function nu(e){return typeof e>"u"||e===null}function ey(e){return typeof e=="object"&&e!==null}function ty(e){return Array.isArray(e)?e:nu(e)?[]:[e]}function ny(e,t){var n,r,i,s;if(t)for(s=Object.keys(t),n=0,r=s.length;n<r;n+=1)i=s[n],e[i]=t[i];return e}function ry(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function iy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}Ce.isNothing=nu;Ce.isObject=ey;Ce.toArray=ty;Ce.repeat=ry;Ce.isNegativeZero=iy;Ce.extend=ny;function Ut(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Ut.prototype=Object.create(Error.prototype);Ut.prototype.constructor=Ut;Ut.prototype.toString=function(t){var n=this.name+": ";return n+=this.reason||"(unknown reason)",!t&&this.mark&&(n+=" "+this.mark.toString()),n};var Yt=Ut,zo=Ce;function Ci(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}Ci.prototype.getSnippet=function(t,n){var r,i,s,o,a;if(!this.buffer)return null;for(t=t||4,n=n||75,r="",i=this.position;i>0&&`\0\r
48
47
  …\u2028\u2029`.indexOf(this.buffer.charAt(i-1))===-1;)if(i-=1,this.position-i>n/2-1){r=" ... ",i+=5;break}for(s="",o=this.position;o<this.buffer.length&&`\0\r
49
- …\u2028\u2029`.indexOf(this.buffer.charAt(o))===-1;)if(o+=1,o-this.position>n/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(i,o),Wo.repeat(" ",t)+r+a+s+`
50
- `+Wo.repeat(" ",t+this.position-i+r.length)+"^"};$i.prototype.toString=function(t){var n,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),t||(n=this.getSnippet(),n&&(r+=`:
51
- `+n)),r};var oy=$i,Yo=Yt,sy=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],ay=["scalar","sequence","mapping"];function uy(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function cy(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(sy.indexOf(n)===-1)throw new Yo('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=uy(t.styleAliases||null),ay.indexOf(this.kind)===-1)throw new Yo('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ce=cy,Vo=Ce,pn=Yt,ly=ce;function qr(e,t,n){var r=[];return e.include.forEach(function(i){n=qr(i,t,n)}),e[t].forEach(function(i){n.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&r.push(o)}),n.push(i)}),n.filter(function(i,s){return r.indexOf(s)===-1})}function fy(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,n;function r(i){e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function bt(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new pn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=qr(this,"implicit",[]),this.compiledExplicit=qr(this,"explicit",[]),this.compiledTypeMap=fy(this.compiledImplicit,this.compiledExplicit)}bt.DEFAULT=null;bt.create=function(){var t,n;switch(arguments.length){case 1:t=bt.DEFAULT,n=arguments[0];break;case 2:t=arguments[0],n=arguments[1];break;default:throw new pn("Wrong number of arguments for Schema.create function")}if(t=Vo.toArray(t),n=Vo.toArray(n),!t.every(function(r){return r instanceof bt}))throw new pn("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!n.every(function(r){return r instanceof ly}))throw new pn("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new bt({include:t,explicit:n})};var It=bt,py=ce,dy=new py("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),hy=ce,my=new hy("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),gy=ce,yy=new gy("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),vy=It,Fi=new vy({explicit:[dy,my,yy]}),Ey=ce;function wy(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function by(){return null}function _y(e){return e===null}var xy=new Ey("tag:yaml.org,2002:null",{kind:"scalar",resolve:wy,construct:by,predicate:_y,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"}),Ay=ce;function Sy(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Ty(e){return e==="true"||e==="True"||e==="TRUE"}function Cy(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Ry=new Ay("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Sy,construct:Ty,predicate:Cy,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"}),$y=Ce,Fy=ce;function Iy(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Oy(e){return 48<=e&&e<=55}function Ny(e){return 48<=e&&e<=57}function Py(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Iy(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}for(;n<t;n++)if(i=e[n],i!=="_"){if(!Oy(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(i===":")break;if(!Ny(e.charCodeAt(n)))return!1;r=!0}return!r||i==="_"?!1:i!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(n))}function Ly(e){var t=e,n=1,r,i,s=[];return t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0"?0:r==="0"?t[1]==="b"?n*parseInt(t.slice(2),2):t[1]==="x"?n*parseInt(t,16):n*parseInt(t,8):t.indexOf(":")!==-1?(t.split(":").forEach(function(o){s.unshift(parseInt(o,10))}),t=0,i=1,s.forEach(function(o){t+=o*i,i*=60}),n*t):n*parseInt(t,10)}function Dy(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!$y.isNegativeZero(e)}var My=new Fy("tag:yaml.org,2002:int",{kind:"scalar",resolve:Py,construct:Ly,predicate:Dy,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),iu=Ce,ky=ce,jy=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Hy(e){return!(e===null||!jy.test(e)||e[e.length-1]==="_")}function By(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(s){i.unshift(parseFloat(s,10))}),t=0,r=1,i.forEach(function(s){t+=s*r,r*=60}),n*t):n*parseFloat(t,10)}var Uy=/^[-+]?[0-9]+e/;function Gy(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(iu.isNegativeZero(e))return"-0.0";return n=e.toString(10),Uy.test(n)?n.replace("e",".e"):n}function qy(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||iu.isNegativeZero(e))}var Ky=new ky("tag:yaml.org,2002:float",{kind:"scalar",resolve:Hy,construct:By,predicate:qy,represent:Gy,defaultStyle:"lowercase"}),zy=It,ou=new zy({include:[Fi],implicit:[xy,Ry,My,Ky]}),Wy=It,su=new Wy({include:[ou]}),Yy=ce,au=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),uu=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 Vy(e){return e===null?!1:au.exec(e)!==null||uu.exec(e)!==null}function Qy(e){var t,n,r,i,s,o,a,u=0,l=null,c,f,p;if(t=au.exec(e),t===null&&(t=uu.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(s=+t[4],o=+t[5],a=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(c=+t[10],f=+(t[11]||0),l=(c*60+f)*6e4,t[9]==="-"&&(l=-l)),p=new Date(Date.UTC(n,r,i,s,o,a,u)),l&&p.setTime(p.getTime()-l),p}function Xy(e){return e.toISOString()}var Zy=new Yy("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Vy,construct:Qy,instanceOf:Date,represent:Xy}),Jy=ce;function ev(e){return e==="<<"||e===null}var tv=new Jy("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ev});function cu(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var et;try{var nv=cu;et=nv("buffer").Buffer}catch{}var rv=ce,Ii=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
52
- \r`;function iv(e){if(e===null)return!1;var t,n,r=0,i=e.length,s=Ii;for(n=0;n<i;n++)if(t=s.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function ov(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=Ii,o=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),et?et.from?et.from(a):new et(a):a}function sv(e){var t="",n=0,r,i,s=e.length,o=Ii;for(r=0;r<s;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=s%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function av(e){return et&&et.isBuffer(e)}var uv=new rv("tag:yaml.org,2002:binary",{kind:"scalar",resolve:iv,construct:ov,predicate:av,represent:sv}),cv=ce,lv=Object.prototype.hasOwnProperty,fv=Object.prototype.toString;function pv(e){if(e===null)return!0;var t=[],n,r,i,s,o,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],o=!1,fv.call(i)!=="[object Object]")return!1;for(s in i)if(lv.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function dv(e){return e!==null?e:[]}var hv=new cv("tag:yaml.org,2002:omap",{kind:"sequence",resolve:pv,construct:dv}),mv=ce,gv=Object.prototype.toString;function yv(e){if(e===null)return!0;var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],gv.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[t]=[i[0],r[i[0]]]}return!0}function vv(e){if(e===null)return[];var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),s[t]=[i[0],r[i[0]]];return s}var Ev=new mv("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:yv,construct:vv}),wv=ce,bv=Object.prototype.hasOwnProperty;function _v(e){if(e===null)return!0;var t,n=e;for(t in n)if(bv.call(n,t)&&n[t]!==null)return!1;return!0}function xv(e){return e!==null?e:{}}var Av=new wv("tag:yaml.org,2002:set",{kind:"mapping",resolve:_v,construct:xv}),Sv=It,Vt=new Sv({include:[su],implicit:[Zy,tv],explicit:[uv,hv,Ev,Av]}),Tv=ce;function Cv(){return!0}function Rv(){}function $v(){return""}function Fv(e){return typeof e>"u"}var Iv=new Tv("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:Cv,construct:Rv,predicate:Fv,represent:$v}),Ov=ce;function Nv(e){if(e===null||e.length===0)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";return!(t[0]==="/"&&(n&&(r=n[1]),r.length>3||t[t.length-r.length-1]!=="/"))}function Pv(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return t[0]==="/"&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function Lv(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function Dv(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var Mv=new Ov("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:Nv,construct:Pv,predicate:Dv,represent:Lv}),Nn;try{var kv=cu;Nn=kv("esprima")}catch{typeof window<"u"&&(Nn=window.esprima)}var jv=ce;function Hv(e){if(e===null)return!1;try{var t="("+e+")",n=Nn.parse(t,{range:!0});return!(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function Bv(e){var t="("+e+")",n=Nn.parse(t,{range:!0}),r=[],i;if(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach(function(s){r.push(s.name)}),i=n.body[0].expression.body.range,n.body[0].expression.body.type==="BlockStatement"?new Function(r,t.slice(i[0]+1,i[1]-1)):new Function(r,"return "+t.slice(i[0],i[1]))}function Uv(e){return e.toString()}function Gv(e){return Object.prototype.toString.call(e)==="[object Function]"}var qv=new jv("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:Hv,construct:Bv,predicate:Gv,represent:Uv}),Qo=It,tr=Qo.DEFAULT=new Qo({include:[Vt],explicit:[Iv,Mv,qv]}),Be=Ce,lu=Yt,Kv=oy,fu=Vt,zv=tr,ze=Object.prototype.hasOwnProperty,Pn=1,pu=2,du=3,Ln=4,Tr=1,Wv=2,Xo=3,Yv=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Vv=/[\x85\u2028\u2029]/,Qv=/[,\[\]\{\}]/,hu=/^(?:!|!!|![a-z\-]+!)$/i,mu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Zo(e){return Object.prototype.toString.call(e)}function Me(e){return e===10||e===13}function rt(e){return e===9||e===32}function ve(e){return e===9||e===32||e===10||e===13}function _t(e){return e===44||e===91||e===93||e===123||e===125}function Xv(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Zv(e){return e===120?2:e===117?4:e===85?8:0}function Jv(e){return 48<=e&&e<=57?e-48:-1}function Jo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
53
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function e0(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var gu=new Array(256),yu=new Array(256);for(var dt=0;dt<256;dt++)gu[dt]=Jo(dt)?1:0,yu[dt]=Jo(dt);function t0(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||zv,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function vu(e,t){return new lu(t,new Kv(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function G(e,t){throw vu(e,t)}function Dn(e,t){e.onWarning&&e.onWarning.call(null,vu(e,t))}var es={YAML:function(t,n,r){var i,s,o;t.version!==null&&G(t,"duplication of %YAML directive"),r.length!==1&&G(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&G(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&G(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Dn(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&G(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],hu.test(i)||G(t,"ill-formed tag handle (first argument) of the TAG directive"),ze.call(t.tagMap,i)&&G(t,'there is a previously declared suffix for "'+i+'" tag handle'),mu.test(s)||G(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=s}};function Ke(e,t,n,r){var i,s,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||G(e,"expected valid JSON character");else Yv.test(a)&&G(e,"the stream contains non-printable characters");e.result+=a}}function ts(e,t,n,r){var i,s,o,a;for(Be.isObject(n)||G(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)s=i[o],ze.call(t,s)||(t[s]=n[s],r[s]=!0)}function xt(e,t,n,r,i,s,o,a){var u,l;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,l=i.length;u<l;u+=1)Array.isArray(i[u])&&G(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Zo(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&Zo(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(u=0,l=s.length;u<l;u+=1)ts(e,t,s[u],n);else ts(e,t,s,n);else!e.json&&!ze.call(n,i)&&ze.call(t,i)&&(e.line=o||e.line,e.position=a||e.position,G(e,"duplicated mapping key")),t[i]=s,delete n[i];return t}function Oi(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):G(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function se(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;rt(i);)i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Me(i))for(Oi(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Dn(e,"deficient indentation"),r}function nr(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||ve(n)))}function Ni(e,t){t===1?e.result+=" ":t>1&&(e.result+=Be.repeat(`
54
- `,t-1))}function n0(e,t,n){var r,i,s,o,a,u,l,c,f=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),ve(d)||_t(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),ve(i)||n&&_t(i)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),ve(i)||n&&_t(i))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),ve(r))break}else{if(e.position===e.lineStart&&nr(e)||n&&_t(d))break;if(Me(d))if(u=e.line,l=e.lineStart,c=e.lineIndent,se(e,!1,-1),e.lineIndent>=t){a=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=u,e.lineStart=l,e.lineIndent=c;break}}a&&(Ke(e,s,o,!1),Ni(e,e.line-u),s=o=e.position,a=!1),rt(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return Ke(e,s,o,!1),e.result?!0:(e.kind=f,e.result=p,!1)}function r0(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Ke(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Me(n)?(Ke(e,r,i,!0),Ni(e,se(e,!1,t)),r=i=e.position):e.position===e.lineStart&&nr(e)?G(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);G(e,"unexpected end of the stream within a single quoted scalar")}function i0(e,t){var n,r,i,s,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Ke(e,n,e.position,!0),e.position++,!0;if(a===92){if(Ke(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),Me(a))se(e,!1,t);else if(a<256&&gu[a])e.result+=yu[a],e.position++;else if((o=Zv(a))>0){for(i=o,s=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=Xv(a))>=0?s=(s<<4)+o:G(e,"expected hexadecimal character");e.result+=e0(s),e.position++}else G(e,"unknown escape sequence");n=r=e.position}else Me(a)?(Ke(e,n,r,!0),Ni(e,se(e,!1,t)),n=r=e.position):e.position===e.lineStart&&nr(e)?G(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}G(e,"unexpected end of the stream within a double quoted scalar")}function o0(e,t){var n=!0,r,i=e.tag,s,o=e.anchor,a,u,l,c,f,p={},d,h,g,m;if(m=e.input.charCodeAt(e.position),m===91)u=93,f=!1,s=[];else if(m===123)u=125,f=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),m=e.input.charCodeAt(++e.position);m!==0;){if(se(e,!0,t),m=e.input.charCodeAt(e.position),m===u)return e.position++,e.tag=i,e.anchor=o,e.kind=f?"mapping":"sequence",e.result=s,!0;n||G(e,"missed comma between flow collection entries"),h=d=g=null,l=c=!1,m===63&&(a=e.input.charCodeAt(e.position+1),ve(a)&&(l=c=!0,e.position++,se(e,!0,t))),r=e.line,Ct(e,t,Pn,!1,!0),h=e.tag,d=e.result,se(e,!0,t),m=e.input.charCodeAt(e.position),(c||e.line===r)&&m===58&&(l=!0,m=e.input.charCodeAt(++e.position),se(e,!0,t),Ct(e,t,Pn,!1,!0),g=e.result),f?xt(e,s,p,h,d,g):l?s.push(xt(e,null,p,h,d,g)):s.push(d),se(e,!0,t),m=e.input.charCodeAt(e.position),m===44?(n=!0,m=e.input.charCodeAt(++e.position)):n=!1}G(e,"unexpected end of the stream within a flow collection")}function s0(e,t){var n,r,i=Tr,s=!1,o=!1,a=t,u=0,l=!1,c,f;if(f=e.input.charCodeAt(e.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)Tr===i?i=f===43?Xo:Wv:G(e,"repeat of a chomping mode identifier");else if((c=Jv(f))>=0)c===0?G(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?G(e,"repeat of an indentation width identifier"):(a=t+c-1,o=!0);else break;if(rt(f)){do f=e.input.charCodeAt(++e.position);while(rt(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!Me(f)&&f!==0)}for(;f!==0;){for(Oi(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),Me(f)){u++;continue}if(e.lineIndent<a){i===Xo?e.result+=Be.repeat(`
48
+ …\u2028\u2029`.indexOf(this.buffer.charAt(o))===-1;)if(o+=1,o-this.position>n/2-1){s=" ... ",o-=5;break}return a=this.buffer.slice(i,o),zo.repeat(" ",t)+r+a+s+`
49
+ `+zo.repeat(" ",t+this.position-i+r.length)+"^"};Ci.prototype.toString=function(t){var n,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),t||(n=this.getSnippet(),n&&(r+=`:
50
+ `+n)),r};var oy=Ci,Ko=Yt,sy=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],ay=["scalar","sequence","mapping"];function uy(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function cy(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(sy.indexOf(n)===-1)throw new Ko('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=uy(t.styleAliases||null),ay.indexOf(this.kind)===-1)throw new Ko('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ce=cy,Wo=Ce,pn=Yt,ly=ce;function qr(e,t,n){var r=[];return e.include.forEach(function(i){n=qr(i,t,n)}),e[t].forEach(function(i){n.forEach(function(s,o){s.tag===i.tag&&s.kind===i.kind&&r.push(o)}),n.push(i)}),n.filter(function(i,s){return r.indexOf(s)===-1})}function fy(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,n;function r(i){e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function _t(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new pn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=qr(this,"implicit",[]),this.compiledExplicit=qr(this,"explicit",[]),this.compiledTypeMap=fy(this.compiledImplicit,this.compiledExplicit)}_t.DEFAULT=null;_t.create=function(){var t,n;switch(arguments.length){case 1:t=_t.DEFAULT,n=arguments[0];break;case 2:t=arguments[0],n=arguments[1];break;default:throw new pn("Wrong number of arguments for Schema.create function")}if(t=Wo.toArray(t),n=Wo.toArray(n),!t.every(function(r){return r instanceof _t}))throw new pn("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!n.every(function(r){return r instanceof ly}))throw new pn("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new _t({include:t,explicit:n})};var It=_t,py=ce,dy=new py("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),hy=ce,my=new hy("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),gy=ce,yy=new gy("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),vy=It,Ri=new vy({explicit:[dy,my,yy]}),Ey=ce;function wy(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function by(){return null}function _y(e){return e===null}var xy=new Ey("tag:yaml.org,2002:null",{kind:"scalar",resolve:wy,construct:by,predicate:_y,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"}),Sy=ce;function Ay(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Ty(e){return e==="true"||e==="True"||e==="TRUE"}function Cy(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Ry=new Sy("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Ay,construct:Ty,predicate:Cy,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"}),$y=Ce,Fy=ce;function Iy(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Oy(e){return 48<=e&&e<=55}function Ny(e){return 48<=e&&e<=57}function Py(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Iy(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}for(;n<t;n++)if(i=e[n],i!=="_"){if(!Oy(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(i===":")break;if(!Ny(e.charCodeAt(n)))return!1;r=!0}return!r||i==="_"?!1:i!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(n))}function Ly(e){var t=e,n=1,r,i,s=[];return t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0"?0:r==="0"?t[1]==="b"?n*parseInt(t.slice(2),2):t[1]==="x"?n*parseInt(t,16):n*parseInt(t,8):t.indexOf(":")!==-1?(t.split(":").forEach(function(o){s.unshift(parseInt(o,10))}),t=0,i=1,s.forEach(function(o){t+=o*i,i*=60}),n*t):n*parseInt(t,10)}function Dy(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!$y.isNegativeZero(e)}var ky=new Fy("tag:yaml.org,2002:int",{kind:"scalar",resolve:Py,construct:Ly,predicate:Dy,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ru=Ce,My=ce,jy=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function By(e){return!(e===null||!jy.test(e)||e[e.length-1]==="_")}function Hy(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(s){i.unshift(parseFloat(s,10))}),t=0,r=1,i.forEach(function(s){t+=s*r,r*=60}),n*t):n*parseFloat(t,10)}var Uy=/^[-+]?[0-9]+e/;function Gy(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ru.isNegativeZero(e))return"-0.0";return n=e.toString(10),Uy.test(n)?n.replace("e",".e"):n}function qy(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ru.isNegativeZero(e))}var zy=new My("tag:yaml.org,2002:float",{kind:"scalar",resolve:By,construct:Hy,predicate:qy,represent:Gy,defaultStyle:"lowercase"}),Ky=It,iu=new Ky({include:[Ri],implicit:[xy,Ry,ky,zy]}),Wy=It,ou=new Wy({include:[iu]}),Yy=ce,su=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),au=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 Vy(e){return e===null?!1:su.exec(e)!==null||au.exec(e)!==null}function Qy(e){var t,n,r,i,s,o,a,u=0,f=null,c,l,p;if(t=su.exec(e),t===null&&(t=au.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(s=+t[4],o=+t[5],a=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(c=+t[10],l=+(t[11]||0),f=(c*60+l)*6e4,t[9]==="-"&&(f=-f)),p=new Date(Date.UTC(n,r,i,s,o,a,u)),f&&p.setTime(p.getTime()-f),p}function Xy(e){return e.toISOString()}var Zy=new Yy("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Vy,construct:Qy,instanceOf:Date,represent:Xy}),Jy=ce;function ev(e){return e==="<<"||e===null}var tv=new Jy("tag:yaml.org,2002:merge",{kind:"scalar",resolve:ev});function uu(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var tt;try{var nv=uu;tt=nv("buffer").Buffer}catch{}var rv=ce,$i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
+ \r`;function iv(e){if(e===null)return!1;var t,n,r=0,i=e.length,s=$i;for(n=0;n<i;n++)if(t=s.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function ov(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,s=$i,o=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|s.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),tt?tt.from?tt.from(a):new tt(a):a}function sv(e){var t="",n=0,r,i,s=e.length,o=$i;for(r=0;r<s;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=s%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function av(e){return tt&&tt.isBuffer(e)}var uv=new rv("tag:yaml.org,2002:binary",{kind:"scalar",resolve:iv,construct:ov,predicate:av,represent:sv}),cv=ce,lv=Object.prototype.hasOwnProperty,fv=Object.prototype.toString;function pv(e){if(e===null)return!0;var t=[],n,r,i,s,o,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],o=!1,fv.call(i)!=="[object Object]")return!1;for(s in i)if(lv.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(s)===-1)t.push(s);else return!1}return!0}function dv(e){return e!==null?e:[]}var hv=new cv("tag:yaml.org,2002:omap",{kind:"sequence",resolve:pv,construct:dv}),mv=ce,gv=Object.prototype.toString;function yv(e){if(e===null)return!0;var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],gv.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[t]=[i[0],r[i[0]]]}return!0}function vv(e){if(e===null)return[];var t,n,r,i,s,o=e;for(s=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),s[t]=[i[0],r[i[0]]];return s}var Ev=new mv("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:yv,construct:vv}),wv=ce,bv=Object.prototype.hasOwnProperty;function _v(e){if(e===null)return!0;var t,n=e;for(t in n)if(bv.call(n,t)&&n[t]!==null)return!1;return!0}function xv(e){return e!==null?e:{}}var Sv=new wv("tag:yaml.org,2002:set",{kind:"mapping",resolve:_v,construct:xv}),Av=It,Vt=new Av({include:[ou],implicit:[Zy,tv],explicit:[uv,hv,Ev,Sv]}),Tv=ce;function Cv(){return!0}function Rv(){}function $v(){return""}function Fv(e){return typeof e>"u"}var Iv=new Tv("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:Cv,construct:Rv,predicate:Fv,represent:$v}),Ov=ce;function Nv(e){if(e===null||e.length===0)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";return!(t[0]==="/"&&(n&&(r=n[1]),r.length>3||t[t.length-r.length-1]!=="/"))}function Pv(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return t[0]==="/"&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function Lv(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function Dv(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var kv=new Ov("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:Nv,construct:Pv,predicate:Dv,represent:Lv}),Nn;try{var Mv=uu;Nn=Mv("esprima")}catch{typeof window<"u"&&(Nn=window.esprima)}var jv=ce;function Bv(e){if(e===null)return!1;try{var t="("+e+")",n=Nn.parse(t,{range:!0});return!(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function Hv(e){var t="("+e+")",n=Nn.parse(t,{range:!0}),r=[],i;if(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach(function(s){r.push(s.name)}),i=n.body[0].expression.body.range,n.body[0].expression.body.type==="BlockStatement"?new Function(r,t.slice(i[0]+1,i[1]-1)):new Function(r,"return "+t.slice(i[0],i[1]))}function Uv(e){return e.toString()}function Gv(e){return Object.prototype.toString.call(e)==="[object Function]"}var qv=new jv("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:Bv,construct:Hv,predicate:Gv,represent:Uv}),Yo=It,tr=Yo.DEFAULT=new Yo({include:[Vt],explicit:[Iv,kv,qv]}),Ue=Ce,cu=Yt,zv=oy,lu=Vt,Kv=tr,We=Object.prototype.hasOwnProperty,Pn=1,fu=2,pu=3,Ln=4,Tr=1,Wv=2,Vo=3,Yv=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Vv=/[\x85\u2028\u2029]/,Qv=/[,\[\]\{\}]/,du=/^(?:!|!!|![a-z\-]+!)$/i,hu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Qo(e){return Object.prototype.toString.call(e)}function Me(e){return e===10||e===13}function it(e){return e===9||e===32}function ve(e){return e===9||e===32||e===10||e===13}function xt(e){return e===44||e===91||e===93||e===123||e===125}function Xv(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Zv(e){return e===120?2:e===117?4:e===85?8:0}function Jv(e){return 48<=e&&e<=57?e-48:-1}function Xo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
52
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function e0(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var mu=new Array(256),gu=new Array(256);for(var ht=0;ht<256;ht++)mu[ht]=Xo(ht)?1:0,gu[ht]=Xo(ht);function t0(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Kv,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function yu(e,t){return new cu(t,new zv(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function G(e,t){throw yu(e,t)}function Dn(e,t){e.onWarning&&e.onWarning.call(null,yu(e,t))}var Zo={YAML:function(t,n,r){var i,s,o;t.version!==null&&G(t,"duplication of %YAML directive"),r.length!==1&&G(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&G(t,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&G(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Dn(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,s;r.length!==2&&G(t,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],du.test(i)||G(t,"ill-formed tag handle (first argument) of the TAG directive"),We.call(t.tagMap,i)&&G(t,'there is a previously declared suffix for "'+i+'" tag handle'),hu.test(s)||G(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=s}};function Ke(e,t,n,r){var i,s,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,s=a.length;i<s;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||G(e,"expected valid JSON character");else Yv.test(a)&&G(e,"the stream contains non-printable characters");e.result+=a}}function Jo(e,t,n,r){var i,s,o,a;for(Ue.isObject(n)||G(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)s=i[o],We.call(t,s)||(t[s]=n[s],r[s]=!0)}function St(e,t,n,r,i,s,o,a){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&G(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Qo(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&Qo(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(u=0,f=s.length;u<f;u+=1)Jo(e,t,s[u],n);else Jo(e,t,s,n);else!e.json&&!We.call(n,i)&&We.call(t,i)&&(e.line=o||e.line,e.position=a||e.position,G(e,"duplicated mapping key")),t[i]=s,delete n[i];return t}function Fi(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):G(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function se(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;it(i);)i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Me(i))for(Fi(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Dn(e,"deficient indentation"),r}function nr(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||ve(n)))}function Ii(e,t){t===1?e.result+=" ":t>1&&(e.result+=Ue.repeat(`
53
+ `,t-1))}function n0(e,t,n){var r,i,s,o,a,u,f,c,l=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),ve(d)||xt(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),ve(i)||n&&xt(i)))return!1;for(e.kind="scalar",e.result="",s=o=e.position,a=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),ve(i)||n&&xt(i))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),ve(r))break}else{if(e.position===e.lineStart&&nr(e)||n&&xt(d))break;if(Me(d))if(u=e.line,f=e.lineStart,c=e.lineIndent,se(e,!1,-1),e.lineIndent>=t){a=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=u,e.lineStart=f,e.lineIndent=c;break}}a&&(Ke(e,s,o,!1),Ii(e,e.line-u),s=o=e.position,a=!1),it(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return Ke(e,s,o,!1),e.result?!0:(e.kind=l,e.result=p,!1)}function r0(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Ke(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Me(n)?(Ke(e,r,i,!0),Ii(e,se(e,!1,t)),r=i=e.position):e.position===e.lineStart&&nr(e)?G(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);G(e,"unexpected end of the stream within a single quoted scalar")}function i0(e,t){var n,r,i,s,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Ke(e,n,e.position,!0),e.position++,!0;if(a===92){if(Ke(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),Me(a))se(e,!1,t);else if(a<256&&mu[a])e.result+=gu[a],e.position++;else if((o=Zv(a))>0){for(i=o,s=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=Xv(a))>=0?s=(s<<4)+o:G(e,"expected hexadecimal character");e.result+=e0(s),e.position++}else G(e,"unknown escape sequence");n=r=e.position}else Me(a)?(Ke(e,n,r,!0),Ii(e,se(e,!1,t)),n=r=e.position):e.position===e.lineStart&&nr(e)?G(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}G(e,"unexpected end of the stream within a double quoted scalar")}function o0(e,t){var n=!0,r,i=e.tag,s,o=e.anchor,a,u,f,c,l,p={},d,h,m,g;if(g=e.input.charCodeAt(e.position),g===91)u=93,l=!1,s=[];else if(g===123)u=125,l=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),g=e.input.charCodeAt(++e.position);g!==0;){if(se(e,!0,t),g=e.input.charCodeAt(e.position),g===u)return e.position++,e.tag=i,e.anchor=o,e.kind=l?"mapping":"sequence",e.result=s,!0;n||G(e,"missed comma between flow collection entries"),h=d=m=null,f=c=!1,g===63&&(a=e.input.charCodeAt(e.position+1),ve(a)&&(f=c=!0,e.position++,se(e,!0,t))),r=e.line,Rt(e,t,Pn,!1,!0),h=e.tag,d=e.result,se(e,!0,t),g=e.input.charCodeAt(e.position),(c||e.line===r)&&g===58&&(f=!0,g=e.input.charCodeAt(++e.position),se(e,!0,t),Rt(e,t,Pn,!1,!0),m=e.result),l?St(e,s,p,h,d,m):f?s.push(St(e,null,p,h,d,m)):s.push(d),se(e,!0,t),g=e.input.charCodeAt(e.position),g===44?(n=!0,g=e.input.charCodeAt(++e.position)):n=!1}G(e,"unexpected end of the stream within a flow collection")}function s0(e,t){var n,r,i=Tr,s=!1,o=!1,a=t,u=0,f=!1,c,l;if(l=e.input.charCodeAt(e.position),l===124)r=!1;else if(l===62)r=!0;else return!1;for(e.kind="scalar",e.result="";l!==0;)if(l=e.input.charCodeAt(++e.position),l===43||l===45)Tr===i?i=l===43?Vo:Wv:G(e,"repeat of a chomping mode identifier");else if((c=Jv(l))>=0)c===0?G(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?G(e,"repeat of an indentation width identifier"):(a=t+c-1,o=!0);else break;if(it(l)){do l=e.input.charCodeAt(++e.position);while(it(l));if(l===35)do l=e.input.charCodeAt(++e.position);while(!Me(l)&&l!==0)}for(;l!==0;){for(Fi(e),e.lineIndent=0,l=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),Me(l)){u++;continue}if(e.lineIndent<a){i===Vo?e.result+=Ue.repeat(`
55
54
  `,s?1+u:u):i===Tr&&s&&(e.result+=`
56
- `);break}for(r?rt(f)?(l=!0,e.result+=Be.repeat(`
57
- `,s?1+u:u)):l?(l=!1,e.result+=Be.repeat(`
58
- `,u+1)):u===0?s&&(e.result+=" "):e.result+=Be.repeat(`
59
- `,u):e.result+=Be.repeat(`
60
- `,s?1+u:u),s=!0,o=!0,u=0,n=e.position;!Me(f)&&f!==0;)f=e.input.charCodeAt(++e.position);Ke(e,n,e.position,!1)}return!0}function ns(e,t){var n,r=e.tag,i=e.anchor,s=[],o,a=!1,u;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),u=e.input.charCodeAt(e.position);u!==0&&!(u!==45||(o=e.input.charCodeAt(e.position+1),!ve(o)));){if(a=!0,e.position++,se(e,!0,-1)&&e.lineIndent<=t){s.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,Ct(e,t,du,!1,!0),s.push(e.result),se(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)G(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function a0(e,t,n){var r,i,s,o,a=e.tag,u=e.anchor,l={},c={},f=null,p=null,d=null,h=!1,g=!1,m;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),m=e.input.charCodeAt(e.position);m!==0;){if(r=e.input.charCodeAt(e.position+1),s=e.line,o=e.position,(m===63||m===58)&&ve(r))m===63?(h&&(xt(e,l,c,f,p,null),f=p=d=null),g=!0,h=!0,i=!0):h?(h=!1,i=!0):G(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,m=r;else if(Ct(e,n,pu,!1,!0))if(e.line===s){for(m=e.input.charCodeAt(e.position);rt(m);)m=e.input.charCodeAt(++e.position);if(m===58)m=e.input.charCodeAt(++e.position),ve(m)||G(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(xt(e,l,c,f,p,null),f=p=d=null),g=!0,h=!1,i=!1,f=e.tag,p=e.result;else if(g)G(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=a,e.anchor=u,!0}else if(g)G(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=a,e.anchor=u,!0;else break;if((e.line===s||e.lineIndent>t)&&(Ct(e,t,Ln,!0,i)&&(h?p=e.result:d=e.result),h||(xt(e,l,c,f,p,d,s,o),f=p=d=null),se(e,!0,-1),m=e.input.charCodeAt(e.position)),e.lineIndent>t&&m!==0)G(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return h&&xt(e,l,c,f,p,null),g&&(e.tag=a,e.anchor=u,e.kind="mapping",e.result=l),g}function u0(e){var t,n=!1,r=!1,i,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&G(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):G(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!ve(o);)o===33&&(r?G(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),hu.test(i)||G(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Qv.test(s)&&G(e,"tag suffix cannot contain flow indicator characters")}return s&&!mu.test(s)&&G(e,"tag name cannot contain such characters: "+s),n?e.tag=s:ze.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:G(e,'undeclared tag handle "'+i+'"'),!0}function c0(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&G(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!ve(n)&&!_t(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function l0(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ve(r)&&!_t(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),ze.call(e.anchorMap,n)||G(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],se(e,!0,-1),!0}function Ct(e,t,n,r,i){var s,o,a,u=1,l=!1,c=!1,f,p,d,h,g;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=Ln===n||du===n,r&&se(e,!0,-1)&&(l=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;u0(e)||c0(e);)se(e,!0,-1)?(l=!0,a=s,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):a=!1;if(a&&(a=l||i),(u===1||Ln===n)&&(Pn===n||pu===n?h=t:h=t+1,g=e.position-e.lineStart,u===1?a&&(ns(e,g)||a0(e,g,h))||o0(e,h)?c=!0:(o&&s0(e,h)||r0(e,h)||i0(e,h)?c=!0:l0(e)?(c=!0,(e.tag!==null||e.anchor!==null)&&G(e,"alias node should not have any properties")):n0(e,h,Pn===n)&&(c=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(c=a&&ns(e,g))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&G(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,p=e.implicitTypes.length;f<p;f+=1)if(d=e.implicitTypes[f],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else ze.call(e.typeMap[e.kind||"fallback"],e.tag)?(d=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&d.kind!==e.kind&&G(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result)?(e.result=d.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):G(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):G(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||c}function f0(e){var t=e.position,n,r,i,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(o=e.input.charCodeAt(e.position))!==0&&(se(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(s=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!ve(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&G(e,"directive name must not be less than one character in length");o!==0;){for(;rt(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!Me(o));break}if(Me(o))break;for(n=e.position;o!==0&&!ve(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Oi(e),ze.call(es,r)?es[r](e,r,i):Dn(e,'unknown document directive "'+r+'"')}if(se(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,se(e,!0,-1)):s&&G(e,"directives end mark is expected"),Ct(e,e.lineIndent-1,Ln,!1,!0),se(e,!0,-1),e.checkLineBreaks&&Vv.test(e.input.slice(t,e.position))&&Dn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&nr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,se(e,!0,-1));return}if(e.position<e.length-1)G(e,"end of the stream or a document separator is expected");else return}function Eu(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
61
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new t0(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,G(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)f0(n);return n.documents}function wu(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=Eu(e,n);if(typeof t!="function")return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])}function bu(e,t){var n=Eu(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new lu("expected a single document in the stream, but found more")}}function p0(e,t,n){return typeof t=="object"&&t!==null&&typeof n>"u"&&(n=t,t=null),wu(e,t,Be.extend({schema:fu},n))}function d0(e,t){return bu(e,Be.extend({schema:fu},t))}Wt.loadAll=wu;Wt.load=bu;Wt.safeLoadAll=p0;Wt.safeLoad=d0;var Pi={},Qt=Ce,Xt=Yt,h0=tr,m0=Vt,_u=Object.prototype.toString,xu=Object.prototype.hasOwnProperty,g0=9,Gt=10,y0=13,v0=32,E0=33,w0=34,Au=35,b0=37,_0=38,x0=39,A0=42,Su=44,S0=45,Tu=58,T0=61,C0=62,R0=63,$0=64,Cu=91,Ru=93,F0=96,$u=123,I0=124,Fu=125,de={};de[0]="\\0";de[7]="\\a";de[8]="\\b";de[9]="\\t";de[10]="\\n";de[11]="\\v";de[12]="\\f";de[13]="\\r";de[27]="\\e";de[34]='\\"';de[92]="\\\\";de[133]="\\N";de[160]="\\_";de[8232]="\\L";de[8233]="\\P";var O0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function N0(e,t){var n,r,i,s,o,a,u;if(t===null)return{};for(n={},r=Object.keys(t),i=0,s=r.length;i<s;i+=1)o=r[i],a=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),u=e.compiledTypeMap.fallback[o],u&&xu.call(u.styleAliases,a)&&(a=u.styleAliases[a]),n[o]=a;return n}function rs(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Xt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Qt.repeat("0",r-t.length)+t}function P0(e){this.schema=e.schema||h0,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Qt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=N0(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function is(e,t){for(var n=Qt.repeat(" ",t),r=0,i=-1,s="",o,a=e.length;r<a;)i=e.indexOf(`
55
+ `);break}for(r?it(l)?(f=!0,e.result+=Ue.repeat(`
56
+ `,s?1+u:u)):f?(f=!1,e.result+=Ue.repeat(`
57
+ `,u+1)):u===0?s&&(e.result+=" "):e.result+=Ue.repeat(`
58
+ `,u):e.result+=Ue.repeat(`
59
+ `,s?1+u:u),s=!0,o=!0,u=0,n=e.position;!Me(l)&&l!==0;)l=e.input.charCodeAt(++e.position);Ke(e,n,e.position,!1)}return!0}function es(e,t){var n,r=e.tag,i=e.anchor,s=[],o,a=!1,u;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),u=e.input.charCodeAt(e.position);u!==0&&!(u!==45||(o=e.input.charCodeAt(e.position+1),!ve(o)));){if(a=!0,e.position++,se(e,!0,-1)&&e.lineIndent<=t){s.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,Rt(e,t,pu,!1,!0),s.push(e.result),se(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)G(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=s,!0):!1}function a0(e,t,n){var r,i,s,o,a=e.tag,u=e.anchor,f={},c={},l=null,p=null,d=null,h=!1,m=!1,g;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),g=e.input.charCodeAt(e.position);g!==0;){if(r=e.input.charCodeAt(e.position+1),s=e.line,o=e.position,(g===63||g===58)&&ve(r))g===63?(h&&(St(e,f,c,l,p,null),l=p=d=null),m=!0,h=!0,i=!0):h?(h=!1,i=!0):G(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,g=r;else if(Rt(e,n,fu,!1,!0))if(e.line===s){for(g=e.input.charCodeAt(e.position);it(g);)g=e.input.charCodeAt(++e.position);if(g===58)g=e.input.charCodeAt(++e.position),ve(g)||G(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(St(e,f,c,l,p,null),l=p=d=null),m=!0,h=!1,i=!1,l=e.tag,p=e.result;else if(m)G(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=a,e.anchor=u,!0}else if(m)G(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=a,e.anchor=u,!0;else break;if((e.line===s||e.lineIndent>t)&&(Rt(e,t,Ln,!0,i)&&(h?p=e.result:d=e.result),h||(St(e,f,c,l,p,d,s,o),l=p=d=null),se(e,!0,-1),g=e.input.charCodeAt(e.position)),e.lineIndent>t&&g!==0)G(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return h&&St(e,f,c,l,p,null),m&&(e.tag=a,e.anchor=u,e.kind="mapping",e.result=f),m}function u0(e){var t,n=!1,r=!1,i,s,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&G(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(s=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):G(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!ve(o);)o===33&&(r?G(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),du.test(i)||G(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);s=e.input.slice(t,e.position),Qv.test(s)&&G(e,"tag suffix cannot contain flow indicator characters")}return s&&!hu.test(s)&&G(e,"tag name cannot contain such characters: "+s),n?e.tag=s:We.call(e.tagMap,i)?e.tag=e.tagMap[i]+s:i==="!"?e.tag="!"+s:i==="!!"?e.tag="tag:yaml.org,2002:"+s:G(e,'undeclared tag handle "'+i+'"'),!0}function c0(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&G(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!ve(n)&&!xt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function l0(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!ve(r)&&!xt(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),We.call(e.anchorMap,n)||G(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],se(e,!0,-1),!0}function Rt(e,t,n,r,i){var s,o,a,u=1,f=!1,c=!1,l,p,d,h,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,s=o=a=Ln===n||pu===n,r&&se(e,!0,-1)&&(f=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;u0(e)||c0(e);)se(e,!0,-1)?(f=!0,a=s,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):a=!1;if(a&&(a=f||i),(u===1||Ln===n)&&(Pn===n||fu===n?h=t:h=t+1,m=e.position-e.lineStart,u===1?a&&(es(e,m)||a0(e,m,h))||o0(e,h)?c=!0:(o&&s0(e,h)||r0(e,h)||i0(e,h)?c=!0:l0(e)?(c=!0,(e.tag!==null||e.anchor!==null)&&G(e,"alias node should not have any properties")):n0(e,h,Pn===n)&&(c=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(c=a&&es(e,m))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&G(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),l=0,p=e.implicitTypes.length;l<p;l+=1)if(d=e.implicitTypes[l],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else We.call(e.typeMap[e.kind||"fallback"],e.tag)?(d=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&d.kind!==e.kind&&G(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result)?(e.result=d.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):G(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):G(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||c}function f0(e){var t=e.position,n,r,i,s=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(o=e.input.charCodeAt(e.position))!==0&&(se(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(s=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!ve(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&G(e,"directive name must not be less than one character in length");o!==0;){for(;it(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!Me(o));break}if(Me(o))break;for(n=e.position;o!==0&&!ve(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Fi(e),We.call(Zo,r)?Zo[r](e,r,i):Dn(e,'unknown document directive "'+r+'"')}if(se(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,se(e,!0,-1)):s&&G(e,"directives end mark is expected"),Rt(e,e.lineIndent-1,Ln,!1,!0),se(e,!0,-1),e.checkLineBreaks&&Vv.test(e.input.slice(t,e.position))&&Dn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&nr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,se(e,!0,-1));return}if(e.position<e.length-1)G(e,"end of the stream or a document separator is expected");else return}function vu(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
60
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new t0(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,G(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)f0(n);return n.documents}function Eu(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=vu(e,n);if(typeof t!="function")return r;for(var i=0,s=r.length;i<s;i+=1)t(r[i])}function wu(e,t){var n=vu(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new cu("expected a single document in the stream, but found more")}}function p0(e,t,n){return typeof t=="object"&&t!==null&&typeof n>"u"&&(n=t,t=null),Eu(e,t,Ue.extend({schema:lu},n))}function d0(e,t){return wu(e,Ue.extend({schema:lu},t))}Wt.loadAll=Eu;Wt.load=wu;Wt.safeLoadAll=p0;Wt.safeLoad=d0;var Oi={},Qt=Ce,Xt=Yt,h0=tr,m0=Vt,bu=Object.prototype.toString,_u=Object.prototype.hasOwnProperty,g0=9,Gt=10,y0=13,v0=32,E0=33,w0=34,xu=35,b0=37,_0=38,x0=39,S0=42,Su=44,A0=45,Au=58,T0=61,C0=62,R0=63,$0=64,Tu=91,Cu=93,F0=96,Ru=123,I0=124,$u=125,de={};de[0]="\\0";de[7]="\\a";de[8]="\\b";de[9]="\\t";de[10]="\\n";de[11]="\\v";de[12]="\\f";de[13]="\\r";de[27]="\\e";de[34]='\\"';de[92]="\\\\";de[133]="\\N";de[160]="\\_";de[8232]="\\L";de[8233]="\\P";var O0=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function N0(e,t){var n,r,i,s,o,a,u;if(t===null)return{};for(n={},r=Object.keys(t),i=0,s=r.length;i<s;i+=1)o=r[i],a=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),u=e.compiledTypeMap.fallback[o],u&&_u.call(u.styleAliases,a)&&(a=u.styleAliases[a]),n[o]=a;return n}function ts(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Xt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+Qt.repeat("0",r-t.length)+t}function P0(e){this.schema=e.schema||h0,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Qt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=N0(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function ns(e,t){for(var n=Qt.repeat(" ",t),r=0,i=-1,s="",o,a=e.length;r<a;)i=e.indexOf(`
62
61
  `,r),i===-1?(o=e.slice(r),r=a):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
63
- `&&(s+=n),s+=o;return s}function Kr(e,t){return`
64
- `+Qt.repeat(" ",e.indent*t)}function L0(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Li(e){return e===v0||e===g0}function Rt(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function D0(e){return Rt(e)&&!Li(e)&&e!==65279&&e!==y0&&e!==Gt}function os(e,t){return Rt(e)&&e!==65279&&e!==Su&&e!==Cu&&e!==Ru&&e!==$u&&e!==Fu&&e!==Tu&&(e!==Au||t&&D0(t))}function M0(e){return Rt(e)&&e!==65279&&!Li(e)&&e!==S0&&e!==R0&&e!==Tu&&e!==Su&&e!==Cu&&e!==Ru&&e!==$u&&e!==Fu&&e!==Au&&e!==_0&&e!==A0&&e!==E0&&e!==I0&&e!==T0&&e!==C0&&e!==x0&&e!==w0&&e!==b0&&e!==$0&&e!==F0}function Iu(e){var t=/^\n* /;return t.test(e)}var Ou=1,Nu=2,Pu=3,Lu=4,dn=5;function k0(e,t,n,r,i){var s,o,a,u=!1,l=!1,c=r!==-1,f=-1,p=M0(e.charCodeAt(0))&&!Li(e.charCodeAt(e.length-1));if(t)for(s=0;s<e.length;s++){if(o=e.charCodeAt(s),!Rt(o))return dn;a=s>0?e.charCodeAt(s-1):null,p=p&&os(o,a)}else{for(s=0;s<e.length;s++){if(o=e.charCodeAt(s),o===Gt)u=!0,c&&(l=l||s-f-1>r&&e[f+1]!==" ",f=s);else if(!Rt(o))return dn;a=s>0?e.charCodeAt(s-1):null,p=p&&os(o,a)}l=l||c&&s-f-1>r&&e[f+1]!==" "}return!u&&!l?p&&!i(e)?Ou:Nu:n>9&&Iu(e)?dn:l?Lu:Pu}function j0(e,t,n,r){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&O0.indexOf(t)!==-1)return"'"+t+"'";var i=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),o=r||e.flowLevel>-1&&n>=e.flowLevel;function a(u){return L0(e,u)}switch(k0(t,o,e.indent,s,a)){case Ou:return t;case Nu:return"'"+t.replace(/'/g,"''")+"'";case Pu:return"|"+ss(t,e.indent)+as(is(t,i));case Lu:return">"+ss(t,e.indent)+as(is(H0(t,s),i));case dn:return'"'+B0(t)+'"';default:throw new Xt("impossible error: invalid scalar style")}}()}function ss(e,t){var n=Iu(e)?String(t):"",r=e[e.length-1]===`
62
+ `&&(s+=n),s+=o;return s}function zr(e,t){return`
63
+ `+Qt.repeat(" ",e.indent*t)}function L0(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Ni(e){return e===v0||e===g0}function $t(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function D0(e){return $t(e)&&!Ni(e)&&e!==65279&&e!==y0&&e!==Gt}function rs(e,t){return $t(e)&&e!==65279&&e!==Su&&e!==Tu&&e!==Cu&&e!==Ru&&e!==$u&&e!==Au&&(e!==xu||t&&D0(t))}function k0(e){return $t(e)&&e!==65279&&!Ni(e)&&e!==A0&&e!==R0&&e!==Au&&e!==Su&&e!==Tu&&e!==Cu&&e!==Ru&&e!==$u&&e!==xu&&e!==_0&&e!==S0&&e!==E0&&e!==I0&&e!==T0&&e!==C0&&e!==x0&&e!==w0&&e!==b0&&e!==$0&&e!==F0}function Fu(e){var t=/^\n* /;return t.test(e)}var Iu=1,Ou=2,Nu=3,Pu=4,dn=5;function M0(e,t,n,r,i){var s,o,a,u=!1,f=!1,c=r!==-1,l=-1,p=k0(e.charCodeAt(0))&&!Ni(e.charCodeAt(e.length-1));if(t)for(s=0;s<e.length;s++){if(o=e.charCodeAt(s),!$t(o))return dn;a=s>0?e.charCodeAt(s-1):null,p=p&&rs(o,a)}else{for(s=0;s<e.length;s++){if(o=e.charCodeAt(s),o===Gt)u=!0,c&&(f=f||s-l-1>r&&e[l+1]!==" ",l=s);else if(!$t(o))return dn;a=s>0?e.charCodeAt(s-1):null,p=p&&rs(o,a)}f=f||c&&s-l-1>r&&e[l+1]!==" "}return!u&&!f?p&&!i(e)?Iu:Ou:n>9&&Fu(e)?dn:f?Pu:Nu}function j0(e,t,n,r){e.dump=function(){if(t.length===0)return"''";if(!e.noCompatMode&&O0.indexOf(t)!==-1)return"'"+t+"'";var i=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),o=r||e.flowLevel>-1&&n>=e.flowLevel;function a(u){return L0(e,u)}switch(M0(t,o,e.indent,s,a)){case Iu:return t;case Ou:return"'"+t.replace(/'/g,"''")+"'";case Nu:return"|"+is(t,e.indent)+os(ns(t,i));case Pu:return">"+is(t,e.indent)+os(ns(B0(t,s),i));case dn:return'"'+H0(t)+'"';default:throw new Xt("impossible error: invalid scalar style")}}()}function is(e,t){var n=Fu(e)?String(t):"",r=e[e.length-1]===`
65
64
  `,i=r&&(e[e.length-2]===`
66
65
  `||e===`
67
66
  `),s=i?"+":r?"":"-";return n+s+`
68
- `}function as(e){return e[e.length-1]===`
69
- `?e.slice(0,-1):e}function H0(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var l=e.indexOf(`
70
- `);return l=l!==-1?l:e.length,n.lastIndex=l,us(e.slice(0,l),t)}(),i=e[0]===`
67
+ `}function os(e){return e[e.length-1]===`
68
+ `?e.slice(0,-1):e}function B0(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var f=e.indexOf(`
69
+ `);return f=f!==-1?f:e.length,n.lastIndex=f,ss(e.slice(0,f),t)}(),i=e[0]===`
71
70
  `||e[0]===" ",s,o;o=n.exec(e);){var a=o[1],u=o[2];s=u[0]===" ",r+=a+(!i&&!s&&u!==""?`
72
- `:"")+us(u,t),i=s}return r}function us(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,s,o=0,a=0,u="";r=n.exec(e);)a=r.index,a-i>t&&(s=o>i?o:a,u+=`
71
+ `:"")+ss(u,t),i=s}return r}function ss(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,s,o=0,a=0,u="";r=n.exec(e);)a=r.index,a-i>t&&(s=o>i?o:a,u+=`
73
72
  `+e.slice(i,s),i=s+1),o=a;return u+=`
74
73
  `,e.length-i>t&&o>i?u+=e.slice(i,o)+`
75
- `+e.slice(o+1):u+=e.slice(i),u.slice(1)}function B0(e){for(var t="",n,r,i,s=0;s<e.length;s++){if(n=e.charCodeAt(s),n>=55296&&n<=56319&&(r=e.charCodeAt(s+1),r>=56320&&r<=57343)){t+=rs((n-55296)*1024+r-56320+65536),s++;continue}i=de[n],t+=!i&&Rt(n)?e[s]:i||rs(n)}return t}function U0(e,t,n){var r="",i=e.tag,s,o;for(s=0,o=n.length;s<o;s+=1)st(e,t,n[s],!1,!1)&&(s!==0&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function G0(e,t,n,r){var i="",s=e.tag,o,a;for(o=0,a=n.length;o<a;o+=1)st(e,t+1,n[o],!0,!0)&&((!r||o!==0)&&(i+=Kr(e,t)),e.dump&&Gt===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function q0(e,t,n){var r="",i=e.tag,s=Object.keys(n),o,a,u,l,c;for(o=0,a=s.length;o<a;o+=1)c="",o!==0&&(c+=", "),e.condenseFlow&&(c+='"'),u=s[o],l=n[u],st(e,t,u,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),st(e,t,l,!1,!1)&&(c+=e.dump,r+=c));e.tag=i,e.dump="{"+r+"}"}function K0(e,t,n,r){var i="",s=e.tag,o=Object.keys(n),a,u,l,c,f,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Xt("sortKeys must be a boolean or a function");for(a=0,u=o.length;a<u;a+=1)p="",(!r||a!==0)&&(p+=Kr(e,t)),l=o[a],c=n[l],st(e,t+1,l,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Gt===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,f&&(p+=Kr(e,t)),st(e,t+1,c,!0,f)&&(e.dump&&Gt===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=s,e.dump=i||"{}"}function cs(e,t,n){var r,i,s,o,a,u;for(i=n?e.explicitTypes:e.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(e.tag=n?a.tag:"?",a.represent){if(u=e.styleMap[a.tag]||a.defaultStyle,_u.call(a.represent)==="[object Function]")r=a.represent(t,u);else if(xu.call(a.represent,u))r=a.represent[u](t,u);else throw new Xt("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function st(e,t,n,r,i,s){e.tag=null,e.dump=n,cs(e,n,!1)||cs(e,n,!0);var o=_u.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var a=o==="[object Object]"||o==="[object Array]",u,l;if(a&&(u=e.duplicates.indexOf(n),l=u!==-1),(e.tag!==null&&e.tag!=="?"||l||e.indent!==2&&t>0)&&(i=!1),l&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(a&&l&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),o==="[object Object]")r&&Object.keys(e.dump).length!==0?(K0(e,t,e.dump,i),l&&(e.dump="&ref_"+u+e.dump)):(q0(e,t,e.dump),l&&(e.dump="&ref_"+u+" "+e.dump));else if(o==="[object Array]"){var c=e.noArrayIndent&&t>0?t-1:t;r&&e.dump.length!==0?(G0(e,c,e.dump,i),l&&(e.dump="&ref_"+u+e.dump)):(U0(e,c,e.dump),l&&(e.dump="&ref_"+u+" "+e.dump))}else if(o==="[object String]")e.tag!=="?"&&j0(e,e.dump,t,s);else{if(e.skipInvalid)return!1;throw new Xt("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function z0(e,t){var n=[],r=[],i,s;for(zr(e,n,r),i=0,s=r.length;i<s;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(s)}function zr(e,t,n){var r,i,s;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,s=e.length;i<s;i+=1)zr(e[i],t,n);else for(r=Object.keys(e),i=0,s=r.length;i<s;i+=1)zr(e[r[i]],t,n)}function Du(e,t){t=t||{};var n=new P0(t);return n.noRefs||z0(e,n),st(n,0,e,!0,!0)?n.dump+`
76
- `:""}function W0(e,t){return Du(e,Qt.extend({schema:m0},t))}Pi.dump=Du;Pi.safeDump=W0;var rr=Wt,Mu=Pi;function ir(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}ne.Type=ce;ne.Schema=It;ne.FAILSAFE_SCHEMA=Fi;ne.JSON_SCHEMA=ou;ne.CORE_SCHEMA=su;ne.DEFAULT_SAFE_SCHEMA=Vt;ne.DEFAULT_FULL_SCHEMA=tr;ne.load=rr.load;ne.loadAll=rr.loadAll;ne.safeLoad=rr.safeLoad;ne.safeLoadAll=rr.safeLoadAll;ne.dump=Mu.dump;ne.safeDump=Mu.safeDump;ne.YAMLException=Yt;ne.MINIMAL_SCHEMA=Fi;ne.SAFE_SCHEMA=Vt;ne.DEFAULT_SCHEMA=tr;ne.scan=ir("scan");ne.parse=ir("parse");ne.compose=ir("compose");ne.addConstructor=ir("addConstructor");var Y0=ne,V0=Y0;const ku=nu,Q0=Zg,X0=Jg,Z0=V0,ju=e=>Z0.safeLoad(X0(e));eu.exports=e=>Q0(ku.readFile)(e,"utf8").then(t=>ju(t));eu.exports.sync=e=>ju(ku.readFileSync(e,"utf8"));function J0(e,t){return fe.default.has(process.env,e)?process.env[e]:t}function ht(e){return process.env[e]??""}const eE={int(e,t){return fe.default.has(process.env,e)?parseInt(ht(e),10):t},float(e,t){return fe.default.has(process.env,e)?parseFloat(ht(e)):t},bool(e,t){return fe.default.has(process.env,e)?ht(e)==="true":t},json(e,t){if(!fe.default.has(process.env,e))return t;try{return JSON.parse(ht(e))}catch(n){throw n instanceof Error?new Error(`Invalid json environment variable ${e}: ${n.message}`):n}},array(e,t){if(!fe.default.has(process.env,e))return t;let n=ht(e);return n.startsWith("[")&&n.endsWith("]")&&(n=n.substring(1,n.length-1)),n.split(",").map(r=>fe.default.trim(fe.default.trim(r," "),'"'))},date(e,t){return fe.default.has(process.env,e)?new Date(ht(e)):t},oneOf(e,t,n){if(!t)throw new Error("env.oneOf requires expectedValues");if(n&&!t.includes(n))throw new Error("env.oneOf requires defaultValue to be included in expectedValues");const r=tE(e,n);return t.includes(r)?r:n}},tE=Object.assign(J0,eE),nE="singleType",rE="collectionType",Hu="id",Bu="documentId",iE="publishedAt",oE="createdBy",sE="updatedBy",Wr="createdAt",Yr="updatedAt",$t={ID_ATTRIBUTE:Hu,DOC_ID_ATTRIBUTE:Bu,PUBLISHED_AT_ATTRIBUTE:iE,CREATED_BY_ATTRIBUTE:oE,UPDATED_BY_ATTRIBUTE:sE,CREATED_AT_ATTRIBUTE:Wr,UPDATED_AT_ATTRIBUTE:Yr,SINGLE_TYPE:nE,COLLECTION_TYPE:rE},aE=e=>{const t=[];return S.has(Wr,e.attributes)&&t.push(Wr),S.has(Yr,e.attributes)&&t.push(Yr),t},uE=e=>{if(!e)return[];const t=fe.default.reduce(e.attributes,(n,r,i)=>r.writable===!1?n.concat(i):n,[]);return fe.default.uniq([Hu,Bu,...aE(e),...t])},cE=e=>S.union(strapi?.config?.get("api.responses.privateAttributes",[])??[],S.getOr([],"options.privateAttributes",e)),lE=(e,t)=>e?.attributes?.[t]?.private===!0?!0:cE(e).includes(t),Uu=e=>e&&!["media","component","relation","dynamiczone"].includes(e.type),fE=e=>e?.type==="media",Gu=e=>e?.type==="relation",pE=e=>!!e&&e.type==="dynamiczone",Di=e=>!!e&&Gu(e)&&e.relation?.startsWith?.("morphTo"),yt=async(e,t,n)=>{const{path:r={raw:null,attribute:null},schema:i,getModel:s}=t;let o=t.parent;const a=async(g,m,w)=>{const C={schema:s(w.__type),path:m,getModel:s,parent:o};return yt(g,C,w)},u=g=>async(m,w,_)=>yt(m,{schema:g,path:w,getModel:s,parent:o},_),l=async(g,m,w)=>{const T={schema:s("plugin::upload.file"),path:m,getModel:s,parent:o};return yt(g,T,w)},c=async(g,m,w,_)=>yt(g,{schema:w,path:m,getModel:s,parent:o},_),f=async(g,m,w)=>{const C={schema:s(w.__component),path:m,getModel:s,parent:o};return yt(g,C,w)};if(!S.isObject(n)||S.isNil(i))return n;const p=S.clone(n),d=dE({data:p}),h=Object.keys(p);for(let g=0;g<h.length;g+=1){const m=h[g],w=i.attributes[m],_={...r};_.raw=S.isNil(r.raw)?m:`${r.raw}.${m}`,S.isNil(w)||(_.attribute=S.isNil(r.attribute)?m:`${r.attribute}.${m}`);const C={data:p,schema:i,key:m,value:p[m],attribute:w,path:_,getModel:s,parent:o};await e(C,d);const T=p[m];if(!(S.isNil(T)||S.isNil(w))){if(o={schema:i,key:m,attribute:w,path:_},Gu(w)){const F=w.relation.toLowerCase().startsWith("morph")?a:u(s(w.target));if(S.isArray(T)){const j=new Array(T.length);for(let x=0;x<T.length;x+=1)j[x]=await F(e,_,T[x]);p[m]=j}else p[m]=await F(e,_,T);continue}if(fE(w)){if(S.isArray(T)){const R=new Array(T.length);for(let F=0;F<T.length;F+=1)R[F]=await l(e,_,T[F]);p[m]=R}else p[m]=await l(e,_,T);continue}if(w.type==="component"){const R=s(w.component);if(S.isArray(T)){const F=new Array(T.length);for(let j=0;j<T.length;j+=1)F[j]=await c(e,_,R,T[j]);p[m]=F}else p[m]=await c(e,_,R,T);continue}if(w.type==="dynamiczone"&&S.isArray(T)){const R=new Array(T.length);for(let F=0;F<T.length;F+=1)R[F]=await f(e,_,T[F]);p[m]=R;continue}}}return p},dE=({data:e})=>({remove(t){delete e[t]},set(t,n){e[t]=n}}),Ht=S.curry(yt),ls=e=>({path:S.toPath(e.path),message:e.message,name:e.name}),hE=e=>({errors:S.isEmpty(e.inner)?[ls(e)]:e.inner.map(ls),message:e.message});class Ge extends Error{name;details;message;constructor(t="An application error occured",n={}){super(),this.name="ApplicationError",this.message=t,this.details=n}}class qu extends Ge{constructor(t,n){super(t,n),this.name="ValidationError"}}class mE extends qu{constructor(t,n){super("Validation");const{errors:r,message:i}=hE(t);this.message=n||i,this.details={errors:r}}}class gE extends Ge{constructor(t="Invalid pagination",n){super(t,n),this.name="PaginationError",this.message=t}}class yE extends Ge{constructor(t="Entity not found",n){super(t,n),this.name="NotFoundError",this.message=t}}class Ku extends Ge{constructor(t="Forbidden access",n){super(t,n),this.name="ForbiddenError",this.message=t}}class vE extends Ge{constructor(t="Unauthorized",n){super(t,n),this.name="UnauthorizedError",this.message=t}}class EE extends Ge{constructor(t="Too many requests, please try again later.",n){super(t,n),this.name="RateLimitError",this.message=t,this.details=n||{}}}class wE extends Ge{constructor(t="Entity too large",n){super(t,n),this.name="PayloadTooLargeError",this.message=t}}class bE extends Ku{constructor(t="Policy Failed",n){super(t,n),this.name="PolicyError",this.message=t,this.details=n||{}}}class _E extends Ge{constructor(t="This feature is not implemented yet",n){super(t,n),this.name="NotImplementedError",this.message=t}}const Mt=Object.freeze(Object.defineProperty({__proto__:null,ApplicationError:Ge,ForbiddenError:Ku,HttpError:ap.HttpError,NotFoundError:yE,NotImplementedError:_E,PaginationError:gE,PayloadTooLargeError:wE,PolicyError:bE,RateLimitError:EE,UnauthorizedError:vE,ValidationError:qu,YupValidationError:mE},Symbol.toStringTag,{value:"Module"})),xE=["$and","$or"],AE=["$not","$in","$notIn","$eq","$eqi","$ne","$nei","$gt","$gte","$lt","$lte","$null","$notNull","$between","$startsWith","$endsWith","$startsWithi","$endsWithi","$contains","$notContains","$containsi","$notContainsi","$jsonSupersetOf"],SE=["$not","$in","$notIn","$eq","$ne","$gt","$gte","$lt","$lte","$between"],TE=["$in","$notIn","$between"],Mn={where:AE,cast:SE,group:xE,array:TE},CE=Object.fromEntries(Object.entries(Mn).map(([e,t])=>[e,t.map(n=>n.toLowerCase())])),RE=(e,t)=>e in t,$E=(e,t,n=!1)=>n?CE[e]?.includes(t.toLowerCase())??!1:RE(e,Mn)?Mn[e]?.includes(t)??!1:!1,FE=(e,t=!1)=>Object.keys(Mn).some(n=>$E(n,e,t));function Pe(...e){const[t,...n]=e;return async(...r)=>{let i=await t.apply(t,r);for(let s=0;s<n.length;s+=1)i=await n[s](i);return i}}S.curry(Ep);const Ot=({key:e,attribute:t},{remove:n})=>{t?.type==="password"&&n(e)},Nt=({schema:e,key:t,attribute:n},{remove:r})=>{if(!n)return;(n.private===!0||lE(e,t))&&r(t)},IE={strict:S.isBoolean},fs=["find"],{CREATED_BY_ATTRIBUTE:OE,UPDATED_BY_ATTRIBUTE:NE}=$t,vt=e=>async({data:t,key:n,attribute:r,schema:i},{remove:s,set:o})=>{if(!r||!(r.type==="relation"))return;const u=async()=>{const p=t[n];if("connect"in p||"set"in p||"disconnect"in p){const d={},h=await l(p.connect||[]),g=await l(p.set||[]),m=await l(p.disconnect||[]);if(h.length>0&&(d.connect=h),g.length>0&&(d.set=g),m.length>0&&(d.disconnect=m),"options"in p&&typeof p.options=="object"&&p.options!==null){const w={};Object.keys(p.options).forEach(_=>{const C=IE[_];C&&C(p.options[_])&&(w[_]=p.options[_])}),d.options=w}else d.options={};o(n,d)}else{const d=await l(p);d.length&&o(n,d)}},l=async p=>{const d=[];if(!S.isArray(p))return d;for(const h of p){if(!S.isObject(h)||!("__type"in h))continue;const g=fs.map(w=>`${h.__type}.${w}`);await ps(g,e)&&d.push(h)}return d},c=async()=>{const p=fs.map(h=>`${r.target}.${h}`);await ps(p,e)||s(n)},f=[OE,NE].includes(n);if(Di(r)){await u();return}f&&i.options?.populateCreatorFields||await c()},ps=async(e,t)=>{for(const n of e)try{return await strapi.auth.verify(t,{scope:n}),!0}catch{continue}return!1},Mi=({key:e,attribute:t},{remove:n})=>{Di(t)&&n(e)},ki=({key:e,attribute:t},{remove:n})=>{pE(t)&&n(e)},PE=(e=null)=>({key:t,path:{attribute:n}},{remove:r})=>{if(e===null)return;if(!(S.isArray(e)&&e.every(S.isString)))throw new TypeError(`Expected array of strings for allowedFields but got "${typeof e}"`);if(S.isNil(n))return;const i=LE(n);e.some(o=>i.includes(o)||o.startsWith(`${n}.`))||r(t)},LE=e=>S.toPath(e).reduce((n,r,i,s)=>[...n,s.slice(0,i+1).join(".")],[]),zu=(e=null)=>({key:t,path:{attribute:n}},{remove:r})=>{if(e===null){r(t);return}if(!(S.isArray(e)&&e.every(S.isString)))throw new TypeError(`Expected array of strings for restrictedFields but got "${typeof e}"`);if(e.includes(n)){r(t);return}e.some(s=>n?.toString().startsWith(`${s}.`))&&r(t)},Wu=({schema:e,key:t,value:n},{set:r})=>{if(t===""&&n==="*"){const{attributes:i}=e,s=Object.entries(i).filter(([,o])=>["relation","component","media","dynamiczone"].includes(o.type)).reduce((o,[a])=>({...o,[a]:!0}),{});r("",s)}},DE=Object.freeze(Object.defineProperty({__proto__:null,expandWildcardPopulate:Wu,removeDisallowedFields:PE,removeDynamicZones:ki,removeMorphToRelations:Mi,removePassword:Ot,removePrivate:Nt,removeRestrictedFields:zu,removeRestrictedRelations:vt},Symbol.toStringTag,{value:"Module"})),ME={raw:null,attribute:null},or=()=>{const e={parsers:[],interceptors:[],ignore:[],handlers:{attributes:[],common:[]}},t=async(n,r,i)=>{const{path:s=ME,parent:o,schema:a,getModel:u}=r??{};for(const{predicate:d,handler:h}of e.interceptors)if(d(i))return h(n,r,i,{recurse:t});const l=e.parsers.find(d=>d.predicate(i))?.parser,c=l?.(i);if(!c)return i;let f=c.transform(i);const p=c.keys(f);for(const d of p){const h=a?.attributes?.[d],g={...s};g.raw=S.isNil(s.raw)?d:`${s.raw}.${d}`,S.isNil(h)||(g.attribute=S.isNil(s.attribute)?d:`${s.attribute}.${d}`);const m={key:d,value:c.get(d,f),attribute:h,schema:a,path:g,data:f,getModel:u,parent:o},w={remove(j){f=c.remove(j,f)},set(j,x){f=c.set(j,x,f)},recurse:t};await n(m,S.pick(["remove","set"],w));const _=c.get(d,f),C=()=>({key:d,value:_,attribute:h,schema:a,path:g,data:f,visitor:n,getModel:u,parent:o}),T=C();if(e.ignore.some(j=>j(T)))continue;const F=[...e.handlers.common,...e.handlers.attributes];for await(const j of F){const x=C();await j.predicate(x)&&await j.handler(x,S.pick(["recurse","set"],w))}}return f};return{traverse:t,intercept(n,r){return e.interceptors.push({predicate:n,handler:r}),this},parse(n,r){return e.parsers.push({predicate:n,parser:r}),this},ignore(n){return e.ignore.push(n),this},on(n,r){return e.handlers.common.push({predicate:n,handler:r}),this},onAttribute(n,r){return e.handlers.attributes.push({predicate:n,handler:r}),this},onRelation(n){return this.onAttribute(({attribute:r})=>r?.type==="relation",n)},onMedia(n){return this.onAttribute(({attribute:r})=>r?.type==="media",n)},onComponent(n){return this.onAttribute(({attribute:r})=>r?.type==="component",n)},onDynamicZone(n){return this.onAttribute(({attribute:r})=>r?.type==="dynamiczone",n)}}},kE=e=>S.isObject(e),jE=or().intercept(S.isArray,async(e,t,n,{recurse:r})=>Promise.all(n.map((i,s)=>{const o=t.path?{...t.path,raw:`${t.path.raw}[${s}]`}:t.path;return r(e,{...t,path:o},i)})).then(i=>i.filter(s=>!(S.isObject(s)&&S.isEmpty(s))))).intercept(e=>!S.isObject(e),(e,t,n)=>n).parse(kE,()=>({transform:S.cloneDeep,remove(e,t){return S.omit(e,t)},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({value:e})=>S.isNil(e)).on(({attribute:e})=>S.isNil(e),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:s,attribute:o},{set:a,recurse:u})=>{a(e,await u(t,{schema:i,path:n,getModel:s,parent:{key:e,path:n,schema:i,attribute:o}},r))}).onRelation(async({key:e,attribute:t,visitor:n,path:r,value:i,schema:s,getModel:o},{set:a,recurse:u})=>{if(t.relation.toLowerCase().startsWith("morph"))return;const c={key:e,path:r,schema:s,attribute:t},f=t.target,p=o(f),d=await u(n,{schema:p,path:r,getModel:o,parent:c},i);a(e,d)}).onComponent(async({key:e,attribute:t,visitor:n,path:r,schema:i,value:s,getModel:o},{set:a,recurse:u})=>{const l={key:e,path:r,schema:i,attribute:t},c=o(t.component),f=await u(n,{schema:c,path:r,getModel:o,parent:l},s);a(e,f)}).onMedia(async({key:e,visitor:t,path:n,schema:r,attribute:i,value:s,getModel:o},{set:a,recurse:u})=>{const l={key:e,path:n,schema:r,attribute:i},f=o("plugin::upload.file"),p=await u(t,{schema:f,path:n,getModel:o,parent:l},s);a(e,p)}),Qe=S.curry(jE.traverse),HE={asc:"asc",desc:"desc"},BE=Object.values(HE),UE=e=>BE.includes(e.toLowerCase()),GE=e=>Array.isArray(e)&&e.every(S.isString),qE=e=>Array.isArray(e)&&e.every(S.isObject),KE=e=>S.isString(e)&&e.split(",").length>1,zE=e=>S.isObject(e),WE=or().intercept(KE,async(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(S.trim).map(i=>r(e,t,i))).then(i=>i.filter(s=>!S.isEmpty(s)).join(","))).intercept(GE,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(s=>!S.isEmpty(s)))).intercept(qE,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(s=>!S.isEmpty(s)))).parse(S.isString,()=>{const e=S.pipe(S.split("."),S.map(S.split(":")),S.flatten),t=n=>{if(n.length!==0)return n.reduce((r,i)=>S.isEmpty(i)?r:r===""?i:UE(i)?`${r}:${i}`:`${r}.${i}`,"")};return{transform:S.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[s]=e(i);return s!==n?i:S.isNil(r)?s:`${s}.${r}`},keys(n){const r=S.first(e(n));return r?[r]:[]},get(n,r){const[i,...s]=e(r);return n===i?t(s):void 0}}}).parse(zE,()=>({transform:S.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,getModel:s,schema:o},{set:a,recurse:u})=>{if(n.relation.toLowerCase().startsWith("morph"))return;const c={key:e,path:i,schema:o,attribute:n},f=n.target,p=s(f),d=await u(r,{schema:p,path:i,getModel:s,parent:c},t);a(e,d)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:s,getModel:o},{recurse:a,set:u})=>{const l={key:e,path:t,schema:n,attribute:r},f=o("plugin::upload.file"),p=await a(i,{schema:f,path:t,getModel:o,parent:l},s);u(e,p)}).onComponent(async({key:e,value:t,visitor:n,path:r,schema:i,attribute:s,getModel:o},{recurse:a,set:u})=>{const l={key:e,path:r,schema:i,attribute:s},c=o(s.component),f=await a(n,{schema:c,path:r,getModel:o,parent:l},t);u(e,f)}),Xe=S.curry(WE.traverse),ds=e=>({key:t,attribute:n})=>!n&&e===t,Yu=e=>e==="*",YE=e=>S.isString(e)&&!Yu(e),VE=e=>S.isArray(e)&&e.every(S.isString),hs=e=>S.isObject(e),QE=or().intercept(YE,async(e,t,n,{recurse:r})=>{const i=ZE([n]),s=await r(e,t,i),[o]=XE(s);return o}).intercept(VE,async(e,t,n,{recurse:r})=>(await Promise.all(n.map(s=>r(e,t,s)))).filter(s=>!S.isNil(s))).parse(Yu,()=>({transform:S.identity,get:(e,t)=>t,set:(e,t)=>t,keys:S.constant([""]),remove:S.constant(void 0)})).parse(S.isString,()=>{const e=S.split("."),t=S.join(".");return{transform:S.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[s]=e(i);return s!==n?i:S.isNil(r)||S.isEmpty(r)?s:`${s}.${r}`},keys(n){const r=S.first(e(n));return r?[r]:[]},get(n,r){const[i,...s]=e(r);return n===i?t(s):void 0}}}).parse(hs,()=>({transform:S.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({key:e,attribute:t})=>["sort","filters","fields"].includes(e)&&!t).on(ds("populate"),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:s,attribute:o},{set:a,recurse:u})=>{const c=await u(t,{schema:i,path:n,getModel:s,parent:{key:e,path:n,schema:i,attribute:o}},r);a(e,c)}).on(ds("on"),async({key:e,visitor:t,path:n,value:r,getModel:i,parent:s},{set:o,recurse:a})=>{const u={};if(hs(r)){for(const[l,c]of Object.entries(r)){const f=i(l),p={...n,raw:`${n.raw}[${l}]`};u[l]=await a(t,{schema:f,path:p,getModel:i,parent:s},c)}o(e,u)}}).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,schema:s,getModel:o},{set:a,recurse:u})=>{if(S.isNil(t))return;const l={key:e,path:i,schema:s,attribute:n};if(Di(n)){if(!S.isObject(t)||!("on"in t&&S.isObject(t?.on)))return;const d=await u(r,{schema:s,path:i,getModel:o,parent:l},{on:t?.on});a(e,d);return}const c=n.target,f=o(c),p=await u(r,{schema:f,path:i,getModel:o,parent:l},t);a(e,p)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:s,getModel:o},{recurse:a,set:u})=>{if(S.isNil(s))return;const l={key:e,path:t,schema:n,attribute:r},f=o("plugin::upload.file"),p=await a(i,{schema:f,path:t,getModel:o,parent:l},s);u(e,p)}).onComponent(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:s,getModel:o},{recurse:a,set:u})=>{if(S.isNil(t))return;const l={key:e,path:i,schema:n,attribute:s},c=o(s.component),f=await a(r,{schema:c,path:i,getModel:o,parent:l},t);u(e,f)}).onDynamicZone(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:s,getModel:o},{set:a,recurse:u})=>{if(S.isNil(t)||!S.isObject(t))return;const l={key:e,path:i,schema:n,attribute:s};if("on"in t&&t.on){const c=await u(r,{schema:n,path:i,getModel:o,parent:l},{on:t.on});a(e,c)}}),hn=S.curry(QE.traverse),XE=e=>{const t=[];function n(r,i){for(const[s,o]of Object.entries(r)){const a=i?`${i}.${s}`:s;o===!0?t.push(a):n(o.populate,a)}}return n(e,""),t},ZE=e=>{const t={};function n(r,i){const[s,...o]=i;o.length===0?r[s]=!0:((!r[s]||typeof r[s]=="boolean")&&(r[s]={populate:{}}),n(r[s].populate,o))}return e.forEach(r=>n(t,r.split("."))),t},JE=e=>S.isArray(e)&&e.every(S.isString),ew=or().intercept(JE,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i)))).intercept(e=>S.isString(e)&&e.includes(","),(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(i=>r(e,t,i)))).intercept(e=>S.eq("*",e),S.constant("*")).parse(S.isString,()=>({transform:S.trim,remove(e,t){return t===e?void 0:t},set(e,t,n){return n},keys(e){return[e]},get(e,t){return e===t?t:void 0}})),Cr=S.curry(ew.traverse),{ID_ATTRIBUTE:kn,DOC_ID_ATTRIBUTE:jn}=$t,tw=e=>async t=>{if(!e.schema)throw new Error("Missing schema in sanitizePasswords");return Ht(Ot,e,t)},Vu=async(e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeOutput");return Ht((...n)=>{Ot(...n),Nt(...n)},e,t)},ji=S.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFilters");return Pe(Qe(({key:n,attribute:r},{remove:i})=>{const s=!!r;[kn,jn].includes(n)||!s&&!FE(n)&&i(n)},e),Qe(ki,e),Qe(Mi,e),Qe(Ot,e),Qe(Nt,e),Qe(({key:n,value:r},{remove:i})=>{S.isObject(r)&&S.isEmpty(r)&&i(n)},e))(t)}),Hi=S.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeSort");return Pe(Xe(({key:n,attribute:r},{remove:i})=>{[kn,jn].includes(n)||r||i(n)},e),Xe(ki,e),Xe(Mi,e),Xe(Nt,e),Xe(Ot,e),Xe(({key:n,attribute:r,value:i},{remove:s})=>{[kn,jn].includes(n)||!Uu(r)&&S.isEmpty(i)&&s(n)},e))(t)}),Bi=S.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFields");return Pe(Cr(({key:n,attribute:r},{remove:i})=>{[kn,jn].includes(n)||(S.isNil(r)||!Uu(r))&&i(n)},e),Cr(Nt,e),Cr(Ot,e),n=>S.isArray(n)?n.filter(r=>!S.isNil(r)):n)(t)}),Ui=S.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizePopulate");return Pe(hn(Wu,e),hn(async({key:n,value:r,schema:i,attribute:s,getModel:o,path:a},{set:u})=>{if(s)return;const l={key:n,path:a,schema:i,attribute:s};n==="sort"&&u(n,await Hi({schema:i,getModel:o,parent:l},r)),n==="filters"&&u(n,await ji({schema:i,getModel:o,parent:l},r)),n==="fields"&&u(n,await Bi({schema:i,getModel:o,parent:l},r)),n==="populate"&&u(n,await Ui({schema:i,getModel:o,parent:l},r))},e),hn(Nt,e))(t)}),nw=Object.freeze(Object.defineProperty({__proto__:null,defaultSanitizeFields:Bi,defaultSanitizeFilters:ji,defaultSanitizeOutput:Vu,defaultSanitizePopulate:Ui,defaultSanitizeSort:Hi,sanitizePasswords:tw},Symbol.toStringTag,{value:"Module"})),rw=e=>{const{getModel:t}=e,n=(l,c,{auth:f}={})=>{if(!c)throw new Error("Missing schema in sanitizeInput");if(S.isArray(l))return Promise.all(l.map(h=>n(h,c,{auth:f})));const p=uE(c),d=[S.omit($t.ID_ATTRIBUTE),S.omit($t.DOC_ID_ATTRIBUTE),Ht(zu(p),{schema:c,getModel:t})];return f&&d.push(Ht(vt(f),{schema:c,getModel:t})),e?.sanitizers?.input?.forEach(h=>d.push(h(c))),Pe(...d)(l)},r=async(l,c,{auth:f}={})=>{if(!c)throw new Error("Missing schema in sanitizeOutput");if(S.isArray(l)){const d=new Array(l.length);for(let h=0;h<l.length;h+=1)d[h]=await r(l[h],c,{auth:f});return d}const p=[d=>Vu({schema:c,getModel:t},d)];return f&&p.push(Ht(vt(f),{schema:c,getModel:t})),e?.sanitizers?.output?.forEach(d=>p.push(d(c))),Pe(...p)(l)},i=async(l,c,{auth:f}={})=>{if(!c)throw new Error("Missing schema in sanitizeQuery");const{filters:p,sort:d,fields:h,populate:g}=l,m=S.cloneDeep(l);return p&&Object.assign(m,{filters:await s(p,c,{auth:f})}),d&&Object.assign(m,{sort:await o(d,c,{auth:f})}),h&&Object.assign(m,{fields:await a(h,c)}),g&&Object.assign(m,{populate:await u(g,c)}),m},s=(l,c,{auth:f}={})=>{if(!c)throw new Error("Missing schema in sanitizeFilters");if(S.isArray(l))return Promise.all(l.map(d=>s(d,c,{auth:f})));const p=[ji({schema:c,getModel:t})];return f&&p.push(Qe(vt(f),{schema:c,getModel:t})),Pe(...p)(l)},o=(l,c,{auth:f}={})=>{if(!c)throw new Error("Missing schema in sanitizeSort");const p=[Hi({schema:c,getModel:t})];return f&&p.push(Xe(vt(f),{schema:c,getModel:t})),Pe(...p)(l)},a=(l,c)=>{if(!c)throw new Error("Missing schema in sanitizeFields");const f=[Bi({schema:c,getModel:t})];return Pe(...f)(l)},u=(l,c,{auth:f}={})=>{if(!c)throw new Error("Missing schema in sanitizePopulate");const p=[Ui({schema:c,getModel:t})];return f&&p.push(hn(vt(f),{schema:c,getModel:t})),Pe(...p)(l)};return{input:n,output:r,query:i,filters:s,sort:o,fields:a,populate:u}},iw=Object.freeze(Object.defineProperty({__proto__:null,createAPISanitizers:rw,sanitizers:nw,visitors:DE},Symbol.toStringTag,{value:"Module"}));$t.DOC_ID_ATTRIBUTE,$t.DOC_ID_ATTRIBUTE;const ow=e=>/^[a-z][a-zA-Z0-9]+$/.test(e),sw=e=>/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.test(e),{toString:aw}=Object.prototype,uw=Error.prototype.toString,cw=RegExp.prototype.toString,lw=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",fw=/^Symbol\((.*)\)(.*)$/;function pw(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":`${e}`}function ms(e,t=!1){if(e==null||e===!0||e===!1)return`${e}`;if(typeof e=="number")return pw(e);if(typeof e=="string")return t?`"${e}"`:e;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(typeof e=="symbol")return lw.call(e).replace(fw,"Symbol($1)");const n=aw.call(e).slice(8,-1);if(n==="Date"){const r=e;return Number.isNaN(r.getTime())?`${r}`:r.toISOString()}return n==="Error"||e instanceof Error?`[${uw.call(e)}]`:n==="RegExp"?cw.call(e):null}function gs(e,t){const n=ms(e,t);return n!==null?n:JSON.stringify(e,function(i,s){const o=ms(this[i],t);return o!==null?o:s},2)}const dw=e=>!fe.default.isNil(e),hw=e=>!fe.default.isNull(e);ct(qn,"notNil",function(t="${path} must be defined."){return this.test("defined",t,dw)});ct(qn,"notNull",function(t="${path} cannot be null."){return this.test("defined",t,hw)});ct(qn,"isFunction",function(t="${path} is not a function"){return this.test("is a function",t,n=>fe.default.isUndefined(n)||fe.default.isFunction(n))});ct(ei,"isCamelCase",function(t="${path} is not in camel case (anExampleOfCamelCase)"){return this.test("is in camelCase",t,n=>n?ow(n):!0)});ct(ei,"isKebabCase",function(t="${path} is not in kebab case (an-example-of-kebab-case)"){return this.test("is in kebab-case",t,n=>n?sw(n):!0)});ct(qs,"onlyContainsFunctions",function(t="${path} contains values that are not functions"){return this.test("only contains functions",t,n=>fe.default.isUndefined(n)||n&&Object.values(n).every(fe.default.isFunction))});ct(Ks,"uniqueProperty",function(t,n){return this.test("unique",n,function(i){const s=[];if(i?.forEach((o,a)=>{i.filter(l=>S.get(t,l)===S.get(t,o)).length>1&&s.push(this.createError({path:`${this.path}[${a}].${t}`,message:n}))}),s.length)throw new Te(s);return!0})});Kf({mixed:{notType(e){const{path:t,type:n,value:r,originalValue:i}=e,s=i!=null&&i!==r;return`${t} must be a \`${n}\` type, but the final value was: \`${gs(r,!0)}\`${s?` (cast from the value \`${gs(i,!0)}\`).`:"."}`}}});const sn=(e,t,n)=>{e&&e.emit&&e.emit(t,n)},mw=e=>[...new Set(e.filter(t=>!!t).flatMap(({remove:t,create:n,update:r})=>[n?"CREATE":"",r?"UPDATE":"",t?"REMOVE":""].filter(i=>!!i)))].join("_"),Qu=e=>async t=>({title:t.title,path:t.path,audience:t.audience,type:t.type,uiRouterKey:t.uiRouterKey,order:t.order,collapsed:t.collapsed,menuAttached:t.menuAttached,removed:!1,updated:!0,externalPath:t.externalPath,items:t.items?await Promise.all(t.items.map(Qu(e))):[],master:e.master,parent:void 0,related:t.related,additionalFields:t.additionalFields}),gw=(e,t)=>t.slice(1).reduce((n,r)=>n.concat([e,r]),t.slice(0,1)),yw=async({strapi:e})=>{const n=!!e.plugin("rest-cache"),r=e.store({type:"plugin",name:"navigation"}),i=Le.parse(await r.get({key:"config"}));return n?{hasCachePlugin:n,enabled:!!i.isCacheEnabled}:{hasCachePlugin:n,enabled:!1}},vw=e=>({async config({viaSettingsPage:t=!1}){const n=oe(e,"common"),r=await yw(e),s=await(await n.getPluginStore()).get({key:"config"}).then(Le.parse),{additionalFields:o,cascadeMenuAttached:a,contentTypesPopulate:u,contentTypesNameFields:l,pathDefaultFields:c,allowedLevels:f,preferCustomContentTypes:p}=s,d=!!strapi.plugin("graphql");let h={allowedContentTypes:As,restrictedContentTypes:Ss,availableAudience:[]};const g=await this.configContentTypes({}),m={contentTypes:await this.configContentTypes({viaSettingsPage:t}),contentTypesNameFields:{default:Vc,...B.isObject(l)?l:{}},contentTypesPopulate:B.isObject(u)?u:{},pathDefaultFields:B.isObject(c)?c:{},allowedLevels:f,additionalFields:t?o:o.filter(w=>typeof w=="string"||!!w.enabled),gql:{navigationItemRelated:g.map(({labelSingular:w})=>w.replace(/\s+/g,""))},isGQLPluginEnabled:t?d:void 0,cascadeMenuAttached:a,preferCustomContentTypes:p};if(o.includes("audience")){const w=await rl(e).find({},Number.MAX_SAFE_INTEGER);h={...h,availableAudience:w}}return{...m,...h,isCacheEnabled:r.enabled,isCachePluginEnabled:r.hasCachePlugin}},async configContentTypes({viaSettingsPage:t=!1}){const i=await(await oe(e,"common").getPluginStore()).get({key:"config"}).then(Le.parse);return(await Promise.all(i.contentTypes.filter(o=>!!e.strapi.contentTypes[o]&&el(o)).map(async o=>{const a=Rr.parse(strapi.contentTypes[o]),{kind:u,options:l,uid:c}=a,f=l?.draftAndPublish,p=u===Wi.SINGLE,d=p&&f,h=g=>({key:o,available:g});if(p){const g=yn(e,c);if(d){const w=d?await g.count({},"published"):!0;return h(w!==0)}return await g.count({})!==0?h(!0):t?h(!1):void 0}return h(!0)}))).reduce((o,a)=>{if(!a?.key)return o;const{key:u,available:l}=a,c=Rr.parse(e.strapi.contentTypes[u]),f=(c.associations||[]).find(({model:D})=>D==="navigationitem"),{uid:p,options:d,info:h,collectionName:g,modelName:m,apiName:w,plugin:_,kind:C,pluginOptions:T={}}=c,R=l&&!d?.hidden;if(!R)return o;const{visible:F=!0}=T["content-manager"]||{},{name:j="",description:x=""}=h,A=B.find(B.get(e.strapi.api,`[${m}].config.routes`,[]),D=>D.handler.includes(".find")),N=A&&A.path.split("/")[1],v=N&&N!==w?N:w||m,k=C===Wi.SINGLE,H=k?v:Ki.default(v),K=Vi(m),E=typeof p=="string"?B.last(p.split(".")).split("-"):[],b=E.length>1?E.reduce((D,U)=>`${D}${B.upperFirst(U)}`,""):B.upperFirst(m),$=j||B.upperFirst(E.length>1?E.join(" "):K);return o.push({uid:p,name:K,draftAndPublish:d?.draftAndPublish,isSingle:k,description:x,collectionName:g,contentTypeName:b,label:k?$:Ki.default(j||$),relatedField:f?f.alias:void 0,labelSingular:Vi($),endpoint:H,plugin:_,available:R,visible:F,templateName:d?.templateName}),o},[])},async get({ids:t,locale:n}){let r={};t&&t.length&&(r.id={$in:t});const i=await Oe(e).find({filters:r,locale:n||"*",limit:Number.MAX_SAFE_INTEGER,populate:["items","items.parent","items.audience","items.related"]}),s=({allItems:o,item:a,parent:u})=>{const l=o.filter(c=>c.parent?.documentId===a.documentId);return{...a,parent:u,items:l.map(c=>s({parent:a,item:c,allItems:o})).sort((c,f)=>c.order-f.order)}};return i.map(o=>({...o,items:o.items?.filter(a=>!a.parent).map(a=>s({allItems:o.items??[],item:a})).sort((a,u)=>a.order-u.order)}))},async getById({documentId:t,locale:n,populate:r=[]}){const i=oe(e,"common"),{defaultLocale:s}=await i.readLocale(),o={documentId:t},a=await Oe(e).findOne({filters:o,locale:n||s}),u=await Ne(e).find({filters:{master:a.id},locale:n||s,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["parent","audience",...r]});return{...a,items:i.buildNestedStructure({navigationItems:u}).filter(({parent:l})=>!l)}},async post({auditLog:t,payload:n}){const{masterModel:r}=be(e),i=oe(e,"common"),{defaultLocale:s,restLocale:o}=await i.readLocale(),a=Oe(e),u=[],{name:l,visible:c}=n,f=await i.getSlug({query:l}),p=await a.save({name:l,visible:c,locale:s,slug:f});u.push(await this.getById({documentId:p.documentId}));for(const d of o){const h=await a.save({name:l,visible:c,locale:d,slug:f,documentId:p.documentId});u.push(await this.getById({documentId:h.documentId}))}return u.map(d=>{sn(t,"onChangeNavigation",{actionType:"CREATE",oldEntity:d,newEntity:d})}),await i.emitEvent({entity:p,event:"entry.create",uid:r.uid}),{...p,items:[]}},async put({auditLog:t,payload:n}){const{masterModel:r}=be(e),i=oe(e,"common"),{defaultLocale:s,restLocale:o}=await i.readLocale(),a=Oe(e),{name:u,visible:l,items:c}=n,f=await a.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),p=await this.getById({documentId:n.documentId,locale:n.locale});if(f.name!==u||f.visible!==l){const g=u?await i.getSlug({query:u}):f.slug,m=await Promise.all([s,...o].map(w=>a.findOne({filters:{documentId:f.documentId},locale:w})));for(const w of m)await a.save({documentId:w.documentId,id:w.id,slug:g,locale:w.locale,name:u,visible:l})}const h=await i.analyzeBranch({navigationItems:c??[],masterEntity:f,prevAction:{}}).then(mw).then(async g=>{const m=await this.getById({documentId:f.documentId});return sn(t,"onChangeNavigation",{actionType:g,oldEntity:p,newEntity:m}),m});return await i.emitEvent({entity:await a.findOne({filters:{documentId:n.documentId},populate:"*"}),event:"entry.update",uid:r.uid}),h},async delete({auditLog:t,documentId:n}){const r=Oe(e),i=Ne(e),s=await this.getById({documentId:n}),o=async l=>{l.length<1||await i.removeForIds(await i.findForMasterIds(l).then(c=>c.reduce((f,{documentId:p})=>(p&&f.push(p),f),[])))},a=await r.findOne({filters:{documentId:n},populate:"*"}),u=await r.find({filters:{documentId:a.documentId},populate:"*"});await o(u.map(({id:l})=>l)),await r.remove({documentId:a.documentId}),sn(t,"onNavigationDeletion",{entity:s,actionType:"DELETE"})},async restart(){e.strapi.reload.isWatching=!1,setImmediate(()=>e.strapi.reload())},async restoreConfig(){const t=oe(e,"common");await(await t.getPluginStore()).delete({key:"config"}),await t.setDefaultConfig()},async updateConfig({config:t}){const n=oe(e,"common"),r=await n.getPluginStore(),i=await r.get({key:"config"}).then(Le.parse);Ts(t.additionalFields),await r.set({key:"config",value:t});const s=B.differenceBy(i.additionalFields,t.additionalFields,"name").reduce((o,a)=>(typeof a=="string"||o.push(a),o),[]);B.isEmpty(s)||await n.pruneCustomFields({removedFields:s})},async fillFromOtherLocale({auditLog:t,source:n,target:r,documentId:i}){const s=await this.getById({documentId:i,locale:r});return await this.i18nNavigationContentsCopy({source:await this.getById({documentId:i,locale:n,populate:["related"]}),target:s}).then(()=>this.getById({documentId:i,locale:r,populate:["related"]})).then(o=>(sn(t,"onChangeNavigation",{actionType:"UPDATE",oldEntity:s,newEntity:o}),o))},async i18nNavigationContentsCopy({source:t,target:n}){const r=oe(e,"common"),i=t.items??[],s=Oe(e);if(n.items?.length)throw new sr("Current navigation is non-empty");if(!n.locale)throw new sr("Current navigation does not have specified locale");if(!i.length)throw new sr("Source navigation is empty");const o=new Map,a=Qu({master:n,locale:n.locale,strapi,entities:o});await r.createBranch({action:{create:!0},masterEntity:await s.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),navigationItems:await Promise.all(i.map(a)),parentItem:void 0})},async readNavigationItemFromLocale({path:t,source:n,target:r}){const i=await this.getById({documentId:n}),s=await this.getById({documentId:r});if(!i)throw new Mt.NotFoundError("Unable to find source navigation for specified query");if(!s)throw new Mt.NotFoundError("Unable to find target navigation for specified query");const o=["path","related","type","uiRouterKey","title","externalPath"],a=t.split(".").map(l=>parseInt(l,10));(!a.some(Number.isNaN)||!a.length)&&new ol("Path is invalid");let u=B.get(i.items,gw("items",a.map(B.toString)));if(!u)throw new Mt.NotFoundError("Unable to find navigation item");return Uc.parse(B.pick(u,o))},async getContentTypeItems({query:t,uid:n}){const s=await(await oe(e,"common").getPluginStore()).get({key:"config"}).then(Le.parse),o={publishedAt:{$notNull:!0}},a=B.get(e.strapi.contentTypes,n),{draftAndPublish:u}=a.options,{localized:l=!1}=a?.pluginOptions?.i18n||{};l&&t.locale&&(o.locale=t.locale);const c=yn(e,n);try{return await c.findMany(o,s.contentTypesPopulate[n]||[],u?"published":void 0)}catch(f){return console.error(f),[]}},async purgeNavigationCache(t,n){const r=Oe(e),i=await r.findOne({filters:{documentId:t}});if(!i)throw new Mt.NotFoundError("Navigation is not defined");const s=l=>new RegExp(`/api/navigation/render/${l}`);let o=[s(i.documentId)];n&&(o=(await r.find({filters:{documentId:i.documentId}})).map(({documentId:c})=>s(c)));const u=strapi.plugin("rest-cache").service("cacheStore");return o.push(s(t)),await u.clearByRegexp(o),{success:!0}},async purgeNavigationsCache(){const n=strapi.plugin("rest-cache").service("cacheStore"),r=new RegExp("/api/navigation/render(.*)");return await n.clearByRegexp([r]),{success:!0}}}),ys=(e,t={},n=[])=>{const{title:r,related:i}=e,s=B.isArray(i)?B.last(i):i;if(r)return B.isString(r)&&!B.isEmpty(r)?r:void 0;if(s){const o=Ew(s,t,n);return B.isString(o)&&!B.isEmpty(o)?o:void 0}},Ew=(e,t={},n=[])=>{const{__contentType:r}=e,i=B.find(n,o=>o.contentTypeName===r),{default:s=[]}=t;return B.get(t,`${i?i.collectionName:""}`,s).map(o=>e[o]).filter(o=>o)[0]||""},vs=(e,t)=>{const n=Xu(e),r=t?n.filter(({path:s})=>s.includes(t)):n,i=r.find(({path:s})=>s===t);return{root:i,items:B.isNil(i)?[]:e.filter(({documentId:s})=>r.find(o=>o.documentId===s))}},Xu=(e,t,n=null)=>e.filter(r=>!r.parent==null&&!t?!0:r.parent?.documentId===t).reduce((r,i)=>{const s=`${n||""}/${i.path}`.replace("//","/");return[{documentId:i.documentId,parent:n&&i.parent?.documentId?{id:i.parent?.id,documentId:i.parent?.documentId,path:n}:void 0,path:s},...Xu(e,i.documentId,s),...r]},[]),ww=(e,t)=>{const n=B.zipWith(e,t,(r,i)=>B.isNil(r)?-1:B.isNil(i)?1:r-i);return B.find(n,r=>r!==0)||0},bw=e=>({async readAll({locale:t,orderBy:n="createdAt",orderDirection:r="DESC"}){return Oe(e).find({locale:t,orderBy:{[n]:r}})},renderRFRNavigationItem({item:t}){const{uiRouterKey:n,title:r,path:i,type:s,audience:o,additionalFields:a}=t,u={label:r,type:s,audience:o?.map(({key:l})=>l),additionalFields:a};if(s==="WRAPPER")return{...u};if(s==="EXTERNAL")return Cs(i,new At("External navigation item's path is undefined",t)),{...u,url:i};if(s==="INTERNAL")return{...u,page:n};if(s==="WRAPPER")return{...u};throw new At("Unknown item type",t)},renderRFRPage({item:t,parent:n,enabledCustomFieldsNames:r}){const{documentId:i,uiRouterKey:s,title:o,path:a,related:u,type:l,audience:c,menuAttached:f,additionalFields:p}=t,d=r.reduce((h,g)=>({...h,[g]:p?.[g]}),{});return{id:s,documentId:i,title:o,related:l==="INTERNAL"&&u?.documentId&&u?.__type?{contentType:u.__type,documentId:u.documentId}:void 0,path:a,parent:n,audience:c,menuAttached:f,additionalFields:d}},renderRFR({items:t,parent:n,parentNavItem:r,contentTypes:i=[],enabledCustomFieldsNames:s}){const o=[];let a={},u={};return t.forEach(l=>{const{items:c,...f}=l,p=this.renderRFRNavigationItem({item:f}),d=this.renderRFRPage({item:f,parent:n,enabledCustomFieldsNames:s});if(l.type!=="EXTERNAL"&&(u={...u,[d.documentId]:{...d}}),l.menuAttached&&o.push(p),!n)a={...a,root:o};else{const h=o.filter(g=>g.type!=="EXTERNAL");B.isEmpty(h)||(a={...a,[n]:h.concat(r||[])})}if(!B.isEmpty(c)){const{nav:h}=this.renderRFR({items:c??[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:s}),{pages:g}=this.renderRFR({items:c?.filter(m=>m.type!=="EXTERNAL")||[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:s});u={...u,...g},a={...a,...h}}}),{pages:u,nav:a}},renderTree({items:t=[],documentId:n,path:r="",itemParser:i=s=>Promise.resolve(s)}){return Promise.all(t.reduce((s,o)=>(o.parent?.documentId===n&&s.push(i(B.cloneDeep(o),r)),s),[])).then(s=>s.sort((o,a)=>o.order!==void 0&&a.order!==void 0?o.order-a.order:0))},getCustomFields(t){return t.reduce((n,r)=>(r!=="audience"&&n.push(r),n),[])},async renderType({criteria:t={},filter:n,itemCriteria:r={},locale:i,populate:s,rootPath:o,type:a="FLAT",wrapRelated:u}){const l=oe(e,"admin"),c=oe(e,"common"),f={...t,visible:!0},p=Oe(e),d=Ne(e);let h;if(i?h=await p.find({filters:{...f},locale:i,limit:1}):h=await p.find({filters:f,limit:1}),B.isArray(h)&&(h=B.first(h)),h&&h.documentId){const g=await d.find({filters:{master:B.pick(h,["slug","id"]),...r},locale:i,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["audience","parent","related"]}),m=await c.mapToNavigationItemDTO({locale:i,master:h,navigationItems:g,populate:s}),{contentTypes:w,contentTypesNameFields:_,additionalFields:C}=await l.config({viaSettingsPage:!1}),T=this.getCustomFields(C).reduce((A,N)=>N.enabled?[...A,N.name]:A,[]),R=A=>u&&A?{documentId:A.documentId,...A}:A,F=["name","url","mime","width","height","previewUrl"],j=C.filter(A=>typeof A!="string"),x=A=>(N,v)=>{const k=j.find(({name:K})=>K===v);let H=A.additionalFields?.[v];if(H)switch(k?.type){case"media":H=B.pick(JSON.parse(H),F);break;case"boolean":H=H==="true";break}return{...N,[v]:H}};switch(a){case"TREE":case"RFR":const A=async($,D="")=>{const U=$.type==="EXTERNAL",z=U?void 0:`${D==="/"?"":D}/${B.first($.path)==="/"?$.path.substring(1):$.path}`,V=typeof z=="string"?await c.getSlug({query:(B.first(z)==="/"?z.substring(1):z).replace(/\//g,"-")}):void 0,J=B.isArray($.related)?B.last($.related):$.related,Ae=R(J),I=T.reduce(x($),{});return{id:$.id,documentId:$.documentId,title:ys($,_,w)??"Title missing",menuAttached:$.menuAttached,order:$.order,path:(U?$.externalPath:z)??"Path is missing",type:$.type,uiRouterKey:$.uiRouterKey,slug:!V&&$.uiRouterKey?await c.getSlug({query:$.uiRouterKey}):V,related:U||!J?void 0:{...Ae},audience:B.isEmpty($.audience)?void 0:$.audience,items:U?[]:await this.renderTree({itemParser:A,path:z,documentId:$.documentId,items:m}),collapsed:$.collapsed,additionalFields:I||{}}},{items:N,root:v}=vs(m,o),k=await this.renderTree({itemParser:A,items:B.isNil(o)?m:N,path:v?.parent?.path,documentId:v?.parent?.documentId}),H=n?k.filter($=>$.uiRouterKey===n):k;return a==="RFR"?this.renderRFR({items:H,contentTypes:w.map($=>$.contentTypeName),enabledCustomFieldsNames:T}):H;default:const K=B.isNil(o)?m:vs(m,o).items,E=new Map,b=($,D=E)=>{const U=D.get($);if(!B.isNil(U))return U;const z=K.find(I=>I.documentId===$);if(B.isNil(z))return[];const{order:V,parent:J}=z,Ae=J?b(J.documentId,D).concat(V):[V];return D.set($,Ae),Ae};return K.map($=>{const D=T.reduce(x($),{});return{...$,audience:$.audience?.map(U=>U.key),title:ys($,_,w)||"",related:R($.related),items:null,additionalFields:D}}).sort(($,D)=>ww(b($.documentId),b(D.documentId)))}}throw new Mt.NotFoundError},renderChildren({childUIKey:t,idOrSlug:n,locale:r,menuOnly:i,type:s="FLAT",wrapRelated:o}){const a={$or:[{documentId:n},{slug:n}]},u=s==="FLAT"?void 0:t,l={...i&&{menuAttached:!0},...s==="FLAT"?{uiRouterKey:t}:{}};return this.renderType({type:s,criteria:a,itemCriteria:l,filter:u,wrapRelated:o,locale:r})},render({idOrSlug:t,locale:n,menuOnly:r,populate:i,rootPath:s,type:o="FLAT",wrapRelated:a}){const u={$or:[{documentId:t},{slug:t}]},l=r?{menuAttached:!0}:{};return this.renderType({type:o,criteria:u,itemCriteria:l,rootPath:s,wrapRelated:a,locale:n,populate:i})}}),_w=({checkData:e,parentItem:t})=>new Promise((n,r)=>{if(t&&t.items){for(let i of e)for(let s of t.items)if(s.path===i.path&&s.id!==i.id&&i.type==="INTERNAL")return r(new At(`Duplicate path:${i.path} in parent: ${t.title||"root"} for ${i.title} and ${s.title} items`,{parentTitle:t.title,parentId:t.id,path:i.path,errorTitles:[i.title,s.title]}))}return n()}),an={navigation:{},"navigation-item":{}},xw=e=>({async getPluginStore(){return await strapi.store({type:"plugin",name:"navigation"})},async mapToNavigationItemDTO({locale:t,master:n,navigationItems:r,parent:i,populate:s}){const o=[],u=await(await this.getPluginStore()).get({key:"config"}).then(Le.parse),l=await Promise.all(r.map(async c=>{if(!c.related?.__type||!c.related.documentId)return c;const f=u.contentTypesPopulate[c.related.__type];if(!f?.length)return c;const d=await yn({strapi},c.related.__type).findById(c.related.documentId,f,"published",{locale:t});return{...c,related:{...d,__type:c.related.__type,documentId:c.related.documentId}}}));for(const c of l){const{items:f=[],...p}=c;o.push({...p,parent:i??p.parent,items:await this.mapToNavigationItemDTO({navigationItems:f,populate:s,master:n,parent:p,locale:t})})}return o},setDefaultConfig(){return $s({strapi})},getBranchName({item:t}){const n=!!t.documentId,r=t.removed;if(n&&!r)return"toUpdate";if(n&&r)return"toRemove";if(!n&&!r)return"toCreate"},async analyzeBranch({masterEntity:t,navigationItems:n=[],parentItem:r,prevAction:i={}}){const{toCreate:s,toRemove:o,toUpdate:a}=n.reduce((c,f)=>{const p=this.getBranchName({item:f});return p?{...c,[p]:[...c[p],f]}:c},{toRemove:[],toCreate:[],toUpdate:[]}),u={create:i.create||s.length>0,update:i.update||a.length>0,remove:i.remove||o.length>0},l=[...s,...a];return await _w({checkData:l,parentItem:r}),Promise.all([this.createBranch({action:u,masterEntity:t,navigationItems:s,parentItem:r}),this.removeBranch({navigationItems:o,action:u}),this.updateBranch({action:u,masterEntity:t,navigationItems:a,parentItem:r})]).then(([c,f,p])=>[...c,...f,...p])},async removeBranch({navigationItems:t=[],action:n={}}){const r=[];for(const i of t)i.documentId&&(n.remove=!0,await Ne(e).remove(i),r.push(n),i.items?.length&&(await this.removeBranch({navigationItems:i.items})).forEach(o=>{r.push(o)}));return r},async createBranch({action:t,masterEntity:n,navigationItems:r,parentItem:i}){let s=[];for(const o of r){t.create=!0;const{parent:a,master:u,items:l,documentId:c,id:f,...p}=o,d=c&&f?{...p,documentId:c,id:f,master:n?n.id:void 0,parent:i?i.id:void 0}:{...p,documentId:void 0,id:void 0,master:n?n.id:void 0,parent:i?i.id:void 0},h=await Ne(e).save({item:d,locale:n?.locale});if(o.items?.length){const g=await this.createBranch({action:{},masterEntity:n,navigationItems:o.items,parentItem:h});s=s.concat(g).concat([t])}else s.push(t)}return s},async updateBranch({masterEntity:t,navigationItems:n,action:r,parentItem:i}){const s=[];for(const o of n){r.update=!0;const{documentId:a,updated:u,parent:l,master:c,items:f,...p}=o;let d;u?d=await Ne(e).save({item:{documentId:a,...p},locale:t?.locale}):d=o,f?.length?(await this.analyzeBranch({navigationItems:f,prevAction:{},masterEntity:t,parentItem:d})).forEach(g=>{s.push(g)}):s.push(r)}return s},async emitEvent({entity:t,event:n,uid:r}){const i=strapi.getModel(r),s=await iw.sanitizers.defaultSanitizeOutput({...i,schema:i.__schema__,getModel:()=>i},t);strapi.webhookRunner?strapi.webhookRunner.eventHub.emit(n,{model:i.modelName,entry:s}):console.warn("Webhook runner not present. Contact with Strapi Navigation Plugin team.")},async pruneCustomFields({removedFields:t}){const n=t.map(({name:o})=>`additionalFields.${o}`),r=t.map(({name:o})=>o),s=(await Ne(e).find({filters:{additionalFields:{$contains:[r]}}})).map(o=>B.omit(o,n));for(const o of s)await Ne(e).save({item:{documentId:o.documentId,additionalFields:o.additionalFields}})},async getSlug({query:t}){let n=xc.default(t);if(n){const r=await Ne(e).count({$or:[{uiRouterKey:{$startsWith:n}},{uiRouterKey:n}]});r&&(n=`${n}-${r}`)}return n.toLowerCase()},registerLifeCycleHook({callback:t,contentTypeName:n,hookName:r}){an[n][r]||(an[n][r]=[]),an[n][r]?.push(t)},async runLifeCycleHook({contentTypeName:t,event:n,hookName:r}){const i=an[t][r]??[];for(const s of i)await s(n)},buildNestedStructure({navigationItems:t,id:n}){return t?.reduce((r,i)=>(n&&i.parent?.id!==n||r.push({...B.omit(i,["related","items"]),related:i.related,items:this.buildNestedStructure({navigationItems:t,id:i.id})}),r),[])??[]},async readLocale(){const t=strapi.plugin("i18n").service("locales");let n=await t.getDefaultLocale(),r=(await t.find({})).map(({code:i})=>i).filter(i=>i!==n);return n||(n=r[0],r=r.slice(1)),{defaultLocale:n,restLocale:r}}}),Aw=e=>({async migrateRelatedIdToDocumentId(){console.log("Navigation plugin :: Migrations :: Relared id to document id - START");const t=Ne(e),n=await t.find({filters:{},limit:Number.MAX_SAFE_INTEGER});await Promise.all(n.map(async r=>{const i=r.related;if(i&&typeof i=="string"){const[s,o]=i.split(Yc);if(!B.isNaN(parseInt(o,10))){const a=await e.strapi.query(s).findOne({where:{id:o}});a&&await t.save({item:{documentId:r.documentId,related:{__type:s,documentId:a.documentId}}})}}})),console.log("Navigation plugin :: Migrations :: Relared id to document id - DONE")}}),Sw={admin:vw,common:xw,client:bw,migrate:Aw},Tw={bootstrap:Nl,destroy:Pl,register:Ll,config:$r,controllers:Zl,contentTypes:ql,middlewares:Jl,policies:ef,routes:rf,services:Sw};module.exports=Tw;
74
+ `+e.slice(o+1):u+=e.slice(i),u.slice(1)}function H0(e){for(var t="",n,r,i,s=0;s<e.length;s++){if(n=e.charCodeAt(s),n>=55296&&n<=56319&&(r=e.charCodeAt(s+1),r>=56320&&r<=57343)){t+=ts((n-55296)*1024+r-56320+65536),s++;continue}i=de[n],t+=!i&&$t(n)?e[s]:i||ts(n)}return t}function U0(e,t,n){var r="",i=e.tag,s,o;for(s=0,o=n.length;s<o;s+=1)at(e,t,n[s],!1,!1)&&(s!==0&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function G0(e,t,n,r){var i="",s=e.tag,o,a;for(o=0,a=n.length;o<a;o+=1)at(e,t+1,n[o],!0,!0)&&((!r||o!==0)&&(i+=zr(e,t)),e.dump&&Gt===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=s,e.dump=i||"[]"}function q0(e,t,n){var r="",i=e.tag,s=Object.keys(n),o,a,u,f,c;for(o=0,a=s.length;o<a;o+=1)c="",o!==0&&(c+=", "),e.condenseFlow&&(c+='"'),u=s[o],f=n[u],at(e,t,u,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),at(e,t,f,!1,!1)&&(c+=e.dump,r+=c));e.tag=i,e.dump="{"+r+"}"}function z0(e,t,n,r){var i="",s=e.tag,o=Object.keys(n),a,u,f,c,l,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Xt("sortKeys must be a boolean or a function");for(a=0,u=o.length;a<u;a+=1)p="",(!r||a!==0)&&(p+=zr(e,t)),f=o[a],c=n[f],at(e,t+1,f,!0,!0,!0)&&(l=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,l&&(e.dump&&Gt===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,l&&(p+=zr(e,t)),at(e,t+1,c,!0,l)&&(e.dump&&Gt===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=s,e.dump=i||"{}"}function as(e,t,n){var r,i,s,o,a,u;for(i=n?e.explicitTypes:e.implicitTypes,s=0,o=i.length;s<o;s+=1)if(a=i[s],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(e.tag=n?a.tag:"?",a.represent){if(u=e.styleMap[a.tag]||a.defaultStyle,bu.call(a.represent)==="[object Function]")r=a.represent(t,u);else if(_u.call(a.represent,u))r=a.represent[u](t,u);else throw new Xt("!<"+a.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function at(e,t,n,r,i,s){e.tag=null,e.dump=n,as(e,n,!1)||as(e,n,!0);var o=bu.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var a=o==="[object Object]"||o==="[object Array]",u,f;if(a&&(u=e.duplicates.indexOf(n),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(a&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),o==="[object Object]")r&&Object.keys(e.dump).length!==0?(z0(e,t,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):(q0(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(o==="[object Array]"){var c=e.noArrayIndent&&t>0?t-1:t;r&&e.dump.length!==0?(G0(e,c,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):(U0(e,c,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump))}else if(o==="[object String]")e.tag!=="?"&&j0(e,e.dump,t,s);else{if(e.skipInvalid)return!1;throw new Xt("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function K0(e,t){var n=[],r=[],i,s;for(Kr(e,n,r),i=0,s=r.length;i<s;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(s)}function Kr(e,t,n){var r,i,s;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,s=e.length;i<s;i+=1)Kr(e[i],t,n);else for(r=Object.keys(e),i=0,s=r.length;i<s;i+=1)Kr(e[r[i]],t,n)}function Lu(e,t){t=t||{};var n=new P0(t);return n.noRefs||K0(e,n),at(n,0,e,!0,!0)?n.dump+`
75
+ `:""}function W0(e,t){return Lu(e,Qt.extend({schema:m0},t))}Oi.dump=Lu;Oi.safeDump=W0;var rr=Wt,Du=Oi;function ir(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}ne.Type=ce;ne.Schema=It;ne.FAILSAFE_SCHEMA=Ri;ne.JSON_SCHEMA=iu;ne.CORE_SCHEMA=ou;ne.DEFAULT_SAFE_SCHEMA=Vt;ne.DEFAULT_FULL_SCHEMA=tr;ne.load=rr.load;ne.loadAll=rr.loadAll;ne.safeLoad=rr.safeLoad;ne.safeLoadAll=rr.safeLoadAll;ne.dump=Du.dump;ne.safeDump=Du.safeDump;ne.YAMLException=Yt;ne.MINIMAL_SCHEMA=Ri;ne.SAFE_SCHEMA=Vt;ne.DEFAULT_SCHEMA=tr;ne.scan=ir("scan");ne.parse=ir("parse");ne.compose=ir("compose");ne.addConstructor=ir("addConstructor");var Y0=ne,V0=Y0;const ku=tu,Q0=Zg,X0=Jg,Z0=V0,Mu=e=>Z0.safeLoad(X0(e));Ja.exports=e=>Q0(ku.readFile)(e,"utf8").then(t=>Mu(t));Ja.exports.sync=e=>Mu(ku.readFileSync(e,"utf8"));function J0(e,t){return fe.default.has(process.env,e)?process.env[e]:t}function mt(e){return process.env[e]??""}const eE={int(e,t){return fe.default.has(process.env,e)?parseInt(mt(e),10):t},float(e,t){return fe.default.has(process.env,e)?parseFloat(mt(e)):t},bool(e,t){return fe.default.has(process.env,e)?mt(e)==="true":t},json(e,t){if(!fe.default.has(process.env,e))return t;try{return JSON.parse(mt(e))}catch(n){throw n instanceof Error?new Error(`Invalid json environment variable ${e}: ${n.message}`):n}},array(e,t){if(!fe.default.has(process.env,e))return t;let n=mt(e);return n.startsWith("[")&&n.endsWith("]")&&(n=n.substring(1,n.length-1)),n.split(",").map(r=>fe.default.trim(fe.default.trim(r," "),'"'))},date(e,t){return fe.default.has(process.env,e)?new Date(mt(e)):t},oneOf(e,t,n){if(!t)throw new Error("env.oneOf requires expectedValues");if(n&&!t.includes(n))throw new Error("env.oneOf requires defaultValue to be included in expectedValues");const r=tE(e,n);return t.includes(r)?r:n}},tE=Object.assign(J0,eE),ju="id",Bu="documentId",nE="publishedAt",rE="createdBy",iE="updatedBy",us="createdAt",cs="updatedAt",Fe={ID_ATTRIBUTE:ju,DOC_ID_ATTRIBUTE:Bu,PUBLISHED_AT_ATTRIBUTE:nE,CREATED_BY_ATTRIBUTE:rE,UPDATED_BY_ATTRIBUTE:iE},oE=e=>{const t=[];return A.has(us,e.attributes)&&t.push(us),A.has(cs,e.attributes)&&t.push(cs),t},sE=e=>{if(!e)return[];const t=fe.default.reduce(e.attributes,(n,r,i)=>r.writable===!1?n.concat(i):n,[]);return fe.default.uniq([ju,Bu,...oE(e),...t])},aE=e=>A.union(strapi?.config?.get("api.responses.privateAttributes",[])??[],A.getOr([],"options.privateAttributes",e)),uE=(e,t)=>e?.attributes?.[t]?.private===!0?!0:aE(e).includes(t),Hu=e=>e&&!["media","component","relation","dynamiczone"].includes(e.type),cE=e=>e?.type==="media",Uu=e=>e?.type==="relation",lE=e=>!!e&&e.type==="dynamiczone",Pi=e=>!!e&&Uu(e)&&e.relation?.startsWith?.("morphTo"),{CREATED_BY_ATTRIBUTE:Rw,UPDATED_BY_ATTRIBUTE:$w}=Fe,vt=async(e,t,n)=>{const{path:r={raw:null,attribute:null},schema:i,getModel:s}=t;let o=t.parent;const a=async(m,g,w)=>{const C={schema:s(w.__type),path:g,getModel:s,parent:o};return vt(m,C,w)},u=m=>async(g,w,_)=>vt(g,{schema:m,path:w,getModel:s,parent:o},_),f=async(m,g,w)=>{const T={schema:s("plugin::upload.file"),path:g,getModel:s,parent:o};return vt(m,T,w)},c=async(m,g,w,_)=>vt(m,{schema:w,path:g,getModel:s,parent:o},_),l=async(m,g,w)=>{const C={schema:s(w.__component),path:g,getModel:s,parent:o};return vt(m,C,w)};if(!A.isObject(n)||A.isNil(i))return n;const p=A.clone(n),d=fE({data:p}),h=Object.keys(p);for(let m=0;m<h.length;m+=1){const g=h[m],w=i.attributes[g],_={...r};_.raw=A.isNil(r.raw)?g:`${r.raw}.${g}`,A.isNil(w)||(_.attribute=A.isNil(r.attribute)?g:`${r.attribute}.${g}`);const C={data:p,schema:i,key:g,value:p[g],attribute:w,path:_,getModel:s,parent:o};await e(C,d);const T=p[g];if(!(A.isNil(T)||A.isNil(w))){if(o={schema:i,key:g,attribute:w,path:_},Uu(w)){const F=w.relation.toLowerCase().startsWith("morph")?a:u(s(w.target));if(A.isArray(T)){const j=new Array(T.length);for(let x=0;x<T.length;x+=1)j[x]=await F(e,_,T[x]);p[g]=j}else p[g]=await F(e,_,T);continue}if(cE(w)){if(A.isArray(T)){const R=new Array(T.length);for(let F=0;F<T.length;F+=1)R[F]=await f(e,_,T[F]);p[g]=R}else p[g]=await f(e,_,T);continue}if(w.type==="component"){const R=s(w.component);if(A.isArray(T)){const F=new Array(T.length);for(let j=0;j<T.length;j+=1)F[j]=await c(e,_,R,T[j]);p[g]=F}else p[g]=await c(e,_,R,T);continue}if(w.type==="dynamiczone"&&A.isArray(T)){const R=new Array(T.length);for(let F=0;F<T.length;F+=1)R[F]=await l(e,_,T[F]);p[g]=R;continue}}}return p},fE=({data:e})=>({remove(t){delete e[t]},set(t,n){e[t]=n}}),Bt=A.curry(vt),ls=e=>({path:A.toPath(e.path),message:e.message,name:e.name}),pE=e=>({errors:A.isEmpty(e.inner)?[ls(e)]:e.inner.map(ls),message:e.message});class qe extends Error{name;details;message;constructor(t="An application error occured",n={}){super(),this.name="ApplicationError",this.message=t,this.details=n}}class Gu extends qe{constructor(t,n){super(t,n),this.name="ValidationError"}}class dE extends Gu{constructor(t,n){super("Validation");const{errors:r,message:i}=pE(t);this.message=n||i,this.details={errors:r}}}class hE extends qe{constructor(t="Invalid pagination",n){super(t,n),this.name="PaginationError",this.message=t}}class mE extends qe{constructor(t="Entity not found",n){super(t,n),this.name="NotFoundError",this.message=t}}class qu extends qe{constructor(t="Forbidden access",n){super(t,n),this.name="ForbiddenError",this.message=t}}class gE extends qe{constructor(t="Unauthorized",n){super(t,n),this.name="UnauthorizedError",this.message=t}}class yE extends qe{constructor(t="Too many requests, please try again later.",n){super(t,n),this.name="RateLimitError",this.message=t,this.details=n||{}}}class vE extends qe{constructor(t="Entity too large",n){super(t,n),this.name="PayloadTooLargeError",this.message=t}}class EE extends qu{constructor(t="Policy Failed",n){super(t,n),this.name="PolicyError",this.message=t,this.details=n||{}}}class wE extends qe{constructor(t="This feature is not implemented yet",n){super(t,n),this.name="NotImplementedError",this.message=t}}const kt=Object.freeze(Object.defineProperty({__proto__:null,ApplicationError:qe,ForbiddenError:qu,HttpError:ap.HttpError,NotFoundError:mE,NotImplementedError:wE,PaginationError:hE,PayloadTooLargeError:vE,PolicyError:EE,RateLimitError:yE,UnauthorizedError:gE,ValidationError:Gu,YupValidationError:dE},Symbol.toStringTag,{value:"Module"})),bE=["$and","$or"],_E=["$not","$in","$notIn","$eq","$eqi","$ne","$nei","$gt","$gte","$lt","$lte","$null","$notNull","$between","$startsWith","$endsWith","$startsWithi","$endsWithi","$contains","$notContains","$containsi","$notContainsi","$jsonSupersetOf"],xE=["$not","$in","$notIn","$eq","$ne","$gt","$gte","$lt","$lte","$between"],SE=["$in","$notIn","$between"],kn={where:_E,cast:xE,group:bE,array:SE},AE=Object.fromEntries(Object.entries(kn).map(([e,t])=>[e,t.map(n=>n.toLowerCase())])),TE=(e,t)=>e in t,CE=(e,t,n=!1)=>n?AE[e]?.includes(t.toLowerCase())??!1:TE(e,kn)?kn[e]?.includes(t)??!1:!1,RE=(e,t=!1)=>Object.keys(kn).some(n=>CE(n,e,t)),{ID_ATTRIBUTE:Fw,DOC_ID_ATTRIBUTE:Iw,PUBLISHED_AT_ATTRIBUTE:Ow}=Fe;function Le(...e){const[t,...n]=e;return async(...r)=>{let i=await t.apply(t,r);for(let s=0;s<n.length;s+=1)i=await n[s](i);return i}}A.curry(Ep);const Ot=({key:e,attribute:t},{remove:n})=>{t?.type==="password"&&n(e)},Nt=({schema:e,key:t,attribute:n},{remove:r})=>{if(!n)return;(n.private===!0||uE(e,t))&&r(t)},$E={strict:A.isBoolean},fs=["find"],{CREATED_BY_ATTRIBUTE:FE,UPDATED_BY_ATTRIBUTE:IE}=Fe,Et=e=>async({data:t,key:n,attribute:r,schema:i},{remove:s,set:o})=>{if(!r||!(r.type==="relation"))return;const u=async()=>{const p=t[n];if("connect"in p||"set"in p||"disconnect"in p){const d={},h=await f(p.connect||[]),m=await f(p.set||[]),g=await f(p.disconnect||[]);if(h.length>0&&(d.connect=h),m.length>0&&(d.set=m),g.length>0&&(d.disconnect=g),"options"in p&&typeof p.options=="object"&&p.options!==null){const w={};Object.keys(p.options).forEach(_=>{const C=$E[_];C&&C(p.options[_])&&(w[_]=p.options[_])}),d.options=w}else d.options={};o(n,d)}else{const d=await f(p);d.length&&o(n,d)}},f=async p=>{const d=[];if(!A.isArray(p))return d;for(const h of p){if(!A.isObject(h)||!("__type"in h))continue;const m=fs.map(w=>`${h.__type}.${w}`);await ps(m,e)&&d.push(h)}return d},c=async()=>{const p=fs.map(h=>`${r.target}.${h}`);await ps(p,e)||s(n)},l=[FE,IE].includes(n);if(Pi(r)){await u();return}l&&i.options?.populateCreatorFields||await c()},ps=async(e,t)=>{for(const n of e)try{return await strapi.auth.verify(t,{scope:n}),!0}catch{continue}return!1},Li=({key:e,attribute:t},{remove:n})=>{Pi(t)&&n(e)},Di=({key:e,attribute:t},{remove:n})=>{lE(t)&&n(e)},OE=(e=null)=>({key:t,path:{attribute:n}},{remove:r})=>{if(e===null)return;if(!(A.isArray(e)&&e.every(A.isString)))throw new TypeError(`Expected array of strings for allowedFields but got "${typeof e}"`);if(A.isNil(n))return;const i=NE(n);e.some(o=>i.includes(o)||o.startsWith(`${n}.`))||r(t)},NE=e=>A.toPath(e).reduce((n,r,i,s)=>[...n,s.slice(0,i+1).join(".")],[]),zu=(e=null)=>({key:t,path:{attribute:n}},{remove:r})=>{if(e===null){r(t);return}if(!(A.isArray(e)&&e.every(A.isString)))throw new TypeError(`Expected array of strings for restrictedFields but got "${typeof e}"`);if(e.includes(n)){r(t);return}e.some(s=>n?.toString().startsWith(`${s}.`))&&r(t)},Ku=({schema:e,key:t,value:n},{set:r})=>{if(t===""&&n==="*"){const{attributes:i}=e,s=Object.entries(i).filter(([,o])=>["relation","component","media","dynamiczone"].includes(o.type)).reduce((o,[a])=>({...o,[a]:!0}),{});r("",s)}},PE=Object.freeze(Object.defineProperty({__proto__:null,expandWildcardPopulate:Ku,removeDisallowedFields:OE,removeDynamicZones:Di,removeMorphToRelations:Li,removePassword:Ot,removePrivate:Nt,removeRestrictedFields:zu,removeRestrictedRelations:Et},Symbol.toStringTag,{value:"Module"})),LE={raw:null,attribute:null},or=()=>{const e={parsers:[],interceptors:[],ignore:[],handlers:{attributes:[],common:[]}},t=async(n,r,i)=>{const{path:s=LE,parent:o,schema:a,getModel:u}=r??{};for(const{predicate:d,handler:h}of e.interceptors)if(d(i))return h(n,r,i,{recurse:t});const f=e.parsers.find(d=>d.predicate(i))?.parser,c=f?.(i);if(!c)return i;let l=c.transform(i);const p=c.keys(l);for(const d of p){const h=a?.attributes?.[d],m={...s};m.raw=A.isNil(s.raw)?d:`${s.raw}.${d}`,A.isNil(h)||(m.attribute=A.isNil(s.attribute)?d:`${s.attribute}.${d}`);const g={key:d,value:c.get(d,l),attribute:h,schema:a,path:m,data:l,getModel:u,parent:o},w={remove(j){l=c.remove(j,l)},set(j,x){l=c.set(j,x,l)},recurse:t};await n(g,A.pick(["remove","set"],w));const _=c.get(d,l),C=()=>({key:d,value:_,attribute:h,schema:a,path:m,data:l,visitor:n,getModel:u,parent:o}),T=C();if(e.ignore.some(j=>j(T)))continue;const F=[...e.handlers.common,...e.handlers.attributes];for await(const j of F){const x=C();await j.predicate(x)&&await j.handler(x,A.pick(["recurse","set"],w))}}return l};return{traverse:t,intercept(n,r){return e.interceptors.push({predicate:n,handler:r}),this},parse(n,r){return e.parsers.push({predicate:n,parser:r}),this},ignore(n){return e.ignore.push(n),this},on(n,r){return e.handlers.common.push({predicate:n,handler:r}),this},onAttribute(n,r){return e.handlers.attributes.push({predicate:n,handler:r}),this},onRelation(n){return this.onAttribute(({attribute:r})=>r?.type==="relation",n)},onMedia(n){return this.onAttribute(({attribute:r})=>r?.type==="media",n)},onComponent(n){return this.onAttribute(({attribute:r})=>r?.type==="component",n)},onDynamicZone(n){return this.onAttribute(({attribute:r})=>r?.type==="dynamiczone",n)}}},DE=e=>A.isObject(e),kE=or().intercept(A.isArray,async(e,t,n,{recurse:r})=>Promise.all(n.map((i,s)=>{const o=t.path?{...t.path,raw:`${t.path.raw}[${s}]`}:t.path;return r(e,{...t,path:o},i)})).then(i=>i.filter(s=>!(A.isObject(s)&&A.isEmpty(s))))).intercept(e=>!A.isObject(e),(e,t,n)=>n).parse(DE,()=>({transform:A.cloneDeep,remove(e,t){return A.omit(e,t)},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({value:e})=>A.isNil(e)).on(({attribute:e})=>A.isNil(e),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:s,attribute:o},{set:a,recurse:u})=>{a(e,await u(t,{schema:i,path:n,getModel:s,parent:{key:e,path:n,schema:i,attribute:o}},r))}).onRelation(async({key:e,attribute:t,visitor:n,path:r,value:i,schema:s,getModel:o},{set:a,recurse:u})=>{if(t.relation.toLowerCase().startsWith("morph"))return;const c={key:e,path:r,schema:s,attribute:t},l=t.target,p=o(l),d=await u(n,{schema:p,path:r,getModel:o,parent:c},i);a(e,d)}).onComponent(async({key:e,attribute:t,visitor:n,path:r,schema:i,value:s,getModel:o},{set:a,recurse:u})=>{const f={key:e,path:r,schema:i,attribute:t},c=o(t.component),l=await u(n,{schema:c,path:r,getModel:o,parent:f},s);a(e,l)}).onMedia(async({key:e,visitor:t,path:n,schema:r,attribute:i,value:s,getModel:o},{set:a,recurse:u})=>{const f={key:e,path:n,schema:r,attribute:i},l=o("plugin::upload.file"),p=await u(t,{schema:l,path:n,getModel:o,parent:f},s);a(e,p)}),Xe=A.curry(kE.traverse),ME={asc:"asc",desc:"desc"},jE=Object.values(ME),BE=e=>jE.includes(e.toLowerCase()),HE=e=>Array.isArray(e)&&e.every(A.isString),UE=e=>Array.isArray(e)&&e.every(A.isObject),GE=e=>A.isString(e)&&e.split(",").length>1,qE=e=>A.isObject(e),zE=or().intercept(GE,async(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(A.trim).map(i=>r(e,t,i))).then(i=>i.filter(s=>!A.isEmpty(s)).join(","))).intercept(HE,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(s=>!A.isEmpty(s)))).intercept(UE,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(s=>!A.isEmpty(s)))).parse(A.isString,()=>{const e=A.pipe(A.split("."),A.map(A.split(":")),A.flatten),t=n=>{if(n.length!==0)return n.reduce((r,i)=>A.isEmpty(i)?r:r===""?i:BE(i)?`${r}:${i}`:`${r}.${i}`,"")};return{transform:A.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[s]=e(i);return s!==n?i:A.isNil(r)?s:`${s}.${r}`},keys(n){const r=A.first(e(n));return r?[r]:[]},get(n,r){const[i,...s]=e(r);return n===i?t(s):void 0}}}).parse(qE,()=>({transform:A.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,getModel:s,schema:o},{set:a,recurse:u})=>{if(n.relation.toLowerCase().startsWith("morph"))return;const c={key:e,path:i,schema:o,attribute:n},l=n.target,p=s(l),d=await u(r,{schema:p,path:i,getModel:s,parent:c},t);a(e,d)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:s,getModel:o},{recurse:a,set:u})=>{const f={key:e,path:t,schema:n,attribute:r},l=o("plugin::upload.file"),p=await a(i,{schema:l,path:t,getModel:o,parent:f},s);u(e,p)}).onComponent(async({key:e,value:t,visitor:n,path:r,schema:i,attribute:s,getModel:o},{recurse:a,set:u})=>{const f={key:e,path:r,schema:i,attribute:s},c=o(s.component),l=await a(n,{schema:c,path:r,getModel:o,parent:f},t);u(e,l)}),Ze=A.curry(zE.traverse),ds=e=>({key:t,attribute:n})=>!n&&e===t,Wu=e=>e==="*",KE=e=>A.isString(e)&&!Wu(e),WE=e=>A.isArray(e)&&e.every(A.isString),hs=e=>A.isObject(e),YE=or().intercept(KE,async(e,t,n,{recurse:r})=>{const i=QE([n]),s=await r(e,t,i),[o]=VE(s);return o}).intercept(WE,async(e,t,n,{recurse:r})=>(await Promise.all(n.map(s=>r(e,t,s)))).filter(s=>!A.isNil(s))).parse(Wu,()=>({transform:A.identity,get:(e,t)=>t,set:(e,t)=>t,keys:A.constant([""]),remove:A.constant(void 0)})).parse(A.isString,()=>{const e=A.split("."),t=A.join(".");return{transform:A.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[s]=e(i);return s!==n?i:A.isNil(r)||A.isEmpty(r)?s:`${s}.${r}`},keys(n){const r=A.first(e(n));return r?[r]:[]},get(n,r){const[i,...s]=e(r);return n===i?t(s):void 0}}}).parse(hs,()=>({transform:A.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({key:e,attribute:t})=>["sort","filters","fields"].includes(e)&&!t).on(ds("populate"),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:s,attribute:o},{set:a,recurse:u})=>{const c=await u(t,{schema:i,path:n,getModel:s,parent:{key:e,path:n,schema:i,attribute:o}},r);a(e,c)}).on(ds("on"),async({key:e,visitor:t,path:n,value:r,getModel:i,parent:s},{set:o,recurse:a})=>{const u={};if(hs(r)){for(const[f,c]of Object.entries(r)){const l=i(f),p={...n,raw:`${n.raw}[${f}]`};u[f]=await a(t,{schema:l,path:p,getModel:i,parent:s},c)}o(e,u)}}).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,schema:s,getModel:o},{set:a,recurse:u})=>{if(A.isNil(t))return;const f={key:e,path:i,schema:s,attribute:n};if(Pi(n)){if(!A.isObject(t)||!("on"in t&&A.isObject(t?.on)))return;const d=await u(r,{schema:s,path:i,getModel:o,parent:f},{on:t?.on});a(e,d);return}const c=n.target,l=o(c),p=await u(r,{schema:l,path:i,getModel:o,parent:f},t);a(e,p)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:s,getModel:o},{recurse:a,set:u})=>{if(A.isNil(s))return;const f={key:e,path:t,schema:n,attribute:r},l=o("plugin::upload.file"),p=await a(i,{schema:l,path:t,getModel:o,parent:f},s);u(e,p)}).onComponent(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:s,getModel:o},{recurse:a,set:u})=>{if(A.isNil(t))return;const f={key:e,path:i,schema:n,attribute:s},c=o(s.component),l=await a(r,{schema:c,path:i,getModel:o,parent:f},t);u(e,l)}).onDynamicZone(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:s,getModel:o},{set:a,recurse:u})=>{if(A.isNil(t)||!A.isObject(t))return;const f={key:e,path:i,schema:n,attribute:s};if("on"in t&&t.on){const c=await u(r,{schema:n,path:i,getModel:o,parent:f},{on:t.on});a(e,c)}}),hn=A.curry(YE.traverse),VE=e=>{const t=[];function n(r,i){for(const[s,o]of Object.entries(r)){const a=i?`${i}.${s}`:s;o===!0?t.push(a):n(o.populate,a)}}return n(e,""),t},QE=e=>{const t={};function n(r,i){const[s,...o]=i;o.length===0?r[s]=!0:((!r[s]||typeof r[s]=="boolean")&&(r[s]={populate:{}}),n(r[s].populate,o))}return e.forEach(r=>n(t,r.split("."))),t},XE=e=>A.isArray(e)&&e.every(A.isString),ZE=or().intercept(XE,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i)))).intercept(e=>A.isString(e)&&e.includes(","),(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(i=>r(e,t,i)))).intercept(e=>A.eq("*",e),A.constant("*")).parse(A.isString,()=>({transform:A.trim,remove(e,t){return t===e?void 0:t},set(e,t,n){return n},keys(e){return[e]},get(e,t){return e===t?t:void 0}})),Cr=A.curry(ZE.traverse),{ID_ATTRIBUTE:Mn,DOC_ID_ATTRIBUTE:jn}=Fe,JE=e=>async t=>{if(!e.schema)throw new Error("Missing schema in sanitizePasswords");return Bt(Ot,e,t)},Yu=async(e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeOutput");return Bt((...n)=>{Ot(...n),Nt(...n)},e,t)},ki=A.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFilters");return Le(Xe(({key:n,attribute:r},{remove:i})=>{const s=!!r;[Mn,jn].includes(n)||!s&&!RE(n)&&i(n)},e),Xe(Di,e),Xe(Li,e),Xe(Ot,e),Xe(Nt,e),Xe(({key:n,value:r},{remove:i})=>{A.isObject(r)&&A.isEmpty(r)&&i(n)},e))(t)}),Mi=A.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeSort");return Le(Ze(({key:n,attribute:r},{remove:i})=>{[Mn,jn].includes(n)||r||i(n)},e),Ze(Di,e),Ze(Li,e),Ze(Nt,e),Ze(Ot,e),Ze(({key:n,attribute:r,value:i},{remove:s})=>{[Mn,jn].includes(n)||!Hu(r)&&A.isEmpty(i)&&s(n)},e))(t)}),ji=A.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFields");return Le(Cr(({key:n,attribute:r},{remove:i})=>{[Mn,jn].includes(n)||(A.isNil(r)||!Hu(r))&&i(n)},e),Cr(Nt,e),Cr(Ot,e),n=>A.isArray(n)?n.filter(r=>!A.isNil(r)):n)(t)}),Bi=A.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizePopulate");return Le(hn(Ku,e),hn(async({key:n,value:r,schema:i,attribute:s,getModel:o,path:a},{set:u})=>{if(s)return;const f={key:n,path:a,schema:i,attribute:s};n==="sort"&&u(n,await Mi({schema:i,getModel:o,parent:f},r)),n==="filters"&&u(n,await ki({schema:i,getModel:o,parent:f},r)),n==="fields"&&u(n,await ji({schema:i,getModel:o,parent:f},r)),n==="populate"&&u(n,await Bi({schema:i,getModel:o,parent:f},r))},e),hn(Nt,e))(t)}),ew=Object.freeze(Object.defineProperty({__proto__:null,defaultSanitizeFields:ji,defaultSanitizeFilters:ki,defaultSanitizeOutput:Yu,defaultSanitizePopulate:Bi,defaultSanitizeSort:Mi,sanitizePasswords:JE},Symbol.toStringTag,{value:"Module"})),tw=e=>{const{getModel:t}=e,n=(f,c,{auth:l}={})=>{if(!c)throw new Error("Missing schema in sanitizeInput");if(A.isArray(f))return Promise.all(f.map(h=>n(h,c,{auth:l})));const p=sE(c),d=[A.omit(Fe.ID_ATTRIBUTE),A.omit(Fe.DOC_ID_ATTRIBUTE),Bt(zu(p),{schema:c,getModel:t})];return l&&d.push(Bt(Et(l),{schema:c,getModel:t})),e?.sanitizers?.input?.forEach(h=>d.push(h(c))),Le(...d)(f)},r=async(f,c,{auth:l}={})=>{if(!c)throw new Error("Missing schema in sanitizeOutput");if(A.isArray(f)){const d=new Array(f.length);for(let h=0;h<f.length;h+=1)d[h]=await r(f[h],c,{auth:l});return d}const p=[d=>Yu({schema:c,getModel:t},d)];return l&&p.push(Bt(Et(l),{schema:c,getModel:t})),e?.sanitizers?.output?.forEach(d=>p.push(d(c))),Le(...p)(f)},i=async(f,c,{auth:l}={})=>{if(!c)throw new Error("Missing schema in sanitizeQuery");const{filters:p,sort:d,fields:h,populate:m}=f,g=A.cloneDeep(f);return p&&Object.assign(g,{filters:await s(p,c,{auth:l})}),d&&Object.assign(g,{sort:await o(d,c,{auth:l})}),h&&Object.assign(g,{fields:await a(h,c)}),m&&Object.assign(g,{populate:await u(m,c)}),g},s=(f,c,{auth:l}={})=>{if(!c)throw new Error("Missing schema in sanitizeFilters");if(A.isArray(f))return Promise.all(f.map(d=>s(d,c,{auth:l})));const p=[ki({schema:c,getModel:t})];return l&&p.push(Xe(Et(l),{schema:c,getModel:t})),Le(...p)(f)},o=(f,c,{auth:l}={})=>{if(!c)throw new Error("Missing schema in sanitizeSort");const p=[Mi({schema:c,getModel:t})];return l&&p.push(Ze(Et(l),{schema:c,getModel:t})),Le(...p)(f)},a=(f,c)=>{if(!c)throw new Error("Missing schema in sanitizeFields");const l=[ji({schema:c,getModel:t})];return Le(...l)(f)},u=(f,c,{auth:l}={})=>{if(!c)throw new Error("Missing schema in sanitizePopulate");const p=[Bi({schema:c,getModel:t})];return l&&p.push(hn(Et(l),{schema:c,getModel:t})),Le(...p)(f)};return{input:n,output:r,query:i,filters:s,sort:o,fields:a,populate:u}},nw=Object.freeze(Object.defineProperty({__proto__:null,createAPISanitizers:tw,sanitizers:ew,visitors:PE},Symbol.toStringTag,{value:"Module"})),{CREATED_BY_ATTRIBUTE:Nw,UPDATED_BY_ATTRIBUTE:Pw}=Fe;Fe.DOC_ID_ATTRIBUTE,Fe.DOC_ID_ATTRIBUTE;const{ID_ATTRIBUTE:Lw,DOC_ID_ATTRIBUTE:Dw}=Fe,{ID_ATTRIBUTE:kw,DOC_ID_ATTRIBUTE:Mw}=Fe,rw=e=>/^[a-z][a-zA-Z0-9]+$/.test(e),iw=e=>/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.test(e),{toString:ow}=Object.prototype,sw=Error.prototype.toString,aw=RegExp.prototype.toString,uw=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",cw=/^Symbol\((.*)\)(.*)$/;function lw(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":`${e}`}function ms(e,t=!1){if(e==null||e===!0||e===!1)return`${e}`;if(typeof e=="number")return lw(e);if(typeof e=="string")return t?`"${e}"`:e;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(typeof e=="symbol")return uw.call(e).replace(cw,"Symbol($1)");const n=ow.call(e).slice(8,-1);if(n==="Date"){const r=e;return Number.isNaN(r.getTime())?`${r}`:r.toISOString()}return n==="Error"||e instanceof Error?`[${sw.call(e)}]`:n==="RegExp"?aw.call(e):null}function gs(e,t){const n=ms(e,t);return n!==null?n:JSON.stringify(e,function(i,s){const o=ms(this[i],t);return o!==null?o:s},2)}const fw=e=>!fe.default.isNil(e),pw=e=>!fe.default.isNull(e);lt(qn,"notNil",function(t="${path} must be defined."){return this.test("defined",t,fw)});lt(qn,"notNull",function(t="${path} cannot be null."){return this.test("defined",t,pw)});lt(qn,"isFunction",function(t="${path} is not a function"){return this.test("is a function",t,n=>fe.default.isUndefined(n)||fe.default.isFunction(n))});lt(Zr,"isCamelCase",function(t="${path} is not in camel case (anExampleOfCamelCase)"){return this.test("is in camelCase",t,n=>n?rw(n):!0)});lt(Zr,"isKebabCase",function(t="${path} is not in kebab case (an-example-of-kebab-case)"){return this.test("is in kebab-case",t,n=>n?iw(n):!0)});lt(Gs,"onlyContainsFunctions",function(t="${path} contains values that are not functions"){return this.test("only contains functions",t,n=>fe.default.isUndefined(n)||n&&Object.values(n).every(fe.default.isFunction))});lt(qs,"uniqueProperty",function(t,n){return this.test("unique",n,function(i){const s=[];if(i?.forEach((o,a)=>{i.filter(f=>A.get(t,f)===A.get(t,o)).length>1&&s.push(this.createError({path:`${this.path}[${a}].${t}`,message:n}))}),s.length)throw new Te(s);return!0})});zf({mixed:{notType(e){const{path:t,type:n,value:r,originalValue:i}=e,s=i!=null&&i!==r;return`${t} must be a \`${n}\` type, but the final value was: \`${gs(r,!0)}\`${s?` (cast from the value \`${gs(i,!0)}\`).`:"."}`}}});const sn=(e,t,n)=>{e&&e.emit&&e.emit(t,n)},dw=e=>[...new Set(e.filter(t=>!!t).flatMap(({remove:t,create:n,update:r})=>[n?"CREATE":"",r?"UPDATE":"",t?"REMOVE":""].filter(i=>!!i)))].join("_"),Vu=e=>async t=>({title:t.title,path:t.path,audience:t.audience,type:t.type,uiRouterKey:t.uiRouterKey,order:t.order,collapsed:t.collapsed,menuAttached:t.menuAttached,removed:!1,updated:!0,externalPath:t.externalPath,items:t.items?await Promise.all(t.items.map(Vu(e))):[],master:e.master,parent:void 0,related:t.related,additionalFields:t.additionalFields}),hw=(e,t)=>t.slice(1).reduce((n,r)=>n.concat([e,r]),t.slice(0,1)),mw=async({strapi:e})=>{const n=!!e.plugin("rest-cache"),r=e.store({type:"plugin",name:"navigation"}),i=De.parse(await r.get({key:"config"}));return n?{hasCachePlugin:n,enabled:!!i.isCacheEnabled}:{hasCachePlugin:n,enabled:!1}},gw=e=>({async config({viaSettingsPage:t=!1}){const n=oe(e,"common"),r=await mw(e),s=await(await n.getPluginStore()).get({key:"config"}).then(De.parse),{additionalFields:o,cascadeMenuAttached:a,contentTypesPopulate:u,contentTypesNameFields:f,pathDefaultFields:c,allowedLevels:l,preferCustomContentTypes:p}=s,d=!!strapi.plugin("graphql");let h={allowedContentTypes:Ss,restrictedContentTypes:As,availableAudience:[]};const m=await this.configContentTypes({}),g={contentTypes:await this.configContentTypes({viaSettingsPage:t}),contentTypesNameFields:{default:Yc,...H.isObject(f)?f:{}},contentTypesPopulate:H.isObject(u)?u:{},pathDefaultFields:H.isObject(c)?c:{},allowedLevels:l,additionalFields:t?o:o.filter(w=>typeof w=="string"||!!w.enabled),gql:{navigationItemRelated:m.map(({labelSingular:w})=>w.replace(/\s+/g,""))},isGQLPluginEnabled:t?d:void 0,cascadeMenuAttached:a,preferCustomContentTypes:p};if(o.includes("audience")){const w=await nl(e).find({},Number.MAX_SAFE_INTEGER);h={...h,availableAudience:w}}return{...g,...h,isCacheEnabled:r.enabled,isCachePluginEnabled:r.hasCachePlugin}},async configContentTypes({viaSettingsPage:t=!1}){const i=await(await oe(e,"common").getPluginStore()).get({key:"config"}).then(De.parse);return(await Promise.all(i.contentTypes.filter(o=>!!e.strapi.contentTypes[o]&&Jc(o)).map(async o=>{const a=Rr.parse(strapi.contentTypes[o]),{kind:u,options:f,uid:c}=a,l=f?.draftAndPublish,p=u===zi.SINGLE,d=p&&l,h=m=>({key:o,available:m});if(p){const m=yn(e,c);if(d){const w=d?await m.count({},"published"):!0;return h(w!==0)}return await m.count({})!==0?h(!0):t?h(!1):void 0}return h(!0)}))).reduce((o,a)=>{if(!a?.key)return o;const{key:u,available:f}=a,c=Rr.parse(e.strapi.contentTypes[u]),l=(c.associations||[]).find(({model:D})=>D==="navigationitem"),{uid:p,options:d,info:h,collectionName:m,modelName:g,apiName:w,plugin:_,kind:C,pluginOptions:T={}}=c,R=f&&!d?.hidden;if(!R)return o;const{visible:F=!0}=T["content-manager"]||{},{name:j="",description:x=""}=h,S=H.find(H.get(e.strapi.api,`[${g}].config.routes`,[]),D=>D.handler.includes(".find")),N=S&&S.path.split("/")[1],v=N&&N!==w?N:w||g,M=C===zi.SINGLE,B=M?v:Gi.default(v),z=Wi(g),E=typeof p=="string"?H.last(p.split(".")).split("-"):[],b=E.length>1?E.reduce((D,U)=>`${D}${H.upperFirst(U)}`,""):H.upperFirst(g),$=j||H.upperFirst(E.length>1?E.join(" "):z);return o.push({uid:p,name:z,draftAndPublish:d?.draftAndPublish,isSingle:M,description:x,collectionName:m,contentTypeName:b,label:M?$:Gi.default(j||$),relatedField:l?l.alias:void 0,labelSingular:Wi($),endpoint:B,plugin:_,available:R,visible:F,templateName:d?.templateName}),o},[])},async get({ids:t,locale:n}){let r={};t&&t.length&&(r.id={$in:t});const i=await Ne(e).find({filters:r,locale:n||"*",limit:Number.MAX_SAFE_INTEGER,populate:["items","items.parent","items.audience","items.related"]}),s=({allItems:o,item:a,parent:u})=>{const f=o.filter(c=>c.parent?.documentId===a.documentId);return{...a,parent:u,items:f.map(c=>s({parent:a,item:c,allItems:o})).sort((c,l)=>c.order-l.order)}};return i.map(o=>({...o,items:o.items?.filter(a=>!a.parent).map(a=>s({allItems:o.items??[],item:a})).sort((a,u)=>a.order-u.order)}))},async getById({documentId:t,locale:n,populate:r=[]}){const i=oe(e,"common"),{defaultLocale:s}=await i.readLocale(),o={documentId:t},a=await Ne(e).findOne({filters:o,locale:n||s}),u=await Pe(e).find({filters:{master:a.id},locale:n||s,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["parent","audience",...r]});return{...a,items:i.buildNestedStructure({navigationItems:u}).filter(({parent:f})=>!f)}},async post({auditLog:t,payload:n}){const{masterModel:r}=be(e),i=oe(e,"common"),{defaultLocale:s,restLocale:o}=await i.readLocale(),a=Ne(e),u=[],{name:f,visible:c}=n,l=await i.getSlug({query:f}),p=await a.save({name:f,visible:c,locale:s,slug:l});u.push(await this.getById({documentId:p.documentId}));for(const d of o){const h=await a.save({name:f,visible:c,locale:d,slug:l,documentId:p.documentId});u.push(await this.getById({documentId:h.documentId}))}return u.map(d=>{sn(t,"onChangeNavigation",{actionType:"CREATE",oldEntity:d,newEntity:d})}),await i.emitEvent({entity:p,event:"entry.create",uid:r.uid}),{...p,items:[]}},async put({auditLog:t,payload:n}){const{masterModel:r}=be(e),i=oe(e,"common"),{defaultLocale:s,restLocale:o}=await i.readLocale(),a=Ne(e),{name:u,visible:f,items:c}=n,l=await a.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),p=await this.getById({documentId:n.documentId,locale:n.locale});if(l.name!==u||l.visible!==f){const m=u?await i.getSlug({query:u}):l.slug,g=await Promise.all([s,...o].map(w=>a.findOne({filters:{documentId:l.documentId},locale:w})));for(const w of g)await a.save({documentId:w.documentId,id:w.id,slug:m,locale:w.locale,name:u,visible:f})}const h=await i.analyzeBranch({navigationItems:c??[],masterEntity:l,prevAction:{}}).then(dw).then(async m=>{const g=await this.getById({documentId:l.documentId});return sn(t,"onChangeNavigation",{actionType:m,oldEntity:p,newEntity:g}),g});return await i.emitEvent({entity:await a.findOne({filters:{documentId:n.documentId},populate:"*"}),event:"entry.update",uid:r.uid}),h},async delete({auditLog:t,documentId:n}){const r=Ne(e),i=Pe(e),s=await this.getById({documentId:n}),o=async f=>{f.length<1||await i.removeForIds(await i.findForMasterIds(f).then(c=>c.reduce((l,{documentId:p})=>(p&&l.push(p),l),[])))},a=await r.findOne({filters:{documentId:n},populate:"*"}),u=await r.find({filters:{documentId:a.documentId},populate:"*"});await o(u.map(({id:f})=>f)),await r.remove({documentId:a.documentId}),sn(t,"onNavigationDeletion",{entity:s,actionType:"DELETE"})},async restart(){e.strapi.reload.isWatching=!1,setImmediate(()=>e.strapi.reload())},async restoreConfig(){const t=oe(e,"common");await(await t.getPluginStore()).delete({key:"config"}),await t.setDefaultConfig()},async updateConfig({config:t}){const n=oe(e,"common"),r=await n.getPluginStore(),i=await r.get({key:"config"}).then(De.parse);Ts(t.additionalFields),await r.set({key:"config",value:t});const s=H.differenceBy(i.additionalFields,t.additionalFields,"name").reduce((o,a)=>(typeof a=="string"||o.push(a),o),[]);H.isEmpty(s)||await n.pruneCustomFields({removedFields:s})},async fillFromOtherLocale({auditLog:t,source:n,target:r,documentId:i}){const s=await this.getById({documentId:i,locale:r});return await this.i18nNavigationContentsCopy({source:await this.getById({documentId:i,locale:n,populate:["related"]}),target:s}).then(()=>this.getById({documentId:i,locale:r,populate:["related"]})).then(o=>(sn(t,"onChangeNavigation",{actionType:"UPDATE",oldEntity:s,newEntity:o}),o))},async i18nNavigationContentsCopy({source:t,target:n}){const r=oe(e,"common"),i=t.items??[],s=Ne(e);if(n.items?.length)throw new sr("Current navigation is non-empty");if(!n.locale)throw new sr("Current navigation does not have specified locale");if(!i.length)throw new sr("Source navigation is empty");const o=Vu({master:n,locale:n.locale,strapi});await r.createBranch({action:{create:!0},masterEntity:await s.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),navigationItems:await Promise.all(i.map(o)),parentItem:void 0})},async readNavigationItemFromLocale({path:t,source:n,target:r}){const i=await this.getById({documentId:n}),s=await this.getById({documentId:r});if(!i)throw new kt.NotFoundError("Unable to find source navigation for specified query");if(!s)throw new kt.NotFoundError("Unable to find target navigation for specified query");const o=["path","related","type","uiRouterKey","title","externalPath"],a=t.split(".").map(f=>parseInt(f,10));(!a.some(Number.isNaN)||!a.length)&&new il("Path is invalid");let u=H.get(i.items,hw("items",a.map(H.toString)));if(!u)throw new kt.NotFoundError("Unable to find navigation item");return Hc.parse(H.pick(u,o))},async getContentTypeItems({query:t,uid:n}){const s=await(await oe(e,"common").getPluginStore()).get({key:"config"}).then(De.parse),o={publishedAt:{$notNull:!0}},a=H.get(e.strapi.contentTypes,n),{draftAndPublish:u}=a.options,{localized:f=!1}=a?.pluginOptions?.i18n||{};f&&t.locale&&(o.locale=t.locale);const c=yn(e,n);try{return await c.findMany(o,s.contentTypesPopulate[n]||[],u?"published":void 0)}catch(l){return console.error(l),[]}},async purgeNavigationCache(t,n){const r=Ne(e),i=await r.findOne({filters:{documentId:t}});if(!i)throw new kt.NotFoundError("Navigation is not defined");const s=f=>new RegExp(`/api/navigation/render/${f}`);let o=[s(i.documentId)];n&&(o=(await r.find({filters:{documentId:i.documentId}})).map(({documentId:c})=>s(c)));const u=strapi.plugin("rest-cache").service("cacheStore");return o.push(s(t)),await u.clearByRegexp(o),{success:!0}},async purgeNavigationsCache(){const n=strapi.plugin("rest-cache").service("cacheStore"),r=new RegExp("/api/navigation/render(.*)");return await n.clearByRegexp([r]),{success:!0}}}),ys=(e,t={},n=[])=>{const{title:r,related:i}=e,s=H.isArray(i)?H.last(i):i;if(r)return H.isString(r)&&!H.isEmpty(r)?r:void 0;if(s){const o=yw(s,t,n);return H.isString(o)&&!H.isEmpty(o)?o:void 0}},yw=(e,t={},n=[])=>{const{__contentType:r}=e,i=H.find(n,o=>o.contentTypeName===r),{default:s=[]}=t;return H.get(t,`${i?i.collectionName:""}`,s).map(o=>e[o]).filter(o=>o)[0]||""},vs=(e,t)=>{const n=Qu(e),r=t?n.filter(({path:s})=>s.includes(t)):n,i=r.find(({path:s})=>s===t);return{root:i,items:H.isNil(i)?[]:e.filter(({documentId:s})=>r.find(o=>o.documentId===s))}},Qu=(e,t,n=null)=>e.filter(r=>!r.parent==null&&!t?!0:r.parent?.documentId===t).reduce((r,i)=>{const s=`${n||""}/${i.path}`.replace("//","/");return[{documentId:i.documentId,parent:n&&i.parent?.documentId?{id:i.parent?.id,documentId:i.parent?.documentId,path:n}:void 0,path:s},...Qu(e,i.documentId,s),...r]},[]),vw=(e,t)=>{const n=H.zipWith(e,t,(r,i)=>H.isNil(r)?-1:H.isNil(i)?1:r-i);return H.find(n,r=>r!==0)||0},Ew=e=>({async readAll({locale:t,orderBy:n="createdAt",orderDirection:r="DESC"}){return Ne(e).find({locale:t,orderBy:{[n]:r}})},renderRFRNavigationItem({item:t}){const{uiRouterKey:n,title:r,path:i,type:s,audience:o,additionalFields:a}=t,u={label:r,type:s,audience:o?.map(({key:f})=>f),additionalFields:a};if(s==="WRAPPER")return{...u};if(s==="EXTERNAL")return Cs(i,new At("External navigation item's path is undefined",t)),{...u,url:i};if(s==="INTERNAL")return{...u,page:n};if(s==="WRAPPER")return{...u};throw new At("Unknown item type",t)},renderRFRPage({item:t,parent:n,enabledCustomFieldsNames:r}){const{documentId:i,uiRouterKey:s,title:o,path:a,related:u,type:f,audience:c,menuAttached:l,additionalFields:p}=t,d=r.reduce((h,m)=>({...h,[m]:p?.[m]}),{});return{id:s,documentId:i,title:o,related:f==="INTERNAL"&&u?.documentId&&u?.__type?{contentType:u.__type,documentId:u.documentId}:void 0,path:a,parent:n,audience:c,menuAttached:l,additionalFields:d}},renderRFR({items:t,parent:n,parentNavItem:r,contentTypes:i=[],enabledCustomFieldsNames:s}){const o=[];let a={},u={};return t.forEach(f=>{const{items:c,...l}=f,p=this.renderRFRNavigationItem({item:l}),d=this.renderRFRPage({item:l,parent:n,enabledCustomFieldsNames:s});if(f.type!=="EXTERNAL"&&(u={...u,[d.documentId]:{...d}}),f.menuAttached&&o.push(p),!n)a={...a,root:o};else{const h=o.filter(m=>m.type);H.isEmpty(h)||(a={...a,[n]:h.concat(r||[])})}if(!H.isEmpty(c)){const{nav:h}=this.renderRFR({items:c??[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:s}),{pages:m}=this.renderRFR({items:c||[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:s});u={...u,...m},a={...a,...h}}}),{pages:u,nav:a}},renderTree({items:t=[],documentId:n,path:r="",itemParser:i=s=>Promise.resolve(s)}){return Promise.all(t.reduce((s,o)=>(o.parent?.documentId===n&&s.push(i(H.cloneDeep(o),r)),s),[])).then(s=>s.sort((o,a)=>o.order!==void 0&&a.order!==void 0?o.order-a.order:0))},getCustomFields(t){return t.reduce((n,r)=>(r!=="audience"&&n.push(r),n),[])},async renderType({criteria:t={},filter:n,itemCriteria:r={},locale:i,populate:s,rootPath:o,type:a="FLAT",wrapRelated:u}){const f=oe(e,"admin"),c=oe(e,"common"),l={...t,visible:!0},p=Ne(e),d=Pe(e);let h;if(i?h=await p.find({filters:{...l},locale:i,limit:1}):h=await p.find({filters:l,limit:1}),H.isArray(h)&&(h=H.first(h)),h&&h.documentId){const m=await d.find({filters:{master:H.pick(h,["slug","id"]),...r},locale:i,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["audience","parent","related"]}),g=await c.mapToNavigationItemDTO({locale:i,master:h,navigationItems:m,populate:s}),{contentTypes:w,contentTypesNameFields:_,additionalFields:C}=await f.config({viaSettingsPage:!1}),T=this.getCustomFields(C).reduce((S,N)=>N.enabled?[...S,N.name]:S,[]),R=S=>u&&S?{documentId:S.documentId,...S}:S,F=["name","url","mime","width","height","previewUrl"],j=C.filter(S=>typeof S!="string"),x=S=>(N,v)=>{const M=j.find(({name:z})=>z===v);let B=S.additionalFields?.[v];if(B)switch(M?.type){case"media":B=H.pick(JSON.parse(B),F);break;case"boolean":B=B==="true";break}return{...N,[v]:B}};switch(a){case"TREE":case"RFR":const S=async($,D="")=>{const U=$.type==="EXTERNAL",K=U?void 0:`${D==="/"?"":D}/${H.first($.path)==="/"?$.path.substring(1):$.path}`,V=typeof K=="string"?await c.getSlug({query:(H.first(K)==="/"?K.substring(1):K).replace(/\//g,"-")}):void 0,J=H.isArray($.related)?H.last($.related):$.related,Se=R(J),I=T.reduce(x($),{});return{id:$.id,documentId:$.documentId,title:ys($,_,w)??"Title missing",menuAttached:$.menuAttached,order:$.order,path:(U?$.externalPath:K)??"Path is missing",type:$.type,uiRouterKey:$.uiRouterKey,slug:!V&&$.uiRouterKey?await c.getSlug({query:$.uiRouterKey}):V,related:U||!J?void 0:{...Se},audience:H.isEmpty($.audience)?void 0:$.audience,items:await this.renderTree({itemParser:S,path:K,documentId:$.documentId,items:g}),collapsed:$.collapsed,additionalFields:I||{}}},{items:N,root:v}=vs(g,o),M=await this.renderTree({itemParser:S,items:H.isNil(o)?g:N,path:v?.parent?.path,documentId:v?.parent?.documentId}),B=n?M.filter($=>$.uiRouterKey===n):M;return a==="RFR"?this.renderRFR({items:B,contentTypes:w.map($=>$.contentTypeName),enabledCustomFieldsNames:T}):B;default:const z=H.isNil(o)?g:vs(g,o).items,E=new Map,b=($,D=E)=>{const U=D.get($);if(!H.isNil(U))return U;const K=z.find(I=>I.documentId===$);if(H.isNil(K))return[];const{order:V,parent:J}=K,Se=J?b(J.documentId,D).concat(V):[V];return D.set($,Se),Se};return z.map($=>{const D=T.reduce(x($),{});return{...$,audience:$.audience?.map(U=>U.key),title:ys($,_,w)||"",related:R($.related),items:null,additionalFields:D}}).sort(($,D)=>vw(b($.documentId),b(D.documentId)))}}throw new kt.NotFoundError},renderChildren({childUIKey:t,idOrSlug:n,locale:r,menuOnly:i,type:s="FLAT",wrapRelated:o}){const a={$or:[{documentId:n},{slug:n}]},u=s==="FLAT"?void 0:t,f={...i&&{menuAttached:!0},...s==="FLAT"?{uiRouterKey:t}:{}};return this.renderType({type:s,criteria:a,itemCriteria:f,filter:u,wrapRelated:o,locale:r})},render({idOrSlug:t,locale:n,menuOnly:r,populate:i,rootPath:s,type:o="FLAT",wrapRelated:a}){const u={$or:[{documentId:t},{slug:t}]},f=r?{menuAttached:!0}:{};return this.renderType({type:o,criteria:u,itemCriteria:f,rootPath:s,wrapRelated:a,locale:n,populate:i})}}),ww=({checkData:e,parentItem:t})=>new Promise((n,r)=>{if(t&&t.items){for(let i of e)for(let s of t.items)if(s.path===i.path&&s.id!==i.id&&i.type==="INTERNAL")return r(new At(`Duplicate path:${i.path} in parent: ${t.title||"root"} for ${i.title} and ${s.title} items`,{parentTitle:t.title,parentId:t.id,path:i.path,errorTitles:[i.title,s.title]}))}return n()}),an={navigation:{},"navigation-item":{}},bw=e=>({async getPluginStore(){return await strapi.store({type:"plugin",name:"navigation"})},async mapToNavigationItemDTO({locale:t,master:n,navigationItems:r,parent:i,populate:s}){const o=[],u=await(await this.getPluginStore()).get({key:"config"}).then(De.parse),f=await Promise.all(r.map(async c=>{if(!c.related?.__type||!c.related.documentId)return c;const l=u.contentTypesPopulate[c.related.__type];if(!l?.length)return c;const d=await yn({strapi},c.related.__type).findById(c.related.documentId,l,"published",{locale:t});return{...c,related:{...d,__type:c.related.__type,documentId:c.related.documentId}}}));for(const c of f){const{items:l=[],...p}=c;o.push({...p,parent:i??p.parent,items:await this.mapToNavigationItemDTO({navigationItems:l,populate:s,master:n,parent:p,locale:t})})}return o},setDefaultConfig(){return $s({strapi})},getBranchName({item:t}){const n=!!t.documentId,r=t.removed;if(n&&!r)return"toUpdate";if(n&&r)return"toRemove";if(!n&&!r)return"toCreate"},async analyzeBranch({masterEntity:t,navigationItems:n=[],parentItem:r,prevAction:i={}}){const{toCreate:s,toRemove:o,toUpdate:a}=n.reduce((c,l)=>{const p=this.getBranchName({item:l});return p?{...c,[p]:[...c[p],l]}:c},{toRemove:[],toCreate:[],toUpdate:[]}),u={create:i.create||s.length>0,update:i.update||a.length>0,remove:i.remove||o.length>0},f=[...s,...a];return await ww({checkData:f,parentItem:r}),Promise.all([this.createBranch({action:u,masterEntity:t,navigationItems:s,parentItem:r}),this.removeBranch({navigationItems:o,action:u}),this.updateBranch({action:u,masterEntity:t,navigationItems:a,parentItem:r})]).then(([c,l,p])=>[...c,...l,...p])},async removeBranch({navigationItems:t=[],action:n={}}){const r=[];for(const i of t)i.documentId&&(n.remove=!0,await Pe(e).remove(i),r.push(n),i.items?.length&&(await this.removeBranch({navigationItems:i.items})).forEach(o=>{r.push(o)}));return r},async createBranch({action:t,masterEntity:n,navigationItems:r,parentItem:i}){let s=[];for(const o of r){t.create=!0;const{parent:a,master:u,items:f,documentId:c,id:l,...p}=o,d=c&&l?{...p,documentId:c,id:l,master:n?n.id:void 0,parent:i?i.id:void 0}:{...p,documentId:void 0,id:void 0,master:n?n.id:void 0,parent:i?i.id:void 0},h=await Pe(e).save({item:d,locale:n?.locale});if(o.items?.length){const m=await this.createBranch({action:{},masterEntity:n,navigationItems:o.items,parentItem:h});s=s.concat(m).concat([t])}else s.push(t)}return s},async updateBranch({masterEntity:t,navigationItems:n,action:r,parentItem:i}){const s=[];for(const o of n){r.update=!0;const{documentId:a,updated:u,parent:f,master:c,items:l,...p}=o;let d;u?d=await Pe(e).save({item:{documentId:a,...p},locale:t?.locale}):d=o,l?.length?(await this.analyzeBranch({navigationItems:l,prevAction:{},masterEntity:t,parentItem:d})).forEach(m=>{s.push(m)}):s.push(r)}return s},async emitEvent({entity:t,event:n,uid:r}){const i=strapi.getModel(r),s=await nw.sanitizers.defaultSanitizeOutput({...i,schema:i.__schema__,getModel:()=>i},t);strapi.webhookRunner?strapi.webhookRunner.eventHub.emit(n,{model:i.modelName,entry:s}):console.warn("Webhook runner not present. Contact with Strapi Navigation Plugin team.")},async pruneCustomFields({removedFields:t}){const n=t.map(({name:o})=>`additionalFields.${o}`),r=t.map(({name:o})=>o),s=(await Pe(e).find({filters:{additionalFields:{$contains:[r]}}})).map(o=>H.omit(o,n));for(const o of s)await Pe(e).save({item:{documentId:o.documentId,additionalFields:o.additionalFields}})},async getSlug({query:t}){let n=_c.default(t);if(n){const r=await Pe(e).count({$or:[{uiRouterKey:{$startsWith:n}},{uiRouterKey:n}]});r&&(n=`${n}-${r}`)}return n.toLowerCase()},registerLifeCycleHook({callback:t,contentTypeName:n,hookName:r}){an[n][r]||(an[n][r]=[]),an[n][r]?.push(t)},async runLifeCycleHook({contentTypeName:t,event:n,hookName:r}){const i=an[t][r]??[];for(const s of i)await s(n)},buildNestedStructure({navigationItems:t,id:n}){return t?.reduce((r,i)=>(n&&i.parent?.id!==n||r.push({...H.omit(i,["related","items"]),related:i.related,items:this.buildNestedStructure({navigationItems:t,id:i.id})}),r),[])??[]},async readLocale(){const t=strapi.plugin("i18n").service("locales");let n=await t.getDefaultLocale(),r=(await t.find({})).map(({code:i})=>i).filter(i=>i!==n);return n||(n=r[0],r=r.slice(1)),{defaultLocale:n,restLocale:r}}}),_w=e=>({async migrateRelatedIdToDocumentId(){console.log("Navigation plugin :: Migrations :: Relared id to document id - START");const t=Pe(e),n=await t.find({filters:{},limit:Number.MAX_SAFE_INTEGER});await Promise.all(n.map(async r=>{const i=r.related;if(i&&typeof i=="string"){const[s,o]=i.split(Wc);if(!H.isNaN(parseInt(o,10))){const a=await e.strapi.query(s).findOne({where:{id:o}});a&&await t.save({item:{documentId:r.documentId,related:{__type:s,documentId:a.documentId}}})}}})),console.log("Navigation plugin :: Migrations :: Relared id to document id - DONE")}}),xw={admin:gw,common:bw,client:Ew,migrate:_w},Sw={bootstrap:Ol,destroy:Nl,register:Pl,config:$r,controllers:Xl,contentTypes:Gl,middlewares:Zl,policies:Jl,routes:nf,services:xw};module.exports=Sw;