fjall 27.0.0 → 27.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/.build-source-hash +11 -11
- package/bin/.bundled +3 -3
- package/bin/.metafile.json +11 -16
- package/bin/assets/generators/account/generator.js +29 -29
- package/bin/assets/generators/application/generator.js +9 -9
- package/bin/assets/generators/cdn/generator.js +32 -32
- package/bin/assets/generators/compute/generator.js +32 -32
- package/bin/assets/generators/compute/service/generator.js +9 -9
- package/bin/assets/generators/database/generator.js +32 -32
- package/bin/assets/generators/database/proxy/generator.js +9 -9
- package/bin/assets/generators/domain/generator.js +31 -31
- package/bin/assets/generators/network/generator.js +9 -9
- package/bin/assets/generators/organisation/generator.js +24 -24
- package/bin/assets/generators/shared/files/package.json +2 -2
- package/bin/assets/generators/storage/s3/generator.js +32 -32
- package/bin/assets/generators/tunnel/generator.js +9 -9
- package/bin/fjall.bundle.js +474 -474
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __fjcreateRequire } from "module";
|
|
2
2
|
const require = __fjcreateRequire(import.meta.url);
|
|
3
3
|
|
|
4
|
-
var xG=Object.create;var Qd=Object.defineProperty;var AG=Object.getOwnPropertyDescriptor;var _G=Object.getOwnPropertyNames;var TG=Object.getPrototypeOf,CG=Object.prototype.hasOwnProperty;var Io=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var HD=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var P=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Ur=(e,t)=>{for(var r in t)Qd(e,r,{get:t[r],enumerable:!0})},JD=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of _G(t))!CG.call(e,n)&&n!==r&&Qd(e,n,{get:()=>t[n],enumerable:!(i=AG(t,n))||i.enumerable});return e};var ua=(e,t,r)=>(r=e!=null?xG(TG(e)):{},JD(t||!e||!e.__esModule?Qd(r,"default",{value:e,enumerable:!0}):r,e)),Q=e=>JD(Qd({},"__esModule",{value:!0}),e);var Zj=P((Sve,vh)=>{var bj,Sj,Ej,xj,Aj,_j,Tj,Cj,Ij,Dj,wj,kj,Nj,gh,h0,Pj,Rj,Oj,Ms,$j,jj,Mj,Fj,Lj,Uj,zj,Bj,Vj,yh,Gj,Wj,Kj;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){e(r(t,r(i)))}):typeof vh=="object"&&typeof vh.exports=="object"?e(r(t,r(vh.exports))):e(r(t));function r(i,n){return i!==t&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(a,o){return i[a]=n?n(a,o):o}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(a[s]=o[s])};bj=function(a,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(a,o);function s(){this.constructor=a}a.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)},Sj=Object.assign||function(a){for(var o,s=1,u=arguments.length;s<u;s++){o=arguments[s];for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(a[d]=o[d])}return a},Ej=function(a,o){var s={};for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&o.indexOf(u)<0&&(s[u]=a[u]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,u=Object.getOwnPropertySymbols(a);d<u.length;d++)o.indexOf(u[d])<0&&Object.prototype.propertyIsEnumerable.call(a,u[d])&&(s[u[d]]=a[u[d]]);return s},xj=function(a,o,s,u){var d=arguments.length,p=d<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,s):u,g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(a,o,s,u);else for(var h=a.length-1;h>=0;h--)(g=a[h])&&(p=(d<3?g(p):d>3?g(o,s,p):g(o,s))||p);return d>3&&p&&Object.defineProperty(o,s,p),p},Aj=function(a,o){return function(s,u){o(s,u,a)}},_j=function(a,o,s,u,d,p){function g(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var h=u.kind,l=h==="getter"?"get":h==="setter"?"set":"value",m=!o&&a?u.static?a:a.prototype:null,f=o||(m?Object.getOwnPropertyDescriptor(m,u.name):{}),y,v=!1,b=s.length-1;b>=0;b--){var A={};for(var x in u)A[x]=x==="access"?{}:u[x];for(var x in u.access)A.access[x]=u.access[x];A.addInitializer=function(C){if(v)throw new TypeError("Cannot add initializers after decoration has completed");p.push(g(C||null))};var _=(0,s[b])(h==="accessor"?{get:f.get,set:f.set}:f[l],A);if(h==="accessor"){if(_===void 0)continue;if(_===null||typeof _!="object")throw new TypeError("Object expected");(y=g(_.get))&&(f.get=y),(y=g(_.set))&&(f.set=y),(y=g(_.init))&&d.unshift(y)}else(y=g(_))&&(h==="field"?d.unshift(y):f[l]=y)}m&&Object.defineProperty(m,u.name,f),v=!0},Tj=function(a,o,s){for(var u=arguments.length>2,d=0;d<o.length;d++)s=u?o[d].call(a,s):o[d].call(a);return u?s:void 0},Cj=function(a){return typeof a=="symbol"?a:"".concat(a)},Ij=function(a,o,s){return typeof o=="symbol"&&(o=o.description?"[".concat(o.description,"]"):""),Object.defineProperty(a,"name",{configurable:!0,value:s?"".concat(s," ",o):o})},Dj=function(a,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,o)},wj=function(a,o,s,u){function d(p){return p instanceof s?p:new s(function(g){g(p)})}return new(s||(s=Promise))(function(p,g){function h(f){try{m(u.next(f))}catch(y){g(y)}}function l(f){try{m(u.throw(f))}catch(y){g(y)}}function m(f){f.done?p(f.value):d(f.value).then(h,l)}m((u=u.apply(a,o||[])).next())})},kj=function(a,o){var s={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},u,d,p,g=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g.next=h(0),g.throw=h(1),g.return=h(2),typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function h(m){return function(f){return l([m,f])}}function l(m){if(u)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(s=0)),s;)try{if(u=1,d&&(p=m[0]&2?d.return:m[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,m[1])).done)return p;switch(d=0,p&&(m=[m[0]&2,p.value]),m[0]){case 0:case 1:p=m;break;case 4:return s.label++,{value:m[1],done:!1};case 5:s.label++,d=m[1],m=[0];continue;case 7:m=s.ops.pop(),s.trys.pop();continue;default:if(p=s.trys,!(p=p.length>0&&p[p.length-1])&&(m[0]===6||m[0]===2)){s=0;continue}if(m[0]===3&&(!p||m[1]>p[0]&&m[1]<p[3])){s.label=m[1];break}if(m[0]===6&&s.label<p[1]){s.label=p[1],p=m;break}if(p&&s.label<p[2]){s.label=p[2],s.ops.push(m);break}p[2]&&s.ops.pop(),s.trys.pop();continue}m=o.call(a,s)}catch(f){m=[6,f],d=0}finally{u=p=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},Nj=function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&yh(o,a,s)},yh=Object.create?(function(a,o,s,u){u===void 0&&(u=s);var d=Object.getOwnPropertyDescriptor(o,s);(!d||("get"in d?!o.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(a,u,d)}):(function(a,o,s,u){u===void 0&&(u=s),a[u]=o[s]}),gh=function(a){var o=typeof Symbol=="function"&&Symbol.iterator,s=o&&a[o],u=0;if(s)return s.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&u>=a.length&&(a=void 0),{value:a&&a[u++],done:!a}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},h0=function(a,o){var s=typeof Symbol=="function"&&a[Symbol.iterator];if(!s)return a;var u=s.call(a),d,p=[],g;try{for(;(o===void 0||o-- >0)&&!(d=u.next()).done;)p.push(d.value)}catch(h){g={error:h}}finally{try{d&&!d.done&&(s=u.return)&&s.call(u)}finally{if(g)throw g.error}}return p},Pj=function(){for(var a=[],o=0;o<arguments.length;o++)a=a.concat(h0(arguments[o]));return a},Rj=function(){for(var a=0,o=0,s=arguments.length;o<s;o++)a+=arguments[o].length;for(var u=Array(a),d=0,o=0;o<s;o++)for(var p=arguments[o],g=0,h=p.length;g<h;g++,d++)u[d]=p[g];return u},Oj=function(a,o,s){if(s||arguments.length===2)for(var u=0,d=o.length,p;u<d;u++)(p||!(u in o))&&(p||(p=Array.prototype.slice.call(o,0,u)),p[u]=o[u]);return a.concat(p||Array.prototype.slice.call(o))},Ms=function(a){return this instanceof Ms?(this.v=a,this):new Ms(a)},$j=function(a,o,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u=s.apply(a,o||[]),d,p=[];return d=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),h("next"),h("throw"),h("return",g),d[Symbol.asyncIterator]=function(){return this},d;function g(b){return function(A){return Promise.resolve(A).then(b,y)}}function h(b,A){u[b]&&(d[b]=function(x){return new Promise(function(_,C){p.push([b,x,_,C])>1||l(b,x)})},A&&(d[b]=A(d[b])))}function l(b,A){try{m(u[b](A))}catch(x){v(p[0][3],x)}}function m(b){b.value instanceof Ms?Promise.resolve(b.value.v).then(f,y):v(p[0][2],b)}function f(b){l("next",b)}function y(b){l("throw",b)}function v(b,A){b(A),p.shift(),p.length&&l(p[0][0],p[0][1])}},jj=function(a){var o,s;return o={},u("next"),u("throw",function(d){throw d}),u("return"),o[Symbol.iterator]=function(){return this},o;function u(d,p){o[d]=a[d]?function(g){return(s=!s)?{value:Ms(a[d](g)),done:!1}:p?p(g):g}:p}},Mj=function(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=a[Symbol.asyncIterator],s;return o?o.call(a):(a=typeof gh=="function"?gh(a):a[Symbol.iterator](),s={},u("next"),u("throw"),u("return"),s[Symbol.asyncIterator]=function(){return this},s);function u(p){s[p]=a[p]&&function(g){return new Promise(function(h,l){g=a[p](g),d(h,l,g.done,g.value)})}}function d(p,g,h,l){Promise.resolve(l).then(function(m){p({value:m,done:h})},g)}},Fj=function(a,o){return Object.defineProperty?Object.defineProperty(a,"raw",{value:o}):a.raw=o,a};var r=Object.create?(function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}):function(a,o){a.default=o},i=function(a){return i=Object.getOwnPropertyNames||function(o){var s=[];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(s[s.length]=u);return s},i(a)};Lj=function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var s=i(a),u=0;u<s.length;u++)s[u]!=="default"&&yh(o,a,s[u]);return r(o,a),o},Uj=function(a){return a&&a.__esModule?a:{default:a}},zj=function(a,o,s,u){if(s==="a"&&!u)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?a!==o||!u:!o.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?u:s==="a"?u.call(a):u?u.value:o.get(a)},Bj=function(a,o,s,u,d){if(u==="m")throw new TypeError("Private method is not writable");if(u==="a"&&!d)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?a!==o||!d:!o.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u==="a"?d.call(a,s):d?d.value=s:o.set(a,s),s},Vj=function(a,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof a=="function"?o===a:a.has(o)},Gj=function(a,o,s){if(o!=null){if(typeof o!="object"&&typeof o!="function")throw new TypeError("Object expected.");var u,d;if(s){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");u=o[Symbol.asyncDispose]}if(u===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");u=o[Symbol.dispose],s&&(d=u)}if(typeof u!="function")throw new TypeError("Object not disposable.");d&&(u=function(){try{d.call(this)}catch(p){return Promise.reject(p)}}),a.stack.push({value:o,dispose:u,async:s})}else s&&a.stack.push({async:!0});return o};var n=typeof SuppressedError=="function"?SuppressedError:function(a,o,s){var u=new Error(s);return u.name="SuppressedError",u.error=a,u.suppressed=o,u};Wj=function(a){function o(p){a.error=a.hasError?new n(p,a.error,"An error was suppressed during disposal."):p,a.hasError=!0}var s,u=0;function d(){for(;s=a.stack.pop();)try{if(!s.async&&u===1)return u=0,a.stack.push(s),Promise.resolve().then(d);if(s.dispose){var p=s.dispose.call(s.value);if(s.async)return u|=2,Promise.resolve(p).then(d,function(g){return o(g),d()})}else u|=1}catch(g){o(g)}if(u===1)return a.hasError?Promise.reject(a.error):Promise.resolve();if(a.hasError)throw a.error}return d()},Kj=function(a,o){return typeof a=="string"&&/^\.\.?\//.test(a)?a.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(s,u,d,p,g){return u?o?".jsx":".js":d&&(!p||!g)?s:d+p+"."+g.toLowerCase()+"js"}):a},e("__extends",bj),e("__assign",Sj),e("__rest",Ej),e("__decorate",xj),e("__param",Aj),e("__esDecorate",_j),e("__runInitializers",Tj),e("__propKey",Cj),e("__setFunctionName",Ij),e("__metadata",Dj),e("__awaiter",wj),e("__generator",kj),e("__exportStar",Nj),e("__createBinding",yh),e("__values",gh),e("__read",h0),e("__spread",Pj),e("__spreadArrays",Rj),e("__spreadArray",Oj),e("__await",Ms),e("__asyncGenerator",$j),e("__asyncDelegator",jj),e("__asyncValues",Mj),e("__makeTemplateObject",Fj),e("__importStar",Lj),e("__importDefault",Uj),e("__classPrivateFieldGet",zj),e("__classPrivateFieldSet",Bj),e("__classPrivateFieldIn",Vj),e("__addDisposableResource",Gj),e("__disposeResources",Wj),e("__rewriteRelativeImportExtension",Kj)})});var ue={};Ur(ue,{__addDisposableResource:()=>W8,__assign:()=>y8,__asyncDelegator:()=>M8,__asyncGenerator:()=>j8,__asyncValues:()=>F8,__await:()=>$8,__awaiter:()=>C8,__classPrivateFieldGet:()=>B8,__classPrivateFieldIn:()=>G8,__classPrivateFieldSet:()=>V8,__createBinding:()=>w8,__decorate:()=>b8,__disposeResources:()=>K8,__esDecorate:()=>E8,__exportStar:()=>D8,__extends:()=>g8,__generator:()=>I8,__importDefault:()=>z8,__importStar:()=>U8,__makeTemplateObject:()=>L8,__metadata:()=>T8,__param:()=>S8,__propKey:()=>A8,__read:()=>N8,__rest:()=>v8,__rewriteRelativeImportExtension:()=>Z8,__runInitializers:()=>x8,__setFunctionName:()=>_8,__spread:()=>P8,__spreadArray:()=>O8,__spreadArrays:()=>R8,__values:()=>k8,default:()=>q8});var g0,g8,y8,v8,b8,S8,E8,x8,A8,_8,T8,C8,I8,D8,w8,k8,N8,P8,R8,O8,$8,j8,M8,F8,L8,U8,z8,B8,V8,G8,W8,K8,Z8,q8,le=HD(()=>{g0=ua(Zj(),1),{__extends:g8,__assign:y8,__rest:v8,__decorate:b8,__param:S8,__esDecorate:E8,__runInitializers:x8,__propKey:A8,__setFunctionName:_8,__metadata:T8,__awaiter:C8,__generator:I8,__exportStar:D8,__createBinding:w8,__values:k8,__read:N8,__spread:P8,__spreadArrays:R8,__spreadArray:O8,__await:$8,__asyncGenerator:j8,__asyncDelegator:M8,__asyncValues:F8,__makeTemplateObject:L8,__importStar:U8,__importDefault:z8,__classPrivateFieldGet:B8,__classPrivateFieldSet:V8,__classPrivateFieldIn:G8,__addDisposableResource:W8,__disposeResources:K8,__rewriteRelativeImportExtension:Z8}=g0.default,q8=g0.default});var Ae=P(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.maybeSetModuleExports=void 0;var H8=(le(),Q(ue)),J8=H8.__importDefault(Be());function X8(e){var t=e.use(J8.default),r=t.Type,i=t.builtInTypes,n=i.number;function a(d){return r.from(function(p){return n.check(p)&&p>=d},n+" >= "+d)}var o={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}},s=r.or(i.string,i.number,i.boolean,i.null,i.undefined),u=r.from(function(d){if(d===null)return!0;var p=typeof d;return!(p==="object"||p==="function")},s.toString());return{geq:a,defaults:o,isPrimitive:u}}yl.default=X8;function Y8(e){try{var t=e(),r=t.exports,i=r.default}catch{return}i&&i!==r&&typeof r=="object"&&(Object.assign(i,r,{default:i}),r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0}),t.exports=i)}yl.maybeSetModuleExports=Y8});var Be=P((Sl,Qj)=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.Def=void 0;var Fs=(le(),Q(ue)),Q8=Ae(),Yj=Object.prototype,Sh=Yj.toString,xr=Yj.hasOwnProperty,bl=(function(){function e(){}return e.prototype.assert=function(t,r){if(!this.check(t,r)){var i=v0(t);throw new Error(i+" does not match type "+this)}return!0},e.prototype.arrayOf=function(){var t=this;return new y0(t)},e})(),y0=(function(e){Fs.__extends(t,e);function t(r){var i=e.call(this)||this;return i.elemType=r,i.kind="ArrayType",i}return t.prototype.toString=function(){return"["+this.elemType+"]"},t.prototype.check=function(r,i){var n=this;return Array.isArray(r)&&r.every(function(a){return n.elemType.check(a,i)})},t})(bl),qj=(function(e){Fs.__extends(t,e);function t(r){var i=e.call(this)||this;return i.value=r,i.kind="IdentityType",i}return t.prototype.toString=function(){return String(this.value)},t.prototype.check=function(r,i){var n=r===this.value;return!n&&typeof i=="function"&&i(this,r),n},t})(bl),Hj=(function(e){Fs.__extends(t,e);function t(r){var i=e.call(this)||this;return i.fields=r,i.kind="ObjectType",i}return t.prototype.toString=function(){return"{ "+this.fields.join(", ")+" }"},t.prototype.check=function(r,i){return Sh.call(r)===Sh.call({})&&this.fields.every(function(n){return n.type.check(r[n.name],i)})},t})(bl),Jj=(function(e){Fs.__extends(t,e);function t(r){var i=e.call(this)||this;return i.types=r,i.kind="OrType",i}return t.prototype.toString=function(){return this.types.join(" | ")},t.prototype.check=function(r,i){return this.types.some(function(n){return n.check(r,!!i)})?!0:(typeof i=="function"&&i(this,r),!1)},t})(bl),vl=(function(e){Fs.__extends(t,e);function t(r,i){var n=e.call(this)||this;return n.name=r,n.predicate=i,n.kind="PredicateType",n}return t.prototype.toString=function(){return this.name},t.prototype.check=function(r,i){var n=this.predicate(r,i);return!n&&typeof i=="function"&&i(this,r),n},t})(bl),bh=(function(){function e(t,r){this.type=t,this.typeName=r,this.baseNames=[],this.ownFields=Object.create(null),this.allSupertypes=Object.create(null),this.supertypeList=[],this.allFields=Object.create(null),this.fieldNames=[],this.finalized=!1,this.buildable=!1,this.buildParams=[]}return e.prototype.isSupertypeOf=function(t){if(t instanceof e){if(this.finalized!==!0||t.finalized!==!0)throw new Error("");return xr.call(t.allSupertypes,this.typeName)}else throw new Error(t+" is not a Def")},e.prototype.checkAllFields=function(t,r){var i=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function n(a){var o=i[a],s=o.type,u=o.getValue(t);return s.check(u,r)}return t!==null&&typeof t=="object"&&Object.keys(i).every(n)},e.prototype.bases=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.baseNames;if(this.finalized){if(t.length!==i.length)throw new Error("");for(var n=0;n<t.length;n++)if(t[n]!==i[n])throw new Error("");return this}return t.forEach(function(a){i.indexOf(a)<0&&i.push(a)}),this},e})();Sl.Def=bh;var Xj=(function(){function e(t,r,i,n){this.name=t,this.type=r,this.defaultFn=i,this.hidden=!!n}return e.prototype.toString=function(){return JSON.stringify(this.name)+": "+this.type},e.prototype.getValue=function(t){var r=t[this.name];return typeof r<"u"||typeof this.defaultFn=="function"&&(r=this.defaultFn.call(t)),r},e})();function v0(e){return Array.isArray(e)?"["+e.map(v0).join(", ")+"]":e&&typeof e=="object"?"{ "+Object.keys(e).map(function(t){return t+": "+e[t]}).join(", ")+" }":JSON.stringify(e)}function e5(e){var t={or:function(){for(var U=[],V=0;V<arguments.length;V++)U[V]=arguments[V];return new Jj(U.map(function(B){return t.from(B)}))},from:function(U,V){if(U instanceof y0||U instanceof qj||U instanceof Hj||U instanceof Jj||U instanceof vl)return U;if(U instanceof bh)return U.type;if(s.check(U)){if(U.length!==1)throw new Error("only one element type is permitted for typed arrays");return new y0(t.from(U[0]))}if(u.check(U))return new Hj(Object.keys(U).map(function(J){return new Xj(J,t.from(U[J],J))}));if(typeof U=="function"){var B=r.indexOf(U);if(B>=0)return i[B];if(typeof V!="string")throw new Error("missing name");return new vl(V,U)}return new qj(U)},def:function(U){return xr.call(v,U)?v[U]:v[U]=new A(U)},hasDef:function(U){return xr.call(v,U)}},r=[],i=[];function n(U,V){var B=Sh.call(V),J=new vl(U,function(me){return Sh.call(me)===B});return V&&typeof V.constructor=="function"&&(r.push(V.constructor),i.push(J)),J}var a=n("string","truthy"),o=n("function",function(){}),s=n("array",[]),u=n("object",{}),d=n("RegExp",/./),p=n("Date",new Date),g=n("number",3),h=n("boolean",!0),l=n("null",null),m=n("undefined",void 0),f=typeof BigInt=="function"?n("BigInt",BigInt(1234)):new vl("BigInt",function(){return!1}),y={string:a,function:o,array:s,object:u,RegExp:d,Date:p,number:g,boolean:h,null:l,undefined:m,BigInt:f},v=Object.create(null);function b(U){if(U&&typeof U=="object"){var V=U.type;if(typeof V=="string"&&xr.call(v,V)){var B=v[V];if(B.finalized)return B}}return null}var A=(function(U){Fs.__extends(V,U);function V(B){var J=U.call(this,new vl(B,function(me,he){return J.check(me,he)}),B)||this;return J}return V.prototype.check=function(B,J){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(B===null||typeof B!="object")return!1;var me=b(B);return me?J&&me===this?this.checkAllFields(B,J):this.isSupertypeOf(me)?J?me.checkAllFields(B,J)&&this.checkAllFields(B,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(B,J):!1},V.prototype.build=function(){for(var B=this,J=[],me=0;me<arguments.length;me++)J[me]=arguments[me];if(this.buildParams=J,this.buildable)return this;this.field("type",String,function(){return B.typeName}),this.buildable=!0;var he=function(De,Pe,dr,pr){if(!xr.call(De,Pe)){var jt=B.allFields;if(!xr.call(jt,Pe))throw new Error(""+Pe);var mr=jt[Pe],Uc=mr.type,Fn;if(pr)Fn=dr;else if(mr.defaultFn)Fn=mr.defaultFn.call(De);else{var To="no value or default function given for field "+JSON.stringify(Pe)+" of "+B.typeName+"("+B.buildParams.map(function(Ln){return jt[Ln]}).join(", ")+")";throw new Error(To)}if(!Uc.check(Fn))throw new Error(v0(Fn)+" does not match field "+mr+" of type "+B.typeName);De[Pe]=Fn}},nt=function(){for(var De=[],Pe=0;Pe<arguments.length;Pe++)De[Pe]=arguments[Pe];var dr=De.length;if(!B.finalized)throw new Error("attempting to instantiate unfinalized type "+B.typeName);var pr=Object.create(R);if(B.buildParams.forEach(function(jt,mr){mr<dr?he(pr,jt,De[mr],!0):he(pr,jt,null,!1)}),Object.keys(B.allFields).forEach(function(jt){he(pr,jt,null,!1)}),pr.type!==B.typeName)throw new Error("");return pr};return nt.from=function(De){if(!B.finalized)throw new Error("attempting to instantiate unfinalized type "+B.typeName);var Pe=Object.create(R);if(Object.keys(B.allFields).forEach(function(dr){xr.call(De,dr)?he(Pe,dr,De[dr],!0):he(Pe,dr,null,!1)}),Pe.type!==B.typeName)throw new Error("");return Pe},Object.defineProperty(C,Y(this.typeName),{enumerable:!0,value:nt}),this},V.prototype.field=function(B,J,me,he){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(B)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[B]=new Xj(B,t.from(J),me,he),this)},V.prototype.finalize=function(){var B=this;if(!this.finalized){var J=this.allFields,me=this.allSupertypes;this.baseNames.forEach(function(nt){var De=v[nt];if(De instanceof bh)De.finalize(),Mn(J,De.allFields),Mn(me,De.allSupertypes);else{var Pe="unknown supertype name "+JSON.stringify(nt)+" for subtype "+JSON.stringify(B.typeName);throw new Error(Pe)}}),Mn(J,this.ownFields),me[this.typeName]=this,this.fieldNames.length=0;for(var he in J)xr.call(J,he)&&!J[he].hidden&&this.fieldNames.push(he);Object.defineProperty(Me,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,Lc(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&jn(this.typeName)}},V})(bh);function x(U){if(!xr.call(v,U))throw new Error("");var V=v[U];if(V.finalized!==!0)throw new Error("");return V.supertypeList.slice(1)}function _(U){for(var V={},B=Object.keys(v),J=B.length,me=0;me<J;++me){var he=B[me],nt=v[he];if(nt.finalized!==!0)throw new Error(""+he);for(var De=0;De<nt.supertypeList.length;++De){var Pe=nt.supertypeList[De];if(xr.call(U,Pe)){V[he]=Pe;break}}}return V}var C=Object.create(null),R={};function W(U,V){var B=R[U];return m.check(V)?delete R[U]:(o.assert(V),Object.defineProperty(R,U,{enumerable:!0,configurable:!0,value:V})),B}function Y(U){return U.replace(/^[A-Z]+/,function(V){var B=V.length;switch(B){case 0:return"";case 1:return V.toLowerCase();default:return V.slice(0,B-1).toLowerCase()+V.charAt(B-1)}})}function ve(U){return U=Y(U),U.replace(/(Expression)?$/,"Statement")}var Me={};function lr(U){var V=b(U);if(V)return V.fieldNames.slice(0);if("type"in U)throw new Error("did not recognize object of type "+JSON.stringify(U.type));return Object.keys(U)}function $n(U,V){var B=b(U);if(B){var J=B.allFields[V];if(J)return J.getValue(U)}return U&&U[V]}function _o(U,V,B){lr(U).forEach(function(J){V.call(this,J,$n(U,J))},B)}function sa(U,V,B){return lr(U).some(function(J){return V.call(this,J,$n(U,J))},B)}function jn(U){var V=ve(U);if(!C[V]){var B=C[Y(U)];if(B){var J=function(){for(var me=[],he=0;he<arguments.length;he++)me[he]=arguments[he];return C.expressionStatement(B.apply(C,me))};J.from=function(){for(var me=[],he=0;he<arguments.length;he++)me[he]=arguments[he];return C.expressionStatement(B.from.apply(C,me))},C[V]=J}}}function Lc(U,V){V.length=0,V.push(U);for(var B=Object.create(null),J=0;J<V.length;++J){U=V[J];var me=v[U];if(me.finalized!==!0)throw new Error("");xr.call(B,U)&&delete V[B[U]],B[U]=J,V.push.apply(V,me.baseNames)}for(var he=0,nt=he,De=V.length;nt<De;++nt)xr.call(V,nt)&&(V[he++]=V[nt]);V.length=he}function Mn(U,V){return Object.keys(V).forEach(function(B){U[B]=V[B]}),U}function xi(){Object.keys(v).forEach(function(U){v[U].finalize()})}return{Type:t,builtInTypes:y,getSupertypeNames:x,computeSupertypeLookupTable:_,builders:C,defineMethod:W,getBuilderName:Y,getStatementBuilderName:ve,namedTypes:Me,getFieldNames:lr,getFieldValue:$n,eachField:_o,someField:sa,finalize:xi}}Sl.default=e5;(0,Q8.maybeSetModuleExports)(function(){return Qj})});var S0=P((b0,eM)=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var t5=(le(),Q(ue)),r5=Ae(),n5=t5.__importDefault(Be()),i5=Object.prototype,Eh=i5.hasOwnProperty;function a5(e){var t=e.use(n5.default),r=t.builtInTypes.array,i=t.builtInTypes.number,n=function g(h,l,m){if(!(this instanceof g))throw new Error("Path constructor cannot be invoked without 'new'");if(l){if(!(l instanceof g))throw new Error("")}else l=null,m=null;this.value=h,this.parentPath=l,this.name=m,this.__childCache=null},a=n.prototype;function o(g){return g.__childCache||(g.__childCache=Object.create(null))}function s(g,h){var l=o(g),m=g.getValueProperty(h),f=l[h];return(!Eh.call(l,h)||f.value!==m)&&(f=l[h]=new g.constructor(m,g,h)),f}a.getValueProperty=function(h){return this.value[h]},a.get=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];for(var m=this,f=h.length,y=0;y<f;++y)m=s(m,h[y]);return m},a.each=function(h,l){for(var m=[],f=this.value.length,y=0,y=0;y<f;++y)Eh.call(this.value,y)&&(m[y]=this.get(y));for(l=l||this,y=0;y<f;++y)Eh.call(m,y)&&h.call(l,m[y])},a.map=function(h,l){var m=[];return this.each(function(f){m.push(h.call(this,f))},l),m},a.filter=function(h,l){var m=[];return this.each(function(f){h.call(this,f)&&m.push(f)},l),m};function u(){}function d(g,h,l,m){if(r.assert(g.value),h===0)return u;var f=g.value.length;if(f<1)return u;var y=arguments.length;y===2?(l=0,m=f):y===3?(l=Math.max(l,0),m=f):(l=Math.max(l,0),m=Math.min(m,f)),i.assert(l),i.assert(m);for(var v=Object.create(null),b=o(g),A=l;A<m;++A)if(Eh.call(g.value,A)){var x=g.get(A);if(x.name!==A)throw new Error("");var _=A+h;x.name=_,v[_]=x,delete b[A]}return delete b.length,function(){for(var C in v){var R=v[C];if(R.name!==+C)throw new Error("");b[C]=R,g.value[C]=R.value}}}a.shift=function(){var h=d(this,-1),l=this.value.shift();return h(),l},a.unshift=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];var m=d(this,h.length),f=this.value.unshift.apply(this.value,h);return m(),f},a.push=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];return r.assert(this.value),delete o(this).length,this.value.push.apply(this.value,h)},a.pop=function(){r.assert(this.value);var h=o(this);return delete h[this.value.length-1],delete h.length,this.value.pop()},a.insertAt=function(h){var l=arguments.length,m=d(this,l-1,h);if(m===u&&l<=1)return this;h=Math.max(h,0);for(var f=1;f<l;++f)this.value[h+f-1]=arguments[f];return m(),this},a.insertBefore=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];for(var m=this.parentPath,f=h.length,y=[this.name],v=0;v<f;++v)y.push(h[v]);return m.insertAt.apply(m,y)},a.insertAfter=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];for(var m=this.parentPath,f=h.length,y=[this.name+1],v=0;v<f;++v)y.push(h[v]);return m.insertAt.apply(m,y)};function p(g){if(!(g instanceof n))throw new Error("");var h=g.parentPath;if(!h)return g;var l=h.value,m=o(h);if(l[g.name]===g.value)m[g.name]=g;else if(r.check(l)){var f=l.indexOf(g.value);f>=0&&(m[g.name=f]=g)}else l[g.name]=g.value,m[g.name]=g;if(l[g.name]!==g.value)throw new Error("");if(g.parentPath.get(g.name)!==g)throw new Error("");return g}return a.replace=function(h){var l=[],m=this.parentPath.value,f=o(this.parentPath),y=arguments.length;if(p(this),r.check(m)){for(var v=m.length,b=d(this.parentPath,y-1,this.name+1),A=[this.name,1],x=0;x<y;++x)A.push(arguments[x]);var _=m.splice.apply(m,A);if(_[0]!==this.value)throw new Error("");if(m.length!==v-1+y)throw new Error("");if(b(),y===0)delete this.value,delete f[this.name],this.__childCache=null;else{if(m[this.name]!==h)throw new Error("");for(this.value!==h&&(this.value=h,this.__childCache=null),x=0;x<y;++x)l.push(this.parentPath.get(this.name+x));if(l[0]!==this)throw new Error("")}}else if(y===1)this.value!==h&&(this.__childCache=null),this.value=m[this.name]=h,l.push(this);else if(y===0)delete m[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return l},n}b0.default=a5;(0,r5.maybeSetModuleExports)(function(){return eM})});var rM=P((E0,tM)=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});var o5=(le(),Q(ue)),s5=Ae(),c5=o5.__importDefault(Be()),Ls=Object.prototype.hasOwnProperty;function u5(e){var t=e.use(c5.default),r=t.Type,i=t.namedTypes,n=i.Node,a=i.Expression,o=t.builtInTypes.array,s=t.builders,u=function x(_,C){if(!(this instanceof x))throw new Error("Scope constructor cannot be invoked without 'new'");p.check(_.value)||d.assert(_.value);var R;if(C){if(!(C instanceof x))throw new Error("");R=C.depth+1}else C=null,R=0;Object.defineProperties(this,{path:{value:_},node:{value:_.value},isGlobal:{value:!C,enumerable:!0},depth:{value:R},parent:{value:C},bindings:{value:{}},types:{value:{}}})},d=r.or(i.Program,i.Function,i.CatchClause),p=r.or(i.Function,i.ClassDeclaration,i.ClassExpression,i.InterfaceDeclaration,i.TSInterfaceDeclaration,i.TypeAlias,i.TSTypeAliasDeclaration),g=r.or(i.TypeParameter,i.TSTypeParameter);u.isEstablishedBy=function(x){return d.check(x)||p.check(x)};var h=u.prototype;h.didScan=!1,h.declares=function(x){return this.scan(),Ls.call(this.bindings,x)},h.declaresType=function(x){return this.scan(),Ls.call(this.types,x)},h.declareTemporary=function(x){if(x){if(!/^[a-z$_]/i.test(x))throw new Error("")}else x="t$";x+=this.depth.toString(36)+"$",this.scan();for(var _=0;this.declares(x+_);)++_;var C=x+_;return this.bindings[C]=t.builders.identifier(C)},h.injectTemporary=function(x,_){x||(x=this.declareTemporary());var C=this.path.get("body");return i.BlockStatement.check(C.value)&&(C=C.get("body")),C.unshift(s.variableDeclaration("var",[s.variableDeclarator(x,_||null)])),x},h.scan=function(x){if(x||!this.didScan){for(var _ in this.bindings)delete this.bindings[_];for(var _ in this.types)delete this.types[_];l(this.path,this.bindings,this.types),this.didScan=!0}},h.getBindings=function(){return this.scan(),this.bindings},h.getTypes=function(){return this.scan(),this.types};function l(x,_,C){var R=x.value;if(p.check(R)){var W=x.get("typeParameters","params");o.check(W.value)&&W.each(function(Y){A(Y,C)})}d.check(R)&&(i.CatchClause.check(R)?v(x.get("param"),_):m(x,_,C))}function m(x,_,C){var R=x.value;x.parent&&i.FunctionExpression.check(x.parent.node)&&x.parent.node.id&&v(x.parent.get("id"),_),R&&(o.check(R)?x.each(function(W){y(W,_,C)}):i.Function.check(R)?(x.get("params").each(function(W){v(W,_)}),y(x.get("body"),_,C),m(x.get("typeParameters"),_,C)):i.TypeAlias&&i.TypeAlias.check(R)||i.InterfaceDeclaration&&i.InterfaceDeclaration.check(R)||i.TSTypeAliasDeclaration&&i.TSTypeAliasDeclaration.check(R)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(R)?b(x.get("id"),C):i.VariableDeclarator.check(R)?(v(x.get("id"),_),y(x.get("init"),_,C)):R.type==="ImportSpecifier"||R.type==="ImportNamespaceSpecifier"||R.type==="ImportDefaultSpecifier"?v(x.get(R.local?"local":R.name?"name":"id"),_):n.check(R)&&!a.check(R)&&t.eachField(R,function(W,Y){var ve=x.get(W);if(!f(ve,Y))throw new Error("");y(ve,_,C)}))}function f(x,_){return!!(x.value===_||Array.isArray(x.value)&&x.value.length===0&&Array.isArray(_)&&_.length===0)}function y(x,_,C){var R=x.value;if(!(!R||a.check(R)))if(i.FunctionDeclaration.check(R)&&R.id!==null)v(x.get("id"),_);else if(i.ClassDeclaration&&i.ClassDeclaration.check(R)&&R.id!==null)v(x.get("id"),_),m(x.get("typeParameters"),_,C);else if(i.InterfaceDeclaration&&i.InterfaceDeclaration.check(R)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(R))b(x.get("id"),C);else if(d.check(R)){if(i.CatchClause.check(R)&&i.Identifier.check(R.param)){var W=R.param.name,Y=Ls.call(_,W);m(x.get("body"),_,C),Y||delete _[W]}}else m(x,_,C)}function v(x,_){var C=x.value;i.Pattern.assert(C),i.Identifier.check(C)?Ls.call(_,C.name)?_[C.name].push(x):_[C.name]=[x]:i.AssignmentPattern&&i.AssignmentPattern.check(C)?v(x.get("left"),_):i.ObjectPattern&&i.ObjectPattern.check(C)?x.get("properties").each(function(R){var W=R.value;i.Pattern.check(W)?v(R,_):i.Property.check(W)||i.ObjectProperty&&i.ObjectProperty.check(W)?v(R.get("value"),_):i.SpreadProperty&&i.SpreadProperty.check(W)&&v(R.get("argument"),_)}):i.ArrayPattern&&i.ArrayPattern.check(C)?x.get("elements").each(function(R){var W=R.value;i.Pattern.check(W)?v(R,_):i.SpreadElement&&i.SpreadElement.check(W)&&v(R.get("argument"),_)}):i.PropertyPattern&&i.PropertyPattern.check(C)?v(x.get("pattern"),_):(i.SpreadElementPattern&&i.SpreadElementPattern.check(C)||i.RestElement&&i.RestElement.check(C)||i.SpreadPropertyPattern&&i.SpreadPropertyPattern.check(C))&&v(x.get("argument"),_)}function b(x,_){var C=x.value;i.Pattern.assert(C),i.Identifier.check(C)&&(Ls.call(_,C.name)?_[C.name].push(x):_[C.name]=[x])}function A(x,_){var C=x.value;g.assert(C),Ls.call(_,C.name)?_[C.name].push(x):_[C.name]=[x]}return h.lookup=function(x){for(var _=this;_&&!_.declares(x);_=_.parent);return _},h.lookupType=function(x){for(var _=this;_&&!_.declaresType(x);_=_.parent);return _},h.getGlobalScope=function(){for(var x=this;!x.isGlobal;)x=x.parent;return x},u}E0.default=u5;(0,s5.maybeSetModuleExports)(function(){return tM})});var _0=P((A0,nM)=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});var x0=(le(),Q(ue)),l5=x0.__importDefault(Be()),d5=x0.__importDefault(S0()),p5=x0.__importDefault(rM()),m5=Ae();function f5(e){var t=e.use(l5.default),r=t.namedTypes,i=t.builders,n=t.builtInTypes.number,a=t.builtInTypes.array,o=e.use(d5.default),s=e.use(p5.default),u=function v(b,A,x){if(!(this instanceof v))throw new Error("NodePath constructor cannot be invoked without 'new'");o.call(this,b,A,x)},d=u.prototype=Object.create(o.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(d,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),d.replace=function(){return delete this.node,delete this.parent,delete this.scope,o.prototype.replace.apply(this,arguments)},d.prune=function(){var v=this.parent;return this.replace(),f(v)},d._computeNode=function(){var v=this.value;if(r.Node.check(v))return v;var b=this.parentPath;return b&&b.node||null},d._computeParent=function(){var v=this.value,b=this.parentPath;if(!r.Node.check(v)){for(;b&&!r.Node.check(b.value);)b=b.parentPath;b&&(b=b.parentPath)}for(;b&&!r.Node.check(b.value);)b=b.parentPath;return b||null},d._computeScope=function(){var v=this.value,b=this.parentPath,A=b&&b.scope;return r.Node.check(v)&&s.isEstablishedBy(v)&&(A=new s(this,A)),A||null},d.getValueProperty=function(v){return t.getFieldValue(this.value,v)},d.needsParens=function(v){var b=this.parentPath;if(!b)return!1;var A=this.value;if(!r.Expression.check(A)||A.type==="Identifier")return!1;for(;!r.Node.check(b.value);)if(b=b.parentPath,!b)return!1;var x=b.value;switch(A.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return x.type==="MemberExpression"&&this.name==="object"&&x.object===A;case"BinaryExpression":case"LogicalExpression":switch(x.type){case"CallExpression":return this.name==="callee"&&x.callee===A;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&x.object===A;case"BinaryExpression":case"LogicalExpression":{var _=A,C=x.operator,R=h[C],W=_.operator,Y=h[W];if(R>Y)return!0;if(R===Y&&this.name==="right"){if(x.right!==_)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(x.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(x.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return x.type==="MemberExpression"&&n.check(A.value)&&this.name==="object"&&x.object===A;case"AssignmentExpression":case"ConditionalExpression":switch(x.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&x.callee===A;case"ConditionalExpression":return this.name==="test"&&x.test===A;case"MemberExpression":return this.name==="object"&&x.object===A;default:return!1}default:if(x.type==="NewExpression"&&this.name==="callee"&&x.callee===A)return l(A)}return!!(v!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function p(v){return r.BinaryExpression.check(v)||r.LogicalExpression.check(v)}function g(v){return r.UnaryExpression.check(v)||r.SpreadElement&&r.SpreadElement.check(v)||r.SpreadProperty&&r.SpreadProperty.check(v)}var h={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(v,b){v.forEach(function(A){h[A]=b})});function l(v){return r.CallExpression.check(v)?!0:a.check(v)?v.some(l):r.Node.check(v)?t.someField(v,function(b,A){return l(A)}):!1}d.canBeFirstInStatement=function(){var v=this.node;return!r.FunctionExpression.check(v)&&!r.ObjectExpression.check(v)},d.firstInStatement=function(){return m(this)};function m(v){for(var b,A;v.parent;v=v.parent){if(b=v.node,A=v.parent.node,r.BlockStatement.check(A)&&v.parent.name==="body"&&v.name===0){if(A.body[0]!==b)throw new Error("Nodes must be equal");return!0}if(r.ExpressionStatement.check(A)&&v.name==="expression"){if(A.expression!==b)throw new Error("Nodes must be equal");return!0}if(r.SequenceExpression.check(A)&&v.parent.name==="expressions"&&v.name===0){if(A.expressions[0]!==b)throw new Error("Nodes must be equal");continue}if(r.CallExpression.check(A)&&v.name==="callee"){if(A.callee!==b)throw new Error("Nodes must be equal");continue}if(r.MemberExpression.check(A)&&v.name==="object"){if(A.object!==b)throw new Error("Nodes must be equal");continue}if(r.ConditionalExpression.check(A)&&v.name==="test"){if(A.test!==b)throw new Error("Nodes must be equal");continue}if(p(A)&&v.name==="left"){if(A.left!==b)throw new Error("Nodes must be equal");continue}if(r.UnaryExpression.check(A)&&!A.prefix&&v.name==="argument"){if(A.argument!==b)throw new Error("Nodes must be equal");continue}return!1}return!0}function f(v){if(r.VariableDeclaration.check(v.node)){var b=v.get("declarations").value;if(!b||b.length===0)return v.prune()}else if(r.ExpressionStatement.check(v.node)){if(!v.get("expression").value)return v.prune()}else r.IfStatement.check(v.node)&&y(v);return v}function y(v){var b=v.get("test").value,A=v.get("alternate").value,x=v.get("consequent").value;if(!x&&!A){var _=i.expressionStatement(b);v.replace(_)}else if(!x&&A){var C=i.unaryExpression("!",b,!0);r.UnaryExpression.check(b)&&b.operator==="!"&&(C=b.argument),v.get("test").replace(C),v.get("consequent").replace(A),v.get("alternate").replace()}}return u}A0.default=f5;(0,m5.maybeSetModuleExports)(function(){return nM})});var oM=P((T0,aM)=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});var iM=(le(),Q(ue)),h5=iM.__importDefault(Be()),g5=iM.__importDefault(_0()),y5=Ae(),xh=Object.prototype.hasOwnProperty;function v5(e){var t=e.use(h5.default),r=e.use(g5.default),i=t.builtInTypes.array,n=t.builtInTypes.object,a=t.builtInTypes.function,o,s=function m(){if(!(this instanceof m))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=u(this),this._shouldVisitComments=xh.call(this._methodNameTable,"Block")||xh.call(this._methodNameTable,"Line"),this.Context=h(this),this._visiting=!1,this._changeReported=!1};function u(m){var f=Object.create(null);for(var y in m)/^visit[A-Z]/.test(y)&&(f[y.slice(5)]=!0);for(var v=t.computeSupertypeLookupTable(f),b=Object.create(null),A=Object.keys(v),x=A.length,_=0;_<x;++_){var C=A[_];y="visit"+v[C],a.check(m[y])&&(b[C]=y)}return b}s.fromMethodsObject=function(f){if(f instanceof s)return f;if(!n.check(f))return new s;var y=function b(){if(!(this instanceof b))throw new Error("Visitor constructor cannot be invoked without 'new'");s.call(this)},v=y.prototype=Object.create(p);return v.constructor=y,d(v,f),d(y,s),a.assert(y.fromMethodsObject),a.assert(y.visit),new y};function d(m,f){for(var y in f)xh.call(f,y)&&(m[y]=f[y]);return m}s.visit=function(f,y){return s.fromMethodsObject(y).visit(f)};var p=s.prototype;p.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var m=arguments.length,f=new Array(m),y=0;y<m;++y)f[y]=arguments[y];f[0]instanceof r||(f[0]=new r({root:f[0]}).get("root")),this.reset.apply(this,f);var v;try{var b=this.visitWithoutReset(f[0]);v=!0}finally{if(this._visiting=!1,!v&&this._abortRequested)return f[0].value}return b},p.AbortRequest=function(){},p.abort=function(){var m=this;m._abortRequested=!0;var f=new m.AbortRequest;throw f.cancel=function(){m._abortRequested=!1},f},p.reset=function(m){},p.visitWithoutReset=function(m){if(this instanceof this.Context)return this.visitor.visitWithoutReset(m);if(!(m instanceof r))throw new Error("");var f=m.value,y=f&&typeof f=="object"&&typeof f.type=="string"&&this._methodNameTable[f.type];if(y){var v=this.acquireContext(m);try{return v.invokeVisitorMethod(y)}finally{this.releaseContext(v)}}else return g(m,this)};function g(m,f){if(!(m instanceof r))throw new Error("");if(!(f instanceof s))throw new Error("");var y=m.value;if(i.check(y))m.each(f.visitWithoutReset,f);else if(n.check(y)){var v=t.getFieldNames(y);f._shouldVisitComments&&y.comments&&v.indexOf("comments")<0&&v.push("comments");for(var b=v.length,A=[],x=0;x<b;++x){var _=v[x];xh.call(y,_)||(y[_]=t.getFieldValue(y,_)),A.push(m.get(_))}for(var x=0;x<b;++x)f.visitWithoutReset(A[x])}return m.value}p.acquireContext=function(m){return this._reusableContextStack.length===0?new this.Context(m):this._reusableContextStack.pop().reset(m)},p.releaseContext=function(m){if(!(m instanceof this.Context))throw new Error("");this._reusableContextStack.push(m),m.currentPath=null},p.reportChanged=function(){this._changeReported=!0},p.wasChangeReported=function(){return this._changeReported};function h(m){function f(v){if(!(this instanceof f))throw new Error("");if(!(this instanceof s))throw new Error("");if(!(v instanceof r))throw new Error("");Object.defineProperty(this,"visitor",{value:m,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=v,this.needToCallTraverse=!0,Object.seal(this)}if(!(m instanceof s))throw new Error("");var y=f.prototype=Object.create(m);return y.constructor=f,d(y,l),f}var l=Object.create(null);return l.reset=function(f){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");return this.currentPath=f,this.needToCallTraverse=!0,this},l.invokeVisitorMethod=function(f){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");var y=this.visitor[f].call(this,this.currentPath);if(y===!1?this.needToCallTraverse=!1:y!==o&&(this.currentPath=this.currentPath.replace(y)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+f);var v=this.currentPath;return v&&v.value},l.traverse=function(f,y){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");return this.needToCallTraverse=!1,g(f,s.fromMethodsObject(y||this.visitor))},l.visit=function(f,y){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");return this.needToCallTraverse=!1,s.fromMethodsObject(y||this.visitor).visitWithoutReset(f)},l.reportChanged=function(){this.visitor.reportChanged()},l.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},s}T0.default=v5;(0,y5.maybeSetModuleExports)(function(){return aM})});var cM=P((C0,sM)=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});var b5=(le(),Q(ue)),S5=Ae(),E5=b5.__importDefault(Be());function x5(e){var t=e.use(E5.default),r=t.getFieldNames,i=t.getFieldValue,n=t.builtInTypes.array,a=t.builtInTypes.object,o=t.builtInTypes.Date,s=t.builtInTypes.RegExp,u=Object.prototype.hasOwnProperty;function d(m,f,y){return n.check(y)?y.length=0:y=null,g(m,f,y)}d.assert=function(m,f){var y=[];if(!d(m,f,y))if(y.length===0){if(m!==f)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+y.map(p).join(""))};function p(m){return/[_$a-z][_$a-z0-9]*/i.test(m)?"."+m:"["+JSON.stringify(m)+"]"}function g(m,f,y){return m===f?!0:n.check(m)?h(m,f,y):a.check(m)?l(m,f,y):o.check(m)?o.check(f)&&+m==+f:s.check(m)?s.check(f)&&m.source===f.source&&m.global===f.global&&m.multiline===f.multiline&&m.ignoreCase===f.ignoreCase:m==f}function h(m,f,y){n.assert(m);var v=m.length;if(!n.check(f)||f.length!==v)return y&&y.push("length"),!1;for(var b=0;b<v;++b){if(y&&y.push(b),b in m!=b in f||!g(m[b],f[b],y))return!1;if(y){var A=y.pop();if(A!==b)throw new Error(""+A)}}return!0}function l(m,f,y){if(a.assert(m),!a.check(f))return!1;if(m.type!==f.type)return y&&y.push("type"),!1;var v=r(m),b=v.length,A=r(f),x=A.length;if(b===x){for(var _=0;_<b;++_){var C=v[_],R=i(m,C),W=i(f,C);if(y&&y.push(C),!g(R,W,y))return!1;if(y){var Y=y.pop();if(Y!==C)throw new Error(""+Y)}}return!0}if(!y)return!1;var ve=Object.create(null);for(_=0;_<b;++_)ve[v[_]]=!0;for(_=0;_<x;++_){if(C=A[_],!u.call(ve,C))return y.push(C),!1;delete ve[C]}for(C in ve){y.push(C);break}return!1}return d}C0.default=x5;(0,S5.maybeSetModuleExports)(function(){return sM})});var lM=P((I0,uM)=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});var El=(le(),Q(ue)),A5=El.__importDefault(Be()),_5=El.__importDefault(oM()),T5=El.__importDefault(cM()),C5=El.__importDefault(S0()),I5=El.__importDefault(_0()),D5=Ae();function w5(e){var t=k5(),r=t.use(A5.default);e.forEach(t.use),r.finalize();var i=t.use(_5.default);return{Type:r.Type,builtInTypes:r.builtInTypes,namedTypes:r.namedTypes,builders:r.builders,defineMethod:r.defineMethod,getFieldNames:r.getFieldNames,getFieldValue:r.getFieldValue,eachField:r.eachField,someField:r.someField,getSupertypeNames:r.getSupertypeNames,getBuilderName:r.getBuilderName,astNodesAreEquivalent:t.use(T5.default),finalize:r.finalize,Path:t.use(C5.default),NodePath:t.use(I5.default),PathVisitor:i,use:t.use,visit:i.visit}}I0.default=w5;function k5(){var e=[],t=[];function r(n){var a=e.indexOf(n);return a===-1&&(a=e.length,e.push(n),t[a]=n(i)),t[a]}var i={use:r};return i}(0,D5.maybeSetModuleExports)(function(){return uM})});var w0=P((D0,dM)=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});var N5=Ae();function P5(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}D0.default=P5;(0,N5.maybeSetModuleExports)(function(){return dM})});var N0=P((k0,pM)=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});var R5=(le(),Q(ue)),O5=Ae(),$5=R5.__importDefault(w0());function j5(e){var t=e.use($5.default);return t.BinaryOperators.indexOf("**")<0&&t.BinaryOperators.push("**"),t.AssignmentOperators.indexOf("**=")<0&&t.AssignmentOperators.push("**="),t}k0.default=j5;(0,O5.maybeSetModuleExports)(function(){return pM})});var R0=P((P0,mM)=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});var M5=(le(),Q(ue)),F5=Ae(),L5=M5.__importDefault(N0());function U5(e){var t=e.use(L5.default);return t.LogicalOperators.indexOf("??")<0&&t.LogicalOperators.push("??"),t}P0.default=U5;(0,F5.maybeSetModuleExports)(function(){return mM})});var hM=P((O0,fM)=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});var z5=(le(),Q(ue)),B5=Ae(),V5=z5.__importDefault(R0());function G5(e){var t=e.use(V5.default);return t.LogicalOperators.forEach(function(r){var i=r+"=";t.AssignmentOperators.indexOf(i)<0&&t.AssignmentOperators.push(i)}),t}O0.default=G5;(0,B5.maybeSetModuleExports)(function(){return fM})});var vM=P((j0,yM)=>{"use strict";Object.defineProperty(j0,"__esModule",{value:!0});var $0=(le(),Q(ue)),W5=$0.__importDefault(w0()),K5=$0.__importDefault(Be()),gM=$0.__importStar(Ae());function Z5(e){var t=e.use(K5.default),r=t.Type,i=r.def,n=r.or,a=e.use(gM.default),o=a.defaults,s=a.geq,u=e.use(W5.default),d=u.BinaryOperators,p=u.AssignmentOperators,g=u.LogicalOperators;i("Printable").field("loc",n(i("SourceLocation"),null),o.null,!0),i("Node").bases("Printable").field("type",String).field("comments",n([i("Comment")],null),o.null,!0),i("SourceLocation").field("start",i("Position")).field("end",i("Position")).field("source",n(String,null),o.null),i("Position").field("line",s(1)).field("column",s(0)),i("File").bases("Node").build("program","name").field("program",i("Program")).field("name",n(String,null),o.null),i("Program").bases("Node").build("body").field("body",[i("Statement")]),i("Function").bases("Node").field("id",n(i("Identifier"),null),o.null).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("generator",Boolean,o.false).field("async",Boolean,o.false),i("Statement").bases("Node"),i("EmptyStatement").bases("Statement").build(),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]),i("ExpressionStatement").bases("Statement").build("expression").field("expression",i("Expression")),i("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Statement")).field("alternate",n(i("Statement"),null),o.null),i("LabeledStatement").bases("Statement").build("label","body").field("label",i("Identifier")).field("body",i("Statement")),i("BreakStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("ContinueStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("WithStatement").bases("Statement").build("object","body").field("object",i("Expression")).field("body",i("Statement")),i("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",i("Expression")).field("cases",[i("SwitchCase")]).field("lexical",Boolean,o.false),i("ReturnStatement").bases("Statement").build("argument").field("argument",n(i("Expression"),null)),i("ThrowStatement").bases("Statement").build("argument").field("argument",i("Expression")),i("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",i("BlockStatement")).field("handler",n(i("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[i("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[i("CatchClause")],o.emptyArray).field("finalizer",n(i("BlockStatement"),null),o.null),i("CatchClause").bases("Node").build("param","guard","body").field("param",i("Pattern")).field("guard",n(i("Expression"),null),o.null).field("body",i("BlockStatement")),i("WhileStatement").bases("Statement").build("test","body").field("test",i("Expression")).field("body",i("Statement")),i("DoWhileStatement").bases("Statement").build("body","test").field("body",i("Statement")).field("test",i("Expression")),i("ForStatement").bases("Statement").build("init","test","update","body").field("init",n(i("VariableDeclaration"),i("Expression"),null)).field("test",n(i("Expression"),null)).field("update",n(i("Expression"),null)).field("body",i("Statement")),i("ForInStatement").bases("Statement").build("left","right","body").field("left",n(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("DebuggerStatement").bases("Statement").build(),i("Declaration").bases("Statement"),i("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",i("Identifier")),i("FunctionExpression").bases("Function","Expression").build("id","params","body"),i("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",n("var","let","const")).field("declarations",[i("VariableDeclarator")]),i("VariableDeclarator").bases("Node").build("id","init").field("id",i("Pattern")).field("init",n(i("Expression"),null),o.null),i("Expression").bases("Node"),i("ThisExpression").bases("Expression").build(),i("ArrayExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),null)]),i("ObjectExpression").bases("Expression").build("properties").field("properties",[i("Property")]),i("Property").bases("Node").build("kind","key","value").field("kind",n("init","get","set")).field("key",n(i("Literal"),i("Identifier"))).field("value",i("Expression")),i("SequenceExpression").bases("Expression").build("expressions").field("expressions",[i("Expression")]);var h=n("-","+","!","~","typeof","void","delete");i("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",h).field("argument",i("Expression")).field("prefix",Boolean,o.true);var l=n.apply(void 0,d);i("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",l).field("left",i("Expression")).field("right",i("Expression"));var m=n.apply(void 0,p);i("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",m).field("left",n(i("Pattern"),i("MemberExpression"))).field("right",i("Expression"));var f=n("++","--");i("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",i("Expression")).field("prefix",Boolean);var y=n.apply(void 0,g);i("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",y).field("left",i("Expression")).field("right",i("Expression")),i("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Expression")).field("alternate",i("Expression")),i("NewExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("CallExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("MemberExpression").bases("Expression").build("object","property","computed").field("object",i("Expression")).field("property",n(i("Identifier"),i("Expression"))).field("computed",Boolean,function(){var v=this.property.type;return v==="Literal"||v==="MemberExpression"||v==="BinaryExpression"}),i("Pattern").bases("Node"),i("SwitchCase").bases("Node").build("test","consequent").field("test",n(i("Expression"),null)).field("consequent",[i("Statement")]),i("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,o.false),i("Literal").bases("Expression").build("value").field("value",n(String,Boolean,null,Number,RegExp,BigInt)),i("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}j0.default=Z5;(0,gM.maybeSetModuleExports)(function(){return yM})});var EM=P((F0,SM)=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});var M0=(le(),Q(ue)),q5=M0.__importDefault(vM()),H5=M0.__importDefault(Be()),bM=M0.__importStar(Ae());function J5(e){e.use(q5.default);var t=e.use(H5.default),r=t.Type.def,i=t.Type.or,n=e.use(bM.default).defaults;r("Function").field("generator",Boolean,n.false).field("expression",Boolean,n.false).field("defaults",[i(r("Expression"),null)],n.emptyArray).field("rest",i(r("Identifier"),null),n.null),r("RestElement").bases("Pattern").build("argument").field("argument",r("Pattern")).field("typeAnnotation",i(r("TypeAnnotation"),r("TSTypeAnnotation"),null),n.null),r("SpreadElementPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("FunctionDeclaration").build("id","params","body","generator","expression").field("id",i(r("Identifier"),null)),r("FunctionExpression").build("id","params","body","generator","expression"),r("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,n.null).field("body",i(r("BlockStatement"),r("Expression"))).field("generator",!1,n.false),r("ForOfStatement").bases("Statement").build("left","right","body").field("left",i(r("VariableDeclaration"),r("Pattern"))).field("right",r("Expression")).field("body",r("Statement")),r("YieldExpression").bases("Expression").build("argument","delegate").field("argument",i(r("Expression"),null)).field("delegate",Boolean,n.false),r("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionBlock").bases("Node").build("left","right","each").field("left",r("Pattern")).field("right",r("Expression")).field("each",Boolean),r("Property").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("value",i(r("Expression"),r("Pattern"))).field("method",Boolean,n.false).field("shorthand",Boolean,n.false).field("computed",Boolean,n.false),r("ObjectProperty").field("shorthand",Boolean,n.false),r("PropertyPattern").bases("Pattern").build("key","pattern").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("pattern",r("Pattern")).field("computed",Boolean,n.false),r("ObjectPattern").bases("Pattern").build("properties").field("properties",[i(r("PropertyPattern"),r("Property"))]),r("ArrayPattern").bases("Pattern").build("elements").field("elements",[i(r("Pattern"),null)]),r("SpreadElement").bases("Node").build("argument").field("argument",r("Expression")),r("ArrayExpression").field("elements",[i(r("Expression"),r("SpreadElement"),r("RestElement"),null)]),r("NewExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("CallExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("AssignmentPattern").bases("Pattern").build("left","right").field("left",r("Pattern")).field("right",r("Expression")),r("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",i("constructor","method","get","set")).field("key",r("Expression")).field("value",r("Function")).field("computed",Boolean,n.false).field("static",Boolean,n.false);var a=i(r("MethodDefinition"),r("VariableDeclarator"),r("ClassPropertyDefinition"),r("ClassProperty"),r("StaticBlock"));r("ClassProperty").bases("Declaration").build("key").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("computed",Boolean,n.false),r("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",a),r("ClassBody").bases("Declaration").build("body").field("body",[a]),r("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",i(r("Identifier"),null)).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),n.null),r("ClassExpression").bases("Expression").build("id","body","superClass").field("id",i(r("Identifier"),null),n.null).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),n.null),r("Super").bases("Expression").build(),r("Specifier").bases("Node"),r("ModuleSpecifier").bases("Specifier").field("local",i(r("Identifier"),null),n.null).field("id",i(r("Identifier"),null),n.null).field("name",i(r("Identifier"),null),n.null),r("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",r("Identifier")),r("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),r("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),r("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[i(r("ImportSpecifier"),r("ImportNamespaceSpecifier"),r("ImportDefaultSpecifier"))],n.emptyArray).field("source",r("Literal")).field("importKind",i("value","type"),function(){return"value"}),r("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",i(r("Declaration"),null)).field("specifiers",[r("ExportSpecifier")],n.emptyArray).field("source",i(r("Literal"),null),n.null),r("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",r("Identifier")),r("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",i(r("Declaration"),r("Expression"))),r("ExportAllDeclaration").bases("Declaration").build("source").field("source",r("Literal")),r("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",r("Expression")).field("quasi",r("TemplateLiteral")),r("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[r("TemplateElement")]).field("expressions",[r("Expression")]),r("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),r("MetaProperty").bases("Expression").build("meta","property").field("meta",r("Identifier")).field("property",r("Identifier"))}F0.default=J5;(0,bM.maybeSetModuleExports)(function(){return SM})});var _M=P((L0,AM)=>{"use strict";Object.defineProperty(L0,"__esModule",{value:!0});var xM=(le(),Q(ue)),X5=xM.__importDefault(N0()),Y5=xM.__importDefault(EM()),Q5=Ae();function eY(e){e.use(X5.default),e.use(Y5.default)}L0.default=eY;(0,Q5.maybeSetModuleExports)(function(){return AM})});var IM=P((z0,CM)=>{"use strict";Object.defineProperty(z0,"__esModule",{value:!0});var U0=(le(),Q(ue)),tY=U0.__importDefault(_M()),rY=U0.__importDefault(Be()),TM=U0.__importStar(Ae());function nY(e){e.use(tY.default);var t=e.use(rY.default),r=t.Type.def,i=e.use(TM.default).defaults;r("Function").field("async",Boolean,i.false),r("AwaitExpression").bases("Expression").build("argument").field("argument",r("Expression"))}z0.default=nY;(0,TM.maybeSetModuleExports)(function(){return CM})});var kM=P((V0,wM)=>{"use strict";Object.defineProperty(V0,"__esModule",{value:!0});var B0=(le(),Q(ue)),iY=B0.__importDefault(IM()),aY=B0.__importDefault(Be()),DM=B0.__importStar(Ae());function oY(e){e.use(iY.default);var t=e.use(aY.default),r=t.Type.def,i=t.Type.or,n=e.use(DM.default).defaults;r("ForOfStatement").field("await",Boolean,n.false),r("SpreadProperty").bases("Node").build("argument").field("argument",r("Expression")),r("ObjectExpression").field("properties",[i(r("Property"),r("SpreadProperty"),r("SpreadElement"))]),r("TemplateElement").field("value",{cooked:i(String,null),raw:String}),r("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("ObjectPattern").field("properties",[i(r("PropertyPattern"),r("Property"),r("RestElement"),r("SpreadPropertyPattern"))])}V0.default=oY;(0,DM.maybeSetModuleExports)(function(){return wM})});var RM=P((W0,PM)=>{"use strict";Object.defineProperty(W0,"__esModule",{value:!0});var G0=(le(),Q(ue)),sY=G0.__importDefault(kM()),cY=G0.__importDefault(Be()),NM=G0.__importStar(Ae());function uY(e){e.use(sY.default);var t=e.use(cY.default),r=t.Type.def,i=t.Type.or,n=e.use(NM.default).defaults;r("CatchClause").field("param",i(r("Pattern"),null),n.null)}W0.default=uY;(0,NM.maybeSetModuleExports)(function(){return PM})});var jM=P((K0,$M)=>{"use strict";Object.defineProperty(K0,"__esModule",{value:!0});var Ah=(le(),Q(ue)),lY=Ah.__importDefault(R0()),dY=Ah.__importDefault(RM()),pY=Ah.__importDefault(Be()),OM=Ah.__importStar(Ae());function mY(e){e.use(lY.default),e.use(dY.default);var t=e.use(pY.default),r=t.Type.def,i=t.Type.or,n=e.use(OM.default),a=n.defaults;r("ImportExpression").bases("Expression").build("source").field("source",r("Expression")),r("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",r("Literal")).field("exported",i(r("Identifier"),null,void 0),a.null),r("ChainElement").bases("Node").field("optional",Boolean,a.false),r("CallExpression").bases("Expression","ChainElement"),r("MemberExpression").bases("Expression","ChainElement"),r("ChainExpression").bases("Expression").build("expression").field("expression",r("ChainElement")),r("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,a.true),r("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,a.true)}K0.default=mY;(0,OM.maybeSetModuleExports)(function(){return $M})});var LM=P((Z0,FM)=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});var MM=(le(),Q(ue)),fY=MM.__importDefault(hM()),hY=MM.__importDefault(jM()),gY=Ae();function yY(e){e.use(fY.default),e.use(hY.default)}Z0.default=yY;(0,gY.maybeSetModuleExports)(function(){return FM})});var BM=P((q0,zM)=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});var UM=(le(),Q(ue)),vY=UM.__importDefault(LM()),bY=UM.__importDefault(Be()),SY=Ae();function EY(e){e.use(vY.default);var t=e.use(bY.default),r=t.Type.def;r("StaticBlock").bases("Declaration").build("body").field("body",[r("Statement")])}q0.default=EY;(0,SY.maybeSetModuleExports)(function(){return zM})});var Us=P((J0,GM)=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});var H0=(le(),Q(ue)),xY=H0.__importDefault(Be()),VM=H0.__importStar(Ae()),AY=H0.__importDefault(BM());function _Y(e){e.use(AY.default);var t=e.use(xY.default),r=t.Type,i=t.Type.def,n=r.or,a=e.use(VM.default),o=a.defaults;i("AwaitExpression").build("argument","all").field("argument",n(i("Expression"),null)).field("all",Boolean,o.false),i("Decorator").bases("Node").build("expression").field("expression",i("Expression")),i("Property").field("decorators",n([i("Decorator")],null),o.null),i("MethodDefinition").field("decorators",n([i("Decorator")],null),o.null),i("PrivateName").bases("Expression","Pattern").build("id").field("id",i("Identifier")),i("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",i("PrivateName")).field("value",n(i("Expression"),null),o.null),i("ImportAttribute").bases("Node").build("key","value").field("key",n(i("Identifier"),i("Literal"))).field("value",i("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(function(s){i(s).field("assertions",[i("ImportAttribute")],o.emptyArray)}),i("RecordExpression").bases("Expression").build("properties").field("properties",[n(i("ObjectProperty"),i("ObjectMethod"),i("SpreadElement"))]),i("TupleExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),i("SpreadElement"),null)]),i("ModuleExpression").bases("Node").build("body").field("body",i("Program"))}J0.default=_Y;(0,VM.maybeSetModuleExports)(function(){return GM})});var ZM=P((Y0,KM)=>{"use strict";Object.defineProperty(Y0,"__esModule",{value:!0});var X0=(le(),Q(ue)),TY=X0.__importDefault(Us()),CY=X0.__importDefault(Be()),WM=X0.__importStar(Ae());function IY(e){e.use(TY.default);var t=e.use(CY.default),r=t.Type.def,i=t.Type.or,n=e.use(WM.default).defaults;r("JSXAttribute").bases("Node").build("name","value").field("name",i(r("JSXIdentifier"),r("JSXNamespacedName"))).field("value",i(r("Literal"),r("JSXExpressionContainer"),r("JSXElement"),r("JSXFragment"),null),n.null),r("JSXIdentifier").bases("Identifier").build("name").field("name",String),r("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",r("JSXIdentifier")).field("name",r("JSXIdentifier")),r("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",i(r("JSXIdentifier"),r("JSXMemberExpression"))).field("property",r("JSXIdentifier")).field("computed",Boolean,n.false);var a=i(r("JSXIdentifier"),r("JSXNamespacedName"),r("JSXMemberExpression"));r("JSXSpreadAttribute").bases("Node").build("argument").field("argument",r("Expression"));var o=[i(r("JSXAttribute"),r("JSXSpreadAttribute"))];r("JSXExpressionContainer").bases("Expression").build("expression").field("expression",i(r("Expression"),r("JSXEmptyExpression")));var s=[i(r("JSXText"),r("JSXExpressionContainer"),r("JSXSpreadChild"),r("JSXElement"),r("JSXFragment"),r("Literal"))];r("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",r("JSXOpeningElement")).field("closingElement",i(r("JSXClosingElement"),null),n.null).field("children",s,n.emptyArray).field("name",a,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",o,function(){return this.openingElement.attributes},!0),r("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",a).field("attributes",o,n.emptyArray).field("selfClosing",Boolean,n.false),r("JSXClosingElement").bases("Node").build("name").field("name",a),r("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",r("JSXOpeningFragment")).field("closingFragment",r("JSXClosingFragment")).field("children",s,n.emptyArray),r("JSXOpeningFragment").bases("Node").build(),r("JSXClosingFragment").bases("Node").build(),r("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),r("JSXEmptyExpression").bases("Node").build(),r("JSXSpreadChild").bases("Node").build("expression").field("expression",r("Expression"))}Y0.default=IY;(0,WM.maybeSetModuleExports)(function(){return KM})});var eT=P((Q0,JM)=>{"use strict";Object.defineProperty(Q0,"__esModule",{value:!0});var qM=(le(),Q(ue)),DY=qM.__importDefault(Be()),HM=qM.__importStar(Ae());function wY(e){var t=e.use(DY.default),r=t.Type.def,i=t.Type.or,n=e.use(HM.default).defaults,a=i(r("TypeAnnotation"),r("TSTypeAnnotation"),null),o=i(r("TypeParameterDeclaration"),r("TSTypeParameterDeclaration"),null);r("Identifier").field("typeAnnotation",a,n.null),r("ObjectPattern").field("typeAnnotation",a,n.null),r("Function").field("returnType",a,n.null).field("typeParameters",o,n.null),r("ClassProperty").build("key","value","typeAnnotation","static").field("value",i(r("Expression"),null)).field("static",Boolean,n.false).field("typeAnnotation",a,n.null),["ClassDeclaration","ClassExpression"].forEach(function(s){r(s).field("typeParameters",o,n.null).field("superTypeParameters",i(r("TypeParameterInstantiation"),r("TSTypeParameterInstantiation"),null),n.null).field("implements",i([r("ClassImplements")],[r("TSExpressionWithTypeArguments")]),n.emptyArray)})}Q0.default=wY;(0,HM.maybeSetModuleExports)(function(){return JM})});var rT=P((tT,YM)=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});var _h=(le(),Q(ue)),kY=_h.__importDefault(Us()),NY=_h.__importDefault(eT()),PY=_h.__importDefault(Be()),XM=_h.__importStar(Ae());function RY(e){e.use(kY.default),e.use(NY.default);var t=e.use(PY.default),r=t.Type.def,i=t.Type.or,n=e.use(XM.default).defaults;r("Flow").bases("Node"),r("FlowType").bases("Flow"),r("AnyTypeAnnotation").bases("FlowType").build(),r("EmptyTypeAnnotation").bases("FlowType").build(),r("MixedTypeAnnotation").bases("FlowType").build(),r("VoidTypeAnnotation").bases("FlowType").build(),r("SymbolTypeAnnotation").bases("FlowType").build(),r("NumberTypeAnnotation").bases("FlowType").build(),r("BigIntTypeAnnotation").bases("FlowType").build(),r("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),r("StringTypeAnnotation").bases("FlowType").build(),r("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),r("BooleanTypeAnnotation").bases("FlowType").build(),r("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),r("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullLiteralTypeAnnotation").bases("FlowType").build(),r("NullTypeAnnotation").bases("FlowType").build(),r("ThisTypeAnnotation").bases("FlowType").build(),r("ExistsTypeAnnotation").bases("FlowType").build(),r("ExistentialTypeParam").bases("FlowType").build(),r("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[r("FunctionTypeParam")]).field("returnType",r("FlowType")).field("rest",i(r("FunctionTypeParam"),null)).field("typeParameters",i(r("TypeParameterDeclaration"),null)),r("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",i(r("Identifier"),null)).field("typeAnnotation",r("FlowType")).field("optional",Boolean),r("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",r("FlowType")),r("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[i(r("ObjectTypeProperty"),r("ObjectTypeSpreadProperty"))]).field("indexers",[r("ObjectTypeIndexer")],n.emptyArray).field("callProperties",[r("ObjectTypeCallProperty")],n.emptyArray).field("inexact",i(Boolean,void 0),n.undefined).field("exact",Boolean,n.false).field("internalSlots",[r("ObjectTypeInternalSlot")],n.emptyArray),r("Variance").bases("Node").build("kind").field("kind",i("plus","minus"));var a=i(r("Variance"),"plus","minus",null);r("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",i(r("Literal"),r("Identifier"))).field("value",r("FlowType")).field("optional",Boolean).field("variance",a,n.null),r("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",r("Identifier")).field("key",r("FlowType")).field("value",r("FlowType")).field("variance",a,n.null).field("static",Boolean,n.false),r("ObjectTypeCallProperty").bases("Node").build("value").field("value",r("FunctionTypeAnnotation")).field("static",Boolean,n.false),r("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("id",r("Identifier")),r("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("typeParameters",i(r("TypeParameterInstantiation"),null)),r("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",r("Identifier")).field("property",i(r("MemberTypeAnnotation"),r("GenericTypeAnnotation"))),r("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",r("FlowType")).field("indexType",r("FlowType")),r("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",r("FlowType")).field("indexType",r("FlowType")).field("optional",Boolean),r("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",r("FlowType")),r("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",r("FlowType")),r("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",r("Identifier")).field("value",r("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),r("TypeParameterDeclaration").bases("Node").build("params").field("params",[r("TypeParameter")]),r("TypeParameterInstantiation").bases("Node").build("params").field("params",[r("FlowType")]),r("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",a,n.null).field("bound",i(r("TypeAnnotation"),null),n.null).field("default",i(r("FlowType"),null),n.null),r("ClassProperty").field("variance",a,n.null),r("ClassImplements").bases("Node").build("id").field("id",r("Identifier")).field("superClass",i(r("Expression"),null),n.null).field("typeParameters",i(r("TypeParameterInstantiation"),null),n.null),r("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",r("ObjectTypeAnnotation")).field("extends",i([r("InterfaceExtends")],null),n.null),r("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null),n.null).field("body",r("ObjectTypeAnnotation")).field("extends",[r("InterfaceExtends")]),r("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),r("InterfaceExtends").bases("Node").build("id").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterInstantiation"),null),n.null),r("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null)).field("right",r("FlowType")),r("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),r("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null)).field("impltype",r("FlowType")).field("supertype",i(r("FlowType"),null)),r("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",i(r("FlowType"),null)),r("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",r("Expression")).field("typeAnnotation",r("TypeAnnotation")),r("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("DeclareVariable").bases("Statement").build("id").field("id",r("Identifier")),r("DeclareFunction").bases("Statement").build("id").field("id",r("Identifier")).field("predicate",i(r("FlowPredicate"),null),n.null),r("DeclareClass").bases("InterfaceDeclaration").build("id"),r("DeclareModule").bases("Statement").build("id","body").field("id",i(r("Identifier"),r("Literal"))).field("body",r("BlockStatement")),r("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",r("TypeAnnotation")),r("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(r("DeclareVariable"),r("DeclareFunction"),r("DeclareClass"),r("FlowType"),r("TypeAlias"),r("DeclareOpaqueType"),r("InterfaceDeclaration"),null)).field("specifiers",[i(r("ExportSpecifier"),r("ExportBatchSpecifier"))],n.emptyArray).field("source",i(r("Literal"),null),n.null),r("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",i(r("Literal"),null),n.null),r("ImportDeclaration").field("importKind",i("value","type","typeof"),function(){return"value"}),r("FlowPredicate").bases("Flow"),r("InferredPredicate").bases("FlowPredicate").build(),r("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",r("Expression")),r("Function").field("predicate",i(r("FlowPredicate"),null),n.null),r("CallExpression").field("typeArguments",i(null,r("TypeParameterInstantiation")),n.null),r("NewExpression").field("typeArguments",i(null,r("TypeParameterInstantiation")),n.null),r("EnumDeclaration").bases("Declaration").build("id","body").field("id",r("Identifier")).field("body",i(r("EnumBooleanBody"),r("EnumNumberBody"),r("EnumStringBody"),r("EnumSymbolBody"))),r("EnumBooleanBody").build("members","explicitType").field("members",[r("EnumBooleanMember")]).field("explicitType",Boolean),r("EnumNumberBody").build("members","explicitType").field("members",[r("EnumNumberMember")]).field("explicitType",Boolean),r("EnumStringBody").build("members","explicitType").field("members",i([r("EnumStringMember")],[r("EnumDefaultedMember")])).field("explicitType",Boolean),r("EnumSymbolBody").build("members").field("members",[r("EnumDefaultedMember")]),r("EnumBooleanMember").build("id","init").field("id",r("Identifier")).field("init",i(r("Literal"),Boolean)),r("EnumNumberMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumStringMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumDefaultedMember").build("id").field("id",r("Identifier"))}tT.default=RY;(0,XM.maybeSetModuleExports)(function(){return YM})});var tF=P((iT,eF)=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});var nT=(le(),Q(ue)),OY=nT.__importDefault(Us()),$Y=nT.__importDefault(Be()),QM=nT.__importStar(Ae());function jY(e){e.use(OY.default);var t=e.use($Y.default),r=e.use(QM.default).defaults,i=t.Type.def,n=t.Type.or;i("VariableDeclaration").field("declarations",[n(i("VariableDeclarator"),i("Identifier"))]),i("Property").field("value",n(i("Expression"),i("Pattern"))),i("ArrayPattern").field("elements",[n(i("Pattern"),i("SpreadElement"),null)]),i("ObjectPattern").field("properties",[n(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"))]),i("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ExportBatchSpecifier").bases("Specifier").build(),i("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(i("Declaration"),i("Expression"),null)).field("specifiers",[n(i("ExportSpecifier"),i("ExportBatchSpecifier"))],r.emptyArray).field("source",n(i("Literal"),null),r.null),i("Block").bases("Comment").build("value","leading","trailing"),i("Line").bases("Comment").build("value","leading","trailing")}iT.default=jY;(0,QM.maybeSetModuleExports)(function(){return eF})});var sT=P((oT,nF)=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});var aT=(le(),Q(ue)),MY=aT.__importDefault(Us()),FY=aT.__importDefault(Be()),rF=aT.__importStar(Ae());function LY(e){var t,r,i,n,a;e.use(MY.default);var o=e.use(FY.default),s=e.use(rF.default).defaults,u=o.Type.def,d=o.Type.or,p=o.builtInTypes.undefined;u("Noop").bases("Statement").build(),u("DoExpression").bases("Expression").build("body").field("body",[u("Statement")]),u("BindExpression").bases("Expression").build("object","callee").field("object",d(u("Expression"),null)).field("callee",u("Expression")),u("ParenthesizedExpression").bases("Expression").build("expression").field("expression",u("Expression")),u("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",u("Identifier")),u("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",u("Identifier")),u("CommentBlock").bases("Comment").build("value","leading","trailing"),u("CommentLine").bases("Comment").build("value","leading","trailing"),u("Directive").bases("Node").build("value").field("value",u("DirectiveLiteral")),u("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,s["use strict"]),u("InterpreterDirective").bases("Node").build("value").field("value",String),u("BlockStatement").bases("Statement").build("body").field("body",[u("Statement")]).field("directives",[u("Directive")],s.emptyArray),u("Program").bases("Node").build("body").field("body",[u("Statement")]).field("directives",[u("Directive")],s.emptyArray).field("interpreter",d(u("InterpreterDirective"),null),s.null);function g(f,y){return f===void 0&&(f=String),["extra",{rawValue:f,raw:String},function(){var b=o.getFieldValue(this,"value");return{rawValue:b,raw:y?y(b):String(b)}}]}(t=u("StringLiteral").bases("Literal").build("value").field("value",String)).field.apply(t,g(String,function(f){return JSON.stringify(f)})),(r=u("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",d(String,null),s.null)).field.apply(r,g(Number)),(i=u("BigIntLiteral").bases("Literal").build("value").field("value",d(String,Number))).field.apply(i,g(String,function(f){return f+"n"})),(n=u("DecimalLiteral").bases("Literal").build("value").field("value",String)).field.apply(n,g(String,function(f){return f+"m"})),u("NullLiteral").bases("Literal").build().field("value",null,s.null),u("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),(a=u("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)})).field.apply(a,g(d(RegExp,p),function(f){return"/".concat(f.pattern,"/").concat(f.flags||"")})).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var h=d(u("Property"),u("ObjectMethod"),u("ObjectProperty"),u("SpreadProperty"),u("SpreadElement"));u("ObjectExpression").bases("Expression").build("properties").field("properties",[h]),u("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",d("method","get","set")).field("key",d(u("Literal"),u("Identifier"),u("Expression"))).field("params",[u("Pattern")]).field("body",u("BlockStatement")).field("computed",Boolean,s.false).field("generator",Boolean,s.false).field("async",Boolean,s.false).field("accessibility",d(u("Literal"),null),s.null).field("decorators",d([u("Decorator")],null),s.null),u("ObjectProperty").bases("Node").build("key","value").field("key",d(u("Literal"),u("Identifier"),u("Expression"))).field("value",d(u("Expression"),u("Pattern"))).field("accessibility",d(u("Literal"),null),s.null).field("computed",Boolean,s.false);var l=d(u("MethodDefinition"),u("VariableDeclarator"),u("ClassPropertyDefinition"),u("ClassProperty"),u("ClassPrivateProperty"),u("ClassMethod"),u("ClassPrivateMethod"),u("ClassAccessorProperty"),u("StaticBlock"));u("ClassBody").bases("Declaration").build("body").field("body",[l]),u("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",d(u("Literal"),u("Identifier"),u("Expression"))),u("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",u("PrivateName")),u("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",d(u("Literal"),u("Identifier"),u("PrivateName"),u("Expression"))).field("value",d(u("Expression"),null),s.null),["ClassMethod","ClassPrivateMethod"].forEach(function(f){u(f).field("kind",d("get","set","method","constructor"),function(){return"method"}).field("body",u("BlockStatement")).field("access",d("public","private","protected",null),s.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(function(f){u(f).field("computed",Boolean,s.false).field("static",Boolean,s.false).field("abstract",Boolean,s.false).field("accessibility",d("public","private","protected",null),s.null).field("decorators",d([u("Decorator")],null),s.null).field("definite",Boolean,s.false).field("optional",Boolean,s.false).field("override",Boolean,s.false).field("readonly",Boolean,s.false)});var m=d(u("Property"),u("PropertyPattern"),u("SpreadPropertyPattern"),u("SpreadProperty"),u("ObjectProperty"),u("RestProperty"),u("RestElement"));u("ObjectPattern").bases("Pattern").build("properties").field("properties",[m]).field("decorators",d([u("Decorator")],null),s.null),u("SpreadProperty").bases("Node").build("argument").field("argument",u("Expression")),u("RestProperty").bases("Node").build("argument").field("argument",u("Expression")),u("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",d(u("VariableDeclaration"),u("Expression"))).field("right",u("Expression")).field("body",u("Statement")),u("Import").bases("Expression").build()}oT.default=LY;(0,rF.maybeSetModuleExports)(function(){return nF})});var aF=P((uT,iF)=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});var cT=(le(),Q(ue)),UY=cT.__importDefault(Be()),zY=cT.__importDefault(sT()),BY=cT.__importDefault(rT()),VY=Ae();function GY(e){var t=e.use(UY.default),r=t.Type.def;e.use(zY.default),e.use(BY.default),r("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),r("TopicReference").bases("Expression").build()}uT.default=GY;(0,VY.maybeSetModuleExports)(function(){return iF})});var cF=P((lT,sF)=>{"use strict";Object.defineProperty(lT,"__esModule",{value:!0});var Th=(le(),Q(ue)),WY=Th.__importDefault(sT()),KY=Th.__importDefault(eT()),ZY=Th.__importDefault(Be()),oF=Th.__importStar(Ae());function qY(e){e.use(WY.default),e.use(KY.default);var t=e.use(ZY.default),r=t.namedTypes,i=t.Type.def,n=t.Type.or,a=e.use(oF.default).defaults,o=t.Type.from(function(p,g){return!!(r.StringLiteral&&r.StringLiteral.check(p,g)||r.Literal&&r.Literal.check(p,g)&&typeof p.value=="string")},"StringLiteral");i("TSType").bases("Node");var s=n(i("Identifier"),i("TSQualifiedName"));i("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",s),i("TSHasOptionalTypeParameterInstantiation").field("typeParameters",n(i("TSTypeParameterInstantiation"),null),a.null),i("TSHasOptionalTypeParameters").field("typeParameters",n(i("TSTypeParameterDeclaration"),null,void 0),a.null),i("TSHasOptionalTypeAnnotation").field("typeAnnotation",n(i("TSTypeAnnotation"),null),a.null),i("TSQualifiedName").bases("Node").build("left","right").field("left",s).field("right",s),i("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")).field("extra",n({parenthesized:Boolean},null),a.null),i("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",i("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(function(p){i(p).bases("TSType").build()}),i("TSArrayType").bases("TSType").build("elementType").field("elementType",i("TSType")),i("TSLiteralType").bases("TSType").build("literal").field("literal",n(i("NumericLiteral"),i("StringLiteral"),i("BooleanLiteral"),i("TemplateLiteral"),i("UnaryExpression"),i("BigIntLiteral"))),i("TemplateLiteral").field("expressions",n([i("Expression")],[i("TSType")])),["TSUnionType","TSIntersectionType"].forEach(function(p){i(p).bases("TSType").build("types").field("types",[i("TSType")])}),i("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",i("TSType")).field("extendsType",i("TSType")).field("trueType",i("TSType")).field("falseType",i("TSType")),i("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",i("TSTypeParameter")),i("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType"));var u=[n(i("Identifier"),i("RestElement"),i("ArrayPattern"),i("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(function(p){i(p).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",u)}),i("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,a.false).field("async",Boolean,a.false).field("generator",Boolean,a.false).field("id",n(i("Identifier"),null),a.null).field("params",[i("Pattern")]).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),a.null),i("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,a.false).field("generator",Boolean,a.false).field("params",[i("Pattern")]).field("abstract",Boolean,a.false).field("accessibility",n("public","private","protected",void 0),a.undefined).field("static",Boolean,a.false).field("computed",Boolean,a.false).field("optional",Boolean,a.false).field("key",n(i("Identifier"),i("StringLiteral"),i("NumericLiteral"),i("Expression"))).field("kind",n("get","set","method","constructor"),function(){return"method"}).field("access",n("public","private","protected",void 0),a.undefined).field("decorators",n([i("Decorator")],null),a.null).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),a.null),i("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",n(Boolean,"+","-"),a.false).field("typeParameter",i("TSTypeParameter")).field("optional",n(Boolean,"+","-"),a.false).field("typeAnnotation",n(i("TSType"),null),a.null),i("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[n(i("TSType"),i("TSNamedTupleMember"))]),i("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",i("Identifier")).field("optional",Boolean,a.false).field("elementType",i("TSType")),i("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",i("TSType")).field("indexType",i("TSType")),i("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",i("TSType")),i("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n(i("TSType"),i("TSTypeAnnotation"))),i("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[i("Identifier")]).field("readonly",Boolean,a.false),i("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",i("Expression")).field("computed",Boolean,a.false).field("readonly",Boolean,a.false).field("optional",Boolean,a.false).field("initializer",n(i("Expression"),null),a.null),i("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",i("Expression")).field("computed",Boolean,a.false).field("optional",Boolean,a.false).field("parameters",u),i("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",n(i("Identifier"),i("TSThisType"))).field("typeAnnotation",n(i("TSTypeAnnotation"),null),a.null).field("asserts",Boolean,a.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(function(p){i(p).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",u)}),i("TSEnumMember").bases("Node").build("id","initializer").field("id",n(i("Identifier"),o)).field("initializer",n(i("Expression"),null),a.null),i("TSTypeQuery").bases("TSType").build("exprName").field("exprName",n(s,i("TSImportType")));var d=n(i("TSCallSignatureDeclaration"),i("TSConstructSignatureDeclaration"),i("TSIndexSignature"),i("TSMethodSignature"),i("TSPropertySignature"));i("TSTypeLiteral").bases("TSType").build("members").field("members",[d]),i("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",n(i("Identifier"),String)).field("constraint",n(i("TSType"),void 0),a.undefined).field("default",n(i("TSType"),void 0),a.undefined),i("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",i("TSType")).field("expression",i("Expression")).field("extra",n({parenthesized:Boolean},null),a.null),i("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[i("TSTypeParameter")]),i("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",i("Expression")),i("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[i("TSType")]),i("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",i("Identifier")).field("const",Boolean,a.false).field("declare",Boolean,a.false).field("members",[i("TSEnumMember")]).field("initializer",n(i("Expression"),null),a.null),i("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",i("Identifier")).field("declare",Boolean,a.false).field("typeAnnotation",i("TSType")),i("TSModuleBlock").bases("Node").build("body").field("body",[i("Statement")]),i("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",n(o,s)).field("declare",Boolean,a.false).field("global",Boolean,a.false).field("body",n(i("TSModuleBlock"),i("TSModuleDeclaration"),null),a.null),i("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",o).field("qualifier",n(s,void 0),a.undefined),i("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",i("Identifier")).field("isExport",Boolean,a.false).field("moduleReference",n(s,i("TSExternalModuleReference"))),i("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",o),i("TSExportAssignment").bases("Statement").build("expression").field("expression",i("Expression")),i("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",i("Identifier")),i("TSInterfaceBody").bases("Node").build("body").field("body",[d]),i("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",s),i("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",s).field("declare",Boolean,a.false).field("extends",n([i("TSExpressionWithTypeArguments")],null),a.null).field("body",i("TSInterfaceBody")),i("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",n("public","private","protected",void 0),a.undefined).field("readonly",Boolean,a.false).field("parameter",n(i("Identifier"),i("AssignmentPattern"))),i("ClassProperty").field("access",n("public","private","protected",void 0),a.undefined),i("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),i("ClassBody").field("body",[n(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassPrivateProperty"),i("ClassAccessorProperty"),i("ClassMethod"),i("ClassPrivateMethod"),i("StaticBlock"),i("TSDeclareMethod"),d)])}lT.default=qY;(0,oF.maybeSetModuleExports)(function(){return sF})});var uF=P(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.namedTypes=void 0;var HY;HY=xl.namedTypes||(xl.namedTypes={})});var Ar=P(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.visit=de.use=de.Type=de.someField=de.PathVisitor=de.Path=de.NodePath=de.namedTypes=de.getSupertypeNames=de.getFieldValue=de.getFieldNames=de.getBuilderName=de.finalize=de.eachField=de.defineMethod=de.builtInTypes=de.builders=de.astNodesAreEquivalent=void 0;var Ba=(le(),Q(ue)),JY=Ba.__importDefault(lM()),XY=Ba.__importDefault(Us()),YY=Ba.__importDefault(ZM()),QY=Ba.__importDefault(rT()),e7=Ba.__importDefault(tF()),t7=Ba.__importDefault(aF()),r7=Ba.__importDefault(cF()),lF=uF();Object.defineProperty(de,"namedTypes",{enumerable:!0,get:function(){return lF.namedTypes}});var dt=(0,JY.default)([XY.default,YY.default,QY.default,e7.default,t7.default,r7.default]),n7=dt.astNodesAreEquivalent,i7=dt.builders,a7=dt.builtInTypes,o7=dt.defineMethod,s7=dt.eachField,c7=dt.finalize,u7=dt.getBuilderName,l7=dt.getFieldNames,d7=dt.getFieldValue,p7=dt.getSupertypeNames,m7=dt.namedTypes,f7=dt.NodePath,h7=dt.Path,g7=dt.PathVisitor,y7=dt.someField,v7=dt.Type,b7=dt.use,S7=dt.visit;de.astNodesAreEquivalent=n7;de.builders=i7;de.builtInTypes=a7;de.defineMethod=o7;de.eachField=s7;de.finalize=c7;de.getBuilderName=u7;de.getFieldNames=l7;de.getFieldValue=d7;de.getSupertypeNames=p7;de.NodePath=f7;de.Path=h7;de.PathVisitor=g7;de.someField=y7;de.Type=v7;de.use=b7;de.visit=S7;Object.assign(lF.namedTypes,m7)});var ui={};Ur(ui,{default:()=>wee});function wee(e,t){if(!e){if(Dee)throw new Error(CC);var r=typeof t=="function"?t():t,i=r?"".concat(CC,": ").concat(r):CC;throw new Error(i)}}var Dee,CC,li=HD(()=>{Dee=process.env.NODE_ENV==="production",CC="Invariant failed"});var HU=P(IC=>{var qU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");IC.encode=function(e){if(0<=e&&e<qU.length)return qU[e];throw new TypeError("Must be between 0 and 63: "+e)};IC.decode=function(e){var t=65,r=90,i=97,n=122,a=48,o=57,s=43,u=47,d=26,p=52;return t<=e&&e<=r?e-t:i<=e&&e<=n?e-i+d:a<=e&&e<=o?e-a+p:e==s?62:e==u?63:-1}});var kC=P(wC=>{var JU=HU(),DC=5,XU=1<<DC,YU=XU-1,QU=XU;function kee(e){return e<0?(-e<<1)+1:(e<<1)+0}function Nee(e){var t=(e&1)===1,r=e>>1;return t?-r:r}wC.encode=function(t){var r="",i,n=kee(t);do i=n&YU,n>>>=DC,n>0&&(i|=QU),r+=JU.encode(i);while(n>0);return r};wC.decode=function(t,r,i){var n=t.length,a=0,o=0,s,u;do{if(r>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(u=JU.decode(t.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));s=!!(u&QU),u&=YU,a=a+(u<<o),o+=DC}while(s);i.value=Nee(a),i.rest=r}});var yc=P(_t=>{function Pee(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}_t.getArg=Pee;var ez=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Ree=/^data:.+\,.+$/;function pd(e){var t=e.match(ez);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}_t.urlParse=pd;function hc(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}_t.urlGenerate=hc;function NC(e){var t=e,r=pd(e);if(r){if(!r.path)return e;t=r.path}for(var i=_t.isAbsolute(t),n=t.split(/\/+/),a,o=0,s=n.length-1;s>=0;s--)a=n[s],a==="."?n.splice(s,1):a===".."?o++:o>0&&(a===""?(n.splice(s+1,o),o=0):(n.splice(s,2),o--));return t=n.join("/"),t===""&&(t=i?"/":"."),r?(r.path=t,hc(r)):t}_t.normalize=NC;function tz(e,t){e===""&&(e="."),t===""&&(t=".");var r=pd(t),i=pd(e);if(i&&(e=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),hc(r);if(r||t.match(Ree))return t;if(i&&!i.host&&!i.path)return i.host=t,hc(i);var n=t.charAt(0)==="/"?t:NC(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=n,hc(i)):n}_t.join=tz;_t.isAbsolute=function(e){return e.charAt(0)==="/"||ez.test(e)};function Oee(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var i=e.lastIndexOf("/");if(i<0||(e=e.slice(0,i),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}_t.relative=Oee;var rz=(function(){var e=Object.create(null);return!("__proto__"in e)})();function nz(e){return e}function $ee(e){return iz(e)?"$"+e:e}_t.toSetString=rz?nz:$ee;function jee(e){return iz(e)?e.slice(1):e}_t.fromSetString=rz?nz:jee;function iz(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function Mee(e,t,r){var i=gc(e.source,t.source);return i!==0||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0||r)||(i=e.generatedColumn-t.generatedColumn,i!==0)||(i=e.generatedLine-t.generatedLine,i!==0)?i:gc(e.name,t.name)}_t.compareByOriginalPositions=Mee;function Fee(e,t,r){var i=e.generatedLine-t.generatedLine;return i!==0||(i=e.generatedColumn-t.generatedColumn,i!==0||r)||(i=gc(e.source,t.source),i!==0)||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0)?i:gc(e.name,t.name)}_t.compareByGeneratedPositionsDeflated=Fee;function gc(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function Lee(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=gc(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:gc(e.name,t.name)}_t.compareByGeneratedPositionsInflated=Lee;function Uee(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}_t.parseSourceMapInput=Uee;function zee(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var i=pd(r);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var n=i.path.lastIndexOf("/");n>=0&&(i.path=i.path.substring(0,n+1))}t=tz(hc(i),t)}return NC(t)}_t.computeSourceURL=zee});var OC=P(az=>{var PC=yc(),RC=Object.prototype.hasOwnProperty,co=typeof Map<"u";function di(){this._array=[],this._set=co?new Map:Object.create(null)}di.fromArray=function(t,r){for(var i=new di,n=0,a=t.length;n<a;n++)i.add(t[n],r);return i};di.prototype.size=function(){return co?this._set.size:Object.getOwnPropertyNames(this._set).length};di.prototype.add=function(t,r){var i=co?t:PC.toSetString(t),n=co?this.has(t):RC.call(this._set,i),a=this._array.length;(!n||r)&&this._array.push(t),n||(co?this._set.set(t,a):this._set[i]=a)};di.prototype.has=function(t){if(co)return this._set.has(t);var r=PC.toSetString(t);return RC.call(this._set,r)};di.prototype.indexOf=function(t){if(co){var r=this._set.get(t);if(r>=0)return r}else{var i=PC.toSetString(t);if(RC.call(this._set,i))return this._set[i]}throw new Error('"'+t+'" is not in the set.')};di.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};di.prototype.toArray=function(){return this._array.slice()};az.ArraySet=di});var cz=P(sz=>{var oz=yc();function Bee(e,t){var r=e.generatedLine,i=t.generatedLine,n=e.generatedColumn,a=t.generatedColumn;return i>r||i==r&&a>=n||oz.compareByGeneratedPositionsInflated(e,t)<=0}function _g(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}_g.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};_g.prototype.add=function(t){Bee(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};_g.prototype.toArray=function(){return this._sorted||(this._array.sort(oz.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};sz.MappingList=_g});var $C=P(uz=>{var md=kC(),tt=yc(),Tg=OC().ArraySet,Vee=cz().MappingList;function Or(e){e||(e={}),this._file=tt.getArg(e,"file",null),this._sourceRoot=tt.getArg(e,"sourceRoot",null),this._skipValidation=tt.getArg(e,"skipValidation",!1),this._sources=new Tg,this._names=new Tg,this._mappings=new Vee,this._sourcesContents=null}Or.prototype._version=3;Or.fromSourceMap=function(t){var r=t.sourceRoot,i=new Or({file:t.file,sourceRoot:r});return t.eachMapping(function(n){var a={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(a.source=n.source,r!=null&&(a.source=tt.relative(r,a.source)),a.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(a.name=n.name)),i.addMapping(a)}),t.sources.forEach(function(n){var a=n;r!==null&&(a=tt.relative(r,n)),i._sources.has(a)||i._sources.add(a);var o=t.sourceContentFor(n);o!=null&&i.setSourceContent(n,o)}),i};Or.prototype.addMapping=function(t){var r=tt.getArg(t,"generated"),i=tt.getArg(t,"original",null),n=tt.getArg(t,"source",null),a=tt.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,i,n,a),n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:i!=null&&i.line,originalColumn:i!=null&&i.column,source:n,name:a})};Or.prototype.setSourceContent=function(t,r){var i=t;this._sourceRoot!=null&&(i=tt.relative(this._sourceRoot,i)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[tt.toSetString(i)]=r):this._sourcesContents&&(delete this._sourcesContents[tt.toSetString(i)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Or.prototype.applySourceMap=function(t,r,i){var n=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=t.file}var a=this._sourceRoot;a!=null&&(n=tt.relative(a,n));var o=new Tg,s=new Tg;this._mappings.unsortedForEach(function(u){if(u.source===n&&u.originalLine!=null){var d=t.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,i!=null&&(u.source=tt.join(i,u.source)),a!=null&&(u.source=tt.relative(a,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}var p=u.source;p!=null&&!o.has(p)&&o.add(p);var g=u.name;g!=null&&!s.has(g)&&s.add(g)},this),this._sources=o,this._names=s,t.sources.forEach(function(u){var d=t.sourceContentFor(u);d!=null&&(i!=null&&(u=tt.join(i,u)),a!=null&&(u=tt.relative(a,u)),this.setSourceContent(u,d))},this)};Or.prototype._validateMapping=function(t,r,i,n){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!i&&!n)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&i)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:i,original:r,name:n}))}};Or.prototype._serializeMappings=function(){for(var t=0,r=1,i=0,n=0,a=0,o=0,s="",u,d,p,g,h=this._mappings.toArray(),l=0,m=h.length;l<m;l++){if(d=h[l],u="",d.generatedLine!==r)for(t=0;d.generatedLine!==r;)u+=";",r++;else if(l>0){if(!tt.compareByGeneratedPositionsInflated(d,h[l-1]))continue;u+=","}u+=md.encode(d.generatedColumn-t),t=d.generatedColumn,d.source!=null&&(g=this._sources.indexOf(d.source),u+=md.encode(g-o),o=g,u+=md.encode(d.originalLine-1-n),n=d.originalLine-1,u+=md.encode(d.originalColumn-i),i=d.originalColumn,d.name!=null&&(p=this._names.indexOf(d.name),u+=md.encode(p-a),a=p)),s+=u}return s};Or.prototype._generateSourcesContent=function(t,r){return t.map(function(i){if(!this._sourcesContents)return null;r!=null&&(i=tt.relative(r,i));var n=tt.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};Or.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};Or.prototype.toString=function(){return JSON.stringify(this.toJSON())};uz.SourceMapGenerator=Or});var lz=P(uo=>{uo.GREATEST_LOWER_BOUND=1;uo.LEAST_UPPER_BOUND=2;function jC(e,t,r,i,n,a){var o=Math.floor((t-e)/2)+e,s=n(r,i[o],!0);return s===0?o:s>0?t-o>1?jC(o,t,r,i,n,a):a==uo.LEAST_UPPER_BOUND?t<i.length?t:-1:o:o-e>1?jC(e,o,r,i,n,a):a==uo.LEAST_UPPER_BOUND?o:e<0?-1:e}uo.search=function(t,r,i,n){if(r.length===0)return-1;var a=jC(-1,r.length,t,r,i,n||uo.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&i(r[a],r[a-1],!0)===0;)--a;return a}});var pz=P(dz=>{function MC(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function Gee(e,t){return Math.round(e+Math.random()*(t-e))}function FC(e,t,r,i){if(r<i){var n=Gee(r,i),a=r-1;MC(e,n,i);for(var o=e[i],s=r;s<i;s++)t(e[s],o)<=0&&(a+=1,MC(e,a,s));MC(e,a+1,s);var u=a+1;FC(e,t,r,u-1),FC(e,t,u+1,i)}}dz.quickSort=function(e,t){FC(e,t,0,e.length-1)}});var fz=P(Cg=>{var K=yc(),LC=lz(),vc=OC().ArraySet,Wee=kC(),fd=pz().quickSort;function Le(e,t){var r=e;return typeof e=="string"&&(r=K.parseSourceMapInput(e)),r.sections!=null?new Xr(r,t):new yt(r,t)}Le.fromSourceMap=function(e,t){return yt.fromSourceMap(e,t)};Le.prototype._version=3;Le.prototype.__generatedMappings=null;Object.defineProperty(Le.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Le.prototype.__originalMappings=null;Object.defineProperty(Le.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Le.prototype._charIsMappingSeparator=function(t,r){var i=t.charAt(r);return i===";"||i===","};Le.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};Le.GENERATED_ORDER=1;Le.ORIGINAL_ORDER=2;Le.GREATEST_LOWER_BOUND=1;Le.LEAST_UPPER_BOUND=2;Le.prototype.eachMapping=function(t,r,i){var n=r||null,a=i||Le.GENERATED_ORDER,o;switch(a){case Le.GENERATED_ORDER:o=this._generatedMappings;break;case Le.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;o.map(function(u){var d=u.source===null?null:this._sources.at(u.source);return d=K.computeSourceURL(s,d,this._sourceMapURL),{source:d,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(t,n)};Le.prototype.allGeneratedPositionsFor=function(t){var r=K.getArg(t,"line"),i={source:K.getArg(t,"source"),originalLine:r,originalColumn:K.getArg(t,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],a=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",K.compareByOriginalPositions,LC.LEAST_UPPER_BOUND);if(a>=0){var o=this._originalMappings[a];if(t.column===void 0)for(var s=o.originalLine;o&&o.originalLine===s;)n.push({line:K.getArg(o,"generatedLine",null),column:K.getArg(o,"generatedColumn",null),lastColumn:K.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a];else for(var u=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==u;)n.push({line:K.getArg(o,"generatedLine",null),column:K.getArg(o,"generatedColumn",null),lastColumn:K.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a]}return n};Cg.SourceMapConsumer=Le;function yt(e,t){var r=e;typeof e=="string"&&(r=K.parseSourceMapInput(e));var i=K.getArg(r,"version"),n=K.getArg(r,"sources"),a=K.getArg(r,"names",[]),o=K.getArg(r,"sourceRoot",null),s=K.getArg(r,"sourcesContent",null),u=K.getArg(r,"mappings"),d=K.getArg(r,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);o&&(o=K.normalize(o)),n=n.map(String).map(K.normalize).map(function(p){return o&&K.isAbsolute(o)&&K.isAbsolute(p)?K.relative(o,p):p}),this._names=vc.fromArray(a.map(String),!0),this._sources=vc.fromArray(n,!0),this._absoluteSources=this._sources.toArray().map(function(p){return K.computeSourceURL(o,p,t)}),this.sourceRoot=o,this.sourcesContent=s,this._mappings=u,this._sourceMapURL=t,this.file=d}yt.prototype=Object.create(Le.prototype);yt.prototype.consumer=Le;yt.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=K.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};yt.fromSourceMap=function(t,r){var i=Object.create(yt.prototype),n=i._names=vc.fromArray(t._names.toArray(),!0),a=i._sources=vc.fromArray(t._sources.toArray(),!0);i.sourceRoot=t._sourceRoot,i.sourcesContent=t._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=t._file,i._sourceMapURL=r,i._absoluteSources=i._sources.toArray().map(function(l){return K.computeSourceURL(i.sourceRoot,l,r)});for(var o=t._mappings.toArray().slice(),s=i.__generatedMappings=[],u=i.__originalMappings=[],d=0,p=o.length;d<p;d++){var g=o[d],h=new mz;h.generatedLine=g.generatedLine,h.generatedColumn=g.generatedColumn,g.source&&(h.source=a.indexOf(g.source),h.originalLine=g.originalLine,h.originalColumn=g.originalColumn,g.name&&(h.name=n.indexOf(g.name)),u.push(h)),s.push(h)}return fd(i.__originalMappings,K.compareByOriginalPositions),i};yt.prototype._version=3;Object.defineProperty(yt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function mz(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}yt.prototype._parseMappings=function(t,r){for(var i=1,n=0,a=0,o=0,s=0,u=0,d=t.length,p=0,g={},h={},l=[],m=[],f,y,v,b,A;p<d;)if(t.charAt(p)===";")i++,p++,n=0;else if(t.charAt(p)===",")p++;else{for(f=new mz,f.generatedLine=i,b=p;b<d&&!this._charIsMappingSeparator(t,b);b++);if(y=t.slice(p,b),v=g[y],v)p+=y.length;else{for(v=[];p<b;)Wee.decode(t,p,h),A=h.value,p=h.rest,v.push(A);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");g[y]=v}f.generatedColumn=n+v[0],n=f.generatedColumn,v.length>1&&(f.source=s+v[1],s+=v[1],f.originalLine=a+v[2],a=f.originalLine,f.originalLine+=1,f.originalColumn=o+v[3],o=f.originalColumn,v.length>4&&(f.name=u+v[4],u+=v[4])),m.push(f),typeof f.originalLine=="number"&&l.push(f)}fd(m,K.compareByGeneratedPositionsDeflated),this.__generatedMappings=m,fd(l,K.compareByOriginalPositions),this.__originalMappings=l};yt.prototype._findMapping=function(t,r,i,n,a,o){if(t[i]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[i]);if(t[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[n]);return LC.search(t,r,a,o)};yt.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var i=this._generatedMappings[t+1];if(r.generatedLine===i.generatedLine){r.lastGeneratedColumn=i.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};yt.prototype.originalPositionFor=function(t){var r={generatedLine:K.getArg(t,"line"),generatedColumn:K.getArg(t,"column")},i=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",K.compareByGeneratedPositionsDeflated,K.getArg(t,"bias",Le.GREATEST_LOWER_BOUND));if(i>=0){var n=this._generatedMappings[i];if(n.generatedLine===r.generatedLine){var a=K.getArg(n,"source",null);a!==null&&(a=this._sources.at(a),a=K.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var o=K.getArg(n,"name",null);return o!==null&&(o=this._names.at(o)),{source:a,line:K.getArg(n,"originalLine",null),column:K.getArg(n,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};yt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};yt.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var i=this._findSourceIndex(t);if(i>=0)return this.sourcesContent[i];var n=t;this.sourceRoot!=null&&(n=K.relative(this.sourceRoot,n));var a;if(this.sourceRoot!=null&&(a=K.urlParse(this.sourceRoot))){var o=n.replace(/^file:\/\//,"");if(a.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!a.path||a.path=="/")&&this._sources.has("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(r)return null;throw new Error('"'+n+'" is not in the SourceMap.')};yt.prototype.generatedPositionFor=function(t){var r=K.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var i={source:r,originalLine:K.getArg(t,"line"),originalColumn:K.getArg(t,"column")},n=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",K.compareByOriginalPositions,K.getArg(t,"bias",Le.GREATEST_LOWER_BOUND));if(n>=0){var a=this._originalMappings[n];if(a.source===i.source)return{line:K.getArg(a,"generatedLine",null),column:K.getArg(a,"generatedColumn",null),lastColumn:K.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Cg.BasicSourceMapConsumer=yt;function Xr(e,t){var r=e;typeof e=="string"&&(r=K.parseSourceMapInput(e));var i=K.getArg(r,"version"),n=K.getArg(r,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new vc,this._names=new vc;var a={line:-1,column:0};this._sections=n.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var s=K.getArg(o,"offset"),u=K.getArg(s,"line"),d=K.getArg(s,"column");if(u<a.line||u===a.line&&d<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=s,{generatedOffset:{generatedLine:u+1,generatedColumn:d+1},consumer:new Le(K.getArg(o,"map"),t)}})}Xr.prototype=Object.create(Le.prototype);Xr.prototype.constructor=Le;Xr.prototype._version=3;Object.defineProperty(Xr.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}});Xr.prototype.originalPositionFor=function(t){var r={generatedLine:K.getArg(t,"line"),generatedColumn:K.getArg(t,"column")},i=LC.search(r,this._sections,function(a,o){var s=a.generatedLine-o.generatedOffset.generatedLine;return s||a.generatedColumn-o.generatedOffset.generatedColumn}),n=this._sections[i];return n?n.consumer.originalPositionFor({line:r.generatedLine-(n.generatedOffset.generatedLine-1),column:r.generatedColumn-(n.generatedOffset.generatedLine===r.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}};Xr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};Xr.prototype.sourceContentFor=function(t,r){for(var i=0;i<this._sections.length;i++){var n=this._sections[i],a=n.consumer.sourceContentFor(t,!0);if(a)return a}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')};Xr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var i=this._sections[r];if(i.consumer._findSourceIndex(K.getArg(t,"source"))!==-1){var n=i.consumer.generatedPositionFor(t);if(n){var a={line:n.line+(i.generatedOffset.generatedLine-1),column:n.column+(i.generatedOffset.generatedLine===n.line?i.generatedOffset.generatedColumn-1:0)};return a}}}return{line:null,column:null}};Xr.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var i=0;i<this._sections.length;i++)for(var n=this._sections[i],a=n.consumer._generatedMappings,o=0;o<a.length;o++){var s=a[o],u=n.consumer._sources.at(s.source);u=K.computeSourceURL(n.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var d=null;s.name&&(d=n.consumer._names.at(s.name),this._names.add(d),d=this._names.indexOf(d));var p={source:u,generatedLine:s.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:d};this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}fd(this.__generatedMappings,K.compareByGeneratedPositionsDeflated),fd(this.__originalMappings,K.compareByOriginalPositions)};Cg.IndexedSourceMapConsumer=Xr});var gz=P(hz=>{var Kee=$C().SourceMapGenerator,Ig=yc(),Zee=/(\r?\n)/,qee=10,bc="$$$isSourceNode$$$";function ur(e,t,r,i,n){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=n??null,this[bc]=!0,i!=null&&this.add(i)}ur.fromStringWithSourceMap=function(t,r,i){var n=new ur,a=t.split(Zee),o=0,s=function(){var h=m(),l=m()||"";return h+l;function m(){return o<a.length?a[o++]:void 0}},u=1,d=0,p=null;return r.eachMapping(function(h){if(p!==null)if(u<h.generatedLine)g(p,s()),u++,d=0;else{var l=a[o]||"",m=l.substr(0,h.generatedColumn-d);a[o]=l.substr(h.generatedColumn-d),d=h.generatedColumn,g(p,m),p=h;return}for(;u<h.generatedLine;)n.add(s()),u++;if(d<h.generatedColumn){var l=a[o]||"";n.add(l.substr(0,h.generatedColumn)),a[o]=l.substr(h.generatedColumn),d=h.generatedColumn}p=h},this),o<a.length&&(p&&g(p,s()),n.add(a.splice(o).join(""))),r.sources.forEach(function(h){var l=r.sourceContentFor(h);l!=null&&(i!=null&&(h=Ig.join(i,h)),n.setSourceContent(h,l))}),n;function g(h,l){if(h===null||h.source===void 0)n.add(l);else{var m=i?Ig.join(i,h.source):h.source;n.add(new ur(h.originalLine,h.originalColumn,m,l,h.name))}}};ur.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[bc]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};ur.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[bc]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};ur.prototype.walk=function(t){for(var r,i=0,n=this.children.length;i<n;i++)r=this.children[i],r[bc]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};ur.prototype.join=function(t){var r,i,n=this.children.length;if(n>0){for(r=[],i=0;i<n-1;i++)r.push(this.children[i]),r.push(t);r.push(this.children[i]),this.children=r}return this};ur.prototype.replaceRight=function(t,r){var i=this.children[this.children.length-1];return i[bc]?i.replaceRight(t,r):typeof i=="string"?this.children[this.children.length-1]=i.replace(t,r):this.children.push("".replace(t,r)),this};ur.prototype.setSourceContent=function(t,r){this.sourceContents[Ig.toSetString(t)]=r};ur.prototype.walkSourceContents=function(t){for(var r=0,i=this.children.length;r<i;r++)this.children[r][bc]&&this.children[r].walkSourceContents(t);for(var n=Object.keys(this.sourceContents),r=0,i=n.length;r<i;r++)t(Ig.fromSetString(n[r]),this.sourceContents[n[r]])};ur.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};ur.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},i=new Kee(t),n=!1,a=null,o=null,s=null,u=null;return this.walk(function(d,p){r.code+=d,p.source!==null&&p.line!==null&&p.column!==null?((a!==p.source||o!==p.line||s!==p.column||u!==p.name)&&i.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name}),a=p.source,o=p.line,s=p.column,u=p.name,n=!0):n&&(i.addMapping({generated:{line:r.line,column:r.column}}),a=null,n=!1);for(var g=0,h=d.length;g<h;g++)d.charCodeAt(g)===qee?(r.line++,r.column=0,g+1===h?(a=null,n=!1):n&&i.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name})):r.column++}),this.walkSourceContents(function(d,p){i.setSourceContent(d,p)}),{code:r.code,map:i}};hz.SourceNode=ur});var UC=P(Dg=>{Dg.SourceMapGenerator=$C().SourceMapGenerator;Dg.SourceMapConsumer=fz().SourceMapConsumer;Dg.SourceNode=gz().SourceNode});var _n=P($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.isTrailingCommaEnabled=$e.getParentExportDeclaration=$e.isExportDeclaration=$e.fixFaultyLocations=$e.getTrueLoc=$e.composeSourceMaps=$e.copyPos=$e.comparePos=$e.getUnionOfKeys=$e.getOption=$e.isBrowser=$e.getLineTerminator=void 0;var BC=(le(),Q(ue)),hd=BC.__importDefault((li(),Q(ui))),Hee=BC.__importStar(Ar()),wg=Hee.namedTypes,vz=BC.__importDefault(UC()),yz=vz.default.SourceMapConsumer,Jee=vz.default.SourceMapGenerator,bz=Object.prototype.hasOwnProperty;function Xee(){return Sz()?`
|
|
4
|
+
var xG=Object.create;var Qd=Object.defineProperty;var AG=Object.getOwnPropertyDescriptor;var _G=Object.getOwnPropertyNames;var TG=Object.getPrototypeOf,CG=Object.prototype.hasOwnProperty;var Io=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var HD=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(i){throw r=[i],i}};var P=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Ur=(e,t)=>{for(var r in t)Qd(e,r,{get:t[r],enumerable:!0})},JD=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of _G(t))!CG.call(e,n)&&n!==r&&Qd(e,n,{get:()=>t[n],enumerable:!(i=AG(t,n))||i.enumerable});return e};var ua=(e,t,r)=>(r=e!=null?xG(TG(e)):{},JD(t||!e||!e.__esModule?Qd(r,"default",{value:e,enumerable:!0}):r,e)),Q=e=>JD(Qd({},"__esModule",{value:!0}),e);var Zj=P((Eve,vh)=>{var bj,Sj,Ej,xj,Aj,_j,Tj,Cj,Ij,Dj,wj,kj,Nj,gh,h0,Pj,Rj,Oj,Ms,$j,jj,Mj,Fj,Lj,Uj,zj,Bj,Vj,yh,Gj,Wj,Kj;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){e(r(t,r(i)))}):typeof vh=="object"&&typeof vh.exports=="object"?e(r(t,r(vh.exports))):e(r(t));function r(i,n){return i!==t&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(a,o){return i[a]=n?n(a,o):o}}})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,o){a.__proto__=o}||function(a,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(a[s]=o[s])};bj=function(a,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(a,o);function s(){this.constructor=a}a.prototype=o===null?Object.create(o):(s.prototype=o.prototype,new s)},Sj=Object.assign||function(a){for(var o,s=1,u=arguments.length;s<u;s++){o=arguments[s];for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(a[d]=o[d])}return a},Ej=function(a,o){var s={};for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&o.indexOf(u)<0&&(s[u]=a[u]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,u=Object.getOwnPropertySymbols(a);d<u.length;d++)o.indexOf(u[d])<0&&Object.prototype.propertyIsEnumerable.call(a,u[d])&&(s[u[d]]=a[u[d]]);return s},xj=function(a,o,s,u){var d=arguments.length,p=d<3?o:u===null?u=Object.getOwnPropertyDescriptor(o,s):u,g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(a,o,s,u);else for(var h=a.length-1;h>=0;h--)(g=a[h])&&(p=(d<3?g(p):d>3?g(o,s,p):g(o,s))||p);return d>3&&p&&Object.defineProperty(o,s,p),p},Aj=function(a,o){return function(s,u){o(s,u,a)}},_j=function(a,o,s,u,d,p){function g(C){if(C!==void 0&&typeof C!="function")throw new TypeError("Function expected");return C}for(var h=u.kind,l=h==="getter"?"get":h==="setter"?"set":"value",m=!o&&a?u.static?a:a.prototype:null,f=o||(m?Object.getOwnPropertyDescriptor(m,u.name):{}),y,v=!1,b=s.length-1;b>=0;b--){var A={};for(var x in u)A[x]=x==="access"?{}:u[x];for(var x in u.access)A.access[x]=u.access[x];A.addInitializer=function(C){if(v)throw new TypeError("Cannot add initializers after decoration has completed");p.push(g(C||null))};var _=(0,s[b])(h==="accessor"?{get:f.get,set:f.set}:f[l],A);if(h==="accessor"){if(_===void 0)continue;if(_===null||typeof _!="object")throw new TypeError("Object expected");(y=g(_.get))&&(f.get=y),(y=g(_.set))&&(f.set=y),(y=g(_.init))&&d.unshift(y)}else(y=g(_))&&(h==="field"?d.unshift(y):f[l]=y)}m&&Object.defineProperty(m,u.name,f),v=!0},Tj=function(a,o,s){for(var u=arguments.length>2,d=0;d<o.length;d++)s=u?o[d].call(a,s):o[d].call(a);return u?s:void 0},Cj=function(a){return typeof a=="symbol"?a:"".concat(a)},Ij=function(a,o,s){return typeof o=="symbol"&&(o=o.description?"[".concat(o.description,"]"):""),Object.defineProperty(a,"name",{configurable:!0,value:s?"".concat(s," ",o):o})},Dj=function(a,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(a,o)},wj=function(a,o,s,u){function d(p){return p instanceof s?p:new s(function(g){g(p)})}return new(s||(s=Promise))(function(p,g){function h(f){try{m(u.next(f))}catch(y){g(y)}}function l(f){try{m(u.throw(f))}catch(y){g(y)}}function m(f){f.done?p(f.value):d(f.value).then(h,l)}m((u=u.apply(a,o||[])).next())})},kj=function(a,o){var s={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},u,d,p,g=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return g.next=h(0),g.throw=h(1),g.return=h(2),typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function h(m){return function(f){return l([m,f])}}function l(m){if(u)throw new TypeError("Generator is already executing.");for(;g&&(g=0,m[0]&&(s=0)),s;)try{if(u=1,d&&(p=m[0]&2?d.return:m[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,m[1])).done)return p;switch(d=0,p&&(m=[m[0]&2,p.value]),m[0]){case 0:case 1:p=m;break;case 4:return s.label++,{value:m[1],done:!1};case 5:s.label++,d=m[1],m=[0];continue;case 7:m=s.ops.pop(),s.trys.pop();continue;default:if(p=s.trys,!(p=p.length>0&&p[p.length-1])&&(m[0]===6||m[0]===2)){s=0;continue}if(m[0]===3&&(!p||m[1]>p[0]&&m[1]<p[3])){s.label=m[1];break}if(m[0]===6&&s.label<p[1]){s.label=p[1],p=m;break}if(p&&s.label<p[2]){s.label=p[2],s.ops.push(m);break}p[2]&&s.ops.pop(),s.trys.pop();continue}m=o.call(a,s)}catch(f){m=[6,f],d=0}finally{u=p=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},Nj=function(a,o){for(var s in a)s!=="default"&&!Object.prototype.hasOwnProperty.call(o,s)&&yh(o,a,s)},yh=Object.create?(function(a,o,s,u){u===void 0&&(u=s);var d=Object.getOwnPropertyDescriptor(o,s);(!d||("get"in d?!o.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return o[s]}}),Object.defineProperty(a,u,d)}):(function(a,o,s,u){u===void 0&&(u=s),a[u]=o[s]}),gh=function(a){var o=typeof Symbol=="function"&&Symbol.iterator,s=o&&a[o],u=0;if(s)return s.call(a);if(a&&typeof a.length=="number")return{next:function(){return a&&u>=a.length&&(a=void 0),{value:a&&a[u++],done:!a}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},h0=function(a,o){var s=typeof Symbol=="function"&&a[Symbol.iterator];if(!s)return a;var u=s.call(a),d,p=[],g;try{for(;(o===void 0||o-- >0)&&!(d=u.next()).done;)p.push(d.value)}catch(h){g={error:h}}finally{try{d&&!d.done&&(s=u.return)&&s.call(u)}finally{if(g)throw g.error}}return p},Pj=function(){for(var a=[],o=0;o<arguments.length;o++)a=a.concat(h0(arguments[o]));return a},Rj=function(){for(var a=0,o=0,s=arguments.length;o<s;o++)a+=arguments[o].length;for(var u=Array(a),d=0,o=0;o<s;o++)for(var p=arguments[o],g=0,h=p.length;g<h;g++,d++)u[d]=p[g];return u},Oj=function(a,o,s){if(s||arguments.length===2)for(var u=0,d=o.length,p;u<d;u++)(p||!(u in o))&&(p||(p=Array.prototype.slice.call(o,0,u)),p[u]=o[u]);return a.concat(p||Array.prototype.slice.call(o))},Ms=function(a){return this instanceof Ms?(this.v=a,this):new Ms(a)},$j=function(a,o,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u=s.apply(a,o||[]),d,p=[];return d=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),h("next"),h("throw"),h("return",g),d[Symbol.asyncIterator]=function(){return this},d;function g(b){return function(A){return Promise.resolve(A).then(b,y)}}function h(b,A){u[b]&&(d[b]=function(x){return new Promise(function(_,C){p.push([b,x,_,C])>1||l(b,x)})},A&&(d[b]=A(d[b])))}function l(b,A){try{m(u[b](A))}catch(x){v(p[0][3],x)}}function m(b){b.value instanceof Ms?Promise.resolve(b.value.v).then(f,y):v(p[0][2],b)}function f(b){l("next",b)}function y(b){l("throw",b)}function v(b,A){b(A),p.shift(),p.length&&l(p[0][0],p[0][1])}},jj=function(a){var o,s;return o={},u("next"),u("throw",function(d){throw d}),u("return"),o[Symbol.iterator]=function(){return this},o;function u(d,p){o[d]=a[d]?function(g){return(s=!s)?{value:Ms(a[d](g)),done:!1}:p?p(g):g}:p}},Mj=function(a){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=a[Symbol.asyncIterator],s;return o?o.call(a):(a=typeof gh=="function"?gh(a):a[Symbol.iterator](),s={},u("next"),u("throw"),u("return"),s[Symbol.asyncIterator]=function(){return this},s);function u(p){s[p]=a[p]&&function(g){return new Promise(function(h,l){g=a[p](g),d(h,l,g.done,g.value)})}}function d(p,g,h,l){Promise.resolve(l).then(function(m){p({value:m,done:h})},g)}},Fj=function(a,o){return Object.defineProperty?Object.defineProperty(a,"raw",{value:o}):a.raw=o,a};var r=Object.create?(function(a,o){Object.defineProperty(a,"default",{enumerable:!0,value:o})}):function(a,o){a.default=o},i=function(a){return i=Object.getOwnPropertyNames||function(o){var s=[];for(var u in o)Object.prototype.hasOwnProperty.call(o,u)&&(s[s.length]=u);return s},i(a)};Lj=function(a){if(a&&a.__esModule)return a;var o={};if(a!=null)for(var s=i(a),u=0;u<s.length;u++)s[u]!=="default"&&yh(o,a,s[u]);return r(o,a),o},Uj=function(a){return a&&a.__esModule?a:{default:a}},zj=function(a,o,s,u){if(s==="a"&&!u)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?a!==o||!u:!o.has(a))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?u:s==="a"?u.call(a):u?u.value:o.get(a)},Bj=function(a,o,s,u,d){if(u==="m")throw new TypeError("Private method is not writable");if(u==="a"&&!d)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?a!==o||!d:!o.has(a))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u==="a"?d.call(a,s):d?d.value=s:o.set(a,s),s},Vj=function(a,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof a=="function"?o===a:a.has(o)},Gj=function(a,o,s){if(o!=null){if(typeof o!="object"&&typeof o!="function")throw new TypeError("Object expected.");var u,d;if(s){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");u=o[Symbol.asyncDispose]}if(u===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");u=o[Symbol.dispose],s&&(d=u)}if(typeof u!="function")throw new TypeError("Object not disposable.");d&&(u=function(){try{d.call(this)}catch(p){return Promise.reject(p)}}),a.stack.push({value:o,dispose:u,async:s})}else s&&a.stack.push({async:!0});return o};var n=typeof SuppressedError=="function"?SuppressedError:function(a,o,s){var u=new Error(s);return u.name="SuppressedError",u.error=a,u.suppressed=o,u};Wj=function(a){function o(p){a.error=a.hasError?new n(p,a.error,"An error was suppressed during disposal."):p,a.hasError=!0}var s,u=0;function d(){for(;s=a.stack.pop();)try{if(!s.async&&u===1)return u=0,a.stack.push(s),Promise.resolve().then(d);if(s.dispose){var p=s.dispose.call(s.value);if(s.async)return u|=2,Promise.resolve(p).then(d,function(g){return o(g),d()})}else u|=1}catch(g){o(g)}if(u===1)return a.hasError?Promise.reject(a.error):Promise.resolve();if(a.hasError)throw a.error}return d()},Kj=function(a,o){return typeof a=="string"&&/^\.\.?\//.test(a)?a.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(s,u,d,p,g){return u?o?".jsx":".js":d&&(!p||!g)?s:d+p+"."+g.toLowerCase()+"js"}):a},e("__extends",bj),e("__assign",Sj),e("__rest",Ej),e("__decorate",xj),e("__param",Aj),e("__esDecorate",_j),e("__runInitializers",Tj),e("__propKey",Cj),e("__setFunctionName",Ij),e("__metadata",Dj),e("__awaiter",wj),e("__generator",kj),e("__exportStar",Nj),e("__createBinding",yh),e("__values",gh),e("__read",h0),e("__spread",Pj),e("__spreadArrays",Rj),e("__spreadArray",Oj),e("__await",Ms),e("__asyncGenerator",$j),e("__asyncDelegator",jj),e("__asyncValues",Mj),e("__makeTemplateObject",Fj),e("__importStar",Lj),e("__importDefault",Uj),e("__classPrivateFieldGet",zj),e("__classPrivateFieldSet",Bj),e("__classPrivateFieldIn",Vj),e("__addDisposableResource",Gj),e("__disposeResources",Wj),e("__rewriteRelativeImportExtension",Kj)})});var ue={};Ur(ue,{__addDisposableResource:()=>W8,__assign:()=>y8,__asyncDelegator:()=>M8,__asyncGenerator:()=>j8,__asyncValues:()=>F8,__await:()=>$8,__awaiter:()=>C8,__classPrivateFieldGet:()=>B8,__classPrivateFieldIn:()=>G8,__classPrivateFieldSet:()=>V8,__createBinding:()=>w8,__decorate:()=>b8,__disposeResources:()=>K8,__esDecorate:()=>E8,__exportStar:()=>D8,__extends:()=>g8,__generator:()=>I8,__importDefault:()=>z8,__importStar:()=>U8,__makeTemplateObject:()=>L8,__metadata:()=>T8,__param:()=>S8,__propKey:()=>A8,__read:()=>N8,__rest:()=>v8,__rewriteRelativeImportExtension:()=>Z8,__runInitializers:()=>x8,__setFunctionName:()=>_8,__spread:()=>P8,__spreadArray:()=>O8,__spreadArrays:()=>R8,__values:()=>k8,default:()=>q8});var g0,g8,y8,v8,b8,S8,E8,x8,A8,_8,T8,C8,I8,D8,w8,k8,N8,P8,R8,O8,$8,j8,M8,F8,L8,U8,z8,B8,V8,G8,W8,K8,Z8,q8,le=HD(()=>{g0=ua(Zj(),1),{__extends:g8,__assign:y8,__rest:v8,__decorate:b8,__param:S8,__esDecorate:E8,__runInitializers:x8,__propKey:A8,__setFunctionName:_8,__metadata:T8,__awaiter:C8,__generator:I8,__exportStar:D8,__createBinding:w8,__values:k8,__read:N8,__spread:P8,__spreadArrays:R8,__spreadArray:O8,__await:$8,__asyncGenerator:j8,__asyncDelegator:M8,__asyncValues:F8,__makeTemplateObject:L8,__importStar:U8,__importDefault:z8,__classPrivateFieldGet:B8,__classPrivateFieldSet:V8,__classPrivateFieldIn:G8,__addDisposableResource:W8,__disposeResources:K8,__rewriteRelativeImportExtension:Z8}=g0.default,q8=g0.default});var Ae=P(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});yl.maybeSetModuleExports=void 0;var H8=(le(),Q(ue)),J8=H8.__importDefault(Be());function X8(e){var t=e.use(J8.default),r=t.Type,i=t.builtInTypes,n=i.number;function a(d){return r.from(function(p){return n.check(p)&&p>=d},n+" >= "+d)}var o={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}},s=r.or(i.string,i.number,i.boolean,i.null,i.undefined),u=r.from(function(d){if(d===null)return!0;var p=typeof d;return!(p==="object"||p==="function")},s.toString());return{geq:a,defaults:o,isPrimitive:u}}yl.default=X8;function Y8(e){try{var t=e(),r=t.exports,i=r.default}catch{return}i&&i!==r&&typeof r=="object"&&(Object.assign(i,r,{default:i}),r.__esModule&&Object.defineProperty(i,"__esModule",{value:!0}),t.exports=i)}yl.maybeSetModuleExports=Y8});var Be=P((Sl,Qj)=>{"use strict";Object.defineProperty(Sl,"__esModule",{value:!0});Sl.Def=void 0;var Fs=(le(),Q(ue)),Q8=Ae(),Yj=Object.prototype,Sh=Yj.toString,xr=Yj.hasOwnProperty,bl=(function(){function e(){}return e.prototype.assert=function(t,r){if(!this.check(t,r)){var i=v0(t);throw new Error(i+" does not match type "+this)}return!0},e.prototype.arrayOf=function(){var t=this;return new y0(t)},e})(),y0=(function(e){Fs.__extends(t,e);function t(r){var i=e.call(this)||this;return i.elemType=r,i.kind="ArrayType",i}return t.prototype.toString=function(){return"["+this.elemType+"]"},t.prototype.check=function(r,i){var n=this;return Array.isArray(r)&&r.every(function(a){return n.elemType.check(a,i)})},t})(bl),qj=(function(e){Fs.__extends(t,e);function t(r){var i=e.call(this)||this;return i.value=r,i.kind="IdentityType",i}return t.prototype.toString=function(){return String(this.value)},t.prototype.check=function(r,i){var n=r===this.value;return!n&&typeof i=="function"&&i(this,r),n},t})(bl),Hj=(function(e){Fs.__extends(t,e);function t(r){var i=e.call(this)||this;return i.fields=r,i.kind="ObjectType",i}return t.prototype.toString=function(){return"{ "+this.fields.join(", ")+" }"},t.prototype.check=function(r,i){return Sh.call(r)===Sh.call({})&&this.fields.every(function(n){return n.type.check(r[n.name],i)})},t})(bl),Jj=(function(e){Fs.__extends(t,e);function t(r){var i=e.call(this)||this;return i.types=r,i.kind="OrType",i}return t.prototype.toString=function(){return this.types.join(" | ")},t.prototype.check=function(r,i){return this.types.some(function(n){return n.check(r,!!i)})?!0:(typeof i=="function"&&i(this,r),!1)},t})(bl),vl=(function(e){Fs.__extends(t,e);function t(r,i){var n=e.call(this)||this;return n.name=r,n.predicate=i,n.kind="PredicateType",n}return t.prototype.toString=function(){return this.name},t.prototype.check=function(r,i){var n=this.predicate(r,i);return!n&&typeof i=="function"&&i(this,r),n},t})(bl),bh=(function(){function e(t,r){this.type=t,this.typeName=r,this.baseNames=[],this.ownFields=Object.create(null),this.allSupertypes=Object.create(null),this.supertypeList=[],this.allFields=Object.create(null),this.fieldNames=[],this.finalized=!1,this.buildable=!1,this.buildParams=[]}return e.prototype.isSupertypeOf=function(t){if(t instanceof e){if(this.finalized!==!0||t.finalized!==!0)throw new Error("");return xr.call(t.allSupertypes,this.typeName)}else throw new Error(t+" is not a Def")},e.prototype.checkAllFields=function(t,r){var i=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function n(a){var o=i[a],s=o.type,u=o.getValue(t);return s.check(u,r)}return t!==null&&typeof t=="object"&&Object.keys(i).every(n)},e.prototype.bases=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this.baseNames;if(this.finalized){if(t.length!==i.length)throw new Error("");for(var n=0;n<t.length;n++)if(t[n]!==i[n])throw new Error("");return this}return t.forEach(function(a){i.indexOf(a)<0&&i.push(a)}),this},e})();Sl.Def=bh;var Xj=(function(){function e(t,r,i,n){this.name=t,this.type=r,this.defaultFn=i,this.hidden=!!n}return e.prototype.toString=function(){return JSON.stringify(this.name)+": "+this.type},e.prototype.getValue=function(t){var r=t[this.name];return typeof r<"u"||typeof this.defaultFn=="function"&&(r=this.defaultFn.call(t)),r},e})();function v0(e){return Array.isArray(e)?"["+e.map(v0).join(", ")+"]":e&&typeof e=="object"?"{ "+Object.keys(e).map(function(t){return t+": "+e[t]}).join(", ")+" }":JSON.stringify(e)}function e5(e){var t={or:function(){for(var U=[],V=0;V<arguments.length;V++)U[V]=arguments[V];return new Jj(U.map(function(B){return t.from(B)}))},from:function(U,V){if(U instanceof y0||U instanceof qj||U instanceof Hj||U instanceof Jj||U instanceof vl)return U;if(U instanceof bh)return U.type;if(s.check(U)){if(U.length!==1)throw new Error("only one element type is permitted for typed arrays");return new y0(t.from(U[0]))}if(u.check(U))return new Hj(Object.keys(U).map(function(J){return new Xj(J,t.from(U[J],J))}));if(typeof U=="function"){var B=r.indexOf(U);if(B>=0)return i[B];if(typeof V!="string")throw new Error("missing name");return new vl(V,U)}return new qj(U)},def:function(U){return xr.call(v,U)?v[U]:v[U]=new A(U)},hasDef:function(U){return xr.call(v,U)}},r=[],i=[];function n(U,V){var B=Sh.call(V),J=new vl(U,function(me){return Sh.call(me)===B});return V&&typeof V.constructor=="function"&&(r.push(V.constructor),i.push(J)),J}var a=n("string","truthy"),o=n("function",function(){}),s=n("array",[]),u=n("object",{}),d=n("RegExp",/./),p=n("Date",new Date),g=n("number",3),h=n("boolean",!0),l=n("null",null),m=n("undefined",void 0),f=typeof BigInt=="function"?n("BigInt",BigInt(1234)):new vl("BigInt",function(){return!1}),y={string:a,function:o,array:s,object:u,RegExp:d,Date:p,number:g,boolean:h,null:l,undefined:m,BigInt:f},v=Object.create(null);function b(U){if(U&&typeof U=="object"){var V=U.type;if(typeof V=="string"&&xr.call(v,V)){var B=v[V];if(B.finalized)return B}}return null}var A=(function(U){Fs.__extends(V,U);function V(B){var J=U.call(this,new vl(B,function(me,he){return J.check(me,he)}),B)||this;return J}return V.prototype.check=function(B,J){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(B===null||typeof B!="object")return!1;var me=b(B);return me?J&&me===this?this.checkAllFields(B,J):this.isSupertypeOf(me)?J?me.checkAllFields(B,J)&&this.checkAllFields(B,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(B,J):!1},V.prototype.build=function(){for(var B=this,J=[],me=0;me<arguments.length;me++)J[me]=arguments[me];if(this.buildParams=J,this.buildable)return this;this.field("type",String,function(){return B.typeName}),this.buildable=!0;var he=function(De,Pe,dr,pr){if(!xr.call(De,Pe)){var jt=B.allFields;if(!xr.call(jt,Pe))throw new Error(""+Pe);var mr=jt[Pe],Uc=mr.type,Fn;if(pr)Fn=dr;else if(mr.defaultFn)Fn=mr.defaultFn.call(De);else{var To="no value or default function given for field "+JSON.stringify(Pe)+" of "+B.typeName+"("+B.buildParams.map(function(Ln){return jt[Ln]}).join(", ")+")";throw new Error(To)}if(!Uc.check(Fn))throw new Error(v0(Fn)+" does not match field "+mr+" of type "+B.typeName);De[Pe]=Fn}},nt=function(){for(var De=[],Pe=0;Pe<arguments.length;Pe++)De[Pe]=arguments[Pe];var dr=De.length;if(!B.finalized)throw new Error("attempting to instantiate unfinalized type "+B.typeName);var pr=Object.create(R);if(B.buildParams.forEach(function(jt,mr){mr<dr?he(pr,jt,De[mr],!0):he(pr,jt,null,!1)}),Object.keys(B.allFields).forEach(function(jt){he(pr,jt,null,!1)}),pr.type!==B.typeName)throw new Error("");return pr};return nt.from=function(De){if(!B.finalized)throw new Error("attempting to instantiate unfinalized type "+B.typeName);var Pe=Object.create(R);if(Object.keys(B.allFields).forEach(function(dr){xr.call(De,dr)?he(Pe,dr,De[dr],!0):he(Pe,dr,null,!1)}),Pe.type!==B.typeName)throw new Error("");return Pe},Object.defineProperty(C,Y(this.typeName),{enumerable:!0,value:nt}),this},V.prototype.field=function(B,J,me,he){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(B)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[B]=new Xj(B,t.from(J),me,he),this)},V.prototype.finalize=function(){var B=this;if(!this.finalized){var J=this.allFields,me=this.allSupertypes;this.baseNames.forEach(function(nt){var De=v[nt];if(De instanceof bh)De.finalize(),Mn(J,De.allFields),Mn(me,De.allSupertypes);else{var Pe="unknown supertype name "+JSON.stringify(nt)+" for subtype "+JSON.stringify(B.typeName);throw new Error(Pe)}}),Mn(J,this.ownFields),me[this.typeName]=this,this.fieldNames.length=0;for(var he in J)xr.call(J,he)&&!J[he].hidden&&this.fieldNames.push(he);Object.defineProperty(Me,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,Lc(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&jn(this.typeName)}},V})(bh);function x(U){if(!xr.call(v,U))throw new Error("");var V=v[U];if(V.finalized!==!0)throw new Error("");return V.supertypeList.slice(1)}function _(U){for(var V={},B=Object.keys(v),J=B.length,me=0;me<J;++me){var he=B[me],nt=v[he];if(nt.finalized!==!0)throw new Error(""+he);for(var De=0;De<nt.supertypeList.length;++De){var Pe=nt.supertypeList[De];if(xr.call(U,Pe)){V[he]=Pe;break}}}return V}var C=Object.create(null),R={};function W(U,V){var B=R[U];return m.check(V)?delete R[U]:(o.assert(V),Object.defineProperty(R,U,{enumerable:!0,configurable:!0,value:V})),B}function Y(U){return U.replace(/^[A-Z]+/,function(V){var B=V.length;switch(B){case 0:return"";case 1:return V.toLowerCase();default:return V.slice(0,B-1).toLowerCase()+V.charAt(B-1)}})}function ve(U){return U=Y(U),U.replace(/(Expression)?$/,"Statement")}var Me={};function lr(U){var V=b(U);if(V)return V.fieldNames.slice(0);if("type"in U)throw new Error("did not recognize object of type "+JSON.stringify(U.type));return Object.keys(U)}function $n(U,V){var B=b(U);if(B){var J=B.allFields[V];if(J)return J.getValue(U)}return U&&U[V]}function _o(U,V,B){lr(U).forEach(function(J){V.call(this,J,$n(U,J))},B)}function sa(U,V,B){return lr(U).some(function(J){return V.call(this,J,$n(U,J))},B)}function jn(U){var V=ve(U);if(!C[V]){var B=C[Y(U)];if(B){var J=function(){for(var me=[],he=0;he<arguments.length;he++)me[he]=arguments[he];return C.expressionStatement(B.apply(C,me))};J.from=function(){for(var me=[],he=0;he<arguments.length;he++)me[he]=arguments[he];return C.expressionStatement(B.from.apply(C,me))},C[V]=J}}}function Lc(U,V){V.length=0,V.push(U);for(var B=Object.create(null),J=0;J<V.length;++J){U=V[J];var me=v[U];if(me.finalized!==!0)throw new Error("");xr.call(B,U)&&delete V[B[U]],B[U]=J,V.push.apply(V,me.baseNames)}for(var he=0,nt=he,De=V.length;nt<De;++nt)xr.call(V,nt)&&(V[he++]=V[nt]);V.length=he}function Mn(U,V){return Object.keys(V).forEach(function(B){U[B]=V[B]}),U}function xi(){Object.keys(v).forEach(function(U){v[U].finalize()})}return{Type:t,builtInTypes:y,getSupertypeNames:x,computeSupertypeLookupTable:_,builders:C,defineMethod:W,getBuilderName:Y,getStatementBuilderName:ve,namedTypes:Me,getFieldNames:lr,getFieldValue:$n,eachField:_o,someField:sa,finalize:xi}}Sl.default=e5;(0,Q8.maybeSetModuleExports)(function(){return Qj})});var S0=P((b0,eM)=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});var t5=(le(),Q(ue)),r5=Ae(),n5=t5.__importDefault(Be()),i5=Object.prototype,Eh=i5.hasOwnProperty;function a5(e){var t=e.use(n5.default),r=t.builtInTypes.array,i=t.builtInTypes.number,n=function g(h,l,m){if(!(this instanceof g))throw new Error("Path constructor cannot be invoked without 'new'");if(l){if(!(l instanceof g))throw new Error("")}else l=null,m=null;this.value=h,this.parentPath=l,this.name=m,this.__childCache=null},a=n.prototype;function o(g){return g.__childCache||(g.__childCache=Object.create(null))}function s(g,h){var l=o(g),m=g.getValueProperty(h),f=l[h];return(!Eh.call(l,h)||f.value!==m)&&(f=l[h]=new g.constructor(m,g,h)),f}a.getValueProperty=function(h){return this.value[h]},a.get=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];for(var m=this,f=h.length,y=0;y<f;++y)m=s(m,h[y]);return m},a.each=function(h,l){for(var m=[],f=this.value.length,y=0,y=0;y<f;++y)Eh.call(this.value,y)&&(m[y]=this.get(y));for(l=l||this,y=0;y<f;++y)Eh.call(m,y)&&h.call(l,m[y])},a.map=function(h,l){var m=[];return this.each(function(f){m.push(h.call(this,f))},l),m},a.filter=function(h,l){var m=[];return this.each(function(f){h.call(this,f)&&m.push(f)},l),m};function u(){}function d(g,h,l,m){if(r.assert(g.value),h===0)return u;var f=g.value.length;if(f<1)return u;var y=arguments.length;y===2?(l=0,m=f):y===3?(l=Math.max(l,0),m=f):(l=Math.max(l,0),m=Math.min(m,f)),i.assert(l),i.assert(m);for(var v=Object.create(null),b=o(g),A=l;A<m;++A)if(Eh.call(g.value,A)){var x=g.get(A);if(x.name!==A)throw new Error("");var _=A+h;x.name=_,v[_]=x,delete b[A]}return delete b.length,function(){for(var C in v){var R=v[C];if(R.name!==+C)throw new Error("");b[C]=R,g.value[C]=R.value}}}a.shift=function(){var h=d(this,-1),l=this.value.shift();return h(),l},a.unshift=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];var m=d(this,h.length),f=this.value.unshift.apply(this.value,h);return m(),f},a.push=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];return r.assert(this.value),delete o(this).length,this.value.push.apply(this.value,h)},a.pop=function(){r.assert(this.value);var h=o(this);return delete h[this.value.length-1],delete h.length,this.value.pop()},a.insertAt=function(h){var l=arguments.length,m=d(this,l-1,h);if(m===u&&l<=1)return this;h=Math.max(h,0);for(var f=1;f<l;++f)this.value[h+f-1]=arguments[f];return m(),this},a.insertBefore=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];for(var m=this.parentPath,f=h.length,y=[this.name],v=0;v<f;++v)y.push(h[v]);return m.insertAt.apply(m,y)},a.insertAfter=function(){for(var h=[],l=0;l<arguments.length;l++)h[l]=arguments[l];for(var m=this.parentPath,f=h.length,y=[this.name+1],v=0;v<f;++v)y.push(h[v]);return m.insertAt.apply(m,y)};function p(g){if(!(g instanceof n))throw new Error("");var h=g.parentPath;if(!h)return g;var l=h.value,m=o(h);if(l[g.name]===g.value)m[g.name]=g;else if(r.check(l)){var f=l.indexOf(g.value);f>=0&&(m[g.name=f]=g)}else l[g.name]=g.value,m[g.name]=g;if(l[g.name]!==g.value)throw new Error("");if(g.parentPath.get(g.name)!==g)throw new Error("");return g}return a.replace=function(h){var l=[],m=this.parentPath.value,f=o(this.parentPath),y=arguments.length;if(p(this),r.check(m)){for(var v=m.length,b=d(this.parentPath,y-1,this.name+1),A=[this.name,1],x=0;x<y;++x)A.push(arguments[x]);var _=m.splice.apply(m,A);if(_[0]!==this.value)throw new Error("");if(m.length!==v-1+y)throw new Error("");if(b(),y===0)delete this.value,delete f[this.name],this.__childCache=null;else{if(m[this.name]!==h)throw new Error("");for(this.value!==h&&(this.value=h,this.__childCache=null),x=0;x<y;++x)l.push(this.parentPath.get(this.name+x));if(l[0]!==this)throw new Error("")}}else if(y===1)this.value!==h&&(this.__childCache=null),this.value=m[this.name]=h,l.push(this);else if(y===0)delete m[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return l},n}b0.default=a5;(0,r5.maybeSetModuleExports)(function(){return eM})});var rM=P((E0,tM)=>{"use strict";Object.defineProperty(E0,"__esModule",{value:!0});var o5=(le(),Q(ue)),s5=Ae(),c5=o5.__importDefault(Be()),Ls=Object.prototype.hasOwnProperty;function u5(e){var t=e.use(c5.default),r=t.Type,i=t.namedTypes,n=i.Node,a=i.Expression,o=t.builtInTypes.array,s=t.builders,u=function x(_,C){if(!(this instanceof x))throw new Error("Scope constructor cannot be invoked without 'new'");p.check(_.value)||d.assert(_.value);var R;if(C){if(!(C instanceof x))throw new Error("");R=C.depth+1}else C=null,R=0;Object.defineProperties(this,{path:{value:_},node:{value:_.value},isGlobal:{value:!C,enumerable:!0},depth:{value:R},parent:{value:C},bindings:{value:{}},types:{value:{}}})},d=r.or(i.Program,i.Function,i.CatchClause),p=r.or(i.Function,i.ClassDeclaration,i.ClassExpression,i.InterfaceDeclaration,i.TSInterfaceDeclaration,i.TypeAlias,i.TSTypeAliasDeclaration),g=r.or(i.TypeParameter,i.TSTypeParameter);u.isEstablishedBy=function(x){return d.check(x)||p.check(x)};var h=u.prototype;h.didScan=!1,h.declares=function(x){return this.scan(),Ls.call(this.bindings,x)},h.declaresType=function(x){return this.scan(),Ls.call(this.types,x)},h.declareTemporary=function(x){if(x){if(!/^[a-z$_]/i.test(x))throw new Error("")}else x="t$";x+=this.depth.toString(36)+"$",this.scan();for(var _=0;this.declares(x+_);)++_;var C=x+_;return this.bindings[C]=t.builders.identifier(C)},h.injectTemporary=function(x,_){x||(x=this.declareTemporary());var C=this.path.get("body");return i.BlockStatement.check(C.value)&&(C=C.get("body")),C.unshift(s.variableDeclaration("var",[s.variableDeclarator(x,_||null)])),x},h.scan=function(x){if(x||!this.didScan){for(var _ in this.bindings)delete this.bindings[_];for(var _ in this.types)delete this.types[_];l(this.path,this.bindings,this.types),this.didScan=!0}},h.getBindings=function(){return this.scan(),this.bindings},h.getTypes=function(){return this.scan(),this.types};function l(x,_,C){var R=x.value;if(p.check(R)){var W=x.get("typeParameters","params");o.check(W.value)&&W.each(function(Y){A(Y,C)})}d.check(R)&&(i.CatchClause.check(R)?v(x.get("param"),_):m(x,_,C))}function m(x,_,C){var R=x.value;x.parent&&i.FunctionExpression.check(x.parent.node)&&x.parent.node.id&&v(x.parent.get("id"),_),R&&(o.check(R)?x.each(function(W){y(W,_,C)}):i.Function.check(R)?(x.get("params").each(function(W){v(W,_)}),y(x.get("body"),_,C),m(x.get("typeParameters"),_,C)):i.TypeAlias&&i.TypeAlias.check(R)||i.InterfaceDeclaration&&i.InterfaceDeclaration.check(R)||i.TSTypeAliasDeclaration&&i.TSTypeAliasDeclaration.check(R)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(R)?b(x.get("id"),C):i.VariableDeclarator.check(R)?(v(x.get("id"),_),y(x.get("init"),_,C)):R.type==="ImportSpecifier"||R.type==="ImportNamespaceSpecifier"||R.type==="ImportDefaultSpecifier"?v(x.get(R.local?"local":R.name?"name":"id"),_):n.check(R)&&!a.check(R)&&t.eachField(R,function(W,Y){var ve=x.get(W);if(!f(ve,Y))throw new Error("");y(ve,_,C)}))}function f(x,_){return!!(x.value===_||Array.isArray(x.value)&&x.value.length===0&&Array.isArray(_)&&_.length===0)}function y(x,_,C){var R=x.value;if(!(!R||a.check(R)))if(i.FunctionDeclaration.check(R)&&R.id!==null)v(x.get("id"),_);else if(i.ClassDeclaration&&i.ClassDeclaration.check(R)&&R.id!==null)v(x.get("id"),_),m(x.get("typeParameters"),_,C);else if(i.InterfaceDeclaration&&i.InterfaceDeclaration.check(R)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(R))b(x.get("id"),C);else if(d.check(R)){if(i.CatchClause.check(R)&&i.Identifier.check(R.param)){var W=R.param.name,Y=Ls.call(_,W);m(x.get("body"),_,C),Y||delete _[W]}}else m(x,_,C)}function v(x,_){var C=x.value;i.Pattern.assert(C),i.Identifier.check(C)?Ls.call(_,C.name)?_[C.name].push(x):_[C.name]=[x]:i.AssignmentPattern&&i.AssignmentPattern.check(C)?v(x.get("left"),_):i.ObjectPattern&&i.ObjectPattern.check(C)?x.get("properties").each(function(R){var W=R.value;i.Pattern.check(W)?v(R,_):i.Property.check(W)||i.ObjectProperty&&i.ObjectProperty.check(W)?v(R.get("value"),_):i.SpreadProperty&&i.SpreadProperty.check(W)&&v(R.get("argument"),_)}):i.ArrayPattern&&i.ArrayPattern.check(C)?x.get("elements").each(function(R){var W=R.value;i.Pattern.check(W)?v(R,_):i.SpreadElement&&i.SpreadElement.check(W)&&v(R.get("argument"),_)}):i.PropertyPattern&&i.PropertyPattern.check(C)?v(x.get("pattern"),_):(i.SpreadElementPattern&&i.SpreadElementPattern.check(C)||i.RestElement&&i.RestElement.check(C)||i.SpreadPropertyPattern&&i.SpreadPropertyPattern.check(C))&&v(x.get("argument"),_)}function b(x,_){var C=x.value;i.Pattern.assert(C),i.Identifier.check(C)&&(Ls.call(_,C.name)?_[C.name].push(x):_[C.name]=[x])}function A(x,_){var C=x.value;g.assert(C),Ls.call(_,C.name)?_[C.name].push(x):_[C.name]=[x]}return h.lookup=function(x){for(var _=this;_&&!_.declares(x);_=_.parent);return _},h.lookupType=function(x){for(var _=this;_&&!_.declaresType(x);_=_.parent);return _},h.getGlobalScope=function(){for(var x=this;!x.isGlobal;)x=x.parent;return x},u}E0.default=u5;(0,s5.maybeSetModuleExports)(function(){return tM})});var _0=P((A0,nM)=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});var x0=(le(),Q(ue)),l5=x0.__importDefault(Be()),d5=x0.__importDefault(S0()),p5=x0.__importDefault(rM()),m5=Ae();function f5(e){var t=e.use(l5.default),r=t.namedTypes,i=t.builders,n=t.builtInTypes.number,a=t.builtInTypes.array,o=e.use(d5.default),s=e.use(p5.default),u=function v(b,A,x){if(!(this instanceof v))throw new Error("NodePath constructor cannot be invoked without 'new'");o.call(this,b,A,x)},d=u.prototype=Object.create(o.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(d,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),d.replace=function(){return delete this.node,delete this.parent,delete this.scope,o.prototype.replace.apply(this,arguments)},d.prune=function(){var v=this.parent;return this.replace(),f(v)},d._computeNode=function(){var v=this.value;if(r.Node.check(v))return v;var b=this.parentPath;return b&&b.node||null},d._computeParent=function(){var v=this.value,b=this.parentPath;if(!r.Node.check(v)){for(;b&&!r.Node.check(b.value);)b=b.parentPath;b&&(b=b.parentPath)}for(;b&&!r.Node.check(b.value);)b=b.parentPath;return b||null},d._computeScope=function(){var v=this.value,b=this.parentPath,A=b&&b.scope;return r.Node.check(v)&&s.isEstablishedBy(v)&&(A=new s(this,A)),A||null},d.getValueProperty=function(v){return t.getFieldValue(this.value,v)},d.needsParens=function(v){var b=this.parentPath;if(!b)return!1;var A=this.value;if(!r.Expression.check(A)||A.type==="Identifier")return!1;for(;!r.Node.check(b.value);)if(b=b.parentPath,!b)return!1;var x=b.value;switch(A.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return x.type==="MemberExpression"&&this.name==="object"&&x.object===A;case"BinaryExpression":case"LogicalExpression":switch(x.type){case"CallExpression":return this.name==="callee"&&x.callee===A;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&x.object===A;case"BinaryExpression":case"LogicalExpression":{var _=A,C=x.operator,R=h[C],W=_.operator,Y=h[W];if(R>Y)return!0;if(R===Y&&this.name==="right"){if(x.right!==_)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(x.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(x.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return x.type==="MemberExpression"&&n.check(A.value)&&this.name==="object"&&x.object===A;case"AssignmentExpression":case"ConditionalExpression":switch(x.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&x.callee===A;case"ConditionalExpression":return this.name==="test"&&x.test===A;case"MemberExpression":return this.name==="object"&&x.object===A;default:return!1}default:if(x.type==="NewExpression"&&this.name==="callee"&&x.callee===A)return l(A)}return!!(v!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function p(v){return r.BinaryExpression.check(v)||r.LogicalExpression.check(v)}function g(v){return r.UnaryExpression.check(v)||r.SpreadElement&&r.SpreadElement.check(v)||r.SpreadProperty&&r.SpreadProperty.check(v)}var h={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(v,b){v.forEach(function(A){h[A]=b})});function l(v){return r.CallExpression.check(v)?!0:a.check(v)?v.some(l):r.Node.check(v)?t.someField(v,function(b,A){return l(A)}):!1}d.canBeFirstInStatement=function(){var v=this.node;return!r.FunctionExpression.check(v)&&!r.ObjectExpression.check(v)},d.firstInStatement=function(){return m(this)};function m(v){for(var b,A;v.parent;v=v.parent){if(b=v.node,A=v.parent.node,r.BlockStatement.check(A)&&v.parent.name==="body"&&v.name===0){if(A.body[0]!==b)throw new Error("Nodes must be equal");return!0}if(r.ExpressionStatement.check(A)&&v.name==="expression"){if(A.expression!==b)throw new Error("Nodes must be equal");return!0}if(r.SequenceExpression.check(A)&&v.parent.name==="expressions"&&v.name===0){if(A.expressions[0]!==b)throw new Error("Nodes must be equal");continue}if(r.CallExpression.check(A)&&v.name==="callee"){if(A.callee!==b)throw new Error("Nodes must be equal");continue}if(r.MemberExpression.check(A)&&v.name==="object"){if(A.object!==b)throw new Error("Nodes must be equal");continue}if(r.ConditionalExpression.check(A)&&v.name==="test"){if(A.test!==b)throw new Error("Nodes must be equal");continue}if(p(A)&&v.name==="left"){if(A.left!==b)throw new Error("Nodes must be equal");continue}if(r.UnaryExpression.check(A)&&!A.prefix&&v.name==="argument"){if(A.argument!==b)throw new Error("Nodes must be equal");continue}return!1}return!0}function f(v){if(r.VariableDeclaration.check(v.node)){var b=v.get("declarations").value;if(!b||b.length===0)return v.prune()}else if(r.ExpressionStatement.check(v.node)){if(!v.get("expression").value)return v.prune()}else r.IfStatement.check(v.node)&&y(v);return v}function y(v){var b=v.get("test").value,A=v.get("alternate").value,x=v.get("consequent").value;if(!x&&!A){var _=i.expressionStatement(b);v.replace(_)}else if(!x&&A){var C=i.unaryExpression("!",b,!0);r.UnaryExpression.check(b)&&b.operator==="!"&&(C=b.argument),v.get("test").replace(C),v.get("consequent").replace(A),v.get("alternate").replace()}}return u}A0.default=f5;(0,m5.maybeSetModuleExports)(function(){return nM})});var oM=P((T0,aM)=>{"use strict";Object.defineProperty(T0,"__esModule",{value:!0});var iM=(le(),Q(ue)),h5=iM.__importDefault(Be()),g5=iM.__importDefault(_0()),y5=Ae(),xh=Object.prototype.hasOwnProperty;function v5(e){var t=e.use(h5.default),r=e.use(g5.default),i=t.builtInTypes.array,n=t.builtInTypes.object,a=t.builtInTypes.function,o,s=function m(){if(!(this instanceof m))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=u(this),this._shouldVisitComments=xh.call(this._methodNameTable,"Block")||xh.call(this._methodNameTable,"Line"),this.Context=h(this),this._visiting=!1,this._changeReported=!1};function u(m){var f=Object.create(null);for(var y in m)/^visit[A-Z]/.test(y)&&(f[y.slice(5)]=!0);for(var v=t.computeSupertypeLookupTable(f),b=Object.create(null),A=Object.keys(v),x=A.length,_=0;_<x;++_){var C=A[_];y="visit"+v[C],a.check(m[y])&&(b[C]=y)}return b}s.fromMethodsObject=function(f){if(f instanceof s)return f;if(!n.check(f))return new s;var y=function b(){if(!(this instanceof b))throw new Error("Visitor constructor cannot be invoked without 'new'");s.call(this)},v=y.prototype=Object.create(p);return v.constructor=y,d(v,f),d(y,s),a.assert(y.fromMethodsObject),a.assert(y.visit),new y};function d(m,f){for(var y in f)xh.call(f,y)&&(m[y]=f[y]);return m}s.visit=function(f,y){return s.fromMethodsObject(y).visit(f)};var p=s.prototype;p.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var m=arguments.length,f=new Array(m),y=0;y<m;++y)f[y]=arguments[y];f[0]instanceof r||(f[0]=new r({root:f[0]}).get("root")),this.reset.apply(this,f);var v;try{var b=this.visitWithoutReset(f[0]);v=!0}finally{if(this._visiting=!1,!v&&this._abortRequested)return f[0].value}return b},p.AbortRequest=function(){},p.abort=function(){var m=this;m._abortRequested=!0;var f=new m.AbortRequest;throw f.cancel=function(){m._abortRequested=!1},f},p.reset=function(m){},p.visitWithoutReset=function(m){if(this instanceof this.Context)return this.visitor.visitWithoutReset(m);if(!(m instanceof r))throw new Error("");var f=m.value,y=f&&typeof f=="object"&&typeof f.type=="string"&&this._methodNameTable[f.type];if(y){var v=this.acquireContext(m);try{return v.invokeVisitorMethod(y)}finally{this.releaseContext(v)}}else return g(m,this)};function g(m,f){if(!(m instanceof r))throw new Error("");if(!(f instanceof s))throw new Error("");var y=m.value;if(i.check(y))m.each(f.visitWithoutReset,f);else if(n.check(y)){var v=t.getFieldNames(y);f._shouldVisitComments&&y.comments&&v.indexOf("comments")<0&&v.push("comments");for(var b=v.length,A=[],x=0;x<b;++x){var _=v[x];xh.call(y,_)||(y[_]=t.getFieldValue(y,_)),A.push(m.get(_))}for(var x=0;x<b;++x)f.visitWithoutReset(A[x])}return m.value}p.acquireContext=function(m){return this._reusableContextStack.length===0?new this.Context(m):this._reusableContextStack.pop().reset(m)},p.releaseContext=function(m){if(!(m instanceof this.Context))throw new Error("");this._reusableContextStack.push(m),m.currentPath=null},p.reportChanged=function(){this._changeReported=!0},p.wasChangeReported=function(){return this._changeReported};function h(m){function f(v){if(!(this instanceof f))throw new Error("");if(!(this instanceof s))throw new Error("");if(!(v instanceof r))throw new Error("");Object.defineProperty(this,"visitor",{value:m,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=v,this.needToCallTraverse=!0,Object.seal(this)}if(!(m instanceof s))throw new Error("");var y=f.prototype=Object.create(m);return y.constructor=f,d(y,l),f}var l=Object.create(null);return l.reset=function(f){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");return this.currentPath=f,this.needToCallTraverse=!0,this},l.invokeVisitorMethod=function(f){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");var y=this.visitor[f].call(this,this.currentPath);if(y===!1?this.needToCallTraverse=!1:y!==o&&(this.currentPath=this.currentPath.replace(y)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+f);var v=this.currentPath;return v&&v.value},l.traverse=function(f,y){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");return this.needToCallTraverse=!1,g(f,s.fromMethodsObject(y||this.visitor))},l.visit=function(f,y){if(!(this instanceof this.Context))throw new Error("");if(!(f instanceof r))throw new Error("");if(!(this.currentPath instanceof r))throw new Error("");return this.needToCallTraverse=!1,s.fromMethodsObject(y||this.visitor).visitWithoutReset(f)},l.reportChanged=function(){this.visitor.reportChanged()},l.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},s}T0.default=v5;(0,y5.maybeSetModuleExports)(function(){return aM})});var cM=P((C0,sM)=>{"use strict";Object.defineProperty(C0,"__esModule",{value:!0});var b5=(le(),Q(ue)),S5=Ae(),E5=b5.__importDefault(Be());function x5(e){var t=e.use(E5.default),r=t.getFieldNames,i=t.getFieldValue,n=t.builtInTypes.array,a=t.builtInTypes.object,o=t.builtInTypes.Date,s=t.builtInTypes.RegExp,u=Object.prototype.hasOwnProperty;function d(m,f,y){return n.check(y)?y.length=0:y=null,g(m,f,y)}d.assert=function(m,f){var y=[];if(!d(m,f,y))if(y.length===0){if(m!==f)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+y.map(p).join(""))};function p(m){return/[_$a-z][_$a-z0-9]*/i.test(m)?"."+m:"["+JSON.stringify(m)+"]"}function g(m,f,y){return m===f?!0:n.check(m)?h(m,f,y):a.check(m)?l(m,f,y):o.check(m)?o.check(f)&&+m==+f:s.check(m)?s.check(f)&&m.source===f.source&&m.global===f.global&&m.multiline===f.multiline&&m.ignoreCase===f.ignoreCase:m==f}function h(m,f,y){n.assert(m);var v=m.length;if(!n.check(f)||f.length!==v)return y&&y.push("length"),!1;for(var b=0;b<v;++b){if(y&&y.push(b),b in m!=b in f||!g(m[b],f[b],y))return!1;if(y){var A=y.pop();if(A!==b)throw new Error(""+A)}}return!0}function l(m,f,y){if(a.assert(m),!a.check(f))return!1;if(m.type!==f.type)return y&&y.push("type"),!1;var v=r(m),b=v.length,A=r(f),x=A.length;if(b===x){for(var _=0;_<b;++_){var C=v[_],R=i(m,C),W=i(f,C);if(y&&y.push(C),!g(R,W,y))return!1;if(y){var Y=y.pop();if(Y!==C)throw new Error(""+Y)}}return!0}if(!y)return!1;var ve=Object.create(null);for(_=0;_<b;++_)ve[v[_]]=!0;for(_=0;_<x;++_){if(C=A[_],!u.call(ve,C))return y.push(C),!1;delete ve[C]}for(C in ve){y.push(C);break}return!1}return d}C0.default=x5;(0,S5.maybeSetModuleExports)(function(){return sM})});var lM=P((I0,uM)=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});var El=(le(),Q(ue)),A5=El.__importDefault(Be()),_5=El.__importDefault(oM()),T5=El.__importDefault(cM()),C5=El.__importDefault(S0()),I5=El.__importDefault(_0()),D5=Ae();function w5(e){var t=k5(),r=t.use(A5.default);e.forEach(t.use),r.finalize();var i=t.use(_5.default);return{Type:r.Type,builtInTypes:r.builtInTypes,namedTypes:r.namedTypes,builders:r.builders,defineMethod:r.defineMethod,getFieldNames:r.getFieldNames,getFieldValue:r.getFieldValue,eachField:r.eachField,someField:r.someField,getSupertypeNames:r.getSupertypeNames,getBuilderName:r.getBuilderName,astNodesAreEquivalent:t.use(T5.default),finalize:r.finalize,Path:t.use(C5.default),NodePath:t.use(I5.default),PathVisitor:i,use:t.use,visit:i.visit}}I0.default=w5;function k5(){var e=[],t=[];function r(n){var a=e.indexOf(n);return a===-1&&(a=e.length,e.push(n),t[a]=n(i)),t[a]}var i={use:r};return i}(0,D5.maybeSetModuleExports)(function(){return uM})});var w0=P((D0,dM)=>{"use strict";Object.defineProperty(D0,"__esModule",{value:!0});var N5=Ae();function P5(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}D0.default=P5;(0,N5.maybeSetModuleExports)(function(){return dM})});var N0=P((k0,pM)=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});var R5=(le(),Q(ue)),O5=Ae(),$5=R5.__importDefault(w0());function j5(e){var t=e.use($5.default);return t.BinaryOperators.indexOf("**")<0&&t.BinaryOperators.push("**"),t.AssignmentOperators.indexOf("**=")<0&&t.AssignmentOperators.push("**="),t}k0.default=j5;(0,O5.maybeSetModuleExports)(function(){return pM})});var R0=P((P0,mM)=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});var M5=(le(),Q(ue)),F5=Ae(),L5=M5.__importDefault(N0());function U5(e){var t=e.use(L5.default);return t.LogicalOperators.indexOf("??")<0&&t.LogicalOperators.push("??"),t}P0.default=U5;(0,F5.maybeSetModuleExports)(function(){return mM})});var hM=P((O0,fM)=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});var z5=(le(),Q(ue)),B5=Ae(),V5=z5.__importDefault(R0());function G5(e){var t=e.use(V5.default);return t.LogicalOperators.forEach(function(r){var i=r+"=";t.AssignmentOperators.indexOf(i)<0&&t.AssignmentOperators.push(i)}),t}O0.default=G5;(0,B5.maybeSetModuleExports)(function(){return fM})});var vM=P((j0,yM)=>{"use strict";Object.defineProperty(j0,"__esModule",{value:!0});var $0=(le(),Q(ue)),W5=$0.__importDefault(w0()),K5=$0.__importDefault(Be()),gM=$0.__importStar(Ae());function Z5(e){var t=e.use(K5.default),r=t.Type,i=r.def,n=r.or,a=e.use(gM.default),o=a.defaults,s=a.geq,u=e.use(W5.default),d=u.BinaryOperators,p=u.AssignmentOperators,g=u.LogicalOperators;i("Printable").field("loc",n(i("SourceLocation"),null),o.null,!0),i("Node").bases("Printable").field("type",String).field("comments",n([i("Comment")],null),o.null,!0),i("SourceLocation").field("start",i("Position")).field("end",i("Position")).field("source",n(String,null),o.null),i("Position").field("line",s(1)).field("column",s(0)),i("File").bases("Node").build("program","name").field("program",i("Program")).field("name",n(String,null),o.null),i("Program").bases("Node").build("body").field("body",[i("Statement")]),i("Function").bases("Node").field("id",n(i("Identifier"),null),o.null).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("generator",Boolean,o.false).field("async",Boolean,o.false),i("Statement").bases("Node"),i("EmptyStatement").bases("Statement").build(),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]),i("ExpressionStatement").bases("Statement").build("expression").field("expression",i("Expression")),i("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Statement")).field("alternate",n(i("Statement"),null),o.null),i("LabeledStatement").bases("Statement").build("label","body").field("label",i("Identifier")).field("body",i("Statement")),i("BreakStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("ContinueStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("WithStatement").bases("Statement").build("object","body").field("object",i("Expression")).field("body",i("Statement")),i("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",i("Expression")).field("cases",[i("SwitchCase")]).field("lexical",Boolean,o.false),i("ReturnStatement").bases("Statement").build("argument").field("argument",n(i("Expression"),null)),i("ThrowStatement").bases("Statement").build("argument").field("argument",i("Expression")),i("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",i("BlockStatement")).field("handler",n(i("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[i("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[i("CatchClause")],o.emptyArray).field("finalizer",n(i("BlockStatement"),null),o.null),i("CatchClause").bases("Node").build("param","guard","body").field("param",i("Pattern")).field("guard",n(i("Expression"),null),o.null).field("body",i("BlockStatement")),i("WhileStatement").bases("Statement").build("test","body").field("test",i("Expression")).field("body",i("Statement")),i("DoWhileStatement").bases("Statement").build("body","test").field("body",i("Statement")).field("test",i("Expression")),i("ForStatement").bases("Statement").build("init","test","update","body").field("init",n(i("VariableDeclaration"),i("Expression"),null)).field("test",n(i("Expression"),null)).field("update",n(i("Expression"),null)).field("body",i("Statement")),i("ForInStatement").bases("Statement").build("left","right","body").field("left",n(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("DebuggerStatement").bases("Statement").build(),i("Declaration").bases("Statement"),i("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",i("Identifier")),i("FunctionExpression").bases("Function","Expression").build("id","params","body"),i("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",n("var","let","const")).field("declarations",[i("VariableDeclarator")]),i("VariableDeclarator").bases("Node").build("id","init").field("id",i("Pattern")).field("init",n(i("Expression"),null),o.null),i("Expression").bases("Node"),i("ThisExpression").bases("Expression").build(),i("ArrayExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),null)]),i("ObjectExpression").bases("Expression").build("properties").field("properties",[i("Property")]),i("Property").bases("Node").build("kind","key","value").field("kind",n("init","get","set")).field("key",n(i("Literal"),i("Identifier"))).field("value",i("Expression")),i("SequenceExpression").bases("Expression").build("expressions").field("expressions",[i("Expression")]);var h=n("-","+","!","~","typeof","void","delete");i("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",h).field("argument",i("Expression")).field("prefix",Boolean,o.true);var l=n.apply(void 0,d);i("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",l).field("left",i("Expression")).field("right",i("Expression"));var m=n.apply(void 0,p);i("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",m).field("left",n(i("Pattern"),i("MemberExpression"))).field("right",i("Expression"));var f=n("++","--");i("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",i("Expression")).field("prefix",Boolean);var y=n.apply(void 0,g);i("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",y).field("left",i("Expression")).field("right",i("Expression")),i("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Expression")).field("alternate",i("Expression")),i("NewExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("CallExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("MemberExpression").bases("Expression").build("object","property","computed").field("object",i("Expression")).field("property",n(i("Identifier"),i("Expression"))).field("computed",Boolean,function(){var v=this.property.type;return v==="Literal"||v==="MemberExpression"||v==="BinaryExpression"}),i("Pattern").bases("Node"),i("SwitchCase").bases("Node").build("test","consequent").field("test",n(i("Expression"),null)).field("consequent",[i("Statement")]),i("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,o.false),i("Literal").bases("Expression").build("value").field("value",n(String,Boolean,null,Number,RegExp,BigInt)),i("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}j0.default=Z5;(0,gM.maybeSetModuleExports)(function(){return yM})});var EM=P((F0,SM)=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});var M0=(le(),Q(ue)),q5=M0.__importDefault(vM()),H5=M0.__importDefault(Be()),bM=M0.__importStar(Ae());function J5(e){e.use(q5.default);var t=e.use(H5.default),r=t.Type.def,i=t.Type.or,n=e.use(bM.default).defaults;r("Function").field("generator",Boolean,n.false).field("expression",Boolean,n.false).field("defaults",[i(r("Expression"),null)],n.emptyArray).field("rest",i(r("Identifier"),null),n.null),r("RestElement").bases("Pattern").build("argument").field("argument",r("Pattern")).field("typeAnnotation",i(r("TypeAnnotation"),r("TSTypeAnnotation"),null),n.null),r("SpreadElementPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("FunctionDeclaration").build("id","params","body","generator","expression").field("id",i(r("Identifier"),null)),r("FunctionExpression").build("id","params","body","generator","expression"),r("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,n.null).field("body",i(r("BlockStatement"),r("Expression"))).field("generator",!1,n.false),r("ForOfStatement").bases("Statement").build("left","right","body").field("left",i(r("VariableDeclaration"),r("Pattern"))).field("right",r("Expression")).field("body",r("Statement")),r("YieldExpression").bases("Expression").build("argument","delegate").field("argument",i(r("Expression"),null)).field("delegate",Boolean,n.false),r("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",r("Expression")).field("blocks",[r("ComprehensionBlock")]).field("filter",i(r("Expression"),null)),r("ComprehensionBlock").bases("Node").build("left","right","each").field("left",r("Pattern")).field("right",r("Expression")).field("each",Boolean),r("Property").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("value",i(r("Expression"),r("Pattern"))).field("method",Boolean,n.false).field("shorthand",Boolean,n.false).field("computed",Boolean,n.false),r("ObjectProperty").field("shorthand",Boolean,n.false),r("PropertyPattern").bases("Pattern").build("key","pattern").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("pattern",r("Pattern")).field("computed",Boolean,n.false),r("ObjectPattern").bases("Pattern").build("properties").field("properties",[i(r("PropertyPattern"),r("Property"))]),r("ArrayPattern").bases("Pattern").build("elements").field("elements",[i(r("Pattern"),null)]),r("SpreadElement").bases("Node").build("argument").field("argument",r("Expression")),r("ArrayExpression").field("elements",[i(r("Expression"),r("SpreadElement"),r("RestElement"),null)]),r("NewExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("CallExpression").field("arguments",[i(r("Expression"),r("SpreadElement"))]),r("AssignmentPattern").bases("Pattern").build("left","right").field("left",r("Pattern")).field("right",r("Expression")),r("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",i("constructor","method","get","set")).field("key",r("Expression")).field("value",r("Function")).field("computed",Boolean,n.false).field("static",Boolean,n.false);var a=i(r("MethodDefinition"),r("VariableDeclarator"),r("ClassPropertyDefinition"),r("ClassProperty"),r("StaticBlock"));r("ClassProperty").bases("Declaration").build("key").field("key",i(r("Literal"),r("Identifier"),r("Expression"))).field("computed",Boolean,n.false),r("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",a),r("ClassBody").bases("Declaration").build("body").field("body",[a]),r("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",i(r("Identifier"),null)).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),n.null),r("ClassExpression").bases("Expression").build("id","body","superClass").field("id",i(r("Identifier"),null),n.null).field("body",r("ClassBody")).field("superClass",i(r("Expression"),null),n.null),r("Super").bases("Expression").build(),r("Specifier").bases("Node"),r("ModuleSpecifier").bases("Specifier").field("local",i(r("Identifier"),null),n.null).field("id",i(r("Identifier"),null),n.null).field("name",i(r("Identifier"),null),n.null),r("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",r("Identifier")),r("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),r("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),r("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[i(r("ImportSpecifier"),r("ImportNamespaceSpecifier"),r("ImportDefaultSpecifier"))],n.emptyArray).field("source",r("Literal")).field("importKind",i("value","type"),function(){return"value"}),r("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",i(r("Declaration"),null)).field("specifiers",[r("ExportSpecifier")],n.emptyArray).field("source",i(r("Literal"),null),n.null),r("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",r("Identifier")),r("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",i(r("Declaration"),r("Expression"))),r("ExportAllDeclaration").bases("Declaration").build("source").field("source",r("Literal")),r("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",r("Expression")).field("quasi",r("TemplateLiteral")),r("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[r("TemplateElement")]).field("expressions",[r("Expression")]),r("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),r("MetaProperty").bases("Expression").build("meta","property").field("meta",r("Identifier")).field("property",r("Identifier"))}F0.default=J5;(0,bM.maybeSetModuleExports)(function(){return SM})});var _M=P((L0,AM)=>{"use strict";Object.defineProperty(L0,"__esModule",{value:!0});var xM=(le(),Q(ue)),X5=xM.__importDefault(N0()),Y5=xM.__importDefault(EM()),Q5=Ae();function eY(e){e.use(X5.default),e.use(Y5.default)}L0.default=eY;(0,Q5.maybeSetModuleExports)(function(){return AM})});var IM=P((z0,CM)=>{"use strict";Object.defineProperty(z0,"__esModule",{value:!0});var U0=(le(),Q(ue)),tY=U0.__importDefault(_M()),rY=U0.__importDefault(Be()),TM=U0.__importStar(Ae());function nY(e){e.use(tY.default);var t=e.use(rY.default),r=t.Type.def,i=e.use(TM.default).defaults;r("Function").field("async",Boolean,i.false),r("AwaitExpression").bases("Expression").build("argument").field("argument",r("Expression"))}z0.default=nY;(0,TM.maybeSetModuleExports)(function(){return CM})});var kM=P((V0,wM)=>{"use strict";Object.defineProperty(V0,"__esModule",{value:!0});var B0=(le(),Q(ue)),iY=B0.__importDefault(IM()),aY=B0.__importDefault(Be()),DM=B0.__importStar(Ae());function oY(e){e.use(iY.default);var t=e.use(aY.default),r=t.Type.def,i=t.Type.or,n=e.use(DM.default).defaults;r("ForOfStatement").field("await",Boolean,n.false),r("SpreadProperty").bases("Node").build("argument").field("argument",r("Expression")),r("ObjectExpression").field("properties",[i(r("Property"),r("SpreadProperty"),r("SpreadElement"))]),r("TemplateElement").field("value",{cooked:i(String,null),raw:String}),r("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",r("Pattern")),r("ObjectPattern").field("properties",[i(r("PropertyPattern"),r("Property"),r("RestElement"),r("SpreadPropertyPattern"))])}V0.default=oY;(0,DM.maybeSetModuleExports)(function(){return wM})});var RM=P((W0,PM)=>{"use strict";Object.defineProperty(W0,"__esModule",{value:!0});var G0=(le(),Q(ue)),sY=G0.__importDefault(kM()),cY=G0.__importDefault(Be()),NM=G0.__importStar(Ae());function uY(e){e.use(sY.default);var t=e.use(cY.default),r=t.Type.def,i=t.Type.or,n=e.use(NM.default).defaults;r("CatchClause").field("param",i(r("Pattern"),null),n.null)}W0.default=uY;(0,NM.maybeSetModuleExports)(function(){return PM})});var jM=P((K0,$M)=>{"use strict";Object.defineProperty(K0,"__esModule",{value:!0});var Ah=(le(),Q(ue)),lY=Ah.__importDefault(R0()),dY=Ah.__importDefault(RM()),pY=Ah.__importDefault(Be()),OM=Ah.__importStar(Ae());function mY(e){e.use(lY.default),e.use(dY.default);var t=e.use(pY.default),r=t.Type.def,i=t.Type.or,n=e.use(OM.default),a=n.defaults;r("ImportExpression").bases("Expression").build("source").field("source",r("Expression")),r("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",r("Literal")).field("exported",i(r("Identifier"),null,void 0),a.null),r("ChainElement").bases("Node").field("optional",Boolean,a.false),r("CallExpression").bases("Expression","ChainElement"),r("MemberExpression").bases("Expression","ChainElement"),r("ChainExpression").bases("Expression").build("expression").field("expression",r("ChainElement")),r("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,a.true),r("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,a.true)}K0.default=mY;(0,OM.maybeSetModuleExports)(function(){return $M})});var LM=P((Z0,FM)=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});var MM=(le(),Q(ue)),fY=MM.__importDefault(hM()),hY=MM.__importDefault(jM()),gY=Ae();function yY(e){e.use(fY.default),e.use(hY.default)}Z0.default=yY;(0,gY.maybeSetModuleExports)(function(){return FM})});var BM=P((q0,zM)=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});var UM=(le(),Q(ue)),vY=UM.__importDefault(LM()),bY=UM.__importDefault(Be()),SY=Ae();function EY(e){e.use(vY.default);var t=e.use(bY.default),r=t.Type.def;r("StaticBlock").bases("Declaration").build("body").field("body",[r("Statement")])}q0.default=EY;(0,SY.maybeSetModuleExports)(function(){return zM})});var Us=P((J0,GM)=>{"use strict";Object.defineProperty(J0,"__esModule",{value:!0});var H0=(le(),Q(ue)),xY=H0.__importDefault(Be()),VM=H0.__importStar(Ae()),AY=H0.__importDefault(BM());function _Y(e){e.use(AY.default);var t=e.use(xY.default),r=t.Type,i=t.Type.def,n=r.or,a=e.use(VM.default),o=a.defaults;i("AwaitExpression").build("argument","all").field("argument",n(i("Expression"),null)).field("all",Boolean,o.false),i("Decorator").bases("Node").build("expression").field("expression",i("Expression")),i("Property").field("decorators",n([i("Decorator")],null),o.null),i("MethodDefinition").field("decorators",n([i("Decorator")],null),o.null),i("PrivateName").bases("Expression","Pattern").build("id").field("id",i("Identifier")),i("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",i("PrivateName")).field("value",n(i("Expression"),null),o.null),i("ImportAttribute").bases("Node").build("key","value").field("key",n(i("Identifier"),i("Literal"))).field("value",i("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(function(s){i(s).field("assertions",[i("ImportAttribute")],o.emptyArray)}),i("RecordExpression").bases("Expression").build("properties").field("properties",[n(i("ObjectProperty"),i("ObjectMethod"),i("SpreadElement"))]),i("TupleExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),i("SpreadElement"),null)]),i("ModuleExpression").bases("Node").build("body").field("body",i("Program"))}J0.default=_Y;(0,VM.maybeSetModuleExports)(function(){return GM})});var ZM=P((Y0,KM)=>{"use strict";Object.defineProperty(Y0,"__esModule",{value:!0});var X0=(le(),Q(ue)),TY=X0.__importDefault(Us()),CY=X0.__importDefault(Be()),WM=X0.__importStar(Ae());function IY(e){e.use(TY.default);var t=e.use(CY.default),r=t.Type.def,i=t.Type.or,n=e.use(WM.default).defaults;r("JSXAttribute").bases("Node").build("name","value").field("name",i(r("JSXIdentifier"),r("JSXNamespacedName"))).field("value",i(r("Literal"),r("JSXExpressionContainer"),r("JSXElement"),r("JSXFragment"),null),n.null),r("JSXIdentifier").bases("Identifier").build("name").field("name",String),r("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",r("JSXIdentifier")).field("name",r("JSXIdentifier")),r("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",i(r("JSXIdentifier"),r("JSXMemberExpression"))).field("property",r("JSXIdentifier")).field("computed",Boolean,n.false);var a=i(r("JSXIdentifier"),r("JSXNamespacedName"),r("JSXMemberExpression"));r("JSXSpreadAttribute").bases("Node").build("argument").field("argument",r("Expression"));var o=[i(r("JSXAttribute"),r("JSXSpreadAttribute"))];r("JSXExpressionContainer").bases("Expression").build("expression").field("expression",i(r("Expression"),r("JSXEmptyExpression")));var s=[i(r("JSXText"),r("JSXExpressionContainer"),r("JSXSpreadChild"),r("JSXElement"),r("JSXFragment"),r("Literal"))];r("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",r("JSXOpeningElement")).field("closingElement",i(r("JSXClosingElement"),null),n.null).field("children",s,n.emptyArray).field("name",a,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",o,function(){return this.openingElement.attributes},!0),r("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",a).field("attributes",o,n.emptyArray).field("selfClosing",Boolean,n.false),r("JSXClosingElement").bases("Node").build("name").field("name",a),r("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",r("JSXOpeningFragment")).field("closingFragment",r("JSXClosingFragment")).field("children",s,n.emptyArray),r("JSXOpeningFragment").bases("Node").build(),r("JSXClosingFragment").bases("Node").build(),r("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),r("JSXEmptyExpression").bases("Node").build(),r("JSXSpreadChild").bases("Node").build("expression").field("expression",r("Expression"))}Y0.default=IY;(0,WM.maybeSetModuleExports)(function(){return KM})});var eT=P((Q0,JM)=>{"use strict";Object.defineProperty(Q0,"__esModule",{value:!0});var qM=(le(),Q(ue)),DY=qM.__importDefault(Be()),HM=qM.__importStar(Ae());function wY(e){var t=e.use(DY.default),r=t.Type.def,i=t.Type.or,n=e.use(HM.default).defaults,a=i(r("TypeAnnotation"),r("TSTypeAnnotation"),null),o=i(r("TypeParameterDeclaration"),r("TSTypeParameterDeclaration"),null);r("Identifier").field("typeAnnotation",a,n.null),r("ObjectPattern").field("typeAnnotation",a,n.null),r("Function").field("returnType",a,n.null).field("typeParameters",o,n.null),r("ClassProperty").build("key","value","typeAnnotation","static").field("value",i(r("Expression"),null)).field("static",Boolean,n.false).field("typeAnnotation",a,n.null),["ClassDeclaration","ClassExpression"].forEach(function(s){r(s).field("typeParameters",o,n.null).field("superTypeParameters",i(r("TypeParameterInstantiation"),r("TSTypeParameterInstantiation"),null),n.null).field("implements",i([r("ClassImplements")],[r("TSExpressionWithTypeArguments")]),n.emptyArray)})}Q0.default=wY;(0,HM.maybeSetModuleExports)(function(){return JM})});var rT=P((tT,YM)=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});var _h=(le(),Q(ue)),kY=_h.__importDefault(Us()),NY=_h.__importDefault(eT()),PY=_h.__importDefault(Be()),XM=_h.__importStar(Ae());function RY(e){e.use(kY.default),e.use(NY.default);var t=e.use(PY.default),r=t.Type.def,i=t.Type.or,n=e.use(XM.default).defaults;r("Flow").bases("Node"),r("FlowType").bases("Flow"),r("AnyTypeAnnotation").bases("FlowType").build(),r("EmptyTypeAnnotation").bases("FlowType").build(),r("MixedTypeAnnotation").bases("FlowType").build(),r("VoidTypeAnnotation").bases("FlowType").build(),r("SymbolTypeAnnotation").bases("FlowType").build(),r("NumberTypeAnnotation").bases("FlowType").build(),r("BigIntTypeAnnotation").bases("FlowType").build(),r("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),r("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),r("StringTypeAnnotation").bases("FlowType").build(),r("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),r("BooleanTypeAnnotation").bases("FlowType").build(),r("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),r("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",r("FlowType")),r("NullLiteralTypeAnnotation").bases("FlowType").build(),r("NullTypeAnnotation").bases("FlowType").build(),r("ThisTypeAnnotation").bases("FlowType").build(),r("ExistsTypeAnnotation").bases("FlowType").build(),r("ExistentialTypeParam").bases("FlowType").build(),r("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[r("FunctionTypeParam")]).field("returnType",r("FlowType")).field("rest",i(r("FunctionTypeParam"),null)).field("typeParameters",i(r("TypeParameterDeclaration"),null)),r("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",i(r("Identifier"),null)).field("typeAnnotation",r("FlowType")).field("optional",Boolean),r("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",r("FlowType")),r("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[i(r("ObjectTypeProperty"),r("ObjectTypeSpreadProperty"))]).field("indexers",[r("ObjectTypeIndexer")],n.emptyArray).field("callProperties",[r("ObjectTypeCallProperty")],n.emptyArray).field("inexact",i(Boolean,void 0),n.undefined).field("exact",Boolean,n.false).field("internalSlots",[r("ObjectTypeInternalSlot")],n.emptyArray),r("Variance").bases("Node").build("kind").field("kind",i("plus","minus"));var a=i(r("Variance"),"plus","minus",null);r("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",i(r("Literal"),r("Identifier"))).field("value",r("FlowType")).field("optional",Boolean).field("variance",a,n.null),r("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",r("Identifier")).field("key",r("FlowType")).field("value",r("FlowType")).field("variance",a,n.null).field("static",Boolean,n.false),r("ObjectTypeCallProperty").bases("Node").build("value").field("value",r("FunctionTypeAnnotation")).field("static",Boolean,n.false),r("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("id",r("Identifier")),r("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",i(r("Identifier"),r("QualifiedTypeIdentifier"))).field("typeParameters",i(r("TypeParameterInstantiation"),null)),r("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",r("Identifier")).field("property",i(r("MemberTypeAnnotation"),r("GenericTypeAnnotation"))),r("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",r("FlowType")).field("indexType",r("FlowType")),r("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",r("FlowType")).field("indexType",r("FlowType")).field("optional",Boolean),r("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",r("FlowType")),r("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",r("FlowType")),r("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",r("Identifier")).field("value",r("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),r("TypeParameterDeclaration").bases("Node").build("params").field("params",[r("TypeParameter")]),r("TypeParameterInstantiation").bases("Node").build("params").field("params",[r("FlowType")]),r("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",a,n.null).field("bound",i(r("TypeAnnotation"),null),n.null).field("default",i(r("FlowType"),null),n.null),r("ClassProperty").field("variance",a,n.null),r("ClassImplements").bases("Node").build("id").field("id",r("Identifier")).field("superClass",i(r("Expression"),null),n.null).field("typeParameters",i(r("TypeParameterInstantiation"),null),n.null),r("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",r("ObjectTypeAnnotation")).field("extends",i([r("InterfaceExtends")],null),n.null),r("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null),n.null).field("body",r("ObjectTypeAnnotation")).field("extends",[r("InterfaceExtends")]),r("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),r("InterfaceExtends").bases("Node").build("id").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterInstantiation"),null),n.null),r("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null)).field("right",r("FlowType")),r("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),r("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",r("Identifier")).field("typeParameters",i(r("TypeParameterDeclaration"),null)).field("impltype",r("FlowType")).field("supertype",i(r("FlowType"),null)),r("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",i(r("FlowType"),null)),r("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",r("Expression")).field("typeAnnotation",r("TypeAnnotation")),r("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[r("FlowType")]),r("DeclareVariable").bases("Statement").build("id").field("id",r("Identifier")),r("DeclareFunction").bases("Statement").build("id").field("id",r("Identifier")).field("predicate",i(r("FlowPredicate"),null),n.null),r("DeclareClass").bases("InterfaceDeclaration").build("id"),r("DeclareModule").bases("Statement").build("id","body").field("id",i(r("Identifier"),r("Literal"))).field("body",r("BlockStatement")),r("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",r("TypeAnnotation")),r("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(r("DeclareVariable"),r("DeclareFunction"),r("DeclareClass"),r("FlowType"),r("TypeAlias"),r("DeclareOpaqueType"),r("InterfaceDeclaration"),null)).field("specifiers",[i(r("ExportSpecifier"),r("ExportBatchSpecifier"))],n.emptyArray).field("source",i(r("Literal"),null),n.null),r("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",i(r("Literal"),null),n.null),r("ImportDeclaration").field("importKind",i("value","type","typeof"),function(){return"value"}),r("FlowPredicate").bases("Flow"),r("InferredPredicate").bases("FlowPredicate").build(),r("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",r("Expression")),r("Function").field("predicate",i(r("FlowPredicate"),null),n.null),r("CallExpression").field("typeArguments",i(null,r("TypeParameterInstantiation")),n.null),r("NewExpression").field("typeArguments",i(null,r("TypeParameterInstantiation")),n.null),r("EnumDeclaration").bases("Declaration").build("id","body").field("id",r("Identifier")).field("body",i(r("EnumBooleanBody"),r("EnumNumberBody"),r("EnumStringBody"),r("EnumSymbolBody"))),r("EnumBooleanBody").build("members","explicitType").field("members",[r("EnumBooleanMember")]).field("explicitType",Boolean),r("EnumNumberBody").build("members","explicitType").field("members",[r("EnumNumberMember")]).field("explicitType",Boolean),r("EnumStringBody").build("members","explicitType").field("members",i([r("EnumStringMember")],[r("EnumDefaultedMember")])).field("explicitType",Boolean),r("EnumSymbolBody").build("members").field("members",[r("EnumDefaultedMember")]),r("EnumBooleanMember").build("id","init").field("id",r("Identifier")).field("init",i(r("Literal"),Boolean)),r("EnumNumberMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumStringMember").build("id","init").field("id",r("Identifier")).field("init",r("Literal")),r("EnumDefaultedMember").build("id").field("id",r("Identifier"))}tT.default=RY;(0,XM.maybeSetModuleExports)(function(){return YM})});var tF=P((iT,eF)=>{"use strict";Object.defineProperty(iT,"__esModule",{value:!0});var nT=(le(),Q(ue)),OY=nT.__importDefault(Us()),$Y=nT.__importDefault(Be()),QM=nT.__importStar(Ae());function jY(e){e.use(OY.default);var t=e.use($Y.default),r=e.use(QM.default).defaults,i=t.Type.def,n=t.Type.or;i("VariableDeclaration").field("declarations",[n(i("VariableDeclarator"),i("Identifier"))]),i("Property").field("value",n(i("Expression"),i("Pattern"))),i("ArrayPattern").field("elements",[n(i("Pattern"),i("SpreadElement"),null)]),i("ObjectPattern").field("properties",[n(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"))]),i("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ExportBatchSpecifier").bases("Specifier").build(),i("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(i("Declaration"),i("Expression"),null)).field("specifiers",[n(i("ExportSpecifier"),i("ExportBatchSpecifier"))],r.emptyArray).field("source",n(i("Literal"),null),r.null),i("Block").bases("Comment").build("value","leading","trailing"),i("Line").bases("Comment").build("value","leading","trailing")}iT.default=jY;(0,QM.maybeSetModuleExports)(function(){return eF})});var sT=P((oT,nF)=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});var aT=(le(),Q(ue)),MY=aT.__importDefault(Us()),FY=aT.__importDefault(Be()),rF=aT.__importStar(Ae());function LY(e){var t,r,i,n,a;e.use(MY.default);var o=e.use(FY.default),s=e.use(rF.default).defaults,u=o.Type.def,d=o.Type.or,p=o.builtInTypes.undefined;u("Noop").bases("Statement").build(),u("DoExpression").bases("Expression").build("body").field("body",[u("Statement")]),u("BindExpression").bases("Expression").build("object","callee").field("object",d(u("Expression"),null)).field("callee",u("Expression")),u("ParenthesizedExpression").bases("Expression").build("expression").field("expression",u("Expression")),u("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",u("Identifier")),u("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",u("Identifier")),u("CommentBlock").bases("Comment").build("value","leading","trailing"),u("CommentLine").bases("Comment").build("value","leading","trailing"),u("Directive").bases("Node").build("value").field("value",u("DirectiveLiteral")),u("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,s["use strict"]),u("InterpreterDirective").bases("Node").build("value").field("value",String),u("BlockStatement").bases("Statement").build("body").field("body",[u("Statement")]).field("directives",[u("Directive")],s.emptyArray),u("Program").bases("Node").build("body").field("body",[u("Statement")]).field("directives",[u("Directive")],s.emptyArray).field("interpreter",d(u("InterpreterDirective"),null),s.null);function g(f,y){return f===void 0&&(f=String),["extra",{rawValue:f,raw:String},function(){var b=o.getFieldValue(this,"value");return{rawValue:b,raw:y?y(b):String(b)}}]}(t=u("StringLiteral").bases("Literal").build("value").field("value",String)).field.apply(t,g(String,function(f){return JSON.stringify(f)})),(r=u("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",d(String,null),s.null)).field.apply(r,g(Number)),(i=u("BigIntLiteral").bases("Literal").build("value").field("value",d(String,Number))).field.apply(i,g(String,function(f){return f+"n"})),(n=u("DecimalLiteral").bases("Literal").build("value").field("value",String)).field.apply(n,g(String,function(f){return f+"m"})),u("NullLiteral").bases("Literal").build().field("value",null,s.null),u("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),(a=u("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)})).field.apply(a,g(d(RegExp,p),function(f){return"/".concat(f.pattern,"/").concat(f.flags||"")})).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var h=d(u("Property"),u("ObjectMethod"),u("ObjectProperty"),u("SpreadProperty"),u("SpreadElement"));u("ObjectExpression").bases("Expression").build("properties").field("properties",[h]),u("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",d("method","get","set")).field("key",d(u("Literal"),u("Identifier"),u("Expression"))).field("params",[u("Pattern")]).field("body",u("BlockStatement")).field("computed",Boolean,s.false).field("generator",Boolean,s.false).field("async",Boolean,s.false).field("accessibility",d(u("Literal"),null),s.null).field("decorators",d([u("Decorator")],null),s.null),u("ObjectProperty").bases("Node").build("key","value").field("key",d(u("Literal"),u("Identifier"),u("Expression"))).field("value",d(u("Expression"),u("Pattern"))).field("accessibility",d(u("Literal"),null),s.null).field("computed",Boolean,s.false);var l=d(u("MethodDefinition"),u("VariableDeclarator"),u("ClassPropertyDefinition"),u("ClassProperty"),u("ClassPrivateProperty"),u("ClassMethod"),u("ClassPrivateMethod"),u("ClassAccessorProperty"),u("StaticBlock"));u("ClassBody").bases("Declaration").build("body").field("body",[l]),u("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",d(u("Literal"),u("Identifier"),u("Expression"))),u("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",u("PrivateName")),u("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",d(u("Literal"),u("Identifier"),u("PrivateName"),u("Expression"))).field("value",d(u("Expression"),null),s.null),["ClassMethod","ClassPrivateMethod"].forEach(function(f){u(f).field("kind",d("get","set","method","constructor"),function(){return"method"}).field("body",u("BlockStatement")).field("access",d("public","private","protected",null),s.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(function(f){u(f).field("computed",Boolean,s.false).field("static",Boolean,s.false).field("abstract",Boolean,s.false).field("accessibility",d("public","private","protected",null),s.null).field("decorators",d([u("Decorator")],null),s.null).field("definite",Boolean,s.false).field("optional",Boolean,s.false).field("override",Boolean,s.false).field("readonly",Boolean,s.false)});var m=d(u("Property"),u("PropertyPattern"),u("SpreadPropertyPattern"),u("SpreadProperty"),u("ObjectProperty"),u("RestProperty"),u("RestElement"));u("ObjectPattern").bases("Pattern").build("properties").field("properties",[m]).field("decorators",d([u("Decorator")],null),s.null),u("SpreadProperty").bases("Node").build("argument").field("argument",u("Expression")),u("RestProperty").bases("Node").build("argument").field("argument",u("Expression")),u("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",d(u("VariableDeclaration"),u("Expression"))).field("right",u("Expression")).field("body",u("Statement")),u("Import").bases("Expression").build()}oT.default=LY;(0,rF.maybeSetModuleExports)(function(){return nF})});var aF=P((uT,iF)=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});var cT=(le(),Q(ue)),UY=cT.__importDefault(Be()),zY=cT.__importDefault(sT()),BY=cT.__importDefault(rT()),VY=Ae();function GY(e){var t=e.use(UY.default),r=t.Type.def;e.use(zY.default),e.use(BY.default),r("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),r("TopicReference").bases("Expression").build()}uT.default=GY;(0,VY.maybeSetModuleExports)(function(){return iF})});var cF=P((lT,sF)=>{"use strict";Object.defineProperty(lT,"__esModule",{value:!0});var Th=(le(),Q(ue)),WY=Th.__importDefault(sT()),KY=Th.__importDefault(eT()),ZY=Th.__importDefault(Be()),oF=Th.__importStar(Ae());function qY(e){e.use(WY.default),e.use(KY.default);var t=e.use(ZY.default),r=t.namedTypes,i=t.Type.def,n=t.Type.or,a=e.use(oF.default).defaults,o=t.Type.from(function(p,g){return!!(r.StringLiteral&&r.StringLiteral.check(p,g)||r.Literal&&r.Literal.check(p,g)&&typeof p.value=="string")},"StringLiteral");i("TSType").bases("Node");var s=n(i("Identifier"),i("TSQualifiedName"));i("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",s),i("TSHasOptionalTypeParameterInstantiation").field("typeParameters",n(i("TSTypeParameterInstantiation"),null),a.null),i("TSHasOptionalTypeParameters").field("typeParameters",n(i("TSTypeParameterDeclaration"),null,void 0),a.null),i("TSHasOptionalTypeAnnotation").field("typeAnnotation",n(i("TSTypeAnnotation"),null),a.null),i("TSQualifiedName").bases("Node").build("left","right").field("left",s).field("right",s),i("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")).field("extra",n({parenthesized:Boolean},null),a.null),i("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",i("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(function(p){i(p).bases("TSType").build()}),i("TSArrayType").bases("TSType").build("elementType").field("elementType",i("TSType")),i("TSLiteralType").bases("TSType").build("literal").field("literal",n(i("NumericLiteral"),i("StringLiteral"),i("BooleanLiteral"),i("TemplateLiteral"),i("UnaryExpression"),i("BigIntLiteral"))),i("TemplateLiteral").field("expressions",n([i("Expression")],[i("TSType")])),["TSUnionType","TSIntersectionType"].forEach(function(p){i(p).bases("TSType").build("types").field("types",[i("TSType")])}),i("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",i("TSType")).field("extendsType",i("TSType")).field("trueType",i("TSType")).field("falseType",i("TSType")),i("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",i("TSTypeParameter")),i("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType"));var u=[n(i("Identifier"),i("RestElement"),i("ArrayPattern"),i("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(function(p){i(p).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",u)}),i("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,a.false).field("async",Boolean,a.false).field("generator",Boolean,a.false).field("id",n(i("Identifier"),null),a.null).field("params",[i("Pattern")]).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),a.null),i("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,a.false).field("generator",Boolean,a.false).field("params",[i("Pattern")]).field("abstract",Boolean,a.false).field("accessibility",n("public","private","protected",void 0),a.undefined).field("static",Boolean,a.false).field("computed",Boolean,a.false).field("optional",Boolean,a.false).field("key",n(i("Identifier"),i("StringLiteral"),i("NumericLiteral"),i("Expression"))).field("kind",n("get","set","method","constructor"),function(){return"method"}).field("access",n("public","private","protected",void 0),a.undefined).field("decorators",n([i("Decorator")],null),a.null).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),a.null),i("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",n(Boolean,"+","-"),a.false).field("typeParameter",i("TSTypeParameter")).field("optional",n(Boolean,"+","-"),a.false).field("typeAnnotation",n(i("TSType"),null),a.null),i("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[n(i("TSType"),i("TSNamedTupleMember"))]),i("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",i("Identifier")).field("optional",Boolean,a.false).field("elementType",i("TSType")),i("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",i("TSType")).field("indexType",i("TSType")),i("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",i("TSType")),i("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n(i("TSType"),i("TSTypeAnnotation"))),i("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[i("Identifier")]).field("readonly",Boolean,a.false),i("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",i("Expression")).field("computed",Boolean,a.false).field("readonly",Boolean,a.false).field("optional",Boolean,a.false).field("initializer",n(i("Expression"),null),a.null),i("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",i("Expression")).field("computed",Boolean,a.false).field("optional",Boolean,a.false).field("parameters",u),i("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",n(i("Identifier"),i("TSThisType"))).field("typeAnnotation",n(i("TSTypeAnnotation"),null),a.null).field("asserts",Boolean,a.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(function(p){i(p).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",u)}),i("TSEnumMember").bases("Node").build("id","initializer").field("id",n(i("Identifier"),o)).field("initializer",n(i("Expression"),null),a.null),i("TSTypeQuery").bases("TSType").build("exprName").field("exprName",n(s,i("TSImportType")));var d=n(i("TSCallSignatureDeclaration"),i("TSConstructSignatureDeclaration"),i("TSIndexSignature"),i("TSMethodSignature"),i("TSPropertySignature"));i("TSTypeLiteral").bases("TSType").build("members").field("members",[d]),i("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",n(i("Identifier"),String)).field("constraint",n(i("TSType"),void 0),a.undefined).field("default",n(i("TSType"),void 0),a.undefined),i("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",i("TSType")).field("expression",i("Expression")).field("extra",n({parenthesized:Boolean},null),a.null),i("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[i("TSTypeParameter")]),i("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",i("Expression")),i("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[i("TSType")]),i("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",i("Identifier")).field("const",Boolean,a.false).field("declare",Boolean,a.false).field("members",[i("TSEnumMember")]).field("initializer",n(i("Expression"),null),a.null),i("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",i("Identifier")).field("declare",Boolean,a.false).field("typeAnnotation",i("TSType")),i("TSModuleBlock").bases("Node").build("body").field("body",[i("Statement")]),i("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",n(o,s)).field("declare",Boolean,a.false).field("global",Boolean,a.false).field("body",n(i("TSModuleBlock"),i("TSModuleDeclaration"),null),a.null),i("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",o).field("qualifier",n(s,void 0),a.undefined),i("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",i("Identifier")).field("isExport",Boolean,a.false).field("moduleReference",n(s,i("TSExternalModuleReference"))),i("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",o),i("TSExportAssignment").bases("Statement").build("expression").field("expression",i("Expression")),i("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",i("Identifier")),i("TSInterfaceBody").bases("Node").build("body").field("body",[d]),i("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",s),i("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",s).field("declare",Boolean,a.false).field("extends",n([i("TSExpressionWithTypeArguments")],null),a.null).field("body",i("TSInterfaceBody")),i("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",n("public","private","protected",void 0),a.undefined).field("readonly",Boolean,a.false).field("parameter",n(i("Identifier"),i("AssignmentPattern"))),i("ClassProperty").field("access",n("public","private","protected",void 0),a.undefined),i("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),i("ClassBody").field("body",[n(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassPrivateProperty"),i("ClassAccessorProperty"),i("ClassMethod"),i("ClassPrivateMethod"),i("StaticBlock"),i("TSDeclareMethod"),d)])}lT.default=qY;(0,oF.maybeSetModuleExports)(function(){return sF})});var uF=P(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.namedTypes=void 0;var HY;HY=xl.namedTypes||(xl.namedTypes={})});var Ar=P(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.visit=de.use=de.Type=de.someField=de.PathVisitor=de.Path=de.NodePath=de.namedTypes=de.getSupertypeNames=de.getFieldValue=de.getFieldNames=de.getBuilderName=de.finalize=de.eachField=de.defineMethod=de.builtInTypes=de.builders=de.astNodesAreEquivalent=void 0;var Ba=(le(),Q(ue)),JY=Ba.__importDefault(lM()),XY=Ba.__importDefault(Us()),YY=Ba.__importDefault(ZM()),QY=Ba.__importDefault(rT()),e7=Ba.__importDefault(tF()),t7=Ba.__importDefault(aF()),r7=Ba.__importDefault(cF()),lF=uF();Object.defineProperty(de,"namedTypes",{enumerable:!0,get:function(){return lF.namedTypes}});var dt=(0,JY.default)([XY.default,YY.default,QY.default,e7.default,t7.default,r7.default]),n7=dt.astNodesAreEquivalent,i7=dt.builders,a7=dt.builtInTypes,o7=dt.defineMethod,s7=dt.eachField,c7=dt.finalize,u7=dt.getBuilderName,l7=dt.getFieldNames,d7=dt.getFieldValue,p7=dt.getSupertypeNames,m7=dt.namedTypes,f7=dt.NodePath,h7=dt.Path,g7=dt.PathVisitor,y7=dt.someField,v7=dt.Type,b7=dt.use,S7=dt.visit;de.astNodesAreEquivalent=n7;de.builders=i7;de.builtInTypes=a7;de.defineMethod=o7;de.eachField=s7;de.finalize=c7;de.getBuilderName=u7;de.getFieldNames=l7;de.getFieldValue=d7;de.getSupertypeNames=p7;de.NodePath=f7;de.Path=h7;de.PathVisitor=g7;de.someField=y7;de.Type=v7;de.use=b7;de.visit=S7;Object.assign(lF.namedTypes,m7)});var ui={};Ur(ui,{default:()=>wee});function wee(e,t){if(!e){if(Dee)throw new Error(CC);var r=typeof t=="function"?t():t,i=r?"".concat(CC,": ").concat(r):CC;throw new Error(i)}}var Dee,CC,li=HD(()=>{Dee=process.env.NODE_ENV==="production",CC="Invariant failed"});var HU=P(IC=>{var qU="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");IC.encode=function(e){if(0<=e&&e<qU.length)return qU[e];throw new TypeError("Must be between 0 and 63: "+e)};IC.decode=function(e){var t=65,r=90,i=97,n=122,a=48,o=57,s=43,u=47,d=26,p=52;return t<=e&&e<=r?e-t:i<=e&&e<=n?e-i+d:a<=e&&e<=o?e-a+p:e==s?62:e==u?63:-1}});var kC=P(wC=>{var JU=HU(),DC=5,XU=1<<DC,YU=XU-1,QU=XU;function kee(e){return e<0?(-e<<1)+1:(e<<1)+0}function Nee(e){var t=(e&1)===1,r=e>>1;return t?-r:r}wC.encode=function(t){var r="",i,n=kee(t);do i=n&YU,n>>>=DC,n>0&&(i|=QU),r+=JU.encode(i);while(n>0);return r};wC.decode=function(t,r,i){var n=t.length,a=0,o=0,s,u;do{if(r>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(u=JU.decode(t.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));s=!!(u&QU),u&=YU,a=a+(u<<o),o+=DC}while(s);i.value=Nee(a),i.rest=r}});var yc=P(_t=>{function Pee(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}_t.getArg=Pee;var ez=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Ree=/^data:.+\,.+$/;function pd(e){var t=e.match(ez);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}_t.urlParse=pd;function hc(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}_t.urlGenerate=hc;function NC(e){var t=e,r=pd(e);if(r){if(!r.path)return e;t=r.path}for(var i=_t.isAbsolute(t),n=t.split(/\/+/),a,o=0,s=n.length-1;s>=0;s--)a=n[s],a==="."?n.splice(s,1):a===".."?o++:o>0&&(a===""?(n.splice(s+1,o),o=0):(n.splice(s,2),o--));return t=n.join("/"),t===""&&(t=i?"/":"."),r?(r.path=t,hc(r)):t}_t.normalize=NC;function tz(e,t){e===""&&(e="."),t===""&&(t=".");var r=pd(t),i=pd(e);if(i&&(e=i.path||"/"),r&&!r.scheme)return i&&(r.scheme=i.scheme),hc(r);if(r||t.match(Ree))return t;if(i&&!i.host&&!i.path)return i.host=t,hc(i);var n=t.charAt(0)==="/"?t:NC(e.replace(/\/+$/,"")+"/"+t);return i?(i.path=n,hc(i)):n}_t.join=tz;_t.isAbsolute=function(e){return e.charAt(0)==="/"||ez.test(e)};function Oee(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var i=e.lastIndexOf("/");if(i<0||(e=e.slice(0,i),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}_t.relative=Oee;var rz=(function(){var e=Object.create(null);return!("__proto__"in e)})();function nz(e){return e}function $ee(e){return iz(e)?"$"+e:e}_t.toSetString=rz?nz:$ee;function jee(e){return iz(e)?e.slice(1):e}_t.fromSetString=rz?nz:jee;function iz(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function Mee(e,t,r){var i=gc(e.source,t.source);return i!==0||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0||r)||(i=e.generatedColumn-t.generatedColumn,i!==0)||(i=e.generatedLine-t.generatedLine,i!==0)?i:gc(e.name,t.name)}_t.compareByOriginalPositions=Mee;function Fee(e,t,r){var i=e.generatedLine-t.generatedLine;return i!==0||(i=e.generatedColumn-t.generatedColumn,i!==0||r)||(i=gc(e.source,t.source),i!==0)||(i=e.originalLine-t.originalLine,i!==0)||(i=e.originalColumn-t.originalColumn,i!==0)?i:gc(e.name,t.name)}_t.compareByGeneratedPositionsDeflated=Fee;function gc(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function Lee(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=gc(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:gc(e.name,t.name)}_t.compareByGeneratedPositionsInflated=Lee;function Uee(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}_t.parseSourceMapInput=Uee;function zee(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var i=pd(r);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var n=i.path.lastIndexOf("/");n>=0&&(i.path=i.path.substring(0,n+1))}t=tz(hc(i),t)}return NC(t)}_t.computeSourceURL=zee});var OC=P(az=>{var PC=yc(),RC=Object.prototype.hasOwnProperty,co=typeof Map<"u";function di(){this._array=[],this._set=co?new Map:Object.create(null)}di.fromArray=function(t,r){for(var i=new di,n=0,a=t.length;n<a;n++)i.add(t[n],r);return i};di.prototype.size=function(){return co?this._set.size:Object.getOwnPropertyNames(this._set).length};di.prototype.add=function(t,r){var i=co?t:PC.toSetString(t),n=co?this.has(t):RC.call(this._set,i),a=this._array.length;(!n||r)&&this._array.push(t),n||(co?this._set.set(t,a):this._set[i]=a)};di.prototype.has=function(t){if(co)return this._set.has(t);var r=PC.toSetString(t);return RC.call(this._set,r)};di.prototype.indexOf=function(t){if(co){var r=this._set.get(t);if(r>=0)return r}else{var i=PC.toSetString(t);if(RC.call(this._set,i))return this._set[i]}throw new Error('"'+t+'" is not in the set.')};di.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};di.prototype.toArray=function(){return this._array.slice()};az.ArraySet=di});var cz=P(sz=>{var oz=yc();function Bee(e,t){var r=e.generatedLine,i=t.generatedLine,n=e.generatedColumn,a=t.generatedColumn;return i>r||i==r&&a>=n||oz.compareByGeneratedPositionsInflated(e,t)<=0}function _g(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}_g.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};_g.prototype.add=function(t){Bee(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};_g.prototype.toArray=function(){return this._sorted||(this._array.sort(oz.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};sz.MappingList=_g});var $C=P(uz=>{var md=kC(),tt=yc(),Tg=OC().ArraySet,Vee=cz().MappingList;function Or(e){e||(e={}),this._file=tt.getArg(e,"file",null),this._sourceRoot=tt.getArg(e,"sourceRoot",null),this._skipValidation=tt.getArg(e,"skipValidation",!1),this._sources=new Tg,this._names=new Tg,this._mappings=new Vee,this._sourcesContents=null}Or.prototype._version=3;Or.fromSourceMap=function(t){var r=t.sourceRoot,i=new Or({file:t.file,sourceRoot:r});return t.eachMapping(function(n){var a={generated:{line:n.generatedLine,column:n.generatedColumn}};n.source!=null&&(a.source=n.source,r!=null&&(a.source=tt.relative(r,a.source)),a.original={line:n.originalLine,column:n.originalColumn},n.name!=null&&(a.name=n.name)),i.addMapping(a)}),t.sources.forEach(function(n){var a=n;r!==null&&(a=tt.relative(r,n)),i._sources.has(a)||i._sources.add(a);var o=t.sourceContentFor(n);o!=null&&i.setSourceContent(n,o)}),i};Or.prototype.addMapping=function(t){var r=tt.getArg(t,"generated"),i=tt.getArg(t,"original",null),n=tt.getArg(t,"source",null),a=tt.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,i,n,a),n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:i!=null&&i.line,originalColumn:i!=null&&i.column,source:n,name:a})};Or.prototype.setSourceContent=function(t,r){var i=t;this._sourceRoot!=null&&(i=tt.relative(this._sourceRoot,i)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[tt.toSetString(i)]=r):this._sourcesContents&&(delete this._sourcesContents[tt.toSetString(i)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Or.prototype.applySourceMap=function(t,r,i){var n=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);n=t.file}var a=this._sourceRoot;a!=null&&(n=tt.relative(a,n));var o=new Tg,s=new Tg;this._mappings.unsortedForEach(function(u){if(u.source===n&&u.originalLine!=null){var d=t.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,i!=null&&(u.source=tt.join(i,u.source)),a!=null&&(u.source=tt.relative(a,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}var p=u.source;p!=null&&!o.has(p)&&o.add(p);var g=u.name;g!=null&&!s.has(g)&&s.add(g)},this),this._sources=o,this._names=s,t.sources.forEach(function(u){var d=t.sourceContentFor(u);d!=null&&(i!=null&&(u=tt.join(i,u)),a!=null&&(u=tt.relative(a,u)),this.setSourceContent(u,d))},this)};Or.prototype._validateMapping=function(t,r,i,n){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!i&&!n)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&i)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:i,original:r,name:n}))}};Or.prototype._serializeMappings=function(){for(var t=0,r=1,i=0,n=0,a=0,o=0,s="",u,d,p,g,h=this._mappings.toArray(),l=0,m=h.length;l<m;l++){if(d=h[l],u="",d.generatedLine!==r)for(t=0;d.generatedLine!==r;)u+=";",r++;else if(l>0){if(!tt.compareByGeneratedPositionsInflated(d,h[l-1]))continue;u+=","}u+=md.encode(d.generatedColumn-t),t=d.generatedColumn,d.source!=null&&(g=this._sources.indexOf(d.source),u+=md.encode(g-o),o=g,u+=md.encode(d.originalLine-1-n),n=d.originalLine-1,u+=md.encode(d.originalColumn-i),i=d.originalColumn,d.name!=null&&(p=this._names.indexOf(d.name),u+=md.encode(p-a),a=p)),s+=u}return s};Or.prototype._generateSourcesContent=function(t,r){return t.map(function(i){if(!this._sourcesContents)return null;r!=null&&(i=tt.relative(r,i));var n=tt.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};Or.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};Or.prototype.toString=function(){return JSON.stringify(this.toJSON())};uz.SourceMapGenerator=Or});var lz=P(uo=>{uo.GREATEST_LOWER_BOUND=1;uo.LEAST_UPPER_BOUND=2;function jC(e,t,r,i,n,a){var o=Math.floor((t-e)/2)+e,s=n(r,i[o],!0);return s===0?o:s>0?t-o>1?jC(o,t,r,i,n,a):a==uo.LEAST_UPPER_BOUND?t<i.length?t:-1:o:o-e>1?jC(e,o,r,i,n,a):a==uo.LEAST_UPPER_BOUND?o:e<0?-1:e}uo.search=function(t,r,i,n){if(r.length===0)return-1;var a=jC(-1,r.length,t,r,i,n||uo.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&i(r[a],r[a-1],!0)===0;)--a;return a}});var pz=P(dz=>{function MC(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function Gee(e,t){return Math.round(e+Math.random()*(t-e))}function FC(e,t,r,i){if(r<i){var n=Gee(r,i),a=r-1;MC(e,n,i);for(var o=e[i],s=r;s<i;s++)t(e[s],o)<=0&&(a+=1,MC(e,a,s));MC(e,a+1,s);var u=a+1;FC(e,t,r,u-1),FC(e,t,u+1,i)}}dz.quickSort=function(e,t){FC(e,t,0,e.length-1)}});var fz=P(Cg=>{var K=yc(),LC=lz(),vc=OC().ArraySet,Wee=kC(),fd=pz().quickSort;function Le(e,t){var r=e;return typeof e=="string"&&(r=K.parseSourceMapInput(e)),r.sections!=null?new Xr(r,t):new yt(r,t)}Le.fromSourceMap=function(e,t){return yt.fromSourceMap(e,t)};Le.prototype._version=3;Le.prototype.__generatedMappings=null;Object.defineProperty(Le.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Le.prototype.__originalMappings=null;Object.defineProperty(Le.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Le.prototype._charIsMappingSeparator=function(t,r){var i=t.charAt(r);return i===";"||i===","};Le.prototype._parseMappings=function(t,r){throw new Error("Subclasses must implement _parseMappings")};Le.GENERATED_ORDER=1;Le.ORIGINAL_ORDER=2;Le.GREATEST_LOWER_BOUND=1;Le.LEAST_UPPER_BOUND=2;Le.prototype.eachMapping=function(t,r,i){var n=r||null,a=i||Le.GENERATED_ORDER,o;switch(a){case Le.GENERATED_ORDER:o=this._generatedMappings;break;case Le.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var s=this.sourceRoot;o.map(function(u){var d=u.source===null?null:this._sources.at(u.source);return d=K.computeSourceURL(s,d,this._sourceMapURL),{source:d,generatedLine:u.generatedLine,generatedColumn:u.generatedColumn,originalLine:u.originalLine,originalColumn:u.originalColumn,name:u.name===null?null:this._names.at(u.name)}},this).forEach(t,n)};Le.prototype.allGeneratedPositionsFor=function(t){var r=K.getArg(t,"line"),i={source:K.getArg(t,"source"),originalLine:r,originalColumn:K.getArg(t,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],a=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",K.compareByOriginalPositions,LC.LEAST_UPPER_BOUND);if(a>=0){var o=this._originalMappings[a];if(t.column===void 0)for(var s=o.originalLine;o&&o.originalLine===s;)n.push({line:K.getArg(o,"generatedLine",null),column:K.getArg(o,"generatedColumn",null),lastColumn:K.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a];else for(var u=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==u;)n.push({line:K.getArg(o,"generatedLine",null),column:K.getArg(o,"generatedColumn",null),lastColumn:K.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a]}return n};Cg.SourceMapConsumer=Le;function yt(e,t){var r=e;typeof e=="string"&&(r=K.parseSourceMapInput(e));var i=K.getArg(r,"version"),n=K.getArg(r,"sources"),a=K.getArg(r,"names",[]),o=K.getArg(r,"sourceRoot",null),s=K.getArg(r,"sourcesContent",null),u=K.getArg(r,"mappings"),d=K.getArg(r,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);o&&(o=K.normalize(o)),n=n.map(String).map(K.normalize).map(function(p){return o&&K.isAbsolute(o)&&K.isAbsolute(p)?K.relative(o,p):p}),this._names=vc.fromArray(a.map(String),!0),this._sources=vc.fromArray(n,!0),this._absoluteSources=this._sources.toArray().map(function(p){return K.computeSourceURL(o,p,t)}),this.sourceRoot=o,this.sourcesContent=s,this._mappings=u,this._sourceMapURL=t,this.file=d}yt.prototype=Object.create(Le.prototype);yt.prototype.consumer=Le;yt.prototype._findSourceIndex=function(e){var t=e;if(this.sourceRoot!=null&&(t=K.relative(this.sourceRoot,t)),this._sources.has(t))return this._sources.indexOf(t);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==e)return r;return-1};yt.fromSourceMap=function(t,r){var i=Object.create(yt.prototype),n=i._names=vc.fromArray(t._names.toArray(),!0),a=i._sources=vc.fromArray(t._sources.toArray(),!0);i.sourceRoot=t._sourceRoot,i.sourcesContent=t._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=t._file,i._sourceMapURL=r,i._absoluteSources=i._sources.toArray().map(function(l){return K.computeSourceURL(i.sourceRoot,l,r)});for(var o=t._mappings.toArray().slice(),s=i.__generatedMappings=[],u=i.__originalMappings=[],d=0,p=o.length;d<p;d++){var g=o[d],h=new mz;h.generatedLine=g.generatedLine,h.generatedColumn=g.generatedColumn,g.source&&(h.source=a.indexOf(g.source),h.originalLine=g.originalLine,h.originalColumn=g.originalColumn,g.name&&(h.name=n.indexOf(g.name)),u.push(h)),s.push(h)}return fd(i.__originalMappings,K.compareByOriginalPositions),i};yt.prototype._version=3;Object.defineProperty(yt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function mz(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}yt.prototype._parseMappings=function(t,r){for(var i=1,n=0,a=0,o=0,s=0,u=0,d=t.length,p=0,g={},h={},l=[],m=[],f,y,v,b,A;p<d;)if(t.charAt(p)===";")i++,p++,n=0;else if(t.charAt(p)===",")p++;else{for(f=new mz,f.generatedLine=i,b=p;b<d&&!this._charIsMappingSeparator(t,b);b++);if(y=t.slice(p,b),v=g[y],v)p+=y.length;else{for(v=[];p<b;)Wee.decode(t,p,h),A=h.value,p=h.rest,v.push(A);if(v.length===2)throw new Error("Found a source, but no line and column");if(v.length===3)throw new Error("Found a source and line, but no column");g[y]=v}f.generatedColumn=n+v[0],n=f.generatedColumn,v.length>1&&(f.source=s+v[1],s+=v[1],f.originalLine=a+v[2],a=f.originalLine,f.originalLine+=1,f.originalColumn=o+v[3],o=f.originalColumn,v.length>4&&(f.name=u+v[4],u+=v[4])),m.push(f),typeof f.originalLine=="number"&&l.push(f)}fd(m,K.compareByGeneratedPositionsDeflated),this.__generatedMappings=m,fd(l,K.compareByOriginalPositions),this.__originalMappings=l};yt.prototype._findMapping=function(t,r,i,n,a,o){if(t[i]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[i]);if(t[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[n]);return LC.search(t,r,a,o)};yt.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var i=this._generatedMappings[t+1];if(r.generatedLine===i.generatedLine){r.lastGeneratedColumn=i.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};yt.prototype.originalPositionFor=function(t){var r={generatedLine:K.getArg(t,"line"),generatedColumn:K.getArg(t,"column")},i=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",K.compareByGeneratedPositionsDeflated,K.getArg(t,"bias",Le.GREATEST_LOWER_BOUND));if(i>=0){var n=this._generatedMappings[i];if(n.generatedLine===r.generatedLine){var a=K.getArg(n,"source",null);a!==null&&(a=this._sources.at(a),a=K.computeSourceURL(this.sourceRoot,a,this._sourceMapURL));var o=K.getArg(n,"name",null);return o!==null&&(o=this._names.at(o)),{source:a,line:K.getArg(n,"originalLine",null),column:K.getArg(n,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};yt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1};yt.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var i=this._findSourceIndex(t);if(i>=0)return this.sourcesContent[i];var n=t;this.sourceRoot!=null&&(n=K.relative(this.sourceRoot,n));var a;if(this.sourceRoot!=null&&(a=K.urlParse(this.sourceRoot))){var o=n.replace(/^file:\/\//,"");if(a.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!a.path||a.path=="/")&&this._sources.has("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(r)return null;throw new Error('"'+n+'" is not in the SourceMap.')};yt.prototype.generatedPositionFor=function(t){var r=K.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var i={source:r,originalLine:K.getArg(t,"line"),originalColumn:K.getArg(t,"column")},n=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",K.compareByOriginalPositions,K.getArg(t,"bias",Le.GREATEST_LOWER_BOUND));if(n>=0){var a=this._originalMappings[n];if(a.source===i.source)return{line:K.getArg(a,"generatedLine",null),column:K.getArg(a,"generatedColumn",null),lastColumn:K.getArg(a,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Cg.BasicSourceMapConsumer=yt;function Xr(e,t){var r=e;typeof e=="string"&&(r=K.parseSourceMapInput(e));var i=K.getArg(r,"version"),n=K.getArg(r,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new vc,this._names=new vc;var a={line:-1,column:0};this._sections=n.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var s=K.getArg(o,"offset"),u=K.getArg(s,"line"),d=K.getArg(s,"column");if(u<a.line||u===a.line&&d<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=s,{generatedOffset:{generatedLine:u+1,generatedColumn:d+1},consumer:new Le(K.getArg(o,"map"),t)}})}Xr.prototype=Object.create(Le.prototype);Xr.prototype.constructor=Le;Xr.prototype._version=3;Object.defineProperty(Xr.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}});Xr.prototype.originalPositionFor=function(t){var r={generatedLine:K.getArg(t,"line"),generatedColumn:K.getArg(t,"column")},i=LC.search(r,this._sections,function(a,o){var s=a.generatedLine-o.generatedOffset.generatedLine;return s||a.generatedColumn-o.generatedOffset.generatedColumn}),n=this._sections[i];return n?n.consumer.originalPositionFor({line:r.generatedLine-(n.generatedOffset.generatedLine-1),column:r.generatedColumn-(n.generatedOffset.generatedLine===r.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}};Xr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})};Xr.prototype.sourceContentFor=function(t,r){for(var i=0;i<this._sections.length;i++){var n=this._sections[i],a=n.consumer.sourceContentFor(t,!0);if(a)return a}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')};Xr.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var i=this._sections[r];if(i.consumer._findSourceIndex(K.getArg(t,"source"))!==-1){var n=i.consumer.generatedPositionFor(t);if(n){var a={line:n.line+(i.generatedOffset.generatedLine-1),column:n.column+(i.generatedOffset.generatedLine===n.line?i.generatedOffset.generatedColumn-1:0)};return a}}}return{line:null,column:null}};Xr.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var i=0;i<this._sections.length;i++)for(var n=this._sections[i],a=n.consumer._generatedMappings,o=0;o<a.length;o++){var s=a[o],u=n.consumer._sources.at(s.source);u=K.computeSourceURL(n.consumer.sourceRoot,u,this._sourceMapURL),this._sources.add(u),u=this._sources.indexOf(u);var d=null;s.name&&(d=n.consumer._names.at(s.name),this._names.add(d),d=this._names.indexOf(d));var p={source:u,generatedLine:s.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:d};this.__generatedMappings.push(p),typeof p.originalLine=="number"&&this.__originalMappings.push(p)}fd(this.__generatedMappings,K.compareByGeneratedPositionsDeflated),fd(this.__originalMappings,K.compareByOriginalPositions)};Cg.IndexedSourceMapConsumer=Xr});var gz=P(hz=>{var Kee=$C().SourceMapGenerator,Ig=yc(),Zee=/(\r?\n)/,qee=10,bc="$$$isSourceNode$$$";function ur(e,t,r,i,n){this.children=[],this.sourceContents={},this.line=e??null,this.column=t??null,this.source=r??null,this.name=n??null,this[bc]=!0,i!=null&&this.add(i)}ur.fromStringWithSourceMap=function(t,r,i){var n=new ur,a=t.split(Zee),o=0,s=function(){var h=m(),l=m()||"";return h+l;function m(){return o<a.length?a[o++]:void 0}},u=1,d=0,p=null;return r.eachMapping(function(h){if(p!==null)if(u<h.generatedLine)g(p,s()),u++,d=0;else{var l=a[o]||"",m=l.substr(0,h.generatedColumn-d);a[o]=l.substr(h.generatedColumn-d),d=h.generatedColumn,g(p,m),p=h;return}for(;u<h.generatedLine;)n.add(s()),u++;if(d<h.generatedColumn){var l=a[o]||"";n.add(l.substr(0,h.generatedColumn)),a[o]=l.substr(h.generatedColumn),d=h.generatedColumn}p=h},this),o<a.length&&(p&&g(p,s()),n.add(a.splice(o).join(""))),r.sources.forEach(function(h){var l=r.sourceContentFor(h);l!=null&&(i!=null&&(h=Ig.join(i,h)),n.setSourceContent(h,l))}),n;function g(h,l){if(h===null||h.source===void 0)n.add(l);else{var m=i?Ig.join(i,h.source):h.source;n.add(new ur(h.originalLine,h.originalColumn,m,l,h.name))}}};ur.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[bc]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};ur.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[bc]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this};ur.prototype.walk=function(t){for(var r,i=0,n=this.children.length;i<n;i++)r=this.children[i],r[bc]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})};ur.prototype.join=function(t){var r,i,n=this.children.length;if(n>0){for(r=[],i=0;i<n-1;i++)r.push(this.children[i]),r.push(t);r.push(this.children[i]),this.children=r}return this};ur.prototype.replaceRight=function(t,r){var i=this.children[this.children.length-1];return i[bc]?i.replaceRight(t,r):typeof i=="string"?this.children[this.children.length-1]=i.replace(t,r):this.children.push("".replace(t,r)),this};ur.prototype.setSourceContent=function(t,r){this.sourceContents[Ig.toSetString(t)]=r};ur.prototype.walkSourceContents=function(t){for(var r=0,i=this.children.length;r<i;r++)this.children[r][bc]&&this.children[r].walkSourceContents(t);for(var n=Object.keys(this.sourceContents),r=0,i=n.length;r<i;r++)t(Ig.fromSetString(n[r]),this.sourceContents[n[r]])};ur.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t};ur.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},i=new Kee(t),n=!1,a=null,o=null,s=null,u=null;return this.walk(function(d,p){r.code+=d,p.source!==null&&p.line!==null&&p.column!==null?((a!==p.source||o!==p.line||s!==p.column||u!==p.name)&&i.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name}),a=p.source,o=p.line,s=p.column,u=p.name,n=!0):n&&(i.addMapping({generated:{line:r.line,column:r.column}}),a=null,n=!1);for(var g=0,h=d.length;g<h;g++)d.charCodeAt(g)===qee?(r.line++,r.column=0,g+1===h?(a=null,n=!1):n&&i.addMapping({source:p.source,original:{line:p.line,column:p.column},generated:{line:r.line,column:r.column},name:p.name})):r.column++}),this.walkSourceContents(function(d,p){i.setSourceContent(d,p)}),{code:r.code,map:i}};hz.SourceNode=ur});var UC=P(Dg=>{Dg.SourceMapGenerator=$C().SourceMapGenerator;Dg.SourceMapConsumer=fz().SourceMapConsumer;Dg.SourceNode=gz().SourceNode});var _n=P($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.isTrailingCommaEnabled=$e.getParentExportDeclaration=$e.isExportDeclaration=$e.fixFaultyLocations=$e.getTrueLoc=$e.composeSourceMaps=$e.copyPos=$e.comparePos=$e.getUnionOfKeys=$e.getOption=$e.isBrowser=$e.getLineTerminator=void 0;var BC=(le(),Q(ue)),hd=BC.__importDefault((li(),Q(ui))),Hee=BC.__importStar(Ar()),wg=Hee.namedTypes,vz=BC.__importDefault(UC()),yz=vz.default.SourceMapConsumer,Jee=vz.default.SourceMapGenerator,bz=Object.prototype.hasOwnProperty;function Xee(){return Sz()?`
|
|
5
5
|
`:Io("os").EOL||`
|
|
6
6
|
`}$e.getLineTerminator=Xee;function Sz(){return typeof window<"u"&&typeof window.document<"u"}$e.isBrowser=Sz;function Yee(e,t,r){return e&&bz.call(e,t)?e[t]:r}$e.getOption=Yee;function Qee(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},i=e.length,n=0;n<i;++n)for(var a=Object.keys(e[n]),o=a.length,s=0;s<o;++s)r[a[s]]=!0;return r}$e.getUnionOfKeys=Qee;function An(e,t){return e.line-t.line||e.column-t.column}$e.comparePos=An;function Yi(e){return{line:e.line,column:e.column}}$e.copyPos=Yi;function ete(e,t){if(e){if(!t)return e}else return t||null;var r=new yz(e),i=new yz(t),n=new Jee({file:t.file,sourceRoot:t.sourceRoot}),a={};return i.eachMapping(function(o){var s=r.originalPositionFor({line:o.originalLine,column:o.originalColumn}),u=s.source;if(u!==null){n.addMapping({source:u,original:Yi(s),generated:{line:o.generatedLine,column:o.generatedColumn},name:o.name});var d=r.sourceContentFor(u);d&&!bz.call(a,u)&&(a[u]=d,n.setSourceContent(u,d))}}),n.toJSON()}$e.composeSourceMaps=ete;function tte(e,t){if(!e.loc)return null;var r={start:e.loc.start,end:e.loc.end};function i(n){zC(r,n.loc)}return e.declaration&&e.declaration.decorators&&kg(e)&&e.declaration.decorators.forEach(i),An(r.start,r.end)<0&&(r.start=Yi(r.start),t.skipSpaces(r.start,!1,!0),An(r.start,r.end)<0&&(r.end=Yi(r.end),t.skipSpaces(r.end,!0,!0))),e.comments&&e.comments.forEach(i),r}$e.getTrueLoc=tte;function zC(e,t){e&&t&&(An(t.start,e.start)<0&&(e.start=t.start),An(e.end,t.end)<0&&(e.end=t.end))}function rte(e,t){var r=e.loc;if(r&&(r.start.line<1&&(r.start.line=1),r.end.line<1&&(r.end.line=1)),e.type==="File"&&(r.start=t.firstPos(),r.end=t.lastPos()),nte(e,t),ite(e,t),r&&e.decorators)e.decorators.forEach(function(o){zC(r,o.loc)});else if(e.declaration&&kg(e)){e.declaration.loc=null;var i=e.declaration.decorators;i&&i.forEach(function(o){zC(r,o.loc)})}else if(wg.MethodDefinition&&wg.MethodDefinition.check(e)||wg.Property.check(e)&&(e.method||e.shorthand))e.value.loc=null,wg.FunctionExpression.check(e.value)&&(e.value.id=null);else if(e.type==="ObjectTypeProperty"){var n=e.loc,a=n&&n.end;a&&(a=Yi(a),t.prevPos(a)&&t.charAt(a)===","&&(a=t.skipSpaces(a,!0,!0))&&(n.end=a))}}$e.fixFaultyLocations=rte;function nte(e,t){if(e.type!=="ForStatement")return;function r(i){for(var n=i&&i.loc,a=n&&n.start,o=n&&Yi(n.end);a&&o&&An(a,o)<0&&(t.prevPos(o),t.charAt(o)===";");)n.end.line=o.line,n.end.column=o.column}r(e.init),r(e.test),r(e.update)}function ite(e,t){if(e.type==="TemplateLiteral"&&e.quasis.length!==0){if(e.loc){var r=Yi(e.loc.start);(0,hd.default)(t.charAt(r)==="`"),(0,hd.default)(t.nextPos(r));var i=e.quasis[0];An(i.loc.start,r)<0&&(i.loc.start=r);var n=Yi(e.loc.end);(0,hd.default)(t.prevPos(n)),(0,hd.default)(t.charAt(n)==="`");var a=e.quasis[e.quasis.length-1];An(n,a.loc.end)<0&&(a.loc.end=n)}e.expressions.forEach(function(o,s){var u=t.skipSpaces(o.loc.start,!0,!1);if(t.prevPos(u)&&t.charAt(u)==="{"&&t.prevPos(u)&&t.charAt(u)==="$"){var d=e.quasis[s];An(u,d.loc.end)<0&&(d.loc.end=u)}var p=t.skipSpaces(o.loc.end,!1,!1);if(t.charAt(p)==="}"){(0,hd.default)(t.nextPos(p));var g=e.quasis[s+1];An(g.loc.start,p)<0&&(g.loc.start=p)}})}}function kg(e){if(e)switch(e.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}$e.isExportDeclaration=kg;function ate(e){var t=e.getParentNode();return e.getName()==="declaration"&&kg(t)?t:null}$e.getParentExportDeclaration=ate;function ote(e,t){var r=e.trailingComma;return typeof r=="object"?!!r[t]:!!r}$e.isTrailingCommaEnabled=ote});var GC=P((gd,VC)=>{(function(t,r){typeof gd=="object"&&typeof VC=="object"?VC.exports=r():typeof define=="function"&&define.amd?define([],r):typeof gd=="object"?gd.esprima=r():t.esprima=r()})(gd,function(){return(function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}return r.m=e,r.c=t,r.p="",r(0)})([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(3),a=r(8),o=r(15);function s(h,l,m){var f=null,y=function(W,Y){m&&m(W,Y),f&&f.visit(W,Y)},v=typeof m=="function"?y:null,b=!1;if(l){b=typeof l.comment=="boolean"&&l.comment;var A=typeof l.attachComment=="boolean"&&l.attachComment;(b||A)&&(f=new i.CommentHandler,f.attach=A,l.comment=!0,v=y)}var x=!1;l&&typeof l.sourceType=="string"&&(x=l.sourceType==="module");var _;l&&typeof l.jsx=="boolean"&&l.jsx?_=new n.JSXParser(h,l,v):_=new a.Parser(h,l,v);var C=x?_.parseModule():_.parseScript(),R=C;return b&&f&&(R.comments=f.comments),_.config.tokens&&(R.tokens=_.tokens),_.config.tolerant&&(R.errors=_.errorHandler.errors),R}t.parse=s;function u(h,l,m){var f=l||{};return f.sourceType="module",s(h,f,m)}t.parseModule=u;function d(h,l,m){var f=l||{};return f.sourceType="script",s(h,f,m)}t.parseScript=d;function p(h,l,m){var f=new o.Tokenizer(h,l),y;y=[];try{for(;;){var v=f.getNextToken();if(!v)break;m&&(v=m(v)),y.push(v)}}catch(b){f.errorHandler.tolerate(b)}return f.errorHandler.tolerant&&(y.errors=f.errors()),y}t.tokenize=p;var g=r(2);t.Syntax=g.Syntax,t.version="4.0.1"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),n=(function(){function a(){this.attach=!1,this.comments=[],this.stack=[],this.leading=[],this.trailing=[]}return a.prototype.insertInnerComments=function(o,s){if(o.type===i.Syntax.BlockStatement&&o.body.length===0){for(var u=[],d=this.leading.length-1;d>=0;--d){var p=this.leading[d];s.end.offset>=p.start&&(u.unshift(p.comment),this.leading.splice(d,1),this.trailing.splice(d,1))}u.length&&(o.innerComments=u)}},a.prototype.findTrailingComments=function(o){var s=[];if(this.trailing.length>0){for(var u=this.trailing.length-1;u>=0;--u){var d=this.trailing[u];d.start>=o.end.offset&&s.unshift(d.comment)}return this.trailing.length=0,s}var p=this.stack[this.stack.length-1];if(p&&p.node.trailingComments){var g=p.node.trailingComments[0];g&&g.range[0]>=o.end.offset&&(s=p.node.trailingComments,delete p.node.trailingComments)}return s},a.prototype.findLeadingComments=function(o){for(var s=[],u;this.stack.length>0;){var d=this.stack[this.stack.length-1];if(d&&d.start>=o.start.offset)u=d.node,this.stack.pop();else break}if(u){for(var p=u.leadingComments?u.leadingComments.length:0,g=p-1;g>=0;--g){var h=u.leadingComments[g];h.range[1]<=o.start.offset&&(s.unshift(h),u.leadingComments.splice(g,1))}return u.leadingComments&&u.leadingComments.length===0&&delete u.leadingComments,s}for(var g=this.leading.length-1;g>=0;--g){var d=this.leading[g];d.start<=o.start.offset&&(s.unshift(d.comment),this.leading.splice(g,1))}return s},a.prototype.visitNode=function(o,s){if(!(o.type===i.Syntax.Program&&o.body.length>0)){this.insertInnerComments(o,s);var u=this.findTrailingComments(s),d=this.findLeadingComments(s);d.length>0&&(o.leadingComments=d),u.length>0&&(o.trailingComments=u),this.stack.push({node:o,start:s.start.offset})}},a.prototype.visitComment=function(o,s){var u=o.type[0]==="L"?"Line":"Block",d={type:u,value:o.value};if(o.range&&(d.range=o.range),o.loc&&(d.loc=o.loc),this.comments.push(d),this.attach){var p={comment:{type:u,value:o.value,range:[s.start.offset,s.end.offset]},start:s.start.offset};o.loc&&(p.comment.loc=o.loc),o.type=u,this.leading.push(p),this.trailing.push(p)}},a.prototype.visit=function(o,s){o.type==="LineComment"?this.visitComment(o,s):o.type==="BlockComment"?this.visitComment(o,s):this.attach&&this.visitNode(o,s)},a})();t.CommentHandler=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Syntax={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForOfStatement:"ForOfStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",Program:"Program",Property:"Property",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchCase:"SwitchCase",SwitchStatement:"SwitchStatement",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"}},function(e,t,r){"use strict";var i=this&&this.__extends||(function(){var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,f){m.__proto__=f}||function(m,f){for(var y in f)f.hasOwnProperty(y)&&(m[y]=f[y])};return function(m,f){l(m,f);function y(){this.constructor=m}m.prototype=f===null?Object.create(f):(y.prototype=f.prototype,new y)}})();Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),a=r(5),o=r(6),s=r(7),u=r(8),d=r(13),p=r(14);d.TokenName[100]="JSXIdentifier",d.TokenName[101]="JSXText";function g(l){var m;switch(l.type){case o.JSXSyntax.JSXIdentifier:var f=l;m=f.name;break;case o.JSXSyntax.JSXNamespacedName:var y=l;m=g(y.namespace)+":"+g(y.name);break;case o.JSXSyntax.JSXMemberExpression:var v=l;m=g(v.object)+"."+g(v.property);break;default:break}return m}var h=(function(l){i(m,l);function m(f,y,v){return l.call(this,f,y,v)||this}return m.prototype.parsePrimaryExpression=function(){return this.match("<")?this.parseJSXRoot():l.prototype.parsePrimaryExpression.call(this)},m.prototype.startJSX=function(){this.scanner.index=this.startMarker.index,this.scanner.lineNumber=this.startMarker.line,this.scanner.lineStart=this.startMarker.index-this.startMarker.column},m.prototype.finishJSX=function(){this.nextToken()},m.prototype.reenterJSX=function(){this.startJSX(),this.expectJSX("}"),this.config.tokens&&this.tokens.pop()},m.prototype.createJSXNode=function(){return this.collectComments(),{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},m.prototype.createJSXChildNode=function(){return{index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}},m.prototype.scanXHTMLEntity=function(f){for(var y="&",v=!0,b=!1,A=!1,x=!1;!this.scanner.eof()&&v&&!b;){var _=this.scanner.source[this.scanner.index];if(_===f)break;if(b=_===";",y+=_,++this.scanner.index,!b)switch(y.length){case 2:A=_==="#";break;case 3:A&&(x=_==="x",v=x||n.Character.isDecimalDigit(_.charCodeAt(0)),A=A&&!x);break;default:v=v&&!(A&&!n.Character.isDecimalDigit(_.charCodeAt(0))),v=v&&!(x&&!n.Character.isHexDigit(_.charCodeAt(0)));break}}if(v&&b&&y.length>2){var C=y.substr(1,y.length-2);A&&C.length>1?y=String.fromCharCode(parseInt(C.substr(1),10)):x&&C.length>2?y=String.fromCharCode(parseInt("0"+C.substr(1),16)):!A&&!x&&p.XHTMLEntities[C]&&(y=p.XHTMLEntities[C])}return y},m.prototype.lexJSX=function(){var f=this.scanner.source.charCodeAt(this.scanner.index);if(f===60||f===62||f===47||f===58||f===61||f===123||f===125){var y=this.scanner.source[this.scanner.index++];return{type:7,value:y,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index-1,end:this.scanner.index}}if(f===34||f===39){for(var v=this.scanner.index,b=this.scanner.source[this.scanner.index++],A="";!this.scanner.eof();){var x=this.scanner.source[this.scanner.index++];if(x===b)break;x==="&"?A+=this.scanXHTMLEntity(b):A+=x}return{type:8,value:A,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:v,end:this.scanner.index}}if(f===46){var _=this.scanner.source.charCodeAt(this.scanner.index+1),C=this.scanner.source.charCodeAt(this.scanner.index+2),y=_===46&&C===46?"...":".",v=this.scanner.index;return this.scanner.index+=y.length,{type:7,value:y,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:v,end:this.scanner.index}}if(f===96)return{type:10,value:"",lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:this.scanner.index,end:this.scanner.index};if(n.Character.isIdentifierStart(f)&&f!==92){var v=this.scanner.index;for(++this.scanner.index;!this.scanner.eof();){var x=this.scanner.source.charCodeAt(this.scanner.index);if(n.Character.isIdentifierPart(x)&&x!==92)++this.scanner.index;else if(x===45)++this.scanner.index;else break}var R=this.scanner.source.slice(v,this.scanner.index);return{type:100,value:R,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:v,end:this.scanner.index}}return this.scanner.lex()},m.prototype.nextJSXToken=function(){this.collectComments(),this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;var f=this.lexJSX();return this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.config.tokens&&this.tokens.push(this.convertToken(f)),f},m.prototype.nextJSXText=function(){this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart;for(var f=this.scanner.index,y="";!this.scanner.eof();){var v=this.scanner.source[this.scanner.index];if(v==="{"||v==="<")break;++this.scanner.index,y+=v,n.Character.isLineTerminator(v.charCodeAt(0))&&(++this.scanner.lineNumber,v==="\r"&&this.scanner.source[this.scanner.index]===`
|
|
7
7
|
`&&++this.scanner.index,this.scanner.lineStart=this.scanner.index)}this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart;var b={type:101,value:y,lineNumber:this.scanner.lineNumber,lineStart:this.scanner.lineStart,start:f,end:this.scanner.index};return y.length>0&&this.config.tokens&&this.tokens.push(this.convertToken(b)),b},m.prototype.peekJSXToken=function(){var f=this.scanner.saveState();this.scanner.scanComments();var y=this.lexJSX();return this.scanner.restoreState(f),y},m.prototype.expectJSX=function(f){var y=this.nextJSXToken();(y.type!==7||y.value!==f)&&this.throwUnexpectedToken(y)},m.prototype.matchJSX=function(f){var y=this.peekJSXToken();return y.type===7&&y.value===f},m.prototype.parseJSXIdentifier=function(){var f=this.createJSXNode(),y=this.nextJSXToken();return y.type!==100&&this.throwUnexpectedToken(y),this.finalize(f,new a.JSXIdentifier(y.value))},m.prototype.parseJSXElementName=function(){var f=this.createJSXNode(),y=this.parseJSXIdentifier();if(this.matchJSX(":")){var v=y;this.expectJSX(":");var b=this.parseJSXIdentifier();y=this.finalize(f,new a.JSXNamespacedName(v,b))}else if(this.matchJSX("."))for(;this.matchJSX(".");){var A=y;this.expectJSX(".");var x=this.parseJSXIdentifier();y=this.finalize(f,new a.JSXMemberExpression(A,x))}return y},m.prototype.parseJSXAttributeName=function(){var f=this.createJSXNode(),y,v=this.parseJSXIdentifier();if(this.matchJSX(":")){var b=v;this.expectJSX(":");var A=this.parseJSXIdentifier();y=this.finalize(f,new a.JSXNamespacedName(b,A))}else y=v;return y},m.prototype.parseJSXStringLiteralAttribute=function(){var f=this.createJSXNode(),y=this.nextJSXToken();y.type!==8&&this.throwUnexpectedToken(y);var v=this.getTokenRaw(y);return this.finalize(f,new s.Literal(y.value,v))},m.prototype.parseJSXExpressionAttribute=function(){var f=this.createJSXNode();this.expectJSX("{"),this.finishJSX(),this.match("}")&&this.tolerateError("JSX attributes must only be assigned a non-empty expression");var y=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(f,new a.JSXExpressionContainer(y))},m.prototype.parseJSXAttributeValue=function(){return this.matchJSX("{")?this.parseJSXExpressionAttribute():this.matchJSX("<")?this.parseJSXElement():this.parseJSXStringLiteralAttribute()},m.prototype.parseJSXNameValueAttribute=function(){var f=this.createJSXNode(),y=this.parseJSXAttributeName(),v=null;return this.matchJSX("=")&&(this.expectJSX("="),v=this.parseJSXAttributeValue()),this.finalize(f,new a.JSXAttribute(y,v))},m.prototype.parseJSXSpreadAttribute=function(){var f=this.createJSXNode();this.expectJSX("{"),this.expectJSX("..."),this.finishJSX();var y=this.parseAssignmentExpression();return this.reenterJSX(),this.finalize(f,new a.JSXSpreadAttribute(y))},m.prototype.parseJSXAttributes=function(){for(var f=[];!this.matchJSX("/")&&!this.matchJSX(">");){var y=this.matchJSX("{")?this.parseJSXSpreadAttribute():this.parseJSXNameValueAttribute();f.push(y)}return f},m.prototype.parseJSXOpeningElement=function(){var f=this.createJSXNode();this.expectJSX("<");var y=this.parseJSXElementName(),v=this.parseJSXAttributes(),b=this.matchJSX("/");return b&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(f,new a.JSXOpeningElement(y,b,v))},m.prototype.parseJSXBoundaryElement=function(){var f=this.createJSXNode();if(this.expectJSX("<"),this.matchJSX("/")){this.expectJSX("/");var y=this.parseJSXElementName();return this.expectJSX(">"),this.finalize(f,new a.JSXClosingElement(y))}var v=this.parseJSXElementName(),b=this.parseJSXAttributes(),A=this.matchJSX("/");return A&&this.expectJSX("/"),this.expectJSX(">"),this.finalize(f,new a.JSXOpeningElement(v,A,b))},m.prototype.parseJSXEmptyExpression=function(){var f=this.createJSXChildNode();return this.collectComments(),this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.finalize(f,new a.JSXEmptyExpression)},m.prototype.parseJSXExpressionContainer=function(){var f=this.createJSXNode();this.expectJSX("{");var y;return this.matchJSX("}")?(y=this.parseJSXEmptyExpression(),this.expectJSX("}")):(this.finishJSX(),y=this.parseAssignmentExpression(),this.reenterJSX()),this.finalize(f,new a.JSXExpressionContainer(y))},m.prototype.parseJSXChildren=function(){for(var f=[];!this.scanner.eof();){var y=this.createJSXChildNode(),v=this.nextJSXText();if(v.start<v.end){var b=this.getTokenRaw(v),A=this.finalize(y,new a.JSXText(v.value,b));f.push(A)}if(this.scanner.source[this.scanner.index]==="{"){var x=this.parseJSXExpressionContainer();f.push(x)}else break}return f},m.prototype.parseComplexJSXElement=function(f){for(var y=[];!this.scanner.eof();){f.children=f.children.concat(this.parseJSXChildren());var v=this.createJSXChildNode(),b=this.parseJSXBoundaryElement();if(b.type===o.JSXSyntax.JSXOpeningElement){var A=b;if(A.selfClosing){var x=this.finalize(v,new a.JSXElement(A,[],null));f.children.push(x)}else y.push(f),f={node:v,opening:A,closing:null,children:[]}}if(b.type===o.JSXSyntax.JSXClosingElement){f.closing=b;var _=g(f.opening.name),C=g(f.closing.name);if(_!==C&&this.tolerateError("Expected corresponding JSX closing tag for %0",_),y.length>0){var x=this.finalize(f.node,new a.JSXElement(f.opening,f.children,f.closing));f=y[y.length-1],f.children.push(x),y.pop()}else break}}return f},m.prototype.parseJSXElement=function(){var f=this.createJSXNode(),y=this.parseJSXOpeningElement(),v=[],b=null;if(!y.selfClosing){var A=this.parseComplexJSXElement({node:f,opening:y,closing:b,children:v});v=A.children,b=A.closing}return this.finalize(f,new a.JSXElement(y,v,b))},m.prototype.parseJSXRoot=function(){this.config.tokens&&this.tokens.pop(),this.startJSX();var f=this.parseJSXElement();return this.finishJSX(),f},m.prototype.isStartOfExpression=function(){return l.prototype.isStartOfExpression.call(this)||this.match("<")},m})(u.Parser);t.JSXParser=h},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={NonAsciiIdentifierStart:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,NonAsciiIdentifierPart:/[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/};t.Character={fromCodePoint:function(i){return i<65536?String.fromCharCode(i):String.fromCharCode(55296+(i-65536>>10))+String.fromCharCode(56320+(i-65536&1023))},isWhiteSpace:function(i){return i===32||i===9||i===11||i===12||i===160||i>=5760&&[5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(i)>=0},isLineTerminator:function(i){return i===10||i===13||i===8232||i===8233},isIdentifierStart:function(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i===92||i>=128&&r.NonAsciiIdentifierStart.test(t.Character.fromCodePoint(i))},isIdentifierPart:function(i){return i===36||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===92||i>=128&&r.NonAsciiIdentifierPart.test(t.Character.fromCodePoint(i))},isDecimalDigit:function(i){return i>=48&&i<=57},isHexDigit:function(i){return i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102},isOctalDigit:function(i){return i>=48&&i<=55}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(6),n=(function(){function f(y){this.type=i.JSXSyntax.JSXClosingElement,this.name=y}return f})();t.JSXClosingElement=n;var a=(function(){function f(y,v,b){this.type=i.JSXSyntax.JSXElement,this.openingElement=y,this.children=v,this.closingElement=b}return f})();t.JSXElement=a;var o=(function(){function f(){this.type=i.JSXSyntax.JSXEmptyExpression}return f})();t.JSXEmptyExpression=o;var s=(function(){function f(y){this.type=i.JSXSyntax.JSXExpressionContainer,this.expression=y}return f})();t.JSXExpressionContainer=s;var u=(function(){function f(y){this.type=i.JSXSyntax.JSXIdentifier,this.name=y}return f})();t.JSXIdentifier=u;var d=(function(){function f(y,v){this.type=i.JSXSyntax.JSXMemberExpression,this.object=y,this.property=v}return f})();t.JSXMemberExpression=d;var p=(function(){function f(y,v){this.type=i.JSXSyntax.JSXAttribute,this.name=y,this.value=v}return f})();t.JSXAttribute=p;var g=(function(){function f(y,v){this.type=i.JSXSyntax.JSXNamespacedName,this.namespace=y,this.name=v}return f})();t.JSXNamespacedName=g;var h=(function(){function f(y,v,b){this.type=i.JSXSyntax.JSXOpeningElement,this.name=y,this.selfClosing=v,this.attributes=b}return f})();t.JSXOpeningElement=h;var l=(function(){function f(y){this.type=i.JSXSyntax.JSXSpreadAttribute,this.argument=y}return f})();t.JSXSpreadAttribute=l;var m=(function(){function f(y,v){this.type=i.JSXSyntax.JSXText,this.value=y,this.raw=v}return f})();t.JSXText=m},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSXSyntax={JSXAttribute:"JSXAttribute",JSXClosingElement:"JSXClosingElement",JSXElement:"JSXElement",JSXEmptyExpression:"JSXEmptyExpression",JSXExpressionContainer:"JSXExpressionContainer",JSXIdentifier:"JSXIdentifier",JSXMemberExpression:"JSXMemberExpression",JSXNamespacedName:"JSXNamespacedName",JSXOpeningElement:"JSXOpeningElement",JSXSpreadAttribute:"JSXSpreadAttribute",JSXText:"JSXText"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(2),n=(function(){function I(k){this.type=i.Syntax.ArrayExpression,this.elements=k}return I})();t.ArrayExpression=n;var a=(function(){function I(k){this.type=i.Syntax.ArrayPattern,this.elements=k}return I})();t.ArrayPattern=a;var o=(function(){function I(k,F,ne){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=k,this.body=F,this.generator=!1,this.expression=ne,this.async=!1}return I})();t.ArrowFunctionExpression=o;var s=(function(){function I(k,F,ne){this.type=i.Syntax.AssignmentExpression,this.operator=k,this.left=F,this.right=ne}return I})();t.AssignmentExpression=s;var u=(function(){function I(k,F){this.type=i.Syntax.AssignmentPattern,this.left=k,this.right=F}return I})();t.AssignmentPattern=u;var d=(function(){function I(k,F,ne){this.type=i.Syntax.ArrowFunctionExpression,this.id=null,this.params=k,this.body=F,this.generator=!1,this.expression=ne,this.async=!0}return I})();t.AsyncArrowFunctionExpression=d;var p=(function(){function I(k,F,ne){this.type=i.Syntax.FunctionDeclaration,this.id=k,this.params=F,this.body=ne,this.generator=!1,this.expression=!1,this.async=!0}return I})();t.AsyncFunctionDeclaration=p;var g=(function(){function I(k,F,ne){this.type=i.Syntax.FunctionExpression,this.id=k,this.params=F,this.body=ne,this.generator=!1,this.expression=!1,this.async=!0}return I})();t.AsyncFunctionExpression=g;var h=(function(){function I(k){this.type=i.Syntax.AwaitExpression,this.argument=k}return I})();t.AwaitExpression=h;var l=(function(){function I(k,F,ne){var Xt=k==="||"||k==="&&";this.type=Xt?i.Syntax.LogicalExpression:i.Syntax.BinaryExpression,this.operator=k,this.left=F,this.right=ne}return I})();t.BinaryExpression=l;var m=(function(){function I(k){this.type=i.Syntax.BlockStatement,this.body=k}return I})();t.BlockStatement=m;var f=(function(){function I(k){this.type=i.Syntax.BreakStatement,this.label=k}return I})();t.BreakStatement=f;var y=(function(){function I(k,F){this.type=i.Syntax.CallExpression,this.callee=k,this.arguments=F}return I})();t.CallExpression=y;var v=(function(){function I(k,F){this.type=i.Syntax.CatchClause,this.param=k,this.body=F}return I})();t.CatchClause=v;var b=(function(){function I(k){this.type=i.Syntax.ClassBody,this.body=k}return I})();t.ClassBody=b;var A=(function(){function I(k,F,ne){this.type=i.Syntax.ClassDeclaration,this.id=k,this.superClass=F,this.body=ne}return I})();t.ClassDeclaration=A;var x=(function(){function I(k,F,ne){this.type=i.Syntax.ClassExpression,this.id=k,this.superClass=F,this.body=ne}return I})();t.ClassExpression=x;var _=(function(){function I(k,F){this.type=i.Syntax.MemberExpression,this.computed=!0,this.object=k,this.property=F}return I})();t.ComputedMemberExpression=_;var C=(function(){function I(k,F,ne){this.type=i.Syntax.ConditionalExpression,this.test=k,this.consequent=F,this.alternate=ne}return I})();t.ConditionalExpression=C;var R=(function(){function I(k){this.type=i.Syntax.ContinueStatement,this.label=k}return I})();t.ContinueStatement=R;var W=(function(){function I(){this.type=i.Syntax.DebuggerStatement}return I})();t.DebuggerStatement=W;var Y=(function(){function I(k,F){this.type=i.Syntax.ExpressionStatement,this.expression=k,this.directive=F}return I})();t.Directive=Y;var ve=(function(){function I(k,F){this.type=i.Syntax.DoWhileStatement,this.body=k,this.test=F}return I})();t.DoWhileStatement=ve;var Me=(function(){function I(){this.type=i.Syntax.EmptyStatement}return I})();t.EmptyStatement=Me;var lr=(function(){function I(k){this.type=i.Syntax.ExportAllDeclaration,this.source=k}return I})();t.ExportAllDeclaration=lr;var $n=(function(){function I(k){this.type=i.Syntax.ExportDefaultDeclaration,this.declaration=k}return I})();t.ExportDefaultDeclaration=$n;var _o=(function(){function I(k,F,ne){this.type=i.Syntax.ExportNamedDeclaration,this.declaration=k,this.specifiers=F,this.source=ne}return I})();t.ExportNamedDeclaration=_o;var sa=(function(){function I(k,F){this.type=i.Syntax.ExportSpecifier,this.exported=F,this.local=k}return I})();t.ExportSpecifier=sa;var jn=(function(){function I(k){this.type=i.Syntax.ExpressionStatement,this.expression=k}return I})();t.ExpressionStatement=jn;var Lc=(function(){function I(k,F,ne){this.type=i.Syntax.ForInStatement,this.left=k,this.right=F,this.body=ne,this.each=!1}return I})();t.ForInStatement=Lc;var Mn=(function(){function I(k,F,ne){this.type=i.Syntax.ForOfStatement,this.left=k,this.right=F,this.body=ne}return I})();t.ForOfStatement=Mn;var xi=(function(){function I(k,F,ne,Xt){this.type=i.Syntax.ForStatement,this.init=k,this.test=F,this.update=ne,this.body=Xt}return I})();t.ForStatement=xi;var U=(function(){function I(k,F,ne,Xt){this.type=i.Syntax.FunctionDeclaration,this.id=k,this.params=F,this.body=ne,this.generator=Xt,this.expression=!1,this.async=!1}return I})();t.FunctionDeclaration=U;var V=(function(){function I(k,F,ne,Xt){this.type=i.Syntax.FunctionExpression,this.id=k,this.params=F,this.body=ne,this.generator=Xt,this.expression=!1,this.async=!1}return I})();t.FunctionExpression=V;var B=(function(){function I(k){this.type=i.Syntax.Identifier,this.name=k}return I})();t.Identifier=B;var J=(function(){function I(k,F,ne){this.type=i.Syntax.IfStatement,this.test=k,this.consequent=F,this.alternate=ne}return I})();t.IfStatement=J;var me=(function(){function I(k,F){this.type=i.Syntax.ImportDeclaration,this.specifiers=k,this.source=F}return I})();t.ImportDeclaration=me;var he=(function(){function I(k){this.type=i.Syntax.ImportDefaultSpecifier,this.local=k}return I})();t.ImportDefaultSpecifier=he;var nt=(function(){function I(k){this.type=i.Syntax.ImportNamespaceSpecifier,this.local=k}return I})();t.ImportNamespaceSpecifier=nt;var De=(function(){function I(k,F){this.type=i.Syntax.ImportSpecifier,this.local=k,this.imported=F}return I})();t.ImportSpecifier=De;var Pe=(function(){function I(k,F){this.type=i.Syntax.LabeledStatement,this.label=k,this.body=F}return I})();t.LabeledStatement=Pe;var dr=(function(){function I(k,F){this.type=i.Syntax.Literal,this.value=k,this.raw=F}return I})();t.Literal=dr;var pr=(function(){function I(k,F){this.type=i.Syntax.MetaProperty,this.meta=k,this.property=F}return I})();t.MetaProperty=pr;var jt=(function(){function I(k,F,ne,Xt,Dy){this.type=i.Syntax.MethodDefinition,this.key=k,this.computed=F,this.value=ne,this.kind=Xt,this.static=Dy}return I})();t.MethodDefinition=jt;var mr=(function(){function I(k){this.type=i.Syntax.Program,this.body=k,this.sourceType="module"}return I})();t.Module=mr;var Uc=(function(){function I(k,F){this.type=i.Syntax.NewExpression,this.callee=k,this.arguments=F}return I})();t.NewExpression=Uc;var Fn=(function(){function I(k){this.type=i.Syntax.ObjectExpression,this.properties=k}return I})();t.ObjectExpression=Fn;var To=(function(){function I(k){this.type=i.Syntax.ObjectPattern,this.properties=k}return I})();t.ObjectPattern=To;var Ln=(function(){function I(k,F,ne,Xt,Dy,EG){this.type=i.Syntax.Property,this.key=F,this.computed=ne,this.value=Xt,this.kind=k,this.method=Dy,this.shorthand=EG}return I})();t.Property=Ln;var Co=(function(){function I(k,F,ne,Xt){this.type=i.Syntax.Literal,this.value=k,this.raw=F,this.regex={pattern:ne,flags:Xt}}return I})();t.RegexLiteral=Co;var Ey=(function(){function I(k){this.type=i.Syntax.RestElement,this.argument=k}return I})();t.RestElement=Ey;var Vd=(function(){function I(k){this.type=i.Syntax.ReturnStatement,this.argument=k}return I})();t.ReturnStatement=Vd;var Gd=(function(){function I(k){this.type=i.Syntax.Program,this.body=k,this.sourceType="script"}return I})();t.Script=Gd;var Wd=(function(){function I(k){this.type=i.Syntax.SequenceExpression,this.expressions=k}return I})();t.SequenceExpression=Wd;var ca=(function(){function I(k){this.type=i.Syntax.SpreadElement,this.argument=k}return I})();t.SpreadElement=ca;var Lr=(function(){function I(k,F){this.type=i.Syntax.MemberExpression,this.computed=!1,this.object=k,this.property=F}return I})();t.StaticMemberExpression=Lr;var Kd=(function(){function I(){this.type=i.Syntax.Super}return I})();t.Super=Kd;var xy=(function(){function I(k,F){this.type=i.Syntax.SwitchCase,this.test=k,this.consequent=F}return I})();t.SwitchCase=xy;var Zd=(function(){function I(k,F){this.type=i.Syntax.SwitchStatement,this.discriminant=k,this.cases=F}return I})();t.SwitchStatement=Zd;var qd=(function(){function I(k,F){this.type=i.Syntax.TaggedTemplateExpression,this.tag=k,this.quasi=F}return I})();t.TaggedTemplateExpression=qd;var Hd=(function(){function I(k,F){this.type=i.Syntax.TemplateElement,this.value=k,this.tail=F}return I})();t.TemplateElement=Hd;var Ay=(function(){function I(k,F){this.type=i.Syntax.TemplateLiteral,this.quasis=k,this.expressions=F}return I})();t.TemplateLiteral=Ay;var Jd=(function(){function I(){this.type=i.Syntax.ThisExpression}return I})();t.ThisExpression=Jd;var _y=(function(){function I(k){this.type=i.Syntax.ThrowStatement,this.argument=k}return I})();t.ThrowStatement=_y;var Ty=(function(){function I(k,F,ne){this.type=i.Syntax.TryStatement,this.block=k,this.handler=F,this.finalizer=ne}return I})();t.TryStatement=Ty;var Xd=(function(){function I(k,F){this.type=i.Syntax.UnaryExpression,this.operator=k,this.argument=F,this.prefix=!0}return I})();t.UnaryExpression=Xd;var Cy=(function(){function I(k,F,ne){this.type=i.Syntax.UpdateExpression,this.operator=k,this.argument=F,this.prefix=ne}return I})();t.UpdateExpression=Cy;var Iy=(function(){function I(k,F){this.type=i.Syntax.VariableDeclaration,this.declarations=k,this.kind=F}return I})();t.VariableDeclaration=Iy;var Yd=(function(){function I(k,F){this.type=i.Syntax.VariableDeclarator,this.id=k,this.init=F}return I})();t.VariableDeclarator=Yd;var X=(function(){function I(k,F){this.type=i.Syntax.WhileStatement,this.test=k,this.body=F}return I})();t.WhileStatement=X;var pe=(function(){function I(k,F){this.type=i.Syntax.WithStatement,this.object=k,this.body=F}return I})();t.WithStatement=pe;var fr=(function(){function I(k,F){this.type=i.Syntax.YieldExpression,this.argument=k,this.delegate=F}return I})();t.YieldExpression=fr},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),n=r(10),a=r(11),o=r(7),s=r(12),u=r(2),d=r(13),p="ArrowParameterPlaceHolder",g=(function(){function h(l,m,f){m===void 0&&(m={}),this.config={range:typeof m.range=="boolean"&&m.range,loc:typeof m.loc=="boolean"&&m.loc,source:null,tokens:typeof m.tokens=="boolean"&&m.tokens,comment:typeof m.comment=="boolean"&&m.comment,tolerant:typeof m.tolerant=="boolean"&&m.tolerant},this.config.loc&&m.source&&m.source!==null&&(this.config.source=String(m.source)),this.delegate=f,this.errorHandler=new n.ErrorHandler,this.errorHandler.tolerant=this.config.tolerant,this.scanner=new s.Scanner(l,this.errorHandler),this.scanner.trackComment=this.config.comment,this.operatorPrecedence={")":0,";":0,",":0,"=":0,"]":0,"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":11,"/":11,"%":11},this.lookahead={type:2,value:"",lineNumber:this.scanner.lineNumber,lineStart:0,start:0,end:0},this.hasLineTerminator=!1,this.context={isModule:!1,await:!1,allowIn:!0,allowStrictDirective:!0,allowYield:!0,firstCoverInitializedNameError:null,isAssignmentTarget:!1,isBindingElement:!1,inFunctionBody:!1,inIteration:!1,inSwitch:!1,labelSet:{},strict:!1},this.tokens=[],this.startMarker={index:0,line:this.scanner.lineNumber,column:0},this.lastMarker={index:0,line:this.scanner.lineNumber,column:0},this.nextToken(),this.lastMarker={index:this.scanner.index,line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}return h.prototype.throwError=function(l){for(var m=[],f=1;f<arguments.length;f++)m[f-1]=arguments[f];var y=Array.prototype.slice.call(arguments,1),v=l.replace(/%(\d)/g,function(_,C){return i.assert(C<y.length,"Message reference must be in range"),y[C]}),b=this.lastMarker.index,A=this.lastMarker.line,x=this.lastMarker.column+1;throw this.errorHandler.createError(b,A,x,v)},h.prototype.tolerateError=function(l){for(var m=[],f=1;f<arguments.length;f++)m[f-1]=arguments[f];var y=Array.prototype.slice.call(arguments,1),v=l.replace(/%(\d)/g,function(_,C){return i.assert(C<y.length,"Message reference must be in range"),y[C]}),b=this.lastMarker.index,A=this.scanner.lineNumber,x=this.lastMarker.column+1;this.errorHandler.tolerateError(b,A,x,v)},h.prototype.unexpectedTokenError=function(l,m){var f=m||a.Messages.UnexpectedToken,y;if(l?(m||(f=l.type===2?a.Messages.UnexpectedEOS:l.type===3?a.Messages.UnexpectedIdentifier:l.type===6?a.Messages.UnexpectedNumber:l.type===8?a.Messages.UnexpectedString:l.type===10?a.Messages.UnexpectedTemplate:a.Messages.UnexpectedToken,l.type===4&&(this.scanner.isFutureReservedWord(l.value)?f=a.Messages.UnexpectedReserved:this.context.strict&&this.scanner.isStrictModeReservedWord(l.value)&&(f=a.Messages.StrictReservedWord))),y=l.value):y="ILLEGAL",f=f.replace("%0",y),l&&typeof l.lineNumber=="number"){var v=l.start,b=l.lineNumber,A=this.lastMarker.index-this.lastMarker.column,x=l.start-A+1;return this.errorHandler.createError(v,b,x,f)}else{var v=this.lastMarker.index,b=this.lastMarker.line,x=this.lastMarker.column+1;return this.errorHandler.createError(v,b,x,f)}},h.prototype.throwUnexpectedToken=function(l,m){throw this.unexpectedTokenError(l,m)},h.prototype.tolerateUnexpectedToken=function(l,m){this.errorHandler.tolerate(this.unexpectedTokenError(l,m))},h.prototype.collectComments=function(){if(!this.config.comment)this.scanner.scanComments();else{var l=this.scanner.scanComments();if(l.length>0&&this.delegate)for(var m=0;m<l.length;++m){var f=l[m],y=void 0;y={type:f.multiLine?"BlockComment":"LineComment",value:this.scanner.source.slice(f.slice[0],f.slice[1])},this.config.range&&(y.range=f.range),this.config.loc&&(y.loc=f.loc);var v={start:{line:f.loc.start.line,column:f.loc.start.column,offset:f.range[0]},end:{line:f.loc.end.line,column:f.loc.end.column,offset:f.range[1]}};this.delegate(y,v)}}},h.prototype.getTokenRaw=function(l){return this.scanner.source.slice(l.start,l.end)},h.prototype.convertToken=function(l){var m={type:d.TokenName[l.type],value:this.getTokenRaw(l)};if(this.config.range&&(m.range=[l.start,l.end]),this.config.loc&&(m.loc={start:{line:this.startMarker.line,column:this.startMarker.column},end:{line:this.scanner.lineNumber,column:this.scanner.index-this.scanner.lineStart}}),l.type===9){var f=l.pattern,y=l.flags;m.regex={pattern:f,flags:y}}return m},h.prototype.nextToken=function(){var l=this.lookahead;this.lastMarker.index=this.scanner.index,this.lastMarker.line=this.scanner.lineNumber,this.lastMarker.column=this.scanner.index-this.scanner.lineStart,this.collectComments(),this.scanner.index!==this.startMarker.index&&(this.startMarker.index=this.scanner.index,this.startMarker.line=this.scanner.lineNumber,this.startMarker.column=this.scanner.index-this.scanner.lineStart);var m=this.scanner.lex();return this.hasLineTerminator=l.lineNumber!==m.lineNumber,m&&this.context.strict&&m.type===3&&this.scanner.isStrictModeReservedWord(m.value)&&(m.type=4),this.lookahead=m,this.config.tokens&&m.type!==2&&this.tokens.push(this.convertToken(m)),l},h.prototype.nextRegexToken=function(){this.collectComments();var l=this.scanner.scanRegExp();return this.config.tokens&&(this.tokens.pop(),this.tokens.push(this.convertToken(l))),this.lookahead=l,this.nextToken(),l},h.prototype.createNode=function(){return{index:this.startMarker.index,line:this.startMarker.line,column:this.startMarker.column}},h.prototype.startNode=function(l,m){m===void 0&&(m=0);var f=l.start-l.lineStart,y=l.lineNumber;return f<0&&(f+=m,y--),{index:l.start,line:y,column:f}},h.prototype.finalize=function(l,m){if(this.config.range&&(m.range=[l.index,this.lastMarker.index]),this.config.loc&&(m.loc={start:{line:l.line,column:l.column},end:{line:this.lastMarker.line,column:this.lastMarker.column}},this.config.source&&(m.loc.source=this.config.source)),this.delegate){var f={start:{line:l.line,column:l.column,offset:l.index},end:{line:this.lastMarker.line,column:this.lastMarker.column,offset:this.lastMarker.index}};this.delegate(m,f)}return m},h.prototype.expect=function(l){var m=this.nextToken();(m.type!==7||m.value!==l)&&this.throwUnexpectedToken(m)},h.prototype.expectCommaSeparator=function(){if(this.config.tolerant){var l=this.lookahead;l.type===7&&l.value===","?this.nextToken():l.type===7&&l.value===";"?(this.nextToken(),this.tolerateUnexpectedToken(l)):this.tolerateUnexpectedToken(l,a.Messages.UnexpectedToken)}else this.expect(",")},h.prototype.expectKeyword=function(l){var m=this.nextToken();(m.type!==4||m.value!==l)&&this.throwUnexpectedToken(m)},h.prototype.match=function(l){return this.lookahead.type===7&&this.lookahead.value===l},h.prototype.matchKeyword=function(l){return this.lookahead.type===4&&this.lookahead.value===l},h.prototype.matchContextualKeyword=function(l){return this.lookahead.type===3&&this.lookahead.value===l},h.prototype.matchAssign=function(){if(this.lookahead.type!==7)return!1;var l=this.lookahead.value;return l==="="||l==="*="||l==="**="||l==="/="||l==="%="||l==="+="||l==="-="||l==="<<="||l===">>="||l===">>>="||l==="&="||l==="^="||l==="|="},h.prototype.isolateCoverGrammar=function(l){var m=this.context.isBindingElement,f=this.context.isAssignmentTarget,y=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var v=l.call(this);return this.context.firstCoverInitializedNameError!==null&&this.throwUnexpectedToken(this.context.firstCoverInitializedNameError),this.context.isBindingElement=m,this.context.isAssignmentTarget=f,this.context.firstCoverInitializedNameError=y,v},h.prototype.inheritCoverGrammar=function(l){var m=this.context.isBindingElement,f=this.context.isAssignmentTarget,y=this.context.firstCoverInitializedNameError;this.context.isBindingElement=!0,this.context.isAssignmentTarget=!0,this.context.firstCoverInitializedNameError=null;var v=l.call(this);return this.context.isBindingElement=this.context.isBindingElement&&m,this.context.isAssignmentTarget=this.context.isAssignmentTarget&&f,this.context.firstCoverInitializedNameError=y||this.context.firstCoverInitializedNameError,v},h.prototype.consumeSemicolon=function(){this.match(";")?this.nextToken():this.hasLineTerminator||(this.lookahead.type!==2&&!this.match("}")&&this.throwUnexpectedToken(this.lookahead),this.lastMarker.index=this.startMarker.index,this.lastMarker.line=this.startMarker.line,this.lastMarker.column=this.startMarker.column)},h.prototype.parsePrimaryExpression=function(){var l=this.createNode(),m,f,y;switch(this.lookahead.type){case 3:(this.context.isModule||this.context.await)&&this.lookahead.value==="await"&&this.tolerateUnexpectedToken(this.lookahead),m=this.matchAsyncFunction()?this.parseFunctionExpression():this.finalize(l,new o.Identifier(this.nextToken().value));break;case 6:case 8:this.context.strict&&this.lookahead.octal&&this.tolerateUnexpectedToken(this.lookahead,a.Messages.StrictOctalLiteral),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,f=this.nextToken(),y=this.getTokenRaw(f),m=this.finalize(l,new o.Literal(f.value,y));break;case 1:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,f=this.nextToken(),y=this.getTokenRaw(f),m=this.finalize(l,new o.Literal(f.value==="true",y));break;case 5:this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,f=this.nextToken(),y=this.getTokenRaw(f),m=this.finalize(l,new o.Literal(null,y));break;case 10:m=this.parseTemplateLiteral();break;case 7:switch(this.lookahead.value){case"(":this.context.isBindingElement=!1,m=this.inheritCoverGrammar(this.parseGroupExpression);break;case"[":m=this.inheritCoverGrammar(this.parseArrayInitializer);break;case"{":m=this.inheritCoverGrammar(this.parseObjectInitializer);break;case"/":case"/=":this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.scanner.index=this.startMarker.index,f=this.nextRegexToken(),y=this.getTokenRaw(f),m=this.finalize(l,new o.RegexLiteral(f.regex,y,f.pattern,f.flags));break;default:m=this.throwUnexpectedToken(this.nextToken())}break;case 4:!this.context.strict&&this.context.allowYield&&this.matchKeyword("yield")?m=this.parseIdentifierName():!this.context.strict&&this.matchKeyword("let")?m=this.finalize(l,new o.Identifier(this.nextToken().value)):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.matchKeyword("function")?m=this.parseFunctionExpression():this.matchKeyword("this")?(this.nextToken(),m=this.finalize(l,new o.ThisExpression)):this.matchKeyword("class")?m=this.parseClassExpression():m=this.throwUnexpectedToken(this.nextToken()));break;default:m=this.throwUnexpectedToken(this.nextToken())}return m},h.prototype.parseSpreadElement=function(){var l=this.createNode();this.expect("...");var m=this.inheritCoverGrammar(this.parseAssignmentExpression);return this.finalize(l,new o.SpreadElement(m))},h.prototype.parseArrayInitializer=function(){var l=this.createNode(),m=[];for(this.expect("[");!this.match("]");)if(this.match(","))this.nextToken(),m.push(null);else if(this.match("...")){var f=this.parseSpreadElement();this.match("]")||(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1,this.expect(",")),m.push(f)}else m.push(this.inheritCoverGrammar(this.parseAssignmentExpression)),this.match("]")||this.expect(",");return this.expect("]"),this.finalize(l,new o.ArrayExpression(m))},h.prototype.parsePropertyMethod=function(l){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var m=this.context.strict,f=this.context.allowStrictDirective;this.context.allowStrictDirective=l.simple;var y=this.isolateCoverGrammar(this.parseFunctionSourceElements);return this.context.strict&&l.firstRestricted&&this.tolerateUnexpectedToken(l.firstRestricted,l.message),this.context.strict&&l.stricted&&this.tolerateUnexpectedToken(l.stricted,l.message),this.context.strict=m,this.context.allowStrictDirective=f,y},h.prototype.parsePropertyMethodFunction=function(){var l=!1,m=this.createNode(),f=this.context.allowYield;this.context.allowYield=!0;var y=this.parseFormalParameters(),v=this.parsePropertyMethod(y);return this.context.allowYield=f,this.finalize(m,new o.FunctionExpression(null,y.params,v,l))},h.prototype.parsePropertyMethodAsyncFunction=function(){var l=this.createNode(),m=this.context.allowYield,f=this.context.await;this.context.allowYield=!1,this.context.await=!0;var y=this.parseFormalParameters(),v=this.parsePropertyMethod(y);return this.context.allowYield=m,this.context.await=f,this.finalize(l,new o.AsyncFunctionExpression(null,y.params,v))},h.prototype.parseObjectPropertyKey=function(){var l=this.createNode(),m=this.nextToken(),f;switch(m.type){case 8:case 6:this.context.strict&&m.octal&&this.tolerateUnexpectedToken(m,a.Messages.StrictOctalLiteral);var y=this.getTokenRaw(m);f=this.finalize(l,new o.Literal(m.value,y));break;case 3:case 1:case 5:case 4:f=this.finalize(l,new o.Identifier(m.value));break;case 7:m.value==="["?(f=this.isolateCoverGrammar(this.parseAssignmentExpression),this.expect("]")):f=this.throwUnexpectedToken(m);break;default:f=this.throwUnexpectedToken(m)}return f},h.prototype.isPropertyKey=function(l,m){return l.type===u.Syntax.Identifier&&l.name===m||l.type===u.Syntax.Literal&&l.value===m},h.prototype.parseObjectProperty=function(l){var m=this.createNode(),f=this.lookahead,y,v=null,b=null,A=!1,x=!1,_=!1,C=!1;if(f.type===3){var R=f.value;this.nextToken(),A=this.match("["),C=!this.hasLineTerminator&&R==="async"&&!this.match(":")&&!this.match("(")&&!this.match("*")&&!this.match(","),v=C?this.parseObjectPropertyKey():this.finalize(m,new o.Identifier(R))}else this.match("*")?this.nextToken():(A=this.match("["),v=this.parseObjectPropertyKey());var W=this.qualifiedPropertyName(this.lookahead);if(f.type===3&&!C&&f.value==="get"&&W)y="get",A=this.match("["),v=this.parseObjectPropertyKey(),this.context.allowYield=!1,b=this.parseGetterMethod();else if(f.type===3&&!C&&f.value==="set"&&W)y="set",A=this.match("["),v=this.parseObjectPropertyKey(),b=this.parseSetterMethod();else if(f.type===7&&f.value==="*"&&W)y="init",A=this.match("["),v=this.parseObjectPropertyKey(),b=this.parseGeneratorMethod(),x=!0;else if(v||this.throwUnexpectedToken(this.lookahead),y="init",this.match(":")&&!C)!A&&this.isPropertyKey(v,"__proto__")&&(l.value&&this.tolerateError(a.Messages.DuplicateProtoProperty),l.value=!0),this.nextToken(),b=this.inheritCoverGrammar(this.parseAssignmentExpression);else if(this.match("("))b=C?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),x=!0;else if(f.type===3){var R=this.finalize(m,new o.Identifier(f.value));if(this.match("=")){this.context.firstCoverInitializedNameError=this.lookahead,this.nextToken(),_=!0;var Y=this.isolateCoverGrammar(this.parseAssignmentExpression);b=this.finalize(m,new o.AssignmentPattern(R,Y))}else _=!0,b=R}else this.throwUnexpectedToken(this.nextToken());return this.finalize(m,new o.Property(y,v,A,b,x,_))},h.prototype.parseObjectInitializer=function(){var l=this.createNode();this.expect("{");for(var m=[],f={value:!1};!this.match("}");)m.push(this.parseObjectProperty(f)),this.match("}")||this.expectCommaSeparator();return this.expect("}"),this.finalize(l,new o.ObjectExpression(m))},h.prototype.parseTemplateHead=function(){i.assert(this.lookahead.head,"Template literal must start with a template head");var l=this.createNode(),m=this.nextToken(),f=m.value,y=m.cooked;return this.finalize(l,new o.TemplateElement({raw:f,cooked:y},m.tail))},h.prototype.parseTemplateElement=function(){this.lookahead.type!==10&&this.throwUnexpectedToken();var l=this.createNode(),m=this.nextToken(),f=m.value,y=m.cooked;return this.finalize(l,new o.TemplateElement({raw:f,cooked:y},m.tail))},h.prototype.parseTemplateLiteral=function(){var l=this.createNode(),m=[],f=[],y=this.parseTemplateHead();for(f.push(y);!y.tail;)m.push(this.parseExpression()),y=this.parseTemplateElement(),f.push(y);return this.finalize(l,new o.TemplateLiteral(f,m))},h.prototype.reinterpretExpressionAsPattern=function(l){switch(l.type){case u.Syntax.Identifier:case u.Syntax.MemberExpression:case u.Syntax.RestElement:case u.Syntax.AssignmentPattern:break;case u.Syntax.SpreadElement:l.type=u.Syntax.RestElement,this.reinterpretExpressionAsPattern(l.argument);break;case u.Syntax.ArrayExpression:l.type=u.Syntax.ArrayPattern;for(var m=0;m<l.elements.length;m++)l.elements[m]!==null&&this.reinterpretExpressionAsPattern(l.elements[m]);break;case u.Syntax.ObjectExpression:l.type=u.Syntax.ObjectPattern;for(var m=0;m<l.properties.length;m++)this.reinterpretExpressionAsPattern(l.properties[m].value);break;case u.Syntax.AssignmentExpression:l.type=u.Syntax.AssignmentPattern,delete l.operator,this.reinterpretExpressionAsPattern(l.left);break;default:break}},h.prototype.parseGroupExpression=function(){var l;if(this.expect("("),this.match(")"))this.nextToken(),this.match("=>")||this.expect("=>"),l={type:p,params:[],async:!1};else{var m=this.lookahead,f=[];if(this.match("..."))l=this.parseRestElement(f),this.expect(")"),this.match("=>")||this.expect("=>"),l={type:p,params:[l],async:!1};else{var y=!1;if(this.context.isBindingElement=!0,l=this.inheritCoverGrammar(this.parseAssignmentExpression),this.match(",")){var v=[];for(this.context.isAssignmentTarget=!1,v.push(l);this.lookahead.type!==2&&this.match(",");){if(this.nextToken(),this.match(")")){this.nextToken();for(var b=0;b<v.length;b++)this.reinterpretExpressionAsPattern(v[b]);y=!0,l={type:p,params:v,async:!1}}else if(this.match("...")){this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),v.push(this.parseRestElement(f)),this.expect(")"),this.match("=>")||this.expect("=>"),this.context.isBindingElement=!1;for(var b=0;b<v.length;b++)this.reinterpretExpressionAsPattern(v[b]);y=!0,l={type:p,params:v,async:!1}}else v.push(this.inheritCoverGrammar(this.parseAssignmentExpression));if(y)break}y||(l=this.finalize(this.startNode(m),new o.SequenceExpression(v)))}if(!y){if(this.expect(")"),this.match("=>")&&(l.type===u.Syntax.Identifier&&l.name==="yield"&&(y=!0,l={type:p,params:[l],async:!1}),!y)){if(this.context.isBindingElement||this.throwUnexpectedToken(this.lookahead),l.type===u.Syntax.SequenceExpression)for(var b=0;b<l.expressions.length;b++)this.reinterpretExpressionAsPattern(l.expressions[b]);else this.reinterpretExpressionAsPattern(l);var A=l.type===u.Syntax.SequenceExpression?l.expressions:[l];l={type:p,params:A,async:!1}}this.context.isBindingElement=!1}}}return l},h.prototype.parseArguments=function(){this.expect("(");var l=[];if(!this.match(")"))for(;;){var m=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAssignmentExpression);if(l.push(m),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),l},h.prototype.isIdentifierName=function(l){return l.type===3||l.type===4||l.type===1||l.type===5},h.prototype.parseIdentifierName=function(){var l=this.createNode(),m=this.nextToken();return this.isIdentifierName(m)||this.throwUnexpectedToken(m),this.finalize(l,new o.Identifier(m.value))},h.prototype.parseNewExpression=function(){var l=this.createNode(),m=this.parseIdentifierName();i.assert(m.name==="new","New expression must start with `new`");var f;if(this.match("."))if(this.nextToken(),this.lookahead.type===3&&this.context.inFunctionBody&&this.lookahead.value==="target"){var y=this.parseIdentifierName();f=new o.MetaProperty(m,y)}else this.throwUnexpectedToken(this.lookahead);else{var v=this.isolateCoverGrammar(this.parseLeftHandSideExpression),b=this.match("(")?this.parseArguments():[];f=new o.NewExpression(v,b),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return this.finalize(l,f)},h.prototype.parseAsyncArgument=function(){var l=this.parseAssignmentExpression();return this.context.firstCoverInitializedNameError=null,l},h.prototype.parseAsyncArguments=function(){this.expect("(");var l=[];if(!this.match(")"))for(;;){var m=this.match("...")?this.parseSpreadElement():this.isolateCoverGrammar(this.parseAsyncArgument);if(l.push(m),this.match(")")||(this.expectCommaSeparator(),this.match(")")))break}return this.expect(")"),l},h.prototype.parseLeftHandSideExpressionAllowCall=function(){var l=this.lookahead,m=this.matchContextualKeyword("async"),f=this.context.allowIn;this.context.allowIn=!0;var y;for(this.matchKeyword("super")&&this.context.inFunctionBody?(y=this.createNode(),this.nextToken(),y=this.finalize(y,new o.Super),!this.match("(")&&!this.match(".")&&!this.match("[")&&this.throwUnexpectedToken(this.lookahead)):y=this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var v=this.parseIdentifierName();y=this.finalize(this.startNode(l),new o.StaticMemberExpression(y,v))}else if(this.match("(")){var b=m&&l.lineNumber===this.lookahead.lineNumber;this.context.isBindingElement=!1,this.context.isAssignmentTarget=!1;var A=b?this.parseAsyncArguments():this.parseArguments();if(y=this.finalize(this.startNode(l),new o.CallExpression(y,A)),b&&this.match("=>")){for(var x=0;x<A.length;++x)this.reinterpretExpressionAsPattern(A[x]);y={type:p,params:A,async:!0}}}else if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var v=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),y=this.finalize(this.startNode(l),new o.ComputedMemberExpression(y,v))}else if(this.lookahead.type===10&&this.lookahead.head){var _=this.parseTemplateLiteral();y=this.finalize(this.startNode(l),new o.TaggedTemplateExpression(y,_))}else break;return this.context.allowIn=f,y},h.prototype.parseSuper=function(){var l=this.createNode();return this.expectKeyword("super"),!this.match("[")&&!this.match(".")&&this.throwUnexpectedToken(this.lookahead),this.finalize(l,new o.Super)},h.prototype.parseLeftHandSideExpression=function(){i.assert(this.context.allowIn,"callee of new expression always allow in keyword.");for(var l=this.startNode(this.lookahead),m=this.matchKeyword("super")&&this.context.inFunctionBody?this.parseSuper():this.inheritCoverGrammar(this.matchKeyword("new")?this.parseNewExpression:this.parsePrimaryExpression);;)if(this.match("[")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect("[");var f=this.isolateCoverGrammar(this.parseExpression);this.expect("]"),m=this.finalize(l,new o.ComputedMemberExpression(m,f))}else if(this.match(".")){this.context.isBindingElement=!1,this.context.isAssignmentTarget=!0,this.expect(".");var f=this.parseIdentifierName();m=this.finalize(l,new o.StaticMemberExpression(m,f))}else if(this.lookahead.type===10&&this.lookahead.head){var y=this.parseTemplateLiteral();m=this.finalize(l,new o.TaggedTemplateExpression(m,y))}else break;return m},h.prototype.parseUpdateExpression=function(){var l,m=this.lookahead;if(this.match("++")||this.match("--")){var f=this.startNode(m),y=this.nextToken();l=this.inheritCoverGrammar(this.parseUnaryExpression),this.context.strict&&l.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(l.name)&&this.tolerateError(a.Messages.StrictLHSPrefix),this.context.isAssignmentTarget||this.tolerateError(a.Messages.InvalidLHSInAssignment);var v=!0;l=this.finalize(f,new o.UpdateExpression(y.value,l,v)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else if(l=this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall),!this.hasLineTerminator&&this.lookahead.type===7&&(this.match("++")||this.match("--"))){this.context.strict&&l.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(l.name)&&this.tolerateError(a.Messages.StrictLHSPostfix),this.context.isAssignmentTarget||this.tolerateError(a.Messages.InvalidLHSInAssignment),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var b=this.nextToken().value,v=!1;l=this.finalize(this.startNode(m),new o.UpdateExpression(b,l,v))}return l},h.prototype.parseAwaitExpression=function(){var l=this.createNode();this.nextToken();var m=this.parseUnaryExpression();return this.finalize(l,new o.AwaitExpression(m))},h.prototype.parseUnaryExpression=function(){var l;if(this.match("+")||this.match("-")||this.match("~")||this.match("!")||this.matchKeyword("delete")||this.matchKeyword("void")||this.matchKeyword("typeof")){var m=this.startNode(this.lookahead),f=this.nextToken();l=this.inheritCoverGrammar(this.parseUnaryExpression),l=this.finalize(m,new o.UnaryExpression(f.value,l)),this.context.strict&&l.operator==="delete"&&l.argument.type===u.Syntax.Identifier&&this.tolerateError(a.Messages.StrictDelete),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}else this.context.await&&this.matchContextualKeyword("await")?l=this.parseAwaitExpression():l=this.parseUpdateExpression();return l},h.prototype.parseExponentiationExpression=function(){var l=this.lookahead,m=this.inheritCoverGrammar(this.parseUnaryExpression);if(m.type!==u.Syntax.UnaryExpression&&this.match("**")){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var f=m,y=this.isolateCoverGrammar(this.parseExponentiationExpression);m=this.finalize(this.startNode(l),new o.BinaryExpression("**",f,y))}return m},h.prototype.binaryPrecedence=function(l){var m=l.value,f;return l.type===7?f=this.operatorPrecedence[m]||0:l.type===4?f=m==="instanceof"||this.context.allowIn&&m==="in"?7:0:f=0,f},h.prototype.parseBinaryExpression=function(){var l=this.lookahead,m=this.inheritCoverGrammar(this.parseExponentiationExpression),f=this.lookahead,y=this.binaryPrecedence(f);if(y>0){this.nextToken(),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;for(var v=[l,this.lookahead],b=m,A=this.isolateCoverGrammar(this.parseExponentiationExpression),x=[b,f.value,A],_=[y];y=this.binaryPrecedence(this.lookahead),!(y<=0);){for(;x.length>2&&y<=_[_.length-1];){A=x.pop();var C=x.pop();_.pop(),b=x.pop(),v.pop();var R=this.startNode(v[v.length-1]);x.push(this.finalize(R,new o.BinaryExpression(C,b,A)))}x.push(this.nextToken().value),_.push(y),v.push(this.lookahead),x.push(this.isolateCoverGrammar(this.parseExponentiationExpression))}var W=x.length-1;m=x[W];for(var Y=v.pop();W>1;){var ve=v.pop(),Me=Y&&Y.lineStart,R=this.startNode(ve,Me),C=x[W-1];m=this.finalize(R,new o.BinaryExpression(C,x[W-2],m)),W-=2,Y=ve}}return m},h.prototype.parseConditionalExpression=function(){var l=this.lookahead,m=this.inheritCoverGrammar(this.parseBinaryExpression);if(this.match("?")){this.nextToken();var f=this.context.allowIn;this.context.allowIn=!0;var y=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowIn=f,this.expect(":");var v=this.isolateCoverGrammar(this.parseAssignmentExpression);m=this.finalize(this.startNode(l),new o.ConditionalExpression(m,y,v)),this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1}return m},h.prototype.checkPatternParam=function(l,m){switch(m.type){case u.Syntax.Identifier:this.validateParam(l,m,m.name);break;case u.Syntax.RestElement:this.checkPatternParam(l,m.argument);break;case u.Syntax.AssignmentPattern:this.checkPatternParam(l,m.left);break;case u.Syntax.ArrayPattern:for(var f=0;f<m.elements.length;f++)m.elements[f]!==null&&this.checkPatternParam(l,m.elements[f]);break;case u.Syntax.ObjectPattern:for(var f=0;f<m.properties.length;f++)this.checkPatternParam(l,m.properties[f].value);break;default:break}l.simple=l.simple&&m instanceof o.Identifier},h.prototype.reinterpretAsCoverFormalsList=function(l){var m=[l],f,y=!1;switch(l.type){case u.Syntax.Identifier:break;case p:m=l.params,y=l.async;break;default:return null}f={simple:!0,paramSet:{}};for(var v=0;v<m.length;++v){var b=m[v];b.type===u.Syntax.AssignmentPattern?b.right.type===u.Syntax.YieldExpression&&(b.right.argument&&this.throwUnexpectedToken(this.lookahead),b.right.type=u.Syntax.Identifier,b.right.name="yield",delete b.right.argument,delete b.right.delegate):y&&b.type===u.Syntax.Identifier&&b.name==="await"&&this.throwUnexpectedToken(this.lookahead),this.checkPatternParam(f,b),m[v]=b}if(this.context.strict||!this.context.allowYield)for(var v=0;v<m.length;++v){var b=m[v];b.type===u.Syntax.YieldExpression&&this.throwUnexpectedToken(this.lookahead)}if(f.message===a.Messages.StrictParamDupe){var A=this.context.strict?f.stricted:f.firstRestricted;this.throwUnexpectedToken(A,f.message)}return{simple:f.simple,params:m,stricted:f.stricted,firstRestricted:f.firstRestricted,message:f.message}},h.prototype.parseAssignmentExpression=function(){var l;if(!this.context.allowYield&&this.matchKeyword("yield"))l=this.parseYieldExpression();else{var m=this.lookahead,f=m;if(l=this.parseConditionalExpression(),f.type===3&&f.lineNumber===this.lookahead.lineNumber&&f.value==="async"&&(this.lookahead.type===3||this.matchKeyword("yield"))){var y=this.parsePrimaryExpression();this.reinterpretExpressionAsPattern(y),l={type:p,params:[y],async:!0}}if(l.type===p||this.match("=>")){this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1;var v=l.async,b=this.reinterpretAsCoverFormalsList(l);if(b){this.hasLineTerminator&&this.tolerateUnexpectedToken(this.lookahead),this.context.firstCoverInitializedNameError=null;var A=this.context.strict,x=this.context.allowStrictDirective;this.context.allowStrictDirective=b.simple;var _=this.context.allowYield,C=this.context.await;this.context.allowYield=!0,this.context.await=v;var R=this.startNode(m);this.expect("=>");var W=void 0;if(this.match("{")){var Y=this.context.allowIn;this.context.allowIn=!0,W=this.parseFunctionSourceElements(),this.context.allowIn=Y}else W=this.isolateCoverGrammar(this.parseAssignmentExpression);var ve=W.type!==u.Syntax.BlockStatement;this.context.strict&&b.firstRestricted&&this.throwUnexpectedToken(b.firstRestricted,b.message),this.context.strict&&b.stricted&&this.tolerateUnexpectedToken(b.stricted,b.message),l=v?this.finalize(R,new o.AsyncArrowFunctionExpression(b.params,W,ve)):this.finalize(R,new o.ArrowFunctionExpression(b.params,W,ve)),this.context.strict=A,this.context.allowStrictDirective=x,this.context.allowYield=_,this.context.await=C}}else if(this.matchAssign()){if(this.context.isAssignmentTarget||this.tolerateError(a.Messages.InvalidLHSInAssignment),this.context.strict&&l.type===u.Syntax.Identifier){var Me=l;this.scanner.isRestrictedWord(Me.name)&&this.tolerateUnexpectedToken(f,a.Messages.StrictLHSAssignment),this.scanner.isStrictModeReservedWord(Me.name)&&this.tolerateUnexpectedToken(f,a.Messages.StrictReservedWord)}this.match("=")?this.reinterpretExpressionAsPattern(l):(this.context.isAssignmentTarget=!1,this.context.isBindingElement=!1),f=this.nextToken();var lr=f.value,$n=this.isolateCoverGrammar(this.parseAssignmentExpression);l=this.finalize(this.startNode(m),new o.AssignmentExpression(lr,l,$n)),this.context.firstCoverInitializedNameError=null}}return l},h.prototype.parseExpression=function(){var l=this.lookahead,m=this.isolateCoverGrammar(this.parseAssignmentExpression);if(this.match(",")){var f=[];for(f.push(m);this.lookahead.type!==2&&this.match(",");)this.nextToken(),f.push(this.isolateCoverGrammar(this.parseAssignmentExpression));m=this.finalize(this.startNode(l),new o.SequenceExpression(f))}return m},h.prototype.parseStatementListItem=function(){var l;if(this.context.isAssignmentTarget=!0,this.context.isBindingElement=!0,this.lookahead.type===4)switch(this.lookahead.value){case"export":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,a.Messages.IllegalExportDeclaration),l=this.parseExportDeclaration();break;case"import":this.context.isModule||this.tolerateUnexpectedToken(this.lookahead,a.Messages.IllegalImportDeclaration),l=this.parseImportDeclaration();break;case"const":l=this.parseLexicalDeclaration({inFor:!1});break;case"function":l=this.parseFunctionDeclaration();break;case"class":l=this.parseClassDeclaration();break;case"let":l=this.isLexicalDeclaration()?this.parseLexicalDeclaration({inFor:!1}):this.parseStatement();break;default:l=this.parseStatement();break}else l=this.parseStatement();return l},h.prototype.parseBlock=function(){var l=this.createNode();this.expect("{");for(var m=[];!this.match("}");)m.push(this.parseStatementListItem());return this.expect("}"),this.finalize(l,new o.BlockStatement(m))},h.prototype.parseLexicalBinding=function(l,m){var f=this.createNode(),y=[],v=this.parsePattern(y,l);this.context.strict&&v.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(v.name)&&this.tolerateError(a.Messages.StrictVarName);var b=null;return l==="const"?!this.matchKeyword("in")&&!this.matchContextualKeyword("of")&&(this.match("=")?(this.nextToken(),b=this.isolateCoverGrammar(this.parseAssignmentExpression)):this.throwError(a.Messages.DeclarationMissingInitializer,"const")):(!m.inFor&&v.type!==u.Syntax.Identifier||this.match("="))&&(this.expect("="),b=this.isolateCoverGrammar(this.parseAssignmentExpression)),this.finalize(f,new o.VariableDeclarator(v,b))},h.prototype.parseBindingList=function(l,m){for(var f=[this.parseLexicalBinding(l,m)];this.match(",");)this.nextToken(),f.push(this.parseLexicalBinding(l,m));return f},h.prototype.isLexicalDeclaration=function(){var l=this.scanner.saveState();this.scanner.scanComments();var m=this.scanner.lex();return this.scanner.restoreState(l),m.type===3||m.type===7&&m.value==="["||m.type===7&&m.value==="{"||m.type===4&&m.value==="let"||m.type===4&&m.value==="yield"},h.prototype.parseLexicalDeclaration=function(l){var m=this.createNode(),f=this.nextToken().value;i.assert(f==="let"||f==="const","Lexical declaration must be either let or const");var y=this.parseBindingList(f,l);return this.consumeSemicolon(),this.finalize(m,new o.VariableDeclaration(y,f))},h.prototype.parseBindingRestElement=function(l,m){var f=this.createNode();this.expect("...");var y=this.parsePattern(l,m);return this.finalize(f,new o.RestElement(y))},h.prototype.parseArrayPattern=function(l,m){var f=this.createNode();this.expect("[");for(var y=[];!this.match("]");)if(this.match(","))this.nextToken(),y.push(null);else{if(this.match("...")){y.push(this.parseBindingRestElement(l,m));break}else y.push(this.parsePatternWithDefault(l,m));this.match("]")||this.expect(",")}return this.expect("]"),this.finalize(f,new o.ArrayPattern(y))},h.prototype.parsePropertyPattern=function(l,m){var f=this.createNode(),y=!1,v=!1,b=!1,A,x;if(this.lookahead.type===3){var _=this.lookahead;A=this.parseVariableIdentifier();var C=this.finalize(f,new o.Identifier(_.value));if(this.match("=")){l.push(_),v=!0,this.nextToken();var R=this.parseAssignmentExpression();x=this.finalize(this.startNode(_),new o.AssignmentPattern(C,R))}else this.match(":")?(this.expect(":"),x=this.parsePatternWithDefault(l,m)):(l.push(_),v=!0,x=C)}else y=this.match("["),A=this.parseObjectPropertyKey(),this.expect(":"),x=this.parsePatternWithDefault(l,m);return this.finalize(f,new o.Property("init",A,y,x,b,v))},h.prototype.parseObjectPattern=function(l,m){var f=this.createNode(),y=[];for(this.expect("{");!this.match("}");)y.push(this.parsePropertyPattern(l,m)),this.match("}")||this.expect(",");return this.expect("}"),this.finalize(f,new o.ObjectPattern(y))},h.prototype.parsePattern=function(l,m){var f;return this.match("[")?f=this.parseArrayPattern(l,m):this.match("{")?f=this.parseObjectPattern(l,m):(this.matchKeyword("let")&&(m==="const"||m==="let")&&this.tolerateUnexpectedToken(this.lookahead,a.Messages.LetInLexicalBinding),l.push(this.lookahead),f=this.parseVariableIdentifier(m)),f},h.prototype.parsePatternWithDefault=function(l,m){var f=this.lookahead,y=this.parsePattern(l,m);if(this.match("=")){this.nextToken();var v=this.context.allowYield;this.context.allowYield=!0;var b=this.isolateCoverGrammar(this.parseAssignmentExpression);this.context.allowYield=v,y=this.finalize(this.startNode(f),new o.AssignmentPattern(y,b))}return y},h.prototype.parseVariableIdentifier=function(l){var m=this.createNode(),f=this.nextToken();return f.type===4&&f.value==="yield"?this.context.strict?this.tolerateUnexpectedToken(f,a.Messages.StrictReservedWord):this.context.allowYield||this.throwUnexpectedToken(f):f.type!==3?this.context.strict&&f.type===4&&this.scanner.isStrictModeReservedWord(f.value)?this.tolerateUnexpectedToken(f,a.Messages.StrictReservedWord):(this.context.strict||f.value!=="let"||l!=="var")&&this.throwUnexpectedToken(f):(this.context.isModule||this.context.await)&&f.type===3&&f.value==="await"&&this.tolerateUnexpectedToken(f),this.finalize(m,new o.Identifier(f.value))},h.prototype.parseVariableDeclaration=function(l){var m=this.createNode(),f=[],y=this.parsePattern(f,"var");this.context.strict&&y.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(y.name)&&this.tolerateError(a.Messages.StrictVarName);var v=null;return this.match("=")?(this.nextToken(),v=this.isolateCoverGrammar(this.parseAssignmentExpression)):y.type!==u.Syntax.Identifier&&!l.inFor&&this.expect("="),this.finalize(m,new o.VariableDeclarator(y,v))},h.prototype.parseVariableDeclarationList=function(l){var m={inFor:l.inFor},f=[];for(f.push(this.parseVariableDeclaration(m));this.match(",");)this.nextToken(),f.push(this.parseVariableDeclaration(m));return f},h.prototype.parseVariableStatement=function(){var l=this.createNode();this.expectKeyword("var");var m=this.parseVariableDeclarationList({inFor:!1});return this.consumeSemicolon(),this.finalize(l,new o.VariableDeclaration(m,"var"))},h.prototype.parseEmptyStatement=function(){var l=this.createNode();return this.expect(";"),this.finalize(l,new o.EmptyStatement)},h.prototype.parseExpressionStatement=function(){var l=this.createNode(),m=this.parseExpression();return this.consumeSemicolon(),this.finalize(l,new o.ExpressionStatement(m))},h.prototype.parseIfClause=function(){return this.context.strict&&this.matchKeyword("function")&&this.tolerateError(a.Messages.StrictFunction),this.parseStatement()},h.prototype.parseIfStatement=function(){var l=this.createNode(),m,f=null;this.expectKeyword("if"),this.expect("(");var y=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),m=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),m=this.parseIfClause(),this.matchKeyword("else")&&(this.nextToken(),f=this.parseIfClause())),this.finalize(l,new o.IfStatement(y,m,f))},h.prototype.parseDoWhileStatement=function(){var l=this.createNode();this.expectKeyword("do");var m=this.context.inIteration;this.context.inIteration=!0;var f=this.parseStatement();this.context.inIteration=m,this.expectKeyword("while"),this.expect("(");var y=this.parseExpression();return!this.match(")")&&this.config.tolerant?this.tolerateUnexpectedToken(this.nextToken()):(this.expect(")"),this.match(";")&&this.nextToken()),this.finalize(l,new o.DoWhileStatement(f,y))},h.prototype.parseWhileStatement=function(){var l=this.createNode(),m;this.expectKeyword("while"),this.expect("(");var f=this.parseExpression();if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),m=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var y=this.context.inIteration;this.context.inIteration=!0,m=this.parseStatement(),this.context.inIteration=y}return this.finalize(l,new o.WhileStatement(f,m))},h.prototype.parseForStatement=function(){var l=null,m=null,f=null,y=!0,v,b,A=this.createNode();if(this.expectKeyword("for"),this.expect("("),this.match(";"))this.nextToken();else if(this.matchKeyword("var")){l=this.createNode(),this.nextToken();var x=this.context.allowIn;this.context.allowIn=!1;var _=this.parseVariableDeclarationList({inFor:!0});if(this.context.allowIn=x,_.length===1&&this.matchKeyword("in")){var C=_[0];C.init&&(C.id.type===u.Syntax.ArrayPattern||C.id.type===u.Syntax.ObjectPattern||this.context.strict)&&this.tolerateError(a.Messages.ForInOfLoopInitializer,"for-in"),l=this.finalize(l,new o.VariableDeclaration(_,"var")),this.nextToken(),v=l,b=this.parseExpression(),l=null}else _.length===1&&_[0].init===null&&this.matchContextualKeyword("of")?(l=this.finalize(l,new o.VariableDeclaration(_,"var")),this.nextToken(),v=l,b=this.parseAssignmentExpression(),l=null,y=!1):(l=this.finalize(l,new o.VariableDeclaration(_,"var")),this.expect(";"))}else if(this.matchKeyword("const")||this.matchKeyword("let")){l=this.createNode();var R=this.nextToken().value;if(!this.context.strict&&this.lookahead.value==="in")l=this.finalize(l,new o.Identifier(R)),this.nextToken(),v=l,b=this.parseExpression(),l=null;else{var x=this.context.allowIn;this.context.allowIn=!1;var _=this.parseBindingList(R,{inFor:!0});this.context.allowIn=x,_.length===1&&_[0].init===null&&this.matchKeyword("in")?(l=this.finalize(l,new o.VariableDeclaration(_,R)),this.nextToken(),v=l,b=this.parseExpression(),l=null):_.length===1&&_[0].init===null&&this.matchContextualKeyword("of")?(l=this.finalize(l,new o.VariableDeclaration(_,R)),this.nextToken(),v=l,b=this.parseAssignmentExpression(),l=null,y=!1):(this.consumeSemicolon(),l=this.finalize(l,new o.VariableDeclaration(_,R)))}}else{var W=this.lookahead,x=this.context.allowIn;if(this.context.allowIn=!1,l=this.inheritCoverGrammar(this.parseAssignmentExpression),this.context.allowIn=x,this.matchKeyword("in"))(!this.context.isAssignmentTarget||l.type===u.Syntax.AssignmentExpression)&&this.tolerateError(a.Messages.InvalidLHSInForIn),this.nextToken(),this.reinterpretExpressionAsPattern(l),v=l,b=this.parseExpression(),l=null;else if(this.matchContextualKeyword("of"))(!this.context.isAssignmentTarget||l.type===u.Syntax.AssignmentExpression)&&this.tolerateError(a.Messages.InvalidLHSInForLoop),this.nextToken(),this.reinterpretExpressionAsPattern(l),v=l,b=this.parseAssignmentExpression(),l=null,y=!1;else{if(this.match(",")){for(var Y=[l];this.match(",");)this.nextToken(),Y.push(this.isolateCoverGrammar(this.parseAssignmentExpression));l=this.finalize(this.startNode(W),new o.SequenceExpression(Y))}this.expect(";")}}typeof v>"u"&&(this.match(";")||(m=this.parseExpression()),this.expect(";"),this.match(")")||(f=this.parseExpression()));var ve;if(!this.match(")")&&this.config.tolerant)this.tolerateUnexpectedToken(this.nextToken()),ve=this.finalize(this.createNode(),new o.EmptyStatement);else{this.expect(")");var Me=this.context.inIteration;this.context.inIteration=!0,ve=this.isolateCoverGrammar(this.parseStatement),this.context.inIteration=Me}return typeof v>"u"?this.finalize(A,new o.ForStatement(l,m,f,ve)):y?this.finalize(A,new o.ForInStatement(v,b,ve)):this.finalize(A,new o.ForOfStatement(v,b,ve))},h.prototype.parseContinueStatement=function(){var l=this.createNode();this.expectKeyword("continue");var m=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var f=this.parseVariableIdentifier();m=f;var y="$"+f.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,y)||this.throwError(a.Messages.UnknownLabel,f.name)}return this.consumeSemicolon(),m===null&&!this.context.inIteration&&this.throwError(a.Messages.IllegalContinue),this.finalize(l,new o.ContinueStatement(m))},h.prototype.parseBreakStatement=function(){var l=this.createNode();this.expectKeyword("break");var m=null;if(this.lookahead.type===3&&!this.hasLineTerminator){var f=this.parseVariableIdentifier(),y="$"+f.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,y)||this.throwError(a.Messages.UnknownLabel,f.name),m=f}return this.consumeSemicolon(),m===null&&!this.context.inIteration&&!this.context.inSwitch&&this.throwError(a.Messages.IllegalBreak),this.finalize(l,new o.BreakStatement(m))},h.prototype.parseReturnStatement=function(){this.context.inFunctionBody||this.tolerateError(a.Messages.IllegalReturn);var l=this.createNode();this.expectKeyword("return");var m=!this.match(";")&&!this.match("}")&&!this.hasLineTerminator&&this.lookahead.type!==2||this.lookahead.type===8||this.lookahead.type===10,f=m?this.parseExpression():null;return this.consumeSemicolon(),this.finalize(l,new o.ReturnStatement(f))},h.prototype.parseWithStatement=function(){this.context.strict&&this.tolerateError(a.Messages.StrictModeWith);var l=this.createNode(),m;this.expectKeyword("with"),this.expect("(");var f=this.parseExpression();return!this.match(")")&&this.config.tolerant?(this.tolerateUnexpectedToken(this.nextToken()),m=this.finalize(this.createNode(),new o.EmptyStatement)):(this.expect(")"),m=this.parseStatement()),this.finalize(l,new o.WithStatement(f,m))},h.prototype.parseSwitchCase=function(){var l=this.createNode(),m;this.matchKeyword("default")?(this.nextToken(),m=null):(this.expectKeyword("case"),m=this.parseExpression()),this.expect(":");for(var f=[];!(this.match("}")||this.matchKeyword("default")||this.matchKeyword("case"));)f.push(this.parseStatementListItem());return this.finalize(l,new o.SwitchCase(m,f))},h.prototype.parseSwitchStatement=function(){var l=this.createNode();this.expectKeyword("switch"),this.expect("(");var m=this.parseExpression();this.expect(")");var f=this.context.inSwitch;this.context.inSwitch=!0;var y=[],v=!1;for(this.expect("{");!this.match("}");){var b=this.parseSwitchCase();b.test===null&&(v&&this.throwError(a.Messages.MultipleDefaultsInSwitch),v=!0),y.push(b)}return this.expect("}"),this.context.inSwitch=f,this.finalize(l,new o.SwitchStatement(m,y))},h.prototype.parseLabelledStatement=function(){var l=this.createNode(),m=this.parseExpression(),f;if(m.type===u.Syntax.Identifier&&this.match(":")){this.nextToken();var y=m,v="$"+y.name;Object.prototype.hasOwnProperty.call(this.context.labelSet,v)&&this.throwError(a.Messages.Redeclaration,"Label",y.name),this.context.labelSet[v]=!0;var b=void 0;if(this.matchKeyword("class"))this.tolerateUnexpectedToken(this.lookahead),b=this.parseClassDeclaration();else if(this.matchKeyword("function")){var A=this.lookahead,x=this.parseFunctionDeclaration();this.context.strict?this.tolerateUnexpectedToken(A,a.Messages.StrictFunction):x.generator&&this.tolerateUnexpectedToken(A,a.Messages.GeneratorInLegacyContext),b=x}else b=this.parseStatement();delete this.context.labelSet[v],f=new o.LabeledStatement(y,b)}else this.consumeSemicolon(),f=new o.ExpressionStatement(m);return this.finalize(l,f)},h.prototype.parseThrowStatement=function(){var l=this.createNode();this.expectKeyword("throw"),this.hasLineTerminator&&this.throwError(a.Messages.NewlineAfterThrow);var m=this.parseExpression();return this.consumeSemicolon(),this.finalize(l,new o.ThrowStatement(m))},h.prototype.parseCatchClause=function(){var l=this.createNode();this.expectKeyword("catch"),this.expect("("),this.match(")")&&this.throwUnexpectedToken(this.lookahead);for(var m=[],f=this.parsePattern(m),y={},v=0;v<m.length;v++){var b="$"+m[v].value;Object.prototype.hasOwnProperty.call(y,b)&&this.tolerateError(a.Messages.DuplicateBinding,m[v].value),y[b]=!0}this.context.strict&&f.type===u.Syntax.Identifier&&this.scanner.isRestrictedWord(f.name)&&this.tolerateError(a.Messages.StrictCatchVariable),this.expect(")");var A=this.parseBlock();return this.finalize(l,new o.CatchClause(f,A))},h.prototype.parseFinallyClause=function(){return this.expectKeyword("finally"),this.parseBlock()},h.prototype.parseTryStatement=function(){var l=this.createNode();this.expectKeyword("try");var m=this.parseBlock(),f=this.matchKeyword("catch")?this.parseCatchClause():null,y=this.matchKeyword("finally")?this.parseFinallyClause():null;return!f&&!y&&this.throwError(a.Messages.NoCatchOrFinally),this.finalize(l,new o.TryStatement(m,f,y))},h.prototype.parseDebuggerStatement=function(){var l=this.createNode();return this.expectKeyword("debugger"),this.consumeSemicolon(),this.finalize(l,new o.DebuggerStatement)},h.prototype.parseStatement=function(){var l;switch(this.lookahead.type){case 1:case 5:case 6:case 8:case 10:case 9:l=this.parseExpressionStatement();break;case 7:var m=this.lookahead.value;m==="{"?l=this.parseBlock():m==="("?l=this.parseExpressionStatement():m===";"?l=this.parseEmptyStatement():l=this.parseExpressionStatement();break;case 3:l=this.matchAsyncFunction()?this.parseFunctionDeclaration():this.parseLabelledStatement();break;case 4:switch(this.lookahead.value){case"break":l=this.parseBreakStatement();break;case"continue":l=this.parseContinueStatement();break;case"debugger":l=this.parseDebuggerStatement();break;case"do":l=this.parseDoWhileStatement();break;case"for":l=this.parseForStatement();break;case"function":l=this.parseFunctionDeclaration();break;case"if":l=this.parseIfStatement();break;case"return":l=this.parseReturnStatement();break;case"switch":l=this.parseSwitchStatement();break;case"throw":l=this.parseThrowStatement();break;case"try":l=this.parseTryStatement();break;case"var":l=this.parseVariableStatement();break;case"while":l=this.parseWhileStatement();break;case"with":l=this.parseWithStatement();break;default:l=this.parseExpressionStatement();break}break;default:l=this.throwUnexpectedToken(this.lookahead)}return l},h.prototype.parseFunctionSourceElements=function(){var l=this.createNode();this.expect("{");var m=this.parseDirectivePrologues(),f=this.context.labelSet,y=this.context.inIteration,v=this.context.inSwitch,b=this.context.inFunctionBody;for(this.context.labelSet={},this.context.inIteration=!1,this.context.inSwitch=!1,this.context.inFunctionBody=!0;this.lookahead.type!==2&&!this.match("}");)m.push(this.parseStatementListItem());return this.expect("}"),this.context.labelSet=f,this.context.inIteration=y,this.context.inSwitch=v,this.context.inFunctionBody=b,this.finalize(l,new o.BlockStatement(m))},h.prototype.validateParam=function(l,m,f){var y="$"+f;this.context.strict?(this.scanner.isRestrictedWord(f)&&(l.stricted=m,l.message=a.Messages.StrictParamName),Object.prototype.hasOwnProperty.call(l.paramSet,y)&&(l.stricted=m,l.message=a.Messages.StrictParamDupe)):l.firstRestricted||(this.scanner.isRestrictedWord(f)?(l.firstRestricted=m,l.message=a.Messages.StrictParamName):this.scanner.isStrictModeReservedWord(f)?(l.firstRestricted=m,l.message=a.Messages.StrictReservedWord):Object.prototype.hasOwnProperty.call(l.paramSet,y)&&(l.stricted=m,l.message=a.Messages.StrictParamDupe)),typeof Object.defineProperty=="function"?Object.defineProperty(l.paramSet,y,{value:!0,enumerable:!0,writable:!0,configurable:!0}):l.paramSet[y]=!0},h.prototype.parseRestElement=function(l){var m=this.createNode();this.expect("...");var f=this.parsePattern(l);return this.match("=")&&this.throwError(a.Messages.DefaultRestParameter),this.match(")")||this.throwError(a.Messages.ParameterAfterRestParameter),this.finalize(m,new o.RestElement(f))},h.prototype.parseFormalParameter=function(l){for(var m=[],f=this.match("...")?this.parseRestElement(m):this.parsePatternWithDefault(m),y=0;y<m.length;y++)this.validateParam(l,m[y],m[y].value);l.simple=l.simple&&f instanceof o.Identifier,l.params.push(f)},h.prototype.parseFormalParameters=function(l){var m;if(m={simple:!0,params:[],firstRestricted:l},this.expect("("),!this.match(")"))for(m.paramSet={};this.lookahead.type!==2&&(this.parseFormalParameter(m),!(this.match(")")||(this.expect(","),this.match(")")))););return this.expect(")"),{simple:m.simple,params:m.params,stricted:m.stricted,firstRestricted:m.firstRestricted,message:m.message}},h.prototype.matchAsyncFunction=function(){var l=this.matchContextualKeyword("async");if(l){var m=this.scanner.saveState();this.scanner.scanComments();var f=this.scanner.lex();this.scanner.restoreState(m),l=m.lineNumber===f.lineNumber&&f.type===4&&f.value==="function"}return l},h.prototype.parseFunctionDeclaration=function(l){var m=this.createNode(),f=this.matchContextualKeyword("async");f&&this.nextToken(),this.expectKeyword("function");var y=f?!1:this.match("*");y&&this.nextToken();var v,b=null,A=null;if(!l||!this.match("(")){var x=this.lookahead;b=this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(x.value)&&this.tolerateUnexpectedToken(x,a.Messages.StrictFunctionName):this.scanner.isRestrictedWord(x.value)?(A=x,v=a.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(x.value)&&(A=x,v=a.Messages.StrictReservedWord)}var _=this.context.await,C=this.context.allowYield;this.context.await=f,this.context.allowYield=!y;var R=this.parseFormalParameters(A),W=R.params,Y=R.stricted;A=R.firstRestricted,R.message&&(v=R.message);var ve=this.context.strict,Me=this.context.allowStrictDirective;this.context.allowStrictDirective=R.simple;var lr=this.parseFunctionSourceElements();return this.context.strict&&A&&this.throwUnexpectedToken(A,v),this.context.strict&&Y&&this.tolerateUnexpectedToken(Y,v),this.context.strict=ve,this.context.allowStrictDirective=Me,this.context.await=_,this.context.allowYield=C,f?this.finalize(m,new o.AsyncFunctionDeclaration(b,W,lr)):this.finalize(m,new o.FunctionDeclaration(b,W,lr,y))},h.prototype.parseFunctionExpression=function(){var l=this.createNode(),m=this.matchContextualKeyword("async");m&&this.nextToken(),this.expectKeyword("function");var f=m?!1:this.match("*");f&&this.nextToken();var y,v=null,b,A=this.context.await,x=this.context.allowYield;if(this.context.await=m,this.context.allowYield=!f,!this.match("(")){var _=this.lookahead;v=!this.context.strict&&!f&&this.matchKeyword("yield")?this.parseIdentifierName():this.parseVariableIdentifier(),this.context.strict?this.scanner.isRestrictedWord(_.value)&&this.tolerateUnexpectedToken(_,a.Messages.StrictFunctionName):this.scanner.isRestrictedWord(_.value)?(b=_,y=a.Messages.StrictFunctionName):this.scanner.isStrictModeReservedWord(_.value)&&(b=_,y=a.Messages.StrictReservedWord)}var C=this.parseFormalParameters(b),R=C.params,W=C.stricted;b=C.firstRestricted,C.message&&(y=C.message);var Y=this.context.strict,ve=this.context.allowStrictDirective;this.context.allowStrictDirective=C.simple;var Me=this.parseFunctionSourceElements();return this.context.strict&&b&&this.throwUnexpectedToken(b,y),this.context.strict&&W&&this.tolerateUnexpectedToken(W,y),this.context.strict=Y,this.context.allowStrictDirective=ve,this.context.await=A,this.context.allowYield=x,m?this.finalize(l,new o.AsyncFunctionExpression(v,R,Me)):this.finalize(l,new o.FunctionExpression(v,R,Me,f))},h.prototype.parseDirective=function(){var l=this.lookahead,m=this.createNode(),f=this.parseExpression(),y=f.type===u.Syntax.Literal?this.getTokenRaw(l).slice(1,-1):null;return this.consumeSemicolon(),this.finalize(m,y?new o.Directive(f,y):new o.ExpressionStatement(f))},h.prototype.parseDirectivePrologues=function(){for(var l=null,m=[];;){var f=this.lookahead;if(f.type!==8)break;var y=this.parseDirective();m.push(y);var v=y.directive;if(typeof v!="string")break;v==="use strict"?(this.context.strict=!0,l&&this.tolerateUnexpectedToken(l,a.Messages.StrictOctalLiteral),this.context.allowStrictDirective||this.tolerateUnexpectedToken(f,a.Messages.IllegalLanguageModeDirective)):!l&&f.octal&&(l=f)}return m},h.prototype.qualifiedPropertyName=function(l){switch(l.type){case 3:case 8:case 1:case 5:case 6:case 4:return!0;case 7:return l.value==="[";default:break}return!1},h.prototype.parseGetterMethod=function(){var l=this.createNode(),m=!1,f=this.context.allowYield;this.context.allowYield=!m;var y=this.parseFormalParameters();y.params.length>0&&this.tolerateError(a.Messages.BadGetterArity);var v=this.parsePropertyMethod(y);return this.context.allowYield=f,this.finalize(l,new o.FunctionExpression(null,y.params,v,m))},h.prototype.parseSetterMethod=function(){var l=this.createNode(),m=!1,f=this.context.allowYield;this.context.allowYield=!m;var y=this.parseFormalParameters();y.params.length!==1?this.tolerateError(a.Messages.BadSetterArity):y.params[0]instanceof o.RestElement&&this.tolerateError(a.Messages.BadSetterRestParameter);var v=this.parsePropertyMethod(y);return this.context.allowYield=f,this.finalize(l,new o.FunctionExpression(null,y.params,v,m))},h.prototype.parseGeneratorMethod=function(){var l=this.createNode(),m=!0,f=this.context.allowYield;this.context.allowYield=!0;var y=this.parseFormalParameters();this.context.allowYield=!1;var v=this.parsePropertyMethod(y);return this.context.allowYield=f,this.finalize(l,new o.FunctionExpression(null,y.params,v,m))},h.prototype.isStartOfExpression=function(){var l=!0,m=this.lookahead.value;switch(this.lookahead.type){case 7:l=m==="["||m==="("||m==="{"||m==="+"||m==="-"||m==="!"||m==="~"||m==="++"||m==="--"||m==="/"||m==="/=";break;case 4:l=m==="class"||m==="delete"||m==="function"||m==="let"||m==="new"||m==="super"||m==="this"||m==="typeof"||m==="void"||m==="yield";break;default:break}return l},h.prototype.parseYieldExpression=function(){var l=this.createNode();this.expectKeyword("yield");var m=null,f=!1;if(!this.hasLineTerminator){var y=this.context.allowYield;this.context.allowYield=!1,f=this.match("*"),f?(this.nextToken(),m=this.parseAssignmentExpression()):this.isStartOfExpression()&&(m=this.parseAssignmentExpression()),this.context.allowYield=y}return this.finalize(l,new o.YieldExpression(m,f))},h.prototype.parseClassElement=function(l){var m=this.lookahead,f=this.createNode(),y="",v=null,b=null,A=!1,x=!1,_=!1,C=!1;if(this.match("*"))this.nextToken();else{A=this.match("["),v=this.parseObjectPropertyKey();var R=v;if(R.name==="static"&&(this.qualifiedPropertyName(this.lookahead)||this.match("*"))&&(m=this.lookahead,_=!0,A=this.match("["),this.match("*")?this.nextToken():v=this.parseObjectPropertyKey()),m.type===3&&!this.hasLineTerminator&&m.value==="async"){var W=this.lookahead.value;W!==":"&&W!=="("&&W!=="*"&&(C=!0,m=this.lookahead,v=this.parseObjectPropertyKey(),m.type===3&&m.value==="constructor"&&this.tolerateUnexpectedToken(m,a.Messages.ConstructorIsAsync))}}var Y=this.qualifiedPropertyName(this.lookahead);return m.type===3?m.value==="get"&&Y?(y="get",A=this.match("["),v=this.parseObjectPropertyKey(),this.context.allowYield=!1,b=this.parseGetterMethod()):m.value==="set"&&Y&&(y="set",A=this.match("["),v=this.parseObjectPropertyKey(),b=this.parseSetterMethod()):m.type===7&&m.value==="*"&&Y&&(y="init",A=this.match("["),v=this.parseObjectPropertyKey(),b=this.parseGeneratorMethod(),x=!0),!y&&v&&this.match("(")&&(y="init",b=C?this.parsePropertyMethodAsyncFunction():this.parsePropertyMethodFunction(),x=!0),y||this.throwUnexpectedToken(this.lookahead),y==="init"&&(y="method"),A||(_&&this.isPropertyKey(v,"prototype")&&this.throwUnexpectedToken(m,a.Messages.StaticPrototype),!_&&this.isPropertyKey(v,"constructor")&&((y!=="method"||!x||b&&b.generator)&&this.throwUnexpectedToken(m,a.Messages.ConstructorSpecialMethod),l.value?this.throwUnexpectedToken(m,a.Messages.DuplicateConstructor):l.value=!0,y="constructor")),this.finalize(f,new o.MethodDefinition(v,A,b,y,_))},h.prototype.parseClassElementList=function(){var l=[],m={value:!1};for(this.expect("{");!this.match("}");)this.match(";")?this.nextToken():l.push(this.parseClassElement(m));return this.expect("}"),l},h.prototype.parseClassBody=function(){var l=this.createNode(),m=this.parseClassElementList();return this.finalize(l,new o.ClassBody(m))},h.prototype.parseClassDeclaration=function(l){var m=this.createNode(),f=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var y=l&&this.lookahead.type!==3?null:this.parseVariableIdentifier(),v=null;this.matchKeyword("extends")&&(this.nextToken(),v=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var b=this.parseClassBody();return this.context.strict=f,this.finalize(m,new o.ClassDeclaration(y,v,b))},h.prototype.parseClassExpression=function(){var l=this.createNode(),m=this.context.strict;this.context.strict=!0,this.expectKeyword("class");var f=this.lookahead.type===3?this.parseVariableIdentifier():null,y=null;this.matchKeyword("extends")&&(this.nextToken(),y=this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall));var v=this.parseClassBody();return this.context.strict=m,this.finalize(l,new o.ClassExpression(f,y,v))},h.prototype.parseModule=function(){this.context.strict=!0,this.context.isModule=!0,this.scanner.isModule=!0;for(var l=this.createNode(),m=this.parseDirectivePrologues();this.lookahead.type!==2;)m.push(this.parseStatementListItem());return this.finalize(l,new o.Module(m))},h.prototype.parseScript=function(){for(var l=this.createNode(),m=this.parseDirectivePrologues();this.lookahead.type!==2;)m.push(this.parseStatementListItem());return this.finalize(l,new o.Script(m))},h.prototype.parseModuleSpecifier=function(){var l=this.createNode();this.lookahead.type!==8&&this.throwError(a.Messages.InvalidModuleSpecifier);var m=this.nextToken(),f=this.getTokenRaw(m);return this.finalize(l,new o.Literal(m.value,f))},h.prototype.parseImportSpecifier=function(){var l=this.createNode(),m,f;return this.lookahead.type===3?(m=this.parseVariableIdentifier(),f=m,this.matchContextualKeyword("as")&&(this.nextToken(),f=this.parseVariableIdentifier())):(m=this.parseIdentifierName(),f=m,this.matchContextualKeyword("as")?(this.nextToken(),f=this.parseVariableIdentifier()):this.throwUnexpectedToken(this.nextToken())),this.finalize(l,new o.ImportSpecifier(f,m))},h.prototype.parseNamedImports=function(){this.expect("{");for(var l=[];!this.match("}");)l.push(this.parseImportSpecifier()),this.match("}")||this.expect(",");return this.expect("}"),l},h.prototype.parseImportDefaultSpecifier=function(){var l=this.createNode(),m=this.parseIdentifierName();return this.finalize(l,new o.ImportDefaultSpecifier(m))},h.prototype.parseImportNamespaceSpecifier=function(){var l=this.createNode();this.expect("*"),this.matchContextualKeyword("as")||this.throwError(a.Messages.NoAsAfterImportNamespace),this.nextToken();var m=this.parseIdentifierName();return this.finalize(l,new o.ImportNamespaceSpecifier(m))},h.prototype.parseImportDeclaration=function(){this.context.inFunctionBody&&this.throwError(a.Messages.IllegalImportDeclaration);var l=this.createNode();this.expectKeyword("import");var m,f=[];if(this.lookahead.type===8)m=this.parseModuleSpecifier();else{if(this.match("{")?f=f.concat(this.parseNamedImports()):this.match("*")?f.push(this.parseImportNamespaceSpecifier()):this.isIdentifierName(this.lookahead)&&!this.matchKeyword("default")?(f.push(this.parseImportDefaultSpecifier()),this.match(",")&&(this.nextToken(),this.match("*")?f.push(this.parseImportNamespaceSpecifier()):this.match("{")?f=f.concat(this.parseNamedImports()):this.throwUnexpectedToken(this.lookahead))):this.throwUnexpectedToken(this.nextToken()),!this.matchContextualKeyword("from")){var y=this.lookahead.value?a.Messages.UnexpectedToken:a.Messages.MissingFromClause;this.throwError(y,this.lookahead.value)}this.nextToken(),m=this.parseModuleSpecifier()}return this.consumeSemicolon(),this.finalize(l,new o.ImportDeclaration(f,m))},h.prototype.parseExportSpecifier=function(){var l=this.createNode(),m=this.parseIdentifierName(),f=m;return this.matchContextualKeyword("as")&&(this.nextToken(),f=this.parseIdentifierName()),this.finalize(l,new o.ExportSpecifier(m,f))},h.prototype.parseExportDeclaration=function(){this.context.inFunctionBody&&this.throwError(a.Messages.IllegalExportDeclaration);var l=this.createNode();this.expectKeyword("export");var m;if(this.matchKeyword("default"))if(this.nextToken(),this.matchKeyword("function")){var f=this.parseFunctionDeclaration(!0);m=this.finalize(l,new o.ExportDefaultDeclaration(f))}else if(this.matchKeyword("class")){var f=this.parseClassDeclaration(!0);m=this.finalize(l,new o.ExportDefaultDeclaration(f))}else if(this.matchContextualKeyword("async")){var f=this.matchAsyncFunction()?this.parseFunctionDeclaration(!0):this.parseAssignmentExpression();m=this.finalize(l,new o.ExportDefaultDeclaration(f))}else{this.matchContextualKeyword("from")&&this.throwError(a.Messages.UnexpectedToken,this.lookahead.value);var f=this.match("{")?this.parseObjectInitializer():this.match("[")?this.parseArrayInitializer():this.parseAssignmentExpression();this.consumeSemicolon(),m=this.finalize(l,new o.ExportDefaultDeclaration(f))}else if(this.match("*")){if(this.nextToken(),!this.matchContextualKeyword("from")){var y=this.lookahead.value?a.Messages.UnexpectedToken:a.Messages.MissingFromClause;this.throwError(y,this.lookahead.value)}this.nextToken();var v=this.parseModuleSpecifier();this.consumeSemicolon(),m=this.finalize(l,new o.ExportAllDeclaration(v))}else if(this.lookahead.type===4){var f=void 0;switch(this.lookahead.value){case"let":case"const":f=this.parseLexicalDeclaration({inFor:!1});break;case"var":case"class":case"function":f=this.parseStatementListItem();break;default:this.throwUnexpectedToken(this.lookahead)}m=this.finalize(l,new o.ExportNamedDeclaration(f,[],null))}else if(this.matchAsyncFunction()){var f=this.parseFunctionDeclaration();m=this.finalize(l,new o.ExportNamedDeclaration(f,[],null))}else{var b=[],A=null,x=!1;for(this.expect("{");!this.match("}");)x=x||this.matchKeyword("default"),b.push(this.parseExportSpecifier()),this.match("}")||this.expect(",");if(this.expect("}"),this.matchContextualKeyword("from"))this.nextToken(),A=this.parseModuleSpecifier(),this.consumeSemicolon();else if(x){var y=this.lookahead.value?a.Messages.UnexpectedToken:a.Messages.MissingFromClause;this.throwError(y,this.lookahead.value)}else this.consumeSemicolon();m=this.finalize(l,new o.ExportNamedDeclaration(null,b,A))}return m},h})();t.Parser=g},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});function r(i,n){if(!i)throw new Error("ASSERT: "+n)}t.assert=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(function(){function i(){this.errors=[],this.tolerant=!1}return i.prototype.recordError=function(n){this.errors.push(n)},i.prototype.tolerate=function(n){if(this.tolerant)this.recordError(n);else throw n},i.prototype.constructError=function(n,a){var o=new Error(n);try{throw o}catch(s){Object.create&&Object.defineProperty&&(o=Object.create(s),Object.defineProperty(o,"column",{value:a}))}return o},i.prototype.createError=function(n,a,o,s){var u="Line "+a+": "+s,d=this.constructError(u,o);return d.index=n,d.lineNumber=a,d.description=s,d},i.prototype.throwError=function(n,a,o,s){throw this.createError(n,a,o,s)},i.prototype.tolerateError=function(n,a,o,s){var u=this.createError(n,a,o,s);if(this.tolerant)this.recordError(u);else throw u},i})();t.ErrorHandler=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Messages={BadGetterArity:"Getter must not have any formal parameters",BadSetterArity:"Setter must have exactly one formal parameter",BadSetterRestParameter:"Setter function argument must not be a rest parameter",ConstructorIsAsync:"Class constructor may not be an async method",ConstructorSpecialMethod:"Class constructor may not be an accessor",DeclarationMissingInitializer:"Missing initializer in %0 declaration",DefaultRestParameter:"Unexpected token =",DuplicateBinding:"Duplicate binding %0",DuplicateConstructor:"A class may only have one constructor",DuplicateProtoProperty:"Duplicate __proto__ fields are not allowed in object literals",ForInOfLoopInitializer:"%0 loop variable declaration may not have an initializer",GeneratorInLegacyContext:"Generator declarations are not allowed in legacy contexts",IllegalBreak:"Illegal break statement",IllegalContinue:"Illegal continue statement",IllegalExportDeclaration:"Unexpected token",IllegalImportDeclaration:"Unexpected token",IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list",IllegalReturn:"Illegal return statement",InvalidEscapedReservedWord:"Keyword must not contain escaped characters",InvalidHexEscapeSequence:"Invalid hexadecimal escape sequence",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",InvalidLHSInForLoop:"Invalid left-hand side in for-loop",InvalidModuleSpecifier:"Unexpected token",InvalidRegExp:"Invalid regular expression",LetInLexicalBinding:"let is disallowed as a lexically bound name",MissingFromClause:"Unexpected token",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NewlineAfterThrow:"Illegal newline after throw",NoAsAfterImportNamespace:"Unexpected token",NoCatchOrFinally:"Missing catch or finally after try",ParameterAfterRestParameter:"Rest parameter must be last formal parameter",Redeclaration:"%0 '%1' has already been declared",StaticPrototype:"Classes may not have static property named prototype",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictModeWith:"Strict mode code may not include a with statement",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictReservedWord:"Use of future reserved word in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",TemplateOctalLiteral:"Octal literals are not allowed in template strings.",UnexpectedEOS:"Unexpected end of input",UnexpectedIdentifier:"Unexpected identifier",UnexpectedNumber:"Unexpected number",UnexpectedReserved:"Unexpected reserved word",UnexpectedString:"Unexpected string",UnexpectedTemplate:"Unexpected quasi %0",UnexpectedToken:"Unexpected token %0",UnexpectedTokenIllegal:"Unexpected token ILLEGAL",UnknownLabel:"Undefined label '%0'",UnterminatedRegExp:"Invalid regular expression: missing /"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),n=r(4),a=r(11);function o(d){return"0123456789abcdef".indexOf(d.toLowerCase())}function s(d){return"01234567".indexOf(d)}var u=(function(){function d(p,g){this.source=p,this.errorHandler=g,this.trackComment=!1,this.isModule=!1,this.length=p.length,this.index=0,this.lineNumber=p.length>0?1:0,this.lineStart=0,this.curlyStack=[]}return d.prototype.saveState=function(){return{index:this.index,lineNumber:this.lineNumber,lineStart:this.lineStart}},d.prototype.restoreState=function(p){this.index=p.index,this.lineNumber=p.lineNumber,this.lineStart=p.lineStart},d.prototype.eof=function(){return this.index>=this.length},d.prototype.throwUnexpectedToken=function(p){return p===void 0&&(p=a.Messages.UnexpectedTokenIllegal),this.errorHandler.throwError(this.index,this.lineNumber,this.index-this.lineStart+1,p)},d.prototype.tolerateUnexpectedToken=function(p){p===void 0&&(p=a.Messages.UnexpectedTokenIllegal),this.errorHandler.tolerateError(this.index,this.lineNumber,this.index-this.lineStart+1,p)},d.prototype.skipSingleLineComment=function(p){var g=[],h,l;for(this.trackComment&&(g=[],h=this.index-p,l={start:{line:this.lineNumber,column:this.index-this.lineStart-p},end:{}});!this.eof();){var m=this.source.charCodeAt(this.index);if(++this.index,n.Character.isLineTerminator(m)){if(this.trackComment){l.end={line:this.lineNumber,column:this.index-this.lineStart-1};var f={multiLine:!1,slice:[h+p,this.index-1],range:[h,this.index-1],loc:l};g.push(f)}return m===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,g}}if(this.trackComment){l.end={line:this.lineNumber,column:this.index-this.lineStart};var f={multiLine:!1,slice:[h+p,this.index],range:[h,this.index],loc:l};g.push(f)}return g},d.prototype.skipMultiLineComment=function(){var p=[],g,h;for(this.trackComment&&(p=[],g=this.index-2,h={start:{line:this.lineNumber,column:this.index-this.lineStart-2},end:{}});!this.eof();){var l=this.source.charCodeAt(this.index);if(n.Character.isLineTerminator(l))l===13&&this.source.charCodeAt(this.index+1)===10&&++this.index,++this.lineNumber,++this.index,this.lineStart=this.index;else if(l===42){if(this.source.charCodeAt(this.index+1)===47){if(this.index+=2,this.trackComment){h.end={line:this.lineNumber,column:this.index-this.lineStart};var m={multiLine:!0,slice:[g+2,this.index-2],range:[g,this.index],loc:h};p.push(m)}return p}++this.index}else++this.index}if(this.trackComment){h.end={line:this.lineNumber,column:this.index-this.lineStart};var m={multiLine:!0,slice:[g+2,this.index],range:[g,this.index],loc:h};p.push(m)}return this.tolerateUnexpectedToken(),p},d.prototype.scanComments=function(){var p;this.trackComment&&(p=[]);for(var g=this.index===0;!this.eof();){var h=this.source.charCodeAt(this.index);if(n.Character.isWhiteSpace(h))++this.index;else if(n.Character.isLineTerminator(h))++this.index,h===13&&this.source.charCodeAt(this.index)===10&&++this.index,++this.lineNumber,this.lineStart=this.index,g=!0;else if(h===47)if(h=this.source.charCodeAt(this.index+1),h===47){this.index+=2;var l=this.skipSingleLineComment(2);this.trackComment&&(p=p.concat(l)),g=!0}else if(h===42){this.index+=2;var l=this.skipMultiLineComment();this.trackComment&&(p=p.concat(l))}else break;else if(g&&h===45)if(this.source.charCodeAt(this.index+1)===45&&this.source.charCodeAt(this.index+2)===62){this.index+=3;var l=this.skipSingleLineComment(3);this.trackComment&&(p=p.concat(l))}else break;else if(h===60&&!this.isModule)if(this.source.slice(this.index+1,this.index+4)==="!--"){this.index+=4;var l=this.skipSingleLineComment(4);this.trackComment&&(p=p.concat(l))}else break;else break}return p},d.prototype.isFutureReservedWord=function(p){switch(p){case"enum":case"export":case"import":case"super":return!0;default:return!1}},d.prototype.isStrictModeReservedWord=function(p){switch(p){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}},d.prototype.isRestrictedWord=function(p){return p==="eval"||p==="arguments"},d.prototype.isKeyword=function(p){switch(p.length){case 2:return p==="if"||p==="in"||p==="do";case 3:return p==="var"||p==="for"||p==="new"||p==="try"||p==="let";case 4:return p==="this"||p==="else"||p==="case"||p==="void"||p==="with"||p==="enum";case 5:return p==="while"||p==="break"||p==="catch"||p==="throw"||p==="const"||p==="yield"||p==="class"||p==="super";case 6:return p==="return"||p==="typeof"||p==="delete"||p==="switch"||p==="export"||p==="import";case 7:return p==="default"||p==="finally"||p==="extends";case 8:return p==="function"||p==="continue"||p==="debugger";case 10:return p==="instanceof";default:return!1}},d.prototype.codePointAt=function(p){var g=this.source.charCodeAt(p);if(g>=55296&&g<=56319){var h=this.source.charCodeAt(p+1);if(h>=56320&&h<=57343){var l=g;g=(l-55296)*1024+h-56320+65536}}return g},d.prototype.scanHexEscape=function(p){for(var g=p==="u"?4:2,h=0,l=0;l<g;++l)if(!this.eof()&&n.Character.isHexDigit(this.source.charCodeAt(this.index)))h=h*16+o(this.source[this.index++]);else return null;return String.fromCharCode(h)},d.prototype.scanUnicodeCodePointEscape=function(){var p=this.source[this.index],g=0;for(p==="}"&&this.throwUnexpectedToken();!this.eof()&&(p=this.source[this.index++],!!n.Character.isHexDigit(p.charCodeAt(0)));)g=g*16+o(p);return(g>1114111||p!=="}")&&this.throwUnexpectedToken(),n.Character.fromCodePoint(g)},d.prototype.getIdentifier=function(){for(var p=this.index++;!this.eof();){var g=this.source.charCodeAt(this.index);if(g===92)return this.index=p,this.getComplexIdentifier();if(g>=55296&&g<57343)return this.index=p,this.getComplexIdentifier();if(n.Character.isIdentifierPart(g))++this.index;else break}return this.source.slice(p,this.index)},d.prototype.getComplexIdentifier=function(){var p=this.codePointAt(this.index),g=n.Character.fromCodePoint(p);this.index+=g.length;var h;for(p===92&&(this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,h=this.scanUnicodeCodePointEscape()):(h=this.scanHexEscape("u"),(h===null||h==="\\"||!n.Character.isIdentifierStart(h.charCodeAt(0)))&&this.throwUnexpectedToken()),g=h);!this.eof()&&(p=this.codePointAt(this.index),!!n.Character.isIdentifierPart(p));)h=n.Character.fromCodePoint(p),g+=h,this.index+=h.length,p===92&&(g=g.substr(0,g.length-1),this.source.charCodeAt(this.index)!==117&&this.throwUnexpectedToken(),++this.index,this.source[this.index]==="{"?(++this.index,h=this.scanUnicodeCodePointEscape()):(h=this.scanHexEscape("u"),(h===null||h==="\\"||!n.Character.isIdentifierPart(h.charCodeAt(0)))&&this.throwUnexpectedToken()),g+=h);return g},d.prototype.octalToDecimal=function(p){var g=p!=="0",h=s(p);return!this.eof()&&n.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(g=!0,h=h*8+s(this.source[this.index++]),"0123".indexOf(p)>=0&&!this.eof()&&n.Character.isOctalDigit(this.source.charCodeAt(this.index))&&(h=h*8+s(this.source[this.index++]))),{code:h,octal:g}},d.prototype.scanIdentifier=function(){var p,g=this.index,h=this.source.charCodeAt(g)===92?this.getComplexIdentifier():this.getIdentifier();if(h.length===1?p=3:this.isKeyword(h)?p=4:h==="null"?p=5:h==="true"||h==="false"?p=1:p=3,p!==3&&g+h.length!==this.index){var l=this.index;this.index=g,this.tolerateUnexpectedToken(a.Messages.InvalidEscapedReservedWord),this.index=l}return{type:p,value:h,lineNumber:this.lineNumber,lineStart:this.lineStart,start:g,end:this.index}},d.prototype.scanPunctuator=function(){var p=this.index,g=this.source[this.index];switch(g){case"(":case"{":g==="{"&&this.curlyStack.push("{"),++this.index;break;case".":++this.index,this.source[this.index]==="."&&this.source[this.index+1]==="."&&(this.index+=2,g="...");break;case"}":++this.index,this.curlyStack.pop();break;case")":case";":case",":case"[":case"]":case":":case"?":case"~":++this.index;break;default:g=this.source.substr(this.index,4),g===">>>="?this.index+=4:(g=g.substr(0,3),g==="==="||g==="!=="||g===">>>"||g==="<<="||g===">>="||g==="**="?this.index+=3:(g=g.substr(0,2),g==="&&"||g==="||"||g==="=="||g==="!="||g==="+="||g==="-="||g==="*="||g==="/="||g==="++"||g==="--"||g==="<<"||g===">>"||g==="&="||g==="|="||g==="^="||g==="%="||g==="<="||g===">="||g==="=>"||g==="**"?this.index+=2:(g=this.source[this.index],"<>=!+-*%&|^/".indexOf(g)>=0&&++this.index)))}return this.index===p&&this.throwUnexpectedToken(),{type:7,value:g,lineNumber:this.lineNumber,lineStart:this.lineStart,start:p,end:this.index}},d.prototype.scanHexLiteral=function(p){for(var g="";!this.eof()&&n.Character.isHexDigit(this.source.charCodeAt(this.index));)g+=this.source[this.index++];return g.length===0&&this.throwUnexpectedToken(),n.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseInt("0x"+g,16),lineNumber:this.lineNumber,lineStart:this.lineStart,start:p,end:this.index}},d.prototype.scanBinaryLiteral=function(p){for(var g="",h;!this.eof()&&(h=this.source[this.index],!(h!=="0"&&h!=="1"));)g+=this.source[this.index++];return g.length===0&&this.throwUnexpectedToken(),this.eof()||(h=this.source.charCodeAt(this.index),(n.Character.isIdentifierStart(h)||n.Character.isDecimalDigit(h))&&this.throwUnexpectedToken()),{type:6,value:parseInt(g,2),lineNumber:this.lineNumber,lineStart:this.lineStart,start:p,end:this.index}},d.prototype.scanOctalLiteral=function(p,g){var h="",l=!1;for(n.Character.isOctalDigit(p.charCodeAt(0))?(l=!0,h="0"+this.source[this.index++]):++this.index;!this.eof()&&n.Character.isOctalDigit(this.source.charCodeAt(this.index));)h+=this.source[this.index++];return!l&&h.length===0&&this.throwUnexpectedToken(),(n.Character.isIdentifierStart(this.source.charCodeAt(this.index))||n.Character.isDecimalDigit(this.source.charCodeAt(this.index)))&&this.throwUnexpectedToken(),{type:6,value:parseInt(h,8),octal:l,lineNumber:this.lineNumber,lineStart:this.lineStart,start:g,end:this.index}},d.prototype.isImplicitOctalLiteral=function(){for(var p=this.index+1;p<this.length;++p){var g=this.source[p];if(g==="8"||g==="9")return!1;if(!n.Character.isOctalDigit(g.charCodeAt(0)))return!0}return!0},d.prototype.scanNumericLiteral=function(){var p=this.index,g=this.source[p];i.assert(n.Character.isDecimalDigit(g.charCodeAt(0))||g===".","Numeric literal must start with a decimal digit or a decimal point");var h="";if(g!=="."){if(h=this.source[this.index++],g=this.source[this.index],h==="0"){if(g==="x"||g==="X")return++this.index,this.scanHexLiteral(p);if(g==="b"||g==="B")return++this.index,this.scanBinaryLiteral(p);if(g==="o"||g==="O")return this.scanOctalLiteral(g,p);if(g&&n.Character.isOctalDigit(g.charCodeAt(0))&&this.isImplicitOctalLiteral())return this.scanOctalLiteral(g,p)}for(;n.Character.isDecimalDigit(this.source.charCodeAt(this.index));)h+=this.source[this.index++];g=this.source[this.index]}if(g==="."){for(h+=this.source[this.index++];n.Character.isDecimalDigit(this.source.charCodeAt(this.index));)h+=this.source[this.index++];g=this.source[this.index]}if(g==="e"||g==="E")if(h+=this.source[this.index++],g=this.source[this.index],(g==="+"||g==="-")&&(h+=this.source[this.index++]),n.Character.isDecimalDigit(this.source.charCodeAt(this.index)))for(;n.Character.isDecimalDigit(this.source.charCodeAt(this.index));)h+=this.source[this.index++];else this.throwUnexpectedToken();return n.Character.isIdentifierStart(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(),{type:6,value:parseFloat(h),lineNumber:this.lineNumber,lineStart:this.lineStart,start:p,end:this.index}},d.prototype.scanStringLiteral=function(){var p=this.index,g=this.source[p];i.assert(g==="'"||g==='"',"String literal must starts with a quote"),++this.index;for(var h=!1,l="";!this.eof();){var m=this.source[this.index++];if(m===g){g="";break}else if(m==="\\")if(m=this.source[this.index++],!m||!n.Character.isLineTerminator(m.charCodeAt(0)))switch(m){case"u":if(this.source[this.index]==="{")++this.index,l+=this.scanUnicodeCodePointEscape();else{var f=this.scanHexEscape(m);f===null&&this.throwUnexpectedToken(),l+=f}break;case"x":var y=this.scanHexEscape(m);y===null&&this.throwUnexpectedToken(a.Messages.InvalidHexEscapeSequence),l+=y;break;case"n":l+=`
|
|
@@ -101,29 +101,29 @@ while`),s.push(" (",e.call(r,"test"),");"),(0,S.concat)(s)}case"DoExpression":{v
|
|
|
101
101
|
`,u,`
|
|
102
102
|
}`):t.objectCurlySpacing?n.push("{ ",u," }"):n.push("{",u,"}")}}else n.push(a?"{ ":"{",(0,S.fromString)(", ").join(e.map(r,"specifiers")),a?" }":"}");i.source&&n.push(" from ",e.call(r,"source"),dI(e,t,r))}var d=(0,S.concat)(n);return Dd(d)!==";"&&!(i.declaration&&(i.declaration.type==="FunctionDeclaration"||i.declaration.type==="ClassDeclaration"||i.declaration.type==="TSModuleDeclaration"||i.declaration.type==="TSInterfaceDeclaration"||i.declaration.type==="TSEnumDeclaration"))&&(d=(0,S.concat)([d,";"])),d}function Td(e,t){var r=In.getParentExportDeclaration(e);return r?(0,Yr.default)(r.type==="DeclareExportDeclaration"):t.unshift("declare "),(0,S.concat)(t)}function Cd(e,t){return e.call(function(r){var i=r.getValue();return i?i==="plus"?(0,S.fromString)("+"):i==="minus"?(0,S.fromString)("-"):t(r):(0,S.fromString)("")},"variance")}function ho(e,t){return e.length>1?(0,S.concat)([" ",e]):(0,S.concat)([`
|
|
103
103
|
`,Gg(e).indent(t.tabWidth)])}function Dd(e){var t=e.lastPos();do{var r=e.charAt(t);if(/\S/.test(r))return r}while(e.prevPos(t))}function Xz(e){return Dd(e)==="}"}function zg(e){return e.replace(/['"]/g,function(t){return t==='"'?"'":'"'})}function Dc(e){var t=go.getFieldValue(e,"value"),r=go.getFieldValue(e,"extra");if(r&&typeof r.raw=="string"&&t==r.rawValue)return r.raw;if(e.type==="Literal"){var i=e.raw;if(typeof i=="string"&&t==i)return i}}function Bg(e){return JSON.stringify(e).replace(/[\u2028\u2029]/g,function(t){return"\\u"+t.charCodeAt(0).toString(16)})}function Id(e,t){switch(pI.assert(e),t.quote){case"auto":{var r=Bg(e),i=zg(Bg(zg(e)));return r.length>i.length?i:r}case"single":return zg(Bg(zg(e)));default:return Bg(e)}}function Gg(e){var t=Dd(e);return!t||`
|
|
104
|
-
};`.indexOf(t)<0?(0,S.concat)([e,";"]):e}});var iB=P(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.run=Zt.prettyPrint=Zt.print=Zt.visit=Zt.types=Zt.parse=void 0;var eB=(le(),Q(ue)),Yte=eB.__importDefault(Io("fs")),Qte=eB.__importStar(Ar());Zt.types=Qte;var tB=$z();Object.defineProperty(Zt,"parse",{enumerable:!0,get:function(){return tB.parse}});var rB=Qz(),ere=Ar();Object.defineProperty(Zt,"visit",{enumerable:!0,get:function(){return ere.visit}});function nB(e,t){return new rB.Printer(t).print(e)}Zt.print=nB;function tre(e,t){return new rB.Printer(t).printGenerically(e)}Zt.prettyPrint=tre;function rre(e,t){return nre(process.argv[2],e,t)}Zt.run=rre;function nre(e,t,r){Yte.default.readFile(e,"utf-8",function(i,n){if(i){console.error(i);return}are(n,t,r)})}function ire(e){process.stdout.write(e)}function are(e,t,r){var i=r&&r.writeback||ire;t((0,tB.parse)(e,r),function(n){i(nB(n,r).code)})}});var We=P((
|
|
105
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return a=d.done,d},e:function(d){o=!0,s=d},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function pne(e,t){if(e){if(typeof e=="string")return q2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q2(e,t)}}function q2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}var mne=iy(),J2=Ke(),H2=J2.erase,fne=J2.cursor,hne=e=>[...mne(e)].length;X2.exports=function(e,t){if(!t)return H2.line+fne.to(0);let r=0,i=e.split(/\r?\n/);var n=dne(i),a;try{for(n.s();!(a=n.n()).done;){let o=a.value;r+=1+Math.floor(Math.max(hne(o)-1,0)/t)}}catch(o){n.e(o)}finally{n.f()}return H2.lines(r)}});var jI=P((
|
|
104
|
+
};`.indexOf(t)<0?(0,S.concat)([e,";"]):e}});var iB=P(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.run=Zt.prettyPrint=Zt.print=Zt.visit=Zt.types=Zt.parse=void 0;var eB=(le(),Q(ue)),Yte=eB.__importDefault(Io("fs")),Qte=eB.__importStar(Ar());Zt.types=Qte;var tB=$z();Object.defineProperty(Zt,"parse",{enumerable:!0,get:function(){return tB.parse}});var rB=Qz(),ere=Ar();Object.defineProperty(Zt,"visit",{enumerable:!0,get:function(){return ere.visit}});function nB(e,t){return new rB.Printer(t).print(e)}Zt.print=nB;function tre(e,t){return new rB.Printer(t).printGenerically(e)}Zt.prettyPrint=tre;function rre(e,t){return nre(process.argv[2],e,t)}Zt.run=rre;function nre(e,t,r){Yte.default.readFile(e,"utf-8",function(i,n){if(i){console.error(i);return}are(n,t,r)})}function ire(e){process.stdout.write(e)}function are(e,t,r){var i=r&&r.writeback||ire;t((0,tB.parse)(e,r),function(n){i(nB(n,r).code)})}});var We=P((Y_e,V2)=>{"use strict";var{FORCE_COLOR:ane,NODE_DISABLE_COLORS:one,TERM:sne}=process.env,Te={enabled:!one&&sne!=="dumb"&&ane!=="0",reset:je(0,0),bold:je(1,22),dim:je(2,22),italic:je(3,23),underline:je(4,24),inverse:je(7,27),hidden:je(8,28),strikethrough:je(9,29),black:je(30,39),red:je(31,39),green:je(32,39),yellow:je(33,39),blue:je(34,39),magenta:je(35,39),cyan:je(36,39),white:je(37,39),gray:je(90,39),grey:je(90,39),bgBlack:je(40,49),bgRed:je(41,49),bgGreen:je(42,49),bgYellow:je(43,49),bgBlue:je(44,49),bgMagenta:je(45,49),bgCyan:je(46,49),bgWhite:je(47,49)};function B2(e,t){let r=0,i,n="",a="";for(;r<e.length;r++)i=e[r],n+=i.open,a+=i.close,t.includes(i.close)&&(t=t.replace(i.rgx,i.close+i.open));return n+t+a}function cne(e,t){let r={has:e,keys:t};return r.reset=Te.reset.bind(r),r.bold=Te.bold.bind(r),r.dim=Te.dim.bind(r),r.italic=Te.italic.bind(r),r.underline=Te.underline.bind(r),r.inverse=Te.inverse.bind(r),r.hidden=Te.hidden.bind(r),r.strikethrough=Te.strikethrough.bind(r),r.black=Te.black.bind(r),r.red=Te.red.bind(r),r.green=Te.green.bind(r),r.yellow=Te.yellow.bind(r),r.blue=Te.blue.bind(r),r.magenta=Te.magenta.bind(r),r.cyan=Te.cyan.bind(r),r.white=Te.white.bind(r),r.gray=Te.gray.bind(r),r.grey=Te.grey.bind(r),r.bgBlack=Te.bgBlack.bind(r),r.bgRed=Te.bgRed.bind(r),r.bgGreen=Te.bgGreen.bind(r),r.bgYellow=Te.bgYellow.bind(r),r.bgBlue=Te.bgBlue.bind(r),r.bgMagenta=Te.bgMagenta.bind(r),r.bgCyan=Te.bgCyan.bind(r),r.bgWhite=Te.bgWhite.bind(r),r}function je(e,t){let r={open:`\x1B[${e}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(e)||(this.has.push(e),this.keys.push(r)),i===void 0?this:Te.enabled?B2(this.keys,i+""):i+""):i===void 0?cne([e],[r]):Te.enabled?B2([r],i+""):i+""}}V2.exports=Te});var W2=P((Q_e,G2)=>{"use strict";G2.exports=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}});var iy=P((e0e,K2)=>{"use strict";K2.exports=e=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(t,"g");return typeof e=="string"?e.replace(r,""):e}});var Ke=P((t0e,Z2)=>{"use strict";var $I={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},une={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},lne={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?$I.up():"");return e&&(t+=$I.left),t}};Z2.exports={cursor:$I,scroll:une,erase:lne,beep:"\x07"}});var Y2=P((r0e,X2)=>{"use strict";function dne(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=pne(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
105
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return a=d.done,d},e:function(d){o=!0,s=d},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function pne(e,t){if(e){if(typeof e=="string")return q2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return q2(e,t)}}function q2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}var mne=iy(),J2=Ke(),H2=J2.erase,fne=J2.cursor,hne=e=>[...mne(e)].length;X2.exports=function(e,t){if(!t)return H2.line+fne.to(0);let r=0,i=e.split(/\r?\n/);var n=dne(i),a;try{for(n.s();!(a=n.n()).done;){let o=a.value;r+=1+Math.floor(Math.max(hne(o)-1,0)/t)}}catch(o){n.e(o)}finally{n.f()}return H2.lines(r)}});var jI=P((n0e,Q2)=>{"use strict";var Pd={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},gne={arrowUp:Pd.arrowUp,arrowDown:Pd.arrowDown,arrowLeft:Pd.arrowLeft,arrowRight:Pd.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},yne=process.platform==="win32"?gne:Pd;Q2.exports=yne});var t4=P((i0e,e4)=>{"use strict";var $c=We(),xo=jI(),MI=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"\u{1F603}".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),vne=e=>MI[e]||MI.default,Rd=Object.freeze({aborted:$c.red(xo.cross),done:$c.green(xo.tick),exited:$c.yellow(xo.cross),default:$c.cyan("?")}),bne=(e,t,r)=>t?Rd.aborted:r?Rd.exited:e?Rd.done:Rd.default,Sne=e=>$c.gray(e?xo.ellipsis:xo.pointerSmall),Ene=(e,t)=>$c.gray(e?t?xo.pointerSmall:"+":xo.line);e4.exports={styles:MI,render:vne,symbols:Rd,symbol:bne,delimiter:Sne,item:Ene}});var n4=P((a0e,r4)=>{"use strict";var xne=iy();r4.exports=function(e,t){let r=String(xne(e)||"").split(/\r?\n/);return t?r.map(i=>Math.ceil(i.length/t)).reduce((i,n)=>i+n):r.length}});var a4=P((o0e,i4)=>{"use strict";i4.exports=(e,t={})=>{let r=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(e||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((a,o)=>(o.length+r.length>=i||a[a.length-1].length+o.length+1<i?a[a.length-1]+=` ${o}`:a.push(`${r}${o}`),a),[r]).join(`
|
|
106
106
|
`)).join(`
|
|
107
|
-
`)}});var s4=P((
|
|
107
|
+
`)}});var s4=P((s0e,o4)=>{"use strict";o4.exports=(e,t,r)=>{r=r||t;let i=Math.min(t-r,e-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,t);return{startIndex:i,endIndex:n}}});var en=P((c0e,c4)=>{"use strict";c4.exports={action:W2(),clear:Y2(),style:t4(),strip:iy(),figures:jI(),lines:n4(),wrap:a4(),entriesToDisplay:s4()}});var hi=P((u0e,d4)=>{"use strict";var u4=Io("readline"),Ane=en(),_ne=Ane.action,Tne=Io("events"),l4=Ke(),Cne=l4.beep,Ine=l4.cursor,Dne=We(),FI=class extends Tne{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);let r=u4.createInterface({input:this.in,escapeCodeTimeout:50});u4.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(a,o)=>{let s=_ne(o,i);s===!1?this._&&this._(a,o):typeof this[s]=="function"?this[s](o):this.bell()};this.close=()=>{this.out.write(Ine.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Cne)}render(){this.onRender(Dne),this.firstRender&&(this.firstRender=!1)}};d4.exports=FI});var g4=P((l0e,h4)=>{"use strict";function p4(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(d){r(d);return}s.done?t(u):Promise.resolve(u).then(i,n)}function m4(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var a=e.apply(t,r);function o(u){p4(a,i,n,o,s,"next",u)}function s(u){p4(a,i,n,o,s,"throw",u)}o(void 0)})}}var ay=We(),wne=hi(),f4=Ke(),kne=f4.erase,Od=f4.cursor,oy=en(),LI=oy.style,UI=oy.clear,Nne=oy.lines,Pne=oy.figures,zI=class extends wne{constructor(t={}){super(t),this.transform=LI.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=UI("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=ay.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
108
108
|
`),this.close()}validate(){var t=this;return m4(function*(){let r=yield t.validator(t.value);typeof r=="string"&&(t.errorMsg=r,r=!1),t.error=!r})()}submit(){var t=this;return m4(function*(){if(t.value=t.value||t.initial,t.cursorOffset=0,t.cursor=t.rendered.length,yield t.validate(),t.error){t.red=!0,t.fire(),t.render();return}t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write(`
|
|
109
109
|
`),t.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${t}${n}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${t}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${t}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(Od.down(Nne(this.outputError,this.out.columns)-1)+UI(this.outputError,this.out.columns)),this.out.write(UI(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[LI.symbol(this.done,this.aborted),ay.bold(this.msg),LI.delimiter(this.done),this.red?ay.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
110
110
|
`).reduce((t,r,i)=>t+`
|
|
111
|
-
${i?" ":Pne.pointerSmall} ${ay.red().italic(r)}`,"")),this.out.write(kne.line+Od.to(0)+this.outputText+Od.save+this.outputError+Od.restore+Od.move(this.cursorOffset,0)))}};h4.exports=zI});var S4=P((
|
|
111
|
+
${i?" ":Pne.pointerSmall} ${ay.red().italic(r)}`,"")),this.out.write(kne.line+Od.to(0)+this.outputText+Od.save+this.outputError+Od.restore+Od.move(this.cursorOffset,0)))}};h4.exports=zI});var S4=P((d0e,b4)=>{"use strict";var gi=We(),Rne=hi(),$d=en(),y4=$d.style,v4=$d.clear,sy=$d.figures,One=$d.wrap,$ne=$d.entriesToDisplay,jne=Ke(),Mne=jne.cursor,BI=class extends Rne{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=v4("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
112
112
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
113
113
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Mne.hide):this.out.write(v4(this.outputText,this.out.columns)),super.render();let t=$ne(this.cursor,this.choices.length,this.optionsPerPage),r=t.startIndex,i=t.endIndex;if(this.outputText=[y4.symbol(this.done,this.aborted),gi.bold(this.msg),y4.delimiter(!1),this.done?this.selection.title:this.selection.disabled?gi.yellow(this.warn):gi.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
114
114
|
`;for(let n=r;n<i;n++){let a,o,s="",u=this.choices[n];n===r&&r>0?o=sy.arrowUp:n===i-1&&i<this.choices.length?o=sy.arrowDown:o=" ",u.disabled?(a=this.cursor===n?gi.gray().underline(u.title):gi.strikethrough().gray(u.title),o=(this.cursor===n?gi.bold().gray(sy.pointer)+" ":" ")+o):(a=this.cursor===n?gi.cyan().underline(u.title):u.title,o=(this.cursor===n?gi.cyan(sy.pointer)+" ":" ")+o,u.description&&this.cursor===n&&(s=` - ${u.description}`,(o.length+a.length+s.length>=this.out.columns||u.description.split(/\r?\n/).length>1)&&(s=`
|
|
115
115
|
`+One(u.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${a}${gi.gray(s)}
|
|
116
|
-
`}}this.out.write(this.outputText)}};b4.exports=BI});var C4=P((
|
|
116
|
+
`}}this.out.write(this.outputText)}};b4.exports=BI});var C4=P((p0e,T4)=>{"use strict";var cy=We(),Fne=hi(),A4=en(),E4=A4.style,Lne=A4.clear,_4=Ke(),x4=_4.cursor,Une=_4.erase,VI=class extends Fne{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
117
117
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
118
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,r){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(x4.hide):this.out.write(Lne(this.outputText,this.out.columns)),super.render(),this.outputText=[E4.symbol(this.done,this.aborted),cy.bold(this.msg),E4.delimiter(this.done),this.value?this.inactive:cy.cyan().underline(this.inactive),cy.gray("/"),this.value?cy.cyan().underline(this.active):this.active].join(" "),this.out.write(Une.line+x4.to(0)+this.outputText))}};T4.exports=VI});var wn=P((
|
|
118
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,r){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(x4.hide):this.out.write(Lne(this.outputText,this.out.columns)),super.render(),this.outputText=[E4.symbol(this.done,this.aborted),cy.bold(this.msg),E4.delimiter(this.done),this.value?this.inactive:cy.cyan().underline(this.inactive),cy.gray("/"),this.value?cy.cyan().underline(this.active):this.active].join(" "),this.out.write(Une.line+x4.to(0)+this.outputText))}};T4.exports=VI});var wn=P((m0e,I4)=>{"use strict";var GI=class e{constructor({token:t,date:r,parts:i,locales:n}){this.token=t,this.date=r||new Date,this.parts=i||[this],this.locales=n||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((r,i)=>i>t&&r instanceof e)}setTo(t){}prev(){let t=[].concat(this.parts).reverse(),r=t.indexOf(this);return t.find((i,n)=>n>r&&i instanceof e)}toString(){return String(this.date)}};I4.exports=GI});var w4=P((f0e,D4)=>{"use strict";var zne=wn(),WI=class extends zne{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};D4.exports=WI});var N4=P((h0e,k4)=>{"use strict";var Bne=wn(),Vne=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),KI=class extends Bne{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+Vne(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}};k4.exports=KI});var R4=P((g0e,P4)=>{"use strict";var Gne=wn(),ZI=class extends Gne{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};P4.exports=ZI});var $4=P((y0e,O4)=>{"use strict";var Wne=wn(),qI=class extends Wne{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};O4.exports=qI});var M4=P((v0e,j4)=>{"use strict";var Kne=wn(),HI=class extends Kne{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};j4.exports=HI});var L4=P((b0e,F4)=>{"use strict";var Zne=wn(),JI=class extends Zne{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}};F4.exports=JI});var z4=P((S0e,U4)=>{"use strict";var qne=wn(),XI=class extends qne{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};U4.exports=XI});var V4=P((E0e,B4)=>{"use strict";var Hne=wn(),YI=class extends Hne{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};B4.exports=YI});var W4=P((x0e,G4)=>{"use strict";G4.exports={DatePart:wn(),Meridiem:w4(),Day:N4(),Hours:R4(),Milliseconds:$4(),Minutes:M4(),Month:L4(),Seconds:z4(),Year:V4()}});var t6=P((A0e,e6)=>{"use strict";function K4(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(d){r(d);return}s.done?t(u):Promise.resolve(u).then(i,n)}function Z4(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var a=e.apply(t,r);function o(u){K4(a,i,n,o,s,"next",u)}function s(u){K4(a,i,n,o,s,"throw",u)}o(void 0)})}}var QI=We(),Jne=hi(),tD=en(),q4=tD.style,H4=tD.clear,Xne=tD.figures,Q4=Ke(),Yne=Q4.erase,J4=Q4.cursor,yi=W4(),X4=yi.DatePart,Qne=yi.Meridiem,eie=yi.Day,tie=yi.Hours,rie=yi.Milliseconds,nie=yi.Minutes,iie=yi.Month,aie=yi.Seconds,oie=yi.Year,sie=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Y4={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new eie(e),3:e=>new iie(e),4:e=>new oie(e),5:e=>new Qne(e),6:e=>new tie(e),7:e=>new nie(e),8:e=>new aie(e),9:e=>new rie(e)},cie={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},eD=class extends Jne{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(cie,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=H4("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let r;for(this.parts=[];r=sie.exec(t);){let n=r.shift(),a=r.findIndex(o=>o!=null);this.parts.push(a in Y4?Y4[a]({token:r[a]||n,date:this.date,parts:this.parts,locales:this.locales}):r[a]||n)}let i=this.parts.reduce((n,a)=>(typeof a=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=a:n.push(a),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof X4)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
119
119
|
`),this.close()}validate(){var t=this;return Z4(function*(){let r=yield t.validator(t.value);typeof r=="string"&&(t.errorMsg=r,r=!1),t.error=!r})()}submit(){var t=this;return Z4(function*(){if(yield t.validate(),t.error){t.color="red",t.fire(),t.render();return}t.done=!0,t.aborted=!1,t.fire(),t.render(),t.out.write(`
|
|
120
120
|
`),t.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(r=>r instanceof X4)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(J4.hide):this.out.write(H4(this.outputText,this.out.columns)),super.render(),this.outputText=[q4.symbol(this.done,this.aborted),QI.bold(this.msg),q4.delimiter(!1),this.parts.reduce((t,r,i)=>t.concat(i===this.cursor&&!this.done?QI.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
121
121
|
`).reduce((t,r,i)=>t+`
|
|
122
|
-
${i?" ":Xne.pointerSmall} ${QI.red().italic(r)}`,"")),this.out.write(Yne.line+J4.to(0)+this.outputText))}};e6.exports=eD});var c6=P((
|
|
122
|
+
${i?" ":Xne.pointerSmall} ${QI.red().italic(r)}`,"")),this.out.write(Yne.line+J4.to(0)+this.outputText))}};e6.exports=eD});var c6=P((_0e,s6)=>{"use strict";function r6(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(d){r(d);return}s.done?t(u):Promise.resolve(u).then(i,n)}function n6(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var a=e.apply(t,r);function o(u){r6(a,i,n,o,s,"next",u)}function s(u){r6(a,i,n,o,s,"throw",u)}o(void 0)})}}var uy=We(),uie=hi(),o6=Ke(),ly=o6.cursor,lie=o6.erase,dy=en(),rD=dy.style,die=dy.figures,i6=dy.clear,pie=dy.lines,mie=/[0-9]/,nD=e=>e!==void 0,a6=(e,t)=>{let r=Math.pow(10,t);return Math.round(e*r)/r},iD=class extends uie{constructor(t={}){super(t),this.transform=rD.render(t.style),this.msg=t.message,this.initial=nD(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=nD(t.min)?t.min:-1/0,this.max=nD(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=uy.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${a6(t,this.round)}`),this._value=a6(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||mie.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
123
123
|
`),this.close()}validate(){var t=this;return n6(function*(){let r=yield t.validator(t.value);typeof r=="string"&&(t.errorMsg=r,r=!1),t.error=!r})()}submit(){var t=this;return n6(function*(){if(yield t.validate(),t.error){t.color="red",t.fire(),t.render();return}let r=t.value;t.value=r!==""?r:t.initial,t.done=!0,t.aborted=!1,t.error=!1,t.fire(),t.render(),t.out.write(`
|
|
124
124
|
`),t.close()})()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,r){if(!this.valid(t))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(ly.down(pie(this.outputError,this.out.columns)-1)+i6(this.outputError,this.out.columns)),this.out.write(i6(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[rD.symbol(this.done,this.aborted),uy.bold(this.msg),rD.delimiter(this.done),!this.done||!this.done&&!this.placeholder?uy[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
125
125
|
`).reduce((t,r,i)=>t+`
|
|
126
|
-
${i?" ":die.pointerSmall} ${uy.red().italic(r)}`,"")),this.out.write(lie.line+ly.to(0)+this.outputText+ly.save+this.outputError+ly.restore))}};s6.exports=iD});var oD=P((
|
|
126
|
+
${i?" ":die.pointerSmall} ${uy.red().italic(r)}`,"")),this.out.write(lie.line+ly.to(0)+this.outputText+ly.save+this.outputError+ly.restore))}};s6.exports=iD});var oD=P((T0e,d6)=>{"use strict";var kn=We(),fie=Ke(),hie=fie.cursor,gie=hi(),jd=en(),u6=jd.clear,ra=jd.figures,l6=jd.style,yie=jd.wrap,vie=jd.entriesToDisplay,aD=class extends gie{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=u6("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
127
127
|
`),this.close()}submit(){let t=this.value.filter(r=>r.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
128
128
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let t=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=t),this.render()}_(t,r){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
129
129
|
Instructions:
|
|
@@ -133,13 +133,13 @@ Instructions:
|
|
|
133
133
|
`:"")+" enter/return: Complete answer":""}renderOption(t,r,i,n){let a=(r.selected?kn.green(ra.radioOn):ra.radioOff)+" "+n+" ",o,s;return r.disabled?o=t===i?kn.gray().underline(r.title):kn.strikethrough().gray(r.title):(o=t===i?kn.cyan().underline(r.title):r.title,t===i&&r.description&&(s=` - ${r.description}`,(a.length+o.length+s.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(s=`
|
|
134
134
|
`+yie(r.description,{margin:a.length,width:this.out.columns})))),a+o+kn.gray(s||"")}paginateOptions(t){if(t.length===0)return kn.red("No matches for this query.");let r=vie(this.cursor,t.length,this.optionsPerPage),i=r.startIndex,n=r.endIndex,a,o=[];for(let s=i;s<n;s++)s===i&&i>0?a=ra.arrowUp:s===n-1&&n<t.length?a=ra.arrowDown:a=" ",o.push(this.renderOption(this.cursor,t[s],s,a));return`
|
|
135
135
|
`+o.join(`
|
|
136
|
-
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let t=[kn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(kn.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(hie.hide),super.render();let t=[l6.symbol(this.done,this.aborted),kn.bold(this.msg),l6.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=kn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=u6(t,this.out.columns)}};d6.exports=aD});var v6=P((
|
|
136
|
+
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let t=[kn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(kn.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(hie.hide),super.render();let t=[l6.symbol(this.done,this.aborted),kn.bold(this.msg),l6.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=kn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=u6(t,this.out.columns)}};d6.exports=aD});var v6=P((C0e,y6)=>{"use strict";function p6(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(d){r(d);return}s.done?t(u):Promise.resolve(u).then(i,n)}function bie(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var a=e.apply(t,r);function o(u){p6(a,i,n,o,s,"next",u)}function s(u){p6(a,i,n,o,s,"throw",u)}o(void 0)})}}var Md=We(),Sie=hi(),g6=Ke(),Eie=g6.erase,m6=g6.cursor,Fd=en(),sD=Fd.style,f6=Fd.clear,cD=Fd.figures,xie=Fd.wrap,Aie=Fd.entriesToDisplay,h6=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),_ie=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),Tie=(e,t)=>{let r=e.findIndex(i=>i.value===t||i.title===t);return r>-1?r:void 0},uD=class extends Sie{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:Tie(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=sD.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=f6("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=h6(this.suggestions,t):this.value=this.fallback.value,this.fire()}complete(t){var r=this;return bie(function*(){let i=r.completing=r.suggest(r.input,r.choices),n=yield i;if(r.completing!==i)return;r.suggestions=n.map((o,s,u)=>({title:_ie(u,s),value:h6(u,s),description:o.description})),r.completing=!1;let a=Math.max(n.length-1,0);r.moveSelect(Math.min(a,r.select)),t&&t()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
137
137
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
138
138
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
139
139
|
`),this.close()}_(t,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${t}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${t}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${t}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,r,i,n){let a,o=i?cD.arrowUp:n?cD.arrowDown:" ",s=r?Md.cyan().underline(t.title):t.title;return o=(r?Md.cyan(cD.pointer)+" ":" ")+o,t.description&&(a=` - ${t.description}`,(o.length+s.length+a.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(a=`
|
|
140
140
|
`+xie(t.description,{margin:3,width:this.out.columns}))),o+" "+s+Md.gray(a||"")}render(){if(this.closed)return;this.firstRender?this.out.write(m6.hide):this.out.write(f6(this.outputText,this.out.columns)),super.render();let t=Aie(this.select,this.choices.length,this.limit),r=t.startIndex,i=t.endIndex;if(this.outputText=[sD.symbol(this.done,this.aborted,this.exited),Md.bold(this.msg),sD.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let n=this.suggestions.slice(r,i).map((a,o)=>this.renderOption(a,this.select===o+r,o===0&&r>0,o+r===i-1&&i<this.choices.length)).join(`
|
|
141
141
|
`);this.outputText+=`
|
|
142
|
-
`+(n||Md.gray(this.fallback.title))}this.out.write(Eie.line+m6.to(0)+this.outputText)}};y6.exports=uD});var x6=P((
|
|
142
|
+
`+(n||Md.gray(this.fallback.title))}this.out.write(Eie.line+m6.to(0)+this.outputText)}};y6.exports=uD});var x6=P((I0e,E6)=>{"use strict";var vi=We(),Cie=Ke(),Iie=Cie.cursor,Die=oD(),dD=en(),b6=dD.clear,S6=dD.style,jc=dD.figures,lD=class extends Die{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=b6("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(i=>i===t);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,r){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
143
143
|
Instructions:
|
|
144
144
|
${jc.arrowUp}/${jc.arrowDown}: Highlight option
|
|
145
145
|
${jc.arrowLeft}/${jc.arrowRight}/[space]: Toggle selection
|
|
@@ -147,31 +147,31 @@ Instructions:
|
|
|
147
147
|
enter/return: Complete answer
|
|
148
148
|
`:""}renderCurrentInput(){return`
|
|
149
149
|
Filtered results for: ${this.inputValue?this.inputValue:vi.gray("Enter something to filter")}
|
|
150
|
-
`}renderOption(t,r,i){let n;return r.disabled?n=t===i?vi.gray().underline(r.title):vi.strikethrough().gray(r.title):n=t===i?vi.cyan().underline(r.title):r.title,(r.selected?vi.green(jc.radioOn):jc.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let t=[vi.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(vi.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Iie.hide),super.render();let t=[S6.symbol(this.done,this.aborted),vi.bold(this.msg),S6.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=vi.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=b6(t,this.out.columns)}};E6.exports=lD});var w6=P((
|
|
150
|
+
`}renderOption(t,r,i){let n;return r.disabled?n=t===i?vi.gray().underline(r.title):vi.strikethrough().gray(r.title):n=t===i?vi.cyan().underline(r.title):r.title,(r.selected?vi.green(jc.radioOn):jc.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let t=[vi.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(vi.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Iie.hide),super.render();let t=[S6.symbol(this.done,this.aborted),vi.bold(this.msg),S6.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=vi.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=b6(t,this.out.columns)}};E6.exports=lD});var w6=P((D0e,D6)=>{"use strict";var A6=We(),wie=hi(),C6=en(),_6=C6.style,kie=C6.clear,I6=Ke(),Nie=I6.erase,T6=I6.cursor,pD=class extends wie{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
151
151
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
152
|
-
`),this.close()}_(t,r){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(T6.hide):this.out.write(kie(this.outputText,this.out.columns)),super.render(),this.outputText=[_6.symbol(this.done,this.aborted),A6.bold(this.msg),_6.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:A6.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Nie.line+T6.to(0)+this.outputText))}};D6.exports=pD});var N6=P((
|
|
153
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return a=d.done,d},e:function(d){o=!0,s=d},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function jie(e,t){if(e){if(typeof e=="string")return j6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j6(e,t)}}function j6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function M6(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(d){r(d);return}s.done?t(u):Promise.resolve(u).then(i,n)}function F6(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var a=e.apply(t,r);function o(u){M6(a,i,n,o,s,"next",u)}function s(u){M6(a,i,n,o,s,"throw",u)}o(void 0)})}}var mD=R6(),Mie=["suggest","format","onState","validate","onRender","type"],L6=()=>{};function na(){return fD.apply(this,arguments)}function fD(){return fD=F6(function*(e=[],{onSubmit:t=L6,onCancel:r=L6}={}){let i={},n=na._override||{};e=[].concat(e);let a,o,s,u,d,p,g=(function(){var y=F6(function*(v,b,A=!1){if(!(!A&&v.validate&&v.validate(b)!==!0))return v.format?yield v.format(b,i):b});return function(b,A){return y.apply(this,arguments)}})();var h=$ie(e),l;try{for(h.s();!(l=h.n()).done;){o=l.value;var m=o;if(u=m.name,d=m.type,typeof d=="function"&&(d=yield d(a,$6({},i),o),o.type=d),!!d){for(let y in o){if(Mie.includes(y))continue;let v=o[y];o[y]=typeof v=="function"?yield v(a,$6({},i),p):v}if(p=o,typeof o.message!="string")throw new Error("prompt message is required");var f=o;if(u=f.name,d=f.type,mD[d]===void 0)throw new Error(`prompt type (${d}) is not defined`);if(n[o.name]!==void 0&&(a=yield g(o,n[o.name]),a!==void 0)){i[u]=a;continue}try{a=na._injected?Fie(na._injected,o.initial):yield mD[d](o),i[u]=a=yield g(o,a,!0),s=yield t(o,a,i)}catch{s=!(yield r(o,i))}if(s)return i}}}catch(y){h.e(y)}finally{h.f()}return i}),fD.apply(this,arguments)}function Fie(e,t){let r=e.shift();if(r instanceof Error)throw r;return r===void 0?t:r}function Lie(e){na._injected=(na._injected||[]).concat(e)}function Uie(e){na._override=Object.assign({},e)}U6.exports=Object.assign(na,{prompt:na,prompts:mD,inject:Lie,override:Uie})});var V6=P((
|
|
152
|
+
`),this.close()}_(t,r){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(T6.hide):this.out.write(kie(this.outputText,this.out.columns)),super.render(),this.outputText=[_6.symbol(this.done,this.aborted),A6.bold(this.msg),_6.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:A6.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(Nie.line+T6.to(0)+this.outputText))}};D6.exports=pD});var N6=P((w0e,k6)=>{"use strict";k6.exports={TextPrompt:g4(),SelectPrompt:S4(),TogglePrompt:C4(),DatePrompt:t6(),NumberPrompt:c6(),MultiselectPrompt:oD(),AutocompletePrompt:v6(),AutocompleteMultiselectPrompt:x6(),ConfirmPrompt:w6()}});var R6=P(P6=>{"use strict";var Ht=P6,Pie=N6(),py=e=>e;function Nn(e,t,r={}){return new Promise((i,n)=>{let a=new Pie[e](t),o=r.onAbort||py,s=r.onSubmit||py,u=r.onExit||py;a.on("state",t.onState||py),a.on("submit",d=>i(s(d))),a.on("exit",d=>i(u(d))),a.on("abort",d=>n(o(d)))})}Ht.text=e=>Nn("TextPrompt",e);Ht.password=e=>(e.style="password",Ht.text(e));Ht.invisible=e=>(e.style="invisible",Ht.text(e));Ht.number=e=>Nn("NumberPrompt",e);Ht.date=e=>Nn("DatePrompt",e);Ht.confirm=e=>Nn("ConfirmPrompt",e);Ht.list=e=>{let t=e.separator||",";return Nn("TextPrompt",e,{onSubmit:r=>r.split(t).map(i=>i.trim())})};Ht.toggle=e=>Nn("TogglePrompt",e);Ht.select=e=>Nn("SelectPrompt",e);Ht.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(i=>i.selected).map(i=>i.value);return Nn("MultiselectPrompt",e,{onAbort:t,onSubmit:t})};Ht.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(i=>i.selected).map(i=>i.value);return Nn("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var Rie=(e,t)=>Promise.resolve(t.filter(r=>r.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Ht.autocomplete=e=>(e.suggest=e.suggest||Rie,e.choices=[].concat(e.choices||[]),Nn("AutocompletePrompt",e))});var z6=P((N0e,U6)=>{"use strict";function O6(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function $6(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?O6(Object(r),!0).forEach(function(i){Oie(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O6(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Oie(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $ie(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=jie(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var i=0,n=function(){};return{s:n,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
153
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,o=!1,s;return{s:function(){r=r.call(e)},n:function(){var d=r.next();return a=d.done,d},e:function(d){o=!0,s=d},f:function(){try{!a&&r.return!=null&&r.return()}finally{if(o)throw s}}}}function jie(e,t){if(e){if(typeof e=="string")return j6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j6(e,t)}}function j6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function M6(e,t,r,i,n,a,o){try{var s=e[a](o),u=s.value}catch(d){r(d);return}s.done?t(u):Promise.resolve(u).then(i,n)}function F6(e){return function(){var t=this,r=arguments;return new Promise(function(i,n){var a=e.apply(t,r);function o(u){M6(a,i,n,o,s,"next",u)}function s(u){M6(a,i,n,o,s,"throw",u)}o(void 0)})}}var mD=R6(),Mie=["suggest","format","onState","validate","onRender","type"],L6=()=>{};function na(){return fD.apply(this,arguments)}function fD(){return fD=F6(function*(e=[],{onSubmit:t=L6,onCancel:r=L6}={}){let i={},n=na._override||{};e=[].concat(e);let a,o,s,u,d,p,g=(function(){var y=F6(function*(v,b,A=!1){if(!(!A&&v.validate&&v.validate(b)!==!0))return v.format?yield v.format(b,i):b});return function(b,A){return y.apply(this,arguments)}})();var h=$ie(e),l;try{for(h.s();!(l=h.n()).done;){o=l.value;var m=o;if(u=m.name,d=m.type,typeof d=="function"&&(d=yield d(a,$6({},i),o),o.type=d),!!d){for(let y in o){if(Mie.includes(y))continue;let v=o[y];o[y]=typeof v=="function"?yield v(a,$6({},i),p):v}if(p=o,typeof o.message!="string")throw new Error("prompt message is required");var f=o;if(u=f.name,d=f.type,mD[d]===void 0)throw new Error(`prompt type (${d}) is not defined`);if(n[o.name]!==void 0&&(a=yield g(o,n[o.name]),a!==void 0)){i[u]=a;continue}try{a=na._injected?Fie(na._injected,o.initial):yield mD[d](o),i[u]=a=yield g(o,a,!0),s=yield t(o,a,i)}catch{s=!(yield r(o,i))}if(s)return i}}}catch(y){h.e(y)}finally{h.f()}return i}),fD.apply(this,arguments)}function Fie(e,t){let r=e.shift();if(r instanceof Error)throw r;return r===void 0?t:r}function Lie(e){na._injected=(na._injected||[]).concat(e)}function Uie(e){na._override=Object.assign({},e)}U6.exports=Object.assign(na,{prompt:na,prompts:mD,inject:Lie,override:Uie})});var V6=P((P0e,B6)=>{"use strict";B6.exports=(e,t)=>{if(!(e.meta&&e.name!=="escape")){if(e.ctrl){if(e.name==="a")return"first";if(e.name==="c"||e.name==="d")return"abort";if(e.name==="e")return"last";if(e.name==="g")return"reset"}if(t){if(e.name==="j")return"down";if(e.name==="k")return"up"}return e.name==="return"||e.name==="enter"?"submit":e.name==="backspace"?"delete":e.name==="delete"?"deleteForward":e.name==="abort"?"abort":e.name==="escape"?"exit":e.name==="tab"?"next":e.name==="pagedown"?"nextPage":e.name==="pageup"?"prevPage":e.name==="home"?"home":e.name==="end"?"end":e.name==="up"?"up":e.name==="down"?"down":e.name==="right"?"right":e.name==="left"?"left":!1}}});var my=P((R0e,G6)=>{"use strict";G6.exports=e=>{let t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),r=new RegExp(t,"g");return typeof e=="string"?e.replace(r,""):e}});var Z6=P((O0e,K6)=>{"use strict";var zie=my(),{erase:W6,cursor:Bie}=Ke(),Vie=e=>[...zie(e)].length;K6.exports=function(e,t){if(!t)return W6.line+Bie.to(0);let r=0,i=e.split(/\r?\n/);for(let n of i)r+=1+Math.floor(Math.max(Vie(n)-1,0)/t);return W6.lines(r)}});var hD=P(($0e,q6)=>{"use strict";var Ld={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},Gie={arrowUp:Ld.arrowUp,arrowDown:Ld.arrowDown,arrowLeft:Ld.arrowLeft,arrowRight:Ld.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},Wie=process.platform==="win32"?Gie:Ld;q6.exports=Wie});var J6=P((j0e,H6)=>{"use strict";var Mc=We(),Ao=hD(),gD=Object.freeze({password:{scale:1,render:e=>"*".repeat(e.length)},emoji:{scale:2,render:e=>"\u{1F603}".repeat(e.length)},invisible:{scale:0,render:e=>""},default:{scale:1,render:e=>`${e}`}}),Kie=e=>gD[e]||gD.default,Ud=Object.freeze({aborted:Mc.red(Ao.cross),done:Mc.green(Ao.tick),exited:Mc.yellow(Ao.cross),default:Mc.cyan("?")}),Zie=(e,t,r)=>t?Ud.aborted:r?Ud.exited:e?Ud.done:Ud.default,qie=e=>Mc.gray(e?Ao.ellipsis:Ao.pointerSmall),Hie=(e,t)=>Mc.gray(e?t?Ao.pointerSmall:"+":Ao.line);H6.exports={styles:gD,render:Kie,symbols:Ud,symbol:Zie,delimiter:qie,item:Hie}});var Y6=P((M0e,X6)=>{"use strict";var Jie=my();X6.exports=function(e,t){let r=String(Jie(e)||"").split(/\r?\n/);return t?r.map(i=>Math.ceil(i.length/t)).reduce((i,n)=>i+n):r.length}});var eV=P((F0e,Q6)=>{"use strict";Q6.exports=(e,t={})=>{let r=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(e||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((a,o)=>(o.length+r.length>=i||a[a.length-1].length+o.length+1<i?a[a.length-1]+=` ${o}`:a.push(`${r}${o}`),a),[r]).join(`
|
|
154
154
|
`)).join(`
|
|
155
|
-
`)}});var rV=P((
|
|
155
|
+
`)}});var rV=P((L0e,tV)=>{"use strict";tV.exports=(e,t,r)=>{r=r||t;let i=Math.min(t-r,e-Math.floor(r/2));i<0&&(i=0);let n=Math.min(i+r,t);return{startIndex:i,endIndex:n}}});var tn=P((U0e,nV)=>{"use strict";nV.exports={action:V6(),clear:Z6(),style:J6(),strip:my(),figures:hD(),lines:Y6(),wrap:eV(),entriesToDisplay:rV()}});var bi=P((z0e,aV)=>{"use strict";var iV=Io("readline"),{action:Xie}=tn(),Yie=Io("events"),{beep:Qie,cursor:eae}=Ke(),tae=We(),yD=class extends Yie{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);let r=iV.createInterface({input:this.in,escapeCodeTimeout:50});iV.emitKeypressEvents(this.in,r),this.in.isTTY&&this.in.setRawMode(!0);let i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(a,o)=>{let s=Xie(o,i);s===!1?this._&&this._(a,o):typeof this[s]=="function"?this[s](o):this.bell()};this.close=()=>{this.out.write(eae.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),r.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Qie)}render(){this.onRender(tae),this.firstRender&&(this.firstRender=!1)}};aV.exports=yD});var sV=P((B0e,oV)=>{var fy=We(),rae=bi(),{erase:nae,cursor:zd}=Ke(),{style:vD,clear:bD,lines:iae,figures:aae}=tn(),SD=class extends rae{constructor(t={}){super(t),this.transform=vD.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=bD("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=fy.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
|
|
156
156
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
157
157
|
`),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,r){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${t}${n}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),r=this.value.slice(this.cursor);this.value=`${t}${r}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),r=this.value.slice(this.cursor+1);this.value=`${t}${r}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(zd.down(iae(this.outputError,this.out.columns)-1)+bD(this.outputError,this.out.columns)),this.out.write(bD(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[vD.symbol(this.done,this.aborted),fy.bold(this.msg),vD.delimiter(this.done),this.red?fy.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
158
158
|
`).reduce((t,r,i)=>t+`
|
|
159
|
-
${i?" ":aae.pointerSmall} ${fy.red().italic(r)}`,"")),this.out.write(nae.line+zd.to(0)+this.outputText+zd.save+this.outputError+zd.restore+zd.move(this.cursorOffset,0)))}};oV.exports=SD});var dV=P((
|
|
159
|
+
${i?" ":aae.pointerSmall} ${fy.red().italic(r)}`,"")),this.out.write(nae.line+zd.to(0)+this.outputText+zd.save+this.outputError+zd.restore+zd.move(this.cursorOffset,0)))}};oV.exports=SD});var dV=P((V0e,lV)=>{"use strict";var Si=We(),oae=bi(),{style:cV,clear:uV,figures:hy,wrap:sae,entriesToDisplay:cae}=tn(),{cursor:uae}=Ke(),ED=class extends oae{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),value:r&&(r.value===void 0?i:r.value),description:r&&r.description,selected:r&&r.selected,disabled:r&&r.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=uV("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
160
160
|
`),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
161
161
|
`),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,r){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(uae.hide):this.out.write(uV(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:r}=cae(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[cV.symbol(this.done,this.aborted),Si.bold(this.msg),cV.delimiter(!1),this.done?this.selection.title:this.selection.disabled?Si.yellow(this.warn):Si.gray(this.hint)].join(" "),!this.done){this.outputText+=`
|
|
162
162
|
`;for(let i=t;i<r;i++){let n,a,o="",s=this.choices[i];i===t&&t>0?a=hy.arrowUp:i===r-1&&r<this.choices.length?a=hy.arrowDown:a=" ",s.disabled?(n=this.cursor===i?Si.gray().underline(s.title):Si.strikethrough().gray(s.title),a=(this.cursor===i?Si.bold().gray(hy.pointer)+" ":" ")+a):(n=this.cursor===i?Si.cyan().underline(s.title):s.title,a=(this.cursor===i?Si.cyan(hy.pointer)+" ":" ")+a,s.description&&this.cursor===i&&(o=` - ${s.description}`,(a.length+n.length+o.length>=this.out.columns||s.description.split(/\r?\n/).length>1)&&(o=`
|
|
163
163
|
`+sae(s.description,{margin:3,width:this.out.columns})))),this.outputText+=`${a} ${n}${Si.gray(o)}
|
|
164
|
-
`}}this.out.write(this.outputText)}};lV.exports=ED});var hV=P((
|
|
164
|
+
`}}this.out.write(this.outputText)}};lV.exports=ED});var hV=P((G0e,fV)=>{var gy=We(),lae=bi(),{style:pV,clear:dae}=tn(),{cursor:mV,erase:pae}=Ke(),xD=class extends lae{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
165
165
|
`),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
166
|
-
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,r){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(mV.hide):this.out.write(dae(this.outputText,this.out.columns)),super.render(),this.outputText=[pV.symbol(this.done,this.aborted),gy.bold(this.msg),pV.delimiter(this.done),this.value?this.inactive:gy.cyan().underline(this.inactive),gy.gray("/"),this.value?gy.cyan().underline(this.active):this.active].join(" "),this.out.write(pae.line+mV.to(0)+this.outputText))}};fV.exports=xD});var Pn=P((
|
|
166
|
+
`),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,r){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(mV.hide):this.out.write(dae(this.outputText,this.out.columns)),super.render(),this.outputText=[pV.symbol(this.done,this.aborted),gy.bold(this.msg),pV.delimiter(this.done),this.value?this.inactive:gy.cyan().underline(this.inactive),gy.gray("/"),this.value?gy.cyan().underline(this.active):this.active].join(" "),this.out.write(pae.line+mV.to(0)+this.outputText))}};fV.exports=xD});var Pn=P((W0e,gV)=>{"use strict";var AD=class e{constructor({token:t,date:r,parts:i,locales:n}){this.token=t,this.date=r||new Date,this.parts=i||[this],this.locales=n||{}}up(){}down(){}next(){let t=this.parts.indexOf(this);return this.parts.find((r,i)=>i>t&&r instanceof e)}setTo(t){}prev(){let t=[].concat(this.parts).reverse(),r=t.indexOf(this);return t.find((i,n)=>n>r&&i instanceof e)}toString(){return String(this.date)}};gV.exports=AD});var vV=P((K0e,yV)=>{"use strict";var mae=Pn(),_D=class extends mae{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};yV.exports=_D});var SV=P((Z0e,bV)=>{"use strict";var fae=Pn(),hae=e=>(e=e%10,e===1?"st":e===2?"nd":e===3?"rd":"th"),TD=class extends fae{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),r=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+hae(t):this.token==="d"?r+1:this.token==="ddd"?this.locales.weekdaysShort[r]:this.token==="dddd"?this.locales.weekdays[r]:t}};bV.exports=TD});var xV=P((q0e,EV)=>{"use strict";var gae=Pn(),CD=class extends gae{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};EV.exports=CD});var _V=P((H0e,AV)=>{"use strict";var yae=Pn(),ID=class extends yae{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};AV.exports=ID});var CV=P((J0e,TV)=>{"use strict";var vae=Pn(),DD=class extends vae{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};TV.exports=DD});var DV=P((X0e,IV)=>{"use strict";var bae=Pn(),wD=class extends bae{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),r=this.token.length;return r===2?String(t+1).padStart(2,"0"):r===3?this.locales.monthsShort[t]:r===4?this.locales.months[t]:String(t+1)}};IV.exports=wD});var kV=P((Y0e,wV)=>{"use strict";var Sae=Pn(),kD=class extends Sae{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};wV.exports=kD});var PV=P((Q0e,NV)=>{"use strict";var Eae=Pn(),ND=class extends Eae{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};NV.exports=ND});var OV=P((eTe,RV)=>{"use strict";RV.exports={DatePart:Pn(),Meridiem:vV(),Day:SV(),Hours:xV(),Milliseconds:_V(),Minutes:CV(),Month:DV(),Seconds:kV(),Year:PV()}});var zV=P((tTe,UV)=>{"use strict";var PD=We(),xae=bi(),{style:$V,clear:jV,figures:Aae}=tn(),{erase:_ae,cursor:MV}=Ke(),{DatePart:FV,Meridiem:Tae,Day:Cae,Hours:Iae,Milliseconds:Dae,Minutes:wae,Month:kae,Seconds:Nae,Year:Pae}=OV(),Rae=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,LV={1:({token:e})=>e.replace(/\\(.)/g,"$1"),2:e=>new Cae(e),3:e=>new kae(e),4:e=>new Pae(e),5:e=>new Tae(e),6:e=>new Iae(e),7:e=>new wae(e),8:e=>new Nae(e),9:e=>new Dae(e)},Oae={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")},RD=class extends xae{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(Oae,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=jV("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let r;for(this.parts=[];r=Rae.exec(t);){let n=r.shift(),a=r.findIndex(o=>o!=null);this.parts.push(a in LV?LV[a]({token:r[a]||n,date:this.date,parts:this.parts,locales:this.locales}):r[a]||n)}let i=this.parts.reduce((n,a)=>(typeof a=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=a:n.push(a),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof FV)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
167
167
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
168
168
|
`),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(r=>r instanceof FV)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(MV.hide):this.out.write(jV(this.outputText,this.out.columns)),super.render(),this.outputText=[$V.symbol(this.done,this.aborted),PD.bold(this.msg),$V.delimiter(!1),this.parts.reduce((t,r,i)=>t.concat(i===this.cursor&&!this.done?PD.cyan().underline(r.toString()):r),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
|
|
169
169
|
`).reduce((t,r,i)=>t+`
|
|
170
|
-
${i?" ":Aae.pointerSmall} ${PD.red().italic(r)}`,"")),this.out.write(_ae.line+MV.to(0)+this.outputText))}};UV.exports=RD});var WV=P((
|
|
170
|
+
${i?" ":Aae.pointerSmall} ${PD.red().italic(r)}`,"")),this.out.write(_ae.line+MV.to(0)+this.outputText))}};UV.exports=RD});var WV=P((rTe,GV)=>{var yy=We(),$ae=bi(),{cursor:vy,erase:jae}=Ke(),{style:OD,figures:Mae,clear:BV,lines:Fae}=tn(),Lae=/[0-9]/,$D=e=>e!==void 0,VV=(e,t)=>{let r=Math.pow(10,t);return Math.round(e*r)/r},jD=class extends $ae{constructor(t={}){super(t),this.transform=OD.render(t.style),this.msg=t.message,this.initial=$D(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=$D(t.min)?t.min:-1/0,this.max=$D(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=yy.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${VV(t,this.round)}`),this._value=VV(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||Lae.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
171
171
|
`),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let t=this.value;this.value=t!==""?t:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
|
|
172
172
|
`),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,r){if(!this.valid(t))return this.bell();let i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(vy.down(Fae(this.outputError,this.out.columns)-1)+BV(this.outputError,this.out.columns)),this.out.write(BV(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[OD.symbol(this.done,this.aborted),yy.bold(this.msg),OD.delimiter(this.done),!this.done||!this.done&&!this.placeholder?yy[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
|
|
173
173
|
`).reduce((t,r,i)=>t+`
|
|
174
|
-
${i?" ":Mae.pointerSmall} ${yy.red().italic(r)}`,"")),this.out.write(jae.line+vy.to(0)+this.outputText+vy.save+this.outputError+vy.restore))}};GV.exports=jD});var FD=P((
|
|
174
|
+
${i?" ":Mae.pointerSmall} ${yy.red().italic(r)}`,"")),this.out.write(jae.line+vy.to(0)+this.outputText+vy.save+this.outputError+vy.restore))}};GV.exports=jD});var FD=P((nTe,qV)=>{"use strict";var Rn=We(),{cursor:Uae}=Ke(),zae=bi(),{clear:KV,figures:ia,style:ZV,wrap:Bae,entriesToDisplay:Vae}=tn(),MD=class extends zae{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((r,i)=>(typeof r=="string"&&(r={title:r,value:i}),{title:r&&(r.title||r.value||r),description:r&&r.description,value:r&&(r.value===void 0?i:r.value),selected:r&&r.selected,disabled:r&&r.disabled})),this.clear=KV("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
175
175
|
`),this.close()}submit(){let t=this.value.filter(r=>r.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
176
176
|
`),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){let t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();let t=!this.value[this.cursor].selected;this.value.filter(r=>!r.disabled).forEach(r=>r.selected=t),this.render()}_(t,r){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
177
177
|
Instructions:
|
|
@@ -181,13 +181,13 @@ Instructions:
|
|
|
181
181
|
`:"")+" enter/return: Complete answer":""}renderOption(t,r,i,n){let a=(r.selected?Rn.green(ia.radioOn):ia.radioOff)+" "+n+" ",o,s;return r.disabled?o=t===i?Rn.gray().underline(r.title):Rn.strikethrough().gray(r.title):(o=t===i?Rn.cyan().underline(r.title):r.title,t===i&&r.description&&(s=` - ${r.description}`,(a.length+o.length+s.length>=this.out.columns||r.description.split(/\r?\n/).length>1)&&(s=`
|
|
182
182
|
`+Bae(r.description,{margin:a.length,width:this.out.columns})))),a+o+Rn.gray(s||"")}paginateOptions(t){if(t.length===0)return Rn.red("No matches for this query.");let{startIndex:r,endIndex:i}=Vae(this.cursor,t.length,this.optionsPerPage),n,a=[];for(let o=r;o<i;o++)o===r&&r>0?n=ia.arrowUp:o===i-1&&i<t.length?n=ia.arrowDown:n=" ",a.push(this.renderOption(this.cursor,t[o],o,n));return`
|
|
183
183
|
`+a.join(`
|
|
184
|
-
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let t=[Rn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(Rn.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Uae.hide),super.render();let t=[ZV.symbol(this.done,this.aborted),Rn.bold(this.msg),ZV.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=Rn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=KV(t,this.out.columns)}};qV.exports=MD});var QV=P((
|
|
184
|
+
`)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let t=[Rn.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(Rn.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Uae.hide),super.render();let t=[ZV.symbol(this.done,this.aborted),Rn.bold(this.msg),ZV.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=Rn.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=KV(t,this.out.columns)}};qV.exports=MD});var QV=P((iTe,YV)=>{"use strict";var Bd=We(),Gae=bi(),{erase:Wae,cursor:HV}=Ke(),{style:LD,clear:JV,figures:UD,wrap:Kae,entriesToDisplay:Zae}=tn(),XV=(e,t)=>e[t]&&(e[t].value||e[t].title||e[t]),qae=(e,t)=>e[t]&&(e[t].title||e[t].value||e[t]),Hae=(e,t)=>{let r=e.findIndex(i=>i.value===t||i.title===t);return r>-1?r:void 0},zD=class extends Gae{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:Hae(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=LD.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=JV("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=XV(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){let r=this.completing=this.suggest(this.input,this.choices),i=await r;if(this.completing!==r)return;this.suggestions=i.map((a,o,s)=>({title:qae(s,o),value:XV(s,o),description:a.description})),this.completing=!1;let n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),t&&t()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
185
185
|
`),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
186
186
|
`),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
|
|
187
187
|
`),this.close()}_(t,r){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${t}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),r=this.input.slice(this.cursor);this.input=`${t}${r}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),r=this.input.slice(this.cursor+1);this.input=`${t}${r}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,r,i,n){let a,o=i?UD.arrowUp:n?UD.arrowDown:" ",s=r?Bd.cyan().underline(t.title):t.title;return o=(r?Bd.cyan(UD.pointer)+" ":" ")+o,t.description&&(a=` - ${t.description}`,(o.length+s.length+a.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(a=`
|
|
188
188
|
`+Kae(t.description,{margin:3,width:this.out.columns}))),o+" "+s+Bd.gray(a||"")}render(){if(this.closed)return;this.firstRender?this.out.write(HV.hide):this.out.write(JV(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:r}=Zae(this.select,this.choices.length,this.limit);if(this.outputText=[LD.symbol(this.done,this.aborted,this.exited),Bd.bold(this.msg),LD.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){let i=this.suggestions.slice(t,r).map((n,a)=>this.renderOption(n,this.select===a+t,a===0&&t>0,a+t===r-1&&r<this.choices.length)).join(`
|
|
189
189
|
`);this.outputText+=`
|
|
190
|
-
`+(i||Bd.gray(this.fallback.title))}this.out.write(Wae.line+HV.to(0)+this.outputText)}};YV.exports=zD});var nG=P((
|
|
190
|
+
`+(i||Bd.gray(this.fallback.title))}this.out.write(Wae.line+HV.to(0)+this.outputText)}};YV.exports=zD});var nG=P((aTe,rG)=>{"use strict";var Ei=We(),{cursor:Jae}=Ke(),Xae=FD(),{clear:eG,style:tG,figures:Fc}=tn(),BD=class extends Xae{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=eG("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){let t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);let r=this.filteredOptions.findIndex(i=>i===t);this.cursor=r<0?0:r,this.render()}handleSpaceToggle(){let t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(r=>r.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,r){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
|
|
191
191
|
Instructions:
|
|
192
192
|
${Fc.arrowUp}/${Fc.arrowDown}: Highlight option
|
|
193
193
|
${Fc.arrowLeft}/${Fc.arrowRight}/[space]: Toggle selection
|
|
@@ -195,9 +195,9 @@ Instructions:
|
|
|
195
195
|
enter/return: Complete answer
|
|
196
196
|
`:""}renderCurrentInput(){return`
|
|
197
197
|
Filtered results for: ${this.inputValue?this.inputValue:Ei.gray("Enter something to filter")}
|
|
198
|
-
`}renderOption(t,r,i){let n;return r.disabled?n=t===i?Ei.gray().underline(r.title):Ei.strikethrough().gray(r.title):n=t===i?Ei.cyan().underline(r.title):r.title,(r.selected?Ei.green(Fc.radioOn):Fc.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let t=[Ei.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(Ei.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Jae.hide),super.render();let t=[tG.symbol(this.done,this.aborted),Ei.bold(this.msg),tG.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=Ei.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=eG(t,this.out.columns)}};rG.exports=BD});var cG=P((
|
|
198
|
+
`}renderOption(t,r,i){let n;return r.disabled?n=t===i?Ei.gray().underline(r.title):Ei.strikethrough().gray(r.title):n=t===i?Ei.cyan().underline(r.title):r.title,(r.selected?Ei.green(Fc.radioOn):Fc.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(r=>r.selected).map(r=>r.title).join(", ");let t=[Ei.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(Ei.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Jae.hide),super.render();let t=[tG.symbol(this.done,this.aborted),Ei.bold(this.msg),tG.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=Ei.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=eG(t,this.out.columns)}};rG.exports=BD});var cG=P((oTe,sG)=>{var iG=We(),Yae=bi(),{style:aG,clear:Qae}=tn(),{erase:eoe,cursor:oG}=Ke(),VD=class extends Yae{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
199
199
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
200
|
-
`),this.close()}_(t,r){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(oG.hide):this.out.write(Qae(this.outputText,this.out.columns)),super.render(),this.outputText=[aG.symbol(this.done,this.aborted),iG.bold(this.msg),aG.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:iG.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(eoe.line+oG.to(0)+this.outputText))}};sG.exports=VD});var lG=P((oTe,uG)=>{"use strict";uG.exports={TextPrompt:sV(),SelectPrompt:dV(),TogglePrompt:hV(),DatePrompt:zV(),NumberPrompt:WV(),MultiselectPrompt:FD(),AutocompletePrompt:QV(),AutocompleteMultiselectPrompt:nG(),ConfirmPrompt:cG()}});var pG=P(dG=>{"use strict";var Jt=dG,toe=lG(),by=e=>e;function On(e,t,r={}){return new Promise((i,n)=>{let a=new toe[e](t),o=r.onAbort||by,s=r.onSubmit||by,u=r.onExit||by;a.on("state",t.onState||by),a.on("submit",d=>i(s(d))),a.on("exit",d=>i(u(d))),a.on("abort",d=>n(o(d)))})}Jt.text=e=>On("TextPrompt",e);Jt.password=e=>(e.style="password",Jt.text(e));Jt.invisible=e=>(e.style="invisible",Jt.text(e));Jt.number=e=>On("NumberPrompt",e);Jt.date=e=>On("DatePrompt",e);Jt.confirm=e=>On("ConfirmPrompt",e);Jt.list=e=>{let t=e.separator||",";return On("TextPrompt",e,{onSubmit:r=>r.split(t).map(i=>i.trim())})};Jt.toggle=e=>On("TogglePrompt",e);Jt.select=e=>On("SelectPrompt",e);Jt.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(i=>i.selected).map(i=>i.value);return On("MultiselectPrompt",e,{onAbort:t,onSubmit:t})};Jt.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(i=>i.selected).map(i=>i.value);return On("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var roe=(e,t)=>Promise.resolve(t.filter(r=>r.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Jt.autocomplete=e=>(e.suggest=e.suggest||roe,e.choices=[].concat(e.choices||[]),On("AutocompletePrompt",e))});var hG=P((cTe,fG)=>{"use strict";var GD=pG(),noe=["suggest","format","onState","validate","onRender","type"],mG=()=>{};async function aa(e=[],{onSubmit:t=mG,onCancel:r=mG}={}){let i={},n=aa._override||{};e=[].concat(e);let a,o,s,u,d,p,g=async(h,l,m=!1)=>{if(!(!m&&h.validate&&h.validate(l)!==!0))return h.format?await h.format(l,i):l};for(o of e)if({name:u,type:d}=o,typeof d=="function"&&(d=await d(a,{...i},o),o.type=d),!!d){for(let h in o){if(noe.includes(h))continue;let l=o[h];o[h]=typeof l=="function"?await l(a,{...i},p):l}if(p=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:u,type:d}=o,GD[d]===void 0)throw new Error(`prompt type (${d}) is not defined`);if(n[o.name]!==void 0&&(a=await g(o,n[o.name]),a!==void 0)){i[u]=a;continue}try{a=aa._injected?ioe(aa._injected,o.initial):await GD[d](o),i[u]=a=await g(o,a,!0),s=await t(o,a,i)}catch{s=!await r(o,i)}if(s)return i}return i}function ioe(e,t){let r=e.shift();if(r instanceof Error)throw r;return r===void 0?t:r}function aoe(e){aa._injected=(aa._injected||[]).concat(e)}function ooe(e){aa._override=Object.assign({},e)}fG.exports=Object.assign(aa,{prompt:aa,prompts:GD,inject:aoe,override:ooe})});var WD=P((uTe,gG)=>{function soe(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,r=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(r[t]>e[t])return!1;if(e[t]>r[t])return!0}return!1}gG.exports=soe("8.6.0")?z6():hG()});import*as Oc from"fs";import*as $2 from"path";var IG=Object.defineProperty,Ai=(e,t)=>IG(e,"name",{value:t,configurable:!0});function Qe(e){return e.replace(/[-_](.)/g,(t,r)=>r.toUpperCase()).replace(/^./,t=>t.toUpperCase())}Ai(Qe,"toPascalCase");function hr(e){return e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z\d])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}Ai(hr,"toKebab");function Do(e){return hr(e).replace(/-/g,"_")}Ai(Do,"toValidDatabaseName");function XD(e){return hr(e).replace(/-/g,"_").toUpperCase()}Ai(XD,"toScreamingSnake");function YD(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}Ai(YD,"capitalise");function QD(e){return e.split(".").join("")}Ai(QD,"getSafeZoneName");function la(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}Ai(la,"accountConstructKey");function ew(e){let t=e.replace(new RegExp("\\P{ASCII}","gu"),"");return la(t)===la(e)&&la(e)!==""}Ai(ew,"hasAsciiStableConstructKey");var DG=Object.defineProperty,wo=(e,t)=>DG(e,"name",{value:t,configurable:!0});function ko(e){return`${Qe(e.split(".").join(""))}Domain`}wo(ko,"getDomainStackName");function tw(e){return`${e}UsEast1Certificates`}wo(tw,"getDomainUsEast1CertificatesStackName");function wy(e){let t=e.replace(/\./g,"-");return{hostedZoneId:`${t}-hosted-zone-id`,certificateArn:`${t}-certificate-arn`,certificateHosts:`${t}-certificate-hosts`,usEast1CertificateArn:`${t}-us-east-1-certificate-arn`,usEast1CertificateHosts:`${t}-us-east-1-certificate-hosts`,delegationRoleArn:`${t}-delegation-role-arn`,nameservers:`${t}-nameservers`}}wo(wy,"getDomainExportNames");var rw=1e3;function nw(e){let t=[],r=[];for(let i of e){let n=[...r,i];r.length>0&&Buffer.byteLength(JSON.stringify(n),"utf8")>rw?(t.push(r),r=[i]):r=n}return r.length>0&&t.push(r),t.map(i=>JSON.stringify(i))}wo(nw,"serialiseHostsChunks");function iw(e,t){return`${e}-${t}`}wo(iw,"hostsExportPartName");function aw(e){return typeof e.hostedZoneId=="string"}wo(aw,"isManagedDomainBinding");var wG=Object.defineProperty,kG=(e,t)=>wG(e,"name",{value:t,configurable:!0});function ow(e){return`${Qe(e)}ImageTag`}kG(ow,"imageTagParameterName");var NG=Object.defineProperty,Un=(e,t)=>NG(e,"name",{value:t,configurable:!0});function da(e){return Qe(e.replace(/[^A-Za-z0-9-]/g,""))}Un(da,"safeExportToken");function ky(e,t){let r=da(e);return t===void 0?r:`${r}-${da(t)}-`}Un(ky,"albExportScope");function sw(e,t){return`${ky(e,t)}AlbDnsName`}Un(sw,"albDnsExportName");function cw(e,t){return`${ky(e,t)}AlbHostedZoneId`}Un(cw,"albHostedZoneIdExportName");function uw(e,t){let r=da(e);return t===void 0?r:`${r}-${da(t)}-`}Un(uw,"cdnExportScope");function lw(e,t){return`${uw(e,t)}CdnDistributionDomainName`}Un(lw,"cdnDomainExportName");function Ny(e,t){return`${da(e)}-${da(t)}-`}Un(Ny,"bucketExportScope");function dw(e,t){return`${Ny(e,t)}WebsiteEndpoint`}Un(dw,"bucketWebsiteEndpointExportName");function pw(e,t){return`${Ny(e,t)}WebsiteHostedZoneId`}Un(pw,"bucketWebsiteHostedZoneIdExportName");var c={};Ur(c,{$brand:()=>Ry,$input:()=>eS,$output:()=>Qb,NEVER:()=>Py,TimePrecision:()=>iS,ZodAny:()=>ZE,ZodArray:()=>XE,ZodBase64:()=>Cm,ZodBase64URL:()=>Im,ZodBigInt:()=>ss,ZodBigIntFormat:()=>km,ZodBoolean:()=>os,ZodCIDRv4:()=>_m,ZodCIDRv6:()=>Tm,ZodCUID:()=>ym,ZodCUID2:()=>vm,ZodCatch:()=>bx,ZodCodec:()=>vu,ZodCustom:()=>bu,ZodCustomStringFormat:()=>is,ZodDate:()=>mu,ZodDefault:()=>mx,ZodDiscriminatedUnion:()=>QE,ZodE164:()=>Dm,ZodEmail:()=>fm,ZodEmoji:()=>hm,ZodEnum:()=>rs,ZodError:()=>cK,ZodExactOptional:()=>lx,ZodFile:()=>cx,ZodFirstPartyTypeKind:()=>Px,ZodFunction:()=>wx,ZodGUID:()=>cu,ZodIPv4:()=>xm,ZodIPv6:()=>Am,ZodISODate:()=>cm,ZodISODateTime:()=>sm,ZodISODuration:()=>lm,ZodISOTime:()=>um,ZodIntersection:()=>ex,ZodIssueCode:()=>lK,ZodJWT:()=>wm,ZodKSUID:()=>Em,ZodLazy:()=>Cx,ZodLiteral:()=>sx,ZodMAC:()=>UE,ZodMap:()=>ax,ZodNaN:()=>Ex,ZodNanoID:()=>gm,ZodNever:()=>HE,ZodNonOptional:()=>jm,ZodNull:()=>WE,ZodNullable:()=>px,ZodNumber:()=>as,ZodNumberFormat:()=>Sa,ZodObject:()=>hu,ZodOptional:()=>$m,ZodPipe:()=>yu,ZodPrefault:()=>hx,ZodPreprocess:()=>xx,ZodPromise:()=>Dx,ZodReadonly:()=>Ax,ZodRealError:()=>Lt,ZodRecord:()=>ts,ZodSet:()=>ox,ZodString:()=>ns,ZodStringFormat:()=>Ie,ZodSuccess:()=>vx,ZodSymbol:()=>VE,ZodTemplateLiteral:()=>Tx,ZodTransform:()=>ux,ZodTuple:()=>rx,ZodType:()=>re,ZodULID:()=>bm,ZodURL:()=>pu,ZodUUID:()=>on,ZodUndefined:()=>GE,ZodUnion:()=>gu,ZodUnknown:()=>qE,ZodVoid:()=>JE,ZodXID:()=>Sm,ZodXor:()=>YE,_ZodString:()=>mm,_default:()=>fx,_function:()=>eP,any:()=>NN,array:()=>fu,base64:()=>fN,base64url:()=>hN,bigint:()=>CN,boolean:()=>BE,catch:()=>Sx,check:()=>tP,cidrv4:()=>pN,cidrv6:()=>mN,clone:()=>Ct,codec:()=>JN,coerce:()=>Rx,config:()=>Ze,core:()=>Vn,cuid:()=>iN,cuid2:()=>aN,custom:()=>rP,date:()=>RN,decode:()=>RE,decodeAsync:()=>$E,describe:()=>nP,discriminatedUnion:()=>LN,e164:()=>gN,email:()=>qk,emoji:()=>rN,encode:()=>PE,encodeAsync:()=>OE,endsWith:()=>Wo,enum:()=>Rm,exactOptional:()=>dx,file:()=>KN,flattenError:()=>qc,float32:()=>xN,float64:()=>AN,formatError:()=>Hc,fromJSONSchema:()=>lP,function:()=>eP,getErrorMap:()=>pK,globalRegistry:()=>mt,gt:()=>nn,gte:()=>Dt,guid:()=>Hk,hash:()=>EN,hex:()=>SN,hostname:()=>bN,httpUrl:()=>tN,includes:()=>Vo,instanceof:()=>aP,int:()=>dm,int32:()=>_N,int64:()=>IN,intersection:()=>tx,invertCodec:()=>XN,ipv4:()=>uN,ipv6:()=>dN,iso:()=>es,json:()=>sP,jwt:()=>yN,keyof:()=>ON,ksuid:()=>cN,lazy:()=>Ix,length:()=>va,literal:()=>WN,locales:()=>nu,looseObject:()=>MN,looseRecord:()=>zN,lowercase:()=>zo,lt:()=>rn,lte:()=>Qt,mac:()=>lN,map:()=>BN,maxLength:()=>ya,maxSize:()=>ki,meta:()=>iP,mime:()=>Ko,minLength:()=>Bn,minSize:()=>an,multipleOf:()=>wi,nan:()=>HN,nanoid:()=>nN,nativeEnum:()=>GN,negative:()=>Xp,never:()=>Nm,nonnegative:()=>Qp,nonoptional:()=>yx,nonpositive:()=>Yp,normalize:()=>Zo,null:()=>KE,nullable:()=>lu,nullish:()=>ZN,number:()=>zE,object:()=>$N,optional:()=>uu,overwrite:()=>Br,parse:()=>DE,parseAsync:()=>wE,partialRecord:()=>UN,pipe:()=>pm,positive:()=>Jp,prefault:()=>gx,preprocess:()=>cP,prettifyError:()=>Ky,promise:()=>QN,property:()=>em,readonly:()=>_x,record:()=>ix,refine:()=>kx,regex:()=>Uo,regexes:()=>Yt,registry:()=>wp,safeDecode:()=>ME,safeDecodeAsync:()=>LE,safeEncode:()=>jE,safeEncodeAsync:()=>FE,safeParse:()=>kE,safeParseAsync:()=>NE,set:()=>VN,setErrorMap:()=>dK,size:()=>ga,slugify:()=>Xo,startsWith:()=>Go,strictObject:()=>jN,string:()=>su,stringFormat:()=>vN,stringbool:()=>oP,success:()=>qN,superRefine:()=>Nx,symbol:()=>wN,templateLiteral:()=>YN,toJSONSchema:()=>im,toLowerCase:()=>Ho,toUpperCase:()=>Jo,transform:()=>Om,treeifyError:()=>Wy,trim:()=>qo,tuple:()=>nx,uint32:()=>TN,uint64:()=>DN,ulid:()=>oN,undefined:()=>kN,union:()=>Pm,unknown:()=>ba,uppercase:()=>Bo,url:()=>eN,util:()=>M,uuid:()=>Jk,uuidv4:()=>Xk,uuidv6:()=>Yk,uuidv7:()=>Qk,void:()=>PN,xid:()=>sN,xor:()=>FN});var Vn={};Ur(Vn,{$ZodAny:()=>Eb,$ZodArray:()=>Cb,$ZodAsyncError:()=>zr,$ZodBase64:()=>db,$ZodBase64URL:()=>pb,$ZodBigInt:()=>Ep,$ZodBigIntFormat:()=>yb,$ZodBoolean:()=>Qc,$ZodCIDRv4:()=>cb,$ZodCIDRv6:()=>ub,$ZodCUID:()=>Jv,$ZodCUID2:()=>Xv,$ZodCatch:()=>Gb,$ZodCheck:()=>we,$ZodCheckBigIntFormat:()=>Cv,$ZodCheckEndsWith:()=>Fv,$ZodCheckGreaterThan:()=>hp,$ZodCheckIncludes:()=>jv,$ZodCheckLengthEquals:()=>Pv,$ZodCheckLessThan:()=>fp,$ZodCheckLowerCase:()=>Ov,$ZodCheckMaxLength:()=>kv,$ZodCheckMaxSize:()=>Iv,$ZodCheckMimeType:()=>Uv,$ZodCheckMinLength:()=>Nv,$ZodCheckMinSize:()=>Dv,$ZodCheckMultipleOf:()=>_v,$ZodCheckNumberFormat:()=>Tv,$ZodCheckOverwrite:()=>zv,$ZodCheckProperty:()=>Lv,$ZodCheckRegex:()=>Rv,$ZodCheckSizeEquals:()=>wv,$ZodCheckStartsWith:()=>Mv,$ZodCheckStringFormat:()=>Fo,$ZodCheckUpperCase:()=>$v,$ZodCodec:()=>tu,$ZodCustom:()=>Yb,$ZodCustomStringFormat:()=>hb,$ZodDate:()=>Tb,$ZodDefault:()=>Ub,$ZodDiscriminatedUnion:()=>wb,$ZodE164:()=>mb,$ZodEmail:()=>Kv,$ZodEmoji:()=>qv,$ZodEncodeError:()=>_i,$ZodEnum:()=>Ob,$ZodError:()=>Zc,$ZodExactOptional:()=>Fb,$ZodFile:()=>jb,$ZodFunction:()=>Hb,$ZodGUID:()=>Gv,$ZodIPv4:()=>ab,$ZodIPv6:()=>ob,$ZodISODate:()=>rb,$ZodISODateTime:()=>tb,$ZodISODuration:()=>ib,$ZodISOTime:()=>nb,$ZodIntersection:()=>kb,$ZodJWT:()=>fb,$ZodKSUID:()=>eb,$ZodLazy:()=>Xb,$ZodLiteral:()=>$b,$ZodMAC:()=>sb,$ZodMap:()=>Pb,$ZodNaN:()=>Wb,$ZodNanoID:()=>Hv,$ZodNever:()=>Ab,$ZodNonOptional:()=>Bb,$ZodNull:()=>Sb,$ZodNullable:()=>Lb,$ZodNumber:()=>Sp,$ZodNumberFormat:()=>gb,$ZodObject:()=>Vw,$ZodObjectJIT:()=>Ib,$ZodOptional:()=>Ap,$ZodPipe:()=>_p,$ZodPrefault:()=>zb,$ZodPreprocess:()=>Kb,$ZodPromise:()=>Jb,$ZodReadonly:()=>Zb,$ZodRealError:()=>Ft,$ZodRecord:()=>Nb,$ZodRegistry:()=>Dp,$ZodSet:()=>Rb,$ZodString:()=>ha,$ZodStringFormat:()=>Ce,$ZodSuccess:()=>Vb,$ZodSymbol:()=>vb,$ZodTemplateLiteral:()=>qb,$ZodTransform:()=>Mb,$ZodTuple:()=>xp,$ZodType:()=>ee,$ZodULID:()=>Yv,$ZodURL:()=>Zv,$ZodUUID:()=>Wv,$ZodUndefined:()=>bb,$ZodUnion:()=>eu,$ZodUnknown:()=>xb,$ZodVoid:()=>_b,$ZodXID:()=>Qv,$ZodXor:()=>Db,$brand:()=>Ry,$constructor:()=>T,$input:()=>eS,$output:()=>Qb,Doc:()=>Yc,JSONSchema:()=>Wk,JSONSchemaGenerator:()=>am,NEVER:()=>Py,TimePrecision:()=>iS,_any:()=>TS,_array:()=>PS,_base64:()=>Kp,_base64url:()=>Zp,_bigint:()=>vS,_boolean:()=>gS,_catch:()=>eK,_check:()=>Gk,_cidrv4:()=>Gp,_cidrv6:()=>Wp,_coercedBigint:()=>bS,_coercedBoolean:()=>yS,_coercedDate:()=>kS,_coercedNumber:()=>lS,_coercedString:()=>rS,_cuid:()=>Mp,_cuid2:()=>Fp,_custom:()=>OS,_date:()=>wS,_decode:()=>ap,_decodeAsync:()=>sp,_default:()=>XW,_discriminatedUnion:()=>LW,_e164:()=>qp,_email:()=>kp,_emoji:()=>$p,_encode:()=>ip,_encodeAsync:()=>op,_endsWith:()=>Wo,_enum:()=>WW,_file:()=>RS,_float32:()=>pS,_float64:()=>mS,_gt:()=>nn,_gte:()=>Dt,_guid:()=>iu,_includes:()=>Vo,_int:()=>dS,_int32:()=>fS,_int64:()=>SS,_intersection:()=>UW,_ipv4:()=>Bp,_ipv6:()=>Vp,_isoDate:()=>oS,_isoDateTime:()=>aS,_isoDuration:()=>cS,_isoTime:()=>sS,_jwt:()=>Hp,_ksuid:()=>zp,_lazy:()=>iK,_length:()=>va,_literal:()=>ZW,_lowercase:()=>zo,_lt:()=>rn,_lte:()=>Qt,_mac:()=>nS,_map:()=>VW,_max:()=>Qt,_maxLength:()=>ya,_maxSize:()=>ki,_mime:()=>Ko,_min:()=>Dt,_minLength:()=>Bn,_minSize:()=>an,_multipleOf:()=>wi,_nan:()=>NS,_nanoid:()=>jp,_nativeEnum:()=>KW,_negative:()=>Xp,_never:()=>IS,_nonnegative:()=>Qp,_nonoptional:()=>YW,_nonpositive:()=>Yp,_normalize:()=>Zo,_null:()=>_S,_nullable:()=>JW,_number:()=>uS,_optional:()=>HW,_overwrite:()=>Br,_parse:()=>Oo,_parseAsync:()=>$o,_pipe:()=>tK,_positive:()=>Jp,_promise:()=>aK,_property:()=>em,_readonly:()=>rK,_record:()=>BW,_refine:()=>$S,_regex:()=>Uo,_safeDecode:()=>up,_safeDecodeAsync:()=>dp,_safeEncode:()=>cp,_safeEncodeAsync:()=>lp,_safeParse:()=>jo,_safeParseAsync:()=>Mo,_set:()=>GW,_size:()=>ga,_slugify:()=>Xo,_startsWith:()=>Go,_string:()=>tS,_stringFormat:()=>Yo,_stringbool:()=>LS,_success:()=>QW,_superRefine:()=>jS,_symbol:()=>xS,_templateLiteral:()=>nK,_toLowerCase:()=>Ho,_toUpperCase:()=>Jo,_transform:()=>qW,_trim:()=>qo,_tuple:()=>zW,_uint32:()=>hS,_uint64:()=>ES,_ulid:()=>Lp,_undefined:()=>AS,_union:()=>MW,_unknown:()=>CS,_uppercase:()=>Bo,_url:()=>au,_uuid:()=>Np,_uuidv4:()=>Pp,_uuidv6:()=>Rp,_uuidv7:()=>Op,_void:()=>DS,_xid:()=>Up,_xor:()=>FW,clone:()=>Ct,config:()=>Ze,createStandardJSONSchemaMethod:()=>Qo,createToJSONSchemaMethod:()=>US,decode:()=>a3,decodeAsync:()=>s3,describe:()=>MS,encode:()=>i3,encodeAsync:()=>o3,extractDefs:()=>Pi,finalize:()=>Ri,flattenError:()=>qc,formatError:()=>Hc,globalConfig:()=>pa,globalRegistry:()=>mt,initializeContext:()=>Ni,isValidBase64:()=>lb,isValidBase64URL:()=>Lw,isValidJWT:()=>Uw,locales:()=>nu,meta:()=>FS,parse:()=>rp,parseAsync:()=>np,prettifyError:()=>Ky,process:()=>Ee,regexes:()=>Yt,registry:()=>wp,safeDecode:()=>u3,safeDecodeAsync:()=>d3,safeEncode:()=>c3,safeEncodeAsync:()=>l3,safeParse:()=>Zy,safeParseAsync:()=>qy,toDotPath:()=>vw,toJSONSchema:()=>im,treeifyError:()=>Wy,util:()=>M,version:()=>Bv});var mw,Py=Object.freeze({status:"aborted"});function T(e,t,r){function i(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let d=o.prototype,p=Object.keys(d);for(let g=0;g<p.length;g++){let h=p[g];h in s||(s[h]=d[h].bind(s))}}let n=r?.Parent??Object;class a extends n{}Object.defineProperty(a,"name",{value:e});function o(s){var u;let d=r?.Parent?new a:this;i(d,s),(u=d._zod).deferred??(u.deferred=[]);for(let p of d._zod.deferred)p();return d}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Ry=Symbol("zod_brand"),zr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},_i=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(mw=globalThis).__zod_globalConfig??(mw.__zod_globalConfig={});var pa=globalThis.__zod_globalConfig;function Ze(e){return e&&Object.assign(pa,e),pa}var M={};Ur(M,{BIGINT_FORMAT_RANGES:()=>Vy,Class:()=>$y,NUMBER_FORMAT_RANGES:()=>By,aborted:()=>Di,allowsEval:()=>Fy,assert:()=>jG,assertEqual:()=>PG,assertIs:()=>OG,assertNever:()=>$G,assertNotEqual:()=>RG,assignProp:()=>Ci,base64ToUint8Array:()=>hw,base64urlToUint8Array:()=>QG,cached:()=>Po,captureStackTrace:()=>tp,cleanEnum:()=>YG,cleanRegex:()=>Vc,clone:()=>Ct,cloneDef:()=>FG,createTransparentProxy:()=>GG,defineLazy:()=>ce,esc:()=>ep,escapeRegex:()=>gr,explicitlyAborted:()=>Gy,extend:()=>ZG,finalizeIssue:()=>It,floatSafeRemainder:()=>jy,getElementAtPath:()=>LG,getEnumValues:()=>Bc,getLengthableOrigin:()=>Kc,getParsedType:()=>VG,getSizableOrigin:()=>Wc,hexToUint8Array:()=>t3,isObject:()=>ma,isPlainObject:()=>Ii,issue:()=>Ro,joinValues:()=>D,jsonStringifyReplacer:()=>No,merge:()=>HG,mergeDefs:()=>zn,normalizeParams:()=>L,nullish:()=>Ti,numKeys:()=>BG,objectClone:()=>MG,omit:()=>KG,optionalKeys:()=>zy,parsedType:()=>j,partial:()=>JG,pick:()=>WG,prefixIssues:()=>Mt,primitiveTypes:()=>Uy,promiseAllObject:()=>UG,propertyKeyTypes:()=>Gc,randomString:()=>zG,required:()=>XG,safeExtend:()=>qG,shallowClone:()=>Ly,slugify:()=>My,stringifyPrimitive:()=>O,uint8ArrayToBase64:()=>gw,uint8ArrayToBase64url:()=>e3,uint8ArrayToHex:()=>r3,unwrapMessage:()=>zc});function PG(e){return e}function RG(e){return e}function OG(e){}function $G(e){throw new Error("Unexpected value in exhaustive check")}function jG(e){}function Bc(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function D(e,t="|"){return e.map(r=>O(r)).join(t)}function No(e,t){return typeof t=="bigint"?t.toString():t}function Po(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ti(e){return e==null}function Vc(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function jy(e,t){let r=e/t,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}var fw=Symbol("evaluating");function ce(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==fw)return i===void 0&&(i=fw,i=r()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function MG(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ci(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function zn(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function FG(e){return zn(e._zod.def)}function LG(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}function UG(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let n={};for(let a=0;a<t.length;a++)n[t[a]]=i[a];return n})}function zG(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function ep(e){return JSON.stringify(e)}function My(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var tp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ma(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Fy=Po(()=>{if(pa.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ii(e){if(ma(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ma(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ly(e){return Ii(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function BG(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var VG=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Gc=new Set(["string","number","symbol"]),Uy=new Set(["string","number","bigint","boolean","symbol","undefined"]);function gr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ct(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function L(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function GG(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,a){return t??(t=e()),Reflect.set(t,i,n,a)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function O(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function zy(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var By={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Vy={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function WG(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=zn(e._zod.def,{get shape(){let o={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=r.shape[s])}return Ci(this,"shape",o),o},checks:[]});return Ct(e,a)}function KG(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=zn(e._zod.def,{get shape(){let o={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete o[s]}return Ci(this,"shape",o),o},checks:[]});return Ct(e,a)}function ZG(e,t){if(!Ii(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let a=e._zod.def.shape;for(let o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=zn(e._zod.def,{get shape(){let a={...e._zod.def.shape,...t};return Ci(this,"shape",a),a}});return Ct(e,n)}function qG(e,t){if(!Ii(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=zn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Ci(this,"shape",i),i}});return Ct(e,r)}function HG(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=zn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Ci(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ct(e,r)}function JG(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=zn(t._zod.def,{get shape(){let s=t._zod.def.shape,u={...s};if(r)for(let d in r){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=e?new e({type:"optional",innerType:s[d]}):s[d])}else for(let d in s)u[d]=e?new e({type:"optional",innerType:s[d]}):s[d];return Ci(this,"shape",u),u},checks:[]});return Ct(t,o)}function XG(e,t,r){let i=zn(t._zod.def,{get shape(){let n=t._zod.def.shape,a={...n};if(r)for(let o in r){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=new e({type:"nonoptional",innerType:n[o]}))}else for(let o in n)a[o]=new e({type:"nonoptional",innerType:n[o]});return Ci(this,"shape",a),a}});return Ct(t,i)}function Di(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Gy(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Mt(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function zc(e){return typeof e=="string"?e:e?.message}function It(e,t,r){let i=e.message?e.message:zc(e.inst?._zod.def?.error?.(e))??zc(t?.error?.(e))??zc(r.customError?.(e))??zc(r.localeError?.(e))??"Invalid input",{inst:n,continue:a,input:o,...s}=e;return s.path??(s.path=[]),s.message=i,t?.reportInput&&(s.input=o),s}function Wc(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Kc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function j(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Ro(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function YG(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function hw(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function gw(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function QG(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return hw(t+r)}function e3(e){return gw(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function t3(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function r3(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var $y=class{constructor(...t){}};var yw=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,No,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Zc=T("$ZodError",yw),Ft=T("$ZodError",yw,{Parent:Error});function qc(e,t=r=>r.message){let r={},i=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function Hc(e,t=r=>r.message){let r={_errors:[]},i=(n,a=[])=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s},[...a,...o.path]));else if(o.code==="invalid_key")i({issues:o.issues},[...a,...o.path]);else if(o.code==="invalid_element")i({issues:o.issues},[...a,...o.path]);else{let s=[...a,...o.path];if(s.length===0)r._errors.push(t(o));else{let u=r,d=0;for(;d<s.length;){let p=s[d];d===s.length-1?(u[p]=u[p]||{_errors:[]},u[p]._errors.push(t(o))):u[p]=u[p]||{_errors:[]},u=u[p],d++}}}};return i(e),r}function Wy(e,t=r=>r.message){let r={errors:[]},i=(n,a=[])=>{var o,s;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>i({issues:d},[...a,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...a,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...a,...u.path]);else{let d=[...a,...u.path];if(d.length===0){r.errors.push(t(u));continue}let p=r,g=0;for(;g<d.length;){let h=d[g],l=g===d.length-1;typeof h=="string"?(p.properties??(p.properties={}),(o=p.properties)[h]??(o[h]={errors:[]}),p=p.properties[h]):(p.items??(p.items=[]),(s=p.items)[h]??(s[h]={errors:[]}),p=p.items[h]),l&&p.errors.push(t(u)),g++}}};return i(e),r}function vw(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Ky(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${vw(i.path)}`);return t.join(`
|
|
200
|
+
`),this.close()}_(t,r){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(oG.hide):this.out.write(Qae(this.outputText,this.out.columns)),super.render(),this.outputText=[aG.symbol(this.done,this.aborted),iG.bold(this.msg),aG.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:iG.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(eoe.line+oG.to(0)+this.outputText))}};sG.exports=VD});var lG=P((sTe,uG)=>{"use strict";uG.exports={TextPrompt:sV(),SelectPrompt:dV(),TogglePrompt:hV(),DatePrompt:zV(),NumberPrompt:WV(),MultiselectPrompt:FD(),AutocompletePrompt:QV(),AutocompleteMultiselectPrompt:nG(),ConfirmPrompt:cG()}});var pG=P(dG=>{"use strict";var Jt=dG,toe=lG(),by=e=>e;function On(e,t,r={}){return new Promise((i,n)=>{let a=new toe[e](t),o=r.onAbort||by,s=r.onSubmit||by,u=r.onExit||by;a.on("state",t.onState||by),a.on("submit",d=>i(s(d))),a.on("exit",d=>i(u(d))),a.on("abort",d=>n(o(d)))})}Jt.text=e=>On("TextPrompt",e);Jt.password=e=>(e.style="password",Jt.text(e));Jt.invisible=e=>(e.style="invisible",Jt.text(e));Jt.number=e=>On("NumberPrompt",e);Jt.date=e=>On("DatePrompt",e);Jt.confirm=e=>On("ConfirmPrompt",e);Jt.list=e=>{let t=e.separator||",";return On("TextPrompt",e,{onSubmit:r=>r.split(t).map(i=>i.trim())})};Jt.toggle=e=>On("TogglePrompt",e);Jt.select=e=>On("SelectPrompt",e);Jt.multiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(i=>i.selected).map(i=>i.value);return On("MultiselectPrompt",e,{onAbort:t,onSubmit:t})};Jt.autocompleteMultiselect=e=>{e.choices=[].concat(e.choices||[]);let t=r=>r.filter(i=>i.selected).map(i=>i.value);return On("AutocompleteMultiselectPrompt",e,{onAbort:t,onSubmit:t})};var roe=(e,t)=>Promise.resolve(t.filter(r=>r.title.slice(0,e.length).toLowerCase()===e.toLowerCase()));Jt.autocomplete=e=>(e.suggest=e.suggest||roe,e.choices=[].concat(e.choices||[]),On("AutocompletePrompt",e))});var hG=P((uTe,fG)=>{"use strict";var GD=pG(),noe=["suggest","format","onState","validate","onRender","type"],mG=()=>{};async function aa(e=[],{onSubmit:t=mG,onCancel:r=mG}={}){let i={},n=aa._override||{};e=[].concat(e);let a,o,s,u,d,p,g=async(h,l,m=!1)=>{if(!(!m&&h.validate&&h.validate(l)!==!0))return h.format?await h.format(l,i):l};for(o of e)if({name:u,type:d}=o,typeof d=="function"&&(d=await d(a,{...i},o),o.type=d),!!d){for(let h in o){if(noe.includes(h))continue;let l=o[h];o[h]=typeof l=="function"?await l(a,{...i},p):l}if(p=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:u,type:d}=o,GD[d]===void 0)throw new Error(`prompt type (${d}) is not defined`);if(n[o.name]!==void 0&&(a=await g(o,n[o.name]),a!==void 0)){i[u]=a;continue}try{a=aa._injected?ioe(aa._injected,o.initial):await GD[d](o),i[u]=a=await g(o,a,!0),s=await t(o,a,i)}catch{s=!await r(o,i)}if(s)return i}return i}function ioe(e,t){let r=e.shift();if(r instanceof Error)throw r;return r===void 0?t:r}function aoe(e){aa._injected=(aa._injected||[]).concat(e)}function ooe(e){aa._override=Object.assign({},e)}fG.exports=Object.assign(aa,{prompt:aa,prompts:GD,inject:aoe,override:ooe})});var WD=P((lTe,gG)=>{function soe(e){e=(Array.isArray(e)?e:e.split(".")).map(Number);let t=0,r=process.versions.node.split(".").map(Number);for(;t<e.length;t++){if(r[t]>e[t])return!1;if(e[t]>r[t])return!0}return!1}gG.exports=soe("8.6.0")?z6():hG()});import*as Oc from"fs";import*as $2 from"path";var IG=Object.defineProperty,Ai=(e,t)=>IG(e,"name",{value:t,configurable:!0});function Qe(e){return e.replace(/[-_](.)/g,(t,r)=>r.toUpperCase()).replace(/^./,t=>t.toUpperCase())}Ai(Qe,"toPascalCase");function hr(e){return e.replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/([a-z\d])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}Ai(hr,"toKebab");function Do(e){return hr(e).replace(/-/g,"_")}Ai(Do,"toValidDatabaseName");function XD(e){return hr(e).replace(/-/g,"_").toUpperCase()}Ai(XD,"toScreamingSnake");function YD(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}Ai(YD,"capitalise");function QD(e){return e.split(".").join("")}Ai(QD,"getSafeZoneName");function la(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}Ai(la,"accountConstructKey");function ew(e){let t=e.replace(new RegExp("\\P{ASCII}","gu"),"");return la(t)===la(e)&&la(e)!==""}Ai(ew,"hasAsciiStableConstructKey");var DG=Object.defineProperty,wo=(e,t)=>DG(e,"name",{value:t,configurable:!0});function ko(e){return`${Qe(e.split(".").join(""))}Domain`}wo(ko,"getDomainStackName");function tw(e){return`${e}UsEast1Certificates`}wo(tw,"getDomainUsEast1CertificatesStackName");function wy(e){let t=e.replace(/\./g,"-");return{hostedZoneId:`${t}-hosted-zone-id`,certificateArn:`${t}-certificate-arn`,certificateHosts:`${t}-certificate-hosts`,usEast1CertificateArn:`${t}-us-east-1-certificate-arn`,usEast1CertificateHosts:`${t}-us-east-1-certificate-hosts`,delegationRoleArn:`${t}-delegation-role-arn`,nameservers:`${t}-nameservers`}}wo(wy,"getDomainExportNames");var rw=1e3;function nw(e){let t=[],r=[];for(let i of e){let n=[...r,i];r.length>0&&Buffer.byteLength(JSON.stringify(n),"utf8")>rw?(t.push(r),r=[i]):r=n}return r.length>0&&t.push(r),t.map(i=>JSON.stringify(i))}wo(nw,"serialiseHostsChunks");function iw(e,t){return`${e}-${t}`}wo(iw,"hostsExportPartName");function aw(e){return typeof e.hostedZoneId=="string"}wo(aw,"isManagedDomainBinding");var wG=Object.defineProperty,kG=(e,t)=>wG(e,"name",{value:t,configurable:!0});function ow(e){return`${Qe(e)}ImageTag`}kG(ow,"imageTagParameterName");var NG=Object.defineProperty,Un=(e,t)=>NG(e,"name",{value:t,configurable:!0});function da(e){return Qe(e.replace(/[^A-Za-z0-9-]/g,""))}Un(da,"safeExportToken");function ky(e,t){let r=da(e);return t===void 0?r:`${r}-${da(t)}-`}Un(ky,"albExportScope");function sw(e,t){return`${ky(e,t)}AlbDnsName`}Un(sw,"albDnsExportName");function cw(e,t){return`${ky(e,t)}AlbHostedZoneId`}Un(cw,"albHostedZoneIdExportName");function uw(e,t){let r=da(e);return t===void 0?r:`${r}-${da(t)}-`}Un(uw,"cdnExportScope");function lw(e,t){return`${uw(e,t)}CdnDistributionDomainName`}Un(lw,"cdnDomainExportName");function Ny(e,t){return`${da(e)}-${da(t)}-`}Un(Ny,"bucketExportScope");function dw(e,t){return`${Ny(e,t)}WebsiteEndpoint`}Un(dw,"bucketWebsiteEndpointExportName");function pw(e,t){return`${Ny(e,t)}WebsiteHostedZoneId`}Un(pw,"bucketWebsiteHostedZoneIdExportName");var c={};Ur(c,{$brand:()=>Ry,$input:()=>eS,$output:()=>Qb,NEVER:()=>Py,TimePrecision:()=>iS,ZodAny:()=>ZE,ZodArray:()=>XE,ZodBase64:()=>Cm,ZodBase64URL:()=>Im,ZodBigInt:()=>ss,ZodBigIntFormat:()=>km,ZodBoolean:()=>os,ZodCIDRv4:()=>_m,ZodCIDRv6:()=>Tm,ZodCUID:()=>ym,ZodCUID2:()=>vm,ZodCatch:()=>bx,ZodCodec:()=>vu,ZodCustom:()=>bu,ZodCustomStringFormat:()=>is,ZodDate:()=>mu,ZodDefault:()=>mx,ZodDiscriminatedUnion:()=>QE,ZodE164:()=>Dm,ZodEmail:()=>fm,ZodEmoji:()=>hm,ZodEnum:()=>rs,ZodError:()=>cK,ZodExactOptional:()=>lx,ZodFile:()=>cx,ZodFirstPartyTypeKind:()=>Px,ZodFunction:()=>wx,ZodGUID:()=>cu,ZodIPv4:()=>xm,ZodIPv6:()=>Am,ZodISODate:()=>cm,ZodISODateTime:()=>sm,ZodISODuration:()=>lm,ZodISOTime:()=>um,ZodIntersection:()=>ex,ZodIssueCode:()=>lK,ZodJWT:()=>wm,ZodKSUID:()=>Em,ZodLazy:()=>Cx,ZodLiteral:()=>sx,ZodMAC:()=>UE,ZodMap:()=>ax,ZodNaN:()=>Ex,ZodNanoID:()=>gm,ZodNever:()=>HE,ZodNonOptional:()=>jm,ZodNull:()=>WE,ZodNullable:()=>px,ZodNumber:()=>as,ZodNumberFormat:()=>Sa,ZodObject:()=>hu,ZodOptional:()=>$m,ZodPipe:()=>yu,ZodPrefault:()=>hx,ZodPreprocess:()=>xx,ZodPromise:()=>Dx,ZodReadonly:()=>Ax,ZodRealError:()=>Lt,ZodRecord:()=>ts,ZodSet:()=>ox,ZodString:()=>ns,ZodStringFormat:()=>Ie,ZodSuccess:()=>vx,ZodSymbol:()=>VE,ZodTemplateLiteral:()=>Tx,ZodTransform:()=>ux,ZodTuple:()=>rx,ZodType:()=>re,ZodULID:()=>bm,ZodURL:()=>pu,ZodUUID:()=>on,ZodUndefined:()=>GE,ZodUnion:()=>gu,ZodUnknown:()=>qE,ZodVoid:()=>JE,ZodXID:()=>Sm,ZodXor:()=>YE,_ZodString:()=>mm,_default:()=>fx,_function:()=>eP,any:()=>NN,array:()=>fu,base64:()=>fN,base64url:()=>hN,bigint:()=>CN,boolean:()=>BE,catch:()=>Sx,check:()=>tP,cidrv4:()=>pN,cidrv6:()=>mN,clone:()=>Ct,codec:()=>JN,coerce:()=>Rx,config:()=>Ze,core:()=>Vn,cuid:()=>iN,cuid2:()=>aN,custom:()=>rP,date:()=>RN,decode:()=>RE,decodeAsync:()=>$E,describe:()=>nP,discriminatedUnion:()=>LN,e164:()=>gN,email:()=>qk,emoji:()=>rN,encode:()=>PE,encodeAsync:()=>OE,endsWith:()=>Wo,enum:()=>Rm,exactOptional:()=>dx,file:()=>KN,flattenError:()=>qc,float32:()=>xN,float64:()=>AN,formatError:()=>Hc,fromJSONSchema:()=>lP,function:()=>eP,getErrorMap:()=>pK,globalRegistry:()=>mt,gt:()=>nn,gte:()=>Dt,guid:()=>Hk,hash:()=>EN,hex:()=>SN,hostname:()=>bN,httpUrl:()=>tN,includes:()=>Vo,instanceof:()=>aP,int:()=>dm,int32:()=>_N,int64:()=>IN,intersection:()=>tx,invertCodec:()=>XN,ipv4:()=>uN,ipv6:()=>dN,iso:()=>es,json:()=>sP,jwt:()=>yN,keyof:()=>ON,ksuid:()=>cN,lazy:()=>Ix,length:()=>va,literal:()=>WN,locales:()=>nu,looseObject:()=>MN,looseRecord:()=>zN,lowercase:()=>zo,lt:()=>rn,lte:()=>Qt,mac:()=>lN,map:()=>BN,maxLength:()=>ya,maxSize:()=>ki,meta:()=>iP,mime:()=>Ko,minLength:()=>Bn,minSize:()=>an,multipleOf:()=>wi,nan:()=>HN,nanoid:()=>nN,nativeEnum:()=>GN,negative:()=>Xp,never:()=>Nm,nonnegative:()=>Qp,nonoptional:()=>yx,nonpositive:()=>Yp,normalize:()=>Zo,null:()=>KE,nullable:()=>lu,nullish:()=>ZN,number:()=>zE,object:()=>$N,optional:()=>uu,overwrite:()=>Br,parse:()=>DE,parseAsync:()=>wE,partialRecord:()=>UN,pipe:()=>pm,positive:()=>Jp,prefault:()=>gx,preprocess:()=>cP,prettifyError:()=>Ky,promise:()=>QN,property:()=>em,readonly:()=>_x,record:()=>ix,refine:()=>kx,regex:()=>Uo,regexes:()=>Yt,registry:()=>wp,safeDecode:()=>ME,safeDecodeAsync:()=>LE,safeEncode:()=>jE,safeEncodeAsync:()=>FE,safeParse:()=>kE,safeParseAsync:()=>NE,set:()=>VN,setErrorMap:()=>dK,size:()=>ga,slugify:()=>Xo,startsWith:()=>Go,strictObject:()=>jN,string:()=>su,stringFormat:()=>vN,stringbool:()=>oP,success:()=>qN,superRefine:()=>Nx,symbol:()=>wN,templateLiteral:()=>YN,toJSONSchema:()=>im,toLowerCase:()=>Ho,toUpperCase:()=>Jo,transform:()=>Om,treeifyError:()=>Wy,trim:()=>qo,tuple:()=>nx,uint32:()=>TN,uint64:()=>DN,ulid:()=>oN,undefined:()=>kN,union:()=>Pm,unknown:()=>ba,uppercase:()=>Bo,url:()=>eN,util:()=>M,uuid:()=>Jk,uuidv4:()=>Xk,uuidv6:()=>Yk,uuidv7:()=>Qk,void:()=>PN,xid:()=>sN,xor:()=>FN});var Vn={};Ur(Vn,{$ZodAny:()=>Eb,$ZodArray:()=>Cb,$ZodAsyncError:()=>zr,$ZodBase64:()=>db,$ZodBase64URL:()=>pb,$ZodBigInt:()=>Ep,$ZodBigIntFormat:()=>yb,$ZodBoolean:()=>Qc,$ZodCIDRv4:()=>cb,$ZodCIDRv6:()=>ub,$ZodCUID:()=>Jv,$ZodCUID2:()=>Xv,$ZodCatch:()=>Gb,$ZodCheck:()=>we,$ZodCheckBigIntFormat:()=>Cv,$ZodCheckEndsWith:()=>Fv,$ZodCheckGreaterThan:()=>hp,$ZodCheckIncludes:()=>jv,$ZodCheckLengthEquals:()=>Pv,$ZodCheckLessThan:()=>fp,$ZodCheckLowerCase:()=>Ov,$ZodCheckMaxLength:()=>kv,$ZodCheckMaxSize:()=>Iv,$ZodCheckMimeType:()=>Uv,$ZodCheckMinLength:()=>Nv,$ZodCheckMinSize:()=>Dv,$ZodCheckMultipleOf:()=>_v,$ZodCheckNumberFormat:()=>Tv,$ZodCheckOverwrite:()=>zv,$ZodCheckProperty:()=>Lv,$ZodCheckRegex:()=>Rv,$ZodCheckSizeEquals:()=>wv,$ZodCheckStartsWith:()=>Mv,$ZodCheckStringFormat:()=>Fo,$ZodCheckUpperCase:()=>$v,$ZodCodec:()=>tu,$ZodCustom:()=>Yb,$ZodCustomStringFormat:()=>hb,$ZodDate:()=>Tb,$ZodDefault:()=>Ub,$ZodDiscriminatedUnion:()=>wb,$ZodE164:()=>mb,$ZodEmail:()=>Kv,$ZodEmoji:()=>qv,$ZodEncodeError:()=>_i,$ZodEnum:()=>Ob,$ZodError:()=>Zc,$ZodExactOptional:()=>Fb,$ZodFile:()=>jb,$ZodFunction:()=>Hb,$ZodGUID:()=>Gv,$ZodIPv4:()=>ab,$ZodIPv6:()=>ob,$ZodISODate:()=>rb,$ZodISODateTime:()=>tb,$ZodISODuration:()=>ib,$ZodISOTime:()=>nb,$ZodIntersection:()=>kb,$ZodJWT:()=>fb,$ZodKSUID:()=>eb,$ZodLazy:()=>Xb,$ZodLiteral:()=>$b,$ZodMAC:()=>sb,$ZodMap:()=>Pb,$ZodNaN:()=>Wb,$ZodNanoID:()=>Hv,$ZodNever:()=>Ab,$ZodNonOptional:()=>Bb,$ZodNull:()=>Sb,$ZodNullable:()=>Lb,$ZodNumber:()=>Sp,$ZodNumberFormat:()=>gb,$ZodObject:()=>Vw,$ZodObjectJIT:()=>Ib,$ZodOptional:()=>Ap,$ZodPipe:()=>_p,$ZodPrefault:()=>zb,$ZodPreprocess:()=>Kb,$ZodPromise:()=>Jb,$ZodReadonly:()=>Zb,$ZodRealError:()=>Ft,$ZodRecord:()=>Nb,$ZodRegistry:()=>Dp,$ZodSet:()=>Rb,$ZodString:()=>ha,$ZodStringFormat:()=>Ce,$ZodSuccess:()=>Vb,$ZodSymbol:()=>vb,$ZodTemplateLiteral:()=>qb,$ZodTransform:()=>Mb,$ZodTuple:()=>xp,$ZodType:()=>ee,$ZodULID:()=>Yv,$ZodURL:()=>Zv,$ZodUUID:()=>Wv,$ZodUndefined:()=>bb,$ZodUnion:()=>eu,$ZodUnknown:()=>xb,$ZodVoid:()=>_b,$ZodXID:()=>Qv,$ZodXor:()=>Db,$brand:()=>Ry,$constructor:()=>T,$input:()=>eS,$output:()=>Qb,Doc:()=>Yc,JSONSchema:()=>Wk,JSONSchemaGenerator:()=>am,NEVER:()=>Py,TimePrecision:()=>iS,_any:()=>TS,_array:()=>PS,_base64:()=>Kp,_base64url:()=>Zp,_bigint:()=>vS,_boolean:()=>gS,_catch:()=>eK,_check:()=>Gk,_cidrv4:()=>Gp,_cidrv6:()=>Wp,_coercedBigint:()=>bS,_coercedBoolean:()=>yS,_coercedDate:()=>kS,_coercedNumber:()=>lS,_coercedString:()=>rS,_cuid:()=>Mp,_cuid2:()=>Fp,_custom:()=>OS,_date:()=>wS,_decode:()=>ap,_decodeAsync:()=>sp,_default:()=>XW,_discriminatedUnion:()=>LW,_e164:()=>qp,_email:()=>kp,_emoji:()=>$p,_encode:()=>ip,_encodeAsync:()=>op,_endsWith:()=>Wo,_enum:()=>WW,_file:()=>RS,_float32:()=>pS,_float64:()=>mS,_gt:()=>nn,_gte:()=>Dt,_guid:()=>iu,_includes:()=>Vo,_int:()=>dS,_int32:()=>fS,_int64:()=>SS,_intersection:()=>UW,_ipv4:()=>Bp,_ipv6:()=>Vp,_isoDate:()=>oS,_isoDateTime:()=>aS,_isoDuration:()=>cS,_isoTime:()=>sS,_jwt:()=>Hp,_ksuid:()=>zp,_lazy:()=>iK,_length:()=>va,_literal:()=>ZW,_lowercase:()=>zo,_lt:()=>rn,_lte:()=>Qt,_mac:()=>nS,_map:()=>VW,_max:()=>Qt,_maxLength:()=>ya,_maxSize:()=>ki,_mime:()=>Ko,_min:()=>Dt,_minLength:()=>Bn,_minSize:()=>an,_multipleOf:()=>wi,_nan:()=>NS,_nanoid:()=>jp,_nativeEnum:()=>KW,_negative:()=>Xp,_never:()=>IS,_nonnegative:()=>Qp,_nonoptional:()=>YW,_nonpositive:()=>Yp,_normalize:()=>Zo,_null:()=>_S,_nullable:()=>JW,_number:()=>uS,_optional:()=>HW,_overwrite:()=>Br,_parse:()=>Oo,_parseAsync:()=>$o,_pipe:()=>tK,_positive:()=>Jp,_promise:()=>aK,_property:()=>em,_readonly:()=>rK,_record:()=>BW,_refine:()=>$S,_regex:()=>Uo,_safeDecode:()=>up,_safeDecodeAsync:()=>dp,_safeEncode:()=>cp,_safeEncodeAsync:()=>lp,_safeParse:()=>jo,_safeParseAsync:()=>Mo,_set:()=>GW,_size:()=>ga,_slugify:()=>Xo,_startsWith:()=>Go,_string:()=>tS,_stringFormat:()=>Yo,_stringbool:()=>LS,_success:()=>QW,_superRefine:()=>jS,_symbol:()=>xS,_templateLiteral:()=>nK,_toLowerCase:()=>Ho,_toUpperCase:()=>Jo,_transform:()=>qW,_trim:()=>qo,_tuple:()=>zW,_uint32:()=>hS,_uint64:()=>ES,_ulid:()=>Lp,_undefined:()=>AS,_union:()=>MW,_unknown:()=>CS,_uppercase:()=>Bo,_url:()=>au,_uuid:()=>Np,_uuidv4:()=>Pp,_uuidv6:()=>Rp,_uuidv7:()=>Op,_void:()=>DS,_xid:()=>Up,_xor:()=>FW,clone:()=>Ct,config:()=>Ze,createStandardJSONSchemaMethod:()=>Qo,createToJSONSchemaMethod:()=>US,decode:()=>a3,decodeAsync:()=>s3,describe:()=>MS,encode:()=>i3,encodeAsync:()=>o3,extractDefs:()=>Pi,finalize:()=>Ri,flattenError:()=>qc,formatError:()=>Hc,globalConfig:()=>pa,globalRegistry:()=>mt,initializeContext:()=>Ni,isValidBase64:()=>lb,isValidBase64URL:()=>Lw,isValidJWT:()=>Uw,locales:()=>nu,meta:()=>FS,parse:()=>rp,parseAsync:()=>np,prettifyError:()=>Ky,process:()=>Ee,regexes:()=>Yt,registry:()=>wp,safeDecode:()=>u3,safeDecodeAsync:()=>d3,safeEncode:()=>c3,safeEncodeAsync:()=>l3,safeParse:()=>Zy,safeParseAsync:()=>qy,toDotPath:()=>vw,toJSONSchema:()=>im,treeifyError:()=>Wy,util:()=>M,version:()=>Bv});var mw,Py=Object.freeze({status:"aborted"});function T(e,t,r){function i(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:o,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let d=o.prototype,p=Object.keys(d);for(let g=0;g<p.length;g++){let h=p[g];h in s||(s[h]=d[h].bind(s))}}let n=r?.Parent??Object;class a extends n{}Object.defineProperty(a,"name",{value:e});function o(s){var u;let d=r?.Parent?new a:this;i(d,s),(u=d._zod).deferred??(u.deferred=[]);for(let p of d._zod.deferred)p();return d}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Ry=Symbol("zod_brand"),zr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},_i=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(mw=globalThis).__zod_globalConfig??(mw.__zod_globalConfig={});var pa=globalThis.__zod_globalConfig;function Ze(e){return e&&Object.assign(pa,e),pa}var M={};Ur(M,{BIGINT_FORMAT_RANGES:()=>Vy,Class:()=>$y,NUMBER_FORMAT_RANGES:()=>By,aborted:()=>Di,allowsEval:()=>Fy,assert:()=>jG,assertEqual:()=>PG,assertIs:()=>OG,assertNever:()=>$G,assertNotEqual:()=>RG,assignProp:()=>Ci,base64ToUint8Array:()=>hw,base64urlToUint8Array:()=>QG,cached:()=>Po,captureStackTrace:()=>tp,cleanEnum:()=>YG,cleanRegex:()=>Vc,clone:()=>Ct,cloneDef:()=>FG,createTransparentProxy:()=>GG,defineLazy:()=>ce,esc:()=>ep,escapeRegex:()=>gr,explicitlyAborted:()=>Gy,extend:()=>ZG,finalizeIssue:()=>It,floatSafeRemainder:()=>jy,getElementAtPath:()=>LG,getEnumValues:()=>Bc,getLengthableOrigin:()=>Kc,getParsedType:()=>VG,getSizableOrigin:()=>Wc,hexToUint8Array:()=>t3,isObject:()=>ma,isPlainObject:()=>Ii,issue:()=>Ro,joinValues:()=>D,jsonStringifyReplacer:()=>No,merge:()=>HG,mergeDefs:()=>zn,normalizeParams:()=>L,nullish:()=>Ti,numKeys:()=>BG,objectClone:()=>MG,omit:()=>KG,optionalKeys:()=>zy,parsedType:()=>j,partial:()=>JG,pick:()=>WG,prefixIssues:()=>Mt,primitiveTypes:()=>Uy,promiseAllObject:()=>UG,propertyKeyTypes:()=>Gc,randomString:()=>zG,required:()=>XG,safeExtend:()=>qG,shallowClone:()=>Ly,slugify:()=>My,stringifyPrimitive:()=>O,uint8ArrayToBase64:()=>gw,uint8ArrayToBase64url:()=>e3,uint8ArrayToHex:()=>r3,unwrapMessage:()=>zc});function PG(e){return e}function RG(e){return e}function OG(e){}function $G(e){throw new Error("Unexpected value in exhaustive check")}function jG(e){}function Bc(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,n])=>t.indexOf(+i)===-1).map(([i,n])=>n)}function D(e,t="|"){return e.map(r=>O(r)).join(t)}function No(e,t){return typeof t=="bigint"?t.toString():t}function Po(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Ti(e){return e==null}function Vc(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function jy(e,t){let r=e/t,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}var fw=Symbol("evaluating");function ce(e,t,r){let i;Object.defineProperty(e,t,{get(){if(i!==fw)return i===void 0&&(i=fw,i=r()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function MG(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ci(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function zn(...e){let t={};for(let r of e){let i=Object.getOwnPropertyDescriptors(r);Object.assign(t,i)}return Object.defineProperties({},t)}function FG(e){return zn(e._zod.def)}function LG(e,t){return t?t.reduce((r,i)=>r?.[i],e):e}function UG(e){let t=Object.keys(e),r=t.map(i=>e[i]);return Promise.all(r).then(i=>{let n={};for(let a=0;a<t.length;a++)n[t[a]]=i[a];return n})}function zG(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<e;i++)r+=t[Math.floor(Math.random()*t.length)];return r}function ep(e){return JSON.stringify(e)}function My(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var tp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ma(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Fy=Po(()=>{if(pa.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Ii(e){if(ma(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(ma(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ly(e){return Ii(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function BG(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var VG=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Gc=new Set(["string","number","symbol"]),Uy=new Set(["string","number","bigint","boolean","symbol","undefined"]);function gr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ct(e,t,r){let i=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(i._zod.parent=e),i}function L(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function GG(e){let t;return new Proxy({},{get(r,i,n){return t??(t=e()),Reflect.get(t,i,n)},set(r,i,n,a){return t??(t=e()),Reflect.set(t,i,n,a)},has(r,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(r,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(r,i,n){return t??(t=e()),Reflect.defineProperty(t,i,n)}})}function O(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function zy(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var By={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Vy={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function WG(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let a=zn(e._zod.def,{get shape(){let o={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=r.shape[s])}return Ci(this,"shape",o),o},checks:[]});return Ct(e,a)}function KG(e,t){let r=e._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let a=zn(e._zod.def,{get shape(){let o={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete o[s]}return Ci(this,"shape",o),o},checks:[]});return Ct(e,a)}function ZG(e,t){if(!Ii(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let a=e._zod.def.shape;for(let o in t)if(Object.getOwnPropertyDescriptor(a,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=zn(e._zod.def,{get shape(){let a={...e._zod.def.shape,...t};return Ci(this,"shape",a),a}});return Ct(e,n)}function qG(e,t){if(!Ii(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=zn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Ci(this,"shape",i),i}});return Ct(e,r)}function HG(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=zn(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return Ci(this,"shape",i),i},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ct(e,r)}function JG(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=zn(t._zod.def,{get shape(){let s=t._zod.def.shape,u={...s};if(r)for(let d in r){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);r[d]&&(u[d]=e?new e({type:"optional",innerType:s[d]}):s[d])}else for(let d in s)u[d]=e?new e({type:"optional",innerType:s[d]}):s[d];return Ci(this,"shape",u),u},checks:[]});return Ct(t,o)}function XG(e,t,r){let i=zn(t._zod.def,{get shape(){let n=t._zod.def.shape,a={...n};if(r)for(let o in r){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(a[o]=new e({type:"nonoptional",innerType:n[o]}))}else for(let o in n)a[o]=new e({type:"nonoptional",innerType:n[o]});return Ci(this,"shape",a),a}});return Ct(t,i)}function Di(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Gy(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Mt(e,t){return t.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(e),r})}function zc(e){return typeof e=="string"?e:e?.message}function It(e,t,r){let i=e.message?e.message:zc(e.inst?._zod.def?.error?.(e))??zc(t?.error?.(e))??zc(r.customError?.(e))??zc(r.localeError?.(e))??"Invalid input",{inst:n,continue:a,input:o,...s}=e;return s.path??(s.path=[]),s.message=i,t?.reportInput&&(s.input=o),s}function Wc(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Kc(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function j(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Ro(...e){let[t,r,i]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:i}:{...t}}function YG(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function hw(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);return r}function gw(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function QG(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return hw(t+r)}function e3(e){return gw(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function t3(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)r[i/2]=Number.parseInt(t.slice(i,i+2),16);return r}function r3(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var $y=class{constructor(...t){}};var yw=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,No,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Zc=T("$ZodError",yw),Ft=T("$ZodError",yw,{Parent:Error});function qc(e,t=r=>r.message){let r={},i=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):i.push(t(n));return{formErrors:i,fieldErrors:r}}function Hc(e,t=r=>r.message){let r={_errors:[]},i=(n,a=[])=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s},[...a,...o.path]));else if(o.code==="invalid_key")i({issues:o.issues},[...a,...o.path]);else if(o.code==="invalid_element")i({issues:o.issues},[...a,...o.path]);else{let s=[...a,...o.path];if(s.length===0)r._errors.push(t(o));else{let u=r,d=0;for(;d<s.length;){let p=s[d];d===s.length-1?(u[p]=u[p]||{_errors:[]},u[p]._errors.push(t(o))):u[p]=u[p]||{_errors:[]},u=u[p],d++}}}};return i(e),r}function Wy(e,t=r=>r.message){let r={errors:[]},i=(n,a=[])=>{var o,s;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(d=>i({issues:d},[...a,...u.path]));else if(u.code==="invalid_key")i({issues:u.issues},[...a,...u.path]);else if(u.code==="invalid_element")i({issues:u.issues},[...a,...u.path]);else{let d=[...a,...u.path];if(d.length===0){r.errors.push(t(u));continue}let p=r,g=0;for(;g<d.length;){let h=d[g],l=g===d.length-1;typeof h=="string"?(p.properties??(p.properties={}),(o=p.properties)[h]??(o[h]={errors:[]}),p=p.properties[h]):(p.items??(p.items=[]),(s=p.items)[h]??(s[h]={errors:[]}),p=p.items[h]),l&&p.errors.push(t(u)),g++}}};return i(e),r}function vw(e){let t=[],r=e.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}function Ky(e){let t=[],r=[...e.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${vw(i.path)}`);return t.join(`
|
|
201
201
|
`)}var Oo=e=>(t,r,i,n)=>{let a=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise)throw new zr;if(o.issues.length){let s=new(n?.Err??e)(o.issues.map(u=>It(u,a,Ze())));throw tp(s,n?.callee),s}return o.value},rp=Oo(Ft),$o=e=>async(t,r,i,n)=>{let a=i?{...i,async:!0}:{async:!0},o=t._zod.run({value:r,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let s=new(n?.Err??e)(o.issues.map(u=>It(u,a,Ze())));throw tp(s,n?.callee),s}return o.value},np=$o(Ft),jo=e=>(t,r,i)=>{let n=i?{...i,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},n);if(a instanceof Promise)throw new zr;return a.issues.length?{success:!1,error:new(e??Zc)(a.issues.map(o=>It(o,n,Ze())))}:{success:!0,data:a.value}},Zy=jo(Ft),Mo=e=>async(t,r,i)=>{let n=i?{...i,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},n);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>It(o,n,Ze())))}:{success:!0,data:a.value}},qy=Mo(Ft),ip=e=>(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Oo(e)(t,r,n)},i3=ip(Ft),ap=e=>(t,r,i)=>Oo(e)(t,r,i),a3=ap(Ft),op=e=>async(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return $o(e)(t,r,n)},o3=op(Ft),sp=e=>async(t,r,i)=>$o(e)(t,r,i),s3=sp(Ft),cp=e=>(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return jo(e)(t,r,n)},c3=cp(Ft),up=e=>(t,r,i)=>jo(e)(t,r,i),u3=up(Ft),lp=e=>async(t,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Mo(e)(t,r,n)},l3=lp(Ft),dp=e=>async(t,r,i)=>Mo(e)(t,r,i),d3=dp(Ft);var Yt={};Ur(Yt,{base64:()=>lv,base64url:()=>pp,bigint:()=>yv,boolean:()=>bv,browserEmail:()=>b3,cidrv4:()=>cv,cidrv6:()=>uv,cuid:()=>Hy,cuid2:()=>Jy,date:()=>mv,datetime:()=>hv,domain:()=>x3,duration:()=>tv,e164:()=>pv,email:()=>nv,emoji:()=>iv,extendedDuration:()=>p3,guid:()=>rv,hex:()=>A3,hostname:()=>E3,html5Email:()=>g3,httpProtocol:()=>dv,idnEmail:()=>v3,integer:()=>vv,ipv4:()=>av,ipv6:()=>ov,ksuid:()=>Qy,lowercase:()=>xv,mac:()=>sv,md5_base64:()=>T3,md5_base64url:()=>C3,md5_hex:()=>_3,nanoid:()=>ev,null:()=>Sv,number:()=>mp,rfc5322Email:()=>y3,sha1_base64:()=>D3,sha1_base64url:()=>w3,sha1_hex:()=>I3,sha256_base64:()=>N3,sha256_base64url:()=>P3,sha256_hex:()=>k3,sha384_base64:()=>O3,sha384_base64url:()=>$3,sha384_hex:()=>R3,sha512_base64:()=>M3,sha512_base64url:()=>F3,sha512_hex:()=>j3,string:()=>gv,time:()=>fv,ulid:()=>Xy,undefined:()=>Ev,unicodeEmail:()=>bw,uppercase:()=>Av,uuid:()=>fa,uuid4:()=>m3,uuid6:()=>f3,uuid7:()=>h3,xid:()=>Yy});var Hy=/^[cC][0-9a-z]{6,}$/,Jy=/^[0-9a-z]+$/,Xy=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Yy=/^[0-9a-vA-V]{20}$/,Qy=/^[A-Za-z0-9]{27}$/,ev=/^[a-zA-Z0-9_-]{21}$/,tv=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,p3=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rv=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fa=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,m3=fa(4),f3=fa(6),h3=fa(7),nv=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,g3=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,y3=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,bw=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,v3=bw,b3=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,S3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iv(){return new RegExp(S3,"u")}var av=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ov=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,sv=e=>{let t=gr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},cv=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,uv=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,lv=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pp=/^[A-Za-z0-9_-]*$/,E3=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,x3=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,dv=/^https?$/,pv=/^\+[1-9]\d{6,14}$/,Sw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",mv=new RegExp(`^${Sw}$`);function Ew(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function fv(e){return new RegExp(`^${Ew(e)}$`)}function hv(e){let t=Ew({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${t}(?:${r.join("|")})`;return new RegExp(`^${Sw}T(?:${i})$`)}var gv=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},yv=/^-?\d+n?$/,vv=/^-?\d+$/,mp=/^-?\d+(?:\.\d+)?$/,bv=/^(?:true|false)$/i,Sv=/^null$/i;var Ev=/^undefined$/i;var xv=/^[^A-Z]*$/,Av=/^[^a-z]*$/,A3=/^[0-9a-fA-F]*$/;function Jc(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Xc(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var _3=/^[0-9a-fA-F]{32}$/,T3=Jc(22,"=="),C3=Xc(22),I3=/^[0-9a-fA-F]{40}$/,D3=Jc(27,"="),w3=Xc(27),k3=/^[0-9a-fA-F]{64}$/,N3=Jc(43,"="),P3=Xc(43),R3=/^[0-9a-fA-F]{96}$/,O3=Jc(64,""),$3=Xc(64),j3=/^[0-9a-fA-F]{128}$/,M3=Jc(86,"=="),F3=Xc(86);var we=T("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Aw={number:"number",bigint:"bigint",object:"date"},fp=T("$ZodCheckLessThan",(e,t)=>{we.init(e,t);let r=Aw[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,a=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hp=T("$ZodCheckGreaterThan",(e,t)=>{we.init(e,t);let r=Aw[typeof t.value];e._zod.onattach.push(i=>{let n=i._zod.bag,a=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_v=T("$ZodCheckMultipleOf",(e,t)=>{we.init(e,t),e._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):jy(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Tv=T("$ZodCheckNumberFormat",(e,t)=>{we.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),i=r?"int":"number",[n,a]=By[t.format];e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,s.minimum=n,s.maximum=a,r&&(s.pattern=vv)}),e._zod.check=o=>{let s=o.value;if(r){if(!Number.isInteger(s)){o.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}s<n&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Cv=T("$ZodCheckBigIntFormat",(e,t)=>{we.init(e,t);let[r,i]=Vy[t.format];e._zod.onattach.push(n=>{let a=n._zod.bag;a.format=t.format,a.minimum=r,a.maximum=i}),e._zod.check=n=>{let a=n.value;a<r&&n.issues.push({origin:"bigint",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>i&&n.issues.push({origin:"bigint",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),Iv=T("$ZodCheckMaxSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Ti(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;n.size<=t.maximum||i.issues.push({origin:Wc(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Dv=T("$ZodCheckMinSize",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Ti(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;n.size>=t.minimum||i.issues.push({origin:Wc(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),wv=T("$ZodCheckSizeEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Ti(n)&&n.size!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=i=>{let n=i.value,a=n.size;if(a===t.size)return;let o=a>t.size;i.issues.push({origin:Wc(n),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),kv=T("$ZodCheckMaxLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Ti(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(i._zod.bag.maximum=t.maximum)}),e._zod.check=i=>{let n=i.value;if(n.length<=t.maximum)return;let o=Kc(n);i.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Nv=T("$ZodCheckMinLength",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Ti(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(i._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;if(n.length>=t.minimum)return;let o=Kc(n);i.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Pv=T("$ZodCheckLengthEquals",(e,t)=>{var r;we.init(e,t),(r=e._zod.def).when??(r.when=i=>{let n=i.value;return!Ti(n)&&n.length!==void 0}),e._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=i=>{let n=i.value,a=n.length;if(a===t.length)return;let o=Kc(n),s=a>t.length;i.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Fo=T("$ZodCheckStringFormat",(e,t)=>{var r,i;we.init(e,t),e._zod.onattach.push(n=>{let a=n._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Rv=T("$ZodCheckRegex",(e,t)=>{Fo.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ov=T("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=xv),Fo.init(e,t)}),$v=T("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Av),Fo.init(e,t)}),jv=T("$ZodCheckIncludes",(e,t)=>{we.init(e,t);let r=gr(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=i,e._zod.onattach.push(n=>{let a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Mv=T("$ZodCheckStartsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`^${gr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),Fv=T("$ZodCheckEndsWith",(e,t)=>{we.init(e,t);let r=new RegExp(`.*${gr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function xw(e,t,r){e.issues.length&&t.issues.push(...Mt(r,e.issues))}var Lv=T("$ZodCheckProperty",(e,t)=>{we.init(e,t),e._zod.check=r=>{let i=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>xw(n,r,t.property));xw(i,r,t.property)}}),Uv=T("$ZodCheckMimeType",(e,t)=>{we.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(i=>{i._zod.bag.mime=t.mime}),e._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),zv=T("$ZodCheckOverwrite",(e,t)=>{we.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Yc=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
|
|
202
202
|
`).filter(o=>o),n=Math.min(...i.map(o=>o.length-o.trimStart().length)),a=i.map(o=>o.slice(n)).map(o=>" ".repeat(this.indent*2)+o);for(let o of a)this.content.push(o)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...r,n.join(`
|
|
203
203
|
`))}};var Bv={major:4,minor:4,patch:3};var ee=T("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Bv;let i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(let n of i)for(let a of n._zod.onattach)a(e);if(i.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(o,s,u)=>{let d=Di(o),p;for(let g of s){if(g._zod.def.when){if(Gy(o)||!g._zod.def.when(o))continue}else if(d)continue;let h=o.issues.length,l=g._zod.check(o);if(l instanceof Promise&&u?.async===!1)throw new zr;if(p||l instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await l,o.issues.length!==h&&(d||(d=Di(o,h)))});else{if(o.issues.length===h)continue;d||(d=Di(o,h))}}return p?p.then(()=>o):o},a=(o,s,u)=>{if(Di(o))return o.aborted=!0,o;let d=n(s,i,u);if(d instanceof Promise){if(u.async===!1)throw new zr;return d.then(p=>e._zod.parse(p,u))}return e._zod.parse(d,u)};e._zod.run=(o,s)=>{if(s.skipChecks)return e._zod.parse(o,s);if(s.direction==="backward"){let d=e._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(p=>a(p,o,s)):a(d,o,s)}let u=e._zod.parse(o,s);if(u instanceof Promise){if(s.async===!1)throw new zr;return u.then(d=>n(d,i,s))}return n(u,i,s)}}ce(e,"~standard",()=>({validate:n=>{try{let a=Zy(e,n);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return qy(e,n).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ha=T("$ZodString",(e,t)=>{ee.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??gv(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ce=T("$ZodStringFormat",(e,t)=>{Fo.init(e,t),ha.init(e,t)}),Gv=T("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=rv),Ce.init(e,t)}),Wv=T("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=fa(i))}else t.pattern??(t.pattern=fa());Ce.init(e,t)}),Kv=T("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=nv),Ce.init(e,t)}),Zv=T("$ZodURL",(e,t)=>{Ce.init(e,t),e._zod.check=r=>{try{let i=r.value.trim();if(!t.normalize&&t.protocol?.source===dv.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(i);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),qv=T("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=iv()),Ce.init(e,t)}),Hv=T("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ev),Ce.init(e,t)}),Jv=T("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Hy),Ce.init(e,t)}),Xv=T("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Jy),Ce.init(e,t)}),Yv=T("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Xy),Ce.init(e,t)}),Qv=T("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Yy),Ce.init(e,t)}),eb=T("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Qy),Ce.init(e,t)}),tb=T("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=hv(t)),Ce.init(e,t)}),rb=T("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mv),Ce.init(e,t)}),nb=T("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=fv(t)),Ce.init(e,t)}),ib=T("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tv),Ce.init(e,t)}),ab=T("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=av),Ce.init(e,t),e._zod.bag.format="ipv4"}),ob=T("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ov),Ce.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),sb=T("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=sv(t.delimiter)),Ce.init(e,t),e._zod.bag.format="mac"}),cb=T("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=cv),Ce.init(e,t)}),ub=T("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=uv),Ce.init(e,t),e._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,a]=i;if(!a)throw new Error;let o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function lb(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var db=T("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=lv),Ce.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{lb(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Lw(e){if(!pp.test(e))return!1;let t=e.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return lb(r)}var pb=T("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=pp),Ce.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Lw(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),mb=T("$ZodE164",(e,t)=>{t.pattern??(t.pattern=pv),Ce.init(e,t)});function Uw(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var fb=T("$ZodJWT",(e,t)=>{Ce.init(e,t),e._zod.check=r=>{Uw(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),hb=T("$ZodCustomStringFormat",(e,t)=>{Ce.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Sp=T("$ZodNumber",(e,t)=>{ee.init(e,t),e._zod.pattern=e._zod.bag.pattern??mp,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let a=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...a?{received:a}:{}}),r}}),gb=T("$ZodNumberFormat",(e,t)=>{Tv.init(e,t),Sp.init(e,t)}),Qc=T("$ZodBoolean",(e,t)=>{ee.init(e,t),e._zod.pattern=bv,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Ep=T("$ZodBigInt",(e,t)=>{ee.init(e,t),e._zod.pattern=yv,e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),yb=T("$ZodBigIntFormat",(e,t)=>{Cv.init(e,t),Ep.init(e,t)}),vb=T("$ZodSymbol",(e,t)=>{ee.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),bb=T("$ZodUndefined",(e,t)=>{ee.init(e,t),e._zod.pattern=Ev,e._zod.values=new Set([void 0]),e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),Sb=T("$ZodNull",(e,t)=>{ee.init(e,t),e._zod.pattern=Sv,e._zod.values=new Set([null]),e._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),Eb=T("$ZodAny",(e,t)=>{ee.init(e,t),e._zod.parse=r=>r}),xb=T("$ZodUnknown",(e,t)=>{ee.init(e,t),e._zod.parse=r=>r}),Ab=T("$ZodNever",(e,t)=>{ee.init(e,t),e._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),_b=T("$ZodVoid",(e,t)=>{ee.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),Tb=T("$ZodDate",(e,t)=>{ee.init(e,t),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,a=n instanceof Date;return a&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...a?{received:"Invalid Date"}:{},inst:e}),r}});function Tw(e,t,r){e.issues.length&&t.issues.push(...Mt(r,e.issues)),t.value[r]=e.value}var Cb=T("$ZodArray",(e,t)=>{ee.init(e,t),e._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let a=[];for(let o=0;o<n.length;o++){let s=n[o],u=t.element._zod.run({value:s,issues:[]},i);u instanceof Promise?a.push(u.then(d=>Tw(d,r,o))):Tw(u,r,o)}return a.length?Promise.all(a).then(()=>r):r}});function bp(e,t,r,i,n,a){let o=r in i;if(e.issues.length){if(n&&a&&!o)return;t.issues.push(...Mt(r,e.issues))}if(!o&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?o&&(t.value[r]=void 0):t.value[r]=e.value}function zw(e){let t=Object.keys(e.shape);for(let i of t)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=zy(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Bw(e,t,r,i,n,a){let o=[],s=n.keySet,u=n.catchall._zod,d=u.def.type,p=u.optin==="optional",g=u.optout==="optional";for(let h in t){if(h==="__proto__"||s.has(h))continue;if(d==="never"){o.push(h);continue}let l=u.run({value:t[h],issues:[]},i);l instanceof Promise?e.push(l.then(m=>bp(m,r,h,t,p,g))):bp(l,r,h,t,p,g)}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>r):r}var Vw=T("$ZodObject",(e,t)=>{if(ee.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...s};return Object.defineProperty(t,"shape",{value:u}),u}})}let i=Po(()=>zw(t));ce(e._zod,"propValues",()=>{let s=t.shape,u={};for(let d in s){let p=s[d]._zod;if(p.values){u[d]??(u[d]=new Set);for(let g of p.values)u[d].add(g)}}return u});let n=ma,a=t.catchall,o;e._zod.parse=(s,u)=>{o??(o=i.value);let d=s.value;if(!n(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;s.value={};let p=[],g=o.shape;for(let h of o.keys){let l=g[h],m=l._zod.optin==="optional",f=l._zod.optout==="optional",y=l._zod.run({value:d[h],issues:[]},u);y instanceof Promise?p.push(y.then(v=>bp(v,s,h,d,m,f))):bp(y,s,h,d,m,f)}return a?Bw(p,d,s,u,i.value,e):p.length?Promise.all(p).then(()=>s):s}}),Ib=T("$ZodObjectJIT",(e,t)=>{Vw.init(e,t);let r=e._zod.parse,i=Po(()=>zw(t)),n=h=>{let l=new Yc(["shape","payload","ctx"]),m=i.value,f=A=>{let x=ep(A);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};l.write("const input = payload.value;");let y=Object.create(null),v=0;for(let A of m.keys)y[A]=`key_${v++}`;l.write("const newResult = {};");for(let A of m.keys){let x=y[A],_=ep(A),C=h[A],R=C?._zod?.optin==="optional",W=C?._zod?.optout==="optional";l.write(`const ${x} = ${f(A)};`),R&&W?l.write(`
|
|
@@ -336,9 +336,9 @@ ${kA}
|
|
|
336
336
|
`).replace(/^\n+/,"").replace(/\n+$/,`
|
|
337
337
|
`)}Wr(Da,"collapseBlankLines");function xf(e,t){if(t===void 0)return e;if(t==="minimal")return UO(e);if(t==="compact")return zO(e);let r=parseInt(t,10);return Number.isNaN(r)||r<=0?e:BO(e,r)}Wr(xf,"applyBudget");var yH=Object.defineProperty,VA=(e,t)=>yH(e,"name",{value:t,configurable:!0}),GA=!1;function WA(){GA=!0}VA(WA,"markAgentFailureRendered");function vH(){return GA}VA(vH,"agentFailureRendered");function bH(){GA=!1}VA(bH,"resetAgentFailureLatch");var SH=Object.defineProperty,Mi=(e,t)=>SH(e,"name",{value:t,configurable:!0});function VO(e,t){switch(e.state){case"unstamped":case"incomplete":return!0;case"installed":return e.version!==t;case"missing":case"unreadable":return!1}}Mi(VO,"isSkillStale");function EH(e){return`${e.current} -> ${e.latest}`}Mi(EH,"formatUpdateAvailable");function xH(e){let t=VO(e.skill,e.current);if(!(e.update===null&&!t))return{...e.update!==null?{updateAvailable:{current:e.current,latest:e.update.latest,installSource:e.update.installSource}}:{},...t?{skillStale:!0}:{}}}Mi(xH,"buildUpdateEnvelope");function GO(e){let t=[];if(e.updateAvailable!==void 0){let{current:r,latest:i,installSource:n}=e.updateAvailable;t.push(`updateAvailable: ${r} -> ${i}`),t.push(`upgrade: ${nf(n)}`)}return e.skillStale===!0&&t.push("skillStale: true"),t.length===0?"":`${t.join(`
|
|
338
338
|
`)}
|
|
339
|
-
`}Mi(GO,"renderUpdateEnvelope");var Af,_f=!1;function AH(e){Af=e,_f=!1}Mi(AH,"armUpdateEnvelope");function _H(){Af=void 0,_f=!1}Mi(_H,"disarmUpdateEnvelope");function WO(){if(!(_f||Af===void 0)){_f=!0;try{return Af()}catch(e){cn.debug("UpdateEnvelope","Envelope source failed",{error:ge(e instanceof Error?e.message:String(e))});return}}}Mi(WO,"takeUpdateEnvelope");function As(){let e=WO();return e===void 0?"":GO(e)}Mi(As,"takeUpdateEnvelopeTail");var TH=Object.defineProperty,wa=(e,t)=>TH(e,"name",{value:t,configurable:!0}),w={success:wa(e=>e.outcome==="success","success"),error:wa(e=>e.outcome==="error","error"),empty:wa(e=>e.outcome==="empty","empty"),unsupported:wa(e=>e.outcome==="unsupported","unsupported"),successDryRun:wa(e=>e.outcome==="success"&&e.dryRun==="true","successDryRun"),successOffline:wa(e=>e.outcome==="success"&&e.offline==="true","successOffline"),errorWithCode:wa(e=>t=>t.outcome==="error"&&t.errorCode===e,"errorWithCode")};var CH=Object.defineProperty,IH=(e,t)=>CH(e,"name",{value:t,configurable:!0}),DH=["account deploy","add","agent install-skill","agent session-context","apps create","apps describe","apps detect","apps list","assets compliance","assets list","assets show","assets summary","aws exec","build","ci run","ci setup","ci status","ci token create","ci token list","ci token revoke","ci verify","compliance fix","compliance fix --execute","connect","connect status","costs show","create account","create app","create domain","create org","deploy","deploy diff","deploy logs","deployments cancel","deployments force-release","deployments list","destroy","dev down","dev list","dev substrate down","dev up","domain","domain create","domain delegate","domain deploy","domain destroy","domain eject","domain export","domain import","domain list","domain records list","domain sync","domain verify","drift detect","drift repair","drift resume","fjall","history","home","import","list","login","metrics show","migrate identity","modify","org bind","org deploy","org get","org identity setup-google","platform deploy","remove","restore","secrets delete","secrets exec","secrets export","secrets get","secrets import","secrets list","secrets set","services","status","target get","target list","target set","token create","token list","token revoke","token show","tunnel","undo","unlock bucket","user add","user list","user rebind","user remove","validate"],wH=new Set(DH);function Tf(e){return typeof e=="string"&&wH.has(e)}IH(Tf,"isAgentWriterSurface");var Bu="fjall";var kH=Object.defineProperty,NH=(e,t)=>kH(e,"name",{value:t,configurable:!0}),KO=[{command:Bu,match:w.error,templates:["Run `fjall --help` to list the available commands"]},{command:"home",match:w.success,templates:["Run `fjall apps describe <name>` to see app details","Run `fjall deploy <name>` to deploy","Run `fjall status <name>` to check a specific app"]},{command:"home",match:w.empty,templates:[`Run \`${te.createApplicationAgent} --name "<name>"\` to create your first app`,`Run \`${te.connect}\` to connect an AWS account`]},{command:"apps list",match:w.success,templates:["Run `fjall apps describe <name>` to see app details","Run `fjall deploy <name>` to deploy",`Run \`${te.createApplicationAgent} --name "<name>"\` to create a new app`]},{command:"apps list",match:w.empty,templates:[`Run \`${te.createApplicationAgent} --name "<name>"\` to create your first app`,`Run \`${te.connect}\` to connect an AWS account first`]},{command:"apps describe",match:w.success,templates:["Run `fjall deploy <app>` to deploy","Run `fjall secrets list --app <app>` to list secrets","Run `fjall status <app>` to check health"]},{command:"apps detect",match:w.empty,templates:["Run `fjall apps detect <path> --agent` against the directory holding the application, if this was the repository root","Pass `--pattern staticsite` with `--source`, `--build-command` and `--output-dir` explicitly if the app has no recognised framework dependency"]},{command:"apps detect",match:w.success,templates:[`Run \`${te.createApplicationAgent} --name <name> --pattern <pattern>\` using the \`pattern\` column \u2014 never the \`framework\` column`,"Skip any row whose `role` is `library` \u2014 those are not deployable applications","Confirm `outputDir` exists after building: it is a framework convention, not a verified path"]},{command:"apps create",match:w.successOffline,templates:["Run `npm install` in the app directory \u2014 `--offline` skipped it",`Re-run \`${te.createApplicationAgent}\` without \`--offline\` once you have credentials, to register the app`,"Run `fjall deploy <app>` only after both of the above"]},{command:"apps create",match:w.success,templates:["Run `fjall deploy <app>` to deploy your new app","Run `fjall secrets set --app <app> DB_URL=<url>` to configure secrets"]},{command:"status",match:w.success,templates:["Run `fjall deploy <app>` to deploy","Run `fjall apps describe <app>` for details"]},{command:"deploy",match:w.success,templates:["Run `fjall status <app>` to check health","Run `fjall apps describe <app>` for full details"]},{command:"deploy",match:w.error,templates:["Run `fjall deploy <app>` to retry","Run `fjall status <app>` to check current state"]},{command:"destroy",match:w.success,templates:["Run `fjall list` to see remaining resources","Run `fjall apps list` to see remaining apps"]},{command:"destroy",match:w.error,templates:["Run `fjall destroy <app> --skip-confirmation` to force destroy","Run `fjall status <app>` to check current state"]},{command:"build",match:w.success,templates:["Run `fjall deploy <app> --image-tag <tag>` with a tag from `artefacts` to roll out this build","Run `fjall status <app>` to check health"]},{command:"connect",match:NH(e=>e.outcome==="success"&&e.pending==="true","match"),templates:["Run `fjall connect status --external-id <externalId> --wait` to block until the stack completes"]},{command:"connect",match:w.success,templates:[`Run \`${te.accountDeploy}\` or \`${te.organisationDeploy}\` to deploy infrastructure`,`Run \`${te.createApplicationAgent} --name "<name>"\` to create an app`]},{command:"connect status",match:w.success,templates:["Run `fjall connect status --external-id <id> --wait` to block until a pending stack completes",`Run \`${te.accountDeploy}\` or \`${te.organisationDeploy}\` to deploy infrastructure`]},{command:"connect status",match:w.empty,templates:[`Run \`${te.connect}\` to connect an AWS account`]},{command:"login",match:w.success,templates:["Run `fjall apps list` to see your applications",`Run \`${te.connect}\` to connect an AWS account`]},{command:"list",match:w.success,templates:["Run `fjall apps describe <name>` for app details","Run `fjall deploy <name>` to deploy"]},{command:"add",match:w.success,templates:["Run `fjall deploy <app>` to deploy the change","Run `fjall apps describe <app>` to see updated resources"]},{command:"modify",match:w.success,templates:["Run `fjall validate --deep --app <app>` to typecheck the edited infrastructure.ts","Run `fjall deploy <app>` to deploy the change","Run `fjall undo --app <app>` to restore the .bak sidecar if the edit was wrong"]},{command:"remove",match:w.success,templates:["Run `fjall validate --deep --app <app>` to confirm nothing still references the removed resource","Run `fjall deploy <app>` to deploy the change","Run `fjall undo --app <app>` to restore the .bak sidecar if the removal was wrong"]},{command:"validate",match:w.success,templates:["Run `fjall deploy <app>` to deploy the validated infrastructure"]},{command:"validate",match:w.error,templates:["Run `fjall undo --app <app>` to restore the most recent .bak sidecar","Run `fjall history --app <app>` to list older snapshots to restore from"]},{command:"undo",match:w.success,templates:["Run `fjall validate --deep --app <app>` to confirm the restored infrastructure.ts typechecks","Run `fjall history --app <app>` to restore an older snapshot instead"]},{command:"history",match:w.success,templates:["Run `fjall history --restore <timestamp> --app <app>` to restore a specific snapshot","Run `fjall undo --app <app>` to restore the most recent .bak sidecar instead"]},{command:"history",match:w.empty,templates:["No snapshots yet \u2014 `fjall add`, `fjall modify` and `fjall remove` each write one before editing infrastructure.ts"]},{command:"tunnel",match:w.success,templates:["Run `fjall tunnel <app> --background` to run in the background"]}];var ZO=[{command:"secrets list",match:w.success,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to set a secret","Run `fjall rollout <app>` to restart running services with the latest values"]},{command:"secrets list",match:w.empty,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to add a secret","Run `fjall secrets import --app <app> <file>` to bulk import"]},{command:"secrets get",match:w.success,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to update","Run `fjall secrets list --app <app>` to see all secrets"]},{command:"secrets set",match:w.success,templates:["Run `fjall rollout <app>` to restart running services with the new value","New key? Run a full `fjall deploy <app>` so the task definition gains the reference","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets delete",match:w.success,templates:["Declared for a service? Re-run with `--remove-declaration` (or edit infrastructure.ts ssmSecrets), then `fjall deploy <app>` \u2014 a stale declaration breaks task launches","Not declared anywhere? Run `fjall rollout <app>` so running services drop the previous value","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets import",match:w.success,templates:["Run `fjall rollout <app>` to restart running services with the imported values","New keys? Run a full `fjall deploy <app>` so task definitions gain the references","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets export",match:w.success,templates:["Run `fjall secrets list --app <app>` to see all secret names","Run `fjall secrets import --app <app> <file>` to restore"]},{command:"secrets exec",match:w.success,templates:["Run `fjall secrets list --app <app>` to see available secrets"]}];var PH=Object.defineProperty,RH=(e,t)=>PH(e,"name",{value:t,configurable:!0});var qO="identity-only organisation deploys typically take 2-5 minutes",KA=`Run \`${te.organisationDeploy}\` to apply the change (${qO}).`,qpe=`Deploy the organisation now to apply this change? (${qO})`,OH="Groups have no members",_s="fjall user add <email> --group <group>",$H=_s,Hpe=`${OH} \u2014 run \`${$H}\` to declare access.`;function jH(e,t){return`Declared identity (source "${e}"): ${String(t)} user${t===1?"":"s"}`}RH(jH,"formatUserListHeading");var Jpe=`No users or memberships declared. Run \`${_s}\` to add one.`;var HO=[{command:"user list",match:w.success,templates:[`Run \`${_s}\` to grant access`,`Run \`${te.organisationDeploy}\` to apply declared changes`]},{command:"user list",match:w.empty,templates:[`Run \`${_s}\` to declare the first membership`]},{command:"user add",match:w.success,templates:[KA,"Run `fjall user list` to review the declared users"]},{command:"user remove",match:w.success,templates:[KA,"Run `fjall user list` to see the remaining users"]},{command:"user rebind",match:w.success,templates:[`Run \`${te.organisationDeploy}\` to re-resolve external users against the identity store`]},{command:"org identity setup-google",match:w.success,templates:[`Run \`${_s} --live\` to declare access for a synced user`,"Run `fjall user list --live` to compare declared memberships against the identity store"]},{command:"token create",match:w.success,templates:["Run `fjall token list` to see all tokens","Save the token now \u2014 it cannot be retrieved again"]},{command:"token list",match:w.success,templates:["Run `fjall token create --name <name> --scope <scope> --expires <duration>` to create a token","Run `fjall token revoke <id>` to revoke a token"]},{command:"token show",match:w.success,templates:["Run `fjall token revoke <id>` to revoke this token","Run `fjall token list` to see all tokens"]},{command:"token revoke",match:w.success,templates:["Run `fjall token list` to see remaining tokens"]},{command:"target list",match:w.success,templates:["Run `fjall target set <name>` to change active target","Run `fjall deploy <app>` to deploy to the active target","Run `fjall apps list` to see applications"]},{command:"target list",match:w.empty,templates:[`Run \`${te.connect}\` to connect an AWS account`,`Run \`${te.login}\` to authenticate if not logged in`]},{command:"org bind",match:w.success,templates:["Run `fjall org get` to confirm the organisation's regions and accounts","Commit fjall-config.json so every checkout of this project carries the binding"]},{command:"org get",match:w.success,templates:["Run `fjall target list` to see which account/region pairs are deployable","Run `fjall accounts list` to see application-hosting accounts only"]},{command:"target get",match:w.success,templates:["Run `fjall target set <name>` to change active target","Run `fjall target list` to see all targets"]},{command:"target get",match:w.empty,templates:["Run `fjall target set <name>` to set a target","Run `fjall target list` to see available targets"]},{command:"target set",match:w.success,templates:["Run `fjall deploy <app>` to deploy to this target","Run `fjall target get` to verify the active target"]},{command:"target set",match:w.errorWithCode("NOT_FOUND"),templates:["Run `fjall target list` to see available targets",`Run \`${te.connect}\` to connect an AWS account if none available`]}];import{platform as nJ,arch as iJ}from"os";import*as Re from"fs";import*as Nt from"path";var MH=Object.defineProperty,Cf=(e,t)=>MH(e,"name",{value:t,configurable:!0});function FH(e){return e.success===!0}Cf(FH,"isSuccess");function LH(e){return e.success===!1}Cf(LH,"isFailure");function ka(e){return{success:!0,data:e}}Cf(ka,"success");function un(e){return{success:!1,error:e}}Cf(un,"failure");var UH=Object.defineProperty,If=(e,t)=>UH(e,"name",{value:t,configurable:!0}),zH=If(e=>{try{return JSON.stringify(e)}catch{return"[unserializable]"}},"safeStringify"),JO=If((e,t,r,i)=>{let n=new Date().toISOString(),a=e.toUpperCase(),o=i?` ${zH(i)}`:"";process.stderr.write(`[${n}] [${a}] [${t}] ${r}${o}
|
|
339
|
+
`}Mi(GO,"renderUpdateEnvelope");var Af,_f=!1;function AH(e){Af=e,_f=!1}Mi(AH,"armUpdateEnvelope");function _H(){Af=void 0,_f=!1}Mi(_H,"disarmUpdateEnvelope");function WO(){if(!(_f||Af===void 0)){_f=!0;try{return Af()}catch(e){cn.debug("UpdateEnvelope","Envelope source failed",{error:ge(e instanceof Error?e.message:String(e))});return}}}Mi(WO,"takeUpdateEnvelope");function As(){let e=WO();return e===void 0?"":GO(e)}Mi(As,"takeUpdateEnvelopeTail");var TH=Object.defineProperty,wa=(e,t)=>TH(e,"name",{value:t,configurable:!0}),w={success:wa(e=>e.outcome==="success","success"),error:wa(e=>e.outcome==="error","error"),empty:wa(e=>e.outcome==="empty","empty"),unsupported:wa(e=>e.outcome==="unsupported","unsupported"),successDryRun:wa(e=>e.outcome==="success"&&e.dryRun==="true","successDryRun"),successOffline:wa(e=>e.outcome==="success"&&e.offline==="true","successOffline"),errorWithCode:wa(e=>t=>t.outcome==="error"&&t.errorCode===e,"errorWithCode")};var CH=Object.defineProperty,IH=(e,t)=>CH(e,"name",{value:t,configurable:!0}),DH=["account deploy","add","agent install-skill","agent session-context","apps create","apps describe","apps detect","apps list","assets compliance","assets list","assets show","assets summary","aws exec","build","ci run","ci setup","ci status","ci token create","ci token list","ci token revoke","ci verify","compliance fix","compliance fix --execute","connect","connect status","costs show","create account","create app","create domain","create org","deploy","deploy diff","deploy logs","deployments cancel","deployments force-release","deployments list","destroy","dev down","dev list","dev substrate down","dev up","domain","domain create","domain delegate","domain deploy","domain destroy","domain eject","domain export","domain import","domain list","domain records list","domain sync","domain verify","drift detect","drift repair","drift resume","fjall","history","home","import","list","login","metrics show","migrate identity","modify","org bind","org deploy","org get","org identity setup-google","platform deploy","remove","restore","secrets delete","secrets exec","secrets export","secrets get","secrets import","secrets list","secrets set","services","status","target get","target list","target set","token create","token list","token revoke","token show","tunnel","undo","unlock bucket","user add","user list","user rebind","user remove","validate"],wH=new Set(DH);function Tf(e){return typeof e=="string"&&wH.has(e)}IH(Tf,"isAgentWriterSurface");var Bu="fjall";var kH=Object.defineProperty,NH=(e,t)=>kH(e,"name",{value:t,configurable:!0}),KO=[{command:Bu,match:w.error,templates:["Run `fjall --help` to list the available commands"]},{command:"home",match:w.success,templates:["Run `fjall apps describe <name>` to see app details","Run `fjall deploy <name>` to deploy","Run `fjall status <name>` to check a specific app"]},{command:"home",match:w.empty,templates:[`Run \`${te.createApplicationAgent} --name "<name>"\` to create your first app`,`Run \`${te.connect}\` to connect an AWS account`]},{command:"apps list",match:w.success,templates:["Run `fjall apps describe <name>` to see app details","Run `fjall deploy <name>` to deploy",`Run \`${te.createApplicationAgent} --name "<name>"\` to create a new app`]},{command:"apps list",match:w.empty,templates:[`Run \`${te.createApplicationAgent} --name "<name>"\` to create your first app`,`Run \`${te.connect}\` to connect an AWS account first`]},{command:"apps describe",match:w.success,templates:["Run `fjall deploy <app>` to deploy","Run `fjall secrets list --app <app>` to list secrets","Run `fjall status <app>` to check health"]},{command:"apps detect",match:w.empty,templates:["Run `fjall apps detect <path> --agent` against the directory holding the application, if this was the repository root","Pass `--pattern staticsite` with `--source`, `--build-command` and `--output-dir` explicitly if the app has no recognised framework dependency"]},{command:"apps detect",match:w.success,templates:[`Run \`${te.createApplicationAgent} --name <name> --pattern <pattern>\` using the \`pattern\` column \u2014 never the \`framework\` column`,"Skip any row whose `role` is `library` \u2014 those are not deployable applications","Confirm `outputDir` exists after building: it is a framework convention, not a verified path"]},{command:"apps create",match:w.successOffline,templates:["Run `npm install` in the app directory \u2014 `--offline` skipped it",`Re-run \`${te.createApplicationAgent}\` without \`--offline\` once you have credentials, to register the app`,"Run `fjall deploy <app>` only after both of the above"]},{command:"apps create",match:w.success,templates:["Run `fjall deploy <app>` to deploy your new app","Run `fjall secrets set --app <app> DB_URL=<url>` to configure secrets"]},{command:"status",match:w.success,templates:["Run `fjall deploy <app>` to deploy","Run `fjall apps describe <app>` for details"]},{command:"deploy",match:w.success,templates:["Run `fjall status <app>` to check health","Run `fjall apps describe <app>` for full details"]},{command:"deploy",match:w.error,templates:["Run `fjall deploy <app>` to retry","Run `fjall status <app>` to check current state"]},{command:"destroy",match:w.success,templates:["Run `fjall list` to see remaining resources","Run `fjall apps list` to see remaining apps"]},{command:"destroy",match:w.error,templates:["Run `fjall destroy <app> --skip-confirmation` to force destroy","Run `fjall status <app>` to check current state"]},{command:"build",match:w.success,templates:["Run `fjall deploy <app> --image-tag <tag>` with a tag from `artefacts` to roll out this build","Run `fjall status <app>` to check health"]},{command:"connect",match:NH(e=>e.outcome==="success"&&e.pending==="true","match"),templates:["Run `fjall connect status --external-id <externalId> --wait` to block until the stack completes"]},{command:"connect",match:w.success,templates:[`Run \`${te.accountDeploy}\` or \`${te.organisationDeploy}\` to deploy infrastructure`,`Run \`${te.createApplicationAgent} --name "<name>"\` to create an app`]},{command:"connect status",match:w.success,templates:["Run `fjall connect status --external-id <id> --wait` to block until a pending stack completes",`Run \`${te.accountDeploy}\` or \`${te.organisationDeploy}\` to deploy infrastructure`]},{command:"connect status",match:w.empty,templates:[`Run \`${te.connect}\` to connect an AWS account`]},{command:"login",match:w.success,templates:["Run `fjall apps list` to see your applications",`Run \`${te.connect}\` to connect an AWS account`]},{command:"list",match:w.success,templates:["Run `fjall apps describe <name>` for app details","Run `fjall deploy <name>` to deploy"]},{command:"add",match:w.success,templates:["Run `fjall deploy <app>` to deploy the change","Run `fjall apps describe <app>` to see updated resources"]},{command:"modify",match:w.success,templates:["Run `fjall validate --deep --app <app>` to typecheck the edited infrastructure.ts","Run `fjall deploy <app>` to deploy the change","Run `fjall undo --app <app>` to restore the .bak sidecar if the edit was wrong"]},{command:"remove",match:w.success,templates:["Run `fjall validate --deep --app <app>` to confirm nothing still references the removed resource","Run `fjall deploy <app>` to deploy the change","Run `fjall undo --app <app>` to restore the .bak sidecar if the removal was wrong"]},{command:"validate",match:w.success,templates:["Run `fjall deploy <app>` to deploy the validated infrastructure"]},{command:"validate",match:w.error,templates:["Run `fjall undo --app <app>` to restore the most recent .bak sidecar","Run `fjall history --app <app>` to list older snapshots to restore from"]},{command:"undo",match:w.success,templates:["Run `fjall validate --deep --app <app>` to confirm the restored infrastructure.ts typechecks","Run `fjall history --app <app>` to restore an older snapshot instead"]},{command:"history",match:w.success,templates:["Run `fjall history --restore <timestamp> --app <app>` to restore a specific snapshot","Run `fjall undo --app <app>` to restore the most recent .bak sidecar instead"]},{command:"history",match:w.empty,templates:["No snapshots yet \u2014 `fjall add`, `fjall modify` and `fjall remove` each write one before editing infrastructure.ts"]},{command:"tunnel",match:w.success,templates:["Run `fjall tunnel <app> --background` to run in the background"]}];var ZO=[{command:"secrets list",match:w.success,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to set a secret","Run `fjall rollout <app>` to restart running services with the latest values"]},{command:"secrets list",match:w.empty,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to add a secret","Run `fjall secrets import --app <app> <file>` to bulk import"]},{command:"secrets get",match:w.success,templates:["Run `fjall secrets set --app <app> KEY=VALUE` to update","Run `fjall secrets list --app <app>` to see all secrets"]},{command:"secrets set",match:w.success,templates:["Run `fjall rollout <app>` to restart running services with the new value","New key? Run a full `fjall deploy <app>` so the task definition gains the reference","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets delete",match:w.success,templates:["Declared for a service? Re-run with `--remove-declaration` (or edit infrastructure.ts ssmSecrets), then `fjall deploy <app>` \u2014 a stale declaration breaks task launches","Not declared anywhere? Run `fjall rollout <app>` so running services drop the previous value","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets import",match:w.success,templates:["Run `fjall rollout <app>` to restart running services with the imported values","New keys? Run a full `fjall deploy <app>` so task definitions gain the references","Run `fjall secrets list --app <app>` to verify"]},{command:"secrets export",match:w.success,templates:["Run `fjall secrets list --app <app>` to see all secret names","Run `fjall secrets import --app <app> <file>` to restore"]},{command:"secrets exec",match:w.success,templates:["Run `fjall secrets list --app <app>` to see available secrets"]}];var PH=Object.defineProperty,RH=(e,t)=>PH(e,"name",{value:t,configurable:!0});var qO="identity-only organisation deploys typically take 2-5 minutes",KA=`Run \`${te.organisationDeploy}\` to apply the change (${qO}).`,Hpe=`Deploy the organisation now to apply this change? (${qO})`,OH="Groups have no members",_s="fjall user add <email> --group <group>",$H=_s,Jpe=`${OH} \u2014 run \`${$H}\` to declare access.`;function jH(e,t){return`Declared identity (source "${e}"): ${String(t)} user${t===1?"":"s"}`}RH(jH,"formatUserListHeading");var Xpe=`No users or memberships declared. Run \`${_s}\` to add one.`;var HO=[{command:"user list",match:w.success,templates:[`Run \`${_s}\` to grant access`,`Run \`${te.organisationDeploy}\` to apply declared changes`]},{command:"user list",match:w.empty,templates:[`Run \`${_s}\` to declare the first membership`]},{command:"user add",match:w.success,templates:[KA,"Run `fjall user list` to review the declared users"]},{command:"user remove",match:w.success,templates:[KA,"Run `fjall user list` to see the remaining users"]},{command:"user rebind",match:w.success,templates:[`Run \`${te.organisationDeploy}\` to re-resolve external users against the identity store`]},{command:"org identity setup-google",match:w.success,templates:[`Run \`${_s} --live\` to declare access for a synced user`,"Run `fjall user list --live` to compare declared memberships against the identity store"]},{command:"token create",match:w.success,templates:["Run `fjall token list` to see all tokens","Save the token now \u2014 it cannot be retrieved again"]},{command:"token list",match:w.success,templates:["Run `fjall token create --name <name> --scope <scope> --expires <duration>` to create a token","Run `fjall token revoke <id>` to revoke a token"]},{command:"token show",match:w.success,templates:["Run `fjall token revoke <id>` to revoke this token","Run `fjall token list` to see all tokens"]},{command:"token revoke",match:w.success,templates:["Run `fjall token list` to see remaining tokens"]},{command:"target list",match:w.success,templates:["Run `fjall target set <name>` to change active target","Run `fjall deploy <app>` to deploy to the active target","Run `fjall apps list` to see applications"]},{command:"target list",match:w.empty,templates:[`Run \`${te.connect}\` to connect an AWS account`,`Run \`${te.login}\` to authenticate if not logged in`]},{command:"org bind",match:w.success,templates:["Run `fjall org get` to confirm the organisation's regions and accounts","Commit fjall-config.json so every checkout of this project carries the binding"]},{command:"org get",match:w.success,templates:["Run `fjall target list` to see which account/region pairs are deployable","Run `fjall accounts list` to see application-hosting accounts only"]},{command:"target get",match:w.success,templates:["Run `fjall target set <name>` to change active target","Run `fjall target list` to see all targets"]},{command:"target get",match:w.empty,templates:["Run `fjall target set <name>` to set a target","Run `fjall target list` to see available targets"]},{command:"target set",match:w.success,templates:["Run `fjall deploy <app>` to deploy to this target","Run `fjall target get` to verify the active target"]},{command:"target set",match:w.errorWithCode("NOT_FOUND"),templates:["Run `fjall target list` to see available targets",`Run \`${te.connect}\` to connect an AWS account if none available`]}];import{platform as nJ,arch as iJ}from"os";import*as Re from"fs";import*as Nt from"path";var MH=Object.defineProperty,Cf=(e,t)=>MH(e,"name",{value:t,configurable:!0});function FH(e){return e.success===!0}Cf(FH,"isSuccess");function LH(e){return e.success===!1}Cf(LH,"isFailure");function ka(e){return{success:!0,data:e}}Cf(ka,"success");function un(e){return{success:!1,error:e}}Cf(un,"failure");var UH=Object.defineProperty,If=(e,t)=>UH(e,"name",{value:t,configurable:!0}),zH=If(e=>{try{return JSON.stringify(e)}catch{return"[unserializable]"}},"safeStringify"),JO=If((e,t,r,i)=>{let n=new Date().toISOString(),a=e.toUpperCase(),o=i?` ${zH(i)}`:"";process.stderr.write(`[${n}] [${a}] [${t}] ${r}${o}
|
|
340
340
|
`)},"defaultWriter"),Na=JO;function BH(e){Na=e}If(BH,"configureLogWriter");function VH(){Na=JO}If(VH,"resetLogWriter");var Pa={info(e,t,r){Na("info",e,t,r)},warn(e,t,r){Na("warn",e,t,r)},error(e,t,r){Na("error",e,t,r)},debug(e,t,r){process.env.FJALL_DEBUG==="true"&&Na("debug",e,t,r)},trace(e,t,r){process.env.FJALL_TRACE==="true"&&Na("trace",e,t,r)},isDebugEnabled(){return process.env.FJALL_DEBUG==="true"}};var GH=Object.defineProperty,Vu=(e,t)=>GH(e,"name",{value:t,configurable:!0}),WH=10;var QO=c.object({name:c.string(),type:c.enum(["apex","delegated"]),parentDomain:c.string().optional(),account:c.string().optional(),region:c.string().optional()}).strict(),e$=c.object({id:c.string().min(1),name:c.string().min(1).optional()}).strict(),t$=c.object({activeTarget:c.string().optional(),domains:c.array(QO).optional(),capacityIdentity:Mm.optional(),organisation:e$.optional()}).strict(),XO=c.object({activeTarget:c.string().optional(),domains:c.array(QO).optional(),capacityIdentity:Mm.optional(),organisation:e$.optional()}),KH=c.object({activeTarget:c.string().optional()});function r$(e={}){return JSON.stringify(e,null,2)}Vu(r$,"serialiseRootConfig");var YO=t$.keyof().options;function n$(e,t,r){let i=t[r];i!==void 0&&(e[r]=i)}Vu(n$,"copyDefinedKey");function ZA(e,t){if(t===void 0)return!1;let r=new Set([...Object.keys(e),...Object.keys(t)]);for(let i of r)if(e[i]!==t[i])return!1;return!0}Vu(ZA,"domainEntriesEqual");var Df=class e{static{Vu(this,"Config")}rootConfig;configPath=null;loadFailed=!1;parseDegraded=!1;loadedSnapshot={};constructor(t,r){this.rootConfig=t??{},this.configPath=r??null}static findConfigDirectory(t){let r=t!==void 0&&t!==""?t:process.cwd();for(let i=0;i<WH;i++){let n=Nt.join(r,"fjall"),a=Nt.join(n,Wn);if(Re.existsSync(a))return n;let o=Nt.join(r,Wn);if(Re.existsSync(o))return r;let s=Nt.dirname(r);if(s===r)break;r=s}return null}static loadConfigFile(t){try{return Re.accessSync(t,Re.constants.R_OK),Re.readFileSync(t,{encoding:"utf8"})}catch(r){return Pa.warn("Config",`Config file at ${t} could not be read; using defaults`,{file:t,error:ge(qe(r))}),null}}static loadConfig(t){let r=e.findConfigDirectory(t);if(!r)return new e;let i=Nt.join(r,Wn),n=e.loadConfigFile(i);if(n===null){let u=new e(void 0,i);return u.loadFailed=!0,u}let a,o=!1;if(n!==""){let u;try{u=JSON.parse(n)}catch(p){throw e.formatZodError(p,Wn)}let d=t$.safeParse(u);if(d.success)a=d.data;else{let p=XO.safeParse(u);a=p.success?p.data:{},o=!p.success,p.success?Pa.warn("Config","fjall-config.json contains keys this version does not recognise (only activeTarget, domains, capacityIdentity and organisation are read). They were most likely written by a newer fjall version \u2014 leave them in place; saves preserve them verbatim.",{file:i}):Pa.warn("Config","fjall-config.json has a malformed activeTarget, domains or capacityIdentity value, so its contents were ignored for this run \u2014 any capacity-identity pins it holds will NOT apply (a pinned stack deploys unpinned and is blocked by the rename gate). Fix the file by hand; do NOT regenerate it, which would discard the pins.",{file:i})}}let s=new e(a,i);return s.parseDegraded=o,s.loadedSnapshot=structuredClone(s.rootConfig),s}static formatZodError(t,r){if(t instanceof c.ZodError&&t.issues.length>0){let n=t.issues.map(a=>`${a.path.join(".")}: ${a.message}`).join("; ");return new Error(`Failed to parse ${r}: ${n}`)}let i=(t instanceof Error?t.message:String(t)).replace(/\n/g," ").substring(0,500);return new Error(`Failed to parse ${r}: ${i}`)}saveConfig(){let t=Nt.join(this.resolveProjectDirectory()??Nt.join(process.cwd(),"fjall"),Wn);if(this.loadFailed)return un(new Error(`Refusing to save ${t}: the file exists but could not be read when this config loaded, so saving would replace its contents with state that never included them. Fix the file permissions (e.g. chmod u+rw ${t}) and retry.`));let r=Nt.dirname(t);try{Re.mkdirSync(r,{recursive:!0})}catch(s){return un(new Error(`Cannot create config directory ${r}: ${ge(qe(s))}`))}let i=e.assertWritable(t,r);if(!i.success)return i;let n=this.mergeWithDisk(t);if(!n.success)return n;let a=r$(n.data),o=`${t}.tmp-${process.pid}`;try{Re.writeFileSync(o,a,{mode:384}),Re.renameSync(o,t)}catch(s){return un(new Error(`Failed to save ${t}: ${ge(qe(s))}`))}return this.configPath=t,ka(void 0)}static assertWritable(t,r){if(Re.existsSync(t))try{Re.accessSync(t,Re.constants.W_OK)}catch{return un(new Error(`Cannot save ${t}: the file is read-only. Make it writable (e.g. chmod u+w ${t}) and retry.`))}try{Re.accessSync(r,Re.constants.W_OK)}catch{return un(new Error(`Cannot save ${t}: the directory ${r} is not writable. Make it writable (e.g. chmod u+w ${r}) and retry.`))}return ka(void 0)}mergeWithDisk(t){let r=e.readDiskConfigForMerge(t);if(r.kind==="unmergeable")return un(new Error(`Refusing to save ${t}: ${r.reason}. Writing now would keep only this session's state and drop everything else the file carries (including keys written by other fjall versions). Fix or remove the file and retry.`));if(r.kind==="absent")return ka(this.rootConfig);let i=r.disk,n={...i.foreign,...i.known};for(let o of YO)o!=="domains"&&this.sessionChangedKey(o)&&(this.rootConfig[o]===void 0?delete n[o]:n$(n,this.rootConfig,o));let a=this.mergeDomains(i.known.domains);return a!==void 0?n.domains=a:delete n.domains,ka(n)}sessionChangedKey(t){return JSON.stringify(this.rootConfig[t])!==JSON.stringify(this.loadedSnapshot[t])}mergeDomains(t){let r=this.rootConfig.domains,i=this.loadedSnapshot.domains??[];if(r===void 0&&i.length===0)return t;let n=Vu(p=>p.toLowerCase(),"norm"),a=r??[],o=new Map(i.map(p=>[n(p.name),p])),s=new Map(a.map(p=>[n(p.name),p])),u=[],d=new Set;for(let p of t??[]){let g=n(p.name);d.add(g);let h=s.get(g),l=o.get(g);if(h!==void 0&&!ZA(h,l)){u.push(h);continue}h===void 0&&l!==void 0||u.push(p)}for(let p of a){let g=n(p.name);d.has(g)||ZA(p,o.get(g))||u.push(p)}return u}static readDiskConfigForMerge(t){if(!Re.existsSync(t))return{kind:"absent"};let r;try{let a=Re.readFileSync(t,{encoding:"utf8"});if(a==="")return{kind:"absent"};r=JSON.parse(a)}catch(a){return{kind:"unmergeable",reason:`the existing file could not be read or parsed as JSON (${ge(qe(a))})`}}let i=XO.safeParse(r);if(!i.success){let a=i.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`).join("; ");return{kind:"unmergeable",reason:`a recognised key in the existing file is malformed (${ge(a)})`}}let n={};if(typeof r=="object"&&r!==null){let a=YO;for(let[o,s]of Object.entries(r))a.includes(o)||(n[o]=s)}return{kind:"ok",disk:{known:i.data,foreign:n}}}static getConfigDirectory(t){return e.findConfigDirectory(t)}getConfigPath(){return this.configPath}isContentUnavailable(){return this.loadFailed||this.parseDegraded}static warnedLegacyActiveTarget=!1;localConfigCache;resolveProjectDirectory(){return this.configPath!==null?Nt.dirname(this.configPath):e.findConfigDirectory()}localConfigFile(){let t=this.resolveProjectDirectory();return t===null?null:Nt.join(t,ji,ku)}loadLocalConfig(){if(this.localConfigCache===void 0){let t=this.localConfigFile();if(t===null)return this.localConfigCache={};try{let r=Re.readFileSync(t,{encoding:"utf8"}),i=KH.safeParse(JSON.parse(r));this.localConfigCache=i.success?i.data:{}}catch{this.localConfigCache={}}}return this.localConfigCache}writeLocalConfig(t){let r=this.localConfigFile();if(r===null)return un(new Error("Cannot persist local state: no fjall-config.json was found from this directory, so there is no project to anchor `.fjall/local.json` to. Run this from inside a fjall project, or run `fjall create account` / `fjall create app` first."));try{Re.mkdirSync(Nt.dirname(r),{recursive:!0});let i=`${r}.tmp-${process.pid}`;Re.writeFileSync(i,JSON.stringify(t,null,2)+`
|
|
341
|
-
`,{encoding:"utf8"}),Re.renameSync(i,r),mf(Nt.dirname(Nt.dirname(r)),[df,...Nu],{header:xA,marker:mO})}catch(i){return un(new Error(`Failed to write ${r}: ${ge(qe(i))}`))}return this.localConfigCache=t,ka(void 0)}static warnLegacyActiveTargetOnce(){e.warnedLegacyActiveTarget||(e.warnedLegacyActiveTarget=!0,Pa.warn("Config","`activeTarget` in fjall-config.json is deprecated and ignored: a committed target must never re-aim a deploy or CI pipeline. Run `fjall target set <name>` to store it locally in .fjall/local.json, then remove `activeTarget` from the committed fjall-config.json."))}getActiveTarget(){let t=this.loadLocalConfig().activeTarget;if(t!==void 0)return t;this.rootConfig.activeTarget!==void 0&&e.warnLegacyActiveTargetOnce()}setActiveTarget(t){let r=this.loadLocalConfig();return r.activeTarget=t,this.writeLocalConfig(r)}clearActiveTarget(){let t=this.loadLocalConfig();return delete t.activeTarget,this.writeLocalConfig(t)}getDomains(){return this.rootConfig.domains??[]}setDomains(t){this.rootConfig.domains=t}addDomain(t){this.rootConfig.domains||(this.rootConfig.domains=[]),this.rootConfig.domains.push(t)}getDomain(t){return this.rootConfig.domains?.find(r=>r.name.toLowerCase()===t.toLowerCase())}removeDomain(t){if(!this.rootConfig.domains)return!1;let r=this.rootConfig.domains.findIndex(i=>i.name.toLowerCase()===t.toLowerCase());return r===-1?!1:(this.rootConfig.domains.splice(r,1),!0)}getOrganisation(){return this.rootConfig.organisation}setOrganisation(t){this.rootConfig.organisation=t}clearOrganisation(){delete this.rootConfig.organisation}};var ZH=Object.defineProperty,Fi=(e,t)=>ZH(e,"name",{value:t,configurable:!0});function qA(e){let t;try{t=Df.loadConfig(e)}catch(i){return{kind:"unreadable",reason:ge(qe(i))}}if(t.isContentUnavailable())return{kind:"unreadable",reason:"fjall-config.json exists but its contents could not be loaded (the preceding warning names the problem)"};let r=t.getOrganisation();return r!==void 0?{kind:"bound",bound:r}:t.getConfigPath()===null?{kind:"no_project"}:{kind:"unbound"}}Fi(qA,"readProjectBinding");function HA(e,t,r){switch(e.kind){case"unreadable":return e;case"no_project":return{kind:"unbound",projectFound:!1,identity:t};case"unbound":return{kind:"unbound",projectFound:!0,identity:t};case"bound":return t===null?{kind:"unverifiable",bound:e.bound,reason:r??"the organisation could not be resolved"}:e.bound.id===t.id?{kind:"matched",bound:e.bound}:{kind:"mismatched",bound:e.bound,actual:t}}}Fi(HA,"resolveBindingVerdict");function i$(e,t={}){return HA(qA(t.startDir),e,t.unresolvedReason)}Fi(i$,"checkProjectOrganisation");function Ra(e){return e.name!==void 0&&e.name!==""?`${e.name} (${e.id})`:e.id}Fi(Ra,"describeOrganisation");function a$(e,t,r){return`Refusing to ${e}: this project's fjall-config.json records organisation ${Ra(t)} as its home, but the credential in use belongs to ${Ra(r)}. Nothing was created, synthesised or deployed. Cure: authenticate as ${Ra(t)} ('fjall login', or set FJALL_API_KEY to a key for that organisation), or \u2014 if this project really is moving \u2014 run 'fjall org bind --org ${r.id} --force' to re-bind it.`}Fi(a$,"buildWrongOrganisationMessage");function o$(e,t){return`Refusing to ${e}: ${t}, so this project's organisation binding cannot be checked. Nothing was created, synthesised or deployed. Cure: fix fjall-config.json (permissions or contents), then re-run.`}Fi(o$,"buildUnreadableConfigMessage");function s$(e,t){return`Could not confirm which organisation your credential belongs to (${t}). Proceeding \u2014 this project is bound to ${Ra(e)}, and a mismatch would not have been caught.`}Fi(s$,"buildUnverifiableNotice");function c$(e){return`This project is not bound to an organisation. Run 'fjall org bind' to pin it to ${Ra(e)} \u2014 afterwards, any command run here with another organisation's credential is refused instead of silently landing there.`}Fi(c$,"buildUnboundNotice");import{createHash as JH}from"node:crypto";var qH=Object.defineProperty,HH=(e,t)=>qH(e,"name",{value:t,configurable:!0});function u$(e,t){return JH("sha256").update(`${e}${t}`).digest("hex")}HH(u$,"credentialFingerprint");import*as kf from"node:fs";var XH=Object.defineProperty,wf=(e,t)=>XH(e,"name",{value:t,configurable:!0}),l$="org-config-cache.json";function JA(){return ms(l$)}wf(JA,"orgConfigCachePath");function XA(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}wf(XA,"isObject");function YA(e){return XA(e)&&typeof e.organisationId=="string"&&e.organisationId!==""&&typeof e.organisationName=="string"}wf(YA,"isCachedCredentialIdentity");function d$(e){try{let t=JA();if(!kf.existsSync(t))return null;let r=JSON.parse(kf.readFileSync(t,"utf-8"));return!XA(r)||r.credentialFingerprint!==e?null:YA(r.identity)?r.identity:null}catch(t){return Pa.debug("cachedCredentialIdentity","Cache read failed, treating as a miss",{error:ge(qe(t))}),null}}wf(d$,"readCachedCredentialIdentity");var YH=Object.defineProperty,QH=(e,t)=>YH(e,"name",{value:t,configurable:!0}),p$="https://fjall.io";function Nf(){let e=process.env.FJALL_API_URL;return e!==void 0&&e!==""?e:p$}QH(Nf,"resolveApiBaseUrl");var m$={name:"@fjall/cli",version:"27.0.0",repository:{type:"git",url:"git+https://github.com/fjall-tech/fjall.git",directory:"cli"},description:"Fjall CLI helper",private:!0,type:"module",bin:{fjall:"dist/src/cli.js"},files:["dist/"],scripts:{clean:"rm -rf ./dist ./dist.next ./sourcemaps","clean:node":"rm -rf ./node_modules","copy-files":'DEST="${DEST:-dist}"; find generators -type d -name files | while read dir; do mkdir -p "$DEST/$dir" && cp -R "$dir/." "$DEST/$dir/"; done && cp -R src/proto "./$DEST/src/proto"',build:"rm -rf ./dist.next ./sourcemaps && npx tsc --outDir dist.next && DEST=dist.next npm run copy-files && node ../scripts/minify-dist.mjs dist.next && chmod +x ./dist.next/src/cli.js && rm -rf ./dist && mv ./dist.next ./dist && node ../scripts/stamp-build.mjs",watch:"npm run build && npx tsc-watch","watch:only":'npx tsc-watch --onSuccess "npm run copy-files"',"fjall-cli":"node ./dist/src/cli.js",version:"npx tsx scripts/updateTemplateVersions.ts && node ../scripts/sync-ci-plugin-major.mjs",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',"format:check":'prettier --check "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',lint:"eslint src/ generators/","lint:fix":"eslint src/ generators/ --fix",typecheck:"tsc --noEmit","typecheck:tests":"tsc --noEmit --project tsconfig.test.json","typecheck:scripts":"tsc --noEmit --project tsconfig.scripts.json","typecheck:all":"npm run typecheck && npm run typecheck:tests && npm run typecheck:scripts",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:integration":"vitest run --config vitest.config.integration.ts","test:integration:watch":"vitest --config vitest.config.integration.ts","test:e2e":"vitest run --config vitest.e2e.config.ts","test:all":"npm run test && npm run test:integration && npm run test:e2e","test:setup":"node scripts/setupTestFixtures.mjs","test:payload-compat":"npx tsx scripts/testPayloadCompatibility.ts","test:payload-compat:e2e":"npx tsx scripts/testPayloadCompatibility.ts --e2e"},engines:{node:">=22.0.0"},author:"",license:"SEE LICENSE IN LICENSE",devDependencies:{"@eslint/js":"^10.0.1","@playwright/test":"^1.62.0","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/ejs":"^3.1.5","@types/prompts":"^2.4.9","@types/proper-lockfile":"^4.1.4","@types/react":"^19.2.17","@typescript-eslint/parser":"^8.65.0","@vitest/coverage-v8":"^4.1.10","aws-cdk-lib":"^2.265.0",constructs:"^10.7.2",eslint:"^10.8.0","ink-testing-library":"^4.0.0",jsdom:"^30.0.1",prettier:"^3.9.6","react-dom":"^19.2.8","strip-ansi":"^6.0.1","tsc-watch":"^7.2.1",tsx:"^4.23.1","typescript-eslint":"^8.65.0",vitest:"4.1.10"},dependencies:{"@anthropic-ai/sdk":"^0.115.0","@aws-sdk/client-acm":"^3.1098.0","@aws-sdk/client-auto-scaling":"^3.1098.0","@aws-sdk/client-backup":"^3.1098.0","@aws-sdk/client-cloudformation":"^3.1098.0","@aws-sdk/client-cost-explorer":"^3.1098.0","@aws-sdk/client-ec2":"^3.1098.0","@aws-sdk/client-ecr":"^3.1098.0","@aws-sdk/client-ecs":"^3.1098.0","@aws-sdk/client-elasticache":"^3.1098.0","@aws-sdk/client-iam":"^3.1098.0","@aws-sdk/client-identitystore":"^3.1098.0","@aws-sdk/client-lambda":"^3.1098.0","@aws-sdk/client-organizations":"^3.1098.0","@aws-sdk/client-ram":"^3.1098.0","@aws-sdk/client-rds":"^3.1098.0","@aws-sdk/client-route-53":"^3.1098.0","@aws-sdk/client-s3":"^3.1098.0","@aws-sdk/client-secrets-manager":"^3.1098.0","@aws-sdk/client-ssm":"^3.1098.0","@aws-sdk/client-sso":"^3.1098.0","@aws-sdk/client-sso-admin":"^3.1098.0","@aws-sdk/client-sso-oidc":"^3.1098.0","@aws-sdk/client-sts":"^3.1098.0","@fjall/deploy-core":"^27.0.0","@fjall/generator":"^27.0.0","@fjall/util":"^27.0.0","@nx/devkit":"^23.1.0","@opennextjs/aws":"^4.1.0","@smithy/node-http-handler":"^4.9.13","@toon-format/toon":"^4.1.0","aws-cdk":"^2.1134.0",axios:"^1.19.0",chalk:"^6.0.0","cli-cursor":"^5.0.0",commander:"^15.0.0",ejs:"^6.0.1",ink:"^7.1.1","js-yaml":"^5.2.2",open:"^11.0.0",ora:"^9.4.1",prompts:"^2.4.2","proper-lockfile":"^4.1.2",protobufjs:"^8.7.1",react:"^19.2.8",typescript:"^6.0.3","update-check":"^1.5.4",zod:"^4.4.3"}};var tJ=Object.defineProperty,rJ=(e,t)=>tJ(e,"name",{value:t,configurable:!0}),Fme=`fjall-cli/${m$.version} node/${process.versions.node} ${nJ()}/${iJ()}`;var f$=Nf(),Lme=c.looseObject({deviceCode:c.string(),userCode:c.string(),verificationUri:c.string(),expiresIn:c.number(),interval:c.number()}),Ume=c.looseObject({status:c.string(),apiKey:c.string().optional(),organisationId:c.string().optional(),organisationName:c.string().optional(),email:c.string().optional()}),zme=c.looseObject({application:c.looseObject({id:c.string()})}),QA=c.looseObject({id:c.string(),name:c.string(),vpcCidr:c.string().nullable(),connectedAwsAccountId:c.string().nullable()}),Bme=c.looseObject({applications:c.array(QA),nextCursor:c.string().optional()}),Vme=c.looseObject({application:QA}),Gme=c.looseObject({applications:c.array(QA)}),Wme=c.looseObject({application:c.looseObject({id:c.string(),name:c.string()})}),Kme=c.looseObject({primaryRegion:c.string().nullish(),secondaryRegions:c.array(c.string()).optional(),disasterRecoveryRegion:c.string().nullish(),providerAccounts:c.custom(e=>Array.isArray(e)),ssoSessions:c.record(c.string(),c.looseObject({ssoRegion:c.string(),ssoStartUrl:c.string()})).optional(),rootOidcRoleArn:c.string().nullish(),allowCodemodLlmFallback:c.boolean().optional(),rootAccessManagement:c.custom(e=>typeof e=="string").optional(),requireTrackedDeploys:c.boolean().optional().catch(void 0)}),Zme=c.looseObject({id:c.string(),token:c.string(),tokenPrefix:c.string(),name:c.string(),scopes:c.array(c.string())}),aJ=c.looseObject({id:c.string(),name:c.string(),tokenPrefix:c.string(),scopes:c.array(c.string()),resourceConstraints:c.record(c.string(),c.unknown()),sourceTag:c.string().nullable(),expiresAt:c.string(),createdAt:c.string(),revokedAt:c.string().nullable(),revokedReason:c.string().nullable(),lastUsedAt:c.string().nullable(),usageCount:c.number(),deniedCount:c.number()}),qme=c.looseObject({tokens:c.array(aJ)}),Hme=c.looseObject({scopes:c.array(c.string()),expiresAt:c.string().optional()}),oJ=c.looseObject({id:c.string(),awsAccountId:c.string(),accountName:c.string().nullable(),environment:c.string().nullable()}),Jme=c.looseObject({accounts:c.array(oJ)}),sJ=c.looseObject({id:c.string(),assetIdentifier:c.string(),name:c.string(),type:c.string(),status:c.string(),region:c.string().nullish(),_count:c.looseObject({complianceIssues:c.number()}).optional()}),cJ=c.looseObject({id:c.string(),name:c.string(),assetIdentifier:c.string(),provider:c.string(),type:c.string(),status:c.string(),region:c.string().nullish(),iacStatus:c.string().nullish(),accountId:c.string().nullish(),estimatedMonthlyCost:c.string().nullish(),lastSeenAt:c.string().nullish(),createdAt:c.string().nullish(),updatedAt:c.string().nullish()}),Xme=c.looseObject({assets:c.array(sJ),nextCursor:c.string().optional()}),Yme=c.looseObject({asset:cJ}),uJ=c.looseObject({id:c.string(),ruleId:c.string(),title:c.string(),severity:c.string(),status:c.string()}),Qme=c.looseObject({issues:c.array(uJ)}),efe=c.record(c.string(),c.unknown()),tfe=c.union([c.array(c.record(c.string(),c.unknown())),c.record(c.string(),c.unknown())]),rfe=c.record(c.string(),c.unknown()),nfe=c.record(c.string(),c.unknown()),ife=c.record(c.string(),c.unknown()),afe=c.record(c.string(),c.unknown()),ofe=c.looseObject({deployment:c.looseObject({id:c.string()}),minCliVersion:c.string().optional()});var lJ=c.object({id:c.string(),releaseNumber:c.number().int(),status:c.string(),commitSha:c.string().nullable(),branch:c.string().nullable(),createdAt:c.string(),assemblyDigest:c.string().nullable(),createdByDeploymentId:c.string().nullable(),rollbackOfReleaseId:c.string().nullable(),services:c.array(of.strip())}),sfe=c.object({releases:c.array(lJ),currentReleaseId:c.string().nullable(),nextCursor:c.number().int().optional()}),dJ=c.object({id:c.string(),status:c.string(),target:c.string().nullish(),applicationId:c.string().nullish(),applicationName:c.string().nullish(),connectedAwsAccountId:c.string().nullish(),source:c.string().nullish(),startedAt:c.string().nullish(),triggeredByName:c.string().nullish(),machineLabel:c.string().nullish()}),cfe=c.object({deployments:c.array(dJ)}),ufe=c.object({cancelled:c.boolean(),message:c.string().nullish(),declined:c.boolean().nullish()}),lfe=c.object({released:c.literal(!0),id:c.string().nullish()}),dfe=c.looseObject({organisationId:c.string(),organisationName:c.string(),organisationSlug:c.string().min(1).optional()}),pfe=c.looseObject({status:c.string(),roleArn:c.string().optional(),accountId:c.string().optional(),phase:c.string().optional(),reason:c.string().optional()}),mfe=c.looseObject({token:c.string()}),pJ=c.looseObject({quickCreateUrl:c.string(),externalId:c.string()}),mJ=c.looseObject({alreadyConnected:c.literal(!0),account:c.looseObject({awsAccountId:c.string(),accountName:c.string().nullable(),status:c.string()})}),ffe=c.union([mJ,pJ]);function fJ(e){return"alreadyConnected"in e&&e.alreadyConnected===!0}rJ(fJ,"isAlreadyConnected");var hfe=c.looseObject({registered:c.boolean(),repository:c.looseObject({id:c.string()}).optional()});var hJ=Object.defineProperty,gJ=(e,t)=>hJ(e,"name",{value:t,configurable:!0});function Gu(e=f$){return`Deploy tokens are minted from a signed-in browser session by an owner or admin: open ${e}/settings/ci (Settings \u2192 CI/CD Tokens).`}gJ(Gu,"deployTokenMintGuidance");var h$=[{command:"ci status",match:w.success,templates:["Run `fjall ci verify` to check the rest of the wiring \u2014 an active deploy token is necessary, not sufficient","Run `fjall ci token list` to see which applications, environments and accounts each active token may deploy to"]},{command:"ci status",match:w.empty,templates:[Gu(),"Run `fjall ci setup --plan --app <app>` to learn where the workflow file will go and which secret name it will read (`workflowPath`, `secretName`) \u2014 the two things needed to stage the secret before minting. `--plan` mints nothing and writes nothing, and the workflow BODY is printed on the human surface only: it is not a field of the agent payload"]},{command:"ci token list",match:w.success,templates:["Run `fjall token show <id>` to inspect one token's stored constraints","Run `fjall ci token revoke <id> --reason <text>` to revoke a listed token"]},{command:"ci token list",match:w.empty,templates:[Gu(),"Run `fjall ci status` to re-check readiness once a token exists"]},{command:"ci token revoke",match:w.success,templates:["Run `fjall ci token list` to confirm the token now lists as revoked \u2014 a revoked token stays listed, it does not disappear",`Any CI job still holding this token now fails to authenticate. ${Gu()}`]}];var Pf="Do not retry or vary flags: `supported: false` is the server's capability verdict, not an input error \u2014 every invocation answers the same until the Fjall server is updated to a version that ships this API (the `message` field names the upgrade)",g$=[{command:"deployments list",match:w.unsupported,templates:[Pf]},{command:"deployments cancel",match:w.unsupported,templates:[Pf]},{command:"deployments force-release",match:w.unsupported,templates:[Pf]},{command:"dev list",match:w.unsupported,templates:[Pf]},{command:"deployments list",match:w.success,templates:["Run `fjall deployments cancel <id>` to request co-operative cancellation of a listed deployment","Run `fjall deploy logs --deployment-id <id>` to read one deployment's logs"]},{command:"deployments cancel",match:w.success,templates:["Run `fjall deployments list` to confirm whether the slot is free, and read `cancelled` and `declined` before assuming it is: `cancelled: false` means the request was refused, `declined: true` is an already-terminal reject, and a plain granted cancel is co-operative \u2014 the deployment has to acknowledge it","Run `fjall deployments force-release <id> --confirm <id>` to clear a slot that stays occupied (organisation admin, audited \u2014 retype the id in `--confirm`)"]},{command:"deployments force-release",match:w.success,templates:["Run `fjall deployments list` to confirm the slot is free","Run `fjall deploy <app>` to retry the deployment the wedged slot was blocking"]},{command:"dev up",match:w.success,templates:["Run `fjall dev list <app>` to see every slot for this app with its `host` \u2014 rows carry `host`, not a full URL, and it is empty until the slot leaves `creating`","Run `fjall dev down <app> --branch <branch>` to tear this slot down"]},{command:"dev list",match:w.success,templates:["Run `fjall dev down <app> --branch <branch>` to tear one listed slot down \u2014 every row carries the `branch` to name here","Run `fjall dev up <app> --branch <branch>` to bring another branch up"]},{command:"dev down",match:w.success,templates:["Run `fjall dev list <app>` to see which slots remain","Run `fjall dev up <app> --branch <branch>` to bring the branch back up"]},{command:"dev substrate down",match:w.success,templates:["Run `fjall dev list <app>` to confirm no slot survives \u2014 the substrate will not tear down under live slots, and `--force` takes them with it","Any `residuals` row survives the teardown and can still cost: its `cleanupHint` names the manual step"]}];var y$=["Run `fjall domain deploy <name>` to deploy the domain","Run `fjall domain verify <name>` to check DNS delegation once it is deployed","Run `fjall domain export <name>` to export the live zone records"],v$=[{command:"org deploy",match:w.success,templates:["Run `fjall org get` to review the deployed organisation topology and accounts",`Run \`${te.accountDeploy}\` to deploy the account tier if you passed \`--no-cascade\``,`Run \`${te.createApplicationAgent} --name "<name>"\` to create an application to deploy into it`]},{command:"org deploy",match:w.error,templates:["Run `fjall org get` to see which tier of the cascade is already deployed",`Run \`${te.organisationDeploy} --no-cascade\` to retry the organisation stack alone`]},{command:"platform deploy",match:w.success,templates:[`Run \`${te.accountDeploy}\` to deploy the account tier on top of it`]},{command:"platform deploy",match:w.error,templates:["Run `fjall org get` to check the organisation tier is deployed first"]},{command:"account deploy",match:w.success,templates:["Run `fjall apps list` to see which applications are registered","Run `fjall deploy <application>` to deploy one into this account"]},{command:"account deploy",match:w.error,templates:["Run `fjall org get` to confirm the account is registered in the organisation",`Run \`${te.accountDeploy} --target <target>\` to select a specific member account`]},{command:"domain list",match:w.success,templates:["Run `fjall domain verify <name>` to check DNS delegation","Run `fjall domain export <name>` to export zone file","Run `fjall create domain --name <name>` to create a new domain"]},{command:"domain list",match:w.empty,templates:['Run `fjall create domain --name "<name>"` to create a domain',"Run `fjall domain import <name>` to import from Route53"]},{command:"domain verify",match:w.success,templates:["Run `fjall domain export <name>` to export zone file","Run `fjall domain deploy <name>` to deploy domain infrastructure"]},{command:"domain verify",match:w.error,templates:["Run `fjall domain verify <name>` to retry","Run `fjall domain list` to see existing domains"]},{command:"domain export",match:w.success,templates:["Run `fjall domain verify <name>` to check delegation","Run `fjall domain import <name>` to re-import from Route53"]},{command:"domain import",match:w.success,templates:["Run `fjall domain verify <name>` to check delegation","Run `fjall domain export <name>` to see the zone file","Run `fjall domain deploy <name>` to deploy domain infrastructure"]},{command:"domain import",match:w.error,templates:["Run `fjall domain import --hosted-zone-id <id>` to import by zone ID","Run `fjall domain list` to see existing domains"]},{command:"domain records list",match:w.success,templates:["Run `fjall domain sync <domain>` for the full zone-hygiene report","Run `fjall domain sync <domain> --fix` to remediate residue records via the destruction ceremony"]},{command:"domain records list",match:w.empty,templates:["Run `fjall domain deploy <domain>` to deploy the domain's declared records","Run `fjall domain list` to see existing domains"]},{command:"domain records list",match:w.error,templates:["Run `fjall domain records list <domain> --hosted-zone-id <id>` when the zone is not resolvable by name",`Run \`${te.connect}\` if AWS credentials are missing`]},{command:"domain sync",match:w.success,templates:["Run `fjall domain sync <domain> --fix` to remediate residue records (ceremony-gated)","Run `fjall domain records list <domain>` to see every record with its owner"]},{command:"domain sync",match:w.error,templates:["Run `fjall domain sync <domain> --hosted-zone-id <id>` when the zone is not resolvable by name","Run `fjall domain list` to see existing domains"]},{command:"domain delegate",match:w.success,templates:["Run `fjall domain verify <domain>` to confirm public DNS resolution","Run `fjall domain deploy <domain>` to continue a two-phase deploy after delegation"]},{command:"domain delegate",match:w.error,templates:["Run `fjall domain deploy <parent-domain>` so the parent publishes its DelegationRole","Run `fjall domain verify <domain> --show-delegation` for registrar instructions"]},{command:"domain destroy",match:w.success,templates:["Run `fjall domain list` to see remaining domains","Run `fjall domain sync <parent-domain>` to confirm no delegation residue remains"]},{command:"domain destroy",match:w.error,templates:["Run `fjall domain destroy <domain> --remediate '<name>'=recreate` with the exact consent the ticket names","Run `fjall domain list` to see existing domains"]},{command:"domain deploy",match:w.success,templates:["Run `fjall domain verify <domain>` to check DNS propagation","Run `fjall domain delegate <domain>` to write the NS delegation for a delegated child"]},{command:"domain deploy",match:w.error,templates:["Run `fjall domain deploy <domain>` to resume \u2014 the zone phase is retained and skipped on re-run","Run `fjall domain verify <domain> --show-delegation` for registrar delegation instructions"]},{command:"domain eject",match:w.success,templates:["Review the ejected infrastructure.ts \u2014 it is now vanilla CDK owned by you","Run `fjall domain list` to see remaining managed domains"]},{command:"create domain",match:w.success,templates:y$},{command:"domain create",match:w.success,templates:y$},{command:"create domain",match:w.error,templates:["Run `fjall domain list` to see existing domains",'Run `fjall create domain --name "<name>"` to retry with a different name']},{command:"create account",match:w.success,templates:[`Run \`${te.connect} --environment production\` to link your AWS account`,`Run \`${te.accountDeploy}\` to deploy account infrastructure (after connecting)`]},{command:"create account",match:w.error,templates:[`Run \`${te.createAccount} --primary-region <region>\` to retry`,`Run \`${te.createAccount} --help\` for usage information`]},{command:"create org",match:w.success,templates:[`Run \`${te.connect} --name "<account-name>" --region <region>\` to link the AWS Organizations management account \u2014 omit \`--environment\` so it registers at the organisation tier`,`Run \`${te.organisationDeploy}\` to deploy all infrastructure (after connecting)`]},{command:"create org",match:w.error,templates:[`Run \`${te.createOrganisation} --email "<email>"\` to retry (add \`--name "<name>"\` only for a brand-new organisation)`,`Run \`${te.createOrganisation} --help\` for all options`]},{command:"restore",match:w.successDryRun,templates:["Run `fjall restore <resourceType> --recovery-point <recoveryPointArn> --yes` to initiate restore","Run `fjall apps list` to see existing applications"]},{command:"restore",match:w.success,templates:["Open the AWS Console URL above to monitor restore progress","Run `fjall import` to import the restored resource after completion"]},{command:"restore",match:w.errorWithCode("NOT_FOUND"),templates:["Verify the recovery point ARN is correct and exists in the current region","Run `fjall restore <resourceType> --recovery-point <arn>` to retry"]},{command:"restore",match:w.errorWithCode("FORBIDDEN"),templates:["Ensure the IAM role has backup:StartRestoreJob and iam:PassRole permissions","Run `fjall restore` interactively to configure with guided setup"]},{command:"import",match:w.successDryRun,templates:["Run `fjall import --app <app> --resource-id <resourceId> --yes` to import a specific resource","Run `fjall import --app <app> --yes` to import all discovered resources"]},{command:"import",match:w.success,templates:["Run `fjall deploy <app>` to deploy with the imported resource","Run `fjall apps describe <app>` to see updated resources"]},{command:"import",match:w.errorWithCode("NOT_FOUND"),templates:[`Run \`${te.createApplicationAgent} --name "<app>"\` to create the application`,"Run `fjall apps list` to see existing applications"]},{command:"import",match:w.errorWithCode("VALIDATION_ERROR"),templates:["Run `fjall import --app <app> --resource-id <resourceId>` to import a specific resource","Run `fjall import --app <app> --resource-id <resourceId> --yes` to import immediately"]},{command:"aws exec",match:w.success,templates:["Run `fjall aws exec -- <command...>` to run another AWS CLI command","Run `fjall status` to check application health"]},{command:"aws exec",match:w.error,templates:["Retry the command \u2014 OIDC token mints can fail transiently",`Run \`${te.login}\` if the retry also fails with an authentication error`]},{command:"unlock bucket",match:w.success,templates:["Re-put sane bucket policy statements (enforceSSL deny, access grants) \u2014 the unlock deleted the ENTIRE policy","Run `fjall destroy <app>` to retry the blocked stack cleanup"]},{command:"unlock bucket",match:w.error,templates:["Ensure your credentials belong to the organisation's management account \u2014 STS AssumeRoot is rejected elsewhere","Run `fjall unlock bucket <name> --account <id> --acknowledge-root-session` to retry"]}];var yJ=Object.defineProperty,x$=(e,t)=>yJ(e,"name",{value:t,configurable:!0}),b$="Run `fjall connect status` to check that an AWS account is connected: asset discovery only inventories connected accounts, so an organisation with none has nothing to inventory",S$=["Run `fjall assets show <asset>` to read one asset in full \u2014 pass its `assetIdentifier`","Run `fjall assets compliance <asset>` to list an asset's recorded posture issues \u2014 pass its `assetIdentifier`, the address every server version accepts"],E$=x$(e=>e.outcome==="success"&&e.nextCursor!==void 0,"isTruncatedPage"),A$=[{command:"assets list",match:x$(e=>E$(e)&&e.fields!==void 0&&e.fields!=="","match"),templates:["This window is truncated \u2014 more assets exist beyond these rows. Run `fjall assets list --cursor <nextCursor> --fields <fields>` to fetch the next page with the same projection; `total` counts this window only, and `fjall assets summary` reports the estate-wide tally, split active/deleted",...S$]},{command:"assets list",match:E$,templates:["This window is truncated \u2014 more assets exist beyond these rows. Run `fjall assets list --cursor <nextCursor>` to fetch the next page; `total` counts this window only, and `fjall assets summary` reports the estate-wide tally, split active/deleted",...S$]},{command:"assets list",match:w.success,templates:["The `total` aggregate counts the rows in this response, not the estate: `--take` bounds the window (default 50). No `nextCursor` aggregate here means the estate ends with these rows; `fjall assets summary` reports the estate-wide tally, split active/deleted","Run `fjall assets show <asset>` to read one asset in full","Run `fjall assets compliance <asset>` to list an asset's recorded posture issues \u2014 pass its `assetIdentifier`, the address every server version accepts (row `id`s are only accepted by newer servers)"]},{command:"assets list",match:w.empty,templates:["Run `fjall assets list --status deleted` to include assets discovery has since marked deleted \u2014 the default listing hides them",b$]},{command:"assets show",match:w.success,templates:["Run `fjall assets compliance <asset>` to list the posture issues recorded against this asset","Run `fjall assets show <asset> --fields id,accountId,iacStatus,estimatedMonthlyCost,lastSeenAt` to read the fields the default projection omits"]},{command:"assets compliance",match:w.success,templates:["Read the `status` column before acting: this listing returns every issue recorded against the asset, `resolved` and `suppressed` included, where the `openIssues` count on `fjall assets list` counts only the open ones","Run `fjall compliance fix --domain compliance --issue-id <issueId>` to read this issue in full alongside the organisation's other open issues. `--domain` is the producer's category \u2014 one of `compliance`, `cost`, `performance` \u2014 not a framework name, and the response is context to reason from, not a remediation step: use `--execute` to run one","Run `fjall assets show <asset>` to read the asset these issues were raised against"]},{command:"assets compliance",match:w.empty,templates:["No issue of ANY status has been recorded against this asset \u2014 an empty listing here is not the same as issues that were resolved, which would still appear with `status: resolved`","Run `fjall assets list --fields name,assetIdentifier,openIssues` to find the assets that do carry open issues"]},{command:"assets summary",match:w.success,templates:["Run `fjall assets list --fields name,assetIdentifier,openIssues` to see which assets sit behind `withIssues` \u2014 `withIssues` counts the assets carrying at least one open issue, `openIssues` counts those issues per asset","Run `fjall assets list --take <n>` to read the rows behind these totals \u2014 page onwards with `--cursor` when the listing reports a `nextCursor`, and pass `--status deleted` to include the `deleted` rows in the listing (interleaved with active \u2014 read the `status` column). These totals are estate-wide (the summary pages the listing to exhaustion, deleted assets included): `total` counts the whole estate, `active` and `deleted` split it"]},{command:"assets summary",match:w.empty,templates:[b$]},{command:"costs show",match:w.success,templates:["Run `fjall costs --mode forecast` to see forecasted spend","Run `fjall costs --mode breakdown` to see service-level breakdown"]},{command:"costs show",match:w.error,templates:["Run `fjall costs --app <app>` to filter by application","Run `fjall costs --help` for usage information"]},{command:"metrics show",match:w.success,templates:["Run `fjall metrics --mode latency` to see latency percentiles","Run `fjall metrics --mode errors` to see error trends"]},{command:"metrics show",match:w.error,templates:["Run `fjall metrics --app <app>` to filter by application","Run `fjall metrics --help` for usage information"]},{command:"compliance fix",match:w.success,templates:["Run `fjall compliance fix --domain <domain> --issue-id <id>` to narrow the suggestions to one issue","Run `fjall deploy <app>` to apply remediation changes"]},{command:"compliance fix",match:w.error,templates:["Run `fjall compliance fix --domain <domain>` to name the compliance domain","Run `fjall compliance --help` for usage information"]},{command:"compliance fix --execute",match:w.success,templates:["Read the result's `kind` before treating the issue as fixed: `auto-pr` opened a pull request that still has to be merged, `imperative` rewrote the live policy, and `manual-hint` changed nothing \u2014 its `awsCliHint` carries the manual step, and that field is absent for rules that supply no hint (`message` is a fixed string either way)","Do not re-read the issue to confirm the cure: nothing on the remediation path writes to the issue record, so `status` stays `open` until the next discovery scan re-evaluates the asset. Verify at the thing that changed \u2014 the pull request, or the live resource","Run `fjall deploy <app>` to roll out an `auto-pr` remediation once its pull request is merged"]},{command:"deploy diff",match:w.success,templates:["Run `fjall deploy logs --deployment-id <id>` to analyse deployment logs","Run `fjall status <app>` to check current deployment health"]},{command:"deploy diff",match:w.error,templates:["Run `fjall list deployments` to see recent deployment IDs","Run `fjall deploy diff --help` for usage information"]},{command:"deploy logs",match:w.success,templates:["Run `fjall deploy diff <idA> <idB>` to compare two deployments","Run `fjall status <app>` to check current deployment health"]},{command:"deploy logs",match:w.error,templates:["Run `fjall deploy logs --deployment-id <id>` with a valid deployment ID","Run `fjall list deployments` to find a deployment ID"]}];var vJ={command:"*",match:w.error,templates:["Run `fjall <command> --help` for usage information"]},_$=[...KO,...ZO,...HO,...h$,...g$,...v$,...A$,vJ];var bJ=Object.defineProperty,SJ=(e,t)=>bJ(e,"name",{value:t,configurable:!0}),T$=["app","environment","region","profile","target","cluster","service","lambda","status","type"],Oa=["app","cluster","service","lambda"],EJ=["status","type","region"],e_={deploy:["environment","region","target"],"deploy diff":[],"deploy logs":[],destroy:["target"],"org deploy":["target"],"org destroy":["target"],"platform deploy":["target"],"platform destroy":["target"],"account deploy":["target"],"account destroy":["target"],status:[],rollout:[],list:["app"],apps:["target"],connect:["environment","region"],"connect status":[],import:["app","region"],costs:["app"],metrics:["app"],compliance:["app"],"token create":["app","environment"],"unlock bucket":["region"],"aws exec":["app","region","target"],"secrets set":Oa,"secrets get":Oa,"secrets list":Oa,"secrets delete":Oa,"secrets export":Oa,"secrets import":Oa,"secrets exec":Oa,"assets list":EJ},xJ=Math.max(...Object.keys(e_).map(e=>e.split(" ").length));function t_(e){let t=e.trim().split(/\s+/).slice(1);for(let r=xJ;r>=1;r--){let i=t.slice(0,r).join(" ");if(Object.hasOwn(e_,i))return e_[i]}return[]}SJ(t_,"resolvePreservableFlags");var AJ=Object.defineProperty,Of=(e,t)=>AJ(e,"name",{value:t,configurable:!0});function r_(e){let t=e.replace(/[\u0000-\u001f\u007f`]/g,"");return/[^\w@%+=:,./-]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t}Of(r_,"shellEscape");function C$(e,t,r){let i=new Set,n=e.replace(/<(\w+)>/g,(a,o)=>{let s=t[o];return s===void 0||s===""?`<${o}>`:(i.add(o),o==="command"?s:r_(s))});return I$(n,r,i)}Of(C$,"interpolateTemplate");var Rf=class{static{Of(this,"SuggestionResolver")}command;flags;constructor(t,r){this.command=t,this.flags=r}resolve(t){let r=_$.find(i=>(i.command===this.command||i.command==="*")&&i.match(t));return r===void 0?[]:r.templates.map(i=>C$(i,t,this.flags))}};function I$(e,t,r=new Set){let i=/`(fjall[^`]*)`/.exec(e),n=i?.[1];if(i===null||n===void 0)return e;let a=t_(n),o=[];for(let p of T$){if(!a.includes(p))continue;let g=t[p];g!==void 0&&g!==""&&!r.has(p)&&!n.includes(`--${p}`)&&o.push(`--${p} ${r_(g)}`)}if(o.length===0)return e;let s=` ${o.join(" ")}`,u=n.indexOf(" -- "),d=u===-1?`${n}${s}`:`${n.slice(0,u)}${s}${n.slice(u)}`;return e.slice(0,i.index)+`\`${d}\``+e.slice(i.index+i[0].length)}Of(I$,"applyPreservedFlags");var _J=Object.defineProperty,Xn=(e,t)=>_J(e,"name",{value:t,configurable:!0});function ln(e,t){if(t!==void 0&&Ts(e)){let i={};for(let[n,a]of Object.entries(e))i[n]=t.has(n)?a:ln(a);return i}if(typeof e=="string")return ge(e);if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(i=>ln(i));if(e instanceof Date||e instanceof RegExp)return e;let r={};for(let[i,n]of Object.entries(e))r[i]=ln(n);return r}Xn(ln,"maskTree");function $f(e){if(Array.isArray(e))return e.map($f);if(!Ts(e))return e;let t={};for(let[r,i]of Object.entries(e))i!==void 0&&(t[r]=$f(i));return t}Xn($f,"stripAbsent");function Ts(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof Date)&&!(e instanceof RegExp)}Xn(Ts,"isPlainRecord");function D$(e){let t=e?.verbatimFields;return t!==void 0&&t.length>0?new Set(t):void 0}Xn(D$,"toVerbatimKeys");function w$(e,t){return t===void 0||!Ts(e)?!1:Object.keys(e).some(r=>t.has(r))}Xn(w$,"carriesVerbatimField");function k$(e,t){let r=e;for(let i of t.split(".")){if(!Ts(r))return;r=r[i]}return r}Xn(k$,"resolveDotPath");function N$(e,t,r){let i=e.project(t),n={};for(let a of r)a in i&&(n[a]=i[a]);return n}Xn(N$,"projectSelectedFields");var Wu=class{static{Xn(this,"AgentOutputWriter")}write;hasWrittenBlock=!1;resolver;flags;full;budget;requestedFields;constructor(t){this.write=t.writeFn??(r=>{process.stdout.write(r)}),this.resolver=new Rf(t.command,t.flags),this.flags=t.flags,this.full=t.full??!1,this.budget=t.budget,this.requestedFields=t.fields??[]}get isFullOutput(){return this.full}writeBlock(t){t!==""&&(this.hasWrittenBlock&&this.write(kA+`
|
|
341
|
+
`,{encoding:"utf8"}),Re.renameSync(i,r),mf(Nt.dirname(Nt.dirname(r)),[df,...Nu],{header:xA,marker:mO})}catch(i){return un(new Error(`Failed to write ${r}: ${ge(qe(i))}`))}return this.localConfigCache=t,ka(void 0)}static warnLegacyActiveTargetOnce(){e.warnedLegacyActiveTarget||(e.warnedLegacyActiveTarget=!0,Pa.warn("Config","`activeTarget` in fjall-config.json is deprecated and ignored: a committed target must never re-aim a deploy or CI pipeline. Run `fjall target set <name>` to store it locally in .fjall/local.json, then remove `activeTarget` from the committed fjall-config.json."))}getActiveTarget(){let t=this.loadLocalConfig().activeTarget;if(t!==void 0)return t;this.rootConfig.activeTarget!==void 0&&e.warnLegacyActiveTargetOnce()}setActiveTarget(t){let r=this.loadLocalConfig();return r.activeTarget=t,this.writeLocalConfig(r)}clearActiveTarget(){let t=this.loadLocalConfig();return delete t.activeTarget,this.writeLocalConfig(t)}getDomains(){return this.rootConfig.domains??[]}setDomains(t){this.rootConfig.domains=t}addDomain(t){this.rootConfig.domains||(this.rootConfig.domains=[]),this.rootConfig.domains.push(t)}getDomain(t){return this.rootConfig.domains?.find(r=>r.name.toLowerCase()===t.toLowerCase())}removeDomain(t){if(!this.rootConfig.domains)return!1;let r=this.rootConfig.domains.findIndex(i=>i.name.toLowerCase()===t.toLowerCase());return r===-1?!1:(this.rootConfig.domains.splice(r,1),!0)}getOrganisation(){return this.rootConfig.organisation}setOrganisation(t){this.rootConfig.organisation=t}clearOrganisation(){delete this.rootConfig.organisation}};var ZH=Object.defineProperty,Fi=(e,t)=>ZH(e,"name",{value:t,configurable:!0});function qA(e){let t;try{t=Df.loadConfig(e)}catch(i){return{kind:"unreadable",reason:ge(qe(i))}}if(t.isContentUnavailable())return{kind:"unreadable",reason:"fjall-config.json exists but its contents could not be loaded (the preceding warning names the problem)"};let r=t.getOrganisation();return r!==void 0?{kind:"bound",bound:r}:t.getConfigPath()===null?{kind:"no_project"}:{kind:"unbound"}}Fi(qA,"readProjectBinding");function HA(e,t,r){switch(e.kind){case"unreadable":return e;case"no_project":return{kind:"unbound",projectFound:!1,identity:t};case"unbound":return{kind:"unbound",projectFound:!0,identity:t};case"bound":return t===null?{kind:"unverifiable",bound:e.bound,reason:r??"the organisation could not be resolved"}:e.bound.id===t.id?{kind:"matched",bound:e.bound}:{kind:"mismatched",bound:e.bound,actual:t}}}Fi(HA,"resolveBindingVerdict");function i$(e,t={}){return HA(qA(t.startDir),e,t.unresolvedReason)}Fi(i$,"checkProjectOrganisation");function Ra(e){return e.name!==void 0&&e.name!==""?`${e.name} (${e.id})`:e.id}Fi(Ra,"describeOrganisation");function a$(e,t,r){return`Refusing to ${e}: this project's fjall-config.json records organisation ${Ra(t)} as its home, but the credential in use belongs to ${Ra(r)}. Nothing was created, synthesised or deployed. Cure: authenticate as ${Ra(t)} ('fjall login', or set FJALL_API_KEY to a key for that organisation), or \u2014 if this project really is moving \u2014 run 'fjall org bind --org ${r.id} --force' to re-bind it.`}Fi(a$,"buildWrongOrganisationMessage");function o$(e,t){return`Refusing to ${e}: ${t}, so this project's organisation binding cannot be checked. Nothing was created, synthesised or deployed. Cure: fix fjall-config.json (permissions or contents), then re-run.`}Fi(o$,"buildUnreadableConfigMessage");function s$(e,t){return`Could not confirm which organisation your credential belongs to (${t}). Proceeding \u2014 this project is bound to ${Ra(e)}, and a mismatch would not have been caught.`}Fi(s$,"buildUnverifiableNotice");function c$(e){return`This project is not bound to an organisation. Run 'fjall org bind' to pin it to ${Ra(e)} \u2014 afterwards, any command run here with another organisation's credential is refused instead of silently landing there.`}Fi(c$,"buildUnboundNotice");import{createHash as JH}from"node:crypto";var qH=Object.defineProperty,HH=(e,t)=>qH(e,"name",{value:t,configurable:!0});function u$(e,t){return JH("sha256").update(`${e}${t}`).digest("hex")}HH(u$,"credentialFingerprint");import*as kf from"node:fs";var XH=Object.defineProperty,wf=(e,t)=>XH(e,"name",{value:t,configurable:!0}),l$="org-config-cache.json";function JA(){return ms(l$)}wf(JA,"orgConfigCachePath");function XA(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}wf(XA,"isObject");function YA(e){return XA(e)&&typeof e.organisationId=="string"&&e.organisationId!==""&&typeof e.organisationName=="string"}wf(YA,"isCachedCredentialIdentity");function d$(e){try{let t=JA();if(!kf.existsSync(t))return null;let r=JSON.parse(kf.readFileSync(t,"utf-8"));return!XA(r)||r.credentialFingerprint!==e?null:YA(r.identity)?r.identity:null}catch(t){return Pa.debug("cachedCredentialIdentity","Cache read failed, treating as a miss",{error:ge(qe(t))}),null}}wf(d$,"readCachedCredentialIdentity");var YH=Object.defineProperty,QH=(e,t)=>YH(e,"name",{value:t,configurable:!0}),p$="https://fjall.io";function Nf(){let e=process.env.FJALL_API_URL;return e!==void 0&&e!==""?e:p$}QH(Nf,"resolveApiBaseUrl");var m$={name:"@fjall/cli",version:"27.1.0",repository:{type:"git",url:"git+https://github.com/fjall-tech/fjall.git",directory:"cli"},description:"Fjall CLI helper",private:!0,type:"module",bin:{fjall:"dist/src/cli.js"},files:["dist/"],scripts:{clean:"rm -rf ./dist ./dist.next ./sourcemaps","clean:node":"rm -rf ./node_modules","copy-files":'DEST="${DEST:-dist}"; find generators -type d -name files | while read dir; do mkdir -p "$DEST/$dir" && cp -R "$dir/." "$DEST/$dir/"; done && cp -R src/proto "./$DEST/src/proto"',build:"rm -rf ./dist.next ./sourcemaps && npx tsc --outDir dist.next && DEST=dist.next npm run copy-files && node ../scripts/minify-dist.mjs dist.next && chmod +x ./dist.next/src/cli.js && rm -rf ./dist && mv ./dist.next ./dist && node ../scripts/stamp-build.mjs",watch:"npm run build && npx tsc-watch","watch:only":'npx tsc-watch --onSuccess "npm run copy-files"',"fjall-cli":"node ./dist/src/cli.js",version:"npx tsx scripts/updateTemplateVersions.ts && node ../scripts/sync-ci-plugin-major.mjs",format:'prettier --write "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',"format:check":'prettier --check "src/**/*.{ts,tsx,js,jsx,json}" "generators/**/*.{ts,tsx,js,jsx,json}"',lint:"eslint src/ generators/","lint:fix":"eslint src/ generators/ --fix",typecheck:"tsc --noEmit","typecheck:tests":"tsc --noEmit --project tsconfig.test.json","typecheck:scripts":"tsc --noEmit --project tsconfig.scripts.json","typecheck:all":"npm run typecheck && npm run typecheck:tests && npm run typecheck:scripts",test:"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","test:integration":"vitest run --config vitest.config.integration.ts","test:integration:watch":"vitest --config vitest.config.integration.ts","test:e2e":"vitest run --config vitest.e2e.config.ts","test:all":"npm run test && npm run test:integration && npm run test:e2e","test:setup":"node scripts/setupTestFixtures.mjs","test:payload-compat":"npx tsx scripts/testPayloadCompatibility.ts","test:payload-compat:e2e":"npx tsx scripts/testPayloadCompatibility.ts --e2e"},engines:{node:">=22.0.0"},author:"",license:"SEE LICENSE IN LICENSE",devDependencies:{"@eslint/js":"^10.0.1","@playwright/test":"^1.62.0","@testing-library/dom":"^10.4.1","@testing-library/react":"^16.3.2","@types/ejs":"^3.1.5","@types/prompts":"^2.4.9","@types/proper-lockfile":"^4.1.4","@types/react":"^19.2.17","@typescript-eslint/parser":"^8.65.0","@vitest/coverage-v8":"^4.1.10","aws-cdk-lib":"^2.265.0",constructs:"^10.7.2",eslint:"^10.8.0","ink-testing-library":"^4.0.0",jsdom:"^30.0.1",prettier:"^3.9.6","react-dom":"^19.2.8","strip-ansi":"^6.0.1","tsc-watch":"^7.2.1",tsx:"^4.23.1","typescript-eslint":"^8.65.0",vitest:"4.1.10"},dependencies:{"@anthropic-ai/sdk":"^0.115.0","@aws-sdk/client-acm":"^3.1098.0","@aws-sdk/client-auto-scaling":"^3.1098.0","@aws-sdk/client-backup":"^3.1098.0","@aws-sdk/client-cloudformation":"^3.1098.0","@aws-sdk/client-cost-explorer":"^3.1098.0","@aws-sdk/client-ec2":"^3.1098.0","@aws-sdk/client-ecr":"^3.1098.0","@aws-sdk/client-ecs":"^3.1098.0","@aws-sdk/client-elasticache":"^3.1098.0","@aws-sdk/client-iam":"^3.1098.0","@aws-sdk/client-identitystore":"^3.1098.0","@aws-sdk/client-lambda":"^3.1098.0","@aws-sdk/client-organizations":"^3.1098.0","@aws-sdk/client-ram":"^3.1098.0","@aws-sdk/client-rds":"^3.1098.0","@aws-sdk/client-route-53":"^3.1098.0","@aws-sdk/client-s3":"^3.1098.0","@aws-sdk/client-secrets-manager":"^3.1098.0","@aws-sdk/client-ssm":"^3.1098.0","@aws-sdk/client-sso":"^3.1098.0","@aws-sdk/client-sso-admin":"^3.1098.0","@aws-sdk/client-sso-oidc":"^3.1098.0","@aws-sdk/client-sts":"^3.1098.0","@fjall/deploy-core":"^27.1.0","@fjall/generator":"^27.1.0","@fjall/util":"^27.1.0","@nx/devkit":"^23.1.0","@opennextjs/aws":"^4.1.0","@smithy/node-http-handler":"^4.9.13","@toon-format/toon":"^4.1.0","aws-cdk":"^2.1134.0",axios:"^1.19.0",chalk:"^6.0.0","cli-cursor":"^5.0.0",commander:"^15.0.0",ejs:"^6.0.1",ink:"^7.1.1","js-yaml":"^5.2.2",open:"^11.0.0",ora:"^9.4.1",prompts:"^2.4.2","proper-lockfile":"^4.1.2",protobufjs:"^8.7.1",react:"^19.2.8",typescript:"^6.0.3","update-check":"^1.5.4",zod:"^4.4.3"}};var tJ=Object.defineProperty,rJ=(e,t)=>tJ(e,"name",{value:t,configurable:!0}),Lme=`fjall-cli/${m$.version} node/${process.versions.node} ${nJ()}/${iJ()}`;var f$=Nf(),Ume=c.looseObject({deviceCode:c.string(),userCode:c.string(),verificationUri:c.string(),expiresIn:c.number(),interval:c.number()}),zme=c.looseObject({status:c.string(),apiKey:c.string().optional(),organisationId:c.string().optional(),organisationName:c.string().optional(),email:c.string().optional()}),Bme=c.looseObject({application:c.looseObject({id:c.string()})}),QA=c.looseObject({id:c.string(),name:c.string(),vpcCidr:c.string().nullable(),connectedAwsAccountId:c.string().nullable()}),Vme=c.looseObject({applications:c.array(QA),nextCursor:c.string().optional()}),Gme=c.looseObject({application:QA}),Wme=c.looseObject({applications:c.array(QA)}),Kme=c.looseObject({application:c.looseObject({id:c.string(),name:c.string()})}),Zme=c.looseObject({primaryRegion:c.string().nullish(),secondaryRegions:c.array(c.string()).optional(),disasterRecoveryRegion:c.string().nullish(),providerAccounts:c.custom(e=>Array.isArray(e)),ssoSessions:c.record(c.string(),c.looseObject({ssoRegion:c.string(),ssoStartUrl:c.string()})).optional(),rootOidcRoleArn:c.string().nullish(),allowCodemodLlmFallback:c.boolean().optional(),rootAccessManagement:c.custom(e=>typeof e=="string").optional(),requireTrackedDeploys:c.boolean().optional().catch(void 0)}),qme=c.looseObject({id:c.string(),token:c.string(),tokenPrefix:c.string(),name:c.string(),scopes:c.array(c.string())}),aJ=c.looseObject({id:c.string(),name:c.string(),tokenPrefix:c.string(),scopes:c.array(c.string()),resourceConstraints:c.record(c.string(),c.unknown()),sourceTag:c.string().nullable(),expiresAt:c.string(),createdAt:c.string(),revokedAt:c.string().nullable(),revokedReason:c.string().nullable(),lastUsedAt:c.string().nullable(),usageCount:c.number(),deniedCount:c.number()}),Hme=c.looseObject({tokens:c.array(aJ)}),Jme=c.looseObject({scopes:c.array(c.string()),expiresAt:c.string().optional()}),oJ=c.looseObject({id:c.string(),awsAccountId:c.string(),accountName:c.string().nullable(),environment:c.string().nullable()}),Xme=c.looseObject({accounts:c.array(oJ)}),sJ=c.looseObject({id:c.string(),assetIdentifier:c.string(),name:c.string(),type:c.string(),status:c.string(),region:c.string().nullish(),_count:c.looseObject({complianceIssues:c.number()}).optional()}),cJ=c.looseObject({id:c.string(),name:c.string(),assetIdentifier:c.string(),provider:c.string(),type:c.string(),status:c.string(),region:c.string().nullish(),iacStatus:c.string().nullish(),accountId:c.string().nullish(),estimatedMonthlyCost:c.string().nullish(),lastSeenAt:c.string().nullish(),createdAt:c.string().nullish(),updatedAt:c.string().nullish()}),Yme=c.looseObject({assets:c.array(sJ),nextCursor:c.string().optional()}),Qme=c.looseObject({asset:cJ}),uJ=c.looseObject({id:c.string(),ruleId:c.string(),title:c.string(),severity:c.string(),status:c.string()}),efe=c.looseObject({issues:c.array(uJ)}),tfe=c.record(c.string(),c.unknown()),rfe=c.union([c.array(c.record(c.string(),c.unknown())),c.record(c.string(),c.unknown())]),nfe=c.record(c.string(),c.unknown()),ife=c.record(c.string(),c.unknown()),afe=c.record(c.string(),c.unknown()),ofe=c.record(c.string(),c.unknown()),sfe=c.looseObject({deployment:c.looseObject({id:c.string()}),minCliVersion:c.string().optional()});var lJ=c.object({id:c.string(),releaseNumber:c.number().int(),status:c.string(),commitSha:c.string().nullable(),branch:c.string().nullable(),createdAt:c.string(),assemblyDigest:c.string().nullable(),createdByDeploymentId:c.string().nullable(),rollbackOfReleaseId:c.string().nullable(),services:c.array(of.strip())}),cfe=c.object({releases:c.array(lJ),currentReleaseId:c.string().nullable(),nextCursor:c.number().int().optional()}),dJ=c.object({id:c.string(),status:c.string(),target:c.string().nullish(),applicationId:c.string().nullish(),applicationName:c.string().nullish(),connectedAwsAccountId:c.string().nullish(),source:c.string().nullish(),startedAt:c.string().nullish(),triggeredByName:c.string().nullish(),machineLabel:c.string().nullish()}),ufe=c.object({deployments:c.array(dJ)}),lfe=c.object({cancelled:c.boolean(),message:c.string().nullish(),declined:c.boolean().nullish()}),dfe=c.object({released:c.literal(!0),id:c.string().nullish()}),pfe=c.looseObject({organisationId:c.string(),organisationName:c.string(),organisationSlug:c.string().min(1).optional()}),mfe=c.looseObject({status:c.string(),roleArn:c.string().optional(),accountId:c.string().optional(),phase:c.string().optional(),reason:c.string().optional()}),ffe=c.looseObject({token:c.string()}),pJ=c.looseObject({quickCreateUrl:c.string(),externalId:c.string()}),mJ=c.looseObject({alreadyConnected:c.literal(!0),account:c.looseObject({awsAccountId:c.string(),accountName:c.string().nullable(),status:c.string()})}),hfe=c.union([mJ,pJ]);function fJ(e){return"alreadyConnected"in e&&e.alreadyConnected===!0}rJ(fJ,"isAlreadyConnected");var gfe=c.looseObject({registered:c.boolean(),repository:c.looseObject({id:c.string()}).optional()});var hJ=Object.defineProperty,gJ=(e,t)=>hJ(e,"name",{value:t,configurable:!0});function Gu(e=f$){return`Deploy tokens are minted from a signed-in browser session by an owner or admin: open ${e}/settings/ci (Settings \u2192 CI/CD Tokens).`}gJ(Gu,"deployTokenMintGuidance");var h$=[{command:"ci status",match:w.success,templates:["Run `fjall ci verify` to check the rest of the wiring \u2014 an active deploy token is necessary, not sufficient","Run `fjall ci token list` to see which applications, environments and accounts each active token may deploy to"]},{command:"ci status",match:w.empty,templates:[Gu(),"Run `fjall ci setup --plan --app <app>` to learn where the workflow file will go and which secret name it will read (`workflowPath`, `secretName`) \u2014 the two things needed to stage the secret before minting. `--plan` mints nothing and writes nothing, and the workflow BODY is printed on the human surface only: it is not a field of the agent payload"]},{command:"ci token list",match:w.success,templates:["Run `fjall token show <id>` to inspect one token's stored constraints","Run `fjall ci token revoke <id> --reason <text>` to revoke a listed token"]},{command:"ci token list",match:w.empty,templates:[Gu(),"Run `fjall ci status` to re-check readiness once a token exists"]},{command:"ci token revoke",match:w.success,templates:["Run `fjall ci token list` to confirm the token now lists as revoked \u2014 a revoked token stays listed, it does not disappear",`Any CI job still holding this token now fails to authenticate. ${Gu()}`]}];var Pf="Do not retry or vary flags: `supported: false` is the server's capability verdict, not an input error \u2014 every invocation answers the same until the Fjall server is updated to a version that ships this API (the `message` field names the upgrade)",g$=[{command:"deployments list",match:w.unsupported,templates:[Pf]},{command:"deployments cancel",match:w.unsupported,templates:[Pf]},{command:"deployments force-release",match:w.unsupported,templates:[Pf]},{command:"dev list",match:w.unsupported,templates:[Pf]},{command:"deployments list",match:w.success,templates:["Run `fjall deployments cancel <id>` to request co-operative cancellation of a listed deployment","Run `fjall deploy logs --deployment-id <id>` to read one deployment's logs"]},{command:"deployments cancel",match:w.success,templates:["Run `fjall deployments list` to confirm whether the slot is free, and read `cancelled` and `declined` before assuming it is: `cancelled: false` means the request was refused, `declined: true` is an already-terminal reject, and a plain granted cancel is co-operative \u2014 the deployment has to acknowledge it","Run `fjall deployments force-release <id> --confirm <id>` to clear a slot that stays occupied (organisation admin, audited \u2014 retype the id in `--confirm`)"]},{command:"deployments force-release",match:w.success,templates:["Run `fjall deployments list` to confirm the slot is free","Run `fjall deploy <app>` to retry the deployment the wedged slot was blocking"]},{command:"dev up",match:w.success,templates:["Run `fjall dev list <app>` to see every slot for this app with its `host` \u2014 rows carry `host`, not a full URL, and it is empty until the slot leaves `creating`","Run `fjall dev down <app> --branch <branch>` to tear this slot down"]},{command:"dev list",match:w.success,templates:["Run `fjall dev down <app> --branch <branch>` to tear one listed slot down \u2014 every row carries the `branch` to name here","Run `fjall dev up <app> --branch <branch>` to bring another branch up"]},{command:"dev down",match:w.success,templates:["Run `fjall dev list <app>` to see which slots remain","Run `fjall dev up <app> --branch <branch>` to bring the branch back up"]},{command:"dev substrate down",match:w.success,templates:["Run `fjall dev list <app>` to confirm no slot survives \u2014 the substrate will not tear down under live slots, and `--force` takes them with it","Any `residuals` row survives the teardown and can still cost: its `cleanupHint` names the manual step"]}];var y$=["Run `fjall domain deploy <name>` to deploy the domain","Run `fjall domain verify <name>` to check DNS delegation once it is deployed","Run `fjall domain export <name>` to export the live zone records"],v$=[{command:"org deploy",match:w.success,templates:["Run `fjall org get` to review the deployed organisation topology and accounts",`Run \`${te.accountDeploy}\` to deploy the account tier if you passed \`--no-cascade\``,`Run \`${te.createApplicationAgent} --name "<name>"\` to create an application to deploy into it`]},{command:"org deploy",match:w.error,templates:["Run `fjall org get` to see which tier of the cascade is already deployed",`Run \`${te.organisationDeploy} --no-cascade\` to retry the organisation stack alone`]},{command:"platform deploy",match:w.success,templates:[`Run \`${te.accountDeploy}\` to deploy the account tier on top of it`]},{command:"platform deploy",match:w.error,templates:["Run `fjall org get` to check the organisation tier is deployed first"]},{command:"account deploy",match:w.success,templates:["Run `fjall apps list` to see which applications are registered","Run `fjall deploy <application>` to deploy one into this account"]},{command:"account deploy",match:w.error,templates:["Run `fjall org get` to confirm the account is registered in the organisation",`Run \`${te.accountDeploy} --target <target>\` to select a specific member account`]},{command:"domain list",match:w.success,templates:["Run `fjall domain verify <name>` to check DNS delegation","Run `fjall domain export <name>` to export zone file","Run `fjall create domain --name <name>` to create a new domain"]},{command:"domain list",match:w.empty,templates:['Run `fjall create domain --name "<name>"` to create a domain',"Run `fjall domain import <name>` to import from Route53"]},{command:"domain verify",match:w.success,templates:["Run `fjall domain export <name>` to export zone file","Run `fjall domain deploy <name>` to deploy domain infrastructure"]},{command:"domain verify",match:w.error,templates:["Run `fjall domain verify <name>` to retry","Run `fjall domain list` to see existing domains"]},{command:"domain export",match:w.success,templates:["Run `fjall domain verify <name>` to check delegation","Run `fjall domain import <name>` to re-import from Route53"]},{command:"domain import",match:w.success,templates:["Run `fjall domain verify <name>` to check delegation","Run `fjall domain export <name>` to see the zone file","Run `fjall domain deploy <name>` to deploy domain infrastructure"]},{command:"domain import",match:w.error,templates:["Run `fjall domain import --hosted-zone-id <id>` to import by zone ID","Run `fjall domain list` to see existing domains"]},{command:"domain records list",match:w.success,templates:["Run `fjall domain sync <domain>` for the full zone-hygiene report","Run `fjall domain sync <domain> --fix` to remediate residue records via the destruction ceremony"]},{command:"domain records list",match:w.empty,templates:["Run `fjall domain deploy <domain>` to deploy the domain's declared records","Run `fjall domain list` to see existing domains"]},{command:"domain records list",match:w.error,templates:["Run `fjall domain records list <domain> --hosted-zone-id <id>` when the zone is not resolvable by name",`Run \`${te.connect}\` if AWS credentials are missing`]},{command:"domain sync",match:w.success,templates:["Run `fjall domain sync <domain> --fix` to remediate residue records (ceremony-gated)","Run `fjall domain records list <domain>` to see every record with its owner"]},{command:"domain sync",match:w.error,templates:["Run `fjall domain sync <domain> --hosted-zone-id <id>` when the zone is not resolvable by name","Run `fjall domain list` to see existing domains"]},{command:"domain delegate",match:w.success,templates:["Run `fjall domain verify <domain>` to confirm public DNS resolution","Run `fjall domain deploy <domain>` to continue a two-phase deploy after delegation"]},{command:"domain delegate",match:w.error,templates:["Run `fjall domain deploy <parent-domain>` so the parent publishes its DelegationRole","Run `fjall domain verify <domain> --show-delegation` for registrar instructions"]},{command:"domain destroy",match:w.success,templates:["Run `fjall domain list` to see remaining domains","Run `fjall domain sync <parent-domain>` to confirm no delegation residue remains"]},{command:"domain destroy",match:w.error,templates:["Run `fjall domain destroy <domain> --remediate '<name>'=recreate` with the exact consent the ticket names","Run `fjall domain list` to see existing domains"]},{command:"domain deploy",match:w.success,templates:["Run `fjall domain verify <domain>` to check DNS propagation","Run `fjall domain delegate <domain>` to write the NS delegation for a delegated child"]},{command:"domain deploy",match:w.error,templates:["Run `fjall domain deploy <domain>` to resume \u2014 the zone phase is retained and skipped on re-run","Run `fjall domain verify <domain> --show-delegation` for registrar delegation instructions"]},{command:"domain eject",match:w.success,templates:["Review the ejected infrastructure.ts \u2014 it is now vanilla CDK owned by you","Run `fjall domain list` to see remaining managed domains"]},{command:"create domain",match:w.success,templates:y$},{command:"domain create",match:w.success,templates:y$},{command:"create domain",match:w.error,templates:["Run `fjall domain list` to see existing domains",'Run `fjall create domain --name "<name>"` to retry with a different name']},{command:"create account",match:w.success,templates:[`Run \`${te.connect} --environment production\` to link your AWS account`,`Run \`${te.accountDeploy}\` to deploy account infrastructure (after connecting)`]},{command:"create account",match:w.error,templates:[`Run \`${te.createAccount} --primary-region <region>\` to retry`,`Run \`${te.createAccount} --help\` for usage information`]},{command:"create org",match:w.success,templates:[`Run \`${te.connect} --name "<account-name>" --region <region>\` to link the AWS Organizations management account \u2014 omit \`--environment\` so it registers at the organisation tier`,`Run \`${te.organisationDeploy}\` to deploy all infrastructure (after connecting)`]},{command:"create org",match:w.error,templates:[`Run \`${te.createOrganisation} --email "<email>"\` to retry (add \`--name "<name>"\` only for a brand-new organisation)`,`Run \`${te.createOrganisation} --help\` for all options`]},{command:"restore",match:w.successDryRun,templates:["Run `fjall restore <resourceType> --recovery-point <recoveryPointArn> --yes` to initiate restore","Run `fjall apps list` to see existing applications"]},{command:"restore",match:w.success,templates:["Open the AWS Console URL above to monitor restore progress","Run `fjall import` to import the restored resource after completion"]},{command:"restore",match:w.errorWithCode("NOT_FOUND"),templates:["Verify the recovery point ARN is correct and exists in the current region","Run `fjall restore <resourceType> --recovery-point <arn>` to retry"]},{command:"restore",match:w.errorWithCode("FORBIDDEN"),templates:["Ensure the IAM role has backup:StartRestoreJob and iam:PassRole permissions","Run `fjall restore` interactively to configure with guided setup"]},{command:"import",match:w.successDryRun,templates:["Run `fjall import --app <app> --resource-id <resourceId> --yes` to import a specific resource","Run `fjall import --app <app> --yes` to import all discovered resources"]},{command:"import",match:w.success,templates:["Run `fjall deploy <app>` to deploy with the imported resource","Run `fjall apps describe <app>` to see updated resources"]},{command:"import",match:w.errorWithCode("NOT_FOUND"),templates:[`Run \`${te.createApplicationAgent} --name "<app>"\` to create the application`,"Run `fjall apps list` to see existing applications"]},{command:"import",match:w.errorWithCode("VALIDATION_ERROR"),templates:["Run `fjall import --app <app> --resource-id <resourceId>` to import a specific resource","Run `fjall import --app <app> --resource-id <resourceId> --yes` to import immediately"]},{command:"aws exec",match:w.success,templates:["Run `fjall aws exec -- <command...>` to run another AWS CLI command","Run `fjall status` to check application health"]},{command:"aws exec",match:w.error,templates:["Retry the command \u2014 OIDC token mints can fail transiently",`Run \`${te.login}\` if the retry also fails with an authentication error`]},{command:"unlock bucket",match:w.success,templates:["Re-put sane bucket policy statements (enforceSSL deny, access grants) \u2014 the unlock deleted the ENTIRE policy","Run `fjall destroy <app>` to retry the blocked stack cleanup"]},{command:"unlock bucket",match:w.error,templates:["Ensure your credentials belong to the organisation's management account \u2014 STS AssumeRoot is rejected elsewhere","Run `fjall unlock bucket <name> --account <id> --acknowledge-root-session` to retry"]}];var yJ=Object.defineProperty,x$=(e,t)=>yJ(e,"name",{value:t,configurable:!0}),b$="Run `fjall connect status` to check that an AWS account is connected: asset discovery only inventories connected accounts, so an organisation with none has nothing to inventory",S$=["Run `fjall assets show <asset>` to read one asset in full \u2014 pass its `assetIdentifier`","Run `fjall assets compliance <asset>` to list an asset's recorded posture issues \u2014 pass its `assetIdentifier`, the address every server version accepts"],E$=x$(e=>e.outcome==="success"&&e.nextCursor!==void 0,"isTruncatedPage"),A$=[{command:"assets list",match:x$(e=>E$(e)&&e.fields!==void 0&&e.fields!=="","match"),templates:["This window is truncated \u2014 more assets exist beyond these rows. Run `fjall assets list --cursor <nextCursor> --fields <fields>` to fetch the next page with the same projection; `total` counts this window only, and `fjall assets summary` reports the estate-wide tally, split active/deleted",...S$]},{command:"assets list",match:E$,templates:["This window is truncated \u2014 more assets exist beyond these rows. Run `fjall assets list --cursor <nextCursor>` to fetch the next page; `total` counts this window only, and `fjall assets summary` reports the estate-wide tally, split active/deleted",...S$]},{command:"assets list",match:w.success,templates:["The `total` aggregate counts the rows in this response, not the estate: `--take` bounds the window (default 50). No `nextCursor` aggregate here means the estate ends with these rows; `fjall assets summary` reports the estate-wide tally, split active/deleted","Run `fjall assets show <asset>` to read one asset in full","Run `fjall assets compliance <asset>` to list an asset's recorded posture issues \u2014 pass its `assetIdentifier`, the address every server version accepts (row `id`s are only accepted by newer servers)"]},{command:"assets list",match:w.empty,templates:["Run `fjall assets list --status deleted` to include assets discovery has since marked deleted \u2014 the default listing hides them",b$]},{command:"assets show",match:w.success,templates:["Run `fjall assets compliance <asset>` to list the posture issues recorded against this asset","Run `fjall assets show <asset> --fields id,accountId,iacStatus,estimatedMonthlyCost,lastSeenAt` to read the fields the default projection omits"]},{command:"assets compliance",match:w.success,templates:["Read the `status` column before acting: this listing returns every issue recorded against the asset, `resolved` and `suppressed` included, where the `openIssues` count on `fjall assets list` counts only the open ones","Run `fjall compliance fix --domain compliance --issue-id <issueId>` to read this issue in full alongside the organisation's other open issues. `--domain` is the producer's category \u2014 one of `compliance`, `cost`, `performance` \u2014 not a framework name, and the response is context to reason from, not a remediation step: use `--execute` to run one","Run `fjall assets show <asset>` to read the asset these issues were raised against"]},{command:"assets compliance",match:w.empty,templates:["No issue of ANY status has been recorded against this asset \u2014 an empty listing here is not the same as issues that were resolved, which would still appear with `status: resolved`","Run `fjall assets list --fields name,assetIdentifier,openIssues` to find the assets that do carry open issues"]},{command:"assets summary",match:w.success,templates:["Run `fjall assets list --fields name,assetIdentifier,openIssues` to see which assets sit behind `withIssues` \u2014 `withIssues` counts the assets carrying at least one open issue, `openIssues` counts those issues per asset","Run `fjall assets list --take <n>` to read the rows behind these totals \u2014 page onwards with `--cursor` when the listing reports a `nextCursor`, and pass `--status deleted` to include the `deleted` rows in the listing (interleaved with active \u2014 read the `status` column). These totals are estate-wide (the summary pages the listing to exhaustion, deleted assets included): `total` counts the whole estate, `active` and `deleted` split it"]},{command:"assets summary",match:w.empty,templates:[b$]},{command:"costs show",match:w.success,templates:["Run `fjall costs --mode forecast` to see forecasted spend","Run `fjall costs --mode breakdown` to see service-level breakdown"]},{command:"costs show",match:w.error,templates:["Run `fjall costs --app <app>` to filter by application","Run `fjall costs --help` for usage information"]},{command:"metrics show",match:w.success,templates:["Run `fjall metrics --mode latency` to see latency percentiles","Run `fjall metrics --mode errors` to see error trends"]},{command:"metrics show",match:w.error,templates:["Run `fjall metrics --app <app>` to filter by application","Run `fjall metrics --help` for usage information"]},{command:"compliance fix",match:w.success,templates:["Run `fjall compliance fix --domain <domain> --issue-id <id>` to narrow the suggestions to one issue","Run `fjall deploy <app>` to apply remediation changes"]},{command:"compliance fix",match:w.error,templates:["Run `fjall compliance fix --domain <domain>` to name the compliance domain","Run `fjall compliance --help` for usage information"]},{command:"compliance fix --execute",match:w.success,templates:["Read the result's `kind` before treating the issue as fixed: `auto-pr` opened a pull request that still has to be merged, `imperative` rewrote the live policy, and `manual-hint` changed nothing \u2014 its `awsCliHint` carries the manual step, and that field is absent for rules that supply no hint (`message` is a fixed string either way)","Do not re-read the issue to confirm the cure: nothing on the remediation path writes to the issue record, so `status` stays `open` until the next discovery scan re-evaluates the asset. Verify at the thing that changed \u2014 the pull request, or the live resource","Run `fjall deploy <app>` to roll out an `auto-pr` remediation once its pull request is merged"]},{command:"deploy diff",match:w.success,templates:["Run `fjall deploy logs --deployment-id <id>` to analyse deployment logs","Run `fjall status <app>` to check current deployment health"]},{command:"deploy diff",match:w.error,templates:["Run `fjall list deployments` to see recent deployment IDs","Run `fjall deploy diff --help` for usage information"]},{command:"deploy logs",match:w.success,templates:["Run `fjall deploy diff <idA> <idB>` to compare two deployments","Run `fjall status <app>` to check current deployment health"]},{command:"deploy logs",match:w.error,templates:["Run `fjall deploy logs --deployment-id <id>` with a valid deployment ID","Run `fjall list deployments` to find a deployment ID"]}];var vJ={command:"*",match:w.error,templates:["Run `fjall <command> --help` for usage information"]},_$=[...KO,...ZO,...HO,...h$,...g$,...v$,...A$,vJ];var bJ=Object.defineProperty,SJ=(e,t)=>bJ(e,"name",{value:t,configurable:!0}),T$=["app","environment","region","profile","target","cluster","service","lambda","status","type"],Oa=["app","cluster","service","lambda"],EJ=["status","type","region"],e_={deploy:["environment","region","target"],"deploy diff":[],"deploy logs":[],destroy:["target"],"org deploy":["target"],"org destroy":["target"],"platform deploy":["target"],"platform destroy":["target"],"account deploy":["target"],"account destroy":["target"],status:[],rollout:[],list:["app"],apps:["target"],connect:["environment","region"],"connect status":[],import:["app","region"],costs:["app"],metrics:["app"],compliance:["app"],"token create":["app","environment"],"unlock bucket":["region"],"aws exec":["app","region","target"],"secrets set":Oa,"secrets get":Oa,"secrets list":Oa,"secrets delete":Oa,"secrets export":Oa,"secrets import":Oa,"secrets exec":Oa,"assets list":EJ},xJ=Math.max(...Object.keys(e_).map(e=>e.split(" ").length));function t_(e){let t=e.trim().split(/\s+/).slice(1);for(let r=xJ;r>=1;r--){let i=t.slice(0,r).join(" ");if(Object.hasOwn(e_,i))return e_[i]}return[]}SJ(t_,"resolvePreservableFlags");var AJ=Object.defineProperty,Of=(e,t)=>AJ(e,"name",{value:t,configurable:!0});function r_(e){let t=e.replace(/[\u0000-\u001f\u007f`]/g,"");return/[^\w@%+=:,./-]/.test(t)?`'${t.replace(/'/g,"'\\''")}'`:t}Of(r_,"shellEscape");function C$(e,t,r){let i=new Set,n=e.replace(/<(\w+)>/g,(a,o)=>{let s=t[o];return s===void 0||s===""?`<${o}>`:(i.add(o),o==="command"?s:r_(s))});return I$(n,r,i)}Of(C$,"interpolateTemplate");var Rf=class{static{Of(this,"SuggestionResolver")}command;flags;constructor(t,r){this.command=t,this.flags=r}resolve(t){let r=_$.find(i=>(i.command===this.command||i.command==="*")&&i.match(t));return r===void 0?[]:r.templates.map(i=>C$(i,t,this.flags))}};function I$(e,t,r=new Set){let i=/`(fjall[^`]*)`/.exec(e),n=i?.[1];if(i===null||n===void 0)return e;let a=t_(n),o=[];for(let p of T$){if(!a.includes(p))continue;let g=t[p];g!==void 0&&g!==""&&!r.has(p)&&!n.includes(`--${p}`)&&o.push(`--${p} ${r_(g)}`)}if(o.length===0)return e;let s=` ${o.join(" ")}`,u=n.indexOf(" -- "),d=u===-1?`${n}${s}`:`${n.slice(0,u)}${s}${n.slice(u)}`;return e.slice(0,i.index)+`\`${d}\``+e.slice(i.index+i[0].length)}Of(I$,"applyPreservedFlags");var _J=Object.defineProperty,Xn=(e,t)=>_J(e,"name",{value:t,configurable:!0});function ln(e,t){if(t!==void 0&&Ts(e)){let i={};for(let[n,a]of Object.entries(e))i[n]=t.has(n)?a:ln(a);return i}if(typeof e=="string")return ge(e);if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(i=>ln(i));if(e instanceof Date||e instanceof RegExp)return e;let r={};for(let[i,n]of Object.entries(e))r[i]=ln(n);return r}Xn(ln,"maskTree");function $f(e){if(Array.isArray(e))return e.map($f);if(!Ts(e))return e;let t={};for(let[r,i]of Object.entries(e))i!==void 0&&(t[r]=$f(i));return t}Xn($f,"stripAbsent");function Ts(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof Date)&&!(e instanceof RegExp)}Xn(Ts,"isPlainRecord");function D$(e){let t=e?.verbatimFields;return t!==void 0&&t.length>0?new Set(t):void 0}Xn(D$,"toVerbatimKeys");function w$(e,t){return t===void 0||!Ts(e)?!1:Object.keys(e).some(r=>t.has(r))}Xn(w$,"carriesVerbatimField");function k$(e,t){let r=e;for(let i of t.split(".")){if(!Ts(r))return;r=r[i]}return r}Xn(k$,"resolveDotPath");function N$(e,t,r){let i=e.project(t),n={};for(let a of r)a in i&&(n[a]=i[a]);return n}Xn(N$,"projectSelectedFields");var Wu=class{static{Xn(this,"AgentOutputWriter")}write;hasWrittenBlock=!1;resolver;flags;full;budget;requestedFields;constructor(t){this.write=t.writeFn??(r=>{process.stdout.write(r)}),this.resolver=new Rf(t.command,t.flags),this.flags=t.flags,this.full=t.full??!1,this.budget=t.budget,this.requestedFields=t.fields??[]}get isFullOutput(){return this.full}writeBlock(t){t!==""&&(this.hasWrittenBlock&&this.write(kA+`
|
|
342
342
|
`),this.hasWrittenBlock=!0,this.write(t))}renderResult(t,r){let i=D$(r?.schema),n=ln(t,i),a=r?.schema!==void 0&&Ts(n)?this.applySchema(n,r.schema):n,o=PA(a),s=this.resolveHelp(r?.suggestionContext),u=o+s+`
|
|
343
343
|
`;this.writeBlock((w$(a,i)?u:xf(u,this.budget))+As())}renderListResult(t,r,i){let n=t.map(d=>ln(d)),a=i.fields,o=a!==void 0&&a.length>0?a:r.fields,s=RA(n,{fields:o,project:Xn(d=>N$(r,d,o),"project")},{entity:i.entity,aggregates:i.aggregates}),u=this.resolveHelp(i.suggestionContext);this.writeBlock(xf(s+u+`
|
|
344
344
|
`,this.budget)+As())}renderEvent(t){let r=ln(t),i=jA({...r,value:$f(r.value)});this.writeBlock(i)}renderError(t,r){let i={...t,message:ge(t.message),...t.details!==void 0?{details:ln(t.details)}:{}},n=OA(i),a=this.resolveHelp(r);this.writeBlock(n+a+`
|
|
@@ -351,10 +351,10 @@ ${kA}
|
|
|
351
351
|
`)}}setDebugEnabled(t){this.debugEnabled=t}write(t,r){this.isClosing||(this.initialised||this.initialise(),this.buffer.push(t),this.debugEnabled&&r&&this.debugBuffer.push(t),this.buffer.length>=this.config.maxBufferSize&&this.flush())}flushBuffer(t,r,i){if(t.length===0||!r)return{buffer:t,stream:r};let n=r;this.fileRotator.needsRotation(i,this.config.maxFileSize)&&(n.end(),this.fileRotator.rotate(i),n=this.openStream(i));for(let a of t)n.write(JSON.stringify(a)+`
|
|
352
352
|
`);return{buffer:[],stream:n}}flush(){let t=this.flushBuffer(this.buffer,this.mainLogStream,this.mainLogPath);this.buffer=t.buffer,this.mainLogStream=t.stream;let r=this.flushBuffer(this.debugBuffer,this.debugLogStream,this.debugLogPath);this.debugBuffer=r.buffer,this.debugLogStream=r.stream}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.mainLogStream&&(this.mainLogStream.end(),this.mainLogStream=null),this.debugLogStream&&(this.debugLogStream.end(),this.debugLogStream=null),this.buffer=[],this.debugBuffer=[],this.initialised=!1,this.isClosing=!1}async closeAndFlush(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null);let t=[];this.mainLogStream&&(t.push(this.mainLogStream),this.mainLogStream=null),this.debugLogStream&&(t.push(this.debugLogStream),this.debugLogStream=null),this.buffer=[],this.debugBuffer=[],this.initialised=!1,await Promise.all(t.map(r=>new Promise(i=>{r.end(()=>i())}))),this.isClosing=!1}};import{createWriteStream as qJ,existsSync as HJ,mkdirSync as JJ,readdirSync as XJ,statSync as YJ,unlinkSync as QJ}from"fs";import{join as p_}from"path";var Yn={trace:0,debug:1,info:2,warn:3,error:4},dn={MAX_FILE_SIZE:qu.MAX_FILE_SIZE,MAX_FILES:qu.MAX_FILES,MAX_BUFFER_SIZE:100,MAX_DEPLOYMENT_LOGS_PER_APP:100,MAX_DEPLOYMENT_LOG_BYTES_PER_APP:256*1024*1024,FLUSH_INTERVAL_MS:500,LOG_FILENAME:"fjall.jsonl",DEBUG_LOG_FILENAME:"fjall-debug.jsonl"};var WJ=Object.defineProperty,KJ=(e,t)=>WJ(e,"name",{value:t,configurable:!0});function ws(){return Wm()}KJ(ws,"getDefaultLogDir");var ZJ=Object.defineProperty,G$=(e,t)=>ZJ(e,"name",{value:t,configurable:!0}),eX=/^[a-zA-Z0-9_-]+-\d{4}-\d{2}-\d{2}T[\d-]+Z\.jsonl$/,tX=6e4;function W$(e,t,r){try{let i=Date.now(),n=XJ(e).filter(s=>eX.test(s)).map(s=>{let u=p_(e,s);try{let d=YJ(u);return{path:u,mtimeMs:d.mtimeMs,size:d.size}}catch{return}}).filter(s=>s!==void 0&&i-s.mtimeMs>=tX);n.sort((s,u)=>u.mtimeMs-s.mtimeMs);let a=0,o=0;for(let s of n){if(a===0||a<t&&o+s.size<=r){a+=1,o+=s.size;continue}try{QJ(s.path)}catch{}}}catch{}}G$(W$,"pruneOldDeploymentLogs");var Hu=class{static{G$(this,"DeploymentLoggerImpl")}mainLogger;appName;operationType;logStream=null;logPath;deploymentId;buffer=[];flushInterval=null;isClosing=!1;maxBufferSize=dn.MAX_BUFFER_SIZE;constructor(t,r,i){this.mainLogger=t,this.appName=r,this.operationType=i,this.deploymentId=`${i}-${Date.now()}`;let n=ws(),a=p_(n,"deployments",r);HJ(a)||JJ(a,{recursive:!0}),W$(a,dn.MAX_DEPLOYMENT_LOGS_PER_APP,dn.MAX_DEPLOYMENT_LOG_BYTES_PER_APP);let o=new Date().toISOString().replace(/[:.]/g,"-"),s=`${i}-${o}.jsonl`;this.logPath=p_(a,s);try{this.logStream=qJ(this.logPath,{flags:"a"}),this.flushInterval=setInterval(()=>this.flush(),dn.FLUSH_INTERVAL_MS),this.info("DeploymentLogger","Deployment logging initialised",{appName:r,operationType:i,deploymentId:this.deploymentId,logPath:this.logPath})}catch{}}log(t,r,i,n,a,o){if(this.isClosing)return;let s={timestamp:new Date().toISOString(),level:t,component:r,message:i,correlationId:this.deploymentId,...n&&Object.keys(n).length>0&&{data:n},...a&&{stackName:a},...o&&{phase:o}};this.buffer.push(s),this.mainLogger.logWithCorrelation(t,r,i,this.deploymentId,n,a,o),this.buffer.length>=this.maxBufferSize&&this.flush()}flush(){if(!(this.buffer.length===0||!this.logStream)){for(let t of this.buffer)this.logStream.write(JSON.stringify(t)+`
|
|
353
353
|
`);this.buffer=[]}}info(t,r,i){this.log("info",t,r,i)}warn(t,r,i){this.log("warn",t,r,i)}error(t,r,i){this.log("error",t,r,i)}debug(t,r,i){this.log("debug",t,r,i)}stackEvent(t,r,i,n){this.log("info","StackDeployment",i,n,t,r)}dockerEvent(t,r){this.log("info","DockerOperation",t,{percentage:r})}ecsEvent(t,r,i){this.log("info","ECSDeployment",t,{percentage:r,taskCount:i})}close(){this.isClosing=!0,this.flush(),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.logStream&&(this.logStream.end(),this.logStream=null),this.buffer=[],this.isClosing=!1}getLogPath(){return this.logPath}getDeploymentId(){return this.deploymentId}};var rX=Object.defineProperty,h_=(e,t)=>rX(e,"name",{value:t,configurable:!0});function f_(){let e=c_();return e==="agent"||e==="mcp"}h_(f_,"isStructuredOutputMode");function K$(){return bs.isUIMode||bs.isNonInteractive}h_(K$,"surfaceOwnsConsole");var Lf=class e{static{h_(this,"Logger")}static instance=null;config;debugEnabled;traceEnabled;minLevel;fileWriter;mainLogPath;debugLogPath;constructor(){let t=ws(),r=m_(t,"debug"),{maxFileSize:i,maxFiles:n}=d_();this.config={logDir:t,debugLogDir:r,maxFileSize:i,maxFiles:n,maxBufferSize:dn.MAX_BUFFER_SIZE,flushIntervalMs:dn.FLUSH_INTERVAL_MS},this.mainLogPath=m_(t,dn.LOG_FILENAME),this.debugLogPath=m_(r,dn.DEBUG_LOG_FILENAME),this.debugEnabled=process.env.FJALL_DEBUG==="true"||process.env.FJALL_TRACE==="true"||process.argv.includes("--verbose")||process.argv.includes("-v"),this.traceEnabled=process.env.FJALL_TRACE==="true";let a=process.env.FJALL_LOG_LEVEL?.toLowerCase();a&&a in Yn?this.minLevel=a:this.traceEnabled?this.minLevel="trace":this.debugEnabled?this.minLevel="debug":this.minLevel="info",this.fileWriter=new Ff(this.config,this.mainLogPath,this.debugLogPath,this.debugEnabled)}static getInstance(){return e.instance||(e.instance=new e),e.instance}shouldLog(t){return Yn[t]>=Yn[this.minLevel]}createEntry(t,r,i,n,a,o,s){return{timestamp:new Date().toISOString(),level:t,component:r,message:i,...a&&{correlationId:a},...n&&Object.keys(n).length>0&&{data:n},...o&&{stackName:o},...s&&{phase:s}}}log(t,r,i,n,a,o,s){if(!this.shouldLog(t))return;let u=this.createEntry(t,r,i,n,a,o,s),d=t==="debug"||t==="trace";this.fileWriter.write(u,d),this.writeConsole(u)}writeConsole(t){if(f_()||K$()){this.debugEnabled&&this.writeStderrLine(t);return}let r=this.getConsolePrefix(t.level),i=`[${t.component}]`,n=`${r} ${i} ${t.message}`;t.level==="error"?console.error(n):t.level==="warn"?console.warn(n):console.log(n)}writeStderrLine(t){let r=this.getConsolePrefix(t.level),i=`[${t.component}]`,n="";if(t.data&&Object.keys(t.data).length>0)try{n=` ${JSON.stringify(t.data)}`}catch{n=" [unserialisable data]"}let a=`${r} ${i} ${t.message}${n}`;process.stderr.write(`${ge(a)}
|
|
354
|
-
`)}getConsolePrefix(t){switch(t){case"error":return"[ERROR]";case"warn":return"[WARN]";case"info":return"[INFO]";case"debug":return"[DEBUG]";case"trace":return"[TRACE]"}}error(t,r,i){this.log("error",t,r,i)}warn(t,r,i){this.log("warn",t,r,i)}info(t,r,i){this.log("info",t,r,i)}debug(t,r,i){this.log("debug",t,r,i)}trace(t,r,i){this.log("trace",t,r,i)}diagnostic(t,r,i,n){this.log(t,r,i,n),!this.debugEnabled&&f_()&&(Yn[t]<Yn.info||this.writeStderrLine(this.createEntry(t,r,i,n)))}isDebugEnabled(){return this.debugEnabled}isTraceEnabled(){return this.traceEnabled}enableDebug(){this.debugEnabled=!0,Yn[this.minLevel]>Yn.debug&&(this.minLevel="debug"),this.fileWriter.setDebugEnabled(!0),this.fileWriter.isInitialised&&this.fileWriter.initialiseDebugStream()}withCorrelation(t){return new Is(this,t)}forDeployment(t,r="deploy"){return new Hu(this,t,r)}close(){this.fileWriter.close()}async flushAndClose(){await this.fileWriter.closeAndFlush()}getLogPath(){return this.mainLogPath}getDebugLogPath(){return this.debugLogPath}getLogDir(){return this.config.logDir}logWithCorrelation(t,r,i,n,a,o,s){this.log(t,r,i,a,n,o,s)}static reset(){e.instance&&(e.instance.close(),e.instance=null)}};var cn=Lf.getInstance();var nX=Object.defineProperty,ks=(e,t)=>nX(e,"name",{value:t,configurable:!0});function g_(e){return e.success===!0}ks(g_,"isSuccess");function y_(e){return e.success===!1}ks(y_,"isFailure");function G(e){return{success:!0,data:e}}ks(G,"success");function $(e){return{success:!1,error:e}}ks($,"failure");async function v_(e){try{let t=await e();return G(t)}catch(t){return $(Vr(t))}}ks(v_,"tryAsync");function b_(e){try{let t=e();return G(t)}catch(t){return $(Vr(t))}}ks(b_,"trySync");var iX=Object.defineProperty,aX=(e,t)=>iX(e,"name",{value:t,configurable:!0}),Z$=/^[a-zA-Z][a-zA-Z0-9-]*$/,oX=Tu.source.replace(/^\^|\$$/g,""),fe=Object.freeze({IDENTIFIER:Z$,NEW_APP_NAME:/^[a-z][a-z0-9-]*$/,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:Z$,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:new RegExp(`^(?:/${oX})+$`),SECRET_NAME:Qm,SSM_COMPONENT:Tu,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,HTTP_ORIGIN:/^https?:\/\/[a-z0-9.-]+(:\d+)?$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/,SCHEDULE_EXPRESSION:/^(rate\(1 (?:minute|hour|day)\)|rate\((?:[2-9]|[1-9]\d+) (?:minutes|hours|days)\)|cron\([^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+\))$/,LAMBDA_RUNTIME_IDENTIFIER:/^[A-Za-z0-9._-]+$/,ENV_VAR_NAME:/^[A-Za-z_][A-Za-z0-9_]*$/});function S_(e){let t=/^rate\((\d+) (minute|minutes|hour|hours|day|days)\)$/.exec(e);if(!t)return;let r=t[1],i=t[2];if(r===void 0||i===void 0)return;let n=parseInt(r,10);if(!Number.isFinite(n)||n<1)return;let a=i==="minute"||i==="hour"||i==="day";if(!(a&&n!==1)&&!(!a&&n===1))return i==="minute"||i==="minutes"?{everyMs:n*6e4}:i==="hour"||i==="hours"?{everyMs:n*60*6e4}:{everyMs:n*24*60*6e4}}aX(S_,"parseRateExpression");var q$=["t4g.medium","m7g.medium","m8g.medium","r7g.medium","r8g.medium","m7g.large","m8g.large","r7g.large","r8g.large","m7g.xlarge","m8g.xlarge","r7g.xlarge","r8g.xlarge"];var E=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",NEW_APP_NAME:"Must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:Wx,SSM_COMPONENT:ef,EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",SOURCE:"Source directory is required",BUILD_COMMAND:"Build command is required",OUTPUT_DIR:"Output directory is required",FORMS_TO:"Forms recipient address is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required",CONNECTED_RESOURCE_NAME:"Connected resource names must not be empty"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},CLICKHOUSE_STORAGE:{INTEGER:"ClickHouse storage must be a whole number of GiB",MIN:`ClickHouse storage must be at least ${100} GiB`,MAX:`ClickHouse storage cannot exceed ${16384} GiB (the gp3 ceiling)`},CLICKHOUSE_IOPS:{INTEGER:"ClickHouse iops must be a whole number",MIN:`ClickHouse iops must be at least ${3e3} (the gp3 baseline)`,MAX:`ClickHouse iops cannot exceed ${8e4} (the gp3 ceiling)`},CLICKHOUSE_THROUGHPUT:{INTEGER:"ClickHouse throughputMbps must be a whole number of MiB/s",MIN:`ClickHouse throughputMbps must be at least ${125} MiB/s (the gp3 baseline)`,MAX:`ClickHouse throughputMbps cannot exceed ${2e3} MiB/s (the gp3 ceiling)`},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days (the RDS automated-backup ceiling)"},CLICKHOUSE_BACKUP_RETENTION:{INTEGER:"ClickHouse backup retention must be an integer number of days",MIN:`ClickHouse backup retention must be at least ${1} day`,MAX:`ClickHouse backup retention cannot exceed ${3650} days`},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"},RESPONSE_TIME_MS:{MIN:"Response-time threshold must be at least 1 ms"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"});var sX=Object.defineProperty,Sr=(e,t)=>sX(e,"name",{value:t,configurable:!0}),cX=["us-east-2","us-west-2","us-east-1","eu-west-1","eu-central-1","ap-southeast-1"],uX=Object.freeze(cX.flatMap(e=>{let t=us(e);return t?[t]:[]})),w_=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","ap-southeast-1"]);function Uf(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}Sr(Uf,"parseRegionList");function k_(e){return Gn.includes(e)}Sr(k_,"isValidRegion");function N_(e){return/^[a-z]{2}-[a-z]+-[1-9]$/.test(e)}Sr(N_,"isValidRegionFormat");function P_(e){if(!e)return w_.slice(0,3);let t=e.toLowerCase().split("-"),r=t[0],i=t.length>1?t[1]:"",n=[];return r&&i&&(n=Gn.filter(a=>a.startsWith(`${r}-${i}`))),n.length===0&&r&&(n=Gn.filter(a=>a.startsWith(`${r}-`))),n.length>0?n.slice(0,3):w_.slice(0,3)}Sr(P_,"getSuggestions");function R_(e){if(k_(e))return!0;let t=P_(e);return N_(e)?`Unknown region. Try: ${t.join(", ")}`:`Invalid format. Try: ${t.join(", ")}`}Sr(R_,"validateRegion");function H$(e){if(!e||e.trim()==="")return!0;let t=Uf(e);for(let r of t){let i=R_(r);if(i!==!0)return i}return!0}Sr(H$,"validateRegionList");function O_(e,t){return e.filter(r=>r!==t)}Sr(O_,"filterDuplicateRegions");function $_(e){return{label:e.city,value:e.code,description:e.optIn?`${e.code} \u2014 opt-in required`:e.code}}Sr($_,"toRegionOption");function J$(){return yr.map($_)}Sr(J$,"getRegionOptions");function X$(e){return yr.filter(t=>t.code!==e).map($_)}Sr(X$,"getRegionOptionsExcluding");function Y$(e){let t=yr.find(r=>r.code===e);return t?t.city:e}Sr(Y$,"getRegionName");function Q$(e){return t=>{let r=Uf(t);return O_(r,e)}}Sr(Q$,"createRegionFormatter");var zf="27.0.0";var Bf=["Aurora","Instance","GlobalAurora","ClickHouse"],Ns=["FARGATE","FARGATE_SPOT","EC2"],Kr=["standard","resilient","enterprise"],Vf=["tinkerer","lightweight","standard","resilient","enterprise"],j_="custom",Ju=[...Vf,j_];var lX=Object.defineProperty,dX=(e,t)=>lX(e,"name",{value:t,configurable:!0}),uge=Object.freeze({RESOURCE_SUFFIXES:Object.freeze({storage:"Storage",database:"Database",cluster:"Cluster",function:"Function",instance:"Instance",compute:"Compute"})}),Xu=["ecs","lambda","ec2"],Yu=Object.freeze({ECS:"ecs",LAMBDA:"lambda",EC2:"ec2"}),Gf=["code","container"],Wf=Object.freeze({CODE:"code",CONTAINER:"container"}),Kf=["ARM_64","X86_64"],e1="ARM_64",Qu=["NONE","AWS_IAM"],Zf=["public","internal"],qf=["CPU","MEMORY"],ja=["messaging","compute"],Hf=["ARM","STANDARD"],M_=["Instance","Aurora"],Ps=["postgresql","mysql"],el=["web","worker"],t1=["foundation","compliance","hardened"];var Jf=["t3.nano","t3.micro","t3.small","t3.medium","t3.large","t3.xlarge","t3.2xlarge","t3a.nano","t3a.micro","t3a.small","t3a.medium","t3a.large","t3a.xlarge","t3a.2xlarge","t4g.nano","t4g.micro","t4g.small","t4g.medium","t4g.large","t4g.xlarge","t4g.2xlarge","c5.large","c5.xlarge","c5.2xlarge","c5.4xlarge","c5.9xlarge","c5.12xlarge","c5.18xlarge","c5.24xlarge","c5a.large","c5a.xlarge","c5a.2xlarge","c5a.4xlarge","c5a.8xlarge","c5a.12xlarge","c5a.16xlarge","c5a.24xlarge","c6g.medium","c6g.large","c6g.xlarge","c6g.2xlarge","c6g.4xlarge","c6g.8xlarge","c6g.12xlarge","c6g.16xlarge","r5.large","r5.xlarge","r5.2xlarge","r5.4xlarge","r5.8xlarge","r5.12xlarge","r5.16xlarge","r5.24xlarge","r5a.large","r5a.xlarge","r5a.2xlarge","r5a.4xlarge","r5a.8xlarge","r5a.12xlarge","r5a.16xlarge","r5a.24xlarge","r6g.medium","r6g.large","r6g.xlarge","r6g.2xlarge","r6g.4xlarge","r6g.8xlarge","r6g.12xlarge","r6g.16xlarge","i3.large","i3.xlarge","i3.2xlarge","i3.4xlarge","i3.8xlarge","i3.16xlarge","p3.2xlarge","p3.8xlarge","p3.16xlarge","g4dn.xlarge","g4dn.2xlarge","g4dn.4xlarge","g4dn.8xlarge","g4dn.12xlarge","g4dn.16xlarge","m5.large","m5.xlarge","m5.2xlarge","m5.4xlarge","m5.8xlarge","m5.12xlarge","m5.16xlarge","m5.24xlarge","m5a.large","m5a.xlarge","m5a.2xlarge","m5a.4xlarge","m5a.8xlarge","m5a.12xlarge","m5a.16xlarge","m5a.24xlarge"],r1=[0,1,5,10,15,30,60];function Ut(e,t){return e.includes(t)}dX(Ut,"constIncludes");var n1=1,i1=65535,fge=Object.freeze({postgresql:5432,mysql:3306}),a1=128,o1=10240,Xf=1,Yf=900,F_=1,L_=1e3,Rs=100,s1=100;var c1=3e3;var u1=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],l1=["standard","assets","upload","website"],Os=["AES256","KMS"];var pX=Object.defineProperty,tl=(e,t)=>pX(e,"name",{value:t,configurable:!0}),zt=tl(e=>c.union([c.literal(!1),e]),"optionalOrDisabled"),Ma={check:tl(e=>e.minCapacity!==void 0&&e.maxCapacity!==void 0?e.minCapacity<=e.maxCapacity:!0,"check"),params:{message:E.CAPACITY_CONSTRAINT.MIN_LTE_MAX,path:["maxCapacity"]}},rl=tl(e=>c.number().int(E.MEMORY_LIMIT.INTEGER).min(e,e===128?E.MEMORY_LIMIT.MIN_128:E.MEMORY_LIMIT.MIN_512).max(30720,E.MEMORY_LIMIT.MAX),"memoryLimitMiBSchema"),be=c.string().min(1,E.REQUIRED.RESOURCE_NAME).max(63,E.MAX_LENGTH.RESOURCE_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),p1=c.string().min(1,E.REQUIRED.BUCKET_NAME).max(63,E.MAX_LENGTH.BUCKET_NAME).regex(fe.BUCKET_NAME,E.BUCKET_NAME),m1=c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME);function Qf(e,t=fe.IDENTIFIER,r=E.IDENTIFIER){return c.string().min(2,E.IDENTIFIER_MIN_LENGTH).max(50,e).regex(t,r).refine(i=>!i.endsWith("-"),{message:E.IDENTIFIER_NO_TRAILING_HYPHEN}).refine(i=>!i.includes("--"),{message:E.IDENTIFIER_NO_CONSECUTIVE_HYPHENS})}tl(Qf,"identifierSchema");var ut=Qf(E.MAX_LENGTH.APP_NAME),Ege=Qf(E.MAX_LENGTH.APP_NAME,fe.NEW_APP_NAME,E.NEW_APP_NAME),Fa=c.number().int(E.PORT.INTEGER).min(n1,E.PORT.MIN).max(i1,E.PORT.MAX),St=c.object({key:c.string(),sourceText:c.string()}).strict(),mX=c.object({__identifier:c.string()}).strict(),fX=c.object({__expression:c.string()}).strict(),hX=c.object({__call:c.string()}).strict(),gX=c.union([mX,fX,hX]),yX=c.union([c.string(),c.number(),c.boolean(),gX]),$s=c.record(c.string().regex(fe.ENV_VAR_NAME,E.ENV_VAR_NAME),yX),vX=c.object({id:c.string(),name:c.string().optional(),arn:c.string().optional(),field:c.string().optional()}).strict().refine(e=>e.name!==void 0!=(e.arn!==void 0),{message:"secretsImport requires exactly one of `name` or `arn`."}),f1=c.record(c.string(),vX),xge=c.record(c.string(),c.unknown()),U_=c.enum(Ju).describe(`Application type must be one of: ${Ju.join(", ")}`),z_=c.enum(vr).describe(`OpenNext deployment pattern: ${vr.join(", ")}`),bX=c.enum(["before-imports","after-imports","after-app-init","after-tags","after-resource","end-of-file"]),SX=c.enum(["import","app-init","tags","database","compute","storage","network","messaging","cdn","pattern","vpc-peer","vpc-peer-accepter","cross-plan-connection","custom"]),h1=c.object({sourceText:c.string(),position:bX,afterManagedResource:c.object({type:SX,name:c.string().optional()}).strict().optional(),originalLine:c.number().int().optional(),leadingComments:c.array(c.string()).optional(),orphaned:c.boolean().optional(),orphanedComment:c.string().optional()}).strict(),g1=c.union([c.object({tier:c.enum(Kr)}).strict(),c.literal(!1)]),y1=c.union([c.object({instanceType:c.string().optional()}).strict(),c.literal(!1)]),EX=Qf(E.MAX_LENGTH.ORGANISATION_NAME),xX=c.string().regex(fe.EMAIL,E.EMAIL),d1=c.string().refine(e=>Gn.includes(e),{message:E.REGION}),Age=c.object({name:EX,email:xX,accountName:c.string().optional(),primaryRegion:d1.optional().default(cs),secondaryRegions:c.array(d1).optional(),security:c.enum(t1).optional(),force:c.boolean().optional()}).strict();function nl(e){return e.issues.map(t=>`${t.path.length>0?`${t.path.join(".")}: `:""}${t.message}`).join(`
|
|
355
|
-
`)}tl(nl,"getZodErrorMessage");var eh=c.number().min(1,E.ALARM.PERCENTAGE.MIN).max(100,E.ALARM.PERCENTAGE.MAX),B_=c.union([eh,c.literal(!1)]),AX=c.union([c.number().min(1,E.ALARM.RESPONSE_TIME_MS.MIN),c.literal(!1)]),_X=c.number().min(1,E.ALARM.FREE_STORAGE_GIB.MIN),v1=c.union([c.literal(!1),c.object({cpuThreshold:B_.optional(),memoryThreshold:B_.optional(),runningTasksMinimum:c.number().int().min(0).optional(),http5xxThreshold:B_.optional(),p99ResponseTimeThresholdMs:AX.optional()}).strict()]),b1=c.union([c.literal(!1),c.object({cpuThreshold:eh.optional(),freeStorageThresholdGiB:_X.optional(),connectionsThreshold:c.number().int().min(1).optional()}).strict()]),S1=c.union([c.literal(!1),c.object({errorRateThreshold:eh.optional(),durationThresholdPercent:eh.optional()}).strict()]);var La=c.number().int(E.BACKUP_RETENTION.INTEGER).min(1,E.BACKUP_RETENTION.MIN).max(35,E.BACKUP_RETENTION.MAX),E1=c.number().int(E.CLICKHOUSE_STORAGE.INTEGER).min(100,E.CLICKHOUSE_STORAGE.MIN).max(16384,E.CLICKHOUSE_STORAGE.MAX),x1=c.number().int(E.CLICKHOUSE_IOPS.INTEGER).min(3e3,E.CLICKHOUSE_IOPS.MIN).max(8e4,E.CLICKHOUSE_IOPS.MAX),A1=c.number().int(E.CLICKHOUSE_THROUGHPUT.INTEGER).min(125,E.CLICKHOUSE_THROUGHPUT.MIN).max(2e3,E.CLICKHOUSE_THROUGHPUT.MAX),TX=c.enum(q$),_1=c.number().int(E.CLICKHOUSE_BACKUP_RETENTION.INTEGER).min(1,E.CLICKHOUSE_BACKUP_RETENTION.MIN).max(3650,E.CLICKHOUSE_BACKUP_RETENTION.MAX),il=c.number().int(E.MONITORING_INTERVAL.INTEGER).refine(e=>Ut(r1,e),{message:E.MONITORING_INTERVAL.VALUES}),rh=c.number().int(E.DATABASE.PORT.INTEGER).min(1024,E.DATABASE.PORT.MIN).max(65535,E.DATABASE.PORT.MAX),CX=c.enum(Bf).describe(`Database type must be one of: ${Bf.join(", ")}`),IX=c.object({maxConnections:c.number().int(E.MAX_CONNECTIONS.INTEGER).min(1,E.MAX_CONNECTIONS.MIN).max(100,E.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:c.number().int(E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:c.number().int(E.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,E.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,E.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:c.boolean().optional()}).strict().describe("RDS Proxy configuration"),DX=c.object({instanceType:c.string().optional(),availabilityZone:c.string().optional()}).strict().describe("Read replica configuration"),wX=c.object({automaticallyAfterDays:c.number().int(E.ROTATION.INTEGER).min(1,E.ROTATION.MIN).max(365,E.ROTATION.MAX).optional()}).strict().describe("Secret rotation configuration"),nh=c.object({username:c.string().min(1,E.REQUIRED.USERNAME).max(63,E.USERNAME.MAX_LENGTH).optional(),secretRotation:wX.optional()}).strict().describe("Database credentials configuration"),ih=zt(IX),ah=zt(DX),kX=c.object({scaleWithWriter:c.boolean().optional(),enableDatabaseInsights:c.boolean().optional(),identifierSuffix:c.string().min(1,E.IDENTIFIER_SUFFIX.REQUIRED).max(50,E.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:c.string().optional()}).strict().describe("Configuration for a single Aurora reader instance"),al=c.object({enableDatabaseInsights:c.boolean().optional(),identifierSuffix:c.string().min(1,E.IDENTIFIER_SUFFIX.REQUIRED).max(50,E.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:c.string().optional()}).strict().describe("Configuration for Aurora writer instance"),NX=c.object({count:c.number().int(E.READER.COUNT.INTEGER).min(0,E.READER.COUNT.MIN).max(15,E.READER.COUNT.MAX).optional(),instances:c.array(kX).max(15,E.READER_INSTANCES.MAX).optional(),defaultEnableDatabaseInsights:c.boolean().optional()}).strict().refine(e=>!(e.count!==void 0&&e.instances!==void 0),{message:E.READER_INSTANCES.COUNT_OR_INSTANCES,path:["count"]}).describe("Aurora readers configuration"),ol=zt(NX),PX=c.object({awsManaged:c.literal(!0)}).strict(),RX=c.object({useCMK:c.literal(!0)}).strict(),T1=c.union([PX,RX]),OX=c.object({mode:c.enum(["standard","advanced"]).optional(),encryptionKey:T1.optional()}).strict().describe("Database Insights configuration"),oh=zt(OX),sh=c.object({storageKey:T1.optional()}).strict().describe("Encryption configuration (DESTRUCTIVE to change storageKey)"),sl=c.object({name:be,type:CX,databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME),instanceType:c.string().optional(),allocatedStorage:c.number().optional(),multiAz:c.boolean().optional(),publiclyAccessible:c.boolean().optional(),databaseInsights:oh.optional(),port:rh.optional(),deletionProtection:c.boolean().optional(),proxy:ih.optional(),credentials:nh.optional(),readReplica:ah.optional(),encryption:sh.optional(),writer:al.optional(),readers:ol.optional(),backupRetention:La.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:il.optional(),primaryRegion:c.string().optional(),secondaryRegions:c.array(c.string()).optional(),globalClusterIdentifier:c.string().optional(),enableGlobalWriteForwarding:c.boolean().optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional(),databaseEngine:c.enum(Ps).optional(),engineExpression:c.string().optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional(),alarms:b1.optional()}).strict(),ch=c.object({appName:ut,nameProvidedByFlag:c.boolean().optional(),databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME),resourceName:be.optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional(),databaseInsights:oh.optional(),port:rh.optional(),proxy:ih.optional(),credentials:nh.optional(),encryption:sh.optional(),deletionProtection:c.boolean().optional()}).strict(),C1={databaseType:c.literal("Instance"),instanceType:c.string().optional(),multiAz:c.boolean().optional(),readReplica:ah.optional(),publiclyAccessible:c.boolean().optional(),backupRetention:La.optional(),allocatedStorage:c.number().optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},I1={databaseType:c.literal("Aurora"),writer:al.optional(),readers:ol.optional(),backupRetention:La.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:il.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},D1={databaseType:c.literal("GlobalAurora"),primaryRegion:c.string().min(1,E.GLOBAL_AURORA.PRIMARY_REGION_REQUIRED),secondaryRegions:c.array(c.string()).optional(),globalClusterIdentifier:c.string().optional(),enableGlobalWriteForwarding:c.boolean().optional(),writer:al.optional(),readers:ol.optional(),backupRetention:La.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:il.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},w1=c.object({appName:ut,nameProvidedByFlag:c.boolean().optional(),databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME),resourceName:be.optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional()}).strict(),k1={databaseType:c.literal("ClickHouse"),instanceType:TX.optional(),storageGb:E1.optional(),iops:x1.optional(),throughputMbps:A1.optional(),coldTier:c.union([c.object({mode:c.literal("s3")}).strict(),c.literal(!1)]).optional(),optimiseSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupVerify:c.literal(!1).optional(),backupRetentionDays:_1.optional()},$X=ch.extend(C1).strict(),jX=ch.extend(I1).strict(),MX=ch.extend(D1).strict(),FX=w1.extend(k1).strict(),Oge=c.discriminatedUnion("databaseType",[$X,jX,MX,FX]),V_=ch.extend({resourceName:be}).strict(),LX=V_.extend(C1).strict(),UX=V_.extend(I1).strict(),zX=V_.extend(D1).strict(),BX=w1.extend({resourceName:be}).strict(),VX=BX.extend(k1).strict(),$ge=c.discriminatedUnion("databaseType",[LX,UX,zX,VX]),jge=c.object({appName:ut,databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME),maxConnections:c.number().int(E.MAX_CONNECTIONS.INTEGER).min(1,E.MAX_CONNECTIONS.MIN).max(100,E.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:c.number().int(E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:c.number().int(E.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,E.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,E.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:c.boolean().optional(),nameProvidedByFlag:c.boolean().optional()}).strict(),GX=["S","N","B"],th=c.object({name:c.string(),type:c.enum(GX)}).strict(),N1=c.object({name:be,partitionKey:th,sortKey:th.optional(),globalSecondaryIndexes:c.array(c.object({indexName:c.string(),partitionKey:th,sortKey:th.optional()}).strict()).optional(),ttlAttribute:c.string().optional(),stream:c.boolean().optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict(),WX=c.object({mode:c.literal("s3")}).strict(),P1=c.object({name:be,type:c.literal("ClickHouse"),databaseName:m1,instanceType:c.string().optional(),storageGb:E1.optional(),iops:x1.optional(),throughputMbps:A1.optional(),coldTier:c.union([WX,c.literal(!1)]).optional(),optimiseSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupVerify:c.literal(!1).optional(),backupRetentionDays:_1.optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict();var KX=c.object({count:c.number().int(E.NAT_GATEWAY.INTEGER).min(0,E.NAT_GATEWAY.MIN).max(3,E.NAT_GATEWAY.MAX).optional()}).strict().describe("NAT gateway configuration"),R1=zt(KX),G_=c.enum(["cloudwatch","s3"]),ZX=c.object({destination:G_.optional(),retentionDays:c.number().int(E.RETENTION_DAYS.INTEGER).min(1,E.RETENTION_DAYS.MIN).max(365,E.RETENTION_DAYS.MAX).optional(),trafficType:c.enum(["ALL","ACCEPT","REJECT"]).optional()}).strict().describe("VPC flow log configuration"),O1=zt(ZX),qX=c.object({s3:c.boolean().optional(),dynamodb:c.boolean().optional()}).strict().describe("Gateway VPC endpoints (FREE)"),HX=zt(qX),JX=c.object({ecr:c.boolean().optional(),secretsManager:c.boolean().optional(),kms:c.boolean().optional(),cloudwatchLogs:c.boolean().optional(),ssm:c.boolean().optional(),sts:c.boolean().optional()}).strict().describe("Interface VPC endpoints (cost per hour)"),XX=zt(JX),YX=c.object({gateway:HX.optional(),interface:XX.optional()}).strict().describe("VPC endpoints configuration"),$1=zt(YX),Ua=c.object({maxAzs:c.number().int(E.MAX_AZS.INTEGER).min(1,E.MAX_AZS.MIN).max(3,E.MAX_AZS.MAX).optional(),natGateways:R1.optional(),flowLogs:O1.optional(),vpcEndpoints:$1.optional(),cidrMask:c.number().int(E.CIDR_MASK.INTEGER).min(16,E.CIDR_MASK.MIN).max(28,E.CIDR_MASK.MAX).optional()}).strict(),j1=c.string().min(1,E.REQUIRED.NETWORK_NAME).max(50,E.MAX_LENGTH.NETWORK_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),M1=Ua.extend({name:j1}).strict(),F1=zt(Ua),zge=c.object({appName:ut,networkName:j1.optional(),maxAzs:c.number().int(E.MAX_AZS.INTEGER).min(1,E.MAX_AZS.MIN).max(3,E.MAX_AZS.MAX).optional(),natGateways:R1.optional(),flowLogs:O1.optional(),vpcEndpoints:$1.optional()}).strict(),QX=fe.CIDR,W_=c.string().regex(QX,E.CIDR),e9=c.object({kind:c.literal("database"),resource:c.string().min(1,E.REQUIRED.RESOURCE_REFERENCE),name:be,allowedFromCidrs:c.array(W_),access:c.enum(["read","write","readWrite"]).optional()}).strict(),t9=c.object({kind:c.literal("ecsService"),resource:c.string().min(1,E.REQUIRED.RESOURCE_REFERENCE),serviceName:c.string().min(1,E.REQUIRED.SERVICE_NAME),name:be,allowedFromCidrs:c.array(W_),port:Fa.optional()}).strict(),r9=c.discriminatedUnion("kind",[e9,t9]),L1=c.object({name:be,peerAppName:c.string().min(1,E.REQUIRED.APP_NAME),peerAccountId:c.string().regex(fe.AWS_ACCOUNT_ID,E.AWS_ACCOUNT_ID),peerRegion:c.string().min(1,E.VPC_PEER.REGION_REQUIRED).optional(),peerVpcId:c.string().regex(fe.VPC_ID,E.VPC_ID).optional(),peerVpcCidr:W_.optional(),peerRoleArn:c.string().regex(fe.ROLE_ARN,E.ROLE_ARN).optional(),peerRouteTableIds:c.array(c.string().min(1,E.VPC_PEER.ROUTE_TABLE_ID_REQUIRED)).optional(),localVpcName:c.string().min(1,E.REQUIRED.NETWORK_NAME).optional(),enableDnsResolution:c.boolean().optional()}).strict(),K_=c.object({name:be,requesterAccountIds:c.array(c.string().regex(fe.AWS_ACCOUNT_ID,E.AWS_ACCOUNT_ID)).min(1,E.VPC_PEER.MIN_REQUESTER_ACCOUNTS),localVpcName:c.string().min(1,E.REQUIRED.NETWORK_NAME).optional(),publishToSsm:c.boolean().optional(),exposedResources:c.array(r9).optional()}).strict();var uh=["storage","cdn","compute"],n9=c.object({sid:c.string().optional(),effect:c.enum(["Allow","Deny"]),principals:c.array(c.string()),actions:c.array(c.string()),resources:c.array(c.string()).optional(),conditions:c.record(c.string(),c.record(c.string(),c.union([c.string(),c.array(c.string())]))).optional()}).strict(),cl=c.object({name:be,bucketName:c.string().optional(),publicReadAccess:c.boolean().optional(),websiteHosting:c.object({indexDocument:c.string(),errorDocument:c.string().optional()}).strict().optional(),backupVaultTier:c.enum(Kr).optional(),versioned:c.boolean().optional(),encryption:c.enum(Os).optional(),kmsKeyArn:c.string().optional(),cors:c.array(c.object({allowedOrigins:c.array(c.string()),allowedMethods:c.array(c.string()),allowedHeaders:c.array(c.string()).optional(),exposedHeaders:c.array(c.string()).optional(),maxAge:c.number().optional()}).strict()).optional(),deployment:c.object({source:c.string(),prune:c.boolean().optional(),cacheControl:c.object({maxAge:c.number().optional(),immutable:c.boolean().optional()}).strict().optional()}).strict().optional(),retain:c.boolean().optional(),resourcePolicyStatements:c.array(n9).optional(),stackPlacement:c.enum(uh).optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict().refine(e=>e.encryption!=="KMS"||!!e.kmsKeyArn,{message:E.KMS.KEY_REQUIRED}),Zge=c.object({appName:ut,bucketName:p1,nameProvidedByFlag:c.boolean().optional(),storagePreset:c.enum(l1).optional(),publicReadAccess:c.boolean().optional(),websiteHosting:c.object({indexDocument:c.string(),errorDocument:c.string().optional()}).strict().optional(),backupVaultTier:c.enum(Kr).optional(),versioned:c.boolean().optional(),encryption:c.enum(Os).optional(),kmsKeyArn:c.string().optional(),cors:c.array(c.object({allowedOrigins:c.array(c.string()),allowedMethods:c.array(c.string()),allowedHeaders:c.array(c.string()).optional(),exposedHeaders:c.array(c.string()).optional(),maxAge:c.number().optional()}).strict()).optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional()}).strict().refine(e=>e.encryption!=="KMS"||!!e.kmsKeyArn,{message:E.KMS.KEY_REQUIRED,path:["kmsKeyArn"]});var Z_=c.enum(["DESTROY","RETAIN"]),ul=c.object({name:be,queueType:c.enum(["standard","fifo"]).default("standard"),visibilityTimeout:c.number().int(E.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,E.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,E.SQS.VISIBILITY_TIMEOUT.MAX).optional(),retentionPeriod:c.number().int(E.SQS.RETENTION_PERIOD.INTEGER).min(60,E.SQS.RETENTION_PERIOD.MIN).max(1209600,E.SQS.RETENTION_PERIOD.MAX).optional(),contentBasedDeduplication:c.boolean().optional(),removalPolicy:Z_.optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict();var U1=c.object({type:c.literal("basic-auth"),username:c.string().min(1),password:c.string().min(1)}).strict(),ll=c.object({name:be,defaultOriginRef:c.string(),behaviours:c.array(c.object({pathPattern:c.string(),originRef:c.string(),cachePolicy:c.enum(["CACHING_OPTIMIZED","CACHING_DISABLED"]).optional()}).strict()).optional(),customDomain:c.string().optional(),certificateArn:c.string().optional(),domain:c.string().optional(),originHostname:c.string().optional(),accessGate:c.union([c.literal(!1),U1]).optional(),extraProperties:c.array(St).optional()}).strict(),z1=c.object({appName:c.string(),name:be.optional(),defaultOriginRef:c.string(),behaviours:c.array(c.object({pathPattern:c.string(),originRef:c.string(),cachePolicy:c.enum(["CACHING_OPTIMIZED","CACHING_DISABLED"]).optional()}).strict()).optional(),customDomain:c.string().optional(),certificateArn:c.string().optional(),domain:c.string().optional(),originHostname:c.string().optional(),accessGate:c.union([c.literal(!1),U1]).optional(),nameProvidedByFlag:c.boolean().optional()}).strict();var i9=Object.defineProperty,q_=(e,t)=>i9(e,"name",{value:t,configurable:!0}),a9=new Set(["t4g","c6g","c6gd","c6gn","c7g","c7gd","c7gn","r6g","r6gd","r7g","r7gd","r8g","r8gd","c8g","c8gd","c8gn","m6g","m6gd","m7g","m7gd","m8g","m8gd","x8g","i8g","a1","x2gd","im4gn","is4gen","i4g","hpc7g"]);function Li(e){let t=e.split(".")[0]??"";return a9.has(t)?"ARM":"STANDARD"}q_(Li,"getArchitectureForInstanceType");function lh(e,t){let r=Li(e);return r!==t?{valid:!1,message:`Instance type '${e}' requires ${r} architecture, but '${t}' AMI was specified. Use a ${r==="ARM"?"Graviton instance (t4g, c6g, r6g, m6g, etc.)":"Intel/AMD instance (t3, c5, r5, m5, etc.)"} instead.`}:{valid:!0}}q_(lh,"validateArchitectureMatch");function B1(e,t){return Li(e)===t}q_(B1,"isArchitectureCompatible");var o9=Object.defineProperty,dh=(e,t)=>o9(e,"name",{value:t,configurable:!0});var s9=1;var c9=/^[A-Za-z0-9_.-]+$/,u9=c.object({id:c.string().min(1,"buildSecret id cannot be empty").regex(c9,"buildSecret id may contain only letters, digits, '_', '.', and '-' (no comma, '=', or whitespace, which would break the buildx --secret argv)"),ssm:c.string().min(1,"ssm parameter name cannot be empty").optional(),secretsManager:c.object({name:c.string().min(1,"secret name cannot be empty").optional(),arn:c.string().min(1,"secret arn cannot be empty").optional(),field:c.string().min(1,"secret field cannot be empty").optional()}).strict().refine(e=>e.name===void 0!=(e.arn===void 0),"secretsManager requires exactly one of name or arn").optional(),env:c.string().min(1,"env variable name cannot be empty").optional()}).strict().superRefine((e,t)=>{[e.ssm,e.secretsManager,e.env].filter(r=>r!==void 0).length!==1&&t.addIssue({code:c.ZodIssueCode.custom,message:"buildSecret requires exactly one source (ssm, secretsManager, or env)"})}),l9=c.union([c.string(),c.object({ssm:c.string().min(1,"ssm parameter name cannot be empty").optional(),secretsManager:c.object({name:c.string().min(1,"secret name cannot be empty").optional(),arn:c.string().min(1,"secret arn cannot be empty").optional(),field:c.string().min(1,"secret field cannot be empty").optional()}).strict().refine(e=>e.name===void 0!=(e.arn===void 0),"secretsManager requires exactly one of name or arn").optional(),env:c.string().min(1,"env variable name cannot be empty").optional(),acknowledgePublic:c.boolean().optional()}).strict().superRefine((e,t)=>{[e.ssm,e.secretsManager,e.env].filter(r=>r!==void 0).length!==1&&t.addIssue({code:c.ZodIssueCode.custom,message:"buildArg value requires exactly one source (ssm, secretsManager, or env)"})})]),pn=c.object({path:c.string(),context:c.string().min(1,"context cannot be empty").optional(),target:c.string().min(1,"target cannot be empty").optional(),buildArgs:c.record(c.string(),l9).optional(),buildSecrets:c.array(u9).optional()}).strict(),aye=pn.partial();function d9(e,t){if(t===void 0)return e;let r=t.context??e.context,i=t.target??e.target,n=t.buildArgs??e.buildArgs,a=t.buildSecrets??e.buildSecrets;return{path:t.path??e.path,...r!==void 0&&{context:r},...i!==void 0&&{target:i},...n!==void 0&&{buildArgs:n},...a!==void 0&&{buildSecrets:a}}}dh(d9,"mergeDockerBuild");function H_(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}dh(H_,"isRecord");function V1(e){if(!H_(e)||typeof e.path!="string"||e.path.length===0)return;let t=typeof e.context=="string"&&e.context.length>0?e.context:void 0,r=typeof e.target=="string"&&e.target.length>0?e.target:void 0,i=H_(e.buildArgs)&&Object.keys(e.buildArgs).length>0?e.buildArgs:void 0,n=Array.isArray(e.buildSecrets)&&e.buildSecrets.length>0?e.buildSecrets:void 0,a={path:e.path,...t!==void 0&&{context:t},...r!==void 0&&{target:r},...i!==void 0&&{buildArgs:i},...n!==void 0&&{buildSecrets:n}},o=pn.safeParse(a);return o.success?o.data:void 0}dh(V1,"normaliseDockerBuild");function p9(e){if(e===void 0)return;let t=V1(e);return t===void 0?void 0:JSON.stringify(t)}dh(p9,"dockerBuildFingerprint");var m9=c.object({name:c.string(),clusterName:c.string().optional(),docker:pn.optional(),containerPort:c.number().optional(),secrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),importedSecretNames:c.array(c.string()).optional(),schemaGateImageTag:c.string().optional()}).strict(),f9=c.object({type:c.enum(vr),name:c.string(),source:c.string()}).strict(),h9=c.object({repositoryName:c.string()}).strict(),g9=["x86_64","arm64"],y9=c.object({name:c.string(),secrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),importedSecretNames:c.array(c.string()).optional(),docker:pn.optional(),imageKey:c.string().optional(),architecture:c.enum(g9).optional()}).strict(),v9=c.object({templateHash:c.string(),synthTimestamp:c.string()}).strict(),b9=c.object({constructPath:c.string().max(512),group:c.string().max(128),resourceType:c.string().max(256)}).strict(),S9=c.object({synthesisedBy:c.string().min(1).max(128),minimumEngineVersion:c.string().min(1).max(32),maximumEngineMajor:c.number().int().min(0).optional(),minimumAwsCdkCli:c.string().min(1).max(32).optional()}).strict(),E9=c.object({appName:c.string().min(1).max(128),slot:c.string().min(1).max(64),clusterName:c.string().min(1).max(128),anchor:c.string().min(1).max(128),pinned:c.boolean(),currentServiceName:c.string().min(1).max(256),legacyKey:c.string().min(1).max(256),legacyAnchor:c.string().min(1).max(256),legacyServiceName:c.string().min(1).max(512),legacyKeyFields:c.array(c.string().max(64)).max(32)}).strict(),x9=c.object({constructPath:c.string().min(1).max(512),resourceType:c.string().min(1).max(256),physicalNameHint:c.string().min(1).max(512),policy:c.enum(["retain","snapshot","adopted"]),destroyDisposition:c.enum(["survives","deleted-on-explicit-destroy"]),reason:c.string().min(1).max(1024),costClass:c.enum(["none","storage","fixed-monthly"]),cleanupHint:c.string().min(1).max(1024)}).strict(),oye=c.object({version:c.literal(s9),generatedAt:c.string(),appName:c.string(),services:c.array(m9),lambdas:c.array(y9),pattern:f9.optional(),ecr:h9.optional(),stacks:c.record(c.string(),v9),resourceMap:c.record(c.string(),b9).optional(),engineCompat:S9.optional(),identityAliases:c.array(E9).optional(),residuals:c.array(x9).optional()}).strict();var A9=Object.defineProperty,_9=(e,t)=>A9(e,"name",{value:t,configurable:!0});function W1(e){return!(e.image!==void 0&&e.docker!==void 0)}_9(W1,"imageDockerMutexCheck");var K1=c.number().int(E.CAPACITY.MIN.INTEGER).min(F_,E.GENERATOR_CAPACITY.MIN.MIN).max(L_,E.GENERATOR_CAPACITY.MIN.MAX),Z1=c.number().int(E.CAPACITY.MAX.INTEGER).min(F_,E.GENERATOR_CAPACITY.MAX.MIN).max(L_,E.GENERATOR_CAPACITY.MAX.MAX),js=c.number().int(E.LAMBDA.MEMORY.INTEGER).min(a1,E.LAMBDA.MEMORY.MIN).max(o1,E.LAMBDA.MEMORY.MAX).refine(e=>e===128||e%64===0,E.LAMBDA.MEMORY.MULTIPLE),q1=c.string().regex(fe.LAMBDA_RUNTIME_IDENTIFIER,E.LAMBDA.RUNTIME),J_=c.number().int(E.CPU.INTEGER).min(256,E.CPU.MIN).max(4096,E.CPU.MAX),mh=c.number().int(E.CAPACITY.DESIRED.INTEGER).min(0,E.CAPACITY.DESIRED.MIN).max(Rs,E.CAPACITY.DESIRED.MAX),dl=c.object({connectToDatabase:c.array(c.string()).optional()}).strict(),T9=c.object({minSize:c.number().int(E.CAPACITY.WARM_POOL.MIN_SIZE.INTEGER).min(0,E.CAPACITY.WARM_POOL.MIN_SIZE.MIN).max(s1,E.CAPACITY.WARM_POOL.MIN_SIZE.MAX).optional(),reuseOnScaleIn:c.boolean().optional()}).strict(),X_=c.object({instanceType:c.string().optional(),amiHardwareType:c.enum(Hf).optional(),minCapacity:c.number().int(E.CAPACITY.MIN.INTEGER).min(0,E.CAPACITY.MIN.MIN_0).max(Rs,E.CAPACITY.MIN.MAX).optional(),maxCapacity:c.number().int(E.CAPACITY.MAX.INTEGER).min(1,E.CAPACITY.MAX.MIN_1).max(Rs,E.CAPACITY.MAX.MAX).optional(),memoryLimitMiB:rl(128).optional(),warmPool:T9.optional(),extraProperties:c.array(St).optional()}).strict().superRefine((e,t)=>{if(!e.instanceType||!e.amiHardwareType)return;let r=lh(e.instanceType,e.amiHardwareType);r.valid||t.addIssue({code:"custom",message:r.message??E.ARCHITECTURE_MISMATCH,path:["instanceType"]})}).superRefine((e,t)=>{e.minCapacity===0&&!e.warmPool&&t.addIssue({code:"custom",message:E.CAPACITY.WARM_POOL_REQUIRED,path:["minCapacity"]}),e.warmPool?.minSize!==void 0&&e.maxCapacity!==void 0&&e.warmPool.minSize>e.maxCapacity&&t.addIssue({code:"custom",message:E.CAPACITY.WARM_POOL.MIN_SIZE_EXCEEDS_MAX_CAPACITY,path:["warmPool","minSize"]})}),C9=c.enum(Xu).describe(`Compute type must be one of: ${Xu.join(", ")}`),Y_=c.enum(Ns).describe(`ECS capacity provider must be one of: ${Ns.join(", ")}`),Q_=c.string().refine(e=>Ut(Jf,e),{message:E.INSTANCE_TYPE}),H1=c.object({sourceType:c.enum(["sqs","dynamodb","eventbridge"]),sourceRef:c.string().describe("Name of the source resource"),batchSize:c.number().int(E.BATCH_SIZE.INTEGER).min(1,E.BATCH_SIZE.MIN).max(1e4,E.BATCH_SIZE.MAX).optional(),startingPosition:c.enum(["TRIM_HORIZON","LATEST"]).optional(),maxBatchingWindow:c.number().int(E.BATCHING_WINDOW.INTEGER).min(0,E.BATCHING_WINDOW.MIN).max(300,E.BATCHING_WINDOW.MAX).optional(),reportBatchItemFailures:c.boolean().optional()}).strict(),I9=c.object({name:c.string().min(1,E.REQUIRED.CONTAINER_NAME).optional(),image:c.string().optional(),port:Fa.optional(),environment:$s.optional(),secretsImport:f1.optional(),command:c.array(c.string()).optional(),entryPoint:c.array(c.string()).optional(),essential:c.boolean().optional(),healthCheck:c.object({command:c.array(c.string()),interval:c.number().int(E.HEALTH_CHECK.INTERVAL.INTEGER).min(5,E.HEALTH_CHECK.INTERVAL.MIN).max(300,E.HEALTH_CHECK.INTERVAL.MAX).optional(),timeout:c.number().int(E.HEALTH_CHECK.TIMEOUT.INTEGER).min(2,E.HEALTH_CHECK.TIMEOUT.MIN).max(60,E.HEALTH_CHECK.TIMEOUT.MAX).optional(),retries:c.number().int(E.HEALTH_CHECK.RETRIES.INTEGER).min(1,E.HEALTH_CHECK.RETRIES.MIN).max(10,E.HEALTH_CHECK.RETRIES.MAX).optional(),startPeriod:c.number().int(E.HEALTH_CHECK.START_PERIOD.INTEGER).min(0,E.HEALTH_CHECK.START_PERIOD.MIN).max(300,E.HEALTH_CHECK.START_PERIOD.MAX).optional()}).strict().optional(),ssmSecrets:c.array(c.string().regex(fe.SECRET_NAME,E.SECRET_NAME)).optional(),extraProperties:c.array(St).optional()}).strict(),J1=c.string().min(1,E.REQUIRED.SERVICE_NAME).max(255,E.MAX_LENGTH.SERVICE_NAME).regex(fe.ECS_SERVICE_NAME,E.ECS_SERVICE_NAME),X1=c.object({domain:c.string().optional(),loadBalancer:c.union([c.literal(!1),c.enum(Zf)]).optional(),directAccess:c.boolean().optional(),extraProperties:c.array(St).optional()}).strict().refine(e=>!(e.directAccess&&e.domain),{message:E.DIRECT_ACCESS.NO_DOMAIN,path:["directAccess"]}).refine(e=>!(e.directAccess&&typeof e.loadBalancer=="string"),{message:E.DIRECT_ACCESS.NO_LOAD_BALANCER}).describe("Cluster-level configuration"),ph=c.object({path:c.string().optional(),host:c.string().optional(),priority:c.number().int(E.PRIORITY.INTEGER).min(1,E.PRIORITY.MIN).max(5e4,E.PRIORITY.MAX).optional(),healthCheckPath:c.string().optional()}).strict().describe("Path/host-based routing configuration"),D9=c.object({desiredCount:mh.optional(),minCapacity:c.number().int(E.CAPACITY.MIN.INTEGER).min(0,E.CAPACITY.MIN.MIN_0).max(Rs,E.CAPACITY.MIN.MAX).optional(),maxCapacity:c.number().int(E.CAPACITY.MAX.INTEGER).min(1,E.CAPACITY.MAX.MIN_1).max(Rs,E.CAPACITY.MAX.MAX).optional(),scalingType:c.enum(qf).optional()}).strict().refine(Ma.check,Ma.params).describe("ECS service scaling configuration"),Y1=c.object({name:J1,docker:pn.optional(),needsDatabaseConnection:c.boolean().optional(),needsStorageConnection:c.boolean().optional(),needsMessagingConnection:c.boolean().optional(),image:c.string().optional(),containers:c.array(I9).optional(),routing:c.union([ph,c.array(ph).min(1)]).optional(),serviceType:c.enum(el).optional(),cpu:J_.optional(),memoryLimitMiB:rl(512).optional(),desiredCount:mh.optional(),scaling:zt(D9).optional(),capacityProvider:Y_,ec2Config:X_.optional(),ssmSecretsPath:c.string().regex(fe.SSM_PATH,E.SSM_PATH).optional(),extraProperties:c.array(St).optional(),alarms:v1.optional()}).strict().superRefine((e,t)=>{W1(e)||t.addIssue({code:"custom",path:["docker"],message:E.IMAGE_DOCKER_MUTEX})}).describe("Configuration for a service in an ECS cluster"),pl=c.object({name:be,type:C9,needsConnection:c.boolean(),connectedDatabase:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),connectedStorage:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),connectedMessaging:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),cluster:X1.optional(),services:c.array(Y1).optional(),docker:pn.partial().optional(),deployment:c.enum(Gf).optional(),codePath:c.string().optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(Xf,E.LAMBDA.TIMEOUT.MIN).max(Yf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:js.optional(),handler:c.string().optional(),runtime:q1.optional(),environment:$s.optional(),secrets:$s.optional(),eventSources:c.array(H1).optional(),functionUrl:c.object({authType:c.enum(Qu)}).strict().optional(),description:c.string().optional(),scheduleExpression:c.string().optional(),scheduleStackPlacement:c.enum(ja).optional(),architecture:c.enum(Kf).optional(),ephemeralStorageSize:c.number().int(E.EPHEMERAL_STORAGE.INTEGER).min(512,E.EPHEMERAL_STORAGE.MIN).max(10240,E.EPHEMERAL_STORAGE.MAX).optional(),functionName:c.string().optional(),ssmSecrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),alarms:S1.optional(),instanceType:Q_.optional(),enableSSH:c.boolean().optional(),keyName:c.string().optional(),userData:c.string().optional(),securityGroups:c.array(c.string()).optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict().superRefine((e,t)=>{if(e.type==="ecs"&&e.services)for(let r=0;r<e.services.length;r++){let i=e.services[r];i?.ec2Config?.instanceType&&!i.ec2Config.amiHardwareType&&Li(i.ec2Config.instanceType)!=="ARM"&&t.addIssue({code:"custom",message:`Service '${i.name??r}' uses instance type '${i.ec2Config.instanceType}' (x86), which requires Docker images built for linux/amd64. The default build targets linux/arm64 (Graviton). Use a Graviton instance type (t4g, c6g, r6g, m6g, etc.) or set amiHardwareType: "STANDARD" to acknowledge x86.`,path:["services",r,"ec2Config","instanceType"]})}e.type==="lambda"&&e.deployment==="container"&&e.architecture==="X86_64"&&t.addIssue({code:"custom",message:"Lambda architecture 'X86_64' requires Docker images built for linux/amd64, but the default build targets linux/arm64. Use 'ARM_64' for Graviton Lambdas (recommended) or ensure your build pipeline targets linux/amd64.",path:["architecture"]})}),hye=c.object({appName:ut,clusterName:be,containerPort:Fa,nameProvidedByFlag:c.boolean().optional(),ecrRepository:c.string().optional(),capacityProvider:Y_.optional(),useAppEcr:c.boolean().optional(),desiredCount:mh.optional(),cpu:J_.optional(),memoryLimitMiB:rl(512).optional(),minCapacity:K1.optional(),maxCapacity:Z1.optional(),ec2Config:X_.optional(),connectionConfig:dl.optional()}).strict().refine(Ma.check,Ma.params),gye=c.object({appName:ut,functionName:be,nameProvidedByFlag:c.boolean().optional(),lambdaType:c.enum(["basic","web","custom"]).optional(),ecrRepository:c.string().optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(Xf,E.LAMBDA.TIMEOUT.MIN).max(Yf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:js.optional(),enableFunctionUrl:c.boolean().optional(),description:c.string().optional(),enableCors:c.boolean().optional(),corsOrigins:c.string().optional(),corsHeaders:c.string().optional(),corsMethods:c.array(c.enum(u1)).optional(),corsCredentials:c.boolean().optional(),connectionConfig:dl.optional()}).strict(),yye=c.object({appName:ut,instanceName:be,nameProvidedByFlag:c.boolean().optional(),instanceType:Q_.optional(),enableSSH:c.boolean().optional(),minCapacity:K1.optional(),maxCapacity:Z1.optional(),connectionConfig:dl.optional()}).strict().refine(Ma.check,Ma.params),vye=c.object({appName:ut,clusterName:be,serviceName:J1,capacityProvider:Y_,containerPort:Fa.optional(),cpu:J_.optional(),memoryLimitMiB:rl(512).optional(),desiredCount:mh.optional(),ec2Config:X_.optional(),routing:c.union([ph,c.array(ph).min(1)]).optional(),docker:pn.partial().optional(),nameProvidedByFlag:c.boolean().optional(),connectionConfig:dl.optional()}).strict(),e0=c.object({appName:ut,computeName:be,nameProvidedByFlag:c.boolean().optional(),connectionConfig:dl.optional()}).strict(),w9=e0.extend({type:c.literal("ecs"),cluster:X1.optional(),services:c.array(Y1).min(1,E.SERVICE.MIN_REQUIRED),docker:pn.partial().optional()}).strict().refine(e=>{let t=e.services.filter(r=>r.containers?.some(i=>i.port));return t.length>1?t.every(r=>(Array.isArray(r.routing)?r.routing:r.routing?[r.routing]:[]).some(i=>i.path||i.host)):!0},{message:E.SERVICE.ROUTING_REQUIRED}).refine(e=>{let t=e.services.map(r=>r.name);return new Set(t).size===t.length},{message:E.SERVICE.UNIQUE_WITHIN_CLUSTER}),k9=e0.extend({type:c.literal("lambda"),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(Xf,E.LAMBDA.TIMEOUT.MIN).max(Yf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:js.optional(),handler:c.string().optional(),runtime:q1.optional(),environment:$s.optional(),secrets:$s.optional(),description:c.string().optional(),functionUrl:c.union([c.object({authType:c.enum(Qu).optional()}).strict(),c.literal(!1)]).optional(),eventSources:c.array(H1).optional()}).strict(),N9=e0.extend({type:c.literal("ec2"),instanceType:Q_.optional(),enableSSH:c.boolean().optional(),keyName:c.string().optional(),userData:c.string().optional(),securityGroups:c.array(c.string()).optional()}).strict(),bye=c.discriminatedUnion("type",[w9,k9,N9]),G1=c.object({path:c.string().min(1,E.REQUIRED.ROUTING_PATH),priority:c.number().int(E.PRIORITY.INTEGER).min(1,E.PRIORITY.MIN).max(5e4,E.PRIORITY.MAX).optional()}).strict(),Q1=c.object({name:c.string().min(1,E.REQUIRED.SERVICE_NAME).max(255,E.MAX_LENGTH.SERVICE_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),serviceType:c.enum(el).optional(),docker:pn.partial().optional(),containerPort:Fa.optional(),needsDatabaseConnection:c.boolean().optional(),routing:c.union([G1,c.array(G1).min(1)]).optional()}).strict().superRefine((e,t)=>{e.serviceType==="worker"&&(e.containerPort!==void 0&&t.addIssue({code:"custom",path:["containerPort"],message:"Worker services are not reachable inbound; remove containerPort."}),e.routing!==void 0&&t.addIssue({code:"custom",path:["routing"],message:"Worker services have no ALB route; remove routing."}))}),Sye=c.object({appName:ut,instanceType:c.string().optional()}).strict();var t0=c.object({memorySize:js.optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(1,E.LAMBDA.TIMEOUT.MIN).max(900,E.LAMBDA.TIMEOUT.MAX).optional(),ephemeralStorageSize:c.number().int(E.EPHEMERAL_STORAGE.INTEGER).min(512,E.EPHEMERAL_STORAGE.MIN).max(10240,E.EPHEMERAL_STORAGE.MAX).optional()}).strict(),ej=c.object({type:c.enum(M_).optional(),databaseName:c.string().optional(),databaseEngine:c.enum(Ps).optional(),deletionProtection:c.boolean().optional(),backupRetention:La.optional(),port:rh.optional(),publiclyAccessible:c.boolean().optional(),allowedIpCidr:c.string().optional(),instanceType:c.string().optional(),allocatedStorage:c.number().int(E.ALLOCATED_STORAGE.INTEGER).min(20,E.ALLOCATED_STORAGE.MIN).max(65536,E.ALLOCATED_STORAGE.MAX).optional(),multiAz:c.boolean().optional(),readReplica:ah.optional(),writer:al.optional(),readers:ol.optional(),allowVpcAccess:c.boolean().optional(),monitoringInterval:il.optional(),preferredMaintenanceWindow:c.string().optional(),databaseInsights:oh.optional(),proxy:ih.optional(),credentials:nh.optional(),encryption:sh.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()}).strict(),tj=c.object({server:t0.optional(),imageOptimisation:t0.optional(),revalidation:t0.optional()}).strict(),r0=c.object({versioned:c.boolean().optional()}).strict(),rj=c.object({assets:r0.optional(),cache:r0.optional(),media:r0.optional()}).strict(),P9=c.object({visibilityTimeout:c.number().int(E.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,E.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,E.SQS.VISIBILITY_TIMEOUT.MAX).optional(),messageRetentionPeriod:c.number().int(E.SQS.RETENTION_PERIOD.INTEGER).min(60,E.SQS.RETENTION_PERIOD.MIN).max(1209600,E.SQS.RETENTION_PERIOD.MAX).optional(),maxMessageSize:c.number().int(E.MAX_MESSAGE_SIZE.INTEGER).min(1024,E.MAX_MESSAGE_SIZE.MIN).max(262144,E.MAX_MESSAGE_SIZE.MAX).optional(),deadLetterQueue:c.union([c.literal(!1),c.object({enabled:c.boolean().optional(),maxReceiveCount:c.number().int(E.DLQ.MAX_RECEIVE_COUNT.INTEGER).min(1,E.DLQ.MAX_RECEIVE_COUNT.MIN).max(1e3,E.DLQ.MAX_RECEIVE_COUNT.MAX).optional()}).strict()]).optional()}).strict(),nj=c.object({revalidationQueue:P9.optional()}).strict(),ij=c.object({domainNames:c.array(c.string()).optional(),certificateArn:c.string().optional()}).strict(),aj=c.record(c.string().regex(fe.ENV_VAR_NAME,E.ENV_VAR_NAME),c.string()).optional(),n0=c.object({type:c.literal("payload"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),domain:c.string().optional(),database:ej.optional(),compute:tj.optional(),storage:rj.optional(),messaging:nj.optional(),cdn:ij.optional(),environment:aj}).strict(),i0=c.object({type:c.literal("nextjs"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),domain:c.string().optional(),database:ej.optional(),compute:tj.optional(),storage:rj.optional(),messaging:nj.optional(),cdn:ij.optional(),environment:aj}).strict(),a0=c.enum(Du),R9=c.object({command:c.string().min(1,E.REQUIRED.BUILD_COMMAND),outputDir:c.string().min(1,E.REQUIRED.OUTPUT_DIR)}).strict(),O9=c.object({maxAgeDays:c.number().optional(),includeSubdomains:c.boolean().optional(),preload:c.boolean().optional()}).strict(),$9=c.object({headers:c.boolean().optional(),contentSecurityPolicy:c.string().optional(),hsts:c.union([c.literal(!1),O9]).optional()}).strict(),j9=c.object({to:c.string().min(1,E.REQUIRED.FORMS_TO).regex(fe.EMAIL,E.EMAIL),from:c.string().regex(fe.EMAIL,E.EMAIL).optional(),corsOrigin:c.string().regex(fe.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),maxConcurrency:c.number().int().min(1).max(100).optional()}).strict(),M9=c.object({behaviours:c.array(c.unknown()).optional(),priceClass:c.enum(wu).optional(),invalidateOnDeploy:c.boolean().optional()}).strict(),F9=c.object({type:c.literal("basic-auth"),username:c.string().min(1,"accessGate.username must not be empty"),password:c.string().min(1,"accessGate.password must not be empty")}).strict(),ml=c.object({type:c.literal("staticsite"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),source:c.string().min(1,E.REQUIRED.SOURCE),build:R9,routing:a0.optional(),security:$9.optional(),domain:c.string().optional(),zoneName:c.string().optional(),hostedZoneId:c.string().optional(),forms:j9.optional(),cdn:M9.optional(),accessGate:F9.optional()}).strict().superRefine((e,t)=>{if(e.forms===void 0)return;let r=e.domain;if(r===void 0||r===""){t.addIssue({code:"custom",path:["domain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"});return}let i=e.forms.from;i!==void 0&&!uf(i,r)&&t.addIssue({code:"custom",path:["forms","from"],message:`forms.from must be an address at ${r} (the verified SES identity) \u2014 for example noreply@${r}. Use forms.to for the recipient.`})}),fl=c.discriminatedUnion("type",[n0,i0,ml]),oj=c.enum(["lightweight","standard","resilient","custom"]),sj=c.object({type:c.enum(M_),instanceType:c.string().optional(),backupRetention:La.optional(),deletionProtection:c.boolean().optional(),encryption:c.union([c.object({useCMK:c.literal(!0)}).strict(),c.literal(!1)]).optional()}).strict(),cj=c.object({memorySize:js.optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(1,E.LAMBDA.TIMEOUT.MIN).max(900,E.LAMBDA.TIMEOUT.MAX).optional()}).strict();var uj=c.object({appName:ut,type:U_,pattern:z_.optional(),patternConfig:fl.optional(),owner:c.string().optional(),tags:c.record(c.string(),c.string()).optional(),vpcId:c.string().optional(),network:Ua.optional(),backup:g1.optional(),tunnel:y1.optional(),additionalNetworks:c.array(M1).optional(),database:c.array(sl),s3:c.array(cl),compute:c.array(pl),dynamodb:c.array(N1).optional(),clickhouse:c.array(P1).optional(),sqs:c.array(ul).optional(),cdn:ll.optional(),customCodeBlocks:c.array(h1).optional(),additionalManagedImports:c.array(c.object({moduleSpecifier:c.string(),namedImports:c.array(c.string()),defaultImport:c.string().optional()}).strict()).optional()}).strict(),Uye=c.object({name:ut,type:U_,pattern:z_.optional(),patternTier:oj.optional(),patternDomain:c.string().optional(),source:c.string().min(1,E.REQUIRED.SOURCE).optional(),buildCommand:c.string().min(1,E.REQUIRED.BUILD_COMMAND).optional(),outputDir:c.string().min(1,E.REQUIRED.OUTPUT_DIR).optional(),routing:a0.optional(),formsTo:c.string().min(1,E.REQUIRED.FORMS_TO).regex(fe.EMAIL,E.EMAIL).optional(),corsOrigin:c.string().regex(fe.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),customDatabase:sj.optional(),customCompute:cj.optional(),region:c.string().optional(),owner:c.string().optional(),includeDatabase:c.boolean().optional(),databaseName:c.string().min(1,E.DATABASE.NAME.REQUIRED).max(63,E.DATABASE.NAME.MAX_LENGTH).optional(),vpcId:c.string().optional(),network:F1.optional(),services:c.array(Q1).optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()}).strict().superRefine((e,t)=>{e.formsTo!==void 0&&(e.patternDomain!==void 0&&e.patternDomain!==""||t.addIssue({code:"custom",path:["patternDomain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"}))}),o0=c.object({name:be,localResource:c.string().min(1),remoteApp:c.string().min(1),remoteResource:c.string().min(1),permission:c.enum(["read","write","read-write"]),remoteArn:c.string().optional()}).strict();var L9=["fjall-managed","external","external-manual"],Wye=c.enum(L9);var lj=c.object({givenName:c.string().min(1),familyName:c.string().min(1),displayName:c.string().min(1).optional(),expires:c.string().min(1).optional()}).strict(),dj=c.object({name:c.string().min(1),path:c.string().min(1).optional()}).strict(),U9=c.union([c.object({managedPolicyArn:c.string().min(1)}).strict(),c.object({customerManagedPolicy:dj}).strict()]),z9=c.object({managedPolicies:c.array(c.string().min(1)).optional(),inlinePolicy:c.record(c.string(),c.unknown()).optional(),customerManagedPolicies:c.array(dj).optional(),permissionsBoundary:U9.optional(),sessionDuration:c.string().min(1).optional(),description:c.string().optional(),accounts:c.union([c.array(c.string().min(1)),c.literal("all")]).optional(),includeManagementAccount:c.boolean().optional(),groups:c.array(c.string().min(1)).optional()}).strict(),B9=c.object({description:c.string().optional()}).strict(),fh=c.string().regex(fe.EMAIL,E.EMAIL),s0={groups:c.record(c.string(),B9).optional(),permissionSets:c.record(c.string(),z9).optional(),memberships:c.record(c.string(),c.array(fh)).optional(),resolutionVersion:c.number().int().min(1).optional(),defaultPermissionSets:c.boolean().optional()},V9=c.discriminatedUnion("source",[c.object({...s0,source:c.literal("fjall-managed"),users:c.record(fh,lj)}).strict(),c.object({...s0,source:c.literal("external")}).strict(),c.object({...s0,source:c.literal("external-manual"),users:c.record(fh,lj).optional()}).strict()]),c0=c.object({name:be,type:c.literal("organisation").optional(),organisationName:c.string().min(1).optional(),orgEmail:fh.optional(),accounts:c.unknown().optional(),accountIds:c.record(c.string(),c.string()).optional(),identityCentre:c.union([V9,c.literal(!1)]).optional(),allowedRegions:c.array(c.string().min(1)).optional()}).strict();var G9=Object.defineProperty,W9=(e,t)=>G9(e,"name",{value:t,configurable:!0}),K9=[1,3,5,7,14,30,60,90,120,150,180,365,400,545,731,1827,3653],hh=c.object({buildkiteQueue:c.string().min(1,"buildkiteQueue cannot be empty").max(100).regex(/^[a-zA-Z0-9-_]+$/,"buildkiteQueue must be alphanumeric with hyphens/underscores"),buildkiteOrgSlug:c.string().min(1,"buildkiteOrgSlug cannot be empty").max(100).regex(/^[a-z0-9-]+$/,"buildkiteOrgSlug must be a lowercase Buildkite organisation slug"),agentTokenSsmParameterName:c.string().min(2).regex(/^\//,"agentTokenSsmParameterName must be a full path (leading /)").optional(),agentTokenKmsKeyArn:c.string().min(1).optional(),fjallApiKeySsmParameterName:c.string().min(2).regex(/^\//,"fjallApiKeySsmParameterName must be a full path (leading /)").optional(),instanceType:c.string().min(1).default("c8g.xlarge"),agentVolumeSizeGib:c.number().int().min(20).max(1e3).default(250),agentMinInstances:c.number().int().min(0).default(0),agentMaxInstances:c.number().int().min(1).default(2),agentsPerInstance:c.number().int().min(1).default(1),spotCapacityPercentage:c.number().int().min(0).max(100).default(0),scaleInIdlePeriodSeconds:c.number().int().min(60).default(600),disconnectAfterUptimeSeconds:c.number().int().min(3600).default(86400),maxInstanceLifetimeDays:c.number().int().min(1).max(365).default(7),terminateInstanceAfterJob:c.boolean().default(!1),purgeBuildsOnDiskFull:c.boolean().default(!0),terminateInstanceOnDiskFull:c.boolean().default(!1),logRetentionDays:c.number().int().min(1).default(30),agentLogRetentionDays:c.literal(K9).default(7),buildkiteAgentRelease:c.enum(["stable","beta","edge"]).default("stable"),buildkiteAgentTags:c.string().default(""),buildkiteAgentTimestampLines:c.boolean().default(!1),buildkiteAgentExperiments:c.string().default(""),buildkiteAgentTracingBackend:c.enum(["","datadog","opentelemetry"]).default(""),buildkiteAgentCancelGracePeriodSeconds:c.number().int().min(10).default(60),enableSecretsPlugin:c.boolean().default(!0),enableEcrPlugin:c.boolean().default(!1),enableDockerLoginPlugin:c.boolean().default(!1),enableDockerUserNamespaceRemap:c.boolean().default(!0),enableDockerExperimental:c.boolean().default(!1),dockerNetworkingProtocol:c.enum(["ipv4","dualstack"]).default("ipv4"),enableInstanceStorage:c.boolean().default(!1),mountTmpfsAtTmp:c.boolean().default(!0),buildkiteAgentEnableGitMirrors:c.boolean().default(!1),bootstrapScriptUrl:c.string().default(""),agentEnvFileUrl:c.string().default(""),scalerEventSchedulePeriod:c.string().min(1).default("1 minute"),scalerMinPollInterval:c.string().min(1).default("10s"),scaleOutFactor:c.string().min(1).default("1.0"),scaleOutWaitingForJobs:c.boolean().default(!1),rolePermissionsBoundaryArn:c.string().min(1).optional(),alarmSnsTopicArn:c.string().min(1).optional(),applicationId:c.string().min(1).optional(),costAllocationEnvironment:c.string().min(1).optional(),costAllocationOwner:c.string().min(1).optional()}).strict(),Z9=hh.refine(e=>e.agentMinInstances<=e.agentMaxInstances,{message:"agentMinInstances must be <= agentMaxInstances"});function q9(e){let t=Z9.safeParse(e);if(!t.success){let r=t.error.issues.map(i=>` - ${i.path.join(".")||"(root)"}: ${i.message}`).join(`
|
|
354
|
+
`)}getConsolePrefix(t){switch(t){case"error":return"[ERROR]";case"warn":return"[WARN]";case"info":return"[INFO]";case"debug":return"[DEBUG]";case"trace":return"[TRACE]"}}error(t,r,i){this.log("error",t,r,i)}warn(t,r,i){this.log("warn",t,r,i)}info(t,r,i){this.log("info",t,r,i)}debug(t,r,i){this.log("debug",t,r,i)}trace(t,r,i){this.log("trace",t,r,i)}diagnostic(t,r,i,n){this.log(t,r,i,n),!this.debugEnabled&&f_()&&(Yn[t]<Yn.info||this.writeStderrLine(this.createEntry(t,r,i,n)))}isDebugEnabled(){return this.debugEnabled}isTraceEnabled(){return this.traceEnabled}enableDebug(){this.debugEnabled=!0,Yn[this.minLevel]>Yn.debug&&(this.minLevel="debug"),this.fileWriter.setDebugEnabled(!0),this.fileWriter.isInitialised&&this.fileWriter.initialiseDebugStream()}withCorrelation(t){return new Is(this,t)}forDeployment(t,r="deploy"){return new Hu(this,t,r)}close(){this.fileWriter.close()}async flushAndClose(){await this.fileWriter.closeAndFlush()}getLogPath(){return this.mainLogPath}getDebugLogPath(){return this.debugLogPath}getLogDir(){return this.config.logDir}logWithCorrelation(t,r,i,n,a,o,s){this.log(t,r,i,a,n,o,s)}static reset(){e.instance&&(e.instance.close(),e.instance=null)}};var cn=Lf.getInstance();var nX=Object.defineProperty,ks=(e,t)=>nX(e,"name",{value:t,configurable:!0});function g_(e){return e.success===!0}ks(g_,"isSuccess");function y_(e){return e.success===!1}ks(y_,"isFailure");function G(e){return{success:!0,data:e}}ks(G,"success");function $(e){return{success:!1,error:e}}ks($,"failure");async function v_(e){try{let t=await e();return G(t)}catch(t){return $(Vr(t))}}ks(v_,"tryAsync");function b_(e){try{let t=e();return G(t)}catch(t){return $(Vr(t))}}ks(b_,"trySync");var iX=Object.defineProperty,aX=(e,t)=>iX(e,"name",{value:t,configurable:!0}),Z$=/^[a-zA-Z][a-zA-Z0-9-]*$/,oX=Tu.source.replace(/^\^|\$$/g,""),fe=Object.freeze({IDENTIFIER:Z$,NEW_APP_NAME:/^[a-z][a-z0-9-]*$/,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:Z$,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:new RegExp(`^(?:/${oX})+$`),SECRET_NAME:Qm,SSM_COMPONENT:Tu,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,HTTP_ORIGIN:/^https?:\/\/[a-z0-9.-]+(:\d+)?$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/,SCHEDULE_EXPRESSION:/^(rate\(1 (?:minute|hour|day)\)|rate\((?:[2-9]|[1-9]\d+) (?:minutes|hours|days)\)|cron\([^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+\))$/,LAMBDA_RUNTIME_IDENTIFIER:/^[A-Za-z0-9._-]+$/,ENV_VAR_NAME:/^[A-Za-z_][A-Za-z0-9_]*$/});function S_(e){let t=/^rate\((\d+) (minute|minutes|hour|hours|day|days)\)$/.exec(e);if(!t)return;let r=t[1],i=t[2];if(r===void 0||i===void 0)return;let n=parseInt(r,10);if(!Number.isFinite(n)||n<1)return;let a=i==="minute"||i==="hour"||i==="day";if(!(a&&n!==1)&&!(!a&&n===1))return i==="minute"||i==="minutes"?{everyMs:n*6e4}:i==="hour"||i==="hours"?{everyMs:n*60*6e4}:{everyMs:n*24*60*6e4}}aX(S_,"parseRateExpression");var q$=["t4g.medium","m7g.medium","m8g.medium","r7g.medium","r8g.medium","m7g.large","m8g.large","r7g.large","r8g.large","m7g.xlarge","m8g.xlarge","r7g.xlarge","r8g.xlarge"];var E=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",NEW_APP_NAME:"Must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:Wx,SSM_COMPONENT:ef,EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",SOURCE:"Source directory is required",BUILD_COMMAND:"Build command is required",OUTPUT_DIR:"Output directory is required",FORMS_TO:"Forms recipient address is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required",CONNECTED_RESOURCE_NAME:"Connected resource names must not be empty"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},CLICKHOUSE_STORAGE:{INTEGER:"ClickHouse storage must be a whole number of GiB",MIN:`ClickHouse storage must be at least ${100} GiB`,MAX:`ClickHouse storage cannot exceed ${16384} GiB (the gp3 ceiling)`},CLICKHOUSE_IOPS:{INTEGER:"ClickHouse iops must be a whole number",MIN:`ClickHouse iops must be at least ${3e3} (the gp3 baseline)`,MAX:`ClickHouse iops cannot exceed ${8e4} (the gp3 ceiling)`},CLICKHOUSE_THROUGHPUT:{INTEGER:"ClickHouse throughputMbps must be a whole number of MiB/s",MIN:`ClickHouse throughputMbps must be at least ${125} MiB/s (the gp3 baseline)`,MAX:`ClickHouse throughputMbps cannot exceed ${2e3} MiB/s (the gp3 ceiling)`},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days (the RDS automated-backup ceiling)"},CLICKHOUSE_BACKUP_RETENTION:{INTEGER:"ClickHouse backup retention must be an integer number of days",MIN:`ClickHouse backup retention must be at least ${1} day`,MAX:`ClickHouse backup retention cannot exceed ${3650} days`},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"},RESPONSE_TIME_MS:{MIN:"Response-time threshold must be at least 1 ms"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"});var sX=Object.defineProperty,Sr=(e,t)=>sX(e,"name",{value:t,configurable:!0}),cX=["us-east-2","us-west-2","us-east-1","eu-west-1","eu-central-1","ap-southeast-1"],uX=Object.freeze(cX.flatMap(e=>{let t=us(e);return t?[t]:[]})),w_=Object.freeze(["us-east-2","us-west-2","us-east-1","eu-west-1","ap-southeast-1"]);function Uf(e){return e?e.split(",").map(t=>t.trim()).filter(Boolean):[]}Sr(Uf,"parseRegionList");function k_(e){return Gn.includes(e)}Sr(k_,"isValidRegion");function N_(e){return/^[a-z]{2}-[a-z]+-[1-9]$/.test(e)}Sr(N_,"isValidRegionFormat");function P_(e){if(!e)return w_.slice(0,3);let t=e.toLowerCase().split("-"),r=t[0],i=t.length>1?t[1]:"",n=[];return r&&i&&(n=Gn.filter(a=>a.startsWith(`${r}-${i}`))),n.length===0&&r&&(n=Gn.filter(a=>a.startsWith(`${r}-`))),n.length>0?n.slice(0,3):w_.slice(0,3)}Sr(P_,"getSuggestions");function R_(e){if(k_(e))return!0;let t=P_(e);return N_(e)?`Unknown region. Try: ${t.join(", ")}`:`Invalid format. Try: ${t.join(", ")}`}Sr(R_,"validateRegion");function H$(e){if(!e||e.trim()==="")return!0;let t=Uf(e);for(let r of t){let i=R_(r);if(i!==!0)return i}return!0}Sr(H$,"validateRegionList");function O_(e,t){return e.filter(r=>r!==t)}Sr(O_,"filterDuplicateRegions");function $_(e){return{label:e.city,value:e.code,description:e.optIn?`${e.code} \u2014 opt-in required`:e.code}}Sr($_,"toRegionOption");function J$(){return yr.map($_)}Sr(J$,"getRegionOptions");function X$(e){return yr.filter(t=>t.code!==e).map($_)}Sr(X$,"getRegionOptionsExcluding");function Y$(e){let t=yr.find(r=>r.code===e);return t?t.city:e}Sr(Y$,"getRegionName");function Q$(e){return t=>{let r=Uf(t);return O_(r,e)}}Sr(Q$,"createRegionFormatter");var zf="27.1.0";var Bf=["Aurora","Instance","GlobalAurora","ClickHouse"],Ns=["FARGATE","FARGATE_SPOT","EC2"],Kr=["standard","resilient","enterprise"],Vf=["tinkerer","lightweight","standard","resilient","enterprise"],j_="custom",Ju=[...Vf,j_];var lX=Object.defineProperty,dX=(e,t)=>lX(e,"name",{value:t,configurable:!0}),lge=Object.freeze({RESOURCE_SUFFIXES:Object.freeze({storage:"Storage",database:"Database",cluster:"Cluster",function:"Function",instance:"Instance",compute:"Compute"})}),Xu=["ecs","lambda","ec2"],Yu=Object.freeze({ECS:"ecs",LAMBDA:"lambda",EC2:"ec2"}),Gf=["code","container"],Wf=Object.freeze({CODE:"code",CONTAINER:"container"}),Kf=["ARM_64","X86_64"],e1="ARM_64",Qu=["NONE","AWS_IAM"],Zf=["public","internal"],qf=["CPU","MEMORY"],ja=["messaging","compute"],Hf=["ARM","STANDARD"],M_=["Instance","Aurora"],Ps=["postgresql","mysql"],el=["web","worker"],t1=["foundation","compliance","hardened"];var Jf=["t3.nano","t3.micro","t3.small","t3.medium","t3.large","t3.xlarge","t3.2xlarge","t3a.nano","t3a.micro","t3a.small","t3a.medium","t3a.large","t3a.xlarge","t3a.2xlarge","t4g.nano","t4g.micro","t4g.small","t4g.medium","t4g.large","t4g.xlarge","t4g.2xlarge","c5.large","c5.xlarge","c5.2xlarge","c5.4xlarge","c5.9xlarge","c5.12xlarge","c5.18xlarge","c5.24xlarge","c5a.large","c5a.xlarge","c5a.2xlarge","c5a.4xlarge","c5a.8xlarge","c5a.12xlarge","c5a.16xlarge","c5a.24xlarge","c6g.medium","c6g.large","c6g.xlarge","c6g.2xlarge","c6g.4xlarge","c6g.8xlarge","c6g.12xlarge","c6g.16xlarge","r5.large","r5.xlarge","r5.2xlarge","r5.4xlarge","r5.8xlarge","r5.12xlarge","r5.16xlarge","r5.24xlarge","r5a.large","r5a.xlarge","r5a.2xlarge","r5a.4xlarge","r5a.8xlarge","r5a.12xlarge","r5a.16xlarge","r5a.24xlarge","r6g.medium","r6g.large","r6g.xlarge","r6g.2xlarge","r6g.4xlarge","r6g.8xlarge","r6g.12xlarge","r6g.16xlarge","i3.large","i3.xlarge","i3.2xlarge","i3.4xlarge","i3.8xlarge","i3.16xlarge","p3.2xlarge","p3.8xlarge","p3.16xlarge","g4dn.xlarge","g4dn.2xlarge","g4dn.4xlarge","g4dn.8xlarge","g4dn.12xlarge","g4dn.16xlarge","m5.large","m5.xlarge","m5.2xlarge","m5.4xlarge","m5.8xlarge","m5.12xlarge","m5.16xlarge","m5.24xlarge","m5a.large","m5a.xlarge","m5a.2xlarge","m5a.4xlarge","m5a.8xlarge","m5a.12xlarge","m5a.16xlarge","m5a.24xlarge"],r1=[0,1,5,10,15,30,60];function Ut(e,t){return e.includes(t)}dX(Ut,"constIncludes");var n1=1,i1=65535,hge=Object.freeze({postgresql:5432,mysql:3306}),a1=128,o1=10240,Xf=1,Yf=900,F_=1,L_=1e3,Rs=100,s1=100;var c1=3e3;var u1=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],l1=["standard","assets","upload","website"],Os=["AES256","KMS"];var pX=Object.defineProperty,tl=(e,t)=>pX(e,"name",{value:t,configurable:!0}),zt=tl(e=>c.union([c.literal(!1),e]),"optionalOrDisabled"),Ma={check:tl(e=>e.minCapacity!==void 0&&e.maxCapacity!==void 0?e.minCapacity<=e.maxCapacity:!0,"check"),params:{message:E.CAPACITY_CONSTRAINT.MIN_LTE_MAX,path:["maxCapacity"]}},rl=tl(e=>c.number().int(E.MEMORY_LIMIT.INTEGER).min(e,e===128?E.MEMORY_LIMIT.MIN_128:E.MEMORY_LIMIT.MIN_512).max(30720,E.MEMORY_LIMIT.MAX),"memoryLimitMiBSchema"),be=c.string().min(1,E.REQUIRED.RESOURCE_NAME).max(63,E.MAX_LENGTH.RESOURCE_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),p1=c.string().min(1,E.REQUIRED.BUCKET_NAME).max(63,E.MAX_LENGTH.BUCKET_NAME).regex(fe.BUCKET_NAME,E.BUCKET_NAME),m1=c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME);function Qf(e,t=fe.IDENTIFIER,r=E.IDENTIFIER){return c.string().min(2,E.IDENTIFIER_MIN_LENGTH).max(50,e).regex(t,r).refine(i=>!i.endsWith("-"),{message:E.IDENTIFIER_NO_TRAILING_HYPHEN}).refine(i=>!i.includes("--"),{message:E.IDENTIFIER_NO_CONSECUTIVE_HYPHENS})}tl(Qf,"identifierSchema");var ut=Qf(E.MAX_LENGTH.APP_NAME),xge=Qf(E.MAX_LENGTH.APP_NAME,fe.NEW_APP_NAME,E.NEW_APP_NAME),Fa=c.number().int(E.PORT.INTEGER).min(n1,E.PORT.MIN).max(i1,E.PORT.MAX),St=c.object({key:c.string(),sourceText:c.string()}).strict(),mX=c.object({__identifier:c.string()}).strict(),fX=c.object({__expression:c.string()}).strict(),hX=c.object({__call:c.string()}).strict(),gX=c.union([mX,fX,hX]),yX=c.union([c.string(),c.number(),c.boolean(),gX]),$s=c.record(c.string().regex(fe.ENV_VAR_NAME,E.ENV_VAR_NAME),yX),vX=c.object({id:c.string(),name:c.string().optional(),arn:c.string().optional(),field:c.string().optional()}).strict().refine(e=>e.name!==void 0!=(e.arn!==void 0),{message:"secretsImport requires exactly one of `name` or `arn`."}),f1=c.record(c.string(),vX),Age=c.record(c.string(),c.unknown()),U_=c.enum(Ju).describe(`Application type must be one of: ${Ju.join(", ")}`),z_=c.enum(vr).describe(`OpenNext deployment pattern: ${vr.join(", ")}`),bX=c.enum(["before-imports","after-imports","after-app-init","after-tags","after-resource","end-of-file"]),SX=c.enum(["import","app-init","tags","database","compute","storage","network","messaging","cdn","pattern","vpc-peer","vpc-peer-accepter","cross-plan-connection","custom"]),h1=c.object({sourceText:c.string(),position:bX,afterManagedResource:c.object({type:SX,name:c.string().optional()}).strict().optional(),originalLine:c.number().int().optional(),leadingComments:c.array(c.string()).optional(),orphaned:c.boolean().optional(),orphanedComment:c.string().optional()}).strict(),g1=c.union([c.object({tier:c.enum(Kr)}).strict(),c.literal(!1)]),y1=c.union([c.object({instanceType:c.string().optional()}).strict(),c.literal(!1)]),EX=Qf(E.MAX_LENGTH.ORGANISATION_NAME),xX=c.string().regex(fe.EMAIL,E.EMAIL),d1=c.string().refine(e=>Gn.includes(e),{message:E.REGION}),_ge=c.object({name:EX,email:xX,accountName:c.string().optional(),primaryRegion:d1.optional().default(cs),secondaryRegions:c.array(d1).optional(),security:c.enum(t1).optional(),force:c.boolean().optional()}).strict();function nl(e){return e.issues.map(t=>`${t.path.length>0?`${t.path.join(".")}: `:""}${t.message}`).join(`
|
|
355
|
+
`)}tl(nl,"getZodErrorMessage");var eh=c.number().min(1,E.ALARM.PERCENTAGE.MIN).max(100,E.ALARM.PERCENTAGE.MAX),B_=c.union([eh,c.literal(!1)]),AX=c.union([c.number().min(1,E.ALARM.RESPONSE_TIME_MS.MIN),c.literal(!1)]),_X=c.number().min(1,E.ALARM.FREE_STORAGE_GIB.MIN),v1=c.union([c.literal(!1),c.object({cpuThreshold:B_.optional(),memoryThreshold:B_.optional(),runningTasksMinimum:c.number().int().min(0).optional(),http5xxThreshold:B_.optional(),p99ResponseTimeThresholdMs:AX.optional()}).strict()]),b1=c.union([c.literal(!1),c.object({cpuThreshold:eh.optional(),freeStorageThresholdGiB:_X.optional(),connectionsThreshold:c.number().int().min(1).optional()}).strict()]),S1=c.union([c.literal(!1),c.object({errorRateThreshold:eh.optional(),durationThresholdPercent:eh.optional()}).strict()]);var La=c.number().int(E.BACKUP_RETENTION.INTEGER).min(1,E.BACKUP_RETENTION.MIN).max(35,E.BACKUP_RETENTION.MAX),E1=c.number().int(E.CLICKHOUSE_STORAGE.INTEGER).min(100,E.CLICKHOUSE_STORAGE.MIN).max(16384,E.CLICKHOUSE_STORAGE.MAX),x1=c.number().int(E.CLICKHOUSE_IOPS.INTEGER).min(3e3,E.CLICKHOUSE_IOPS.MIN).max(8e4,E.CLICKHOUSE_IOPS.MAX),A1=c.number().int(E.CLICKHOUSE_THROUGHPUT.INTEGER).min(125,E.CLICKHOUSE_THROUGHPUT.MIN).max(2e3,E.CLICKHOUSE_THROUGHPUT.MAX),TX=c.enum(q$),_1=c.number().int(E.CLICKHOUSE_BACKUP_RETENTION.INTEGER).min(1,E.CLICKHOUSE_BACKUP_RETENTION.MIN).max(3650,E.CLICKHOUSE_BACKUP_RETENTION.MAX),il=c.number().int(E.MONITORING_INTERVAL.INTEGER).refine(e=>Ut(r1,e),{message:E.MONITORING_INTERVAL.VALUES}),rh=c.number().int(E.DATABASE.PORT.INTEGER).min(1024,E.DATABASE.PORT.MIN).max(65535,E.DATABASE.PORT.MAX),CX=c.enum(Bf).describe(`Database type must be one of: ${Bf.join(", ")}`),IX=c.object({maxConnections:c.number().int(E.MAX_CONNECTIONS.INTEGER).min(1,E.MAX_CONNECTIONS.MIN).max(100,E.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:c.number().int(E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:c.number().int(E.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,E.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,E.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:c.boolean().optional()}).strict().describe("RDS Proxy configuration"),DX=c.object({instanceType:c.string().optional(),availabilityZone:c.string().optional()}).strict().describe("Read replica configuration"),wX=c.object({automaticallyAfterDays:c.number().int(E.ROTATION.INTEGER).min(1,E.ROTATION.MIN).max(365,E.ROTATION.MAX).optional()}).strict().describe("Secret rotation configuration"),nh=c.object({username:c.string().min(1,E.REQUIRED.USERNAME).max(63,E.USERNAME.MAX_LENGTH).optional(),secretRotation:wX.optional()}).strict().describe("Database credentials configuration"),ih=zt(IX),ah=zt(DX),kX=c.object({scaleWithWriter:c.boolean().optional(),enableDatabaseInsights:c.boolean().optional(),identifierSuffix:c.string().min(1,E.IDENTIFIER_SUFFIX.REQUIRED).max(50,E.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:c.string().optional()}).strict().describe("Configuration for a single Aurora reader instance"),al=c.object({enableDatabaseInsights:c.boolean().optional(),identifierSuffix:c.string().min(1,E.IDENTIFIER_SUFFIX.REQUIRED).max(50,E.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:c.string().optional()}).strict().describe("Configuration for Aurora writer instance"),NX=c.object({count:c.number().int(E.READER.COUNT.INTEGER).min(0,E.READER.COUNT.MIN).max(15,E.READER.COUNT.MAX).optional(),instances:c.array(kX).max(15,E.READER_INSTANCES.MAX).optional(),defaultEnableDatabaseInsights:c.boolean().optional()}).strict().refine(e=>!(e.count!==void 0&&e.instances!==void 0),{message:E.READER_INSTANCES.COUNT_OR_INSTANCES,path:["count"]}).describe("Aurora readers configuration"),ol=zt(NX),PX=c.object({awsManaged:c.literal(!0)}).strict(),RX=c.object({useCMK:c.literal(!0)}).strict(),T1=c.union([PX,RX]),OX=c.object({mode:c.enum(["standard","advanced"]).optional(),encryptionKey:T1.optional()}).strict().describe("Database Insights configuration"),oh=zt(OX),sh=c.object({storageKey:T1.optional()}).strict().describe("Encryption configuration (DESTRUCTIVE to change storageKey)"),sl=c.object({name:be,type:CX,databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME),instanceType:c.string().optional(),allocatedStorage:c.number().optional(),multiAz:c.boolean().optional(),publiclyAccessible:c.boolean().optional(),databaseInsights:oh.optional(),port:rh.optional(),deletionProtection:c.boolean().optional(),proxy:ih.optional(),credentials:nh.optional(),readReplica:ah.optional(),encryption:sh.optional(),writer:al.optional(),readers:ol.optional(),backupRetention:La.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:il.optional(),primaryRegion:c.string().optional(),secondaryRegions:c.array(c.string()).optional(),globalClusterIdentifier:c.string().optional(),enableGlobalWriteForwarding:c.boolean().optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional(),databaseEngine:c.enum(Ps).optional(),engineExpression:c.string().optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional(),alarms:b1.optional()}).strict(),ch=c.object({appName:ut,nameProvidedByFlag:c.boolean().optional(),databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME),resourceName:be.optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional(),databaseInsights:oh.optional(),port:rh.optional(),proxy:ih.optional(),credentials:nh.optional(),encryption:sh.optional(),deletionProtection:c.boolean().optional()}).strict(),C1={databaseType:c.literal("Instance"),instanceType:c.string().optional(),multiAz:c.boolean().optional(),readReplica:ah.optional(),publiclyAccessible:c.boolean().optional(),backupRetention:La.optional(),allocatedStorage:c.number().optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},I1={databaseType:c.literal("Aurora"),writer:al.optional(),readers:ol.optional(),backupRetention:La.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:il.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},D1={databaseType:c.literal("GlobalAurora"),primaryRegion:c.string().min(1,E.GLOBAL_AURORA.PRIMARY_REGION_REQUIRED),secondaryRegions:c.array(c.string()).optional(),globalClusterIdentifier:c.string().optional(),enableGlobalWriteForwarding:c.boolean().optional(),writer:al.optional(),readers:ol.optional(),backupRetention:La.optional(),preferredMaintenanceWindow:c.string().optional(),monitoringInterval:il.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()},w1=c.object({appName:ut,nameProvidedByFlag:c.boolean().optional(),databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME).max(63,E.MAX_LENGTH.DATABASE_NAME).regex(fe.DATABASE_NAME,E.DATABASE_NAME),resourceName:be.optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional()}).strict(),k1={databaseType:c.literal("ClickHouse"),instanceType:TX.optional(),storageGb:E1.optional(),iops:x1.optional(),throughputMbps:A1.optional(),coldTier:c.union([c.object({mode:c.literal("s3")}).strict(),c.literal(!1)]).optional(),optimiseSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupVerify:c.literal(!1).optional(),backupRetentionDays:_1.optional()},$X=ch.extend(C1).strict(),jX=ch.extend(I1).strict(),MX=ch.extend(D1).strict(),FX=w1.extend(k1).strict(),$ge=c.discriminatedUnion("databaseType",[$X,jX,MX,FX]),V_=ch.extend({resourceName:be}).strict(),LX=V_.extend(C1).strict(),UX=V_.extend(I1).strict(),zX=V_.extend(D1).strict(),BX=w1.extend({resourceName:be}).strict(),VX=BX.extend(k1).strict(),jge=c.discriminatedUnion("databaseType",[LX,UX,zX,VX]),Mge=c.object({appName:ut,databaseName:c.string().min(1,E.REQUIRED.DATABASE_NAME),maxConnections:c.number().int(E.MAX_CONNECTIONS.INTEGER).min(1,E.MAX_CONNECTIONS.MIN).max(100,E.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:c.number().int(E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,E.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:c.number().int(E.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,E.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,E.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:c.boolean().optional(),nameProvidedByFlag:c.boolean().optional()}).strict(),GX=["S","N","B"],th=c.object({name:c.string(),type:c.enum(GX)}).strict(),N1=c.object({name:be,partitionKey:th,sortKey:th.optional(),globalSecondaryIndexes:c.array(c.object({indexName:c.string(),partitionKey:th,sortKey:th.optional()}).strict()).optional(),ttlAttribute:c.string().optional(),stream:c.boolean().optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict(),WX=c.object({mode:c.literal("s3")}).strict(),P1=c.object({name:be,type:c.literal("ClickHouse"),databaseName:m1,instanceType:c.string().optional(),storageGb:E1.optional(),iops:x1.optional(),throughputMbps:A1.optional(),coldTier:c.union([WX,c.literal(!1)]).optional(),optimiseSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupSchedule:c.union([c.string(),c.literal(!1)]).optional(),backupVerify:c.literal(!1).optional(),backupRetentionDays:_1.optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict();var KX=c.object({count:c.number().int(E.NAT_GATEWAY.INTEGER).min(0,E.NAT_GATEWAY.MIN).max(3,E.NAT_GATEWAY.MAX).optional()}).strict().describe("NAT gateway configuration"),R1=zt(KX),G_=c.enum(["cloudwatch","s3"]),ZX=c.object({destination:G_.optional(),retentionDays:c.number().int(E.RETENTION_DAYS.INTEGER).min(1,E.RETENTION_DAYS.MIN).max(365,E.RETENTION_DAYS.MAX).optional(),trafficType:c.enum(["ALL","ACCEPT","REJECT"]).optional()}).strict().describe("VPC flow log configuration"),O1=zt(ZX),qX=c.object({s3:c.boolean().optional(),dynamodb:c.boolean().optional()}).strict().describe("Gateway VPC endpoints (FREE)"),HX=zt(qX),JX=c.object({ecr:c.boolean().optional(),secretsManager:c.boolean().optional(),kms:c.boolean().optional(),cloudwatchLogs:c.boolean().optional(),ssm:c.boolean().optional(),sts:c.boolean().optional()}).strict().describe("Interface VPC endpoints (cost per hour)"),XX=zt(JX),YX=c.object({gateway:HX.optional(),interface:XX.optional()}).strict().describe("VPC endpoints configuration"),$1=zt(YX),Ua=c.object({maxAzs:c.number().int(E.MAX_AZS.INTEGER).min(1,E.MAX_AZS.MIN).max(3,E.MAX_AZS.MAX).optional(),natGateways:R1.optional(),flowLogs:O1.optional(),vpcEndpoints:$1.optional(),cidrMask:c.number().int(E.CIDR_MASK.INTEGER).min(16,E.CIDR_MASK.MIN).max(28,E.CIDR_MASK.MAX).optional()}).strict(),j1=c.string().min(1,E.REQUIRED.NETWORK_NAME).max(50,E.MAX_LENGTH.NETWORK_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),M1=Ua.extend({name:j1}).strict(),F1=zt(Ua),Bge=c.object({appName:ut,networkName:j1.optional(),maxAzs:c.number().int(E.MAX_AZS.INTEGER).min(1,E.MAX_AZS.MIN).max(3,E.MAX_AZS.MAX).optional(),natGateways:R1.optional(),flowLogs:O1.optional(),vpcEndpoints:$1.optional()}).strict(),QX=fe.CIDR,W_=c.string().regex(QX,E.CIDR),e9=c.object({kind:c.literal("database"),resource:c.string().min(1,E.REQUIRED.RESOURCE_REFERENCE),name:be,allowedFromCidrs:c.array(W_),access:c.enum(["read","write","readWrite"]).optional()}).strict(),t9=c.object({kind:c.literal("ecsService"),resource:c.string().min(1,E.REQUIRED.RESOURCE_REFERENCE),serviceName:c.string().min(1,E.REQUIRED.SERVICE_NAME),name:be,allowedFromCidrs:c.array(W_),port:Fa.optional()}).strict(),r9=c.discriminatedUnion("kind",[e9,t9]),L1=c.object({name:be,peerAppName:c.string().min(1,E.REQUIRED.APP_NAME),peerAccountId:c.string().regex(fe.AWS_ACCOUNT_ID,E.AWS_ACCOUNT_ID),peerRegion:c.string().min(1,E.VPC_PEER.REGION_REQUIRED).optional(),peerVpcId:c.string().regex(fe.VPC_ID,E.VPC_ID).optional(),peerVpcCidr:W_.optional(),peerRoleArn:c.string().regex(fe.ROLE_ARN,E.ROLE_ARN).optional(),peerRouteTableIds:c.array(c.string().min(1,E.VPC_PEER.ROUTE_TABLE_ID_REQUIRED)).optional(),localVpcName:c.string().min(1,E.REQUIRED.NETWORK_NAME).optional(),enableDnsResolution:c.boolean().optional()}).strict(),K_=c.object({name:be,requesterAccountIds:c.array(c.string().regex(fe.AWS_ACCOUNT_ID,E.AWS_ACCOUNT_ID)).min(1,E.VPC_PEER.MIN_REQUESTER_ACCOUNTS),localVpcName:c.string().min(1,E.REQUIRED.NETWORK_NAME).optional(),publishToSsm:c.boolean().optional(),exposedResources:c.array(r9).optional()}).strict();var uh=["storage","cdn","compute"],n9=c.object({sid:c.string().optional(),effect:c.enum(["Allow","Deny"]),principals:c.array(c.string()),actions:c.array(c.string()),resources:c.array(c.string()).optional(),conditions:c.record(c.string(),c.record(c.string(),c.union([c.string(),c.array(c.string())]))).optional()}).strict(),cl=c.object({name:be,bucketName:c.string().optional(),publicReadAccess:c.boolean().optional(),websiteHosting:c.object({indexDocument:c.string(),errorDocument:c.string().optional()}).strict().optional(),backupVaultTier:c.enum(Kr).optional(),versioned:c.boolean().optional(),encryption:c.enum(Os).optional(),kmsKeyArn:c.string().optional(),cors:c.array(c.object({allowedOrigins:c.array(c.string()),allowedMethods:c.array(c.string()),allowedHeaders:c.array(c.string()).optional(),exposedHeaders:c.array(c.string()).optional(),maxAge:c.number().optional()}).strict()).optional(),deployment:c.object({source:c.string(),prune:c.boolean().optional(),cacheControl:c.object({maxAge:c.number().optional(),immutable:c.boolean().optional()}).strict().optional()}).strict().optional(),retain:c.boolean().optional(),resourcePolicyStatements:c.array(n9).optional(),stackPlacement:c.enum(uh).optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict().refine(e=>e.encryption!=="KMS"||!!e.kmsKeyArn,{message:E.KMS.KEY_REQUIRED}),qge=c.object({appName:ut,bucketName:p1,nameProvidedByFlag:c.boolean().optional(),storagePreset:c.enum(l1).optional(),publicReadAccess:c.boolean().optional(),websiteHosting:c.object({indexDocument:c.string(),errorDocument:c.string().optional()}).strict().optional(),backupVaultTier:c.enum(Kr).optional(),versioned:c.boolean().optional(),encryption:c.enum(Os).optional(),kmsKeyArn:c.string().optional(),cors:c.array(c.object({allowedOrigins:c.array(c.string()),allowedMethods:c.array(c.string()),allowedHeaders:c.array(c.string()).optional(),exposedHeaders:c.array(c.string()).optional(),maxAge:c.number().optional()}).strict()).optional(),connectionConfig:c.object({connectToCompute:c.array(c.string()).optional(),connectToServices:c.array(c.string()).optional()}).strict().optional()}).strict().refine(e=>e.encryption!=="KMS"||!!e.kmsKeyArn,{message:E.KMS.KEY_REQUIRED,path:["kmsKeyArn"]});var Z_=c.enum(["DESTROY","RETAIN"]),ul=c.object({name:be,queueType:c.enum(["standard","fifo"]).default("standard"),visibilityTimeout:c.number().int(E.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,E.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,E.SQS.VISIBILITY_TIMEOUT.MAX).optional(),retentionPeriod:c.number().int(E.SQS.RETENTION_PERIOD.INTEGER).min(60,E.SQS.RETENTION_PERIOD.MIN).max(1209600,E.SQS.RETENTION_PERIOD.MAX).optional(),contentBasedDeduplication:c.boolean().optional(),removalPolicy:Z_.optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict();var U1=c.object({type:c.literal("basic-auth"),username:c.string().min(1),password:c.string().min(1)}).strict(),ll=c.object({name:be,defaultOriginRef:c.string(),behaviours:c.array(c.object({pathPattern:c.string(),originRef:c.string(),cachePolicy:c.enum(["CACHING_OPTIMIZED","CACHING_DISABLED"]).optional()}).strict()).optional(),customDomain:c.string().optional(),certificateArn:c.string().optional(),domain:c.string().optional(),originHostname:c.string().optional(),accessGate:c.union([c.literal(!1),U1]).optional(),extraProperties:c.array(St).optional()}).strict(),z1=c.object({appName:c.string(),name:be.optional(),defaultOriginRef:c.string(),behaviours:c.array(c.object({pathPattern:c.string(),originRef:c.string(),cachePolicy:c.enum(["CACHING_OPTIMIZED","CACHING_DISABLED"]).optional()}).strict()).optional(),customDomain:c.string().optional(),certificateArn:c.string().optional(),domain:c.string().optional(),originHostname:c.string().optional(),accessGate:c.union([c.literal(!1),U1]).optional(),nameProvidedByFlag:c.boolean().optional()}).strict();var i9=Object.defineProperty,q_=(e,t)=>i9(e,"name",{value:t,configurable:!0}),a9=new Set(["t4g","c6g","c6gd","c6gn","c7g","c7gd","c7gn","r6g","r6gd","r7g","r7gd","r8g","r8gd","c8g","c8gd","c8gn","m6g","m6gd","m7g","m7gd","m8g","m8gd","x8g","i8g","a1","x2gd","im4gn","is4gen","i4g","hpc7g"]);function Li(e){let t=e.split(".")[0]??"";return a9.has(t)?"ARM":"STANDARD"}q_(Li,"getArchitectureForInstanceType");function lh(e,t){let r=Li(e);return r!==t?{valid:!1,message:`Instance type '${e}' requires ${r} architecture, but '${t}' AMI was specified. Use a ${r==="ARM"?"Graviton instance (t4g, c6g, r6g, m6g, etc.)":"Intel/AMD instance (t3, c5, r5, m5, etc.)"} instead.`}:{valid:!0}}q_(lh,"validateArchitectureMatch");function B1(e,t){return Li(e)===t}q_(B1,"isArchitectureCompatible");var o9=Object.defineProperty,dh=(e,t)=>o9(e,"name",{value:t,configurable:!0});var s9=1;var c9=/^[A-Za-z0-9_.-]+$/,u9=c.object({id:c.string().min(1,"buildSecret id cannot be empty").regex(c9,"buildSecret id may contain only letters, digits, '_', '.', and '-' (no comma, '=', or whitespace, which would break the buildx --secret argv)"),ssm:c.string().min(1,"ssm parameter name cannot be empty").optional(),secretsManager:c.object({name:c.string().min(1,"secret name cannot be empty").optional(),arn:c.string().min(1,"secret arn cannot be empty").optional(),field:c.string().min(1,"secret field cannot be empty").optional()}).strict().refine(e=>e.name===void 0!=(e.arn===void 0),"secretsManager requires exactly one of name or arn").optional(),env:c.string().min(1,"env variable name cannot be empty").optional()}).strict().superRefine((e,t)=>{[e.ssm,e.secretsManager,e.env].filter(r=>r!==void 0).length!==1&&t.addIssue({code:c.ZodIssueCode.custom,message:"buildSecret requires exactly one source (ssm, secretsManager, or env)"})}),l9=c.union([c.string(),c.object({ssm:c.string().min(1,"ssm parameter name cannot be empty").optional(),secretsManager:c.object({name:c.string().min(1,"secret name cannot be empty").optional(),arn:c.string().min(1,"secret arn cannot be empty").optional(),field:c.string().min(1,"secret field cannot be empty").optional()}).strict().refine(e=>e.name===void 0!=(e.arn===void 0),"secretsManager requires exactly one of name or arn").optional(),env:c.string().min(1,"env variable name cannot be empty").optional(),acknowledgePublic:c.boolean().optional()}).strict().superRefine((e,t)=>{[e.ssm,e.secretsManager,e.env].filter(r=>r!==void 0).length!==1&&t.addIssue({code:c.ZodIssueCode.custom,message:"buildArg value requires exactly one source (ssm, secretsManager, or env)"})})]),pn=c.object({path:c.string(),context:c.string().min(1,"context cannot be empty").optional(),target:c.string().min(1,"target cannot be empty").optional(),buildArgs:c.record(c.string(),l9).optional(),buildSecrets:c.array(u9).optional()}).strict(),oye=pn.partial();function d9(e,t){if(t===void 0)return e;let r=t.context??e.context,i=t.target??e.target,n=t.buildArgs??e.buildArgs,a=t.buildSecrets??e.buildSecrets;return{path:t.path??e.path,...r!==void 0&&{context:r},...i!==void 0&&{target:i},...n!==void 0&&{buildArgs:n},...a!==void 0&&{buildSecrets:a}}}dh(d9,"mergeDockerBuild");function H_(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}dh(H_,"isRecord");function V1(e){if(!H_(e)||typeof e.path!="string"||e.path.length===0)return;let t=typeof e.context=="string"&&e.context.length>0?e.context:void 0,r=typeof e.target=="string"&&e.target.length>0?e.target:void 0,i=H_(e.buildArgs)&&Object.keys(e.buildArgs).length>0?e.buildArgs:void 0,n=Array.isArray(e.buildSecrets)&&e.buildSecrets.length>0?e.buildSecrets:void 0,a={path:e.path,...t!==void 0&&{context:t},...r!==void 0&&{target:r},...i!==void 0&&{buildArgs:i},...n!==void 0&&{buildSecrets:n}},o=pn.safeParse(a);return o.success?o.data:void 0}dh(V1,"normaliseDockerBuild");function p9(e){if(e===void 0)return;let t=V1(e);return t===void 0?void 0:JSON.stringify(t)}dh(p9,"dockerBuildFingerprint");var m9=c.object({name:c.string(),clusterName:c.string().optional(),docker:pn.optional(),containerPort:c.number().optional(),secrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),importedSecretNames:c.array(c.string()).optional(),schemaGateImageTag:c.string().optional()}).strict(),f9=c.object({type:c.enum(vr),name:c.string(),source:c.string()}).strict(),h9=c.object({repositoryName:c.string()}).strict(),g9=["x86_64","arm64"],y9=c.object({name:c.string(),secrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),importedSecretNames:c.array(c.string()).optional(),docker:pn.optional(),imageKey:c.string().optional(),architecture:c.enum(g9).optional()}).strict(),v9=c.object({templateHash:c.string(),synthTimestamp:c.string()}).strict(),b9=c.object({constructPath:c.string().max(512),group:c.string().max(128),resourceType:c.string().max(256)}).strict(),S9=c.object({synthesisedBy:c.string().min(1).max(128),minimumEngineVersion:c.string().min(1).max(32),maximumEngineMajor:c.number().int().min(0).optional(),minimumAwsCdkCli:c.string().min(1).max(32).optional()}).strict(),E9=c.object({appName:c.string().min(1).max(128),slot:c.string().min(1).max(64),clusterName:c.string().min(1).max(128),anchor:c.string().min(1).max(128),pinned:c.boolean(),currentServiceName:c.string().min(1).max(256),legacyKey:c.string().min(1).max(256),legacyAnchor:c.string().min(1).max(256),legacyServiceName:c.string().min(1).max(512),legacyKeyFields:c.array(c.string().max(64)).max(32)}).strict(),x9=c.object({constructPath:c.string().min(1).max(512),resourceType:c.string().min(1).max(256),physicalNameHint:c.string().min(1).max(512),policy:c.enum(["retain","snapshot","adopted"]),destroyDisposition:c.enum(["survives","deleted-on-explicit-destroy"]),reason:c.string().min(1).max(1024),costClass:c.enum(["none","storage","fixed-monthly"]),cleanupHint:c.string().min(1).max(1024)}).strict(),sye=c.object({version:c.literal(s9),generatedAt:c.string(),appName:c.string(),services:c.array(m9),lambdas:c.array(y9),pattern:f9.optional(),ecr:h9.optional(),stacks:c.record(c.string(),v9),resourceMap:c.record(c.string(),b9).optional(),engineCompat:S9.optional(),identityAliases:c.array(E9).optional(),residuals:c.array(x9).optional()}).strict();var A9=Object.defineProperty,_9=(e,t)=>A9(e,"name",{value:t,configurable:!0});function W1(e){return!(e.image!==void 0&&e.docker!==void 0)}_9(W1,"imageDockerMutexCheck");var K1=c.number().int(E.CAPACITY.MIN.INTEGER).min(F_,E.GENERATOR_CAPACITY.MIN.MIN).max(L_,E.GENERATOR_CAPACITY.MIN.MAX),Z1=c.number().int(E.CAPACITY.MAX.INTEGER).min(F_,E.GENERATOR_CAPACITY.MAX.MIN).max(L_,E.GENERATOR_CAPACITY.MAX.MAX),js=c.number().int(E.LAMBDA.MEMORY.INTEGER).min(a1,E.LAMBDA.MEMORY.MIN).max(o1,E.LAMBDA.MEMORY.MAX).refine(e=>e===128||e%64===0,E.LAMBDA.MEMORY.MULTIPLE),q1=c.string().regex(fe.LAMBDA_RUNTIME_IDENTIFIER,E.LAMBDA.RUNTIME),J_=c.number().int(E.CPU.INTEGER).min(256,E.CPU.MIN).max(4096,E.CPU.MAX),mh=c.number().int(E.CAPACITY.DESIRED.INTEGER).min(0,E.CAPACITY.DESIRED.MIN).max(Rs,E.CAPACITY.DESIRED.MAX),dl=c.object({connectToDatabase:c.array(c.string()).optional()}).strict(),T9=c.object({minSize:c.number().int(E.CAPACITY.WARM_POOL.MIN_SIZE.INTEGER).min(0,E.CAPACITY.WARM_POOL.MIN_SIZE.MIN).max(s1,E.CAPACITY.WARM_POOL.MIN_SIZE.MAX).optional(),reuseOnScaleIn:c.boolean().optional()}).strict(),X_=c.object({instanceType:c.string().optional(),amiHardwareType:c.enum(Hf).optional(),minCapacity:c.number().int(E.CAPACITY.MIN.INTEGER).min(0,E.CAPACITY.MIN.MIN_0).max(Rs,E.CAPACITY.MIN.MAX).optional(),maxCapacity:c.number().int(E.CAPACITY.MAX.INTEGER).min(1,E.CAPACITY.MAX.MIN_1).max(Rs,E.CAPACITY.MAX.MAX).optional(),memoryLimitMiB:rl(128).optional(),warmPool:T9.optional(),extraProperties:c.array(St).optional()}).strict().superRefine((e,t)=>{if(!e.instanceType||!e.amiHardwareType)return;let r=lh(e.instanceType,e.amiHardwareType);r.valid||t.addIssue({code:"custom",message:r.message??E.ARCHITECTURE_MISMATCH,path:["instanceType"]})}).superRefine((e,t)=>{e.minCapacity===0&&!e.warmPool&&t.addIssue({code:"custom",message:E.CAPACITY.WARM_POOL_REQUIRED,path:["minCapacity"]}),e.warmPool?.minSize!==void 0&&e.maxCapacity!==void 0&&e.warmPool.minSize>e.maxCapacity&&t.addIssue({code:"custom",message:E.CAPACITY.WARM_POOL.MIN_SIZE_EXCEEDS_MAX_CAPACITY,path:["warmPool","minSize"]})}),C9=c.enum(Xu).describe(`Compute type must be one of: ${Xu.join(", ")}`),Y_=c.enum(Ns).describe(`ECS capacity provider must be one of: ${Ns.join(", ")}`),Q_=c.string().refine(e=>Ut(Jf,e),{message:E.INSTANCE_TYPE}),H1=c.object({sourceType:c.enum(["sqs","dynamodb","eventbridge"]),sourceRef:c.string().describe("Name of the source resource"),batchSize:c.number().int(E.BATCH_SIZE.INTEGER).min(1,E.BATCH_SIZE.MIN).max(1e4,E.BATCH_SIZE.MAX).optional(),startingPosition:c.enum(["TRIM_HORIZON","LATEST"]).optional(),maxBatchingWindow:c.number().int(E.BATCHING_WINDOW.INTEGER).min(0,E.BATCHING_WINDOW.MIN).max(300,E.BATCHING_WINDOW.MAX).optional(),reportBatchItemFailures:c.boolean().optional()}).strict(),I9=c.object({name:c.string().min(1,E.REQUIRED.CONTAINER_NAME).optional(),image:c.string().optional(),port:Fa.optional(),environment:$s.optional(),secretsImport:f1.optional(),command:c.array(c.string()).optional(),entryPoint:c.array(c.string()).optional(),essential:c.boolean().optional(),healthCheck:c.object({command:c.array(c.string()),interval:c.number().int(E.HEALTH_CHECK.INTERVAL.INTEGER).min(5,E.HEALTH_CHECK.INTERVAL.MIN).max(300,E.HEALTH_CHECK.INTERVAL.MAX).optional(),timeout:c.number().int(E.HEALTH_CHECK.TIMEOUT.INTEGER).min(2,E.HEALTH_CHECK.TIMEOUT.MIN).max(60,E.HEALTH_CHECK.TIMEOUT.MAX).optional(),retries:c.number().int(E.HEALTH_CHECK.RETRIES.INTEGER).min(1,E.HEALTH_CHECK.RETRIES.MIN).max(10,E.HEALTH_CHECK.RETRIES.MAX).optional(),startPeriod:c.number().int(E.HEALTH_CHECK.START_PERIOD.INTEGER).min(0,E.HEALTH_CHECK.START_PERIOD.MIN).max(300,E.HEALTH_CHECK.START_PERIOD.MAX).optional()}).strict().optional(),ssmSecrets:c.array(c.string().regex(fe.SECRET_NAME,E.SECRET_NAME)).optional(),extraProperties:c.array(St).optional()}).strict(),J1=c.string().min(1,E.REQUIRED.SERVICE_NAME).max(255,E.MAX_LENGTH.SERVICE_NAME).regex(fe.ECS_SERVICE_NAME,E.ECS_SERVICE_NAME),X1=c.object({domain:c.string().optional(),loadBalancer:c.union([c.literal(!1),c.enum(Zf)]).optional(),directAccess:c.boolean().optional(),extraProperties:c.array(St).optional()}).strict().refine(e=>!(e.directAccess&&e.domain),{message:E.DIRECT_ACCESS.NO_DOMAIN,path:["directAccess"]}).refine(e=>!(e.directAccess&&typeof e.loadBalancer=="string"),{message:E.DIRECT_ACCESS.NO_LOAD_BALANCER}).describe("Cluster-level configuration"),ph=c.object({path:c.string().optional(),host:c.string().optional(),priority:c.number().int(E.PRIORITY.INTEGER).min(1,E.PRIORITY.MIN).max(5e4,E.PRIORITY.MAX).optional(),healthCheckPath:c.string().optional()}).strict().describe("Path/host-based routing configuration"),D9=c.object({desiredCount:mh.optional(),minCapacity:c.number().int(E.CAPACITY.MIN.INTEGER).min(0,E.CAPACITY.MIN.MIN_0).max(Rs,E.CAPACITY.MIN.MAX).optional(),maxCapacity:c.number().int(E.CAPACITY.MAX.INTEGER).min(1,E.CAPACITY.MAX.MIN_1).max(Rs,E.CAPACITY.MAX.MAX).optional(),scalingType:c.enum(qf).optional()}).strict().refine(Ma.check,Ma.params).describe("ECS service scaling configuration"),Y1=c.object({name:J1,docker:pn.optional(),needsDatabaseConnection:c.boolean().optional(),needsStorageConnection:c.boolean().optional(),needsMessagingConnection:c.boolean().optional(),image:c.string().optional(),containers:c.array(I9).optional(),routing:c.union([ph,c.array(ph).min(1)]).optional(),serviceType:c.enum(el).optional(),cpu:J_.optional(),memoryLimitMiB:rl(512).optional(),desiredCount:mh.optional(),scaling:zt(D9).optional(),capacityProvider:Y_,ec2Config:X_.optional(),ssmSecretsPath:c.string().regex(fe.SSM_PATH,E.SSM_PATH).optional(),extraProperties:c.array(St).optional(),alarms:v1.optional()}).strict().superRefine((e,t)=>{W1(e)||t.addIssue({code:"custom",path:["docker"],message:E.IMAGE_DOCKER_MUTEX})}).describe("Configuration for a service in an ECS cluster"),pl=c.object({name:be,type:C9,needsConnection:c.boolean(),connectedDatabase:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),connectedStorage:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),connectedMessaging:c.array(c.string().min(1,E.REQUIRED.CONNECTED_RESOURCE_NAME)).optional(),cluster:X1.optional(),services:c.array(Y1).optional(),docker:pn.partial().optional(),deployment:c.enum(Gf).optional(),codePath:c.string().optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(Xf,E.LAMBDA.TIMEOUT.MIN).max(Yf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:js.optional(),handler:c.string().optional(),runtime:q1.optional(),environment:$s.optional(),secrets:$s.optional(),eventSources:c.array(H1).optional(),functionUrl:c.object({authType:c.enum(Qu)}).strict().optional(),description:c.string().optional(),scheduleExpression:c.string().optional(),scheduleStackPlacement:c.enum(ja).optional(),architecture:c.enum(Kf).optional(),ephemeralStorageSize:c.number().int(E.EPHEMERAL_STORAGE.INTEGER).min(512,E.EPHEMERAL_STORAGE.MIN).max(10240,E.EPHEMERAL_STORAGE.MAX).optional(),functionName:c.string().optional(),ssmSecrets:c.array(c.string()).optional(),ssmSecretsPath:c.string().optional(),alarms:S1.optional(),instanceType:Q_.optional(),enableSSH:c.boolean().optional(),keyName:c.string().optional(),userData:c.string().optional(),securityGroups:c.array(c.string()).optional(),variableName:c.string().optional(),extraProperties:c.array(St).optional()}).strict().superRefine((e,t)=>{if(e.type==="ecs"&&e.services)for(let r=0;r<e.services.length;r++){let i=e.services[r];i?.ec2Config?.instanceType&&!i.ec2Config.amiHardwareType&&Li(i.ec2Config.instanceType)!=="ARM"&&t.addIssue({code:"custom",message:`Service '${i.name??r}' uses instance type '${i.ec2Config.instanceType}' (x86), which requires Docker images built for linux/amd64. The default build targets linux/arm64 (Graviton). Use a Graviton instance type (t4g, c6g, r6g, m6g, etc.) or set amiHardwareType: "STANDARD" to acknowledge x86.`,path:["services",r,"ec2Config","instanceType"]})}e.type==="lambda"&&e.deployment==="container"&&e.architecture==="X86_64"&&t.addIssue({code:"custom",message:"Lambda architecture 'X86_64' requires Docker images built for linux/amd64, but the default build targets linux/arm64. Use 'ARM_64' for Graviton Lambdas (recommended) or ensure your build pipeline targets linux/amd64.",path:["architecture"]})}),gye=c.object({appName:ut,clusterName:be,containerPort:Fa,nameProvidedByFlag:c.boolean().optional(),ecrRepository:c.string().optional(),capacityProvider:Y_.optional(),useAppEcr:c.boolean().optional(),desiredCount:mh.optional(),cpu:J_.optional(),memoryLimitMiB:rl(512).optional(),minCapacity:K1.optional(),maxCapacity:Z1.optional(),ec2Config:X_.optional(),connectionConfig:dl.optional()}).strict().refine(Ma.check,Ma.params),yye=c.object({appName:ut,functionName:be,nameProvidedByFlag:c.boolean().optional(),lambdaType:c.enum(["basic","web","custom"]).optional(),ecrRepository:c.string().optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(Xf,E.LAMBDA.TIMEOUT.MIN).max(Yf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:js.optional(),enableFunctionUrl:c.boolean().optional(),description:c.string().optional(),enableCors:c.boolean().optional(),corsOrigins:c.string().optional(),corsHeaders:c.string().optional(),corsMethods:c.array(c.enum(u1)).optional(),corsCredentials:c.boolean().optional(),connectionConfig:dl.optional()}).strict(),vye=c.object({appName:ut,instanceName:be,nameProvidedByFlag:c.boolean().optional(),instanceType:Q_.optional(),enableSSH:c.boolean().optional(),minCapacity:K1.optional(),maxCapacity:Z1.optional(),connectionConfig:dl.optional()}).strict().refine(Ma.check,Ma.params),bye=c.object({appName:ut,clusterName:be,serviceName:J1,capacityProvider:Y_,containerPort:Fa.optional(),cpu:J_.optional(),memoryLimitMiB:rl(512).optional(),desiredCount:mh.optional(),ec2Config:X_.optional(),routing:c.union([ph,c.array(ph).min(1)]).optional(),docker:pn.partial().optional(),nameProvidedByFlag:c.boolean().optional(),connectionConfig:dl.optional()}).strict(),e0=c.object({appName:ut,computeName:be,nameProvidedByFlag:c.boolean().optional(),connectionConfig:dl.optional()}).strict(),w9=e0.extend({type:c.literal("ecs"),cluster:X1.optional(),services:c.array(Y1).min(1,E.SERVICE.MIN_REQUIRED),docker:pn.partial().optional()}).strict().refine(e=>{let t=e.services.filter(r=>r.containers?.some(i=>i.port));return t.length>1?t.every(r=>(Array.isArray(r.routing)?r.routing:r.routing?[r.routing]:[]).some(i=>i.path||i.host)):!0},{message:E.SERVICE.ROUTING_REQUIRED}).refine(e=>{let t=e.services.map(r=>r.name);return new Set(t).size===t.length},{message:E.SERVICE.UNIQUE_WITHIN_CLUSTER}),k9=e0.extend({type:c.literal("lambda"),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(Xf,E.LAMBDA.TIMEOUT.MIN).max(Yf,E.LAMBDA.TIMEOUT.MAX).optional(),memory:js.optional(),handler:c.string().optional(),runtime:q1.optional(),environment:$s.optional(),secrets:$s.optional(),description:c.string().optional(),functionUrl:c.union([c.object({authType:c.enum(Qu).optional()}).strict(),c.literal(!1)]).optional(),eventSources:c.array(H1).optional()}).strict(),N9=e0.extend({type:c.literal("ec2"),instanceType:Q_.optional(),enableSSH:c.boolean().optional(),keyName:c.string().optional(),userData:c.string().optional(),securityGroups:c.array(c.string()).optional()}).strict(),Sye=c.discriminatedUnion("type",[w9,k9,N9]),G1=c.object({path:c.string().min(1,E.REQUIRED.ROUTING_PATH),priority:c.number().int(E.PRIORITY.INTEGER).min(1,E.PRIORITY.MIN).max(5e4,E.PRIORITY.MAX).optional()}).strict(),Q1=c.object({name:c.string().min(1,E.REQUIRED.SERVICE_NAME).max(255,E.MAX_LENGTH.SERVICE_NAME).regex(fe.RESOURCE_NAME,E.RESOURCE_NAME),serviceType:c.enum(el).optional(),docker:pn.partial().optional(),containerPort:Fa.optional(),needsDatabaseConnection:c.boolean().optional(),routing:c.union([G1,c.array(G1).min(1)]).optional()}).strict().superRefine((e,t)=>{e.serviceType==="worker"&&(e.containerPort!==void 0&&t.addIssue({code:"custom",path:["containerPort"],message:"Worker services are not reachable inbound; remove containerPort."}),e.routing!==void 0&&t.addIssue({code:"custom",path:["routing"],message:"Worker services have no ALB route; remove routing."}))}),Eye=c.object({appName:ut,instanceType:c.string().optional()}).strict();var t0=c.object({memorySize:js.optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(1,E.LAMBDA.TIMEOUT.MIN).max(900,E.LAMBDA.TIMEOUT.MAX).optional(),ephemeralStorageSize:c.number().int(E.EPHEMERAL_STORAGE.INTEGER).min(512,E.EPHEMERAL_STORAGE.MIN).max(10240,E.EPHEMERAL_STORAGE.MAX).optional()}).strict(),ej=c.object({type:c.enum(M_).optional(),databaseName:c.string().optional(),databaseEngine:c.enum(Ps).optional(),deletionProtection:c.boolean().optional(),backupRetention:La.optional(),port:rh.optional(),publiclyAccessible:c.boolean().optional(),allowedIpCidr:c.string().optional(),instanceType:c.string().optional(),allocatedStorage:c.number().int(E.ALLOCATED_STORAGE.INTEGER).min(20,E.ALLOCATED_STORAGE.MIN).max(65536,E.ALLOCATED_STORAGE.MAX).optional(),multiAz:c.boolean().optional(),readReplica:ah.optional(),writer:al.optional(),readers:ol.optional(),allowVpcAccess:c.boolean().optional(),monitoringInterval:il.optional(),preferredMaintenanceWindow:c.string().optional(),databaseInsights:oh.optional(),proxy:ih.optional(),credentials:nh.optional(),encryption:sh.optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()}).strict(),tj=c.object({server:t0.optional(),imageOptimisation:t0.optional(),revalidation:t0.optional()}).strict(),r0=c.object({versioned:c.boolean().optional()}).strict(),rj=c.object({assets:r0.optional(),cache:r0.optional(),media:r0.optional()}).strict(),P9=c.object({visibilityTimeout:c.number().int(E.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,E.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,E.SQS.VISIBILITY_TIMEOUT.MAX).optional(),messageRetentionPeriod:c.number().int(E.SQS.RETENTION_PERIOD.INTEGER).min(60,E.SQS.RETENTION_PERIOD.MIN).max(1209600,E.SQS.RETENTION_PERIOD.MAX).optional(),maxMessageSize:c.number().int(E.MAX_MESSAGE_SIZE.INTEGER).min(1024,E.MAX_MESSAGE_SIZE.MIN).max(262144,E.MAX_MESSAGE_SIZE.MAX).optional(),deadLetterQueue:c.union([c.literal(!1),c.object({enabled:c.boolean().optional(),maxReceiveCount:c.number().int(E.DLQ.MAX_RECEIVE_COUNT.INTEGER).min(1,E.DLQ.MAX_RECEIVE_COUNT.MIN).max(1e3,E.DLQ.MAX_RECEIVE_COUNT.MAX).optional()}).strict()]).optional()}).strict(),nj=c.object({revalidationQueue:P9.optional()}).strict(),ij=c.object({domainNames:c.array(c.string()).optional(),certificateArn:c.string().optional()}).strict(),aj=c.record(c.string().regex(fe.ENV_VAR_NAME,E.ENV_VAR_NAME),c.string()).optional(),n0=c.object({type:c.literal("payload"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),domain:c.string().optional(),database:ej.optional(),compute:tj.optional(),storage:rj.optional(),messaging:nj.optional(),cdn:ij.optional(),environment:aj}).strict(),i0=c.object({type:c.literal("nextjs"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),domain:c.string().optional(),database:ej.optional(),compute:tj.optional(),storage:rj.optional(),messaging:nj.optional(),cdn:ij.optional(),environment:aj}).strict(),a0=c.enum(Du),R9=c.object({command:c.string().min(1,E.REQUIRED.BUILD_COMMAND),outputDir:c.string().min(1,E.REQUIRED.OUTPUT_DIR)}).strict(),O9=c.object({maxAgeDays:c.number().optional(),includeSubdomains:c.boolean().optional(),preload:c.boolean().optional()}).strict(),$9=c.object({headers:c.boolean().optional(),contentSecurityPolicy:c.string().optional(),hsts:c.union([c.literal(!1),O9]).optional()}).strict(),j9=c.object({to:c.string().min(1,E.REQUIRED.FORMS_TO).regex(fe.EMAIL,E.EMAIL),from:c.string().regex(fe.EMAIL,E.EMAIL).optional(),corsOrigin:c.string().regex(fe.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),maxConcurrency:c.number().int().min(1).max(100).optional()}).strict(),M9=c.object({behaviours:c.array(c.unknown()).optional(),priceClass:c.enum(wu).optional(),invalidateOnDeploy:c.boolean().optional()}).strict(),F9=c.object({type:c.literal("basic-auth"),username:c.string().min(1,"accessGate.username must not be empty"),password:c.string().min(1,"accessGate.password must not be empty")}).strict(),ml=c.object({type:c.literal("staticsite"),name:c.string().min(1,E.REQUIRED.PATTERN_NAME),source:c.string().min(1,E.REQUIRED.SOURCE),build:R9,routing:a0.optional(),security:$9.optional(),domain:c.string().optional(),zoneName:c.string().optional(),hostedZoneId:c.string().optional(),forms:j9.optional(),cdn:M9.optional(),accessGate:F9.optional()}).strict().superRefine((e,t)=>{if(e.forms===void 0)return;let r=e.domain;if(r===void 0||r===""){t.addIssue({code:"custom",path:["domain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"});return}let i=e.forms.from;i!==void 0&&!uf(i,r)&&t.addIssue({code:"custom",path:["forms","from"],message:`forms.from must be an address at ${r} (the verified SES identity) \u2014 for example noreply@${r}. Use forms.to for the recipient.`})}),fl=c.discriminatedUnion("type",[n0,i0,ml]),oj=c.enum(["lightweight","standard","resilient","custom"]),sj=c.object({type:c.enum(M_),instanceType:c.string().optional(),backupRetention:La.optional(),deletionProtection:c.boolean().optional(),encryption:c.union([c.object({useCMK:c.literal(!0)}).strict(),c.literal(!1)]).optional()}).strict(),cj=c.object({memorySize:js.optional(),timeout:c.number().int(E.LAMBDA.TIMEOUT.INTEGER).min(1,E.LAMBDA.TIMEOUT.MIN).max(900,E.LAMBDA.TIMEOUT.MAX).optional()}).strict();var uj=c.object({appName:ut,type:U_,pattern:z_.optional(),patternConfig:fl.optional(),owner:c.string().optional(),tags:c.record(c.string(),c.string()).optional(),vpcId:c.string().optional(),network:Ua.optional(),backup:g1.optional(),tunnel:y1.optional(),additionalNetworks:c.array(M1).optional(),database:c.array(sl),s3:c.array(cl),compute:c.array(pl),dynamodb:c.array(N1).optional(),clickhouse:c.array(P1).optional(),sqs:c.array(ul).optional(),cdn:ll.optional(),customCodeBlocks:c.array(h1).optional(),additionalManagedImports:c.array(c.object({moduleSpecifier:c.string(),namedImports:c.array(c.string()),defaultImport:c.string().optional()}).strict()).optional()}).strict(),zye=c.object({name:ut,type:U_,pattern:z_.optional(),patternTier:oj.optional(),patternDomain:c.string().optional(),source:c.string().min(1,E.REQUIRED.SOURCE).optional(),buildCommand:c.string().min(1,E.REQUIRED.BUILD_COMMAND).optional(),outputDir:c.string().min(1,E.REQUIRED.OUTPUT_DIR).optional(),routing:a0.optional(),formsTo:c.string().min(1,E.REQUIRED.FORMS_TO).regex(fe.EMAIL,E.EMAIL).optional(),corsOrigin:c.string().regex(fe.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),customDatabase:sj.optional(),customCompute:cj.optional(),region:c.string().optional(),owner:c.string().optional(),includeDatabase:c.boolean().optional(),databaseName:c.string().min(1,E.DATABASE.NAME.REQUIRED).max(63,E.DATABASE.NAME.MAX_LENGTH).optional(),vpcId:c.string().optional(),network:F1.optional(),services:c.array(Q1).optional(),snapshotIdentifier:c.string().optional(),snapshotUsername:c.string().optional()}).strict().superRefine((e,t)=>{e.formsTo!==void 0&&(e.patternDomain!==void 0&&e.patternDomain!==""||t.addIssue({code:"custom",path:["patternDomain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"}))}),o0=c.object({name:be,localResource:c.string().min(1),remoteApp:c.string().min(1),remoteResource:c.string().min(1),permission:c.enum(["read","write","read-write"]),remoteArn:c.string().optional()}).strict();var L9=["fjall-managed","external","external-manual"],Kye=c.enum(L9);var lj=c.object({givenName:c.string().min(1),familyName:c.string().min(1),displayName:c.string().min(1).optional(),expires:c.string().min(1).optional()}).strict(),dj=c.object({name:c.string().min(1),path:c.string().min(1).optional()}).strict(),U9=c.union([c.object({managedPolicyArn:c.string().min(1)}).strict(),c.object({customerManagedPolicy:dj}).strict()]),z9=c.object({managedPolicies:c.array(c.string().min(1)).optional(),inlinePolicy:c.record(c.string(),c.unknown()).optional(),customerManagedPolicies:c.array(dj).optional(),permissionsBoundary:U9.optional(),sessionDuration:c.string().min(1).optional(),description:c.string().optional(),accounts:c.union([c.array(c.string().min(1)),c.literal("all")]).optional(),includeManagementAccount:c.boolean().optional(),groups:c.array(c.string().min(1)).optional()}).strict(),B9=c.object({description:c.string().optional()}).strict(),fh=c.string().regex(fe.EMAIL,E.EMAIL),s0={groups:c.record(c.string(),B9).optional(),permissionSets:c.record(c.string(),z9).optional(),memberships:c.record(c.string(),c.array(fh)).optional(),resolutionVersion:c.number().int().min(1).optional(),defaultPermissionSets:c.boolean().optional()},V9=c.discriminatedUnion("source",[c.object({...s0,source:c.literal("fjall-managed"),users:c.record(fh,lj)}).strict(),c.object({...s0,source:c.literal("external")}).strict(),c.object({...s0,source:c.literal("external-manual"),users:c.record(fh,lj).optional()}).strict()]),c0=c.object({name:be,type:c.literal("organisation").optional(),organisationName:c.string().min(1).optional(),orgEmail:fh.optional(),accounts:c.unknown().optional(),accountIds:c.record(c.string(),c.string()).optional(),identityCentre:c.union([V9,c.literal(!1)]).optional(),allowedRegions:c.array(c.string().min(1)).optional()}).strict();var G9=Object.defineProperty,W9=(e,t)=>G9(e,"name",{value:t,configurable:!0}),K9=[1,3,5,7,14,30,60,90,120,150,180,365,400,545,731,1827,3653],hh=c.object({buildkiteQueue:c.string().min(1,"buildkiteQueue cannot be empty").max(100).regex(/^[a-zA-Z0-9-_]+$/,"buildkiteQueue must be alphanumeric with hyphens/underscores"),buildkiteOrgSlug:c.string().min(1,"buildkiteOrgSlug cannot be empty").max(100).regex(/^[a-z0-9-]+$/,"buildkiteOrgSlug must be a lowercase Buildkite organisation slug"),agentTokenSsmParameterName:c.string().min(2).regex(/^\//,"agentTokenSsmParameterName must be a full path (leading /)").optional(),agentTokenKmsKeyArn:c.string().min(1).optional(),fjallApiKeySsmParameterName:c.string().min(2).regex(/^\//,"fjallApiKeySsmParameterName must be a full path (leading /)").optional(),instanceType:c.string().min(1).default("c8g.xlarge"),agentVolumeSizeGib:c.number().int().min(20).max(1e3).default(250),agentMinInstances:c.number().int().min(0).default(0),agentMaxInstances:c.number().int().min(1).default(2),agentsPerInstance:c.number().int().min(1).default(1),spotCapacityPercentage:c.number().int().min(0).max(100).default(0),scaleInIdlePeriodSeconds:c.number().int().min(60).default(600),disconnectAfterUptimeSeconds:c.number().int().min(3600).default(86400),maxInstanceLifetimeDays:c.number().int().min(1).max(365).default(7),terminateInstanceAfterJob:c.boolean().default(!1),purgeBuildsOnDiskFull:c.boolean().default(!0),terminateInstanceOnDiskFull:c.boolean().default(!1),logRetentionDays:c.number().int().min(1).default(30),agentLogRetentionDays:c.literal(K9).default(7),buildkiteAgentRelease:c.enum(["stable","beta","edge"]).default("stable"),buildkiteAgentTags:c.string().default(""),buildkiteAgentTimestampLines:c.boolean().default(!1),buildkiteAgentExperiments:c.string().default(""),buildkiteAgentTracingBackend:c.enum(["","datadog","opentelemetry"]).default(""),buildkiteAgentCancelGracePeriodSeconds:c.number().int().min(10).default(60),enableSecretsPlugin:c.boolean().default(!0),enableEcrPlugin:c.boolean().default(!1),enableDockerLoginPlugin:c.boolean().default(!1),enableDockerUserNamespaceRemap:c.boolean().default(!0),enableDockerExperimental:c.boolean().default(!1),dockerNetworkingProtocol:c.enum(["ipv4","dualstack"]).default("ipv4"),enableInstanceStorage:c.boolean().default(!1),mountTmpfsAtTmp:c.boolean().default(!0),buildkiteAgentEnableGitMirrors:c.boolean().default(!1),bootstrapScriptUrl:c.string().default(""),agentEnvFileUrl:c.string().default(""),scalerEventSchedulePeriod:c.string().min(1).default("1 minute"),scalerMinPollInterval:c.string().min(1).default("10s"),scaleOutFactor:c.string().min(1).default("1.0"),scaleOutWaitingForJobs:c.boolean().default(!1),rolePermissionsBoundaryArn:c.string().min(1).optional(),alarmSnsTopicArn:c.string().min(1).optional(),applicationId:c.string().min(1).optional(),costAllocationEnvironment:c.string().min(1).optional(),costAllocationOwner:c.string().min(1).optional()}).strict(),Z9=hh.refine(e=>e.agentMinInstances<=e.agentMaxInstances,{message:"agentMinInstances must be <= agentMaxInstances"});function q9(e){let t=Z9.safeParse(e);if(!t.success){let r=t.error.issues.map(i=>` - ${i.path.join(".")||"(root)"}: ${i.message}`).join(`
|
|
356
356
|
`);throw new Error(`Buildkite: invalid props:
|
|
357
|
-
${r}`)}return t.data}W9(q9,"validateBuildkiteProps");var H9=Object.defineProperty,J9=(e,t)=>H9(e,"name",{value:t,configurable:!0});function X9(e){return`FjallDeployBoundary${e}`}J9(X9,"deployBoundaryName");var u0={Sid:"FjallInheritAdministratorAccess",Effect:"Allow",Action:"*",Resource:"*"},pj=[{Sid:"FjallDenyOrgAndAccountEscape",Effect:"Deny",Action:["organizations:LeaveOrganization","account:CloseAccount"],Resource:"*"},{Sid:"FjallDenyDisableAuditLogging",Effect:"Deny",Action:["cloudtrail:StopLogging"],Resource:"*"},{Sid:"FjallDenyBoundarySelfEscape",Effect:"Deny",Action:["iam:DeleteRolePermissionsBoundary"],Resource:"*"},{Sid:"FjallDenyDisableKmsKey",Effect:"Deny",Action:["kms:DisableKey"],Resource:"*"}],mj=[...pj,{Sid:"FjallDenyStandingHumanCredentials",Effect:"Deny",Action:["iam:CreateUser","iam:CreateLoginProfile","iam:CreateAccessKey","iam:CreateAccountAlias"],Resource:"*"},{Sid:"FjallDenyDisableConfigRecorder",Effect:"Deny",Action:["config:StopConfigurationRecorder"],Resource:"*"}],Y9=[...mj,{Sid:"FjallDenyAccountPasswordPolicyTamper",Effect:"Deny",Action:["iam:UpdateAccountPasswordPolicy","iam:DeleteAccountPasswordPolicy"],Resource:"*"},{Sid:"FjallDenyDisableDefaultEbsEncryption",Effect:"Deny",Action:["ec2:DisableEbsEncryptionByDefault"],Resource:"*"}],sve={foundation:[u0,...pj],compliance:[u0,...mj],hardened:[u0,...Y9]};var Q9=Object.defineProperty,lt=(e,t)=>Q9(e,"name",{value:t,configurable:!0});var p0="sts.amazonaws.com";function e8(e){return`FjallDevDeploy${e}`}lt(e8,"devDeployRoleName");function t8(e){return`FjallDevProvisioner${e}`}lt(t8,"devProvisionerRoleName");function r8(e){return`FjallDevSyncWriter${e}`}lt(r8,"devSyncWriterRoleName");var n8="FjallDevBoundary";function fj(e){return`arn:aws:iam::${e}:policy/${n8}`}lt(fj,"devBoundaryPolicyArn");function hj(e){return`org:${e}:dev-provisioner`}lt(hj,"devProvisionerSubject");function gj(e){return`org:${e}:dev-sync`}lt(gj,"devSyncSubject");function l0(e,t){return`org:${e}:acct:${t}`}lt(l0,"deployAccountSubject");function d0(e){return`org:${e}:*`}lt(d0,"genericMachineSubject");var i8=["discovery","connection","org-setup","dev-substrate-setup"];function yj(e,t){return`org:${e}:${t}`}lt(yj,"serviceSubject");function a8(e){let{fjallOrgId:t,providerArn:r,issuerDomain:i,accountTier:n,accountId:a}=e,o=e.machineTrustMode??"expanded",s={[`${i}:aud`]:p0},u;if(o==="account-scoped"){if(n===void 0||!Jm(n)||a===void 0)throw new Error(`machineTrustMode "account-scoped" requires a governance accountTier and an accountId (got tier: ${String(n)}, accountId ${a===void 0?"absent":"present"}) \u2014 refusing to fall back to the generic machine subject: a silent fallback would re-widen the trust the \xA74.4a Step-3 contract removes`);u=[l0(t,a)]}else a!==void 0?u=[d0(t),l0(t,a)]:u=d0(t);return[{Sid:"FjallMachineSubject",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${i}:sub`]:u}}},{Sid:"FjallUserSubjects",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:s,StringLike:{[`${i}:sub`]:`org:${t}:user:*`}}},{Sid:"FjallServiceSubjects",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${i}:sub`]:i8.map(d=>yj(t,d))}}}]}lt(a8,"buildNarrowedDeployTrustStatements");function o8(e){let{fjallOrgId:t,providerArn:r,issuerDomain:i,accountId:n}=e;return[{Sid:"FjallDevSubjectsThisAccount",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${i}:aud`]:p0},StringLike:{[`${i}:sub`]:`org:${t}:dev:${n}:*`}}}]}lt(o8,"buildDevDeployTrustStatements");function m0(e){let{providerArn:t,issuerDomain:r,sid:i,subject:n}=e;return[{Sid:i,Effect:"Allow",Principal:{Federated:t},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${r}:aud`]:p0,[`${r}:sub`]:n}}}]}lt(m0,"buildServiceSubjectTrustStatements");function s8(e){return m0({...e,sid:"FjallDevProvisionerSubject",subject:hj(e.fjallOrgId)})}lt(s8,"buildDevProvisionerTrustStatements");function c8(e){return m0({...e,sid:"FjallDevSyncSubject",subject:gj(e.fjallOrgId)})}lt(c8,"buildDevSyncWriterTrustStatements");function u8({accountId:e}){return[{Sid:"FjallDevEcsTaggedMutations",Effect:"Allow",Action:["ecs:UpdateService","ecs:DeleteService","ecs:RunTask","ecs:StopTask"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTaggedCreates",Effect:"Allow",Action:["ecs:RegisterTaskDefinition","ecs:CreateService"],Resource:"*",Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTagOnCreate",Effect:"Allow",Action:["ecs:TagResource"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"ecs:CreateAction":["RegisterTaskDefinition","CreateService","RunTask"]}}},{Sid:"FjallDevEcsReads",Effect:"Allow",Action:["ecs:Describe*","ecs:List*"],Resource:"*"},{Sid:"FjallDevEcsDeregisterTaskDefinition",Effect:"Allow",Action:["ecs:DeregisterTaskDefinition"],Resource:`arn:aws:ecs:*:${e}:task-definition/fjall-dev-*`},{Sid:"FjallDevElbTaggedMutations",Effect:"Allow",Action:["elasticloadbalancing:ModifyRule","elasticloadbalancing:DeleteRule","elasticloadbalancing:ModifyTargetGroup","elasticloadbalancing:ModifyTargetGroupAttributes","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:RegisterTargets","elasticloadbalancing:DeregisterTargets"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTaggedCreates",Effect:"Allow",Action:["elasticloadbalancing:CreateTargetGroup","elasticloadbalancing:CreateRule"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTagOnCreate",Effect:"Allow",Action:["elasticloadbalancing:AddTags"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"elasticloadbalancing:CreateAction":["CreateTargetGroup","CreateRule"]}}},{Sid:"FjallDevElbReads",Effect:"Allow",Action:["elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevSsmDevTree",Effect:"Allow",Action:["ssm:GetParameter*","ssm:PutParameter","ssm:AddTagsToResource"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevLogsMutations",Effect:"Allow",Action:["logs:PutRetentionPolicy","logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsTaggedCreate",Effect:"Allow",Action:["logs:CreateLogGroup","logs:TagResource"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevLogsRead",Effect:"Allow",Action:["logs:GetLogEvents","logs:DescribeLogStreams","logs:FilterLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsDescribeGroups",Effect:"Allow",Action:["logs:DescribeLogGroups"],Resource:"*"},{Sid:"FjallDevKmsViaDevAlias",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevKmsSsmSecureString",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}},{Sid:"FjallDevEcrAuthToken",Effect:"Allow",Action:["ecr:GetAuthorizationToken"],Resource:"*"},{Sid:"FjallDevEcrPushPull",Effect:"Allow",Action:["ecr:PutImage","ecr:InitiateLayerUpload","ecr:UploadLayerPart","ecr:CompleteLayerUpload","ecr:BatchCheckLayerAvailability","ecr:BatchGetImage","ecr:GetDownloadUrlForLayer","ecr:DescribeImages"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevPassDevPathRoles",Effect:"Allow",Action:["iam:PassRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`}]}lt(u8,"buildDevDeployPolicyStatements");function l8({accountId:e}){return[{Sid:"FjallDevProvisionerBoundedRoleWrites",Effect:"Allow",Action:["iam:CreateRole","iam:PutRolePolicy","iam:AttachRolePolicy"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`,Condition:{StringEquals:{"iam:PermissionsBoundary":fj(e)}}},{Sid:"FjallDevProvisionerPathRoleOps",Effect:"Allow",Action:["iam:DeleteRole","iam:DeleteRolePolicy","iam:DetachRolePolicy","iam:ListRolePolicies","iam:TagRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`},{Sid:"FjallDevProvisionerListRoles",Effect:"Allow",Action:["iam:ListRoles"],Resource:"*"},{Sid:"FjallDevProvisionerDevMasterSecrets",Effect:"Allow",Action:["secretsmanager:GetSecretValue"],Resource:`arn:aws:secretsmanager:*:${e}:secret:fjall-dev-*`},{Sid:"FjallDevProvisionerKmsDecryptViaSecretsManager",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"secretsmanager.*.amazonaws.com"}}},{Sid:"FjallDevProvisionerDataApi",Effect:"Allow",Action:["rds-data:ExecuteStatement","rds-data:BatchExecuteStatement","rds-data:BeginTransaction","rds-data:CommitTransaction","rds-data:RollbackTransaction"],Resource:`arn:aws:rds:*:${e}:cluster:fjall-dev-*`},{Sid:"FjallDevProvisionerMetrics",Effect:"Allow",Action:["cloudwatch:GetMetricData"],Resource:"*"},{Sid:"FjallDevProvisionerOrphanDiscovery",Effect:"Allow",Action:["tag:GetResources"],Resource:"*"},{Sid:"FjallDevProvisionerSsmTeardown",Effect:"Allow",Action:["ssm:DeleteParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevProvisionerLogsTeardown",Effect:"Allow",Action:["logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevProvisionerTaggedTeardown",Effect:"Allow",Action:["ecs:UpdateService","ecs:StopTask","ecs:DeleteService","elasticloadbalancing:DeleteRule","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:DeregisterTargets"],Resource:[`arn:aws:ecs:*:${e}:*`,`arn:aws:elasticloadbalancing:*:${e}:*`],Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevProvisionerTeardownReads",Effect:"Allow",Action:["ecs:Describe*","elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevProvisionerImageJanitor",Effect:"Allow",Action:["ecr:ListImages","ecr:DescribeImages","ecr:BatchDeleteImage"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevProvisionerSsmReadAll",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/*`},{Sid:"FjallDevProvisionerKmsDecryptViaSsm",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}}]}lt(l8,"buildDevProvisionerPolicyStatements");function d8({accountId:e}){return[{Sid:"FjallDevSyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}}]}lt(d8,"buildDevSyncWriterPolicyStatements");function p8({accountId:e}){return[{Sid:"FjallDevBoundarySsmDevRead",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevBoundaryKmsDecryptDevAlias",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevBoundarySyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}},{Sid:"FjallDevBoundarySlotLogs",Effect:"Allow",Action:["logs:CreateLogStream","logs:PutLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevBoundarySyncQueue",Effect:"Allow",Action:["sqs:ReceiveMessage","sqs:DeleteMessage","sqs:GetQueueUrl"],Resource:`arn:aws:sqs:*:${e}:fjall-dev-sync-${e}-*`}]}lt(p8,"buildDevBoundaryStatements");var m8=Object.defineProperty,er=(e,t)=>m8(e,"name",{value:t,configurable:!0});function H(e){return JSON.stringify(e)}er(H,"escapeStringLiteral");function hl(e){return e.map(H).join(", ")}er(hl,"formatStringArray");var f8="import:SharedAlarmTopicArn";function za(e=" "){return`
|
|
357
|
+
${r}`)}return t.data}W9(q9,"validateBuildkiteProps");var H9=Object.defineProperty,J9=(e,t)=>H9(e,"name",{value:t,configurable:!0});function X9(e){return`FjallDeployBoundary${e}`}J9(X9,"deployBoundaryName");var u0={Sid:"FjallInheritAdministratorAccess",Effect:"Allow",Action:"*",Resource:"*"},pj=[{Sid:"FjallDenyOrgAndAccountEscape",Effect:"Deny",Action:["organizations:LeaveOrganization","account:CloseAccount"],Resource:"*"},{Sid:"FjallDenyDisableAuditLogging",Effect:"Deny",Action:["cloudtrail:StopLogging"],Resource:"*"},{Sid:"FjallDenyBoundarySelfEscape",Effect:"Deny",Action:["iam:DeleteRolePermissionsBoundary"],Resource:"*"},{Sid:"FjallDenyDisableKmsKey",Effect:"Deny",Action:["kms:DisableKey"],Resource:"*"}],mj=[...pj,{Sid:"FjallDenyStandingHumanCredentials",Effect:"Deny",Action:["iam:CreateUser","iam:CreateLoginProfile","iam:CreateAccessKey","iam:CreateAccountAlias"],Resource:"*"},{Sid:"FjallDenyDisableConfigRecorder",Effect:"Deny",Action:["config:StopConfigurationRecorder"],Resource:"*"}],Y9=[...mj,{Sid:"FjallDenyAccountPasswordPolicyTamper",Effect:"Deny",Action:["iam:UpdateAccountPasswordPolicy","iam:DeleteAccountPasswordPolicy"],Resource:"*"},{Sid:"FjallDenyDisableDefaultEbsEncryption",Effect:"Deny",Action:["ec2:DisableEbsEncryptionByDefault"],Resource:"*"}],cve={foundation:[u0,...pj],compliance:[u0,...mj],hardened:[u0,...Y9]};var Q9=Object.defineProperty,lt=(e,t)=>Q9(e,"name",{value:t,configurable:!0});var p0="sts.amazonaws.com";function e8(e){return`FjallDevDeploy${e}`}lt(e8,"devDeployRoleName");function t8(e){return`FjallDevProvisioner${e}`}lt(t8,"devProvisionerRoleName");function r8(e){return`FjallDevSyncWriter${e}`}lt(r8,"devSyncWriterRoleName");var n8="FjallDevBoundary";function fj(e){return`arn:aws:iam::${e}:policy/${n8}`}lt(fj,"devBoundaryPolicyArn");function hj(e){return`org:${e}:dev-provisioner`}lt(hj,"devProvisionerSubject");function gj(e){return`org:${e}:dev-sync`}lt(gj,"devSyncSubject");function l0(e,t){return`org:${e}:acct:${t}`}lt(l0,"deployAccountSubject");function d0(e){return`org:${e}:*`}lt(d0,"genericMachineSubject");var i8=["discovery","connection","org-setup","dev-substrate-setup"];function yj(e,t){return`org:${e}:${t}`}lt(yj,"serviceSubject");function a8(e){let{fjallOrgId:t,providerArn:r,issuerDomain:i,accountTier:n,accountId:a}=e,o=e.machineTrustMode??"expanded",s={[`${i}:aud`]:p0},u;if(o==="account-scoped"){if(n===void 0||!Jm(n)||a===void 0)throw new Error(`machineTrustMode "account-scoped" requires a governance accountTier and an accountId (got tier: ${String(n)}, accountId ${a===void 0?"absent":"present"}) \u2014 refusing to fall back to the generic machine subject: a silent fallback would re-widen the trust the \xA74.4a Step-3 contract removes`);u=[l0(t,a)]}else a!==void 0?u=[d0(t),l0(t,a)]:u=d0(t);return[{Sid:"FjallMachineSubject",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${i}:sub`]:u}}},{Sid:"FjallUserSubjects",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:s,StringLike:{[`${i}:sub`]:`org:${t}:user:*`}}},{Sid:"FjallServiceSubjects",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{...s,[`${i}:sub`]:i8.map(d=>yj(t,d))}}}]}lt(a8,"buildNarrowedDeployTrustStatements");function o8(e){let{fjallOrgId:t,providerArn:r,issuerDomain:i,accountId:n}=e;return[{Sid:"FjallDevSubjectsThisAccount",Effect:"Allow",Principal:{Federated:r},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${i}:aud`]:p0},StringLike:{[`${i}:sub`]:`org:${t}:dev:${n}:*`}}}]}lt(o8,"buildDevDeployTrustStatements");function m0(e){let{providerArn:t,issuerDomain:r,sid:i,subject:n}=e;return[{Sid:i,Effect:"Allow",Principal:{Federated:t},Action:"sts:AssumeRoleWithWebIdentity",Condition:{StringEquals:{[`${r}:aud`]:p0,[`${r}:sub`]:n}}}]}lt(m0,"buildServiceSubjectTrustStatements");function s8(e){return m0({...e,sid:"FjallDevProvisionerSubject",subject:hj(e.fjallOrgId)})}lt(s8,"buildDevProvisionerTrustStatements");function c8(e){return m0({...e,sid:"FjallDevSyncSubject",subject:gj(e.fjallOrgId)})}lt(c8,"buildDevSyncWriterTrustStatements");function u8({accountId:e}){return[{Sid:"FjallDevEcsTaggedMutations",Effect:"Allow",Action:["ecs:UpdateService","ecs:DeleteService","ecs:RunTask","ecs:StopTask"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTaggedCreates",Effect:"Allow",Action:["ecs:RegisterTaskDefinition","ecs:CreateService"],Resource:"*",Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevEcsTagOnCreate",Effect:"Allow",Action:["ecs:TagResource"],Resource:`arn:aws:ecs:*:${e}:*`,Condition:{StringEquals:{"ecs:CreateAction":["RegisterTaskDefinition","CreateService","RunTask"]}}},{Sid:"FjallDevEcsReads",Effect:"Allow",Action:["ecs:Describe*","ecs:List*"],Resource:"*"},{Sid:"FjallDevEcsDeregisterTaskDefinition",Effect:"Allow",Action:["ecs:DeregisterTaskDefinition"],Resource:`arn:aws:ecs:*:${e}:task-definition/fjall-dev-*`},{Sid:"FjallDevElbTaggedMutations",Effect:"Allow",Action:["elasticloadbalancing:ModifyRule","elasticloadbalancing:DeleteRule","elasticloadbalancing:ModifyTargetGroup","elasticloadbalancing:ModifyTargetGroupAttributes","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:RegisterTargets","elasticloadbalancing:DeregisterTargets"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTaggedCreates",Effect:"Allow",Action:["elasticloadbalancing:CreateTargetGroup","elasticloadbalancing:CreateRule"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevElbTagOnCreate",Effect:"Allow",Action:["elasticloadbalancing:AddTags"],Resource:`arn:aws:elasticloadbalancing:*:${e}:*`,Condition:{StringEquals:{"elasticloadbalancing:CreateAction":["CreateTargetGroup","CreateRule"]}}},{Sid:"FjallDevElbReads",Effect:"Allow",Action:["elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevSsmDevTree",Effect:"Allow",Action:["ssm:GetParameter*","ssm:PutParameter","ssm:AddTagsToResource"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevLogsMutations",Effect:"Allow",Action:["logs:PutRetentionPolicy","logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsTaggedCreate",Effect:"Allow",Action:["logs:CreateLogGroup","logs:TagResource"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`,Condition:{StringEquals:{"aws:RequestTag/fjall:dev":"true"}}},{Sid:"FjallDevLogsRead",Effect:"Allow",Action:["logs:GetLogEvents","logs:DescribeLogStreams","logs:FilterLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevLogsDescribeGroups",Effect:"Allow",Action:["logs:DescribeLogGroups"],Resource:"*"},{Sid:"FjallDevKmsViaDevAlias",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevKmsSsmSecureString",Effect:"Allow",Action:["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}},{Sid:"FjallDevEcrAuthToken",Effect:"Allow",Action:["ecr:GetAuthorizationToken"],Resource:"*"},{Sid:"FjallDevEcrPushPull",Effect:"Allow",Action:["ecr:PutImage","ecr:InitiateLayerUpload","ecr:UploadLayerPart","ecr:CompleteLayerUpload","ecr:BatchCheckLayerAvailability","ecr:BatchGetImage","ecr:GetDownloadUrlForLayer","ecr:DescribeImages"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevPassDevPathRoles",Effect:"Allow",Action:["iam:PassRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`}]}lt(u8,"buildDevDeployPolicyStatements");function l8({accountId:e}){return[{Sid:"FjallDevProvisionerBoundedRoleWrites",Effect:"Allow",Action:["iam:CreateRole","iam:PutRolePolicy","iam:AttachRolePolicy"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`,Condition:{StringEquals:{"iam:PermissionsBoundary":fj(e)}}},{Sid:"FjallDevProvisionerPathRoleOps",Effect:"Allow",Action:["iam:DeleteRole","iam:DeleteRolePolicy","iam:DetachRolePolicy","iam:ListRolePolicies","iam:TagRole"],Resource:`arn:aws:iam::${e}:role/fjall/dev/*`},{Sid:"FjallDevProvisionerListRoles",Effect:"Allow",Action:["iam:ListRoles"],Resource:"*"},{Sid:"FjallDevProvisionerDevMasterSecrets",Effect:"Allow",Action:["secretsmanager:GetSecretValue"],Resource:`arn:aws:secretsmanager:*:${e}:secret:fjall-dev-*`},{Sid:"FjallDevProvisionerKmsDecryptViaSecretsManager",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"secretsmanager.*.amazonaws.com"}}},{Sid:"FjallDevProvisionerDataApi",Effect:"Allow",Action:["rds-data:ExecuteStatement","rds-data:BatchExecuteStatement","rds-data:BeginTransaction","rds-data:CommitTransaction","rds-data:RollbackTransaction"],Resource:`arn:aws:rds:*:${e}:cluster:fjall-dev-*`},{Sid:"FjallDevProvisionerMetrics",Effect:"Allow",Action:["cloudwatch:GetMetricData"],Resource:"*"},{Sid:"FjallDevProvisionerOrphanDiscovery",Effect:"Allow",Action:["tag:GetResources"],Resource:"*"},{Sid:"FjallDevProvisionerSsmTeardown",Effect:"Allow",Action:["ssm:DeleteParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevProvisionerLogsTeardown",Effect:"Allow",Action:["logs:DeleteLogGroup"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevProvisionerTaggedTeardown",Effect:"Allow",Action:["ecs:UpdateService","ecs:StopTask","ecs:DeleteService","elasticloadbalancing:DeleteRule","elasticloadbalancing:DeleteTargetGroup","elasticloadbalancing:DeregisterTargets"],Resource:[`arn:aws:ecs:*:${e}:*`,`arn:aws:elasticloadbalancing:*:${e}:*`],Condition:{StringEquals:{"aws:ResourceTag/fjall:dev":"true"}}},{Sid:"FjallDevProvisionerTeardownReads",Effect:"Allow",Action:["ecs:Describe*","elasticloadbalancing:Describe*"],Resource:"*"},{Sid:"FjallDevProvisionerImageJanitor",Effect:"Allow",Action:["ecr:ListImages","ecr:DescribeImages","ecr:BatchDeleteImage"],Resource:`arn:aws:ecr:*:${e}:repository/*`},{Sid:"FjallDevProvisionerSsmReadAll",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/*`},{Sid:"FjallDevProvisionerKmsDecryptViaSsm",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{StringLike:{"kms:ViaService":"ssm.*.amazonaws.com"}}}]}lt(l8,"buildDevProvisionerPolicyStatements");function d8({accountId:e}){return[{Sid:"FjallDevSyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}}]}lt(d8,"buildDevSyncWriterPolicyStatements");function p8({accountId:e}){return[{Sid:"FjallDevBoundarySsmDevRead",Effect:"Allow",Action:["ssm:GetParameter*"],Resource:`arn:aws:ssm:*:${e}:parameter/fjall/dev/*`},{Sid:"FjallDevBoundaryKmsDecryptDevAlias",Effect:"Allow",Action:["kms:Decrypt"],Resource:`arn:aws:kms:*:${e}:key/*`,Condition:{"ForAnyValue:StringLike":{"kms:ResourceAliases":"alias/fjall-dev-*"}}},{Sid:"FjallDevBoundarySyncPrefixReadWrite",Effect:"Allow",Action:["s3:GetObject","s3:PutObject"],Resource:`arn:aws:s3:::fjall-dev-sync-${e}-*/*`,Condition:{StringEquals:{"aws:ResourceAccount":e}}},{Sid:"FjallDevBoundarySlotLogs",Effect:"Allow",Action:["logs:CreateLogStream","logs:PutLogEvents"],Resource:`arn:aws:logs:*:${e}:log-group:/fjall/dev/*`},{Sid:"FjallDevBoundarySyncQueue",Effect:"Allow",Action:["sqs:ReceiveMessage","sqs:DeleteMessage","sqs:GetQueueUrl"],Resource:`arn:aws:sqs:*:${e}:fjall-dev-sync-${e}-*`}]}lt(p8,"buildDevBoundaryStatements");var m8=Object.defineProperty,er=(e,t)=>m8(e,"name",{value:t,configurable:!0});function H(e){return JSON.stringify(e)}er(H,"escapeStringLiteral");function hl(e){return e.map(H).join(", ")}er(hl,"formatStringArray");var f8="import:SharedAlarmTopicArn";function za(e=" "){return`
|
|
358
358
|
${e}...(getConfig().environment === "production" ? { alertsTopic: ${H(f8)} } : {}),`}er(za,"emitProductionAlertsTopicSpread");function Qn(e){return e===0?"":`_${String(e+1)}`}er(Qn,"connectionEnvSuffix");function h8(e,t){if(e===t)return 1;if(!e.startsWith(`${t}_`))return;let r=e.slice(t.length+1);return/^\d+$/.test(r)?parseInt(r,10):void 0}er(h8,"connectionKeyOrdinal");function f0(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.__identifier=="string"||typeof t.__expression=="string"||typeof t.__call=="string"}er(f0,"isSpecialValue");function Er(e){return e.replace(/[^a-zA-Z0-9]/g," ").split(" ").map((t,r)=>r===0?t.charAt(0).toLowerCase()+t.slice(1):t.charAt(0).toUpperCase()+t.slice(1)).join("")}er(Er,"toVariableName");function ke(e){return e.variableName??Er(e.name)}er(ke,"getVariableName");function gl(e,t){for(let r of e.database)if(r.name===t&&r.variableName)return r.variableName;for(let r of e.s3)if(r.name===t&&r.variableName)return r.variableName;for(let r of e.compute)if(r.name===t&&r.variableName)return r.variableName;for(let r of e.dynamodb??[])if(r.name===t&&r.variableName)return r.variableName;for(let r of e.sqs??[])if(r.name===t&&r.variableName)return r.variableName;return Er(t)}er(gl,"resolveResourceVariable");function vj(e){let t=Object.entries(e);return t.length===0?!0:t.length>1?!1:t.every(([,r])=>typeof r=="string"||typeof r=="number"||typeof r=="boolean"||r===null)}er(vj,"isSimpleObject");function xe(e,t=" "){if(e==null)return"undefined";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(f0(e)){if("__identifier"in e)return e.__identifier;if("__expression"in e)return e.__expression;if("__call"in e)return e.__call}if(Array.isArray(e))return`[${e.map(r=>xe(r,t)).join(", ")}]`;if(typeof e=="object"){let r=Object.entries(e).filter(([,a])=>a!==void 0);if(vj(e)){let a=r.map(([o,s])=>`${o}: ${xe(s,t)}`).join(", ");return a?`{ ${a} }`:"{}"}let i=t+" ",n=r.map(([a,o])=>`${i}${a}: ${xe(o,i)}`).join(`,
|
|
359
359
|
`);return n?`{
|
|
360
360
|
${n}
|
|
@@ -368,7 +368,7 @@ ${r}}`:"{}"}throw new Error(`Cannot render "${e}": unsupported literal value (ac
|
|
|
368
368
|
${a.map(s=>`${n}${Tl(s.key)}: ${s.source}`).join(`,
|
|
369
369
|
`)}
|
|
370
370
|
${i}}`}case"array":return`[${t.elements.map(n=>ei(e,n,r)).join(", ")}]`}}ti(ei,"renderStructuredValueSource");function ri(e,t={}){switch(e.value.kind){case"expression":return e.value.source;case"structured":return ei(e.key,e.value.expression,t);case"literal":return Ga(e.key,e.value.value,t.indent??" ")}}ti(ri,"renderProjectedValueSource");function wh(e,t=" "){return e.map(r=>`
|
|
371
|
-
${t}${r.key}: ${ri(r,{indent:t})}`).join(",")}ti(wh,"emitProjectedProps");function kh(e){let t=new Set;for(let r of e)if(!(r.value.kind!=="structured"||r.value.imports===void 0))for(let i of r.value.imports)t.add(i);return[...t]}ti(kh,"collectProjectedPropImports");var k7=Object.defineProperty,Cl=(e,t)=>k7(e,"name",{value:t,configurable:!0}),Rt=Object.freeze({HOST:"DATABASE_HOST",PORT:"DATABASE_PORT",NAME:"DATABASE_NAME",SSL:"DATABASE_SSL",USERNAME:"DATABASE_USERNAME",PASSWORD:"DATABASE_PASSWORD"}),Nh=Object.freeze({USERNAME:"username",PASSWORD:"password"}),Ws="true",mn=Object.freeze({HOST:"getHostEndpoint",PORT:"getHostPort",NAME:"getDatabaseName",CREDENTIALS:"getCredentials",IMPORT:"getImport"}),Il=Object.freeze({NAME:"BUCKET_NAME"}),fT=Object.freeze({BUCKET_NAME:"getBucketName"}),Ka=Object.freeze({URL:"QUEUE_URL",ARN:"QUEUE_ARN"}),Ph=Object.freeze({URL:"getQueueUrl",ARN:"getQueueArn"}),Dl=["database","storage","messaging"],Wa=Cl((e,t)=>({key:e,target:"environment",value:t}),"environmentEntry"),yF=Cl((e,t)=>({key:e,target:"secretsImport",value:{kind:"credential",credentialKey:t}}),"secretEntry"),Gs=Cl(e=>({kind:"accessor",method:e}),"accessor");function fn(e,t){switch(e){case"database":return[Wa(`${Rt.HOST}${t}`,Gs(mn.HOST)),Wa(`${Rt.PORT}${t}`,Gs(mn.PORT)),Wa(`${Rt.NAME}${t}`,Gs(mn.NAME)),Wa(`${Rt.SSL}${t}`,{kind:"literal",value:Ws}),yF(`${Rt.USERNAME}${t}`,Nh.USERNAME),yF(`${Rt.PASSWORD}${t}`,Nh.PASSWORD)];case"storage":return[Wa(`${Il.NAME}${t}`,Gs(fT.BUCKET_NAME))];case"messaging":return[Wa(`${Ka.URL}${t}`,Gs(Ph.URL)),Wa(`${Ka.ARN}${t}`,Gs(Ph.ARN))]}}Cl(fn,"buildConnectionWiringEntries");function zi(e,t){switch(e.kind){case"accessor":return`${t}.${e.method}()`;case"credential":return`${t}.${mn.CREDENTIALS}().${mn.IMPORT}(${H(e.credentialKey)})`;case"literal":return H(e.value)}}Cl(zi,"renderWiringValueSource");var P7=Object.defineProperty,vF=(e,t)=>P7(e,"name",{value:t,configurable:!0});function Rh(e){return t=>t[e]===void 0}vF(Rh,"whenAbsent");function R7(e,t){if(e!==void 0){for(let r of e)if(r.refuseWhen(t))return{kind:"InvalidPropertyError",property:r.property,reason:r.reason}}}vF(R7,"evaluateEmitGuard");var O7=Object.defineProperty,Vt=(e,t)=>O7(e,"name",{value:t,configurable:!0}),Bt={database:"DatabaseFactory",storage:"StorageFactory",compute:"ComputeFactory",messaging:"MessagingFactory",cdn:"CdnFactory",network:"NetworkFactory",pattern:"PatternFactory","vpc-peer":"VpcPeerFactory","vpc-peer-accepter":"VpcPeerAccepterFactory","cross-plan-connection":"CrossPlanConnectionFactory",organisation:"OrganisationFactory",buildkite:"BuildkiteFactory"};function Zr(e){let{name:t,...r}=e.shape;return c.object(r).partial().strict()}Vt(Zr,"fragmentOf");function hn(e){let{name:t,...r}=e.shape;return c.object(r).strict()}Vt(hn,"completeFragmentOf");var $7=Zr(sl),j7=Zr(cl),M7=(()=>{let{name:e,...t}=pl.shape;return c.object(t).partial().strict()})(),F7=(()=>{let{name:e,...t}=pl.shape;return c.object(t).strict()})(),L7=Zr(ul),U7=Zr(ll),z7=Zr(Ua),bF=(()=>{let{name:e,type:t,cdn:r,...i}=n0.shape,{name:n,type:a,cdn:o,...s}=i0.shape,{name:u,type:d,domain:p,cdn:g,...h}=ml.shape;return{...i,...s,...h,cdn:c.union([r,g]),type:c.enum(sf)}})(),B7=c.object(bF).partial().strict(),V7=c.object(bF).partial().required({type:!0}).strict(),G7={emitConstructId:Vt((e,t)=>Iu(t.type)?Aa(e,t.type):e,"emitConstructId"),locateCandidates:Vt(e=>[e,...vr.map(t=>Aa(e,t))],"locateCandidates")},W7=Zr(L1),K7=Zr(K_),Z7=Zr(o0),q7=Zr(c0),H7=Zr(hh);function Oh(e,t){return $({kind:"SemanticQueryError",reason:`StatementTypeEntry.${e} for ${t} is not wired; existing types dispatch through the shared locator/generator.`})}Vt(Oh,"notWiredError");function SF(e){return{factoryIdentifier:e,findByShape:Vt(()=>Oh("locator.findByShape",e),"findByShape"),validateContext:Vt(()=>Oh("locator.validateContext",e),"validateContext")}}Vt(SF,"createLocator");function EF(e){return{build:Vt(()=>{let t=Oh("generator.build",e);throw new Error(t.success?"unreachable":t.error.reason)},"build")}}Vt(EF,"createGenerator");var J7=[{property:"peerAppName",refuseWhen:Rh("peerAppName"),reason:"`peerAppName` is required: it is the SSM prefix every remote lookup is built from, and omitting it does NOT fail \u2014 synth succeeds and the app deploys a peering connection pointed at `/fjall/default/undefined/vpc-id`. Pass `--peerAppName <remote app>`."},{property:"peerAccountId",refuseWhen:Rh("peerAccountId"),reason:"`peerAccountId` is required: omitting it does NOT fail, it deploys a VPC peering connection with no `PeerOwnerId`. Pass `--peerAccountId <12-digit account>`."}];function tr(e,t,r={}){return{factoryIdentifier:e,locator:SF(e),generator:EF(e),schemaFragment:t,...r}}Vt(tr,"createEntry");var ni={database:tr(Bt.database,$7,{emitWrapper:{appMethod:"addDatabase"},addContract:hn(sl)}),storage:tr(Bt.storage,j7,{emitWrapper:{appMethod:"addStorage"},addContract:hn(cl)}),compute:tr(Bt.compute,M7,{emitWrapper:{appMethod:"addCompute"},addContract:F7}),messaging:tr(Bt.messaging,L7,{emitWrapper:{appMethod:"addMessaging"},addContract:hn(ul)}),cdn:tr(Bt.cdn,U7,{emitWrapper:{appMethod:"addCdn"},addContract:hn(ll)}),network:tr(Bt.network,z7,{emitWrapper:{appMethod:"addNetwork"},addContract:hn(Ua)}),pattern:tr(Bt.pattern,B7,{emitWrapper:{appMethod:"addPattern"},addContract:V7,statementIdentity:G7}),"vpc-peer":tr(Bt["vpc-peer"],W7,{emitWrapper:{appMethod:"addVpcPeer"},emitGuard:J7}),"vpc-peer-accepter":tr(Bt["vpc-peer-accepter"],K7,{emitWrapper:{appMethod:"addVpcPeerAccepter"},addContract:hn(K_)}),"cross-plan-connection":tr(Bt["cross-plan-connection"],Z7,{addContract:hn(o0)}),organisation:tr(Bt.organisation,q7,{addContract:hn(c0)}),buildkite:tr(Bt.buildkite,H7,{emitWrapper:{appMethod:"addBuildkite",propsOverloadConstructId:"Buildkite"},addContract:hn(hh)})},
|
|
371
|
+
${t}${r.key}: ${ri(r,{indent:t})}`).join(",")}ti(wh,"emitProjectedProps");function kh(e){let t=new Set;for(let r of e)if(!(r.value.kind!=="structured"||r.value.imports===void 0))for(let i of r.value.imports)t.add(i);return[...t]}ti(kh,"collectProjectedPropImports");var k7=Object.defineProperty,Cl=(e,t)=>k7(e,"name",{value:t,configurable:!0}),Rt=Object.freeze({HOST:"DATABASE_HOST",PORT:"DATABASE_PORT",NAME:"DATABASE_NAME",SSL:"DATABASE_SSL",USERNAME:"DATABASE_USERNAME",PASSWORD:"DATABASE_PASSWORD"}),Nh=Object.freeze({USERNAME:"username",PASSWORD:"password"}),Ws="true",mn=Object.freeze({HOST:"getHostEndpoint",PORT:"getHostPort",NAME:"getDatabaseName",CREDENTIALS:"getCredentials",IMPORT:"getImport"}),Il=Object.freeze({NAME:"BUCKET_NAME"}),fT=Object.freeze({BUCKET_NAME:"getBucketName"}),Ka=Object.freeze({URL:"QUEUE_URL",ARN:"QUEUE_ARN"}),Ph=Object.freeze({URL:"getQueueUrl",ARN:"getQueueArn"}),Dl=["database","storage","messaging"],Wa=Cl((e,t)=>({key:e,target:"environment",value:t}),"environmentEntry"),yF=Cl((e,t)=>({key:e,target:"secretsImport",value:{kind:"credential",credentialKey:t}}),"secretEntry"),Gs=Cl(e=>({kind:"accessor",method:e}),"accessor");function fn(e,t){switch(e){case"database":return[Wa(`${Rt.HOST}${t}`,Gs(mn.HOST)),Wa(`${Rt.PORT}${t}`,Gs(mn.PORT)),Wa(`${Rt.NAME}${t}`,Gs(mn.NAME)),Wa(`${Rt.SSL}${t}`,{kind:"literal",value:Ws}),yF(`${Rt.USERNAME}${t}`,Nh.USERNAME),yF(`${Rt.PASSWORD}${t}`,Nh.PASSWORD)];case"storage":return[Wa(`${Il.NAME}${t}`,Gs(fT.BUCKET_NAME))];case"messaging":return[Wa(`${Ka.URL}${t}`,Gs(Ph.URL)),Wa(`${Ka.ARN}${t}`,Gs(Ph.ARN))]}}Cl(fn,"buildConnectionWiringEntries");function zi(e,t){switch(e.kind){case"accessor":return`${t}.${e.method}()`;case"credential":return`${t}.${mn.CREDENTIALS}().${mn.IMPORT}(${H(e.credentialKey)})`;case"literal":return H(e.value)}}Cl(zi,"renderWiringValueSource");var P7=Object.defineProperty,vF=(e,t)=>P7(e,"name",{value:t,configurable:!0});function Rh(e){return t=>t[e]===void 0}vF(Rh,"whenAbsent");function R7(e,t){if(e!==void 0){for(let r of e)if(r.refuseWhen(t))return{kind:"InvalidPropertyError",property:r.property,reason:r.reason}}}vF(R7,"evaluateEmitGuard");var O7=Object.defineProperty,Vt=(e,t)=>O7(e,"name",{value:t,configurable:!0}),Bt={database:"DatabaseFactory",storage:"StorageFactory",compute:"ComputeFactory",messaging:"MessagingFactory",cdn:"CdnFactory",network:"NetworkFactory",pattern:"PatternFactory","vpc-peer":"VpcPeerFactory","vpc-peer-accepter":"VpcPeerAccepterFactory","cross-plan-connection":"CrossPlanConnectionFactory",organisation:"OrganisationFactory",buildkite:"BuildkiteFactory"};function Zr(e){let{name:t,...r}=e.shape;return c.object(r).partial().strict()}Vt(Zr,"fragmentOf");function hn(e){let{name:t,...r}=e.shape;return c.object(r).strict()}Vt(hn,"completeFragmentOf");var $7=Zr(sl),j7=Zr(cl),M7=(()=>{let{name:e,...t}=pl.shape;return c.object(t).partial().strict()})(),F7=(()=>{let{name:e,...t}=pl.shape;return c.object(t).strict()})(),L7=Zr(ul),U7=Zr(ll),z7=Zr(Ua),bF=(()=>{let{name:e,type:t,cdn:r,...i}=n0.shape,{name:n,type:a,cdn:o,...s}=i0.shape,{name:u,type:d,domain:p,cdn:g,...h}=ml.shape;return{...i,...s,...h,cdn:c.union([r,g]),type:c.enum(sf)}})(),B7=c.object(bF).partial().strict(),V7=c.object(bF).partial().required({type:!0}).strict(),G7={emitConstructId:Vt((e,t)=>Iu(t.type)?Aa(e,t.type):e,"emitConstructId"),locateCandidates:Vt(e=>[e,...vr.map(t=>Aa(e,t))],"locateCandidates")},W7=Zr(L1),K7=Zr(K_),Z7=Zr(o0),q7=Zr(c0),H7=Zr(hh);function Oh(e,t){return $({kind:"SemanticQueryError",reason:`StatementTypeEntry.${e} for ${t} is not wired; existing types dispatch through the shared locator/generator.`})}Vt(Oh,"notWiredError");function SF(e){return{factoryIdentifier:e,findByShape:Vt(()=>Oh("locator.findByShape",e),"findByShape"),validateContext:Vt(()=>Oh("locator.validateContext",e),"validateContext")}}Vt(SF,"createLocator");function EF(e){return{build:Vt(()=>{let t=Oh("generator.build",e);throw new Error(t.success?"unreachable":t.error.reason)},"build")}}Vt(EF,"createGenerator");var J7=[{property:"peerAppName",refuseWhen:Rh("peerAppName"),reason:"`peerAppName` is required: it is the SSM prefix every remote lookup is built from, and omitting it does NOT fail \u2014 synth succeeds and the app deploys a peering connection pointed at `/fjall/default/undefined/vpc-id`. Pass `--peerAppName <remote app>`."},{property:"peerAccountId",refuseWhen:Rh("peerAccountId"),reason:"`peerAccountId` is required: omitting it does NOT fail, it deploys a VPC peering connection with no `PeerOwnerId`. Pass `--peerAccountId <12-digit account>`."}];function tr(e,t,r={}){return{factoryIdentifier:e,locator:SF(e),generator:EF(e),schemaFragment:t,...r}}Vt(tr,"createEntry");var ni={database:tr(Bt.database,$7,{emitWrapper:{appMethod:"addDatabase"},addContract:hn(sl)}),storage:tr(Bt.storage,j7,{emitWrapper:{appMethod:"addStorage"},addContract:hn(cl)}),compute:tr(Bt.compute,M7,{emitWrapper:{appMethod:"addCompute"},addContract:F7}),messaging:tr(Bt.messaging,L7,{emitWrapper:{appMethod:"addMessaging"},addContract:hn(ul)}),cdn:tr(Bt.cdn,U7,{emitWrapper:{appMethod:"addCdn"},addContract:hn(ll)}),network:tr(Bt.network,z7,{emitWrapper:{appMethod:"addNetwork"},addContract:hn(Ua)}),pattern:tr(Bt.pattern,B7,{emitWrapper:{appMethod:"addPattern"},addContract:V7,statementIdentity:G7}),"vpc-peer":tr(Bt["vpc-peer"],W7,{emitWrapper:{appMethod:"addVpcPeer"},emitGuard:J7}),"vpc-peer-accepter":tr(Bt["vpc-peer-accepter"],K7,{emitWrapper:{appMethod:"addVpcPeerAccepter"},addContract:hn(K_)}),"cross-plan-connection":tr(Bt["cross-plan-connection"],Z7,{addContract:hn(o0)}),organisation:tr(Bt.organisation,q7,{addContract:hn(c0)}),buildkite:tr(Bt.buildkite,H7,{emitWrapper:{appMethod:"addBuildkite",propsOverloadConstructId:"Buildkite"},addContract:hn(hh)})},Bve=Object.keys(ni);function X7(e,t,r){return ni[e].statementIdentity?.emitConstructId(t,r)??t}Vt(X7,"constructIdFor");function Y7(e,t){return ni[e].statementIdentity?.locateCandidates(t)??[t]}Vt(Y7,"locateNamesFor");function Q7(e){let t=Object.keys(ni);for(let r of t)if(ni[r].factoryIdentifier===e)return r}Vt(Q7,"findTypeByIdentifier");var eQ=Object.defineProperty,tQ=(e,t)=>eQ(e,"name",{value:t,configurable:!0});function Bi(e){let t=ni[e],r=t.emitWrapper?.appMethod;if(r===void 0)throw new Error(`Statement type "${e}" declares no emitWrapper.appMethod \u2014 the scaffold emits wrapped statements only.`);return{factory:t.factoryIdentifier,appMethod:r}}tQ(Bi,"invocationOf");var Tr=Bi("database"),Za=Bi("storage"),wl=Bi("compute"),kl=Bi("messaging"),Ks=Bi("cdn"),$h=Bi("network"),Nl=Bi("pattern");var rQ=Object.defineProperty,rr=(e,t)=>rQ(e,"name",{value:t,configurable:!0});function qa(e,t){let r=t.connectedDatabase;return r?.length?e.database.filter(i=>r.includes(i.name)):[]}rr(qa,"getConnectedDatabases");function Pl(e){let t=[];for(let[r,i]of e.entries()){let n=ke(i),a=Qn(r);for(let o of fn("database",a))t.push({key:o.key,expression:zi(o.value,n),isSecret:o.target==="secretsImport"})}return t}rr(Pl,"generateDatabaseEnvVarEntries");function xF(e){return`connections: [${e.map(t=>ke(t)).join(", ")}],`}rr(xF,"formatConnectionsCode");function jh(e){return e.expression===H(Ws)?Ws:{__expression:e.expression}}rr(jh,"toDatabaseEnvVarValue");function Mh(e,t){let r={},i={};if(!t.needsConnection||!t.connectedDatabase?.length)return{env:r,secrets:i};let n=qa(e,t),a=Pl(n);for(let o of a){let s=jh(o);o.isSecret?i[o.key]={__expression:o.expression}:r[o.key]=s}return{env:r,secrets:i}}rr(Mh,"buildDatabaseEnvVars");function AF(e){let t="";return t+=ie(e.port!==void 0,"port",e.port),t+=ie(e.deletionProtection!==void 0,"deletionProtection",e.deletionProtection),t+=ie(e.snapshotIdentifier!==void 0,"snapshotIdentifier",e.snapshotIdentifier,"string"),t+=ie(e.snapshotUsername!==void 0,"snapshotUsername",e.snapshotUsername,"string"),t+=ie(e.monitoringInterval!==void 0,"monitoringInterval",e.monitoringInterval),t}rr(AF,"generateDatabaseSharedProps");function _F(e){if(e.type!=="Instance")return"";let t="";return t+=ie(e.instanceType!==void 0,"instanceType",e.instanceType,"string"),t+=ie(e.allocatedStorage!==void 0,"allocatedStorage",e.allocatedStorage),t+=ie(e.multiAz!==void 0,"multiAz",e.multiAz),t+=ie(e.publiclyAccessible!==void 0,"publiclyAccessible",e.publiclyAccessible),t+=ie(e.encryption!==void 0,"encryption",e.encryption,"object"),t+=ie(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),t+=ie(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),t+=ie(e.readReplica!==void 0,"readReplica",e.readReplica,"boolean-or-object"),t+=ie(e.credentials!==void 0,"credentials",e.credentials,"object"),t+=ie(e.backupRetention!==void 0,"backupRetention",e.backupRetention),t}rr(_F,"generateDatabaseInstanceProps");function TF(e){if(e.type!=="Aurora"&&e.type!=="GlobalAurora")return"";let t="";return t+=ie(e.encryption!==void 0,"encryption",e.encryption,"object"),t+=ie(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),t+=ie(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),t+=ie(e.credentials!==void 0,"credentials",e.credentials,"object"),t+=ie(e.writer!==void 0,"writer",e.writer,"object"),t+=ie(e.readers!==void 0,"readers",e.readers,"boolean-or-object"),t+=ie(e.backupRetention!==void 0,"backupRetention",e.backupRetention),t+=ie(e.preferredMaintenanceWindow!==void 0,"preferredMaintenanceWindow",e.preferredMaintenanceWindow,"string"),t}rr(TF,"generateDatabaseAuroraProps");function CF(e){if(e.type!=="GlobalAurora")return"";let t="";return t+=ie(e.primaryRegion!==void 0,"primaryRegion",e.primaryRegion,"string"),e.secondaryRegions!==void 0&&e.secondaryRegions.length>0&&(t+=`
|
|
372
372
|
secondaryRegions: [${hl(e.secondaryRegions)}],`),t+=ie(e.globalClusterIdentifier!==void 0,"globalClusterIdentifier",e.globalClusterIdentifier,"string"),t+=ie(e.enableGlobalWriteForwarding!==void 0,"enableGlobalWriteForwarding",e.enableGlobalWriteForwarding),t}rr(CF,"generateDatabaseGlobalAuroraProps");function Rl(e,t){return t.compute.some(r=>r.needsConnection&&r.connectedDatabase?.includes(e.name))}rr(Rl,"databaseNeedsVariable");function Fh(e){if(e.database.length===0)return"";let t="";for(let r=0;r<e.database.length;r++){let i=e.database[r],n=ke(i),a=Rl(i,e),o=r>0,s=a?`const ${n} = `:"";t+=`${o?`
|
|
373
373
|
`:""}${s}app.${Tr.appMethod}(
|
|
374
374
|
${Tr.factory}.build(${H(i.name)}, {
|
|
@@ -615,7 +615,7 @@ ${a}`)}throw n}}hg(ao,"convertToResourcePlan");var lee=Object.defineProperty,pc=
|
|
|
615
615
|
`;return i.push(`Custom code from line ${t.originalLine} could not be positioned. Added at end of file.`),e+`
|
|
616
616
|
`+n+t.sourceText}Rr(SU,"insertOrOrphanBlock");function bg(e,t,r){if(!t||t.length===0)return{content:e,success:!0};try{let i=Ji(e),n=Wt(i),a=[],o=bU(t),s=e;for(let u of o){let d=xU(i,n,u,r,a);s=SU(s,u,d,a)}return{content:s,success:!0,warnings:a.length>0?a:void 0}}catch(i){return Sn(i,e)}}Rr(bg,"injectCustomCodeBlocks");function EU(e,t,r,i){if(!t.afterManagedResource)return null;let n=t.afterManagedResource,a=(n.name&&r?.get(n.name))??n.name,o=e.find(u=>u.type===n.type&&u.resourceName===a);if(o)return o.endPos;let s=e.filter(u=>u.type===n.type&&u.isManaged);return s.length===1?s[0].endPos:(i&&i.push(`Resource ${Xi(t.afterManagedResource.type,t.afterManagedResource.name)} not found. Custom code may be orphaned.`),null)}Rr(EU,"findAfterResourcePosition");function xU(e,t,r,i,n){switch(r.position){case"before-imports":return 0;case"after-imports":return gC(t,"import")?.endPos??0;case"after-app-init":return gg(t,"app-init")?.endPos??null;case"after-tags":return gg(t,"tags")?.endPos??null;case"after-resource":return EU(t,r,i,n);case"end-of-file":return e.getEnd();default:return null}}Rr(xU,"findCustomCodeInsertPosition");function AU(e,t,r){let i=vg(e,t),n=r.sourceText;return n=yg(i,n)+n,n.endsWith(`
|
|
617
617
|
`)||(n+=`
|
|
618
|
-
`),n}Rr(AU,"formatCustomCodeForInsertion");function _U(e){try{let t=function(n){n.kind===oo.SyntaxKind.Unknown&&i.push("Unknown node found in AST - possible parse error"),oo.forEachChild(n,t)};Rr(t,"visit");let r=Ji(e),i=[];return t(r),i.length>0?{valid:!1,errors:i}:{valid:!0}}catch(t){return{valid:!1,errors:[qe(t)]}}}Rr(_U,"validateModifiedFile");import*as Ge from"typescript";var dd=c.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),mee=c.object({name:c.string(),type:dd,ttl:c.number().optional(),value:c.string(),priority:c.number().optional(),weight:c.number().optional(),port:c.number().optional()}).strict(),fee=c.object({subdomain:c.string(),targetAccount:c.string(),auto:c.boolean()}).strict(),hee=c.object({domainName:c.string(),subjectAlternativeNames:c.array(c.string())}).strict(),bxe=c.object({origin:c.string(),ttl:c.number(),records:c.array(mee),delegations:c.array(fee),certificates:c.array(hee)}).strict(),En=Object.freeze({ORIGIN:"$ORIGIN",TTL:"$TTL",FJALL_DELEGATE:"$FJALL-DELEGATE",FJALL_CERT:"$FJALL-CERT"}),TU="ALIAS ";var CU=c.discriminatedUnion("kind",[c.object({kind:c.literal("ecs"),appName:c.string(),computeName:c.string().min(1).optional()}).strict(),c.object({kind:c.literal("cdn"),appName:c.string(),cdnName:c.string().min(1).optional()}).strict(),c.object({kind:c.literal("bucket"),appName:c.string(),bucketName:c.string()}).strict(),c.object({kind:c.literal("custom"),dnsName:c.string(),hostedZoneId:c.string()}).strict()]),IU=CU.options.map(e=>e.shape.kind.value),SC=c.enum(["A","AAAA"]),EC=c.enum(["route53","external-delegated","external-records"]),DU=c.enum(["zone","full"]),Sg=c.string().regex(/^[A-Za-z][A-Za-z0-9]*$/),gee=c.object({kind:c.literal("standard"),type:c.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),name:c.string(),value:c.union([c.string(),c.array(c.string())]),ttl:c.number().int().positive().optional(),id:Sg.optional()}).strict(),yee=c.object({kind:c.literal("alias"),type:SC,name:c.string(),target:CU,id:Sg.optional()}).strict(),vee=c.discriminatedUnion("kind",[gee,yee]),bee=c.object({domainName:c.string(),subjectAlternativeNames:c.array(c.string()).optional(),transparencyLogging:c.boolean().optional(),cloudFront:c.boolean().optional()}).strict(),See=c.object({subdomain:c.string(),toAccount:c.string(),auto:c.boolean().optional()}).strict(),xC=c.enum(["indexed","stable"]),xxe=c.object({zoneName:c.string(),registrar:EC,recordIds:xC.optional(),hostedZoneId:c.string().optional(),delegatedSubdomain:c.string().optional(),adoptedNameServers:c.array(c.string().min(1)).min(1).optional(),records:c.array(vee),certificates:c.array(bee),delegations:c.array(See)}).strict().refine(e=>e.registrar!=="external-delegated"||e.delegatedSubdomain!==void 0,{message:"external-delegated requires delegatedSubdomain"}).refine(e=>e.registrar!=="external-records"||e.delegations.length===0,{message:"external-records forbids delegations"}).refine(e=>e.registrar==="external-delegated"||e.adoptedNameServers===void 0,{message:"adoptedNameServers requires registrar external-delegated"}).refine(e=>e.registrar!=="external-delegated"||e.hostedZoneId===void 0==(e.adoptedNameServers===void 0),{message:"external-delegated adoption requires hostedZoneId and adoptedNameServers together (both-or-neither)"});var Eee=Object.defineProperty,Xe=(e,t)=>Eee(e,"name",{value:t,configurable:!0}),NU=EC.options,wU=DU.options,kU=xC.options,xee=dd.options,Aee=SC.options;function _C(e){let t=[],r=Xe(n=>{if(Ge.isNewExpression(n)&&PU(n.expression)){let a=RU(n);a!==void 0&&t.push(a)}Ge.forEachChild(n,r)},"visit");if(r(e),t.length===0)return G(void 0);if(t.length>1)return $(new Error(`Expected exactly one 'new Domain(...)' call per infrastructure file, found ${t.length}`));let i=t[0];return i?G(i):G(void 0)}Xe(_C,"findDomainConstructCall");function PU(e){return Ge.isIdentifier(e)&&e.text==="Domain"}Xe(PU,"isDomainIdentifier");function RU(e){let t=e.arguments;if(!t||t.length<3)return;let r=t[0],i=t[1],n=t[2];if(!r||!i||!n||!Ge.isObjectLiteralExpression(n))return;let a=OU(e);if(a===void 0)return;let o=$U(e),s=Ge.isStringLiteral(i)?i.text:void 0;return{callExpression:e,containingStatement:a,propsObjectLiteral:n,domainVarId:o,scopeArgumentText:r.getText(),constructIdLiteral:s}}Xe(RU,"buildMatch");function OU(e){let t=e;for(;t!==void 0;){if(Ge.isExpressionStatement(t)||Ge.isVariableStatement(t))return t;t=t.parent}}Xe(OU,"findContainingTopLevelStatement");function $U(e){let t=e.parent;for(;t!==void 0;){if(Ge.isVariableDeclaration(t)&&Ge.isIdentifier(t.name)&&t.initializer===e)return t.name.text;t=t.parent}}Xe($U,"extractDomainVarId");function jU(e){switch(e.kind){case"registrar_required":return"'registrar' property is required";case"registrar_unsupported":return`'registrar' must be one of ${NU.join(", ")}, got ${JSON.stringify(e.value)}`;case"missing_field":return`'${e.field}' property is required`;case"invalid_literal":return`'${e.field}' ${e.reason}`;case"removed_field":return`'${e.field}' was removed from the Domain API \u2014 ${e.cure}`}}Xe(jU,"errorMessage");var _ee="declare the delegated child as its own Domain with registrar: 'external-delegated' and set 'parentDelegationRoleArn' (the CLI injects it via ManagedDomainBinding.delegationRoleArn); the child UPSERTs its NS records into the parent zone";function TC(e){let t=ye(e),r=se(t.registrar,NU);if(r===void 0){let u=t.registrar;if(u===void 0)return $({kind:"registrar_required"});let d=typeof u=="string"?u:xg(u);return $({kind:"registrar_unsupported",value:d})}let i=N(t.zoneName);if(i===void 0)return $({kind:"missing_field",field:"zoneName"});let n=se(t.recordIds,kU);if(t.recordIds!==void 0&&n===void 0)return $({kind:"invalid_literal",field:"recordIds",reason:`must be one of ${kU.map(u=>`'${u}'`).join(", ")}`});let a=LU(t.records);if(!a.success)return a;let o=GU(t.certificates);if(!o.success)return o;if(t.delegations!==void 0)return $({kind:"removed_field",field:"delegations",cure:_ee});let s={zoneName:i,recordIds:n,description:N(t.description),costAllocationEnvironment:N(t.costAllocationEnvironment),tags:WU(t.tags),records:a.data,certificates:o.data};switch(r){case"route53":return G({...s,registrar:r,hostedZoneId:N(t.hostedZoneId)});case"external-delegated":{let u=N(t.delegatedSubdomain);if(u===void 0)return $({kind:"missing_field",field:"delegatedSubdomain"});let d=N(t.hostedZoneId);if(t.hostedZoneId!==void 0&&d===void 0)return $({kind:"invalid_literal",field:"hostedZoneId",reason:"must be a literal string zone id on external-delegated \u2014 dynamic expressions cannot be round-tripped"});let p=Je(t.adoptedNameServers);if(t.adoptedNameServers!==void 0&&p===void 0)return $({kind:"invalid_literal",field:"adoptedNameServers",reason:"must be an array of literal NS hostname strings \u2014 the parent NS UPSERT writes them verbatim"});if(d===void 0!=(p===void 0))return $({kind:"invalid_literal",field:d===void 0?"hostedZoneId":"adoptedNameServers",reason:"adopting an existing child zone requires hostedZoneId and adoptedNameServers together (both-or-neither) \u2014 an imported zone exposes no name-server attribute at synth"});let g=N(t.parentDelegationRoleArn);if(t.parentDelegationRoleArn!==void 0&&g===void 0)return $({kind:"invalid_literal",field:"parentDelegationRoleArn",reason:"must be a literal string ARN (VD2-a) \u2014 the CLI injects it via ManagedDomainBinding.delegationRoleArn; dynamic expressions such as Fn.importValue are not supported"});let h=se(t.phase,wU);return t.phase!==void 0&&h===void 0?$({kind:"invalid_literal",field:"phase",reason:`must be one of ${wU.map(l=>`'${l}'`).join(", ")}`}):G({...s,registrar:r,delegatedSubdomain:u,hostedZoneId:d,adoptedNameServers:p,parentDelegationRoleArn:g,phase:h})}case"external-records":return G({...s,registrar:r})}}Xe(TC,"parseDomainProps");function MU(e){return jU(e)}Xe(MU,"parseDomainErrorMessage");function FU(e,t,r){let i=Ge.createSourceFile(t,e,Ge.ScriptTarget.Latest,!0,Ge.ScriptKind.TS),n=_C(i);if(!n.success)return $(new Error(n.error.message));if(n.data===void 0)return $(new Error(`Domain '${r}': no 'new Domain(...)' call found in ${t} \u2014 the file is not a Fjall domain component.`));let a=TC(n.data.propsObjectLiteral);return a.success?G(a.data):$(new Error(`Domain '${r}': infrastructure.ts could not be parsed (${a.error.kind}).`))}Xe(FU,"parseDomainInfrastructureSource");function LU(e){if(e===void 0)return G([]);if(!Array.isArray(e))return $({kind:"invalid_literal",field:"records",reason:"must be an array"});let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(!q(i))return $({kind:"invalid_literal",field:`records[${r}]`,reason:"must be an object literal"});let n=UU(i,r);if(!n.success)return n;t.push(n.data)}return G(t)}Xe(LU,"parseRecordsArray");function UU(e,t){let r=N(e.type),i=N(e.name);if(r===void 0)return $({kind:"missing_field",field:`records[${t}].type`});if(i===void 0)return $({kind:"missing_field",field:`records[${t}].name`});let n=N(e.id);if(e.id!==void 0&&(n===void 0||!Sg.safeParse(n).success))return $({kind:"invalid_literal",field:`records[${t}].id`,reason:"must be a literal alphanumeric string starting with a letter \u2014 it becomes a CloudFormation logical-ID segment"});if(e.target!==void 0){if(!Aee.some(d=>d===r))return $({kind:"invalid_literal",field:`records[${t}]`,reason:`alias records must have type 'A' or 'AAAA', got '${r}'`});let u=BU(e.target);return G({kind:"alias",type:r,name:i,target:u,...n!==void 0?{id:n}:{}})}if(!xee.some(u=>u===r))return $({kind:"invalid_literal",field:`records[${t}]`,reason:`unsupported record type '${r}'`});let a=zU(e.value);if(a===void 0)return $({kind:"invalid_literal",field:`records[${t}].value`,reason:`must be a string or array of strings (got ${JSON.stringify(e.value)})`});let o=Z(e.ttl),s={kind:"standard",type:r,name:i,value:a,...o!==void 0?{ttl:o}:{},...n!==void 0?{id:n}:{}};return G(s)}Xe(UU,"parseRecord");function zU(e){if(e===void 0)return;if(typeof e=="string")return e;let t=Je(e);if(t!==void 0)return t}Xe(zU,"parseRecordValue");function BU(e){if(Hr(e))return VU(e);if(q(e)){let t=se(e.kind,IU);if(t==="ecs"||t==="cdn"){let r=N(e.appName);if(r!==void 0)return{kind:t,appName:r}}if(t==="bucket"){let r=N(e.appName),i=N(e.bucketName);if(r!==void 0&&i!==void 0)return{kind:t,appName:r,bucketName:i}}if(t==="custom"){let r=N(e.dnsName),i=N(e.hostedZoneId);if(r!==void 0&&i!==void 0)return{kind:t,dnsName:r,hostedZoneId:i}}}return{kind:"unresolved",sourceText:xg(e)}}Xe(BU,"parseTarget");function VU(e){let t=e.__call.trim(),r=t.match(/^([A-Za-z_][\w$]*)\s*\(([\s\S]*)\)\s*$/);if(!r)return{kind:"unresolved",sourceText:t};let i=r[1],n=r[2]??"",a=Eg(n);switch(i){case"fjallApp":{let o=xn(a,0);if(o===void 0)return{kind:"dynamic",sourceText:t};if(a.length<2)return{kind:"ecs",appName:o};let s=xn(a,1);return s===void 0?{kind:"dynamic",sourceText:t}:{kind:"ecs",appName:o,computeName:s}}case"fjallCdn":{let o=xn(a,0);if(o===void 0)return{kind:"dynamic",sourceText:t};if(a.length<2)return{kind:"cdn",appName:o};let s=xn(a,1);return s===void 0?{kind:"dynamic",sourceText:t}:{kind:"cdn",appName:o,cdnName:s}}case"fjallBucket":{if(a.length<2)return{kind:"unresolved",sourceText:t};let o=xn(a,0),s=xn(a,1);return o===void 0||s===void 0?{kind:"dynamic",sourceText:t}:{kind:"bucket",appName:o,bucketName:s}}case"aliasTo":{if(a.length>=2){let o=xn(a,0),s=xn(a,1);return o!==void 0&&s!==void 0?{kind:"custom",dnsName:o,hostedZoneId:s}:{kind:"dynamic",sourceText:t}}if(a.length===1){let o=a[0]?.trim()??"",s=AC(o,"dnsName"),u=AC(o,"hostedZoneId");return s!==void 0&&u!==void 0?{kind:"custom",dnsName:s,hostedZoneId:u}:{kind:"dynamic",sourceText:t}}return{kind:"unresolved",sourceText:t}}default:return{kind:"unresolved",sourceText:t}}}Xe(VU,"resolveCallRefTarget");function Eg(e){let t=[],r=0,i=null,n="";for(let o=0;o<e.length;o++){let s=e[o];if(i!==null){if(n+=s,s==="\\"&&o+1<e.length){let u=e[o+1];u!==void 0&&(n+=u,o+=1);continue}s===i&&(i=null);continue}if(s==='"'||s==="'"||s==="`"){i=s,n+=s;continue}if(s==="("||s==="{"||s==="["){r+=1,n+=s;continue}if(s===")"||s==="}"||s==="]"){r-=1,n+=s;continue}if(s===","&&r===0){t.push(n.trim()),n="";continue}n+=s}let a=n.trim();return a.length>0&&t.push(a),t}Xe(Eg,"splitTopLevelArgs");function xn(e,t){let r=e[t];if(r===void 0)return;let i=r.trim();if(i.length<2)return;let n=i[0],a=i[i.length-1];if(n===a&&!(n!=='"'&&n!=="'"&&n!=="`"))return i.slice(1,-1)}Xe(xn,"extractStringLiteralArg");function AC(e,t){let r=e.trim().replace(/^\{|\}$/g,""),i=Eg(r);for(let n of i){let a=n.indexOf(":");if(a<0||n.slice(0,a).trim().replace(/["'`]/g,"")!==t)continue;let o=n.slice(a+1).trim();return xn([o],0)}}Xe(AC,"extractObjectFieldString");function GU(e){if(e===void 0)return G([]);if(!Array.isArray(e))return $({kind:"invalid_literal",field:"certificates",reason:"must be an array"});let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(typeof i=="string"){t.push({domainName:i});continue}if(!q(i))return $({kind:"invalid_literal",field:`certificates[${r}]`,reason:"must be a string or object literal"});let n=N(i.domainName);if(n===void 0)return $({kind:"missing_field",field:`certificates[${r}].domainName`});let a=Je(i.subjectAlternativeNames),o=oe(i.transparencyLogging),s=oe(i.cloudFront);if(i.cloudFront!==void 0&&s===void 0)return $({kind:"invalid_literal",field:`certificates[${r}].cloudFront`,reason:"must be a boolean literal \u2014 the CloudFront designation drives the zone-level us-east-1 export contract and cannot be round-tripped from a dynamic expression"});t.push({domainName:n,...a!==void 0?{subjectAlternativeNames:a}:{},...o!==void 0?{transparencyLogging:o}:{},...s!==void 0?{cloudFront:s}:{}})}return G(t)}Xe(GU,"parseCertificatesArray");function WU(e){if(e===void 0||!q(e))return;let t={};for(let[r,i]of Object.entries(e)){let n=N(i);n!==void 0&&(t[r]=n)}return Object.keys(t).length===0?void 0:t}Xe(WU,"parseStringRecord");function xg(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`[${e.map(t=>xg(t)).join(", ")}]`;if(typeof e=="object"){if("__call"in e)return String(e.__call);if("__identifier"in e)return String(e.__identifier);if("__expression"in e)return String(e.__expression);if("__unknown"in e)return String(e.__unknown)}return String(e)}Xe(xg,"stringifyParsedValue");var Yg=ua(Ar(),1);var Tee=Object.defineProperty,so=(e,t)=>Tee(e,"name",{value:t,configurable:!0}),Kt=Symbol("non-literal");function Cee(e,t){let r={};for(let i of e.properties){if(i.type!=="Property"&&i.type!=="ObjectProperty"||i.shorthand===!0||i.computed===!0)continue;let n=ci(i.key);if(n===void 0||i.value===void 0)continue;let a=Ag(i.value);a!==Kt&&(r[n]=a)}return{...r,...t}}so(Cee,"buildMergedLiteral");function Iee(e){let t=[];for(let r of e.properties){if(r.type!=="Property"&&r.type!=="ObjectProperty"||r.shorthand===!0||r.computed===!0)continue;let i=ci(r.key);i!==void 0&&t.push(i)}return t}so(Iee,"collectPropertyKeys");function Ag(e){let t=e.value;switch(e.type){case"StringLiteral":return typeof t=="string"?t:Kt;case"NumericLiteral":return typeof t=="number"?t:Kt;case"BooleanLiteral":return typeof t=="boolean"?t:Kt;case"NullLiteral":return null;case"ArrayExpression":return KU(e);case"ObjectExpression":return ZU(e);default:return Kt}}so(Ag,"astToLiteral");function KU(e){let t=e.elements;if(!Array.isArray(t))return Kt;let r=[];for(let i of t){if(!Se(i))return Kt;let n=Ag(i);if(n===Kt)return Kt;r.push(n)}return r}so(KU,"arrayToLiteral");function ZU(e){let t=e.properties;if(!Array.isArray(t))return Kt;let r={};for(let i of t){if(!Se(i)||i.type!=="Property"&&i.type!=="ObjectProperty")return Kt;let n=ci(i.key),a=i.value;if(n===void 0||a===void 0)return Kt;let o=Ag(a);if(o===Kt)return Kt;r[n]=o}return r}so(ZU,"objectToLiteral");function ci(e){if(e===void 0)return;let t=e;if(e.type==="Identifier"&&typeof t.name=="string")return t.name;if(e.type==="StringLiteral"&&typeof t.value=="string")return t.value}so(ci,"readKeyName");function Se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}so(Se,"isNodeShape");var aB=ua(iB(),1),ore=Object.defineProperty,yo=(e,t)=>ore(e,"name",{value:t,configurable:!0}),oB="\uFEFF",Zg=65279;function sre(e,t){let r=kd(t),i=cB(e),n=aB.print(e,{quote:i,lineTerminator:r,trailingComma:!0}).code,a=sB(n,t),o=t.charCodeAt(0)===Zg,s=a.charCodeAt(0)===Zg;return o&&!s?`${oB}${a}`:a}yo(sre,"printFile");var cre=/^(#![^\n\r]*)((?:\r?\n)*)/;function sB(e,t){let r=t.charCodeAt(0)===Zg?t.slice(1):t,i=cre.exec(r);if(i===null)return e;let n=i[1],a=i[2]??"";if(n===void 0)return e;let o=yo(p=>p!==""&&a===""?kd(t):a,"separatorOrFloor"),s=e.charCodeAt(0)===Zg,u=s?oB:"",d=s?e.slice(1):e;if(d.startsWith(n)){let p=d.slice(n.length).replace(/^(?:\r?\n)*/,"");return`${u}${n}${o(p)}${p}`}return d.startsWith("#!")?e:`${u}${n}${o(d)}${d}`}yo(sB,"restoreShebangPrefix");function kd(e){return e.includes(`\r
|
|
618
|
+
`),n}Rr(AU,"formatCustomCodeForInsertion");function _U(e){try{let t=function(n){n.kind===oo.SyntaxKind.Unknown&&i.push("Unknown node found in AST - possible parse error"),oo.forEachChild(n,t)};Rr(t,"visit");let r=Ji(e),i=[];return t(r),i.length>0?{valid:!1,errors:i}:{valid:!0}}catch(t){return{valid:!1,errors:[qe(t)]}}}Rr(_U,"validateModifiedFile");import*as Ge from"typescript";var dd=c.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),mee=c.object({name:c.string(),type:dd,ttl:c.number().optional(),value:c.string(),priority:c.number().optional(),weight:c.number().optional(),port:c.number().optional()}).strict(),fee=c.object({subdomain:c.string(),targetAccount:c.string(),auto:c.boolean()}).strict(),hee=c.object({domainName:c.string(),subjectAlternativeNames:c.array(c.string())}).strict(),Sxe=c.object({origin:c.string(),ttl:c.number(),records:c.array(mee),delegations:c.array(fee),certificates:c.array(hee)}).strict(),En=Object.freeze({ORIGIN:"$ORIGIN",TTL:"$TTL",FJALL_DELEGATE:"$FJALL-DELEGATE",FJALL_CERT:"$FJALL-CERT"}),TU="ALIAS ";var CU=c.discriminatedUnion("kind",[c.object({kind:c.literal("ecs"),appName:c.string(),computeName:c.string().min(1).optional()}).strict(),c.object({kind:c.literal("cdn"),appName:c.string(),cdnName:c.string().min(1).optional()}).strict(),c.object({kind:c.literal("bucket"),appName:c.string(),bucketName:c.string()}).strict(),c.object({kind:c.literal("custom"),dnsName:c.string(),hostedZoneId:c.string()}).strict()]),IU=CU.options.map(e=>e.shape.kind.value),SC=c.enum(["A","AAAA"]),EC=c.enum(["route53","external-delegated","external-records"]),DU=c.enum(["zone","full"]),Sg=c.string().regex(/^[A-Za-z][A-Za-z0-9]*$/),gee=c.object({kind:c.literal("standard"),type:c.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),name:c.string(),value:c.union([c.string(),c.array(c.string())]),ttl:c.number().int().positive().optional(),id:Sg.optional()}).strict(),yee=c.object({kind:c.literal("alias"),type:SC,name:c.string(),target:CU,id:Sg.optional()}).strict(),vee=c.discriminatedUnion("kind",[gee,yee]),bee=c.object({domainName:c.string(),subjectAlternativeNames:c.array(c.string()).optional(),transparencyLogging:c.boolean().optional(),cloudFront:c.boolean().optional()}).strict(),See=c.object({subdomain:c.string(),toAccount:c.string(),auto:c.boolean().optional()}).strict(),xC=c.enum(["indexed","stable"]),Axe=c.object({zoneName:c.string(),registrar:EC,recordIds:xC.optional(),hostedZoneId:c.string().optional(),delegatedSubdomain:c.string().optional(),adoptedNameServers:c.array(c.string().min(1)).min(1).optional(),records:c.array(vee),certificates:c.array(bee),delegations:c.array(See)}).strict().refine(e=>e.registrar!=="external-delegated"||e.delegatedSubdomain!==void 0,{message:"external-delegated requires delegatedSubdomain"}).refine(e=>e.registrar!=="external-records"||e.delegations.length===0,{message:"external-records forbids delegations"}).refine(e=>e.registrar==="external-delegated"||e.adoptedNameServers===void 0,{message:"adoptedNameServers requires registrar external-delegated"}).refine(e=>e.registrar!=="external-delegated"||e.hostedZoneId===void 0==(e.adoptedNameServers===void 0),{message:"external-delegated adoption requires hostedZoneId and adoptedNameServers together (both-or-neither)"});var Eee=Object.defineProperty,Xe=(e,t)=>Eee(e,"name",{value:t,configurable:!0}),NU=EC.options,wU=DU.options,kU=xC.options,xee=dd.options,Aee=SC.options;function _C(e){let t=[],r=Xe(n=>{if(Ge.isNewExpression(n)&&PU(n.expression)){let a=RU(n);a!==void 0&&t.push(a)}Ge.forEachChild(n,r)},"visit");if(r(e),t.length===0)return G(void 0);if(t.length>1)return $(new Error(`Expected exactly one 'new Domain(...)' call per infrastructure file, found ${t.length}`));let i=t[0];return i?G(i):G(void 0)}Xe(_C,"findDomainConstructCall");function PU(e){return Ge.isIdentifier(e)&&e.text==="Domain"}Xe(PU,"isDomainIdentifier");function RU(e){let t=e.arguments;if(!t||t.length<3)return;let r=t[0],i=t[1],n=t[2];if(!r||!i||!n||!Ge.isObjectLiteralExpression(n))return;let a=OU(e);if(a===void 0)return;let o=$U(e),s=Ge.isStringLiteral(i)?i.text:void 0;return{callExpression:e,containingStatement:a,propsObjectLiteral:n,domainVarId:o,scopeArgumentText:r.getText(),constructIdLiteral:s}}Xe(RU,"buildMatch");function OU(e){let t=e;for(;t!==void 0;){if(Ge.isExpressionStatement(t)||Ge.isVariableStatement(t))return t;t=t.parent}}Xe(OU,"findContainingTopLevelStatement");function $U(e){let t=e.parent;for(;t!==void 0;){if(Ge.isVariableDeclaration(t)&&Ge.isIdentifier(t.name)&&t.initializer===e)return t.name.text;t=t.parent}}Xe($U,"extractDomainVarId");function jU(e){switch(e.kind){case"registrar_required":return"'registrar' property is required";case"registrar_unsupported":return`'registrar' must be one of ${NU.join(", ")}, got ${JSON.stringify(e.value)}`;case"missing_field":return`'${e.field}' property is required`;case"invalid_literal":return`'${e.field}' ${e.reason}`;case"removed_field":return`'${e.field}' was removed from the Domain API \u2014 ${e.cure}`}}Xe(jU,"errorMessage");var _ee="declare the delegated child as its own Domain with registrar: 'external-delegated' and set 'parentDelegationRoleArn' (the CLI injects it via ManagedDomainBinding.delegationRoleArn); the child UPSERTs its NS records into the parent zone";function TC(e){let t=ye(e),r=se(t.registrar,NU);if(r===void 0){let u=t.registrar;if(u===void 0)return $({kind:"registrar_required"});let d=typeof u=="string"?u:xg(u);return $({kind:"registrar_unsupported",value:d})}let i=N(t.zoneName);if(i===void 0)return $({kind:"missing_field",field:"zoneName"});let n=se(t.recordIds,kU);if(t.recordIds!==void 0&&n===void 0)return $({kind:"invalid_literal",field:"recordIds",reason:`must be one of ${kU.map(u=>`'${u}'`).join(", ")}`});let a=LU(t.records);if(!a.success)return a;let o=GU(t.certificates);if(!o.success)return o;if(t.delegations!==void 0)return $({kind:"removed_field",field:"delegations",cure:_ee});let s={zoneName:i,recordIds:n,description:N(t.description),costAllocationEnvironment:N(t.costAllocationEnvironment),tags:WU(t.tags),records:a.data,certificates:o.data};switch(r){case"route53":return G({...s,registrar:r,hostedZoneId:N(t.hostedZoneId)});case"external-delegated":{let u=N(t.delegatedSubdomain);if(u===void 0)return $({kind:"missing_field",field:"delegatedSubdomain"});let d=N(t.hostedZoneId);if(t.hostedZoneId!==void 0&&d===void 0)return $({kind:"invalid_literal",field:"hostedZoneId",reason:"must be a literal string zone id on external-delegated \u2014 dynamic expressions cannot be round-tripped"});let p=Je(t.adoptedNameServers);if(t.adoptedNameServers!==void 0&&p===void 0)return $({kind:"invalid_literal",field:"adoptedNameServers",reason:"must be an array of literal NS hostname strings \u2014 the parent NS UPSERT writes them verbatim"});if(d===void 0!=(p===void 0))return $({kind:"invalid_literal",field:d===void 0?"hostedZoneId":"adoptedNameServers",reason:"adopting an existing child zone requires hostedZoneId and adoptedNameServers together (both-or-neither) \u2014 an imported zone exposes no name-server attribute at synth"});let g=N(t.parentDelegationRoleArn);if(t.parentDelegationRoleArn!==void 0&&g===void 0)return $({kind:"invalid_literal",field:"parentDelegationRoleArn",reason:"must be a literal string ARN (VD2-a) \u2014 the CLI injects it via ManagedDomainBinding.delegationRoleArn; dynamic expressions such as Fn.importValue are not supported"});let h=se(t.phase,wU);return t.phase!==void 0&&h===void 0?$({kind:"invalid_literal",field:"phase",reason:`must be one of ${wU.map(l=>`'${l}'`).join(", ")}`}):G({...s,registrar:r,delegatedSubdomain:u,hostedZoneId:d,adoptedNameServers:p,parentDelegationRoleArn:g,phase:h})}case"external-records":return G({...s,registrar:r})}}Xe(TC,"parseDomainProps");function MU(e){return jU(e)}Xe(MU,"parseDomainErrorMessage");function FU(e,t,r){let i=Ge.createSourceFile(t,e,Ge.ScriptTarget.Latest,!0,Ge.ScriptKind.TS),n=_C(i);if(!n.success)return $(new Error(n.error.message));if(n.data===void 0)return $(new Error(`Domain '${r}': no 'new Domain(...)' call found in ${t} \u2014 the file is not a Fjall domain component.`));let a=TC(n.data.propsObjectLiteral);return a.success?G(a.data):$(new Error(`Domain '${r}': infrastructure.ts could not be parsed (${a.error.kind}).`))}Xe(FU,"parseDomainInfrastructureSource");function LU(e){if(e===void 0)return G([]);if(!Array.isArray(e))return $({kind:"invalid_literal",field:"records",reason:"must be an array"});let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(!q(i))return $({kind:"invalid_literal",field:`records[${r}]`,reason:"must be an object literal"});let n=UU(i,r);if(!n.success)return n;t.push(n.data)}return G(t)}Xe(LU,"parseRecordsArray");function UU(e,t){let r=N(e.type),i=N(e.name);if(r===void 0)return $({kind:"missing_field",field:`records[${t}].type`});if(i===void 0)return $({kind:"missing_field",field:`records[${t}].name`});let n=N(e.id);if(e.id!==void 0&&(n===void 0||!Sg.safeParse(n).success))return $({kind:"invalid_literal",field:`records[${t}].id`,reason:"must be a literal alphanumeric string starting with a letter \u2014 it becomes a CloudFormation logical-ID segment"});if(e.target!==void 0){if(!Aee.some(d=>d===r))return $({kind:"invalid_literal",field:`records[${t}]`,reason:`alias records must have type 'A' or 'AAAA', got '${r}'`});let u=BU(e.target);return G({kind:"alias",type:r,name:i,target:u,...n!==void 0?{id:n}:{}})}if(!xee.some(u=>u===r))return $({kind:"invalid_literal",field:`records[${t}]`,reason:`unsupported record type '${r}'`});let a=zU(e.value);if(a===void 0)return $({kind:"invalid_literal",field:`records[${t}].value`,reason:`must be a string or array of strings (got ${JSON.stringify(e.value)})`});let o=Z(e.ttl),s={kind:"standard",type:r,name:i,value:a,...o!==void 0?{ttl:o}:{},...n!==void 0?{id:n}:{}};return G(s)}Xe(UU,"parseRecord");function zU(e){if(e===void 0)return;if(typeof e=="string")return e;let t=Je(e);if(t!==void 0)return t}Xe(zU,"parseRecordValue");function BU(e){if(Hr(e))return VU(e);if(q(e)){let t=se(e.kind,IU);if(t==="ecs"||t==="cdn"){let r=N(e.appName);if(r!==void 0)return{kind:t,appName:r}}if(t==="bucket"){let r=N(e.appName),i=N(e.bucketName);if(r!==void 0&&i!==void 0)return{kind:t,appName:r,bucketName:i}}if(t==="custom"){let r=N(e.dnsName),i=N(e.hostedZoneId);if(r!==void 0&&i!==void 0)return{kind:t,dnsName:r,hostedZoneId:i}}}return{kind:"unresolved",sourceText:xg(e)}}Xe(BU,"parseTarget");function VU(e){let t=e.__call.trim(),r=t.match(/^([A-Za-z_][\w$]*)\s*\(([\s\S]*)\)\s*$/);if(!r)return{kind:"unresolved",sourceText:t};let i=r[1],n=r[2]??"",a=Eg(n);switch(i){case"fjallApp":{let o=xn(a,0);if(o===void 0)return{kind:"dynamic",sourceText:t};if(a.length<2)return{kind:"ecs",appName:o};let s=xn(a,1);return s===void 0?{kind:"dynamic",sourceText:t}:{kind:"ecs",appName:o,computeName:s}}case"fjallCdn":{let o=xn(a,0);if(o===void 0)return{kind:"dynamic",sourceText:t};if(a.length<2)return{kind:"cdn",appName:o};let s=xn(a,1);return s===void 0?{kind:"dynamic",sourceText:t}:{kind:"cdn",appName:o,cdnName:s}}case"fjallBucket":{if(a.length<2)return{kind:"unresolved",sourceText:t};let o=xn(a,0),s=xn(a,1);return o===void 0||s===void 0?{kind:"dynamic",sourceText:t}:{kind:"bucket",appName:o,bucketName:s}}case"aliasTo":{if(a.length>=2){let o=xn(a,0),s=xn(a,1);return o!==void 0&&s!==void 0?{kind:"custom",dnsName:o,hostedZoneId:s}:{kind:"dynamic",sourceText:t}}if(a.length===1){let o=a[0]?.trim()??"",s=AC(o,"dnsName"),u=AC(o,"hostedZoneId");return s!==void 0&&u!==void 0?{kind:"custom",dnsName:s,hostedZoneId:u}:{kind:"dynamic",sourceText:t}}return{kind:"unresolved",sourceText:t}}default:return{kind:"unresolved",sourceText:t}}}Xe(VU,"resolveCallRefTarget");function Eg(e){let t=[],r=0,i=null,n="";for(let o=0;o<e.length;o++){let s=e[o];if(i!==null){if(n+=s,s==="\\"&&o+1<e.length){let u=e[o+1];u!==void 0&&(n+=u,o+=1);continue}s===i&&(i=null);continue}if(s==='"'||s==="'"||s==="`"){i=s,n+=s;continue}if(s==="("||s==="{"||s==="["){r+=1,n+=s;continue}if(s===")"||s==="}"||s==="]"){r-=1,n+=s;continue}if(s===","&&r===0){t.push(n.trim()),n="";continue}n+=s}let a=n.trim();return a.length>0&&t.push(a),t}Xe(Eg,"splitTopLevelArgs");function xn(e,t){let r=e[t];if(r===void 0)return;let i=r.trim();if(i.length<2)return;let n=i[0],a=i[i.length-1];if(n===a&&!(n!=='"'&&n!=="'"&&n!=="`"))return i.slice(1,-1)}Xe(xn,"extractStringLiteralArg");function AC(e,t){let r=e.trim().replace(/^\{|\}$/g,""),i=Eg(r);for(let n of i){let a=n.indexOf(":");if(a<0||n.slice(0,a).trim().replace(/["'`]/g,"")!==t)continue;let o=n.slice(a+1).trim();return xn([o],0)}}Xe(AC,"extractObjectFieldString");function GU(e){if(e===void 0)return G([]);if(!Array.isArray(e))return $({kind:"invalid_literal",field:"certificates",reason:"must be an array"});let t=[];for(let r=0;r<e.length;r++){let i=e[r];if(typeof i=="string"){t.push({domainName:i});continue}if(!q(i))return $({kind:"invalid_literal",field:`certificates[${r}]`,reason:"must be a string or object literal"});let n=N(i.domainName);if(n===void 0)return $({kind:"missing_field",field:`certificates[${r}].domainName`});let a=Je(i.subjectAlternativeNames),o=oe(i.transparencyLogging),s=oe(i.cloudFront);if(i.cloudFront!==void 0&&s===void 0)return $({kind:"invalid_literal",field:`certificates[${r}].cloudFront`,reason:"must be a boolean literal \u2014 the CloudFront designation drives the zone-level us-east-1 export contract and cannot be round-tripped from a dynamic expression"});t.push({domainName:n,...a!==void 0?{subjectAlternativeNames:a}:{},...o!==void 0?{transparencyLogging:o}:{},...s!==void 0?{cloudFront:s}:{}})}return G(t)}Xe(GU,"parseCertificatesArray");function WU(e){if(e===void 0||!q(e))return;let t={};for(let[r,i]of Object.entries(e)){let n=N(i);n!==void 0&&(t[r]=n)}return Object.keys(t).length===0?void 0:t}Xe(WU,"parseStringRecord");function xg(e){if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="string")return JSON.stringify(e);if(typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return`[${e.map(t=>xg(t)).join(", ")}]`;if(typeof e=="object"){if("__call"in e)return String(e.__call);if("__identifier"in e)return String(e.__identifier);if("__expression"in e)return String(e.__expression);if("__unknown"in e)return String(e.__unknown)}return String(e)}Xe(xg,"stringifyParsedValue");var Yg=ua(Ar(),1);var Tee=Object.defineProperty,so=(e,t)=>Tee(e,"name",{value:t,configurable:!0}),Kt=Symbol("non-literal");function Cee(e,t){let r={};for(let i of e.properties){if(i.type!=="Property"&&i.type!=="ObjectProperty"||i.shorthand===!0||i.computed===!0)continue;let n=ci(i.key);if(n===void 0||i.value===void 0)continue;let a=Ag(i.value);a!==Kt&&(r[n]=a)}return{...r,...t}}so(Cee,"buildMergedLiteral");function Iee(e){let t=[];for(let r of e.properties){if(r.type!=="Property"&&r.type!=="ObjectProperty"||r.shorthand===!0||r.computed===!0)continue;let i=ci(r.key);i!==void 0&&t.push(i)}return t}so(Iee,"collectPropertyKeys");function Ag(e){let t=e.value;switch(e.type){case"StringLiteral":return typeof t=="string"?t:Kt;case"NumericLiteral":return typeof t=="number"?t:Kt;case"BooleanLiteral":return typeof t=="boolean"?t:Kt;case"NullLiteral":return null;case"ArrayExpression":return KU(e);case"ObjectExpression":return ZU(e);default:return Kt}}so(Ag,"astToLiteral");function KU(e){let t=e.elements;if(!Array.isArray(t))return Kt;let r=[];for(let i of t){if(!Se(i))return Kt;let n=Ag(i);if(n===Kt)return Kt;r.push(n)}return r}so(KU,"arrayToLiteral");function ZU(e){let t=e.properties;if(!Array.isArray(t))return Kt;let r={};for(let i of t){if(!Se(i)||i.type!=="Property"&&i.type!=="ObjectProperty")return Kt;let n=ci(i.key),a=i.value;if(n===void 0||a===void 0)return Kt;let o=Ag(a);if(o===Kt)return Kt;r[n]=o}return r}so(ZU,"objectToLiteral");function ci(e){if(e===void 0)return;let t=e;if(e.type==="Identifier"&&typeof t.name=="string")return t.name;if(e.type==="StringLiteral"&&typeof t.value=="string")return t.value}so(ci,"readKeyName");function Se(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.type=="string"}so(Se,"isNodeShape");var aB=ua(iB(),1),ore=Object.defineProperty,yo=(e,t)=>ore(e,"name",{value:t,configurable:!0}),oB="\uFEFF",Zg=65279;function sre(e,t){let r=kd(t),i=cB(e),n=aB.print(e,{quote:i,lineTerminator:r,trailingComma:!0}).code,a=sB(n,t),o=t.charCodeAt(0)===Zg,s=a.charCodeAt(0)===Zg;return o&&!s?`${oB}${a}`:a}yo(sre,"printFile");var cre=/^(#![^\n\r]*)((?:\r?\n)*)/;function sB(e,t){let r=t.charCodeAt(0)===Zg?t.slice(1):t,i=cre.exec(r);if(i===null)return e;let n=i[1],a=i[2]??"";if(n===void 0)return e;let o=yo(p=>p!==""&&a===""?kd(t):a,"separatorOrFloor"),s=e.charCodeAt(0)===Zg,u=s?oB:"",d=s?e.slice(1):e;if(d.startsWith(n)){let p=d.slice(n.length).replace(/^(?:\r?\n)*/,"");return`${u}${n}${o(p)}${p}`}return d.startsWith("#!")?e:`${u}${n}${o(d)}${d}`}yo(sB,"restoreShebangPrefix");function kd(e){return e.includes(`\r
|
|
619
619
|
`)?`\r
|
|
620
620
|
`:`
|
|
621
621
|
`}yo(kd,"detectLineTerminator");function cB(e){let t=0,r=0;return uB(e,i=>{if(i.type!=="StringLiteral"&&i.type!=="Literal")return;let n=i.extra;if(!wd(n))return;let a=n.raw;if(typeof a!="string"||a.length===0)return;let o=a.charAt(0);o==="'"?t+=1:o==='"'&&(r+=1)}),t>r?"single":"double"}yo(cB,"detectQuoteStyle");function uB(e,t){let r=[e];for(;r.length>0;){let i=r.pop();if(!(!wd(i)||typeof i.type!="string")){t(i);for(let n of Object.keys(i)){if(n==="loc"||n==="comments"||n==="tokens")continue;let a=i[n];if(Array.isArray(a))for(let o of a)wd(o)&&typeof o.type=="string"&&r.push(o);else wd(a)&&typeof a.type=="string"&&r.push(a)}}}}yo(uB,"visit");function wd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}yo(wd,"isRecord");var ure=Object.defineProperty,qg=(e,t)=>ure(e,"name",{value:t,configurable:!0});function qt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}qg(qt,"isRecord");function lre(e){if(!qt(e))return;let t=e.program;if(!qt(t))return;let r=t.body;if(Array.isArray(r)&&r.every(qt))return r}qg(lre,"extractProgramBody");function mI(e,t){return e.length===0?0:e.split(t).length}qg(mI,"countLines");function dre(e,t){let r=kd(e),i=mI(t,r)-mI(e,r);return i>=0?{added:i,removed:0}:{added:0,removed:-i}}qg(dre,"computeLinesDelta");var pre=Object.defineProperty,Qr=(e,t)=>pre(e,"name",{value:t,configurable:!0});function mre(e){let t=lB(e),r=dB(e),i=Qr(n=>t.get(n)===1?r.get(n):void 0,"initFor");return{resolveString(n){let a=i(n);return a===void 0?void 0:fI(a)},resolveStringArray(n){let a=i(n);if(a===void 0)return;let o=ta(a);if(o.type!=="ArrayExpression")return;let s=o.elements;if(!Array.isArray(s))return;let u=[];for(let d of s){if(!Se(d))return;let p=fI(d);if(p===void 0)return;u.push(p)}return u},objectKeysOf:Qr(n=>Hg(n,i,new Set),"objectKeysOf")}}Qr(mre,"buildModuleConstResolver");function fI(e){let t=ta(e);if(t.type==="StringLiteral"){let r=t.value;return typeof r=="string"?r:void 0}if(t.type==="TemplateLiteral"){let r=t.expressions,i=t.quasis;if(!Array.isArray(r)||r.length!==0||!Array.isArray(i)||i.length!==1)return;let[n]=i;return!qt(n)||!qt(n.value)?void 0:typeof n.value.cooked=="string"?n.value.cooked:void 0}}Qr(fI,"readStaticString");var fre=new Set(["TSAsExpression","TSSatisfiesExpression","TSTypeAssertion","TSNonNullExpression","ParenthesizedExpression"]);function ta(e){let t=e;for(;fre.has(t.type);){let r=t.expression;if(!Se(r))return t;t=r}return t}Qr(ta,"unwrapTsWrappers");function Hg(e,t,r){let i=ta(e);if(i.type==="Identifier"){let o=i.name;if(typeof o!="string"||r.has(o))return;r.add(o);let s=t(o);return s===void 0?void 0:Hg(s,t,r)}if(i.type!=="ObjectExpression")return;let n=i.properties;if(!Array.isArray(n))return;let a=[];for(let o of n){if(!Se(o))return;if(o.type==="SpreadElement"||o.type==="SpreadProperty"){let d=o.argument;if(!Se(d))return;let p=Hg(d,t,r);if(p===void 0)return;a.push(...p);continue}if(o.type!=="Property"&&o.type!=="ObjectProperty"&&o.type!=="ObjectMethod"||o.computed===!0)return;let s=o.key;if(!Se(s))return;let u=ci(s);if(u===void 0)return;a.push(u)}return a}Qr(Hg,"objectKeysOfNode");function lB(e){let t=new Map,r=Qr(a=>{t.set(a,(t.get(a)??0)+1)},"bump"),i=Qr(a=>{if(Se(a))switch(a.type){case"Identifier":{let o=a.name;typeof o=="string"&&r(o);return}case"ObjectPattern":{let o=a.properties;if(!Array.isArray(o))return;for(let s of o)Se(s)&&(s.type==="RestElement"||s.type==="RestProperty"?i(s.argument):i(s.value));return}case"ArrayPattern":{let o=a.elements;if(!Array.isArray(o))return;for(let s of o)i(s);return}case"AssignmentPattern":i(a.left);return;case"RestElement":i(a.argument);return;case"TSParameterProperty":i(a.parameter);return;default:return}},"bumpPattern"),n=Qr(a=>{let o=[a];for(;o.length>0;){let s=o.pop();if(qt(s)){if(typeof s.type=="string"){let u=s;switch(u.type){case"VariableDeclarator":i(u.id);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":{i(u.id);let d=u.params;if(Array.isArray(d))for(let p of d)i(p);break}case"ClassDeclaration":case"ClassExpression":i(u.id);break;case"ImportSpecifier":case"ImportDefaultSpecifier":case"ImportNamespaceSpecifier":i(u.local);break;case"CatchClause":i(u.param);break;default:break}}for(let u of Object.keys(s)){if(u==="loc"||u==="comments"||u==="tokens")continue;let d=s[u];if(Array.isArray(d))for(let p of d)qt(p)&&o.push(p);else qt(d)&&o.push(d)}}}},"visitForBindings");for(let a of e)n(a);return t}Qr(lB,"countBindings");function dB(e){let t=new Map;for(let r of e){let i=r.type==="ExportNamedDeclaration"?r.declaration:r;if(!Se(i)||i.type!=="VariableDeclaration"||i.kind!=="const")continue;let n=i.declarations;if(Array.isArray(n))for(let a of n){if(!Se(a)||a.type!=="VariableDeclarator")continue;let o=a.id,s=a.init;if(!Se(o)||o.type!=="Identifier"||!Se(s))continue;let u=o.name;typeof u=="string"&&t.set(u,s)}}return t}Qr(dB,"collectTopLevelConstInits");var hre=Object.defineProperty,Jg=(e,t)=>hre(e,"name",{value:t,configurable:!0});function gre(e,t){return e.properties.find(r=>(r.type==="Property"||r.type==="ObjectProperty")&&r.shorthand!==!0&&r.computed!==!0&&ci(r.key)===t)}Jg(gre,"findPropertyByKey");function yre(e,t){return!e.properties.some(r=>r.type==="SpreadElement"||r.type==="SpreadProperty"?!0:r.type!=="Property"&&r.type!=="ObjectProperty"?!1:r.computed===!0?!0:r.shorthand===!0&&ci(r.key)===t)}Jg(yre,"objectAbsenceIsProvable");function vre(e,t){e.properties[e.properties.length-1]?.extra?.trailingComma===!0&&(t.extra={...t.extra??{},trailingComma:!0}),e.properties.push(t)}Jg(vre,"pushPropertyPreservingComma");function Xg(e,t){let r=[e];for(;r.length>0;){let i=r.pop();if(qt(i)){typeof i.type=="string"&&t(i);for(let n of Object.keys(i)){if(n==="loc"||n==="comments"||n==="tokens")continue;let a=i[n];if(Array.isArray(a))for(let o of a)qt(o)&&r.push(o);else qt(a)&&r.push(a)}}}}Jg(Xg,"visit");var bre=Object.defineProperty,vo=(e,t)=>bre(e,"name",{value:t,configurable:!0});function gI(e,t,r){let i=[];for(let p=0;p<e.length;p++){let g=e[p];if(g===void 0)continue;let h=!1;Xg(g,l=>{l.type==="CallExpression"&&Qg(l,t.factory,r)&&(h=!0)}),h&&i.push({statementIndex:p})}if(i.length===0)return $({kind:"statement-not-found"});if(i.length>1)return $({kind:"ambiguous",count:i.length});let n=i[0];if(n===void 0)return $({kind:"statement-not-found"});let a=e[n.statementIndex];if(a===void 0)return $({kind:"statement-not-found"});let o=a.type==="ExportNamedDeclaration"||a.type==="ExportDefaultDeclaration",s=yI(a);if(s===void 0)return $({kind:"unbindable-statement",statementType:a.type});if(s.type==="VariableDeclaration"){let p=s.declarations;if(!Array.isArray(p)||p.length!==1)return $({kind:"multiple-declarators"});let g=p[0].id;if(!Se(g)||g.type!=="Identifier")return $({kind:"pattern-binding"});let h=g.name;if(typeof h!="string")return $({kind:"unreadable-name"});let l=p[0].init;return!Se(l)||!hI(l,t,r)?$({kind:"init-not-app-method-wrap"}):G({variableName:h,resourceName:r,statementIndex:n.statementIndex})}if(o)return $({kind:"unbindable-statement",statementType:a.type});if(s.type!=="ExpressionStatement")return $({kind:"unbindable-statement",statementType:s.type});let u=s.expression;if(!Se(u)||u.type!=="CallExpression")return $({kind:"not-app-method-call"});if(Qg(u,t.factory,r))return $({kind:"bare-factory-call"});if(!hI(u,t,r))return $({kind:"foreign-wrapper"});let d=Er(r);return Ui.has(d)?$({kind:"reserved-word",variableName:d}):mB(e,d)?$({kind:"name-conflict",variableName:d}):G({variableName:d,resourceName:r,statementIndex:n.statementIndex,wrap:{statementIndex:n.statementIndex,expression:u}})}vo(gI,"planBinding");function Sre(e,t){if(t.wrap===void 0)return;let{statementIndex:r,expression:i}=t.wrap,n=e[r],a=Yg.builders.variableDeclaration("const",[Yg.builders.variableDeclarator(Yg.builders.identifier(t.variableName),i)]),o=n?.comments;o!==void 0&&(a.comments=o),e[r]=a}vo(Sre,"applyBinding");function Qg(e,t,r){let i=e.callee;if(!Se(i)||i.type!=="MemberExpression"||i.computed===!0)return!1;let n=i.object,a=i.property;if(!Se(n)||n.type!=="Identifier"||n.name!==t||!Se(a)||a.type!=="Identifier"||a.name!=="build")return!1;let o=e.arguments;if(!Array.isArray(o))return!1;let s=o[0];return!Se(s)||s.type!=="StringLiteral"&&s.type!=="Literal"?!1:s.value===r}vo(Qg,"isFactoryBuildOf");function yI(e){if(e.type!=="ExportNamedDeclaration"&&e.type!=="ExportDefaultDeclaration")return e;let t=e.declaration;return Se(t)?t:void 0}vo(yI,"unwrapExportDeclaration");function pB(e){let t=ta(e);if(t.type!=="CallExpression")return;let r=t.callee;if(!Se(r)||r.type!=="MemberExpression"||r.computed===!0)return;let i=r.property;if(!Se(i)||i.type!=="Identifier")return;let n=i.name;return typeof n=="string"?n:void 0}vo(pB,"appMethodNameOf");function hI(e,t,r){let i=ta(e);if(pB(i)!==t.appMethod)return!1;let n=i.arguments;if(!Array.isArray(n))return!1;let a=n[0];return Se(a)?Qg(ta(a),t.factory,r):!1}vo(hI,"isAppMethodWrap");function mB(e,t){for(let r of e){let i=yI(r);if(i!==void 0){if(i.type==="ImportDeclaration"){let n=i.specifiers;if(!Array.isArray(n))continue;for(let a of n){let o=a.local;if(Se(o)&&o.name===t)return!0}continue}if(i.type==="VariableDeclaration"){let n=i.declarations;if(!Array.isArray(n))continue;for(let a of n){if(!Se(a))continue;let o=a.id;if(!Se(o))continue;let s=!1;if(Xg(o,u=>{u.type==="Identifier"&&u.name===t&&(s=!0)}),s)return!0}continue}if(i.type==="FunctionDeclaration"||i.type==="ClassDeclaration"){let n=i.id;if(Se(n)&&n.name===t)return!0}}}return!1}vo(mB,"moduleScopeDeclares");var Ere=Object.defineProperty,kc=(e,t)=>Ere(e,"name",{value:t,configurable:!0}),xre={cdn:{default:["storage","compute"]},compute:{perKey:{connectedDatabase:["database"],connectedStorage:["storage"],connectedMessaging:["messaging"]}}};function Are(e,t,r={}){let i=xre[e],n=[],a=kc((o,s)=>{let u=t();if(u===void 0)return;let d=(s!==void 0?i?.perKey?.[s]:void 0)??i?.default??[],p=[];for(let l of d){let m=ni[l].emitWrapper?.appMethod;if(m===void 0)continue;let f=gI(u,{factory:Bt[l],appMethod:m},o);if(f.success){p.push(f.data);continue}if(f.error.kind!=="statement-not-found")return}if(p.length!==1)return;let g=p[0];if(g===void 0)return;let h=r.mustPrecedeStatementIndex;if(!(h!==void 0&&g.statementIndex>=h))return g.wrap!==void 0&&n.push({plan:g,...s!==void 0&&{planKey:s}}),g.variableName},"resolveBinding");return{resolveBinding:a,resolveBindings:kc((o,s)=>{let u=n.length,d=[];for(let p of o){let g=a(p,s);if(g===void 0){n.length=u;return}d.push(g)}return d},"resolveBindings"),takePendingWraps:kc(()=>{let o=n;return n=[],o.map(s=>s.plan)},"takePendingWraps"),pendingDeclarations:kc(()=>n.map(({plan:o,planKey:s})=>({variableName:o.variableName,resourceName:o.resourceName,statementIndex:o.statementIndex,...s!==void 0&&{planKey:s}})),"pendingDeclarations")}}kc(Are,"createSiblingBindingResolution");function vI(e){let t=new Map;for(let r of e){let i=t.get(r.variableName);if(i===void 0){t.set(r.variableName,r);continue}if(i.statementIndex!==r.statementIndex)return{first:i,second:r}}}kc(vI,"findPendingWrapCollision");var _re=Object.defineProperty,Mr=(e,t)=>_re(e,"name",{value:t,configurable:!0});function fB(e){return e?.map(t=>({name:t.name,...t.serviceType!==void 0&&{serviceType:t.serviceType},...t.docker!==void 0&&{docker:t.docker},...t.containerPort!==void 0&&{containerPort:t.containerPort},...t.needsDatabaseConnection!==void 0&&{needsDatabaseConnection:t.needsDatabaseConnection},...t.routing!==void 0&&{routing:t.routing}}))}Mr(fB,"toUserServiceConfigs");function hB(e,t,r=!0,i,n){let a={appName:e,type:t,database:[],s3:[],compute:[]};if(t==="custom")return a;let o=t,s=ii[o];return{...a,database:gB(e,s,o,r,n),compute:SB(e,s,o,r,i),network:s.network,backup:s.backup}}Mr(hB,"planApplicationResources");function gB(e,t,r,i,n){let a=CT(r),o=t.database[a];return!i||o===null?[]:[{name:e,type:a,databaseName:Do(e),variableName:`${Er(e)}Database`,...o,...n?.snapshotIdentifier!==void 0&&{snapshotIdentifier:n.snapshotIdentifier},...n?.snapshotUsername!==void 0&&{snapshotUsername:n.snapshotUsername}}]}Mr(gB,"buildDatabasePlan");function yB(e,t){if(!(e===void 0&&t===void 0))return{scaling:{...e!==void 0&&{minCapacity:e},...t!==void 0&&{maxCapacity:t}}}}Mr(yB,"buildScalingConfig");function bI(e){let{minCapacity:t,maxCapacity:r,...i}=e;return{...i,...yB(t,r)}}Mr(bI,"planServiceFromTierPreset");function vB(e,t){let r=bI(e),i=t?.serviceType==="worker",n=t?.containerPort??c1,a=t?.docker;return{...r,...a?.path!==void 0&&{docker:{path:a.path,...a.context!==void 0&&{context:a.context},...a.target!==void 0&&{target:a.target}}},...t?.needsDatabaseConnection!==void 0&&{needsDatabaseConnection:t.needsDatabaseConnection},...i&&{serviceType:"worker"},containers:i?[{}]:[{port:n}]}}Mr(vB,"buildServiceEntry");function bB(e,t){return t||e?.directAccess===!0?e:{...e,loadBalancer:!1}}Mr(bB,"resolveClusterConfig");function SB(e,t,r,i,n){let a=t.compute.ecs,o=(n&&n.length>0?IT(r,n):a.services.map((u,d)=>({...u,name:d===0?"api":`service-${d+1}`}))).map((u,d)=>vB(u,n?.[d])),s=o.some(u=>u.containers?.some(d=>d.port!==void 0));return[{name:e,type:Yu.ECS,needsConnection:i,connectedDatabase:i?[e]:void 0,variableName:`${Er(e)}Compute`,cluster:bB(a.cluster,s),services:o}]}Mr(SB,"buildComputePlan");function EB(e){let t=[],r=0,i=Mr((a,o,s)=>{t.push({variableName:a,resourceName:o,statementIndex:r++,planKey:s})},"declare");for(let a of e.additionalNetworks??[])i(Er(a.name),a.name,"additionalNetworks");if(tc(e))return t;for(let a of e.database)Rl(a,e)&&i(ke(a),a.name,"database");for(let a of e.clickhouse??[])Ol(a,e)&&i(ke(a),a.name,"clickhouse");for(let a of e.s3)Wl(a,e)&&i(ke(a),a.name,"s3");for(let a of e.dynamodb??[])i(ke(a),a.name,"dynamodb");for(let a of e.sqs??[])Kl(a,e)&&i(ke(a),a.name,"sqs");let n=Yl(e);for(let a of e.compute)(n.has(a.name)||a.scheduleExpression!==void 0)&&i(ke(a),a.name,"compute");return t}Mr(EB,"collectPlannedDeclarations");function xB(e){let t=[],r=/^const\s+([A-Za-z_$][A-Za-z0-9_$]*)\s*=/gm,i=Xl(e),n=-1,a;for(;(a=r.exec(i))!==null;){let o=a[1];o!==void 0&&t.push({variableName:o,resourceName:o,statementIndex:n--,planKey:"prelude"})}return t}Mr(xB,"collectPreludeDeclarations");function Nc(e,t){let r=EB(e),i=r.find(s=>Ui.has(s.variableName));if(i!==void 0)return $(new Error(`Cannot generate infrastructure: ${i.planKey} resource "${i.resourceName}" binds the module-scope const \`${i.variableName}\`, a JavaScript reserved word \u2014 the generated file would not parse. Rename the resource, or give it a distinct variableName in the plan.`));let n=vI([...xB(e),...r]);if(n!==void 0)return n.first.planKey==="prelude"?$(new Error(`Cannot generate infrastructure: ${n.second.planKey} resource "${n.second.resourceName}" binds the module-scope const \`${n.first.variableName}\`, which the scaffold prelude itself declares \u2014 the generated file would not compile (Identifier '${n.first.variableName}' has already been declared). Rename the resource, or give it a distinct variableName in the plan.`)):$(new Error(`Cannot generate infrastructure: ${n.first.planKey} resource "${n.first.resourceName}" and ${n.second.planKey} resource "${n.second.resourceName}" both bind the module-scope const \`${n.first.variableName}\` \u2014 the generated file would not compile (Identifier '${n.first.variableName}' has already been declared). Rename one of the resources, or give one a distinct variableName in the plan.`));if(!tc(e)){let s=qh(e);if(s!==void 0)return $(new Error(`Cannot generate infrastructure: compute resource "${s.resourceName}" key \`${s.key}\` cannot be emitted \u2014 ${s.reason}`))}let a=[eg(e),Xl(e),Qh(e)];if(tc(e))a.push(ql(e),Jl(e));else{let s=Yl(e);a.push(Jl(e),Fh(e),Lh(e),Jh(e),Xh(e),Yh(e),Hh(e,s),tg(e))}let o=a.join("");if(e.customCodeBlocks&&e.customCodeBlocks.length>0){let s=bg(o,e.customCodeBlocks,t?.resourceMapping);return s.success?G(s.content):$(new Error(`Custom code injection failed: ${s.error??"unknown error"}`))}return G(o)}Mr(Nc,"generateInfrastructureFromPlan");var Tre=Object.defineProperty,Pc=(e,t)=>Tre(e,"name",{value:t,configurable:!0}),Cre=TT("standard");function AB(e){return fl.options.some(t=>t.shape?.type?.value===e)}Pc(AB,"isPatternConfigType");function _B(e,t,r){let{tier:i="standard",domain:n,database:a,compute:o,cdn:s,environment:u,tags:d}=r??{},p=ng(i);if(!p&&i!=="custom")return $(new Error(`Invalid pattern tier: "${i}". Valid tiers are: ${[...ed,"custom"].join(", ")}`));if(!AB(t))return $(new Error(`Unsupported pattern type: ${t}`));let g=p?rg(i):null,h=DB(t,e,{domain:n,database:a,compute:o,cdn:s,environment:u,tierPreset:g});if(!h.success)return h;let l=h.data;return G({appName:e,type:"standard",pattern:t,network:g?g.network:Cre,backup:g?g.backup:!1,patternConfig:l,database:[],s3:[],compute:[],tags:d??{}})}Pc(_B,"planOpenNextResources");function TB(e,t){return{type:e?.type??t.database.type,instanceType:e?.instanceType??t.database.instanceType,backupRetention:e?.backupRetention??t.database.backupRetention,deletionProtection:e?.deletionProtection??t.database.deletionProtection,...e?.databaseName!==void 0&&{databaseName:e.databaseName},...e?.publiclyAccessible!==void 0&&{publiclyAccessible:e.publiclyAccessible},...e?.allowedIpCidr!==void 0&&{allowedIpCidr:e.allowedIpCidr},...e?.encryption!==void 0&&{encryption:e.encryption}}}Pc(TB,"mergeDatabaseConfig");function CB(e,t){return{memorySize:e?.memorySize??t.compute.memorySize,timeout:e?.timeout??t.compute.timeout}}Pc(CB,"mergeComputeConfig");function IB(e){let{encryption:t,...r}=e;return{...r,...t&&{encryption:{storageKey:t}}}}Pc(IB,"toPatternDatabaseConfig");function DB(e,t,r){let{domain:i,database:n,compute:a,cdn:o,environment:s,tierPreset:u}=r,d=u?TB(n,u):n,p=u?CB(a,u):a,g={type:e,name:t,domain:i,database:d?IB(d):void 0,compute:p?{server:p}:void 0,cdn:o?{domainNames:o.domainNames,certificateArn:o.certificateArn}:void 0,environment:s},h=fl.safeParse(g);return h.success?G(h.data):$(new Error(`Invalid pattern config: ${h.error.message}`))}Pc(DB,"buildPatternConfig");var Ire=Object.defineProperty,Dre=(e,t)=>Ire(e,"name",{value:t,configurable:!0});function wB(e,t){let r={type:"staticsite",name:e,source:t.source,build:t.build,...t.routing!==void 0&&{routing:t.routing},...t.security!==void 0&&{security:t.security},...t.domain!==void 0&&{domain:t.domain},...t.forms!==void 0&&{forms:t.forms},...t.cdn!==void 0&&{cdn:t.cdn}},i=ml.safeParse(r);return i.success?G({appName:e,type:"standard",pattern:"staticsite",patternConfig:i.data,database:[],s3:[],compute:[],tags:t.tags??{}}):$(new Error(`Invalid static-site pattern config: ${i.error.message}`))}Dre(wB,"planStaticSiteResources");var wre=Object.defineProperty,ey=(e,t)=>wre(e,"name",{value:t,configurable:!0});function kB(e){let t=e.split("/");if(t.length!==2||!t[0]||!t[1])throw new Error(`Invalid service reference format: '${e}'. Expected 'ClusterName/ServiceName'.`);return t[0]}ey(kB,"parseServiceReference");function SI(e,t,r){r==="database"?(e.needsConnection=!0,e.connectedDatabase=[...new Set([...e.connectedDatabase??[],t])]):e.connectedStorage=[...new Set([...e.connectedStorage??[],t])]}ey(SI,"addResourceConnection");function ty(e,t,r,i){let n=new Set(t),a=[...new Set(t.map(kB))];for(let o of a){let s=e.compute.find(u=>u.name===o);if(s?.services){SI(s,r,i);for(let u of s.services){let d=`${o}/${u.name}`;n.has(d)&&(i==="database"?u.needsDatabaseConnection=!0:u.needsStorageConnection=!0)}}}}ey(ty,"applyServiceConnections");function ry(e,t,r,i){for(let n of e.compute)if(t.includes(n.name)&&(SI(n,r,i),n.services))for(let a of n.services)i==="database"?a.needsDatabaseConnection=!0:a.needsStorageConnection=!0}ey(ry,"applyComputeConnections");var kre=Object.defineProperty,st=(e,t)=>kre(e,"name",{value:t,configurable:!0});function NB(e){let t=e.database.length>0,r=e.cdn!==void 0;return[{type:"database",label:"Database (RDS)",available:!0},{type:"database:proxy",label:"RDS Proxy",available:t,reason:t?void 0:"Requires at least one database"},{type:"storage:s3",label:"S3 Bucket",available:!0},{type:"network",label:"Network (VPC)",available:!0},{type:"compute:ecs",label:"Compute (ECS)",available:!0},{type:"compute:lambda",label:"Compute (Lambda)",available:!0},{type:"cdn",label:"CDN (CloudFront)",available:!r,reason:r?"A CDN is already configured. Remove existing CDN first.":void 0},{type:"tunnel",label:"Database Tunnel",available:t&&!e.tunnel,reason:t?e.tunnel?"Tunnel is already enabled":void 0:"Requires at least one database"}]}st(NB,"listAvailableResources");function Nd(e,t){if(xI(e,t.resourceName))return $(new Error(AI(t.resourceName)));switch(t.type){case"database":return PB(e,t);case"database:proxy":return RB(e,t);case"storage:s3":return G(void 0);case"network":return G(void 0);case"compute:ecs":return!t.services||t.services.length===0?$(new Error("ECS compute requires at least one service.")):G(void 0);case"compute:lambda":return G(void 0);case"cdn":return OB(e,t);case"tunnel":return $B(e);default:{let r=t;return $(new Error(`Unknown resource type: ${String(r)}`))}}}st(Nd,"validateResourceAddition");function PB(e,t){let r=t.databaseName??t.resourceName.toLowerCase();return e.database.some(i=>i.databaseName===r)?$(new Error(`Database name '${r}' already exists. Choose a different database name.`)):t.databaseType==="GlobalAurora"&&!t.primaryRegion?$(new Error("GlobalAurora databases require a primaryRegion.")):G(void 0)}st(PB,"validateDatabaseAddition");function RB(e,t){let r=e.database.find(i=>i.name===t.targetDatabase||i.databaseName===t.targetDatabase);if(!r){let i=e.database.map(n=>n.name).join(", ")||"none";return $(new Error(`Database '${t.targetDatabase}' not found. Available databases: ${i}`))}return r.proxy!==void 0&&r.proxy!==!1?$(new Error(`Database '${r.name}' already has RDS Proxy enabled.`)):G(void 0)}st(RB,"validateProxyAddition");function OB(e,t){if(e.cdn)return $(new Error("A CDN is already configured for this application. Remove the existing CDN first."));if(!EI(e,t.defaultOriginRef))return $(new Error(`Origin '${t.defaultOriginRef}' not found in plan. CDN origin must reference an existing resource.`));if(t.behaviours){for(let r of t.behaviours)if(!EI(e,r.originRef))return $(new Error(`Behaviour origin '${r.originRef}' not found in plan.`))}return G(void 0)}st(OB,"validateCdnAddition");function $B(e){return e.tunnel&&typeof e.tunnel=="object"?$(new Error("Tunnel is already enabled for this application.")):e.database.length===0?$(new Error("No databases found \u2014 tunnel requires at least one relational database.")):G(void 0)}st($B,"validateTunnelAddition");function ny(e,t){let r=Nd(e,t);if(!r.success)return r;switch(t.type){case"database":return jB(e,t);case"database:proxy":return MB(e,t);case"storage:s3":return FB(e,t);case"network":return LB(e,t);case"compute:ecs":return UB(e,t);case"compute:lambda":return zB(e,t);case"cdn":return BB(e,t);case"tunnel":return VB(e,t);default:{let i=t;return $(new Error(`Unknown resource type: ${String(i)}`))}}}st(ny,"addResourceToPlan");function jB(e,t){let r=t.databaseName??t.resourceName.toLowerCase(),i={name:t.resourceName,type:t.databaseType,databaseName:r},n;switch(t.databaseType){case"Instance":n={...i,...t.instanceType!==void 0?{instanceType:t.instanceType}:{},...t.multiAz!==void 0?{multiAz:t.multiAz}:{},...t.readReplica!==void 0?{readReplica:t.readReplica}:{},...t.publiclyAccessible!==void 0?{publiclyAccessible:t.publiclyAccessible}:{},...t.backupRetention!==void 0?{backupRetention:t.backupRetention}:{}};break;case"Aurora":n={...i,...t.writer!==void 0?{writer:t.writer}:{},...t.readers!==void 0?{readers:t.readers}:{},...t.backupRetention!==void 0?{backupRetention:t.backupRetention}:{},...t.preferredMaintenanceWindow!==void 0?{preferredMaintenanceWindow:t.preferredMaintenanceWindow}:{}};break;case"GlobalAurora":n={...i,primaryRegion:t.primaryRegion,...t.secondaryRegions!==void 0?{secondaryRegions:t.secondaryRegions}:{}};break;default:{let o=t.databaseType;return $(new Error(`Unknown database type: ${String(o)}`))}}let a={...e,database:[...e.database,n]};return _I(a,t.resourceName,"database",t),G(a)}st(jB,"addDatabase");function MB(e,t){let r=e.database.map(a=>({...a})),i=r.find(a=>a.name===t.targetDatabase||a.databaseName===t.targetDatabase);if(!i)return $(new Error(`Database '${t.targetDatabase}' not found.`));let n={};return t.maxConnections!==void 0&&(n.maxConnections=t.maxConnections),t.maxIdleConnections!==void 0&&(n.maxIdleConnections=t.maxIdleConnections),t.connectionBorrowTimeout!==void 0&&(n.connectionBorrowTimeout=t.connectionBorrowTimeout),t.requireTLS!==void 0&&(n.requireTLS=t.requireTLS),i.proxy=Object.keys(n).length>0?n:{},G({...e,database:r})}st(MB,"addProxy");function FB(e,t){let r=t.bucketName??t.resourceName.toLowerCase(),i=Qe(r),n=e.s3.length,a=n===0?"":`${n+1}`,o={name:i,bucketName:r,variableName:`bucket${a}`,...t.publicReadAccess!==void 0?{publicReadAccess:t.publicReadAccess}:{},...t.versioned!==void 0?{versioned:t.versioned}:{},...t.encryption!==void 0?{encryption:t.encryption}:{},...t.websiteHosting?{websiteHosting:{indexDocument:"index.html"}}:{}},s={...e,s3:[...e.s3,o]};return _I(s,i,"storage",t),G(s)}st(FB,"addS3");function LB(e,t){let r={};if(t.maxAzs!==void 0&&(r.maxAzs=t.maxAzs),t.natGateways!==void 0&&(r.natGateways=t.natGateways),t.flowLogs!==void 0&&(r.flowLogs=t.flowLogs),t.vpcEndpoints!==void 0&&(r.vpcEndpoints=t.vpcEndpoints),t.networkName){let i={name:t.networkName,...r};return G({...e,additionalNetworks:[...e.additionalNetworks??[],i]})}return G({...e,network:{...e.network??{},...r}})}st(LB,"addNetwork");function UB(e,t){let r=t.connectedDatabase??[],i={name:t.resourceName,type:"ecs",needsConnection:r.length>0,connectedDatabase:r,...t.loadBalancer!==void 0?{cluster:{loadBalancer:t.loadBalancer}}:{},services:t.services.map(n=>({name:n.name,capacityProvider:n.capacityProvider??"FARGATE",...n.port!==void 0?{containers:[{port:n.port}]}:{},...n.cpu!==void 0?{cpu:n.cpu}:{},...n.memory!==void 0?{memoryLimitMiB:n.memory}:{}})),...t.docker!==void 0&&{docker:t.docker}};return G({...e,compute:[...e.compute,i]})}st(UB,"addEcsCompute");function zB(e,t){let r=t.connectedDatabase??[],i={name:t.resourceName,type:"lambda",needsConnection:r.length>0,connectedDatabase:r,...t.timeout!==void 0?{timeout:t.timeout}:{},...t.memory!==void 0?{memory:t.memory}:{},...t.handler!==void 0?{handler:t.handler}:{},...t.runtime!==void 0?{runtime:t.runtime}:{}};return G({...e,compute:[...e.compute,i]})}st(zB,"addLambdaCompute");function BB(e,t){let r={name:t.resourceName,defaultOriginRef:t.defaultOriginRef,...t.customDomain!==void 0?{customDomain:t.customDomain}:{},...t.certificateArn!==void 0?{certificateArn:t.certificateArn}:{},...t.domain!==void 0?{domain:t.domain}:{},...t.originHostname!==void 0?{originHostname:t.originHostname}:{},...t.behaviours&&t.behaviours.length>0?{behaviours:[...t.behaviours].map(i=>({pathPattern:i.pathPattern,originRef:i.originRef,...i.cachePolicy!==void 0?{cachePolicy:i.cachePolicy}:{}}))}:{}};return G({...e,cdn:r})}st(BB,"addCdn");function VB(e,t){let r=t.instanceType?{instanceType:t.instanceType}:{};return G({...e,tunnel:r})}st(VB,"addTunnel");function xI(e,t){let r=[...e.database.map(i=>i.name),...(e.clickhouse??[]).map(i=>i.name),...e.s3.map(i=>i.name),...e.compute.map(i=>i.name),...(e.dynamodb??[]).map(i=>i.name),...(e.sqs??[]).map(i=>i.name),...(e.additionalNetworks??[]).map(i=>i.name)];return e.cdn&&r.push(e.cdn.name),r.includes(t)}st(xI,"isResourceNameTaken");function AI(e){return`Resource name '${e}' is already used in this application.`}st(AI,"resourceNameTakenMessage");function EI(e,t){return e.database.some(r=>r.name===t)||e.s3.some(r=>r.name===t)||e.compute.some(r=>r.name===t)||(e.dynamodb??[]).some(r=>r.name===t)||(e.sqs??[]).some(r=>r.name===t)}st(EI,"resourceExistsInPlan");function _I(e,t,r,i){i.connectToCompute&&i.connectToCompute.length>0&&ry(e,[...i.connectToCompute],t,r),i.connectToServices&&i.connectToServices.length>0&&ty(e,[...i.connectToServices],t,r)}st(_I,"applyConnections");var Nre=Object.defineProperty,Pre=(e,t)=>Nre(e,"name",{value:t,configurable:!0});function GB(e,t,r){let i;try{i=Hi(e,{extractCustomCode:!0})}catch(u){return $(new Error(`Failed to parse infrastructure.ts: ${u instanceof Error?u.message:String(u)}`))}let n;try{n=ao(i,t,{skipValidation:!0})}catch(u){return $(new Error(`Failed to build resource plan: ${u instanceof Error?u.message:String(u)}`))}i.customCodeBlocks&&i.customCodeBlocks.length>0&&(n.customCodeBlocks=i.customCodeBlocks);let a=Nd(n,r);if(!a.success)return a;let o=ny(n,r);if(!o.success)return o;let s=Nc(o.data);return s.success?G({originalContent:e,modifiedContent:s.data,addedResource:{type:r.type,name:r.resourceName}}):$(new Error(`Code generation failed: ${s.error.message}`))}Pre(GB,"generateResourceChange");var Rre=Object.defineProperty,bo=(e,t)=>Rre(e,"name",{value:t,configurable:!0});function Dn(e,...t){let r={};for(let i of t)e[i]!==void 0&&(r[i]=e[i]);return r}bo(Dn,"pickDefined");function WB(e,t){let r={name:e,type:t.databaseType,databaseName:t.databaseName,...Dn(t,"databaseInsights","port","proxy","credentials","encryption","deletionProtection")};switch(t.databaseType){case"Instance":return{...r,...Dn(t,"instanceType","multiAz","readReplica","publiclyAccessible","backupRetention","allocatedStorage","snapshotIdentifier","snapshotUsername")};case"Aurora":return{...r,...Dn(t,"writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};case"GlobalAurora":return{...r,primaryRegion:t.primaryRegion,...t.secondaryRegions&&t.secondaryRegions.length>0&&{secondaryRegions:t.secondaryRegions},...Dn(t,"globalClusterIdentifier","enableGlobalWriteForwarding","writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};default:return t}}bo(WB,"buildRelationalResourcePlan");function KB(e){return`${e}Database`}bo(KB,"defaultRelationalDatabaseName");function ZB(e,t){return`Database name '${e}' already exists in ${t}. Please choose a different database name.`}bo(ZB,"duplicateDatabaseNameMessage");function qB(e,t){let r=e.find(n=>n.name===t.databaseName||n.databaseName===t.databaseName);if(!r)return{ok:!1,message:`Database '${t.databaseName}' not found. Available databases: ${e.map(n=>n.name).join(", ")||"none"}`};if(r.proxy!==void 0&&r.proxy!==!1)return{ok:!1,message:`Database '${r.name}' already has RDS Proxy enabled.`};let i=Dn(t,"maxConnections","maxIdleConnections","connectionBorrowTimeout","requireTLS");return{ok:!0,database:r,proxyValue:Object.keys(i).length>0?i:{}}}bo(qB,"resolveProxyAddition");function HB(e,t){return{name:e,type:"ClickHouse",databaseName:t.databaseName,...Dn(t,"instanceType","storageGb","iops","throughputMbps","coldTier","optimiseSchedule","backupSchedule","backupVerify","backupRetentionDays")}}bo(HB,"buildClickHouseResourcePlan");function JB(e,t,r){let i=t.storagePreset??"standard",n=ig[i],a=r===0?"":`${r+1}`;return{name:e,bucketName:t.bucketName,variableName:`bucket${a}`,...n,...Dn(t,"publicReadAccess","websiteHosting","backupVaultTier","versioned","encryption","kmsKeyArn","cors")}}bo(JB,"buildS3ResourcePlan");var Ore=Object.defineProperty,fi=(e,t)=>Ore(e,"name",{value:t,configurable:!0}),$re=new Set(dd.options);function XB(e){return $re.has(e.toUpperCase())}fi(XB,"isRecordType");function YB(e){return e.endsWith(".")?e.slice(0,-1):e}fi(YB,"stripTrailingDot");function QB(e){let t=!1;for(let r=0;r<e.length;r++)if(e[r]==='"')t=!t;else if(e[r]===";"&&!t)return e.slice(0,r).trimEnd();return e}fi(QB,"stripInlineComment");function e2(e,t){let r=e.slice(t).join(" "),i=[],n="",a=!1;for(let o of r)o==='"'?(a&&(i.push(n),n=""),a=!a):a&&(n+=o);return i.join(" ")}fi(e2,"parseTxtValue");function t2(e){let t=/;\s*auto\s*$/.test(e),r=e.replace(/;\s*auto\s*$/,"").trim().match(/^\$FJALL-DELEGATE\s+(\S+)\s+TO\s+(\S+)$/i);if(r)return{subdomain:r[1],targetAccount:r[2],auto:t}}fi(t2,"parseDelegateDirective");function r2(e){if(e.length<2)return;let t=e[1],r=e.slice(2);return{domainName:t,subjectAlternativeNames:r}}fi(r2,"parseCertDirective");function n2(e){let t=[],r="",i=!1;for(let n of e)n==='"'?(i=!i,r+=n):/\s/.test(n)&&!i?r.length>0&&(t.push(r),r=""):r+=n;return r.length>0&&t.push(r),t}fi(n2,"tokenise");function i2(e){if(e.length<2)return;let t=0,r=e[t++],i,n;for(;t<e.length&&n===void 0;){let o=e[t].toUpperCase();if(o==="IN")t++;else if(XB(o))n=o,t++;else if(/^\d+$/.test(e[t]))i=parseInt(e[t],10),t++;else return}if(!n)return;let a=e.slice(t);switch(n){case"MX":{if(a.length<2)return;let o=parseInt(a[0],10),s=a.slice(1).join(" ");return{name:r,type:n,ttl:i,value:s,priority:o}}case"SRV":{if(a.length<4)return;let o=parseInt(a[0],10),s=parseInt(a[1],10),u=parseInt(a[2],10),d=a[3];return{name:r,type:n,ttl:i,value:d,priority:o,weight:s,port:u}}case"TXT":{let o=e2(e,t);return{name:r,type:n,ttl:i,value:o}}case"CAA":{let o=a.join(" ");return{name:r,type:n,ttl:i,value:o}}case"A":case"AAAA":{if(a.length===0)return;if(a[0].toUpperCase()==="ALIAS"){if(a.length<2)return;let o=a.slice(1).join(" ");return{name:r,type:n,ttl:i,value:`${TU}${o}`}}return{name:r,type:n,ttl:i,value:a[0]}}default:return a.length===0?void 0:{name:r,type:n,ttl:i,value:a[0]}}}fi(i2,"parseRecord");function a2(e){let t=e.split(`
|
|
@@ -821,4 +821,4 @@ ${nl(i.error)}`);return i.data}Eo(L2,"validateGeneratorOptions");function U2(e,t
|
|
|
821
821
|
`);return i}yG(uoe,"selectResources");var oa=ua(WD(),1),loe=Object.defineProperty,Sy=(e,t)=>loe(e,"name",{value:t,configurable:!0});function vG(e){let t=[];for(let r of e.s3)t.push({name:r.name,description:"S3 Storage"});for(let r of e.compute)r.type==="lambda"?r.functionUrl&&t.push({name:r.name,description:"Lambda"}):r.type==="ecs"&&t.push({name:r.name,description:"ECS with ALB"});return t}Sy(vG,"collectAvailableOrigins");function qD(e,t){if(!t.some(r=>r.name===e)){let r=t.map(i=>i.name).join(", ");throw new Error(`Origin "${e}" not found in infrastructure. Available origins: ${r}`)}}Sy(qD,"validateOriginRef");async function bG(e,t){let r=vG(e);if(r.length===0)throw new Error("No available CDN origins found. Add an S3 bucket or compute resource with ALB/function URL first.");if(t.defaultOriginRef){if(qD(t.defaultOriginRef,r),t.behaviours)for(let s of t.behaviours)qD(s.originRef,r);return{defaultOriginRef:t.defaultOriginRef,behaviours:t.behaviours,...t.customDomain&&{customDomain:t.customDomain}}}if(t.nameProvidedByFlag)throw new Error("Default origin must be specified in non-interactive mode");let i;if(r.length===1)i=r[0].name,process.stdout.write(`
|
|
822
822
|
Auto-selected origin: ${i}
|
|
823
823
|
`);else if(i=(await(0,oa.default)([{type:"select",name:"origin",message:"Select the default origin:",choices:r.map(s=>({title:`${s.name} (${s.description})`,value:s.name}))}])).origin,!i)throw new Error("Origin selection cancelled");let n,a=r.filter(s=>s.name!==i);if(a.length>0&&await ZD(a.length,"origin","Add path-based routing to another origin?","Add path-based routing to other origins?")){n=[];let s=!0;for(;s&&a.length>0;){let u=(await(0,oa.default)([{type:"text",name:"pathPattern",message:"Path pattern (e.g., /static/*):"}])).pathPattern;if(!u)break;let d;if(a.length===1)d=a[0].name,process.stdout.write(` Auto-selected origin: ${d}
|
|
824
|
-
`);else if(d=(await(0,oa.default)([{type:"select",name:"origin",message:"Origin for this path:",choices:a.map(g=>({title:`${g.name} (${g.description})`,value:g.name}))}])).origin,!d)break;let p=(await(0,oa.default)([{type:"select",name:"cachePolicy",message:"Cache policy:",choices:[{title:"Caching Optimised",value:"CACHING_OPTIMIZED",description:"Best for static assets"},{title:"Caching Disabled",value:"CACHING_DISABLED",description:"Best for dynamic APIs"}]}])).cachePolicy;n.push({pathPattern:u,originRef:d,...p!==void 0&&{cachePolicy:p}}),s=(await(0,oa.default)([{type:"confirm",name:"addMore",message:"Add another path route?",initial:!1}])).addMore}n.length===0&&(n=void 0)}let o;return(await(0,oa.default)([{type:"confirm",name:"wantDomain",message:"Add a custom domain?",initial:!1}])).wantDomain&&(o=(await(0,oa.default)([{type:"text",name:"domain",message:"Enter custom domain:"}])).domain||void 0),{defaultOriginRef:i,behaviours:n,...o!==void 0&&{customDomain:o}}}Sy(bG,"handleCdnOriginSelection");async function SG(e,t){await OI(e,z1,t,"CDN",async({validated:r,plan:i})=>{if(i.cdn)throw new Error("A CDN is already configured for this application. Remove the existing CDN first.");let n=await bG(i,r),a=r.name??`${Qe(r.appName)}Cdn`;return{...i,cdn:{name:a,defaultOriginRef:n.defaultOriginRef,...n.behaviours&&n.behaviours.length>0&&{behaviours:n.behaviours},...n.customDomain!==void 0&&{customDomain:n.customDomain},...r.certificateArn!==void 0&&{certificateArn:r.certificateArn},...r.domain!==void 0&&{domain:r.domain},...r.originHostname!==void 0&&{originHostname:r.originHostname},...r.accessGate!==void 0&&{accessGate:r.accessGate}}}})}Sy(SG,"cdnGenerator");var
|
|
824
|
+
`);else if(d=(await(0,oa.default)([{type:"select",name:"origin",message:"Origin for this path:",choices:a.map(g=>({title:`${g.name} (${g.description})`,value:g.name}))}])).origin,!d)break;let p=(await(0,oa.default)([{type:"select",name:"cachePolicy",message:"Cache policy:",choices:[{title:"Caching Optimised",value:"CACHING_OPTIMIZED",description:"Best for static assets"},{title:"Caching Disabled",value:"CACHING_DISABLED",description:"Best for dynamic APIs"}]}])).cachePolicy;n.push({pathPattern:u,originRef:d,...p!==void 0&&{cachePolicy:p}}),s=(await(0,oa.default)([{type:"confirm",name:"addMore",message:"Add another path route?",initial:!1}])).addMore}n.length===0&&(n=void 0)}let o;return(await(0,oa.default)([{type:"confirm",name:"wantDomain",message:"Add a custom domain?",initial:!1}])).wantDomain&&(o=(await(0,oa.default)([{type:"text",name:"domain",message:"Enter custom domain:"}])).domain||void 0),{defaultOriginRef:i,behaviours:n,...o!==void 0&&{customDomain:o}}}Sy(bG,"handleCdnOriginSelection");async function SG(e,t){await OI(e,z1,t,"CDN",async({validated:r,plan:i})=>{if(i.cdn)throw new Error("A CDN is already configured for this application. Remove the existing CDN first.");let n=await bG(i,r),a=r.name??`${Qe(r.appName)}Cdn`;return{...i,cdn:{name:a,defaultOriginRef:n.defaultOriginRef,...n.behaviours&&n.behaviours.length>0&&{behaviours:n.behaviours},...n.customDomain!==void 0&&{customDomain:n.customDomain},...r.certificateArn!==void 0&&{certificateArn:r.certificateArn},...r.domain!==void 0&&{domain:r.domain},...r.originHostname!==void 0&&{originHostname:r.originHostname},...r.accessGate!==void 0&&{accessGate:r.accessGate}}}})}Sy(SG,"cdnGenerator");var hTe=SG;export{SG as cdnGenerator,hTe as default};
|