@stacksjs/ai 0.64.6 → 0.66.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/dist/index.d.ts +4 -0
- package/dist/index.js +208 -12
- package/dist/index.js.map +540 -112
- package/dist/text.d.ts +9 -0
- package/dist/utils/client-bedrock-runtime.d.ts +7 -0
- package/dist/utils/client-bedrock.d.ts +5 -0
- package/dist/utils/model-access.d.ts +1 -0
- package/package.json +10 -15
- package/src/index.ts +2 -2
- package/src/text.ts +69 -0
- package/src/utils/client-bedrock-runtime.ts +5 -1
- package/src/utils/client-bedrock.ts +1 -0
- package/src/utils/model-access.ts +48 -0
- /package/{src/chatbots.ts → dist/image.d.ts} +0 -0
- /package/{src/image-generation.ts → dist/personalization.d.ts} +0 -0
- /package/{src/text-generation.ts → dist/search.d.ts} +0 -0
- /package/src/{text-summary.ts → image.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,209 @@
|
|
|
1
|
-
var af=Object.create;var{getPrototypeOf:ff,defineProperty:rt,getOwnPropertyNames:cf}=Object;var df=Object.prototype.hasOwnProperty;var st=(e,r,s)=>{s=e!=null?af(ff(e)):{};const n=r||!e||!e.__esModule?rt(s,"default",{value:e,enumerable:!0}):s;for(let t of cf(e))if(!df.call(n,t))rt(n,t,{get:()=>e[t],enumerable:!0});return n};var lf=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var Fn=lf((nr,On)=>{(function(e,r){typeof nr=="object"&&typeof On=="object"?On.exports=r():typeof define=="function"&&define.amd?define([],r):typeof nr=="object"?nr.bowser=r():e.bowser=r()})(nr,function(){return function(e){var r={};function s(n){if(r[n])return r[n].exports;var t=r[n]={i:n,l:!1,exports:{}};return e[n].call(t.exports,t,t.exports,s),t.l=!0,t.exports}return s.m=e,s.c=r,s.d=function(n,t,i){s.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:i})},s.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},s.t=function(n,t){if(1&t&&(n=s(n)),8&t)return n;if(4&t&&typeof n=="object"&&n&&n.__esModule)return n;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&t&&typeof n!="string")for(var c in n)s.d(i,c,function(o){return n[o]}.bind(null,c));return i},s.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return s.d(t,"a",t),t},s.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},s.p="",s(s.s=90)}({17:function(e,r,s){r.__esModule=!0,r.default=void 0;var n=s(18),t=function(){function i(){}return i.getFirstMatch=function(c,o){var a=o.match(c);return a&&a.length>0&&a[1]||""},i.getSecondMatch=function(c,o){var a=o.match(c);return a&&a.length>1&&a[2]||""},i.matchAndReturnConst=function(c,o,a){if(c.test(o))return a},i.getWindowsVersionName=function(c){switch(c){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},i.getMacOSVersionName=function(c){var o=c.split(".").splice(0,2).map(function(a){return parseInt(a,10)||0});if(o.push(0),o[0]===10)switch(o[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},i.getAndroidVersionName=function(c){var o=c.split(".").splice(0,2).map(function(a){return parseInt(a,10)||0});if(o.push(0),!(o[0]===1&&o[1]<5))return o[0]===1&&o[1]<6?"Cupcake":o[0]===1&&o[1]>=6?"Donut":o[0]===2&&o[1]<2?"Eclair":o[0]===2&&o[1]===2?"Froyo":o[0]===2&&o[1]>2?"Gingerbread":o[0]===3?"Honeycomb":o[0]===4&&o[1]<1?"Ice Cream Sandwich":o[0]===4&&o[1]<4?"Jelly Bean":o[0]===4&&o[1]>=4?"KitKat":o[0]===5?"Lollipop":o[0]===6?"Marshmallow":o[0]===7?"Nougat":o[0]===8?"Oreo":o[0]===9?"Pie":void 0},i.getVersionPrecision=function(c){return c.split(".").length},i.compareVersions=function(c,o,a){a===void 0&&(a=!1);var f=i.getVersionPrecision(c),h=i.getVersionPrecision(o),l=Math.max(f,h),d=0,m=i.map([c,o],function(g){var w=l-i.getVersionPrecision(g),y=g+new Array(w+1).join(".0");return i.map(y.split("."),function(E){return new Array(20-E.length).join("0")+E}).reverse()});for(a&&(d=l-Math.min(f,h)),l-=1;l>=d;){if(m[0][l]>m[1][l])return 1;if(m[0][l]===m[1][l]){if(l===d)return 0;l-=1}else if(m[0][l]<m[1][l])return-1}},i.map=function(c,o){var a,f=[];if(Array.prototype.map)return Array.prototype.map.call(c,o);for(a=0;a<c.length;a+=1)f.push(o(c[a]));return f},i.find=function(c,o){var a,f;if(Array.prototype.find)return Array.prototype.find.call(c,o);for(a=0,f=c.length;a<f;a+=1){var h=c[a];if(o(h,a))return h}},i.assign=function(c){for(var o,a,f=c,h=arguments.length,l=new Array(h>1?h-1:0),d=1;d<h;d++)l[d-1]=arguments[d];if(Object.assign)return Object.assign.apply(Object,[c].concat(l));var m=function(){var g=l[o];typeof g=="object"&&g!==null&&Object.keys(g).forEach(function(w){f[w]=g[w]})};for(o=0,a=l.length;o<a;o+=1)m();return c},i.getBrowserAlias=function(c){return n.BROWSER_ALIASES_MAP[c]},i.getBrowserTypeByAlias=function(c){return n.BROWSER_MAP[c]||""},i}();r.default=t,e.exports=r.default},18:function(e,r,s){r.__esModule=!0,r.ENGINE_MAP=r.OS_MAP=r.PLATFORMS_MAP=r.BROWSER_MAP=r.BROWSER_ALIASES_MAP=void 0,r.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},r.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},r.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},r.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},r.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(e,r,s){r.__esModule=!0,r.default=void 0;var n,t=(n=s(91))&&n.__esModule?n:{default:n},i=s(18);function c(a,f){for(var h=0;h<f.length;h++){var l=f[h];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,l.key,l)}}var o=function(){function a(){}var f,h,l;return a.getParser=function(d,m){if(m===void 0&&(m=!1),typeof d!="string")throw new Error("UserAgent should be a string");return new t.default(d,m)},a.parse=function(d){return new t.default(d).getResult()},f=a,l=[{key:"BROWSER_MAP",get:function(){return i.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return i.ENGINE_MAP}},{key:"OS_MAP",get:function(){return i.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return i.PLATFORMS_MAP}}],(h=null)&&c(f.prototype,h),l&&c(f,l),a}();r.default=o,e.exports=r.default},91:function(e,r,s){r.__esModule=!0,r.default=void 0;var n=a(s(92)),t=a(s(93)),i=a(s(94)),c=a(s(95)),o=a(s(17));function a(h){return h&&h.__esModule?h:{default:h}}var f=function(){function h(d,m){if(m===void 0&&(m=!1),d==null||d==="")throw new Error("UserAgent parameter can't be empty");this._ua=d,this.parsedResult={},m!==!0&&this.parse()}var l=h.prototype;return l.getUA=function(){return this._ua},l.test=function(d){return d.test(this._ua)},l.parseBrowser=function(){var d=this;this.parsedResult.browser={};var m=o.default.find(n.default,function(g){if(typeof g.test=="function")return g.test(d);if(g.test instanceof Array)return g.test.some(function(w){return d.test(w)});throw new Error("Browser's test function is not valid")});return m&&(this.parsedResult.browser=m.describe(this.getUA())),this.parsedResult.browser},l.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},l.getBrowserName=function(d){return d?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},l.getBrowserVersion=function(){return this.getBrowser().version},l.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},l.parseOS=function(){var d=this;this.parsedResult.os={};var m=o.default.find(t.default,function(g){if(typeof g.test=="function")return g.test(d);if(g.test instanceof Array)return g.test.some(function(w){return d.test(w)});throw new Error("Browser's test function is not valid")});return m&&(this.parsedResult.os=m.describe(this.getUA())),this.parsedResult.os},l.getOSName=function(d){var m=this.getOS().name;return d?String(m).toLowerCase()||"":m||""},l.getOSVersion=function(){return this.getOS().version},l.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},l.getPlatformType=function(d){d===void 0&&(d=!1);var m=this.getPlatform().type;return d?String(m).toLowerCase()||"":m||""},l.parsePlatform=function(){var d=this;this.parsedResult.platform={};var m=o.default.find(i.default,function(g){if(typeof g.test=="function")return g.test(d);if(g.test instanceof Array)return g.test.some(function(w){return d.test(w)});throw new Error("Browser's test function is not valid")});return m&&(this.parsedResult.platform=m.describe(this.getUA())),this.parsedResult.platform},l.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},l.getEngineName=function(d){return d?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},l.parseEngine=function(){var d=this;this.parsedResult.engine={};var m=o.default.find(c.default,function(g){if(typeof g.test=="function")return g.test(d);if(g.test instanceof Array)return g.test.some(function(w){return d.test(w)});throw new Error("Browser's test function is not valid")});return m&&(this.parsedResult.engine=m.describe(this.getUA())),this.parsedResult.engine},l.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},l.getResult=function(){return o.default.assign({},this.parsedResult)},l.satisfies=function(d){var m=this,g={},w=0,y={},E=0;if(Object.keys(d).forEach(function(Q){var tr=d[Q];typeof tr=="string"?(y[Q]=tr,E+=1):typeof tr=="object"&&(g[Q]=tr,w+=1)}),w>0){var p=Object.keys(g),T=o.default.find(p,function(Q){return m.isOS(Q)});if(T){var N=this.satisfies(g[T]);if(N!==void 0)return N}var se=o.default.find(p,function(Q){return m.isPlatform(Q)});if(se){var Pe=this.satisfies(g[se]);if(Pe!==void 0)return Pe}}if(E>0){var of=Object.keys(y),et=o.default.find(of,function(Q){return m.isBrowser(Q,!0)});if(et!==void 0)return this.compareVersion(y[et])}},l.isBrowser=function(d,m){m===void 0&&(m=!1);var g=this.getBrowserName().toLowerCase(),w=d.toLowerCase(),y=o.default.getBrowserTypeByAlias(w);return m&&y&&(w=y.toLowerCase()),w===g},l.compareVersion=function(d){var m=[0],g=d,w=!1,y=this.getBrowserVersion();if(typeof y=="string")return d[0]===">"||d[0]==="<"?(g=d.substr(1),d[1]==="="?(w=!0,g=d.substr(2)):m=[],d[0]===">"?m.push(1):m.push(-1)):d[0]==="="?g=d.substr(1):d[0]==="~"&&(w=!0,g=d.substr(1)),m.indexOf(o.default.compareVersions(y,g,w))>-1},l.isOS=function(d){return this.getOSName(!0)===String(d).toLowerCase()},l.isPlatform=function(d){return this.getPlatformType(!0)===String(d).toLowerCase()},l.isEngine=function(d){return this.getEngineName(!0)===String(d).toLowerCase()},l.is=function(d,m){return m===void 0&&(m=!1),this.isBrowser(d,m)||this.isOS(d)||this.isPlatform(d)},l.some=function(d){var m=this;return d===void 0&&(d=[]),d.some(function(g){return m.is(g)})},h}();r.default=f,e.exports=r.default},92:function(e,r,s){r.__esModule=!0,r.default=void 0;var n,t=(n=s(17))&&n.__esModule?n:{default:n},i=/version\/(\d+(\.?_?\d+)+)/i,c=[{test:[/googlebot/i],describe:function(o){var a={name:"Googlebot"},f=t.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/opera/i],describe:function(o){var a={name:"Opera"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/opr\/|opios/i],describe:function(o){var a={name:"Opera"},f=t.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/SamsungBrowser/i],describe:function(o){var a={name:"Samsung Internet for Android"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/Whale/i],describe:function(o){var a={name:"NAVER Whale Browser"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/MZBrowser/i],describe:function(o){var a={name:"MZ Browser"},f=t.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/focus/i],describe:function(o){var a={name:"Focus"},f=t.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/swing/i],describe:function(o){var a={name:"Swing"},f=t.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/coast/i],describe:function(o){var a={name:"Opera Coast"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(o){var a={name:"Opera Touch"},f=t.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/yabrowser/i],describe:function(o){var a={name:"Yandex Browser"},f=t.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/ucbrowser/i],describe:function(o){var a={name:"UC Browser"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/Maxthon|mxios/i],describe:function(o){var a={name:"Maxthon"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/epiphany/i],describe:function(o){var a={name:"Epiphany"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/puffin/i],describe:function(o){var a={name:"Puffin"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/sleipnir/i],describe:function(o){var a={name:"Sleipnir"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/k-meleon/i],describe:function(o){var a={name:"K-Meleon"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/micromessenger/i],describe:function(o){var a={name:"WeChat"},f=t.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/qqbrowser/i],describe:function(o){var a={name:/qqbrowserlite/i.test(o)?"QQ Browser Lite":"QQ Browser"},f=t.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/msie|trident/i],describe:function(o){var a={name:"Internet Explorer"},f=t.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/\sedg\//i],describe:function(o){var a={name:"Microsoft Edge"},f=t.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/edg([ea]|ios)/i],describe:function(o){var a={name:"Microsoft Edge"},f=t.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/vivaldi/i],describe:function(o){var a={name:"Vivaldi"},f=t.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/seamonkey/i],describe:function(o){var a={name:"SeaMonkey"},f=t.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/sailfish/i],describe:function(o){var a={name:"Sailfish"},f=t.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,o);return f&&(a.version=f),a}},{test:[/silk/i],describe:function(o){var a={name:"Amazon Silk"},f=t.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/phantom/i],describe:function(o){var a={name:"PhantomJS"},f=t.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/slimerjs/i],describe:function(o){var a={name:"SlimerJS"},f=t.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(o){var a={name:"BlackBerry"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/(web|hpw)[o0]s/i],describe:function(o){var a={name:"WebOS Browser"},f=t.default.getFirstMatch(i,o)||t.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/bada/i],describe:function(o){var a={name:"Bada"},f=t.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/tizen/i],describe:function(o){var a={name:"Tizen"},f=t.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/qupzilla/i],describe:function(o){var a={name:"QupZilla"},f=t.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/firefox|iceweasel|fxios/i],describe:function(o){var a={name:"Firefox"},f=t.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/electron/i],describe:function(o){var a={name:"Electron"},f=t.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/MiuiBrowser/i],describe:function(o){var a={name:"Miui"},f=t.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/chromium/i],describe:function(o){var a={name:"Chromium"},f=t.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,o)||t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/chrome|crios|crmo/i],describe:function(o){var a={name:"Chrome"},f=t.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/GSA/i],describe:function(o){var a={name:"Google Search"},f=t.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:function(o){var a=!o.test(/like android/i),f=o.test(/android/i);return a&&f},describe:function(o){var a={name:"Android Browser"},f=t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/playstation 4/i],describe:function(o){var a={name:"PlayStation 4"},f=t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/safari|applewebkit/i],describe:function(o){var a={name:"Safari"},f=t.default.getFirstMatch(i,o);return f&&(a.version=f),a}},{test:[/.*/i],describe:function(o){var a=o.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:t.default.getFirstMatch(a,o),version:t.default.getSecondMatch(a,o)}}}];r.default=c,e.exports=r.default},93:function(e,r,s){r.__esModule=!0,r.default=void 0;var n,t=(n=s(17))&&n.__esModule?n:{default:n},i=s(18),c=[{test:[/Roku\/DVP/],describe:function(o){var a=t.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,o);return{name:i.OS_MAP.Roku,version:a}}},{test:[/windows phone/i],describe:function(o){var a=t.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,o);return{name:i.OS_MAP.WindowsPhone,version:a}}},{test:[/windows /i],describe:function(o){var a=t.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,o),f=t.default.getWindowsVersionName(a);return{name:i.OS_MAP.Windows,version:a,versionName:f}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(o){var a={name:i.OS_MAP.iOS},f=t.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,o);return f&&(a.version=f),a}},{test:[/macintosh/i],describe:function(o){var a=t.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,o).replace(/[_\s]/g,"."),f=t.default.getMacOSVersionName(a),h={name:i.OS_MAP.MacOS,version:a};return f&&(h.versionName=f),h}},{test:[/(ipod|iphone|ipad)/i],describe:function(o){var a=t.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,o).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:a}}},{test:function(o){var a=!o.test(/like android/i),f=o.test(/android/i);return a&&f},describe:function(o){var a=t.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,o),f=t.default.getAndroidVersionName(a),h={name:i.OS_MAP.Android,version:a};return f&&(h.versionName=f),h}},{test:[/(web|hpw)[o0]s/i],describe:function(o){var a=t.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,o),f={name:i.OS_MAP.WebOS};return a&&a.length&&(f.version=a),f}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(o){var a=t.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,o)||t.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,o)||t.default.getFirstMatch(/\bbb(\d+)/i,o);return{name:i.OS_MAP.BlackBerry,version:a}}},{test:[/bada/i],describe:function(o){var a=t.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,o);return{name:i.OS_MAP.Bada,version:a}}},{test:[/tizen/i],describe:function(o){var a=t.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,o);return{name:i.OS_MAP.Tizen,version:a}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(o){var a=t.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,o);return{name:i.OS_MAP.PlayStation4,version:a}}}];r.default=c,e.exports=r.default},94:function(e,r,s){r.__esModule=!0,r.default=void 0;var n,t=(n=s(17))&&n.__esModule?n:{default:n},i=s(18),c=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(o){var a=t.default.getFirstMatch(/(can-l01)/i,o)&&"Nova",f={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return a&&(f.model=a),f}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(o){var a=o.test(/ipod|iphone/i),f=o.test(/like (ipod|iphone)/i);return a&&!f},describe:function(o){var a=t.default.getFirstMatch(/(ipod|iphone)/i,o);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:a}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(o){return o.getBrowserName(!0)==="blackberry"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(o){return o.getBrowserName(!0)==="bada"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(o){return o.getBrowserName()==="windows phone"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(o){var a=Number(String(o.getOSVersion()).split(".")[0]);return o.getOSName(!0)==="android"&&a>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(o){return o.getOSName(!0)==="android"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(o){return o.getOSName(!0)==="macos"},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(o){return o.getOSName(!0)==="windows"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(o){return o.getOSName(!0)==="linux"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(o){return o.getOSName(!0)==="playstation 4"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(o){return o.getOSName(!0)==="roku"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];r.default=c,e.exports=r.default},95:function(e,r,s){r.__esModule=!0,r.default=void 0;var n,t=(n=s(17))&&n.__esModule?n:{default:n},i=s(18),c=[{test:function(o){return o.getBrowserName(!0)==="microsoft edge"},describe:function(o){if(/\sedg\//i.test(o))return{name:i.ENGINE_MAP.Blink};var a=t.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,o);return{name:i.ENGINE_MAP.EdgeHTML,version:a}}},{test:[/trident/i],describe:function(o){var a={name:i.ENGINE_MAP.Trident},f=t.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:function(o){return o.test(/presto/i)},describe:function(o){var a={name:i.ENGINE_MAP.Presto},f=t.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:function(o){var a=o.test(/gecko/i),f=o.test(/like gecko/i);return a&&!f},describe:function(o){var a={name:i.ENGINE_MAP.Gecko},f=t.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(o){var a={name:i.ENGINE_MAP.WebKit},f=t.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,o);return f&&(a.version=f),a}}];r.default=c,e.exports=r.default}})})});var ir=(e)=>{let r=e.httpHandler;return{setHttpHandler(s){r=s},httpHandler(){return r},updateHttpClientConfig(s,n){r.updateHttpClientConfig(s,n)},httpHandlerConfigs(){return r.httpHandlerConfigs()}}},or=(e)=>{return{httpHandler:e.httpHandler()}};var nt;(function(e){e.HEADER="header",e.QUERY="query"})(nt||(nt={}));var Ls;(function(e){e.HEADER="header",e.QUERY="query"})(Ls||(Ls={}));var Ie;(function(e){e.HTTP="http",e.HTTPS="https"})(Ie||(Ie={}));var Te;(function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"})(Te||(Te={}));var us;(function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"})(us||(us={}));var ne="__smithy_context";var tt;(function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"})(tt||(tt={}));var it;(function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"})(it||(it={}));function mf(e){return Object.keys(e).reduce((r,s)=>{const n=e[s];return{...r,[s]:Array.isArray(n)?[...n]:n}},{})}class M{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){const r=new M({...e,headers:{...e.headers}});if(r.query)r.query=mf(r.query);return r}static isInstance(e){if(!e)return!1;const r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query==="object"&&typeof r.headers==="object"}clone(){return M.clone(this)}}class J{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;const r=e;return typeof r.statusCode==="number"&&typeof r.headers==="object"}}function ar(e){return e}var hf=(e)=>(r)=>async(s)=>{if(!M.isInstance(s.request))return r(s);const{request:n}=s,{handlerProtocol:t=""}=e.requestHandler.metadata||{};if(t.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let i=n.hostname;if(n.port!=null)i+=`:${n.port}`;n.headers.host=i}return r(s)},gf={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},fr=(e)=>({applyToStack:(r)=>{r.add(hf(e),gf)}});var yf=()=>(e,r)=>async(s)=>{try{const n=await e(s),{clientName:t,commandName:i,logger:c,dynamoDbDocumentClientOptions:o={}}=r,{overrideInputFilterSensitiveLog:a,overrideOutputFilterSensitiveLog:f}=o,h=a??r.inputFilterSensitiveLog,l=f??r.outputFilterSensitiveLog,{$metadata:d,...m}=n.output;return c?.info?.({clientName:t,commandName:i,input:h(s.input),output:l(m),metadata:d}),n}catch(n){const{clientName:t,commandName:i,logger:c,dynamoDbDocumentClientOptions:o={}}=r,{overrideInputFilterSensitiveLog:a}=o,f=a??r.inputFilterSensitiveLog;throw c?.error?.({clientName:t,commandName:i,input:f(s.input),error:n,metadata:n.$metadata}),n}},wf={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},cr=(e)=>({applyToStack:(r)=>{r.add(yf(),wf)}});var ot="X-Amzn-Trace-Id",Ef="AWS_LAMBDA_FUNCTION_NAME",Sf="_X_AMZN_TRACE_ID",pf=(e)=>(r)=>async(s)=>{const{request:n}=s;if(!M.isInstance(n)||e.runtime!=="node"||n.headers.hasOwnProperty(ot))return r(s);const t=process.env[Ef],i=process.env[Sf],c=(o)=>typeof o==="string"&&o.length>0;if(c(t)&&c(i))n.headers[ot]=i;return r({...s,request:n})},Af={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},dr=(e)=>({applyToStack:(r)=>{r.add(pf(e),Af)}});function lr(e){return{...e,customUserAgent:typeof e.customUserAgent==="string"?[[e.customUserAgent]]:e.customUserAgent}}var Rf=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),ve=(e)=>Rf.test(e)||e.startsWith("[")&&e.endsWith("]");var Mf=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Be=(e,r=!1)=>{if(!r)return Mf.test(e);const s=e.split(".");for(let n of s)if(!Be(n))return!1;return!0};var Z={};var _="endpoints";function v(e){if(typeof e!=="object"||e==null)return e;if("ref"in e)return`\$${v(e.ref)}`;if("fn"in e)return`${e.fn}(${(e.argv||[]).map(v).join(", ")})`;return JSON.stringify(e,null,2)}class P extends Error{constructor(e){super(e);this.name="EndpointError"}}var at=(e,r)=>e===r;var ft=(e)=>{const r=e.split("."),s=[];for(let n of r){const t=n.indexOf("[");if(t!==-1){if(n.indexOf("]")!==n.length-1)throw new P(`Path: '${e}' does not end with ']'`);const i=n.slice(t+1,-1);if(Number.isNaN(parseInt(i)))throw new P(`Invalid array index: '${i}' in path: '${e}'`);if(t!==0)s.push(n.slice(0,t));s.push(i)}else s.push(n)}return s};var mr=(e,r)=>ft(r).reduce((s,n)=>{if(typeof s!=="object")throw new P(`Index '${n}' in '${r}' not found in '${JSON.stringify(e)}'`);else if(Array.isArray(s))return s[parseInt(n)];return s[n]},e);var ct=(e)=>e!=null;var dt=(e)=>!e;var vs={[Ie.HTTP]:80,[Ie.HTTPS]:443},lt=(e)=>{const r=(()=>{try{if(e instanceof URL)return e;if(typeof e==="object"&&"hostname"in e){const{hostname:d,port:m,protocol:g="",path:w="",query:y={}}=e,E=new URL(`${g}//${d}${m?`:${m}`:""}${w}`);return E.search=Object.entries(y).map(([p,T])=>`${p}=${T}`).join("&"),E}return new URL(e)}catch(d){return null}})();if(!r)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;const s=r.href,{host:n,hostname:t,pathname:i,protocol:c,search:o}=r;if(o)return null;const a=c.slice(0,-1);if(!Object.values(Ie).includes(a))return null;const f=ve(t),h=s.includes(`${n}:${vs[a]}`)||typeof e==="string"&&e.includes(`${n}:${vs[a]}`),l=`${n}${h?`:${vs[a]}`:""}`;return{scheme:a,authority:l,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:f}};var mt=(e,r)=>e===r;var ht=(e,r,s,n)=>{if(r>=s||e.length<s)return null;if(!n)return e.substring(r,s);return e.substring(e.length-s,e.length-r)};var gt=(e)=>encodeURIComponent(e).replace(/[!*'()]/g,(r)=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`);var yt={booleanEquals:at,getAttr:mr,isSet:ct,isValidHostLabel:Be,not:dt,parseURL:lt,stringEquals:mt,substring:ht,uriEncode:gt};var hr=(e,r)=>{const s=[],n={...r.endpointParams,...r.referenceRecord};let t=0;while(t<e.length){const i=e.indexOf("{",t);if(i===-1){s.push(e.slice(t));break}s.push(e.slice(t,i));const c=e.indexOf("}",i);if(c===-1){s.push(e.slice(i));break}if(e[i+1]==="{"&&e[c+1]==="}")s.push(e.slice(i+1,c)),t=c+2;const o=e.substring(i+1,c);if(o.includes("#")){const[a,f]=o.split("#");s.push(mr(n[a],f))}else s.push(n[o]);t=c+1}return s.join("")};var wt=({ref:e},r)=>{return{...r.endpointParams,...r.referenceRecord}[e]};var te=(e,r,s)=>{if(typeof e==="string")return hr(e,s);else if(e.fn)return gr(e,s);else if(e.ref)return wt(e,s);throw new P(`'${r}': ${String(e)} is not a string, function or reference.`)};var gr=({fn:e,argv:r},s)=>{const n=r.map((i)=>["boolean","number"].includes(typeof i)?i:te(i,"arg",s)),t=e.split(".");if(t[0]in Z&&t[1]!=null)return Z[t[0]][t[1]](...n);return yt[e](...n)};var Et=({assign:e,...r},s)=>{if(e&&e in s.referenceRecord)throw new P(`'${e}' is already defined in Reference Record.`);const n=gr(r,s);return s.logger?.debug?.(`${_} evaluateCondition: ${v(r)} = ${v(n)}`),{result:n===""?!0:!!n,...e!=null&&{toAssign:{name:e,value:n}}}};var Ne=(e=[],r)=>{const s={};for(let n of e){const{result:t,toAssign:i}=Et(n,{...r,referenceRecord:{...r.referenceRecord,...s}});if(!t)return{result:t};if(i)s[i.name]=i.value,r.logger?.debug?.(`${_} assign: ${i.name} := ${v(i.value)}`)}return{result:!0,referenceRecord:s}};var St=(e,r)=>Object.entries(e).reduce((s,[n,t])=>({...s,[n]:t.map((i)=>{const c=te(i,"Header value entry",r);if(typeof c!=="string")throw new P(`Header '${n}' value '${c}' is not a string`);return c})}),{});var Bs=(e,r)=>{if(Array.isArray(e))return e.map((s)=>Bs(s,r));switch(typeof e){case"string":return hr(e,r);case"object":if(e===null)throw new P(`Unexpected endpoint property: ${e}`);return yr(e,r);case"boolean":return e;default:throw new P(`Unexpected endpoint property type: ${typeof e}`)}};var yr=(e,r)=>Object.entries(e).reduce((s,[n,t])=>({...s,[n]:Bs(t,r)}),{});var pt=(e,r)=>{const s=te(e,"Endpoint URL",r);if(typeof s==="string")try{return new URL(s)}catch(n){throw console.error(`Failed to construct URL with ${s}`,n),n}throw new P(`Endpoint URL must be a string, got ${typeof s}`)};var At=(e,r)=>{const{conditions:s,endpoint:n}=e,{result:t,referenceRecord:i}=Ne(s,r);if(!t)return;const c={...r,referenceRecord:{...r.referenceRecord,...i}},{url:o,properties:a,headers:f}=n;return r.logger?.debug?.(`${_} Resolving endpoint from template: ${v(n)}`),{...f!=null&&{headers:St(f,c)},...a!=null&&{properties:yr(a,c)},url:pt(o,c)}};var Rt=(e,r)=>{const{conditions:s,error:n}=e,{result:t,referenceRecord:i}=Ne(s,r);if(!t)return;throw new P(te(n,"Error",{...r,referenceRecord:{...r.referenceRecord,...i}}))};var Mt=(e,r)=>{const{conditions:s,rules:n}=e,{result:t,referenceRecord:i}=Ne(s,r);if(!t)return;return wr(n,{...r,referenceRecord:{...r.referenceRecord,...i}})};var wr=(e,r)=>{for(let s of e)if(s.type==="endpoint"){const n=At(s,r);if(n)return n}else if(s.type==="error")Rt(s,r);else if(s.type==="tree"){const n=Mt(s,r);if(n)return n}else throw new P(`Unknown endpoint rule: ${s}`);throw new P("Rules evaluation failed")};var be=(e,r)=>{const{endpointParams:s,logger:n}=r,{parameters:t,rules:i}=e;r.logger?.debug?.(`${_} Initial EndpointParams: ${v(s)}`);const c=Object.entries(t).filter(([,f])=>f.default!=null).map(([f,h])=>[f,h.default]);if(c.length>0)for(let[f,h]of c)s[f]=s[f]??h;const o=Object.entries(t).filter(([,f])=>f.required).map(([f])=>f);for(let f of o)if(s[f]==null)throw new P(`Missing required parameter: '${f}'`);const a=wr(i,{endpointParams:s,logger:n,referenceRecord:{}});if(r.endpointParams?.Endpoint)try{const f=new URL(r.endpointParams.Endpoint),{protocol:h,port:l}=f;a.url.protocol=h,a.url.port=l}catch(f){}return r.logger?.debug?.(`${_} Resolved endpoint: ${v(a)}`),a};var bs=(e,r=!1)=>{if(r){for(let s of e.split("."))if(!bs(s))return!1;return!0}if(!Be(e))return!1;if(e.length<3||e.length>63)return!1;if(e!==e.toLowerCase())return!1;if(ve(e))return!1;return!0};var Pt=(e)=>{const r=e.split(":");if(r.length<6)return null;const[s,n,t,i,c,...o]=r;if(s!=="arn"||n===""||t===""||o.join(":")==="")return null;const a=o.map((f)=>f.split("/")).flat();return{partition:n,service:t,region:i,accountId:c,resourceId:a}};var It={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{}}],version:"1.1"};var If=It,Tf="",Tt=(e)=>{const{partitions:r}=If;for(let n of r){const{regions:t,outputs:i}=n;for(let[c,o]of Object.entries(t))if(c===e)return{...i,...o}}for(let n of r){const{regionRegex:t,outputs:i}=n;if(new RegExp(t).test(e))return{...i}}const s=r.find((n)=>n.id==="aws");if(!s)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...s.outputs}};var Nt=()=>Tf;var Ge={isVirtualHostableS3Bucket:bs,parseArn:Pt,partition:Tt};Z.aws=Ge;var Gs="user-agent",Er="x-amz-user-agent",zs=" ",Sr="/",kt=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,Ot=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,Hs="-";var Nf=(e)=>(r,s)=>async(n)=>{const{request:t}=n;if(!M.isInstance(t))return r(n);const{headers:i}=t,c=s?.userAgent?.map(qs)||[],o=(await e.defaultUserAgentProvider()).map(qs),a=e?.customUserAgent?.map(qs)||[],f=Nt(),h=(f?[f]:[]).concat([...o,...c,...a]).join(zs),l=[...o.filter((d)=>d.startsWith("aws-sdk-")),...a].join(zs);if(e.runtime!=="browser"){if(l)i[Er]=i[Er]?`${i[Gs]} ${l}`:l;i[Gs]=h}else i[Er]=h;return r({...n,request:t})},qs=(e)=>{const r=e[0].split(Sr).map((c)=>c.replace(kt,Hs)).join(Sr),s=e[1]?.replace(Ot,Hs),n=r.indexOf(Sr),t=r.substring(0,n);let i=r.substring(n+1);if(t==="api")i=i.toLowerCase();return[t,i,s].filter((c)=>c&&c.length>0).reduce((c,o,a)=>{switch(a){case 0:return o;case 1:return`${c}/${o}`;default:return`${c}#${o}`}},"")},kf={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},pr=(e)=>({applyToStack:(r)=>{r.add(Nf(e),kf)}});var Ar;(function(e){e.ENV="env",e.CONFIG="shared config entry"})(Ar||(Ar={}));var Rr=!1;var Mr=!1;var q=(e)=>e[ne]||(e[ne]={});var C=(e)=>{if(typeof e==="function")return e;const r=Promise.resolve(e);return()=>r};var Pr=(e)=>typeof e==="string"&&(e.startsWith("fips-")||e.endsWith("-fips"));var Vs=(e)=>Pr(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e;var Ir=(e)=>{const{region:r,useFipsEndpoint:s}=e;if(!r)throw new Error("Region is missing");return{...e,region:async()=>{if(typeof r==="string")return Vs(r);const n=await r();return Vs(n)},useFipsEndpoint:async()=>{const n=typeof r==="string"?r:await r();if(Pr(n))return!0;return typeof s!=="function"?Promise.resolve(!!s):s()}}};function Ff(e){const r=new Map;for(let s of e)r.set(s.schemeId,s);return r}var Ys=(e,r)=>(s,n)=>async(t)=>{const i=e.httpAuthSchemeProvider(await r.httpAuthSchemeParametersProvider(e,n,t.input)),c=Ff(e.httpAuthSchemes),o=q(n),a=[];for(let f of i){const h=c.get(f.schemeId);if(!h){a.push(`HttpAuthScheme \`${f.schemeId}\` was not enabled for this service.`);continue}const l=h.identityProvider(await r.identityProviderConfigProvider(e));if(!l){a.push(`HttpAuthScheme \`${f.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:d={},signingProperties:m={}}=f.propertiesExtractor?.(e,n)||{};f.identityProperties=Object.assign(f.identityProperties||{},d),f.signingProperties=Object.assign(f.signingProperties||{},m),o.selectedHttpAuthScheme={httpAuthOption:f,identity:await l(f.identityProperties),signer:h.signer};break}if(!o.selectedHttpAuthScheme)throw new Error(a.join("\n"));return s(t)};var Ft=async(e)=>{const r=e?.Bucket||"";if(typeof e.Bucket==="string")e.Bucket=r.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(xf(r)){if(e.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!Df(r)||r.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||r.toLowerCase()!==r||r.length<3)e.ForcePathStyle=!0;if(e.DisableMultiRegionAccessPoints)e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0;return e},Cf=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,$f=/(\d+\.){3}\d+/,Uf=/\.\./;var Df=(e)=>Cf.test(e)&&!$f.test(e)&&!Uf.test(e),xf=(e)=>{const[r,s,n,,,t]=e.split(":"),i=r==="arn"&&e.split(":").length>=6,c=Boolean(i&&s&&n&&t);if(i&&!c)throw new Error(`Invalid ARN: ${e} was an invalid ARN.`);return c};var Ct=(e,r,s)=>{const n=async()=>{const t=s[e]??s[r];if(typeof t==="function")return t();return t};if(e==="credentialScope"||r==="CredentialScope")return async()=>{const t=typeof s.credentials==="function"?await s.credentials():s.credentials;return t?.credentialScope??t?.CredentialScope};if(e==="accountId"||r==="AccountId")return async()=>{const t=typeof s.credentials==="function"?await s.credentials():s.credentials;return t?.accountId??t?.AccountId};if(e==="endpoint"||r==="endpoint")return async()=>{const t=await n();if(t&&typeof t==="object"){if("url"in t)return t.url.href;if("hostname"in t){const{protocol:i,hostname:c,port:o,path:a}=t;return`${i}//${c}${o?":"+o:""}${a}`}}return t};return n};var $t=async(e)=>{return};function Ut(e){const r={};if(e=e.replace(/^\?/,""),e)for(let s of e.split("&")){let[n,t=null]=s.split("=");if(n=decodeURIComponent(n),t)t=decodeURIComponent(t);if(!(n in r))r[n]=t;else if(Array.isArray(r[n]))r[n].push(t);else r[n]=[r[n],t]}return r}var ie=(e)=>{if(typeof e==="string")return ie(new URL(e));const{hostname:r,pathname:s,port:n,protocol:t,search:i}=e;let c;if(i)c=Ut(i);return{hostname:r,port:n?parseInt(n):void 0,protocol:t,path:s,query:c}};var Tr=(e)=>{if(typeof e==="object"){if("url"in e)return ie(e.url);return e}return ie(e)};var Dt=async(e,r,s,n)=>{if(!s.endpoint){const c=await $t(s.serviceId||"");if(c)s.endpoint=()=>Promise.resolve(Tr(c))}const t=await Lf(e,r,s);if(typeof s.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return s.endpointProvider(t,n)},Lf=async(e,r,s)=>{const n={},t=r?.getEndpointParameterInstructions?.()||{};for(let[i,c]of Object.entries(t))switch(c.type){case"staticContextParams":n[i]=c.value;break;case"contextParams":n[i]=e[c.name];break;case"clientContextParams":case"builtInParams":n[i]=await Ct(c.name,i,s)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(c))}if(Object.keys(t).length===0)Object.assign(n,s);if(String(s.serviceId).toLowerCase()==="s3")await Ft(n);return n};var xt=({config:e,instructions:r})=>{return(s,n)=>async(t)=>{const i=await Dt(t.input,{getEndpointParameterInstructions(){return r}},{...e},n);n.endpointV2=i,n.authSchemes=i.properties?.authSchemes;const c=n.authSchemes?.[0];if(c){n.signing_region=c.signingRegion,n.signing_service=c.signingName;const a=q(n)?.selectedHttpAuthScheme?.httpAuthOption;if(a)a.signingProperties=Object.assign(a.signingProperties||{},{signing_region:c.signingRegion,signingRegion:c.signingRegion,signing_service:c.signingName,signingName:c.signingName,signingRegionSet:c.signingRegionSet},c.properties)}return s({...t})}};var Lt=(e,r)=>(s)=>async(n)=>{const{response:t}=await s(n);try{const i=await r(t,e);return{response:t,output:i}}catch(i){if(Object.defineProperty(i,"$response",{value:t}),!("$metadata"in i)){if(i.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof i.$responseBodyText!=="undefined"){if(i.$response)i.$response.body=i.$responseBodyText}}throw i}};var ut=(e,r)=>(s,n)=>async(t)=>{const i=n.endpointV2?.url&&e.urlParser?async()=>e.urlParser(n.endpointV2.url):e.endpoint;if(!i)throw new Error("No valid endpoint provider available.");const c=await r(t.input,{...e,endpoint:i});return s({...t,request:c})};function V(e,r,s){return{applyToStack:(n)=>{n.add(Lt(e,s),uf),n.add(ut(e,r),ze)}}}var uf={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},ze={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};var Ws={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:ze.name},Y=(e,r)=>({applyToStack:(s)=>{s.addRelativeTo(xt({config:e,instructions:r}),Ws)}});var Nr=(e)=>{const r=e.tls??!0,{endpoint:s}=e,n=s!=null?async()=>Tr(await C(s)()):void 0;return{...e,endpoint:n,tls:r,isCustomEndpoint:!!s,useDualstackEndpoint:C(e.useDualstackEndpoint??!1),useFipsEndpoint:C(e.useFipsEndpoint??!1)}};var vf={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:Ws.name},kr=(e,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:s})=>({applyToStack:(n)=>{n.addRelativeTo(Ys(e,{httpAuthSchemeParametersProvider:r,identityProviderConfigProvider:s}),vf)}});var iE={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:ze.name};var Bf=(e)=>(r)=>{throw r},bf=(e,r)=>{},vt=(e)=>(r,s)=>async(n)=>{if(!M.isInstance(n.request))return r(n);const i=q(s).selectedHttpAuthScheme;if(!i)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:c={}},identity:o,signer:a}=i,f=await r({...n,request:await a.sign(n.request,o,c)}).catch((a.errorHandler||Bf)(c));return(a.successHandler||bf)(f.response,c),f};var B;(function(e){e.STANDARD="standard",e.ADAPTIVE="adaptive"})(B||(B={}));var W=3,He=B.STANDARD;var Bt=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],bt=["TimeoutError","RequestTimeout","RequestTimeoutException"],Gt=[500,502,503,504],zt=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"];var Gf=(e)=>e.$metadata?.clockSkewCorrected,ke=(e)=>e.$metadata?.httpStatusCode===429||Bt.includes(e.name)||e.$retryable?.throttling==!0,Or=(e)=>Gf(e)||bt.includes(e.name)||zt.includes(e?.code||"")||Gt.includes(e.$metadata?.httpStatusCode||0),Ht=(e)=>{if(e.$metadata?.httpStatusCode!==void 0){const r=e.$metadata.httpStatusCode;if(500<=r&&r<=599&&!Or(e))return!0;return!1}return!1};class Fr{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??0.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??0.5,this.scaleConstant=e?.scaleConstant??0.4,this.smooth=e?.smooth??0.8;const r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(!this.enabled)return;if(this.refillTokenBucket(),e>this.currentCapacity){const r=(e-this.currentCapacity)/this.fillRate*1000;await new Promise((s)=>setTimeout(s,r))}this.currentCapacity=this.currentCapacity-e}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const r=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=e}updateClientSendingRate(e){let r;if(this.updateMeasuredRate(),ke(e)){const n=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=n,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(n),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());const s=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(s)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){const s=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(s*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}}var he=100,qe=20000,Ks=500,Cr=500,Xs=5,Qs=10,Js=1,$r="amz-sdk-invocation-id",Ur="amz-sdk-request";var qt=()=>{let e=he;return{computeNextBackoffDelay:(n)=>{return Math.floor(Math.min(qe,Math.random()*2**n*e))},setDelayBase:(n)=>{e=n}}};var Zs=({retryDelay:e,retryCount:r,retryCost:s})=>{return{getRetryCount:()=>r,getRetryDelay:()=>Math.min(qe,e),getRetryCost:()=>s}};class Oe{constructor(e){this.maxAttempts=e,this.mode=B.STANDARD,this.capacity=Cr,this.retryBackoffStrategy=qt(),this.maxAttemptsProvider=typeof e==="function"?e:async()=>e}async acquireInitialRetryToken(e){return Zs({retryDelay:he,retryCount:0})}async refreshRetryTokenForRetry(e,r){const s=await this.getMaxAttempts();if(this.shouldRetry(e,r,s)){const n=r.errorType;this.retryBackoffStrategy.setDelayBase(n==="THROTTLING"?Ks:he);const t=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),i=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,t):t,c=this.getCapacityCost(n);return this.capacity-=c,Zs({retryDelay:i,retryCount:e.getRetryCount()+1,retryCost:c})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(Cr,this.capacity+(e.getRetryCost()??Js))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(e){return console.warn(`Max attempts provider could not resolve. Using default of ${W}`),W}}shouldRetry(e,r,s){return e.getRetryCount()+1<s&&this.capacity>=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(e){return e==="TRANSIENT"?Qs:Xs}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class _s{constructor(e,r){this.maxAttemptsProvider=e,this.mode=B.ADAPTIVE;const{rateLimiter:s}=r??{};this.rateLimiter=s??new Fr,this.standardRetryStrategy=new Oe(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(e,r)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}var Dr,zf=new Uint8Array(16);function js(){if(!Dr){if(Dr=typeof crypto!=="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Dr)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return Dr(zf)}function Vt(e,r=0){return O[e[r+0]]+O[e[r+1]]+O[e[r+2]]+O[e[r+3]]+"-"+O[e[r+4]]+O[e[r+5]]+"-"+O[e[r+6]]+O[e[r+7]]+"-"+O[e[r+8]]+O[e[r+9]]+"-"+O[e[r+10]]+O[e[r+11]]+O[e[r+12]]+O[e[r+13]]+O[e[r+14]]+O[e[r+15]]}var O=[];for(let e=0;e<256;++e)O.push((e+256).toString(16).slice(1));var Hf=typeof crypto!=="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),en={randomUUID:Hf};function qf(e,r,s){if(en.randomUUID&&!r&&!e)return en.randomUUID();e=e||{};const n=e.random||(e.rng||js)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,r){s=s||0;for(let t=0;t<16;++t)r[s+t]=n[t];return r}return Vt(n)}var Ve=qf;var rn=(e)=>{if(e instanceof Error)return e;if(e instanceof Object)return Object.assign(new Error,e);if(typeof e==="string")return new Error(e);return new Error(`AWS SDK error wrapper for ${e}`)};var xr=(e)=>{const{retryStrategy:r}=e,s=C(e.maxAttempts??W);return{...e,maxAttempts:s,retryStrategy:async()=>{if(r)return r;if(await C(e.retryMode)()===B.ADAPTIVE)return new _s(s);return new Oe(s)}}};class ge{trace(){}debug(){}info(){}warn(){}error(){}}var ye=(e,r)=>{const s=[];if(e)s.push(e);if(r)for(let n of r)s.push(n);return s},oe=(e,r)=>{return`${e||"anonymous"}${r&&r.length>0?` (a.k.a. ${r.join(",")})`:""}`},Fe=()=>{let e=[],r=[],s=!1;const n=new Set,t=(l)=>l.sort((d,m)=>Yt[m.step]-Yt[d.step]||Wt[m.priority||"normal"]-Wt[d.priority||"normal"]),i=(l)=>{let d=!1;const m=(g)=>{const w=ye(g.name,g.aliases);if(w.includes(l)){d=!0;for(let y of w)n.delete(y);return!1}return!0};return e=e.filter(m),r=r.filter(m),d},c=(l)=>{let d=!1;const m=(g)=>{if(g.middleware===l){d=!0;for(let w of ye(g.name,g.aliases))n.delete(w);return!1}return!0};return e=e.filter(m),r=r.filter(m),d},o=(l)=>{return e.forEach((d)=>{l.add(d.middleware,{...d})}),r.forEach((d)=>{l.addRelativeTo(d.middleware,{...d})}),l.identifyOnResolve?.(h.identifyOnResolve()),l},a=(l)=>{const d=[];return l.before.forEach((m)=>{if(m.before.length===0&&m.after.length===0)d.push(m);else d.push(...a(m))}),d.push(l),l.after.reverse().forEach((m)=>{if(m.before.length===0&&m.after.length===0)d.push(m);else d.push(...a(m))}),d},f=(l=!1)=>{const d=[],m=[],g={};return e.forEach((y)=>{const E={...y,before:[],after:[]};for(let p of ye(E.name,E.aliases))g[p]=E;d.push(E)}),r.forEach((y)=>{const E={...y,before:[],after:[]};for(let p of ye(E.name,E.aliases))g[p]=E;m.push(E)}),m.forEach((y)=>{if(y.toMiddleware){const E=g[y.toMiddleware];if(E===void 0){if(l)return;throw new Error(`${y.toMiddleware} is not found when adding ${oe(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}if(y.relation==="after")E.after.push(y);if(y.relation==="before")E.before.push(y)}}),t(d).map(a).reduce((y,E)=>{return y.push(...E),y},[])},h={add:(l,d={})=>{const{name:m,override:g,aliases:w}=d,y={step:"initialize",priority:"normal",middleware:l,...d},E=ye(m,w);if(E.length>0){if(E.some((p)=>n.has(p))){if(!g)throw new Error(`Duplicate middleware name '${oe(m,w)}'`);for(let p of E){const T=e.findIndex((se)=>se.name===p||se.aliases?.some((Pe)=>Pe===p));if(T===-1)continue;const N=e[T];if(N.step!==y.step||y.priority!==N.priority)throw new Error(`"${oe(N.name,N.aliases)}" middleware with ${N.priority} priority in ${N.step} step cannot be overridden by "${oe(m,w)}" middleware with ${y.priority} priority in ${y.step} step.`);e.splice(T,1)}}for(let p of E)n.add(p)}e.push(y)},addRelativeTo:(l,d)=>{const{name:m,override:g,aliases:w}=d,y={middleware:l,...d},E=ye(m,w);if(E.length>0){if(E.some((p)=>n.has(p))){if(!g)throw new Error(`Duplicate middleware name '${oe(m,w)}'`);for(let p of E){const T=r.findIndex((se)=>se.name===p||se.aliases?.some((Pe)=>Pe===p));if(T===-1)continue;const N=r[T];if(N.toMiddleware!==y.toMiddleware||N.relation!==y.relation)throw new Error(`"${oe(N.name,N.aliases)}" middleware ${N.relation} "${N.toMiddleware}" middleware cannot be overridden by "${oe(m,w)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);r.splice(T,1)}}for(let p of E)n.add(p)}r.push(y)},clone:()=>o(Fe()),use:(l)=>{l.applyToStack(h)},remove:(l)=>{if(typeof l==="string")return i(l);else return c(l)},removeByTag:(l)=>{let d=!1;const m=(g)=>{const{tags:w,name:y,aliases:E}=g;if(w&&w.includes(l)){const p=ye(y,E);for(let T of p)n.delete(T);return d=!0,!1}return!0};return e=e.filter(m),r=r.filter(m),d},concat:(l)=>{const d=o(Fe());return d.use(l),d.identifyOnResolve(s||d.identifyOnResolve()||(l.identifyOnResolve?.()??!1)),d},applyToStack:o,identify:()=>{return f(!0).map((l)=>{const d=l.step??l.relation+" "+l.toMiddleware;return oe(l.name,l.aliases)+" - "+d})},identifyOnResolve(l){if(typeof l==="boolean")s=l;return s},resolve:(l,d)=>{for(let m of f().map((g)=>g.middleware).reverse())l=m(l,d);if(s)console.log(h.identify());return l}};return h},Yt={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Wt={high:3,normal:2,low:1};class Ye{constructor(e){this.middlewareStack=Fe(),this.config=e}send(e,r,s){const n=typeof r!=="function"?r:void 0,t=typeof r==="function"?r:s,i=e.resolveMiddleware(this.middlewareStack,this.config,n);if(t)i(e).then((c)=>t(null,c.output),(c)=>t(c)).catch(()=>{});else return i(e).then((c)=>c.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}}var j={},we=new Array(64);for(let e=0,r="A".charCodeAt(0),s="Z".charCodeAt(0);e+r<=s;e++){const n=String.fromCharCode(e+r);j[n]=e,we[e]=n}for(let e=0,r="a".charCodeAt(0),s="z".charCodeAt(0);e+r<=s;e++){const n=String.fromCharCode(e+r),t=e+26;j[n]=t,we[t]=n}for(let e=0;e<10;e++){j[e.toString(10)]=e+52;const r=e.toString(10),s=e+52;j[r]=s,we[s]=r}j["+"]=62;we[62]="+";j["/"]=63;we[63]="/";var ae=6,Ee=8,Kt=63;var fe=(e)=>{let r=e.length/4*3;if(e.slice(-2)==="==")r-=2;else if(e.slice(-1)==="=")r--;const s=new ArrayBuffer(r),n=new DataView(s);for(let t=0;t<e.length;t+=4){let i=0,c=0;for(let f=t,h=t+3;f<=h;f++)if(e[f]!=="="){if(!(e[f]in j))throw new TypeError(`Invalid character ${e[f]} in base64 string.`);i|=j[e[f]]<<(h-f)*ae,c+=ae}else i>>=ae;const o=t/4*3;i>>=c%Ee;const a=Math.floor(c/Ee);for(let f=0;f<a;f++){const h=(a-f-1)*Ee;n.setUint8(o+f,(i&255<<h)>>h)}}return new Uint8Array(s)};var D=(e)=>new TextEncoder().encode(e);var ce=(e)=>{if(typeof e==="string")return D(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)};var Se=(e)=>{if(typeof e==="string")return e;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)};function pe(e){let r;if(typeof e==="string")r=D(e);else r=e;const s=typeof r==="object"&&typeof r.length==="number",n=typeof r==="object"&&typeof r.byteOffset==="number"&&typeof r.byteLength==="number";if(!s&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let t="";for(let i=0;i<r.length;i+=3){let c=0,o=0;for(let f=i,h=Math.min(i+3,r.length);f<h;f++)c|=r[f]<<(h-f-1)*Ee,o+=Ee;const a=Math.ceil(o/ae);c<<=a*ae-o;for(let f=1;f<=a;f++){const h=(a-f)*ae;t+=we[(c&Kt<<h)>>h]}t+="==".slice(0,4-a)}return t}function Xt(e,r="utf-8"){if(r==="base64")return pe(e);return Se(e)}function Qt(e,r){if(r==="base64")return ee.mutate(fe(e));return ee.mutate(D(e))}class ee extends Uint8Array{static fromString(e,r="utf-8"){switch(typeof e){case"string":return Qt(e,r);default:throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}}static mutate(e){return Object.setPrototypeOf(e,ee.prototype),e}transformToString(e="utf-8"){return Xt(this,e)}}var b=(e)=>encodeURIComponent(e).replace(/[!'()*]/g,Vf),Vf=(e)=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`;function Jt(e){const r=[];for(let s of Object.keys(e).sort()){const n=e[s];if(s=b(s),Array.isArray(n))for(let t=0,i=n.length;t<i;t++)r.push(`${s}=${b(n[t])}`);else{let t=s;if(n||typeof n==="string")t+=`=${b(n)}`;r.push(t)}}return r.join("&")}function Zt(e=0){return new Promise((r,s)=>{if(e)setTimeout(()=>{const n=new Error(`Request did not complete within ${e} ms`);n.name="TimeoutError",s(n)},e)})}var sn={supported:void 0};class Ce{static create(e){if(typeof e?.handle==="function")return e;return new Ce(e)}constructor(e){if(typeof e==="function")this.configProvider=e().then((r)=>r||{});else this.config=e??{},this.configProvider=Promise.resolve(this.config);if(sn.supported===void 0)sn.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(e,{abortSignal:r}={}){if(!this.config)this.config=await this.configProvider;const s=this.config.requestTimeout,n=this.config.keepAlive===!0,t=this.config.credentials;if(r?.aborted){const y=new Error("Request aborted");return y.name="AbortError",Promise.reject(y)}let i=e.path;const c=Jt(e.query||{});if(c)i+=`?${c}`;if(e.fragment)i+=`#${e.fragment}`;let o="";if(e.username!=null||e.password!=null){const y=e.username??"",E=e.password??"";o=`${y}:${E}@`}const{port:a,method:f}=e,h=`${e.protocol}//${o}${e.hostname}${a?`:${a}`:""}${i}`,l=f==="GET"||f==="HEAD"?void 0:e.body,d={body:l,headers:new Headers(e.headers),method:f,credentials:t};if(l)d.duplex="half";if(typeof AbortController!=="undefined")d.signal=r;if(sn.supported)d.keepalive=n;let m=()=>{};const g=new Request(h,d),w=[fetch(g).then((y)=>{const E=y.headers,p={};for(let N of E.entries())p[N[0]]=N[1];if(y.body==null)return y.blob().then((N)=>({response:new J({headers:p,reason:y.statusText,statusCode:y.status,body:N})}));return{response:new J({headers:p,reason:y.statusText,statusCode:y.status,body:y.body})}}),Zt(s)];if(r)w.push(new Promise((y,E)=>{const p=()=>{const T=new Error("Request aborted");T.name="AbortError",E(T)};if(typeof r.addEventListener==="function"){const T=r;T.addEventListener("abort",p,{once:!0}),m=()=>T.removeEventListener("abort",p)}else r.onabort=p}));return Promise.race(w).finally(m)}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then((s)=>{return s[e]=r,s})}httpHandlerConfigs(){return this.config??{}}}async function Yf(e){const r=await Kf(e),s=fe(r);return new Uint8Array(s)}async function Wf(e){const r=[],s=e.getReader();let n=!1,t=0;while(!n){const{done:o,value:a}=await s.read();if(a)r.push(a),t+=a.length;n=o}const i=new Uint8Array(t);let c=0;for(let o of r)i.set(o,c),c+=o.length;return i}function Kf(e){return new Promise((r,s)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return s(new Error("Reader aborted too early"));const t=n.result??"",i=t.indexOf(","),c=i>-1?i+1:t.length;r(t.substring(c))},n.onabort=()=>s(new Error("Read aborted")),n.onerror=()=>s(n.error),n.readAsDataURL(e)})}var We=(e)=>{if(typeof Blob==="function"&&e instanceof Blob)return Yf(e);return Wf(e)};function Lr(e){if(e.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const r=new Uint8Array(e.length/2);for(let s=0;s<e.length;s+=2){const n=e.slice(s,s+2).toLowerCase();if(n in nn)r[s/2]=nn[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return r}function k(e){let r="";for(let s=0;s<e.byteLength;s++)r+=_t[e[s]];return r}var _t={},nn={};for(let e=0;e<256;e++){let r=e.toString(16).toLowerCase();if(r.length===1)r=`0${r}`;_t[e]=r,nn[r]=e}var Ke=async(e=new Uint8Array,r)=>{if(e instanceof Uint8Array)return ee.mutate(e);if(!e)return ee.mutate(new Uint8Array);const s=r.streamCollector(e);return ee.mutate(await s)};class G{constructor(){this.middlewareStack=Fe()}static classBuilder(){return new jt}resolveMiddlewareWithContext(e,r,s,{middlewareFn:n,clientName:t,commandName:i,inputFilterSensitiveLog:c,outputFilterSensitiveLog:o,smithyContext:a,additionalContext:f,CommandCtor:h}){for(let w of n.bind(this)(h,e,r,s))this.middlewareStack.use(w);const l=e.concat(this.middlewareStack),{logger:d}=r,m={logger:d,clientName:t,commandName:i,inputFilterSensitiveLog:c,outputFilterSensitiveLog:o,[ne]:{commandInstance:this,...a},...f},{requestHandler:g}=r;return l.resolve((w)=>g.handle(w.request,s||{}),m)}}class jt{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(e)=>e,this._outputFilterSensitiveLog=(e)=>e,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,r,s={}){return this._smithyContext={service:e,operation:r,...s},this}c(e={}){return this._additionalContext=e,this}n(e,r){return this._clientName=e,this._commandName=r,this}f(e=(s)=>s,r=(s)=>s){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=r,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}build(){const e=this;let r;return r=class extends G{static getEndpointParameterInstructions(){return e._ep}constructor(...[s]){super();this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=s??{},e._init(this)}resolveMiddleware(s,n,t){return this.resolveMiddlewareWithContext(s,n,t,{CommandCtor:r,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog,outputFilterSensitiveLog:e._outputFilterSensitiveLog,smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}var Xe="***SensitiveInformation***";var Xf=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string"){const r=parseFloat(e);if(!Number.isNaN(r)){if(String(r)!==String(e))oi.warn(ii(`Expected number but observed string: ${e}`));return r}}if(typeof e==="number")return e;throw new TypeError(`Expected number, got ${typeof e}: ${e}`)},Qf=Math.ceil(340282346638528860000000000000000000000),tn=(e)=>{const r=Xf(e);if(r!==void 0&&!Number.isNaN(r)&&r!==1/0&&r!==-1/0){if(Math.abs(r)>Qf)throw new TypeError(`Expected 32-bit float, got ${e}`)}return r},Jf=(e)=>{if(e===null||e===void 0)return;if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw new TypeError(`Expected integer, got ${typeof e}: ${e}`)};var ur=(e)=>on(e,32),ei=(e)=>on(e,16),ri=(e)=>on(e,8),on=(e,r)=>{const s=Jf(e);if(s!==void 0&&Zf(s,r)!==s)throw new TypeError(`Expected ${r}-bit integer, got ${e}`);return s},Zf=(e,r)=>{switch(r){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},de=(e,r)=>{if(e===null||e===void 0){if(r)throw new TypeError(`Expected a non-null value for ${r}`);throw new TypeError("Expected a non-null value")}return e},Qe=(e)=>{if(e===null||e===void 0)return;if(typeof e==="object"&&!Array.isArray(e))return e;const r=Array.isArray(e)?"array":typeof e;throw new TypeError(`Expected object, got ${r}: ${e}`)},S=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string")return e;if(["boolean","number","bigint"].includes(typeof e))return oi.warn(ii(`Expected string, got ${typeof e}: ${e}`)),String(e);throw new TypeError(`Expected string, got ${typeof e}: ${e}`)};var si=(e)=>{if(typeof e=="string")return tn(an(e));return tn(e)},_f=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,an=(e)=>{const r=e.match(_f);if(r===null||r[0].length!==e.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(e)};var fn=(e)=>{if(typeof e=="string")return jf(e);return tn(e)},jf=(e)=>{switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${e}`)}};var ni=(e)=>{if(typeof e==="string")return ei(an(e));return ei(e)},ti=(e)=>{if(typeof e==="string")return ri(an(e));return ri(e)},ii=(e)=>{return String(new TypeError(e).stack||e).split("\n").slice(0,5).filter((r)=>!r.includes("stackTraceWarning")).join("\n")},oi={warn:console.warn};var ec=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],rA=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);var rc=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),vr=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const r=rc.exec(e);if(!r)throw new TypeError("Invalid RFC-3339 date-time value");const[s,n,t,i,c,o,a,f,h]=r,l=ni(ai(n)),d=Je(t,"month",1,12),m=Je(i,"day",1,31),g=sc(l,d,m,{hours:c,minutes:o,seconds:a,fractionalMilliseconds:f});if(h.toUpperCase()!="Z")g.setTime(g.getTime()-ac(h));return g},sA=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),nA=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),tA=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);var sc=(e,r,s,n)=>{const t=r-1;return tc(e,t,s),new Date(Date.UTC(e,t,s,Je(n.hours,"hour",0,23),Je(n.minutes,"minute",0,59),Je(n.seconds,"seconds",0,60),oc(n.fractionalMilliseconds)))};var nc=[31,28,31,30,31,30,31,31,30,31,30,31],tc=(e,r,s)=>{let n=nc[r];if(r===1&&ic(e))n=29;if(s>n)throw new TypeError(`Invalid day for ${ec[r]} in ${e}: ${s}`)},ic=(e)=>{return e%4===0&&(e%100!==0||e%400===0)},Je=(e,r,s,n)=>{const t=ti(ai(e));if(t<s||t>n)throw new TypeError(`${r} must be between ${s} and ${n}, inclusive`);return t},oc=(e)=>{if(e===null||e===void 0)return 0;return si("0."+e)*1000},ac=(e)=>{const r=e[0];let s=1;if(r=="+")s=1;else if(r=="-")s=-1;else throw new TypeError(`Offset direction, ${r}, must be "+" or "-"`);const n=Number(e.substring(1,3)),t=Number(e.substring(4,6));return s*(n*60+t)*60*1000},ai=(e)=>{let r=0;while(r<e.length-1&&e.charAt(r)==="0")r++;if(r===0)return e;return e.slice(r)};class $e extends Error{constructor(e){super(e.message);Object.setPrototypeOf(this,$e.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}}var I=(e,r={})=>{Object.entries(r).filter(([,n])=>n!==void 0).forEach(([n,t])=>{if(e[n]==null||e[n]==="")e[n]=t});const s=e.message||e.Message||"UnknownError";return e.message=s,delete e.Message,e};var fc=({output:e,parsedBody:r,exceptionCtor:s,errorCode:n})=>{const t=cc(e),i=t.httpStatusCode?t.httpStatusCode+"":void 0,c=new s({name:r?.code||r?.Code||n||i||"UnknownError",$fault:"client",$metadata:t});throw I(c,r)},Br=(e)=>{return({output:r,parsedBody:s,errorCode:n})=>{fc({output:r,parsedBody:s,exceptionCtor:e,errorCode:n})}},cc=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var br=(e)=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var fi=(e)=>{const r=[];for(let s in Te){const n=Te[s];if(e[n]===void 0)continue;r.push({algorithmId:()=>n,checksumConstructor:()=>e[n]})}return{_checksumAlgorithms:r,addChecksumAlgorithm(s){this._checksumAlgorithms.push(s)},checksumAlgorithms(){return this._checksumAlgorithms}}},ci=(e)=>{const r={};return e.checksumAlgorithms().forEach((s)=>{r[s.algorithmId()]=s.checksumConstructor()}),r};var di=(e)=>{let r=e.retryStrategy;return{setRetryStrategy(s){r=s},retryStrategy(){return r}}},li=(e)=>{const r={};return r.retryStrategy=e.retryStrategy(),r};var Gr=(e)=>{return{...fi(e),...di(e)}};var zr=(e)=>{return{...ci(e),...li(e)}};function cn(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(r){return"%"+r.charCodeAt(0).toString(16).toUpperCase()})}var dn=function(){const e=Object.getPrototypeOf(this).constructor,s=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(s,e.prototype),s};dn.prototype=Object.create(String.prototype,{constructor:{value:dn,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(dn,String);function A(e,r,s){let n,t,i;if(typeof r==="undefined"&&typeof s==="undefined")n={},i=e;else if(n=e,typeof r==="function")return t=r,i=s,dc(n,t,i);else i=r;for(let c of Object.keys(i)){if(!Array.isArray(i[c])){n[c]=i[c];continue}mi(n,null,i,c)}return n}var R=(e,r)=>{const s={};for(let n in r)mi(s,e,r,n);return s},dc=(e,r,s)=>{return A(e,Object.entries(s).reduce((n,[t,i])=>{if(Array.isArray(i))n[t]=i;else if(typeof i==="function")n[t]=[r,i()];else n[t]=[r,i];return n},{}))},mi=(e,r,s,n)=>{if(r!==null){let c=s[n];if(typeof c==="function")c=[,c];const[o=lc,a=mc,f=n]=c;if(typeof o==="function"&&o(r[f])||typeof o!=="function"&&!!o)e[n]=a(r[f]);return}let[t,i]=s[n];if(typeof i==="function"){let c;const o=t===void 0&&(c=i())!=null,a=typeof t==="function"&&!!t(void 0)||typeof t!=="function"&&!!t;if(o)e[n]=c;else if(a)e[n]=i()}else{const c=t===void 0&&i!=null,o=typeof t==="function"&&!!t(i)||typeof t!=="function"&&!!t;if(c||o)e[n]=i}},lc=(e)=>e!=null,mc=(e)=>e;var hi=(e,r,s,n,t,i)=>{if(r!=null&&r[s]!==void 0){const c=n();if(c.length<=0)throw new Error("Empty value provided for input HTTP label: "+s+".");e=e.replace(t,i?c.split("/").map((o)=>cn(o)).join("/"):cn(c))}else throw new Error("No value provided for input HTTP label: "+s+".");return e};var F=(e)=>{if(e==null)return{};if(Array.isArray(e))return e.filter((r)=>r!=null).map(F);if(typeof e==="object"){const r={};for(let s of Object.keys(e)){if(e[s]==null)continue;r[s]=F(e[s])}return r}return e};var gi=(e)=>e?.body instanceof ReadableStream;var hc=(e)=>(r,s)=>async(n)=>{let t=await e.retryStrategy();const i=await e.maxAttempts();if(gc(t)){t=t;let c=await t.acquireInitialRetryToken(s.partition_id),o=new Error,a=0,f=0;const{request:h}=n,l=M.isInstance(h);if(l)h.headers[$r]=Ve();while(!0)try{if(l)h.headers[Ur]=`attempt=${a+1}; max=${i}`;const{response:d,output:m}=await r(n);return t.recordSuccess(c),m.$metadata.attempts=a+1,m.$metadata.totalRetryDelay=f,{response:d,output:m}}catch(d){const m=yc(d);if(o=rn(d),l&&gi(h))throw(s.logger instanceof ge?console:s.logger)?.warn("An error was encountered in a non-retryable streaming request."),o;try{c=await t.refreshRetryTokenForRetry(c,m)}catch(w){if(!o.$metadata)o.$metadata={};throw o.$metadata.attempts=a+1,o.$metadata.totalRetryDelay=f,o}a=c.getRetryCount();const g=c.getRetryDelay();f+=g,await new Promise((w)=>setTimeout(w,g))}}else{if(t=t,t?.mode)s.userAgent=[...s.userAgent||[],["cfg/retry-mode",t.mode]];return t.retry(r,n)}},gc=(e)=>typeof e.acquireInitialRetryToken!=="undefined"&&typeof e.refreshRetryTokenForRetry!=="undefined"&&typeof e.recordSuccess!=="undefined",yc=(e)=>{const r={error:e,errorType:wc(e)},s=Ec(e.$response);if(s)r.retryAfterHint=s;return r},wc=(e)=>{if(ke(e))return"THROTTLING";if(Or(e))return"TRANSIENT";if(Ht(e))return"SERVER_ERROR";return"CLIENT_ERROR"},ln={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},Hr=(e)=>({applyToStack:(r)=>{r.add(hc(e),ln)}}),Ec=(e)=>{if(!J.isInstance(e))return;const r=Object.keys(e.headers).find((i)=>i.toLowerCase()==="retry-after");if(!r)return;const s=e.headers[r],n=Number(s);if(!Number.isNaN(n))return new Date(n*1000);return new Date(s)};var Sc={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:ln.name},qr=(e)=>({applyToStack:(r)=>{r.addRelativeTo(vt(e),Sc)}});class Ze{constructor(e){this.authSchemes=new Map;for(let[r,s]of Object.entries(e))if(s!==void 0)this.authSchemes.set(r,s)}getIdentityProvider(e){return this.authSchemes.get(e)}}var pc=(e)=>(r)=>mn(r)&&r.expiration.getTime()-Date.now()<e;var yi=pc(300000),mn=(e)=>e.expiration!==void 0,wi=(e,r,s)=>{if(e===void 0)return;const n=typeof e!=="function"?async()=>Promise.resolve(e):e;let t,i,c,o=!1;const a=async(f)=>{if(!i)i=n(f);try{t=await i,c=!0,o=!1}finally{i=void 0}return t};if(r===void 0)return async(f)=>{if(!c||f?.forceRefresh)t=await a(f);return t};return async(f)=>{if(!c||f?.forceRefresh)t=await a(f);if(o)return t;if(!s(t))return o=!0,t;if(r(t))return await a(f),t;return t}};var _e=(e)=>{if(typeof e==="function")return e;const r=Promise.resolve(e);return()=>r};function Ae(e,r){return new Ei(e,r)}class Ei{constructor(e,r){this.input=e,this.context=r,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:e,protocol:r="https",port:s,path:n}=await this.context.endpoint();this.path=n;for(let t of this.resolvePathStack)t(this.path);return new M({protocol:r,hostname:this.hostname||e,port:s,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push((r)=>{this.path=`${r?.endsWith("/")?r.slice(0,-1):r||""}`+e}),this}p(e,r,s,n){return this.resolvePathStack.push((t)=>{this.path=hi(t,this.input,e,r,s,n)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}function Ac(e){return(r)=>async(s)=>{const n=s.request;if(M.isInstance(n)){const{body:t,headers:i}=n;if(t&&Object.keys(i).map((c)=>c.toLowerCase()).indexOf(Si)===-1)try{const c=e(t);n.headers={...n.headers,[Si]:String(c)}}catch(c){}}return r({...s,request:n})}}var Si="content-length",Rc={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Vr=(e)=>({applyToStack:(r)=>{r.add(Ac(e.bodyLengthChecker),Rc)}});var hn=(e)=>J.isInstance(e)?e.headers?.date??e.headers?.Date:void 0;var Yr=(e)=>new Date(Date.now()+e);var pi=(e,r)=>Math.abs(Yr(r).getTime()-e)>=300000;var gn=(e,r)=>{const s=Date.parse(e);if(pi(s,r))return s-Date.now();return r};var je=(e,r)=>{if(!r)throw new Error(`Property \`${e}\` is not resolved for AWS SDK SigV4Auth`);return r},Ai=async(e)=>{const r=je("context",e.context),s=je("config",e.config),n=r.endpointV2?.properties?.authSchemes?.[0],i=await je("signer",s.signer)(n),c=e?.signingRegion,o=e?.signingRegionSet,a=e?.signingName;return{config:s,signer:i,signingRegion:c,signingRegionSet:o,signingName:a}};class Ue{async sign(e,r,s){if(!M.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const n=await Ai(s),{config:t,signer:i}=n;let{signingRegion:c,signingName:o}=n;const a=s.context;if(a?.authSchemes?.length??0>1){const[h,l]=a.authSchemes;if(h?.name==="sigv4a"&&l?.name==="sigv4")c=l?.signingRegion??c,o=l?.signingName??o}return await i.sign(e,{signingDate:Yr(t.systemClockOffset),signingRegion:c,signingService:o})}errorHandler(e){return(r)=>{const s=r.ServerTime??hn(r.$response);if(s){const n=je("config",e.config),t=n.systemClockOffset;if(n.systemClockOffset=gn(s,n.systemClockOffset),n.systemClockOffset!==t&&r.$metadata)r.$metadata.clockSkewCorrected=!0}throw r}}successHandler(e,r){const s=hn(e);if(s){const n=je("config",r.config);n.systemClockOffset=gn(s,n.systemClockOffset)}}}var Mi=(e,r,s)=>{let n,t,i,c=!1;const o=async()=>{if(!t)t=e();try{n=await t,i=!0,c=!1}finally{t=void 0}return n};if(r===void 0)return async(a)=>{if(!i||a?.forceRefresh)n=await o();return n};return async(a)=>{if(!i||a?.forceRefresh)n=await o();if(c)return n;if(s&&!s(n))return c=!0,n;if(r(n))return await o(),n;return n}};var Pi="X-Amz-Algorithm",Ii="X-Amz-Credential",Ti="X-Amz-Date",Ni="X-Amz-SignedHeaders",ki="X-Amz-Expires",Oi="X-Amz-Signature",Fi="X-Amz-Security-Token";var Ci="authorization",yn="X-Amz-Date".toLowerCase();var $i=["authorization",yn,"date"],Ui="X-Amz-Signature".toLowerCase(),er="x-amz-content-sha256",Di="X-Amz-Security-Token".toLowerCase();var xi={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Li=/^proxy-/,ui=/^sec-/;var Wr="AWS4-HMAC-SHA256";var vi="AWS4-HMAC-SHA256-PAYLOAD",Bi="UNSIGNED-PAYLOAD",bi=50,wn="aws4_request",Gi=604800;var Kr={},En=[],Xr=(e,r,s)=>`${e}/${r}/${s}/${wn}`,Hi=async(e,r,s,n,t)=>{const i=await zi(e,r.secretAccessKey,r.accessKeyId),c=`${s}:${n}:${t}:${k(i)}:${r.sessionToken}`;if(c in Kr)return Kr[c];En.push(c);while(En.length>bi)delete Kr[En.shift()];let o=`AWS4${r.secretAccessKey}`;for(let a of[s,n,t,wn])o=await zi(e,o,a);return Kr[c]=o};var zi=(e,r,s)=>{const n=new e(r);return n.update(ce(s)),n.digest()};var Qr=({headers:e},r,s)=>{const n={};for(let t of Object.keys(e).sort()){if(e[t]==null)continue;const i=t.toLowerCase();if(i in xi||r?.has(i)||Li.test(i)||ui.test(i)){if(!s||s&&!s.has(i))continue}n[i]=e[t].trim().replace(/\s+/g," ")}return n};var Sn=({query:e={}})=>{const r=[],s={};for(let n of Object.keys(e).sort()){if(n.toLowerCase()===Ui)continue;r.push(n);const t=e[n];if(typeof t==="string")s[n]=`${b(n)}=${b(t)}`;else if(Array.isArray(t))s[n]=t.slice(0).reduce((i,c)=>i.concat([`${b(n)}=${b(c)}`]),[]).sort().join("&")}return r.map((n)=>s[n]).filter((n)=>n).join("&")};var qi=(e)=>typeof ArrayBuffer==="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]";var rr=async({headers:e,body:r},s)=>{for(let n of Object.keys(e))if(n.toLowerCase()===er)return e[n];if(r==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof r==="string"||ArrayBuffer.isView(r)||qi(r)){const n=new s;return n.update(ce(r)),k(await n.digest())}return Bi};function Yi(e){for(let r=0;r<8;r++)e[r]^=255;for(let r=7;r>-1;r--)if(e[r]++,e[r]!==0)break}class pn{format(e){const r=[];for(let t of Object.keys(e)){const i=D(t);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(e[t]))}const s=new Uint8Array(r.reduce((t,i)=>t+i.byteLength,0));let n=0;for(let t of r)s.set(t,n),n+=t.byteLength;return s}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const s=new DataView(new ArrayBuffer(5));return s.setUint8(0,4),s.setInt32(1,e.value,!1),new Uint8Array(s.buffer);case"long":const n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case"binary":const t=new DataView(new ArrayBuffer(3+e.value.byteLength));t.setUint8(0,6),t.setUint16(1,e.value.byteLength,!1);const i=new Uint8Array(t.buffer);return i.set(e.value,3),i;case"string":const c=D(e.value),o=new DataView(new ArrayBuffer(3+c.byteLength));o.setUint8(0,7),o.setUint16(1,c.byteLength,!1);const a=new Uint8Array(o.buffer);return a.set(c,3),a;case"timestamp":const f=new Uint8Array(9);return f[0]=8,f.set(An.fromNumber(e.value.valueOf()).bytes,1),f;case"uuid":if(!Mc.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(Lr(e.value.replace(/\-/g,"")),1),h}}}var Vi;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(Vi||(Vi={}));var Mc=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class An{constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776000||e<-9223372036854776000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let s=7,n=Math.abs(Math.round(e));s>-1&&n>0;s--,n/=256)r[s]=n;if(e<0)Yi(r);return new An(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;if(r)Yi(e);return parseInt(k(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}var Wi=(e,r)=>{e=e.toLowerCase();for(let s of Object.keys(r))if(e===s.toLowerCase())return!0;return!1};var Rn=(e,r={})=>{const{headers:s,query:n={}}=M.clone(e);for(let t of Object.keys(s)){const i=t.toLowerCase();if(i.slice(0,6)==="x-amz-"&&!r.unhoistableHeaders?.has(i))n[t]=s[t],delete s[t]}return{...e,headers:s,query:n}};var Jr=(e)=>{e=M.clone(e);for(let r of Object.keys(e.headers))if($i.indexOf(r.toLowerCase())>-1)delete e.headers[r];return e};var Ki=(e)=>Pc(e).toISOString().replace(/\.\d{3}Z$/,"Z"),Pc=(e)=>{if(typeof e==="number")return new Date(e*1000);if(typeof e==="string"){if(Number(e))return new Date(Number(e)*1000);return new Date(e)}return e};class _r{constructor({applyChecksum:e,credentials:r,region:s,service:n,sha256:t,uriEscapePath:i=!0}){this.headerFormatter=new pn,this.service=n,this.sha256=t,this.uriEscapePath=i,this.applyChecksum=typeof e==="boolean"?e:!0,this.regionProvider=C(s),this.credentialProvider=C(r)}async presign(e,r={}){const{signingDate:s=new Date,expiresIn:n=3600,unsignableHeaders:t,unhoistableHeaders:i,signableHeaders:c,signingRegion:o,signingService:a}=r,f=await this.credentialProvider();this.validateResolvedCredentials(f);const h=o??await this.regionProvider(),{longDate:l,shortDate:d}=Zr(s);if(n>Gi)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const m=Xr(d,h,a??this.service),g=Rn(Jr(e),{unhoistableHeaders:i});if(f.sessionToken)g.query[Fi]=f.sessionToken;g.query[Pi]=Wr,g.query[Ii]=`${f.accessKeyId}/${m}`,g.query[Ti]=l,g.query[ki]=n.toString(10);const w=Qr(g,t,c);return g.query[Ni]=Xi(w),g.query[Oi]=await this.getSignature(l,m,this.getSigningKey(f,h,d,a),this.createCanonicalRequest(g,w,await rr(e,this.sha256))),g}async sign(e,r){if(typeof e==="string")return this.signString(e,r);else if(e.headers&&e.payload)return this.signEvent(e,r);else if(e.message)return this.signMessage(e,r);else return this.signRequest(e,r)}async signEvent({headers:e,payload:r},{signingDate:s=new Date,priorSignature:n,signingRegion:t,signingService:i}){const c=t??await this.regionProvider(),{shortDate:o,longDate:a}=Zr(s),f=Xr(o,c,i??this.service),h=await rr({headers:{},body:r},this.sha256),l=new this.sha256;l.update(e);const d=k(await l.digest()),m=[vi,a,f,n,d,h].join("\n");return this.signString(m,{signingDate:s,signingRegion:c,signingService:i})}async signMessage(e,{signingDate:r=new Date,signingRegion:s,signingService:n}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:r,signingRegion:s,signingService:n,priorSignature:e.priorSignature}).then((i)=>{return{message:e.message,signature:i}})}async signString(e,{signingDate:r=new Date,signingRegion:s,signingService:n}={}){const t=await this.credentialProvider();this.validateResolvedCredentials(t);const i=s??await this.regionProvider(),{shortDate:c}=Zr(r),o=new this.sha256(await this.getSigningKey(t,i,c,n));return o.update(ce(e)),k(await o.digest())}async signRequest(e,{signingDate:r=new Date,signableHeaders:s,unsignableHeaders:n,signingRegion:t,signingService:i}={}){const c=await this.credentialProvider();this.validateResolvedCredentials(c);const o=t??await this.regionProvider(),a=Jr(e),{longDate:f,shortDate:h}=Zr(r),l=Xr(h,o,i??this.service);if(a.headers[yn]=f,c.sessionToken)a.headers[Di]=c.sessionToken;const d=await rr(a,this.sha256);if(!Wi(er,a.headers)&&this.applyChecksum)a.headers[er]=d;const m=Qr(a,n,s),g=await this.getSignature(f,l,this.getSigningKey(c,o,h,i),this.createCanonicalRequest(a,m,d));return a.headers[Ci]=`${Wr} Credential=${c.accessKeyId}/${l}, SignedHeaders=${Xi(m)}, Signature=${g}`,a}createCanonicalRequest(e,r,s){const n=Object.keys(r).sort();return`${e.method}
|
|
2
|
-
${this.getCanonicalPath(e)}
|
|
3
|
-
|
|
4
|
-
${n.map((t)=>`${t}:${r[t]}`).join("\n")}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
${k(t)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const r=[];for(let t of e.split("/")){if(t?.length===0)continue;if(t===".")continue;if(t==="..")r.pop();else r.push(t)}const s=`${e?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&e?.endsWith("/")?"/":""}`;return b(s).replace(/%2F/g,"/")}return e}async getSignature(e,r,s,n){const t=await this.createStringToSign(e,r,n),i=new this.sha256(await s);return i.update(ce(t)),k(await i.digest())}getSigningKey(e,r,s,n){return Hi(this.sha256,e,s,r,n||this.service)}validateResolvedCredentials(e){if(typeof e!=="object"||typeof e.accessKeyId!=="string"||typeof e.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}}var Zr=(e)=>{const r=Ki(e).replace(/[\-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}},Xi=(e)=>Object.keys(e).sort().join(";");var jr=(e)=>{let r;if(e.credentials)r=wi(e.credentials,yi,mn);if(!r)if(e.credentialDefaultProvider)r=_e(e.credentialDefaultProvider(Object.assign({},e,{parentClientConfig:e})));else r=async()=>{throw new Error("`credentials` is missing")};const{signingEscapePath:s=!0,systemClockOffset:n=e.systemClockOffset||0,sha256:t}=e;let i;if(e.signer)i=_e(e.signer);else if(e.regionInfoProvider)i=()=>_e(e.region)().then(async(c)=>[await e.regionInfoProvider(c,{useFipsEndpoint:await e.useFipsEndpoint(),useDualstackEndpoint:await e.useDualstackEndpoint()})||{},c]).then(([c,o])=>{const{signingRegion:a,signingService:f}=c;e.signingRegion=e.signingRegion||a||o,e.signingName=e.signingName||f||e.serviceId;const h={...e,credentials:r,region:e.signingRegion,service:e.signingName,sha256:t,uriEscapePath:s};return new(e.signerConstructor||_r)(h)});else i=async(c)=>{c=Object.assign({},{name:"sigv4",signingName:e.signingName||e.defaultSigningName,signingRegion:await _e(e.region)(),properties:{}},c);const{signingRegion:o,signingName:a}=c;e.signingRegion=e.signingRegion||o,e.signingName=e.signingName||a||e.serviceId;const f={...e,credentials:r,region:e.signingRegion,service:e.signingName,sha256:t,uriEscapePath:s};return new(e.signerConstructor||_r)(f)};return{...e,systemClockOffset:n,signingEscapePath:s,credentials:r,signer:i}};var Qi=(e,r)=>Ke(e,r).then((s)=>r.utf8Encoder(s));var x=(e,r)=>Qi(e,r).then((s)=>{if(s.length)try{return JSON.parse(s)}catch(n){if(n?.name==="SyntaxError")Object.defineProperty(n,"$responseBodyText",{value:s});throw n}return{}}),es=async(e,r)=>{const s=await x(e,r);return s.message=s.message??s.Message,s},rs=(e,r)=>{const s=(i,c)=>Object.keys(i).find((o)=>o.toLowerCase()===c.toLowerCase()),n=(i)=>{let c=i;if(typeof c==="number")c=c.toString();if(c.indexOf(",")>=0)c=c.split(",")[0];if(c.indexOf(":")>=0)c=c.split(":")[0];if(c.indexOf("#")>=0)c=c.split("#")[1];return c},t=s(e.headers,"x-amzn-errortype");if(t!==void 0)return n(e.headers[t]);if(r.code!==void 0)return n(r.code);if(r.__type!==void 0)return n(r.__type)};function Ic(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:e.region},propertiesExtractor:(r,s)=>({signingProperties:{config:r,context:s}})}}var Ji=async(e,r,s)=>{return{operation:q(r).operation,region:await C(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Zi=(e)=>{const r=[];switch(e.operation){default:r.push(Ic(e))}return r},_i=(e)=>{return{...jr(e)}};var ji=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"bedrock"}},De={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var eo={name:"@aws-sdk/client-bedrock",description:"AWS SDK for JavaScript Bedrock Client for Node.js, Browser and React Native",version:"3.640.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-bedrock","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo bedrock"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.637.0","@aws-sdk/client-sts":"3.637.0","@aws-sdk/core":"3.635.0","@aws-sdk/credential-provider-node":"3.637.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.637.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.637.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.4.0","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.15","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.2.0","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.15","@smithy/util-defaults-mode-node":"^3.0.15","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2",uuid:"^9.0.1"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96","@types/uuid":"^9.0.4",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-bedrock",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-bedrock"}};var Mn=(e)=>new TextEncoder().encode(e);function z(e){if(e instanceof Uint8Array)return e;if(typeof e==="string")return Nc(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)}var Nc=typeof Buffer!=="undefined"&&Buffer.from?function(e){return Buffer.from(e,"utf8")}:Mn;function le(e){if(typeof e==="string")return e.length===0;return e.byteLength===0}function Pn(e){return new Uint8Array([(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255])}function In(e){if(!Uint32Array.from){var r=new Uint32Array(e.length),s=0;while(s<e.length)r[s]=e[s],s+=1;return r}return Uint32Array.from(e)}var Tn={name:"SHA-256"},Nn={name:"HMAC",hash:Tn},ro=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);function xe(){if(typeof window!=="undefined")return window;else if(typeof self!=="undefined")return self;return kc}var kc={};var kn=function(){function e(r){this.toHash=new Uint8Array(0),this.secret=r,this.reset()}return e.prototype.update=function(r){if(le(r))return;var s=z(r),n=new Uint8Array(this.toHash.byteLength+s.byteLength);n.set(this.toHash,0),n.set(s,this.toHash.byteLength),this.toHash=n},e.prototype.digest=function(){var r=this;if(this.key)return this.key.then(function(s){return xe().crypto.subtle.sign(Nn,s,r.toHash).then(function(n){return new Uint8Array(n)})});if(le(this.toHash))return Promise.resolve(ro);return Promise.resolve().then(function(){return xe().crypto.subtle.digest(Tn,r.toHash)}).then(function(s){return Promise.resolve(new Uint8Array(s))})},e.prototype.reset=function(){var r=this;if(this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0)this.key=new Promise(function(s,n){xe().crypto.subtle.importKey("raw",z(r.secret),Nn,!1,["sign"]).then(s,n)}),this.key.catch(function(){})},e}();function ss(e,r,s,n){function t(i){return i instanceof s?i:new s(function(c){c(i)})}return new(s||(s=Promise))(function(i,c){function o(h){try{f(n.next(h))}catch(l){c(l)}}function a(h){try{f(n.throw(h))}catch(l){c(l)}}function f(h){h.done?i(h.value):t(h.value).then(o,a)}f((n=n.apply(e,r||[])).next())})}function ns(e,r){var s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,t,i,c;return c={next:o(0),throw:o(1),return:o(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function o(f){return function(h){return a([f,h])}}function a(f){if(n)throw new TypeError("Generator is already executing.");while(c&&(c=0,f[0]&&(s=0)),s)try{if(n=1,t&&(i=f[0]&2?t.return:f[0]?t.throw||((i=t.return)&&i.call(t),0):t.next)&&!(i=i.call(t,f[1])).done)return i;if(t=0,i)f=[f[0]&2,i.value];switch(f[0]){case 0:case 1:i=f;break;case 4:return s.label++,{value:f[1],done:!1};case 5:s.label++,t=f[1],f=[0];continue;case 7:f=s.ops.pop(),s.trys.pop();continue;default:if((i=s.trys,!(i=i.length>0&&i[i.length-1]))&&(f[0]===6||f[0]===2)){s=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){s.label=f[1];break}if(f[0]===6&&s.label<i[1]){s.label=i[1],i=f;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(f);break}if(i[2])s.ops.pop();s.trys.pop();continue}f=r.call(e,s)}catch(h){f=[6,h],t=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}}function so(e){var r=typeof Symbol==="function"&&Symbol.iterator,s=r&&e[r],n=0;if(s)return s.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&n>=e.length)e=void 0;return{value:e&&e[n++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}var U=64,no=32,to=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),io=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],oo=Math.pow(2,53)-1;var sr=function(){function e(){this.state=Int32Array.from(io),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(r){if(this.finished)throw new Error("Attempted to update an already finished hash.");var s=0,n=r.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>oo)throw new Error("Cannot hash more than 2^53 - 1 bits");while(n>0)if(this.buffer[this.bufferLength++]=r[s++],n--,this.bufferLength===U)this.hashBuffer(),this.bufferLength=0},e.prototype.digest=function(){if(!this.finished){var r=this.bytesHashed*8,s=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(s.setUint8(this.bufferLength++,128),n%U>=U-8){for(var t=this.bufferLength;t<U;t++)s.setUint8(t,0);this.hashBuffer(),this.bufferLength=0}for(var t=this.bufferLength;t<U-8;t++)s.setUint8(t,0);s.setUint32(U-8,Math.floor(r/4294967296),!0),s.setUint32(U-4,r),this.hashBuffer(),this.finished=!0}var i=new Uint8Array(no);for(var t=0;t<8;t++)i[t*4]=this.state[t]>>>24&255,i[t*4+1]=this.state[t]>>>16&255,i[t*4+2]=this.state[t]>>>8&255,i[t*4+3]=this.state[t]>>>0&255;return i},e.prototype.hashBuffer=function(){var r=this,s=r.buffer,n=r.state,t=n[0],i=n[1],c=n[2],o=n[3],a=n[4],f=n[5],h=n[6],l=n[7];for(var d=0;d<U;d++){if(d<16)this.temp[d]=(s[d*4]&255)<<24|(s[d*4+1]&255)<<16|(s[d*4+2]&255)<<8|s[d*4+3]&255;else{var m=this.temp[d-2],g=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10;m=this.temp[d-15];var w=(m>>>7|m<<25)^(m>>>18|m<<14)^m>>>3;this.temp[d]=(g+this.temp[d-7]|0)+(w+this.temp[d-16]|0)}var y=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&f^~a&h)|0)+(l+(to[d]+this.temp[d]|0)|0)|0,E=((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+(t&i^t&c^i&c)|0;l=h,h=f,f=a,a=o+y|0,o=c,c=i,i=t,t=y+E|0}n[0]+=t,n[1]+=i,n[2]+=c,n[3]+=o,n[4]+=a,n[5]+=f,n[6]+=h,n[7]+=l},e}();function Oc(e){var r=z(e);if(r.byteLength>U){var s=new sr;s.update(r),r=s.digest()}var n=new Uint8Array(U);return n.set(r),n}var ao=function(){function e(r){this.secret=r,this.hash=new sr,this.reset()}return e.prototype.update=function(r){if(le(r)||this.error)return;try{this.hash.update(z(r))}catch(s){this.error=s}},e.prototype.digestSync=function(){if(this.error)throw this.error;if(this.outer){if(!this.outer.finished)this.outer.update(this.hash.digest());return this.outer.digest()}return this.hash.digest()},e.prototype.digest=function(){return ss(this,void 0,void 0,function(){return ns(this,function(r){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new sr,this.secret){this.outer=new sr;var r=Oc(this.secret),s=new Uint8Array(U);s.set(r);for(var n=0;n<U;n++)r[n]^=54,s[n]^=92;this.hash.update(r),this.outer.update(s);for(var n=0;n<r.byteLength;n++)r[n]=0}},e}();function fo(e){if(Cc(e)&&typeof e.crypto.subtle==="object"){var r=e.crypto.subtle;return $c(r)}return!1}function Cc(e){if(typeof e==="object"&&typeof e.crypto==="object"){var r=e.crypto.getRandomValues;return typeof r==="function"}return!1}function $c(e){return e&&Fc.every(function(r){return typeof e[r]==="function"})}var Fc=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];var ts=function(){function e(r){if(fo(xe()))this.hash=new kn(r);else this.hash=new ao(r)}return e.prototype.update=function(r,s){this.hash.update(z(r))},e.prototype.digest=function(){return this.hash.digest()},e.prototype.reset=function(){this.hash.reset()},e}();var co=st(Fn(),1),is=({serviceId:e,clientVersion:r})=>async()=>{const s=typeof window!=="undefined"&&window?.navigator?.userAgent?co.default.parse(window.navigator.userAgent):void 0,n=[["aws-sdk-js",r],["ua","2.0"],[`os/${s?.os?.name||"other"}`,s?.os?.version],["lang/js"],["md/browser",`${s?.browser?.name??"unknown"}_${s?.browser?.version??"unknown"}`]];if(e)n.push([`api/${e}`,r]);return n};var os=(e)=>()=>Promise.reject(e);var lo=typeof TextEncoder=="function"?new TextEncoder:null,as=(e)=>{if(typeof e==="string"){if(lo)return lo.encode(e).byteLength;let r=e.length;for(let s=r-1;s>=0;s--){const n=e.charCodeAt(s);if(n>127&&n<=2047)r++;else if(n>2047&&n<=65535)r+=2;if(n>=56320&&n<=57343)s--}return r}else if(typeof e.byteLength==="number")return e.byteLength;else if(typeof e.size==="number")return e.size;throw new Error(`Body Length computation failed for ${e}`)};var mo={["required"]:!1,type:"String"},ho={["required"]:!0,default:!1,type:"Boolean"},go={["ref"]:"Endpoint"},Ao={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},Ro={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},K={},yo={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},wo={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsDualStack"]}]},Eo=[Ao],So=[Ro],po=[{["ref"]:"Region"}],Uc={version:"1.0",parameters:{Region:mo,UseDualStack:ho,UseFIPS:ho,Endpoint:mo},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[go]}],rules:[{conditions:Eo,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{rules:[{conditions:So,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:go,properties:K,headers:K},type:"endpoint"}],type:"tree"}],type:"tree"},{rules:[{conditions:[{["fn"]:"isSet",["argv"]:po}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:po,assign:"PartitionResult"}],rules:[{conditions:[Ao,Ro],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,yo]},wo],rules:[{rules:[{endpoint:{url:"https://bedrock-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:K,headers:K},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:Eo,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[yo,!0]}],rules:[{rules:[{endpoint:{url:"https://bedrock-fips.{Region}.{PartitionResult#dnsSuffix}",properties:K,headers:K},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:So,rules:[{conditions:[wo],rules:[{rules:[{endpoint:{url:"https://bedrock.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:K,headers:K},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{rules:[{endpoint:{url:"https://bedrock.{Region}.{PartitionResult#dnsSuffix}",properties:K,headers:K},type:"endpoint"}],type:"tree"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}],type:"tree"}]},Mo=Uc;var Po=(e,r={})=>{return be(Mo,{endpointParams:e,logger:r.logger})};Z.aws=Ge;var Io=(e)=>{return{apiVersion:"2023-04-20",base64Decoder:e?.base64Decoder??fe,base64Encoder:e?.base64Encoder??pe,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Po,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Zi,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new Ue}],logger:e?.logger??new ge,serviceId:e?.serviceId??"Bedrock",urlParser:e?.urlParser??ie,utf8Decoder:e?.utf8Decoder??D,utf8Encoder:e?.utf8Encoder??Se}};var No=st(Fn(),1);var To=["in-region","cross-region","mobile","standard","legacy"];var fs=({defaultsMode:e}={})=>Mi(async()=>{const r=typeof e==="function"?await e():e;switch(r?.toLowerCase()){case"auto":return Promise.resolve(Dc()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(r?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${To.join(", ")}, got ${r}`)}}),Dc=()=>{const r=(typeof window!=="undefined"&&window?.navigator?.userAgent?No.default.parse(window.navigator.userAgent):void 0)?.platform?.type;return r==="tablet"||r==="mobile"};var ko=(e)=>{const r=fs(e),s=()=>r().then(br),n=Io(e);return{...n,...e,runtime:"browser",defaultsMode:r,bodyLengthChecker:e?.bodyLengthChecker??as,credentialDefaultProvider:e?.credentialDefaultProvider??((t)=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??is({serviceId:n.serviceId,clientVersion:eo.version}),maxAttempts:e?.maxAttempts??W,region:e?.region??os("Region is missing"),requestHandler:Ce.create(e?.requestHandler??s),retryMode:e?.retryMode??(async()=>(await s()).retryMode||He),sha256:e?.sha256??ts,streamCollector:e?.streamCollector??We,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(Rr)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Mr))}};var cs=(e)=>{let r=async()=>{if(e.region===void 0)throw new Error("Region is missing from runtimeConfig");const s=e.region;if(typeof s==="string")return s;return s()};return{setRegion(s){r=s},region(){return r}}},ds=(e)=>{return{region:e.region()}};var Oo=(e)=>{const r=e.httpAuthSchemes;let{httpAuthSchemeProvider:s,credentials:n}=e;return{setHttpAuthScheme(t){const i=r.findIndex((c)=>c.schemeId===t.schemeId);if(i===-1)r.push(t);else r.splice(i,1,t)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(t){s=t},httpAuthSchemeProvider(){return s},setCredentials(t){n=t},credentials(){return n}}},Fo=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var ls=(e)=>e,Co=(e,r)=>{const s={...ls(cs(e)),...ls(Gr(e)),...ls(ir(e)),...ls(Oo(e))};return r.forEach((n)=>n.configure(s)),{...e,...ds(s),...zr(s),...or(s),...Fo(s)}};class Cn extends Ye{constructor(...[e]){const r=ko(e||{}),s=ji(r),n=lr(s),t=xr(n),i=Ir(t),c=ar(i),o=Nr(c),a=_i(o),f=Co(a,e?.extensions||[]);super(f);this.config=f,this.middlewareStack.use(pr(this.config)),this.middlewareStack.use(Hr(this.config)),this.middlewareStack.use(Vr(this.config)),this.middlewareStack.use(fr(this.config)),this.middlewareStack.use(cr(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(kr(this.config,{httpAuthSchemeParametersProvider:Ji,identityProviderConfigProvider:async(h)=>new Ze({"aws.auth#sigv4":h.credentials})})),this.middlewareStack.use(qr(this.config))}destroy(){super.destroy()}}class L extends $e{constructor(e){super(e);Object.setPrototypeOf(this,L.prototype)}}class ms extends L{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,ms.prototype)}}class hs extends L{constructor(e){super({name:"ConflictException",$fault:"client",...e});this.name="ConflictException",this.$fault="client",Object.setPrototypeOf(this,hs.prototype)}}class gs extends L{constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,gs.prototype)}}class ys extends L{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,ys.prototype)}}class ws extends L{constructor(e){super({name:"ThrottlingException",$fault:"client",...e});this.name="ThrottlingException",this.$fault="client",Object.setPrototypeOf(this,ws.prototype)}}class Es extends L{constructor(e){super({name:"ValidationException",$fault:"client",...e});this.name="ValidationException",this.$fault="client",Object.setPrototypeOf(this,Es.prototype)}}var $o;(function(e){e.visit=(r,s)=>{if(r.s3Uri!==void 0)return s.s3Uri(r.s3Uri);return s._(r.$unknown[0],r.$unknown[1])}})($o||($o={}));var Uo;(function(e){e.visit=(r,s)=>{if(r.automated!==void 0)return s.automated(r.automated);if(r.human!==void 0)return s.human(r.human);return s._(r.$unknown[0],r.$unknown[1])}})(Uo||(Uo={}));var Do;(function(e){e.visit=(r,s)=>{if(r.bedrockModel!==void 0)return s.bedrockModel(r.bedrockModel);return s._(r.$unknown[0],r.$unknown[1])}})(Do||(Do={}));var xo;(function(e){e.visit=(r,s)=>{if(r.models!==void 0)return s.models(r.models);return s._(r.$unknown[0],r.$unknown[1])}})(xo||(xo={}));class Ss extends L{constructor(e){super({name:"ServiceQuotaExceededException",$fault:"client",...e});this.name="ServiceQuotaExceededException",this.$fault="client",Object.setPrototypeOf(this,Ss.prototype)}}class ps extends L{constructor(e){super({name:"TooManyTagsException",$fault:"client",...e});this.name="TooManyTagsException",this.$fault="client",Object.setPrototypeOf(this,ps.prototype),this.resourceName=e.resourceName}}var Lo;(function(e){e.visit=(r,s)=>{if(r.s3DataSource!==void 0)return s.s3DataSource(r.s3DataSource);return s._(r.$unknown[0],r.$unknown[1])}})(Lo||(Lo={}));var uo;(function(e){e.visit=(r,s)=>{if(r.s3InputDataConfig!==void 0)return s.s3InputDataConfig(r.s3InputDataConfig);return s._(r.$unknown[0],r.$unknown[1])}})(uo||(uo={}));var vo;(function(e){e.visit=(r,s)=>{if(r.s3OutputDataConfig!==void 0)return s.s3OutputDataConfig(r.s3OutputDataConfig);return s._(r.$unknown[0],r.$unknown[1])}})(vo||(vo={}));var Ho=async(e,r)=>{const s=Ae(e,r),n={"content-type":"application/json"};s.bp("/model-customization-jobs");let t;return t=JSON.stringify(R(e,{baseModelIdentifier:[],clientRequestToken:[!0,(i)=>i??Ve()],customModelKmsKeyId:[],customModelName:[],customModelTags:(i)=>F(i),customizationType:[],hyperParameters:(i)=>F(i),jobName:[],jobTags:(i)=>F(i),outputDataConfig:(i)=>F(i),roleArn:[],trainingDataConfig:(i)=>F(i),validationDataConfig:(i)=>F(i),vpcConfig:(i)=>F(i)})),s.m("POST").h(n).b(t),s.build()};var qo=async(e,r)=>{const s=Ae(e,r),n={};s.bp("/model-customization-jobs/{jobIdentifier}"),s.p("jobIdentifier",()=>e.jobIdentifier,"{jobIdentifier}",!1);let t;return s.m("GET").h(n).b(t),s.build()};var Vo=async(e,r)=>{const s=Ae(e,r),n={};s.bp("/foundation-models");const t=A({[zo]:[,e[zo]],[Bo]:[,e[Bo]],[Go]:[,e[Go]],[bo]:[,e[bo]]});let i;return s.m("GET").h(n).q(t).b(i),s.build()};var Yo=async(e,r)=>{if(e.statusCode!==201&&e.statusCode>=300)return $n(e,r);const s=A({$metadata:H(e)}),n=de(Qe(await x(e.body,r)),"body"),t=R(n,{jobArn:S});return Object.assign(s,t),s};var Wo=async(e,r)=>{if(e.statusCode!==200&&e.statusCode>=300)return $n(e,r);const s=A({$metadata:H(e)}),n=de(Qe(await x(e.body,r)),"body"),t=R(n,{baseModelArn:S,clientRequestToken:S,creationTime:(i)=>de(vr(i)),customizationType:S,endTime:(i)=>de(vr(i)),failureMessage:S,hyperParameters:F,jobArn:S,jobName:S,lastModifiedTime:(i)=>de(vr(i)),outputDataConfig:F,outputModelArn:S,outputModelKmsKeyArn:S,outputModelName:S,roleArn:S,status:S,trainingDataConfig:F,trainingMetrics:(i)=>Kc(i,r),validationDataConfig:F,validationMetrics:(i)=>Xc(i,r),vpcConfig:F});return Object.assign(s,t),s};var Ko=async(e,r)=>{if(e.statusCode!==200&&e.statusCode>=300)return $n(e,r);const s=A({$metadata:H(e)}),n=de(Qe(await x(e.body,r)),"body"),t=R(n,{modelSummaries:F});return Object.assign(s,t),s};var $n=async(e,r)=>{const s={...e,body:await es(e.body,r)},n=rs(e,s.body);switch(n){case"AccessDeniedException":case"com.amazonaws.bedrock#AccessDeniedException":throw await bc(s,r);case"ConflictException":case"com.amazonaws.bedrock#ConflictException":throw await Gc(s,r);case"InternalServerException":case"com.amazonaws.bedrock#InternalServerException":throw await zc(s,r);case"ResourceNotFoundException":case"com.amazonaws.bedrock#ResourceNotFoundException":throw await Hc(s,r);case"ThrottlingException":case"com.amazonaws.bedrock#ThrottlingException":throw await Vc(s,r);case"ValidationException":case"com.amazonaws.bedrock#ValidationException":throw await Wc(s,r);case"ServiceQuotaExceededException":case"com.amazonaws.bedrock#ServiceQuotaExceededException":throw await qc(s,r);case"TooManyTagsException":case"com.amazonaws.bedrock#TooManyTagsException":throw await Yc(s,r);default:const t=s.body;return Bc({output:e,parsedBody:t,errorCode:n})}},Bc=Br(L),bc=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new ms({$metadata:H(e),...s});return I(i,e.body)},Gc=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new hs({$metadata:H(e),...s});return I(i,e.body)},zc=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new gs({$metadata:H(e),...s});return I(i,e.body)},Hc=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new ys({$metadata:H(e),...s});return I(i,e.body)},qc=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new Ss({$metadata:H(e),...s});return I(i,e.body)},Vc=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new ws({$metadata:H(e),...s});return I(i,e.body)},Yc=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S,resourceName:S});Object.assign(s,t);const i=new ps({$metadata:H(e),...s});return I(i,e.body)},Wc=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new Es({$metadata:H(e),...s});return I(i,e.body)};var Kc=(e,r)=>{return R(e,{trainingLoss:fn})},Xc=(e,r)=>{return(e||[]).filter((n)=>n!=null).map((n)=>{return Qc(n,r)})},Qc=(e,r)=>{return R(e,{validationLoss:fn})},H=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var Bo="byCustomizationType",bo="byInferenceType";var Go="byOutputModality",zo="byProvider";class Un extends G.classBuilder().ep({...De}).m(function(e,r,s,n){return[V(s,this.serialize,this.deserialize),Y(s,e.getEndpointParameterInstructions())]}).s("AmazonBedrockControlPlaneService","CreateModelCustomizationJob",{}).n("BedrockClient","CreateModelCustomizationJobCommand").f(void 0,void 0).ser(Ho).de(Yo).build(){}class Dn extends G.classBuilder().ep({...De}).m(function(e,r,s,n){return[V(s,this.serialize,this.deserialize),Y(s,e.getEndpointParameterInstructions())]}).s("AmazonBedrockControlPlaneService","GetModelCustomizationJob",{}).n("BedrockClient","GetModelCustomizationJobCommand").f(void 0,void 0).ser(qo).de(Wo).build(){}class xn extends G.classBuilder().ep({...De}).m(function(e,r,s,n){return[V(s,this.serialize,this.deserialize),Y(s,e.getEndpointParameterInstructions())]}).s("AmazonBedrockControlPlaneService","ListFoundationModels",{}).n("BedrockClient","ListFoundationModelsCommand").f(void 0,void 0).ser(Vo).de(Ko).build(){}async function UT(e){re.debug(e);const r=new Un(e),s=await Ln.send(r);return re.debug("Successfully create model customization job"),re.debug(s),s}async function DT(e){re.debug(e);const r=new Dn(e),s=await Ln.send(r);return re.debug("Successfully get model customization job"),re.debug(s),s}async function xT(e){re.debug(e);const r=new xn(e),s=await Ln.send(r);return re.debug("Successfully list foundation models"),re.debug(s),s}var Ln=new Cn({region:process.env.REGION||"us-east-1"}),re=console;var Xo=(e)=>({...e,eventStreamMarshaller:e.eventStreamSerdeProvider(e)});function Jc(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:e.region},propertiesExtractor:(r,s)=>({signingProperties:{config:r,context:s}})}}var Qo=async(e,r,s)=>{return{operation:q(r).operation,region:await C(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Jo=(e)=>{const r=[];switch(e.operation){default:r.push(Jc(e))}return r},Zo=(e)=>{return{...jr(e)}};var _o=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"bedrock"}},As={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var jo={name:"@aws-sdk/client-bedrock-runtime",description:"AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",version:"3.637.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-bedrock-runtime","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo bedrock-runtime"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.637.0","@aws-sdk/client-sts":"3.637.0","@aws-sdk/core":"3.635.0","@aws-sdk/credential-provider-node":"3.637.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.637.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.637.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.4.0","@smithy/eventstream-serde-browser":"^3.0.6","@smithy/eventstream-serde-config-resolver":"^3.0.3","@smithy/eventstream-serde-node":"^3.0.5","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.15","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.2.0","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.15","@smithy/util-defaults-mode-node":"^3.0.15","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-stream":"^3.1.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-bedrock-runtime",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-bedrock-runtime"}};var _c=function(){function e(){this.crc32=new Re}return e.prototype.update=function(r){if(le(r))return;this.crc32.update(z(r))},e.prototype.digest=function(){return ss(this,void 0,void 0,function(){return ns(this,function(r){return[2,Pn(this.crc32.digest())]})})},e.prototype.reset=function(){this.crc32=new Re},e}();var Re=function(){function e(){this.checksum=4294967295}return e.prototype.update=function(r){var s,n;try{for(var t=so(r),i=t.next();!i.done;i=t.next()){var c=i.value;this.checksum=this.checksum>>>8^ed[(this.checksum^c)&255]}}catch(o){s={error:o}}finally{try{if(i&&!i.done&&(n=t.return))n.call(t)}finally{if(s)throw s.error}}return this},e.prototype.digest=function(){return(this.checksum^4294967295)>>>0},e}();var jc=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],ed=In(jc);function ea(e){for(let r=0;r<8;r++)e[r]^=255;for(let r=7;r>-1;r--)if(e[r]++,e[r]!==0)break}class Le{constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776000||e<-9223372036854776000)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);const r=new Uint8Array(8);for(let s=7,n=Math.abs(Math.round(e));s>-1&&n>0;s--,n/=256)r[s]=n;if(e<0)ea(r);return new Le(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;if(r)ea(e);return parseInt(k(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}class un{constructor(e,r){this.toUtf8=e,this.fromUtf8=r}format(e){const r=[];for(let t of Object.keys(e)){const i=this.fromUtf8(t);r.push(Uint8Array.from([i.byteLength]),i,this.formatHeaderValue(e[t]))}const s=new Uint8Array(r.reduce((t,i)=>t+i.byteLength,0));let n=0;for(let t of r)s.set(t,n),n+=t.byteLength;return s}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":const r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":const s=new DataView(new ArrayBuffer(5));return s.setUint8(0,4),s.setInt32(1,e.value,!1),new Uint8Array(s.buffer);case"long":const n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case"binary":const t=new DataView(new ArrayBuffer(3+e.value.byteLength));t.setUint8(0,6),t.setUint16(1,e.value.byteLength,!1);const i=new Uint8Array(t.buffer);return i.set(e.value,3),i;case"string":const c=this.fromUtf8(e.value),o=new DataView(new ArrayBuffer(3+c.byteLength));o.setUint8(0,7),o.setUint16(1,c.byteLength,!1);const a=new Uint8Array(o.buffer);return a.set(c,3),a;case"timestamp":const f=new Uint8Array(9);return f[0]=8,f.set(Le.fromNumber(e.value.valueOf()).bytes,1),f;case"uuid":if(!cd.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(Lr(e.value.replace(/\-/g,"")),1),h}}parse(e){const r={};let s=0;while(s<e.byteLength){const n=e.getUint8(s++),t=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+s,n));switch(s+=n,e.getUint8(s++)){case 0:r[t]={type:sa,value:!0};break;case 1:r[t]={type:sa,value:!1};break;case 2:r[t]={type:rd,value:e.getInt8(s++)};break;case 3:r[t]={type:sd,value:e.getInt16(s,!1)},s+=2;break;case 4:r[t]={type:nd,value:e.getInt32(s,!1)},s+=4;break;case 5:r[t]={type:td,value:new Le(new Uint8Array(e.buffer,e.byteOffset+s,8))},s+=8;break;case 6:const i=e.getUint16(s,!1);s+=2,r[t]={type:id,value:new Uint8Array(e.buffer,e.byteOffset+s,i)},s+=i;break;case 7:const c=e.getUint16(s,!1);s+=2,r[t]={type:od,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+s,c))},s+=c;break;case 8:r[t]={type:ad,value:new Date(new Le(new Uint8Array(e.buffer,e.byteOffset+s,8)).valueOf())},s+=8;break;case 9:const o=new Uint8Array(e.buffer,e.byteOffset+s,16);s+=16,r[t]={type:fd,value:`${k(o.subarray(0,4))}-${k(o.subarray(4,6))}-${k(o.subarray(6,8))}-${k(o.subarray(8,10))}-${k(o.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return r}}var ra;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(ra||(ra={}));var sa="boolean",rd="byte",sd="short",nd="integer",td="long",id="binary",od="string",ad="timestamp",fd="uuid",cd=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function ta({byteLength:e,byteOffset:r,buffer:s}){if(e<dd)throw new Error("Provided message too short to accommodate event stream message overhead");const n=new DataView(s,r,e),t=n.getUint32(0,!1);if(e!==t)throw new Error("Reported message length does not match received message length");const i=n.getUint32(na,!1),c=n.getUint32(me,!1),o=n.getUint32(e-Me,!1),a=new Re().update(new Uint8Array(s,r,me));if(c!==a.digest())throw new Error(`The prelude checksum specified in the message (${c}) does not match the calculated CRC32 checksum (${a.digest()})`);if(a.update(new Uint8Array(s,r+me,e-(me+Me))),o!==a.digest())throw new Error(`The message checksum (${a.digest()}) did not match the expected value of ${o}`);return{headers:new DataView(s,r+me+Me,i),body:new Uint8Array(s,r+me+Me+i,t-i-(me+Me+Me))}}var na=4,me=na*2,Me=4,dd=me+Me*2;class vn{constructor(e,r){this.headerMarshaller=new un(e,r),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){const e=this.messageBuffer.pop(),r=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return r}}}getAvailableMessages(){const e=this.messageBuffer;this.messageBuffer=[];const r=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return r}}}encode({headers:e,body:r}){const s=this.headerMarshaller.format(e),n=s.byteLength+r.byteLength+16,t=new Uint8Array(n),i=new DataView(t.buffer,t.byteOffset,t.byteLength),c=new Re;return i.setUint32(0,n,!1),i.setUint32(4,s.byteLength,!1),i.setUint32(8,c.update(t.subarray(0,8)).digest(),!1),t.set(s,12),t.set(r,s.byteLength+12),i.setUint32(n-4,c.update(t.subarray(8,n-4)).digest(),!1),t}decode(e){const{headers:r,body:s}=ta(e);return{headers:this.headerMarshaller.parse(r),body:s}}formatHeaders(e){return this.headerMarshaller.format(e)}}class Bn{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.decoder.decode(e)}}class bn{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream)yield this.options.encoder.encode(e);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class Gn{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream){const r=await this.options.deserializer(e);if(r===void 0)continue;yield r}}}class zn{constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.serializer(e)}}function ia(e){let r=0,s=0,n=null,t=null;const i=(o)=>{if(typeof o!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+o);r=o,s=4,n=new Uint8Array(o),new DataView(n.buffer).setUint32(0,o,!1)},c=async function*(){const o=e[Symbol.asyncIterator]();while(!0){const{value:a,done:f}=await o.next();if(f){if(!r)return;else if(r===s)yield n;else throw new Error("Truncated event message received.");return}const h=a.length;let l=0;while(l<h){if(!n){const m=h-l;if(!t)t=new Uint8Array(4);const g=Math.min(4-s,m);if(t.set(a.slice(l,l+g),s),s+=g,l+=g,s<4)break;i(new DataView(t.buffer).getUint32(0,!1)),t=null}const d=Math.min(r-s,h-l);if(n.set(a.slice(l,l+d),s),s+=d,l+=d,r&&r===s)yield n,n=null,r=0,s=0}}};return{[Symbol.asyncIterator]:c}}function oa(e,r){return async function(s){const{value:n}=s.headers[":message-type"];if(n==="error"){const t=new Error(s.headers[":error-message"].value||"UnknownError");throw t.name=s.headers[":error-code"].value,t}else if(n==="exception"){const t=s.headers[":exception-type"].value,i={[t]:s},c=await e(i);if(c.$unknown){const o=new Error(r(s.body));throw o.name=t,o}throw c[t]}else if(n==="event"){const t={[s.headers[":event-type"].value]:s},i=await e(t);if(i.$unknown)return;return i}else throw Error(`Unrecognizable event type: ${s.headers[":event-type"].value}`)}}class Rs{constructor({utf8Encoder:e,utf8Decoder:r}){this.eventStreamCodec=new vn(e,r),this.utfEncoder=e}deserialize(e,r){const s=ia(e);return new Gn({messageStream:new Bn({inputStream:s,decoder:this.eventStreamCodec}),deserializer:oa(r,this.utfEncoder)})}serialize(e,r){return new bn({messageStream:new zn({inputStream:e,serializer:r}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}var aa=(e)=>({[Symbol.asyncIterator]:async function*(){const r=e.getReader();try{while(!0){const{done:s,value:n}=await r.read();if(s)return;yield n}}finally{r.releaseLock()}}}),fa=(e)=>{const r=e[Symbol.asyncIterator]();return new ReadableStream({async pull(s){const{done:n,value:t}=await r.next();if(n)return s.close();s.enqueue(t)}})};class Hn{constructor({utf8Encoder:e,utf8Decoder:r}){this.universalMarshaller=new Rs({utf8Decoder:r,utf8Encoder:e})}deserialize(e,r){const s=ld(e)?aa(e):e;return this.universalMarshaller.deserialize(s,r)}serialize(e,r){const s=this.universalMarshaller.serialize(e,r);return typeof ReadableStream==="function"?fa(s):s}}var ld=(e)=>typeof ReadableStream==="function"&&e instanceof ReadableStream;var ca=(e)=>new Hn(e);var da={["required"]:!1,type:"String"},la={["required"]:!0,default:!1,type:"Boolean"},ma={["ref"]:"Endpoint"},Sa={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},pa={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},X={},ha={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},ga={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsDualStack"]}]},ya=[Sa],wa=[pa],Ea=[{["ref"]:"Region"}],md={version:"1.0",parameters:{Region:da,UseDualStack:la,UseFIPS:la,Endpoint:da},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[ma]}],rules:[{conditions:ya,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{rules:[{conditions:wa,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:ma,properties:X,headers:X},type:"endpoint"}],type:"tree"}],type:"tree"},{rules:[{conditions:[{["fn"]:"isSet",["argv"]:Ea}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:Ea,assign:"PartitionResult"}],rules:[{conditions:[Sa,pa],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,ha]},ga],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:X,headers:X},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:ya,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[ha,!0]}],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",properties:X,headers:X},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:wa,rules:[{conditions:[ga],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:X,headers:X},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}",properties:X,headers:X},type:"endpoint"}],type:"tree"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}],type:"tree"}]},Aa=md;var Ra=(e,r={})=>{return be(Aa,{endpointParams:e,logger:r.logger})};Z.aws=Ge;var Ma=(e)=>{return{apiVersion:"2023-09-30",base64Decoder:e?.base64Decoder??fe,base64Encoder:e?.base64Encoder??pe,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Ra,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Jo,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(r)=>r.getIdentityProvider("aws.auth#sigv4"),signer:new Ue}],logger:e?.logger??new ge,serviceId:e?.serviceId??"Bedrock Runtime",urlParser:e?.urlParser??ie,utf8Decoder:e?.utf8Decoder??D,utf8Encoder:e?.utf8Encoder??Se}};var Pa=(e)=>{const r=fs(e),s=()=>r().then(br),n=Ma(e);return{...n,...e,runtime:"browser",defaultsMode:r,bodyLengthChecker:e?.bodyLengthChecker??as,credentialDefaultProvider:e?.credentialDefaultProvider??((t)=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:e?.defaultUserAgentProvider??is({serviceId:n.serviceId,clientVersion:jo.version}),eventStreamSerdeProvider:e?.eventStreamSerdeProvider??ca,maxAttempts:e?.maxAttempts??W,region:e?.region??os("Region is missing"),requestHandler:Ce.create(e?.requestHandler??s),retryMode:e?.retryMode??(async()=>(await s()).retryMode||He),sha256:e?.sha256??ts,streamCollector:e?.streamCollector??We,useDualstackEndpoint:e?.useDualstackEndpoint??(()=>Promise.resolve(Rr)),useFipsEndpoint:e?.useFipsEndpoint??(()=>Promise.resolve(Mr))}};var Ia=(e)=>{const r=e.httpAuthSchemes;let{httpAuthSchemeProvider:s,credentials:n}=e;return{setHttpAuthScheme(t){const i=r.findIndex((c)=>c.schemeId===t.schemeId);if(i===-1)r.push(t);else r.splice(i,1,t)},httpAuthSchemes(){return r},setHttpAuthSchemeProvider(t){s=t},httpAuthSchemeProvider(){return s},setCredentials(t){n=t},credentials(){return n}}},Ta=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var Ms=(e)=>e,Na=(e,r)=>{const s={...Ms(cs(e)),...Ms(Gr(e)),...Ms(ir(e)),...Ms(Ia(e))};return r.forEach((n)=>n.configure(s)),{...e,...ds(s),...zr(s),...or(s),...Ta(s)}};class qn extends Ye{constructor(...[e]){const r=Pa(e||{}),s=_o(r),n=lr(s),t=xr(n),i=Ir(t),c=ar(i),o=Nr(c),a=Xo(o),f=Zo(a),h=Na(f,e?.extensions||[]);super(h);this.config=h,this.middlewareStack.use(pr(this.config)),this.middlewareStack.use(Hr(this.config)),this.middlewareStack.use(Vr(this.config)),this.middlewareStack.use(fr(this.config)),this.middlewareStack.use(cr(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(kr(this.config,{httpAuthSchemeParametersProvider:Qo,identityProviderConfigProvider:async(l)=>new Ze({"aws.auth#sigv4":l.credentials})})),this.middlewareStack.use(qr(this.config))}destroy(){super.destroy()}}class $ extends $e{constructor(e){super(e);Object.setPrototypeOf(this,$.prototype)}}class Ps extends ${constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,Ps.prototype)}}var ka;(function(e){e.visit=(r,s)=>{if(r.text!==void 0)return s.text(r.text);return s._(r.$unknown[0],r.$unknown[1])}})(ka||(ka={}));class Is extends ${constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,Is.prototype)}}class Ts extends ${constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Ts.prototype)}}class Ns extends ${constructor(e){super({name:"ServiceQuotaExceededException",$fault:"client",...e});this.name="ServiceQuotaExceededException",this.$fault="client",Object.setPrototypeOf(this,Ns.prototype)}}class ks extends ${constructor(e){super({name:"ThrottlingException",$fault:"client",...e});this.name="ThrottlingException",this.$fault="client",Object.setPrototypeOf(this,ks.prototype)}}class Os extends ${constructor(e){super({name:"ValidationException",$fault:"client",...e});this.name="ValidationException",this.$fault="client",Object.setPrototypeOf(this,Os.prototype)}}var Vn;(function(e){e.visit=(r,s)=>{if(r.bytes!==void 0)return s.bytes(r.bytes);return s._(r.$unknown[0],r.$unknown[1])}})(Vn||(Vn={}));var Oa;(function(e){e.visit=(r,s)=>{if(r.text!==void 0)return s.text(r.text);return s._(r.$unknown[0],r.$unknown[1])}})(Oa||(Oa={}));var Yn;(function(e){e.visit=(r,s)=>{if(r.bytes!==void 0)return s.bytes(r.bytes);return s._(r.$unknown[0],r.$unknown[1])}})(Yn||(Yn={}));var Wn;(function(e){e.visit=(r,s)=>{if(r.json!==void 0)return s.json(r.json);if(r.text!==void 0)return s.text(r.text);if(r.image!==void 0)return s.image(r.image);if(r.document!==void 0)return s.document(r.document);return s._(r.$unknown[0],r.$unknown[1])}})(Wn||(Wn={}));var Kn;(function(e){e.visit=(r,s)=>{if(r.text!==void 0)return s.text(r.text);if(r.image!==void 0)return s.image(r.image);if(r.document!==void 0)return s.document(r.document);if(r.toolUse!==void 0)return s.toolUse(r.toolUse);if(r.toolResult!==void 0)return s.toolResult(r.toolResult);if(r.guardContent!==void 0)return s.guardContent(r.guardContent);return s._(r.$unknown[0],r.$unknown[1])}})(Kn||(Kn={}));var Fa;(function(e){e.visit=(r,s)=>{if(r.text!==void 0)return s.text(r.text);if(r.guardContent!==void 0)return s.guardContent(r.guardContent);return s._(r.$unknown[0],r.$unknown[1])}})(Fa||(Fa={}));var Ca;(function(e){e.visit=(r,s)=>{if(r.auto!==void 0)return s.auto(r.auto);if(r.any!==void 0)return s.any(r.any);if(r.tool!==void 0)return s.tool(r.tool);return s._(r.$unknown[0],r.$unknown[1])}})(Ca||(Ca={}));var Xn;(function(e){e.visit=(r,s)=>{if(r.json!==void 0)return s.json(r.json);return s._(r.$unknown[0],r.$unknown[1])}})(Xn||(Xn={}));var Qn;(function(e){e.visit=(r,s)=>{if(r.toolSpec!==void 0)return s.toolSpec(r.toolSpec);return s._(r.$unknown[0],r.$unknown[1])}})(Qn||(Qn={}));var $a;(function(e){e.visit=(r,s)=>{if(r.message!==void 0)return s.message(r.message);return s._(r.$unknown[0],r.$unknown[1])}})($a||($a={}));class Fs extends ${constructor(e){super({name:"ModelErrorException",$fault:"client",...e});this.name="ModelErrorException",this.$fault="client",Object.setPrototypeOf(this,Fs.prototype),this.originalStatusCode=e.originalStatusCode,this.resourceName=e.resourceName}}class Cs extends ${constructor(e){super({name:"ModelNotReadyException",$fault:"client",...e});this.name="ModelNotReadyException",this.$fault="client",Object.setPrototypeOf(this,Cs.prototype)}}class $s extends ${constructor(e){super({name:"ModelTimeoutException",$fault:"client",...e});this.name="ModelTimeoutException",this.$fault="client",Object.setPrototypeOf(this,$s.prototype)}}class Us extends ${constructor(e){super({name:"ServiceUnavailableException",$fault:"server",...e});this.name="ServiceUnavailableException",this.$fault="server",Object.setPrototypeOf(this,Us.prototype)}}var Ua;(function(e){e.visit=(r,s)=>{if(r.text!==void 0)return s.text(r.text);if(r.toolUse!==void 0)return s.toolUse(r.toolUse);return s._(r.$unknown[0],r.$unknown[1])}})(Ua||(Ua={}));var Da;(function(e){e.visit=(r,s)=>{if(r.toolUse!==void 0)return s.toolUse(r.toolUse);return s._(r.$unknown[0],r.$unknown[1])}})(Da||(Da={}));class Ds extends ${constructor(e){super({name:"ModelStreamErrorException",$fault:"client",...e});this.name="ModelStreamErrorException",this.$fault="client",Object.setPrototypeOf(this,Ds.prototype),this.originalStatusCode=e.originalStatusCode,this.originalMessage=e.originalMessage}}var xa;(function(e){e.visit=(r,s)=>{if(r.messageStart!==void 0)return s.messageStart(r.messageStart);if(r.contentBlockStart!==void 0)return s.contentBlockStart(r.contentBlockStart);if(r.contentBlockDelta!==void 0)return s.contentBlockDelta(r.contentBlockDelta);if(r.contentBlockStop!==void 0)return s.contentBlockStop(r.contentBlockStop);if(r.messageStop!==void 0)return s.messageStop(r.messageStop);if(r.metadata!==void 0)return s.metadata(r.metadata);if(r.internalServerException!==void 0)return s.internalServerException(r.internalServerException);if(r.modelStreamErrorException!==void 0)return s.modelStreamErrorException(r.modelStreamErrorException);if(r.validationException!==void 0)return s.validationException(r.validationException);if(r.throttlingException!==void 0)return s.throttlingException(r.throttlingException);if(r.serviceUnavailableException!==void 0)return s.serviceUnavailableException(r.serviceUnavailableException);return s._(r.$unknown[0],r.$unknown[1])}})(xa||(xa={}));var La;(function(e){e.visit=(r,s)=>{if(r.chunk!==void 0)return s.chunk(r.chunk);if(r.internalServerException!==void 0)return s.internalServerException(r.internalServerException);if(r.modelStreamErrorException!==void 0)return s.modelStreamErrorException(r.modelStreamErrorException);if(r.validationException!==void 0)return s.validationException(r.validationException);if(r.throttlingException!==void 0)return s.throttlingException(r.throttlingException);if(r.modelTimeoutException!==void 0)return s.modelTimeoutException(r.modelTimeoutException);if(r.serviceUnavailableException!==void 0)return s.serviceUnavailableException(r.serviceUnavailableException);return s._(r.$unknown[0],r.$unknown[1])}})(La||(La={}));var ua=(e)=>({...e,...e.body&&{body:Xe}}),va=(e)=>({...e,...e.body&&{body:Xe}}),Ba=(e)=>({...e,...e.body&&{body:Xe}});var ba=(e)=>({...e,...e.body&&{body:"STREAMING_CONTENT"}});var Ga=async(e,r)=>{const s=Ae(e,r),n=A({},Za,{[Zn]:e[xs]||"application/octet-stream",[Jn]:e[Jn],[nf]:e[ef],[rf]:e[_a],[sf]:e[ja]});s.bp("/model/{modelId}/invoke"),s.p("modelId",()=>e.modelId,"{modelId}",!1);let t;if(e.body!==void 0)t=e.body;return s.m("POST").h(n).b(t),s.build()},za=async(e,r)=>{const s=Ae(e,r),n=A({},Za,{[Zn]:e[xs]||"application/octet-stream",[Od]:e[Jn],[nf]:e[ef],[rf]:e[_a],[sf]:e[ja]});s.bp("/model/{modelId}/invoke-with-response-stream"),s.p("modelId",()=>e.modelId,"{modelId}",!1);let t;if(e.body!==void 0)t=e.body;return s.m("POST").h(n).b(t),s.build()};var Ha=async(e,r)=>{if(e.statusCode!==200&&e.statusCode>=300)return Va(e,r);const s=A({$metadata:u(e),[xs]:[,e.headers[Zn]]}),n=await Ke(e.body,r);return s.body=n,s},qa=async(e,r)=>{if(e.statusCode!==200&&e.statusCode>=300)return Va(e,r);const s=A({$metadata:u(e),[xs]:[,e.headers[Fd]]}),n=e.body;return s.body=pd(n,r),s},Va=async(e,r)=>{const s={...e,body:await es(e.body,r)},n=rs(e,s.body);switch(n){case"AccessDeniedException":case"com.amazonaws.bedrockruntime#AccessDeniedException":throw await gd(s,r);case"InternalServerException":case"com.amazonaws.bedrockruntime#InternalServerException":throw await Ya(s,r);case"ResourceNotFoundException":case"com.amazonaws.bedrockruntime#ResourceNotFoundException":throw await Ed(s,r);case"ServiceQuotaExceededException":case"com.amazonaws.bedrockruntime#ServiceQuotaExceededException":throw await Sd(s,r);case"ThrottlingException":case"com.amazonaws.bedrockruntime#ThrottlingException":throw await Qa(s,r);case"ValidationException":case"com.amazonaws.bedrockruntime#ValidationException":throw await Ja(s,r);case"ModelErrorException":case"com.amazonaws.bedrockruntime#ModelErrorException":throw await yd(s,r);case"ModelNotReadyException":case"com.amazonaws.bedrockruntime#ModelNotReadyException":throw await wd(s,r);case"ModelTimeoutException":case"com.amazonaws.bedrockruntime#ModelTimeoutException":throw await Ka(s,r);case"ServiceUnavailableException":case"com.amazonaws.bedrockruntime#ServiceUnavailableException":throw await Xa(s,r);case"ModelStreamErrorException":case"com.amazonaws.bedrockruntime#ModelStreamErrorException":throw await Wa(s,r);default:const t=s.body;return hd({output:e,parsedBody:t,errorCode:n})}},hd=Br($),gd=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new Ps({$metadata:u(e),...s});return I(i,e.body)},Ya=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new Is({$metadata:u(e),...s});return I(i,e.body)},yd=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S,originalStatusCode:ur,resourceName:S});Object.assign(s,t);const i=new Fs({$metadata:u(e),...s});return I(i,e.body)},wd=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new Cs({$metadata:u(e),...s});return I(i,e.body)},Wa=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S,originalMessage:S,originalStatusCode:ur});Object.assign(s,t);const i=new Ds({$metadata:u(e),...s});return I(i,e.body)},Ka=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new $s({$metadata:u(e),...s});return I(i,e.body)},Ed=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new Ts({$metadata:u(e),...s});return I(i,e.body)},Sd=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new Ns({$metadata:u(e),...s});return I(i,e.body)},Xa=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new Us({$metadata:u(e),...s});return I(i,e.body)},Qa=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new ks({$metadata:u(e),...s});return I(i,e.body)},Ja=async(e,r)=>{const s=A({}),n=e.body,t=R(n,{message:S});Object.assign(s,t);const i=new Os({$metadata:u(e),...s});return I(i,e.body)};var pd=(e,r)=>{return r.eventStreamMarshaller.deserialize(e,async(s)=>{if(s.chunk!=null)return{chunk:await Pd(s.chunk,r)};if(s.internalServerException!=null)return{internalServerException:await Ad(s.internalServerException,r)};if(s.modelStreamErrorException!=null)return{modelStreamErrorException:await Rd(s.modelStreamErrorException,r)};if(s.validationException!=null)return{validationException:await Nd(s.validationException,r)};if(s.throttlingException!=null)return{throttlingException:await Td(s.throttlingException,r)};if(s.modelTimeoutException!=null)return{modelTimeoutException:await Md(s.modelTimeoutException,r)};if(s.serviceUnavailableException!=null)return{serviceUnavailableException:await Id(s.serviceUnavailableException,r)};return{$unknown:e}})};var Ad=async(e,r)=>{const s={...e,body:await x(e.body,r)};return Ya(s,r)};var Rd=async(e,r)=>{const s={...e,body:await x(e.body,r)};return Wa(s,r)},Md=async(e,r)=>{const s={...e,body:await x(e.body,r)};return Ka(s,r)},Pd=async(e,r)=>{const s={},n=await x(e.body,r);return Object.assign(s,kd(n,r)),s},Id=async(e,r)=>{const s={...e,body:await x(e.body,r)};return Xa(s,r)},Td=async(e,r)=>{const s={...e,body:await x(e.body,r)};return Qa(s,r)},Nd=async(e,r)=>{const s={...e,body:await x(e.body,r)};return Ja(s,r)};var kd=(e,r)=>{return R(e,{bytes:r.base64Decoder})};var u=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var Za=(e)=>e!==void 0&&e!==null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),Jn="accept",xs="contentType",Zn="content-type",_a="guardrailIdentifier",ja="guardrailVersion",ef="trace",Od="x-amzn-bedrock-accept",Fd="x-amzn-bedrock-content-type",rf="x-amzn-bedrock-guardrailidentifier",sf="x-amzn-bedrock-guardrailversion",nf="x-amzn-bedrock-trace";class _n extends G.classBuilder().ep({...As}).m(function(e,r,s,n){return[V(s,this.serialize,this.deserialize),Y(s,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModel",{}).n("BedrockRuntimeClient","InvokeModelCommand").f(ua,va).ser(Ga).de(Ha).build(){}class jn extends G.classBuilder().ep({...As}).m(function(e,r,s,n){return[V(s,this.serialize,this.deserialize),Y(s,e.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModelWithResponseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","InvokeModelWithResponseStreamCommand").f(Ba,ba).ser(za).de(qa).build(){}async function ck(e){ue.debug(e);const r=new _n(e),s=await tf.send(r);return ue.debug("Successfully invoke model"),ue.debug(s),s}async function dk(e){ue.debug(e);const r=new jn(e),s=await tf.send(r);return ue.debug("Successfully invoke model with response stream"),ue.debug(s),s}var tf=new qn({region:process.env.REGION||"us-east-1"}),ue=console;export{xT as listFoundationModels,dk as invokeModelWithResponseStream,ck as invokeModel,DT as getModelCustomizationJob,UT as createModelCustomizationJob};
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
var Fg=Object.create;var{getPrototypeOf:Eg,defineProperty:i7,getOwnPropertyNames:wg}=Object;var $g=Object.prototype.hasOwnProperty;var L=(D,F,E)=>{E=D!=null?Fg(Eg(D)):{};const w=F||!D||!D.__esModule?i7(E,"default",{value:D,enumerable:!0}):E;for(let $ of wg(D))if(!$g.call(w,$))i7(w,$,{get:()=>D[$],enumerable:!0});return w};var W=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var _0=(D,F)=>{for(var E in F)i7(D,E,{get:F[E],enumerable:!0,configurable:!0,set:(w)=>F[E]=()=>w})};var G=(D,F)=>()=>(D&&(F=D(D=0)),F);var j2=(D)=>{let F=D.httpHandler;return{setHttpHandler(E){F=E},httpHandler(){return F},updateHttpClientConfig(E,w){F.updateHttpClientConfig(E,w)},httpHandlerConfigs(){return F.httpHandlerConfigs()}}},P2=(D)=>{return{httpHandler:D.httpHandler()}};var EA=()=>{};var J0=W((d4D,IA)=>{var{defineProperty:jE,getOwnPropertyDescriptor:fg,getOwnPropertyNames:Cg}=Object,Bg=Object.prototype.hasOwnProperty,PE=(D,F)=>jE(D,"name",{value:F,configurable:!0}),hg=(D,F)=>{for(var E in F)jE(D,E,{get:F[E],enumerable:!0})},Ug=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Cg(F))if(!Bg.call(D,$)&&$!==E)jE(D,$,{get:()=>F[$],enumerable:!(w=fg(F,$))||w.enumerable})}return D},Ag=(D)=>Ug(jE({},"__esModule",{value:!0}),D),wA={};hg(wA,{AlgorithmId:()=>BA,EndpointURLScheme:()=>CA,FieldPosition:()=>hA,HttpApiKeyAuthLocation:()=>fA,HttpAuthLocation:()=>$A,IniSectionType:()=>UA,RequestHandlerProtocol:()=>AA,SMITHY_CONTEXT_KEY:()=>Zg,getDefaultClientConfiguration:()=>Gg,resolveDefaultRuntimeConfig:()=>Yg});IA.exports=Ag(wA);var $A=((D)=>{return D.HEADER="header",D.QUERY="query",D})($A||{}),fA=((D)=>{return D.HEADER="header",D.QUERY="query",D})(fA||{}),CA=((D)=>{return D.HTTP="http",D.HTTPS="https",D})(CA||{}),BA=((D)=>{return D.MD5="md5",D.CRC32="crc32",D.CRC32C="crc32c",D.SHA1="sha1",D.SHA256="sha256",D})(BA||{}),Ig=PE((D)=>{const F=[];if(D.sha256!==void 0)F.push({algorithmId:()=>"sha256",checksumConstructor:()=>D.sha256});if(D.md5!=null)F.push({algorithmId:()=>"md5",checksumConstructor:()=>D.md5});return{_checksumAlgorithms:F,addChecksumAlgorithm(E){this._checksumAlgorithms.push(E)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),Mg=PE((D)=>{const F={};return D.checksumAlgorithms().forEach((E)=>{F[E.algorithmId()]=E.checksumConstructor()}),F},"resolveChecksumRuntimeConfig"),Gg=PE((D)=>{return{...Ig(D)}},"getDefaultClientConfiguration"),Yg=PE((D)=>{return{...Mg(D)}},"resolveDefaultRuntimeConfig"),hA=((D)=>{return D[D.HEADER=0]="HEADER",D[D.TRAILER=1]="TRAILER",D})(hA||{}),Zg="__smithy_context",UA=((D)=>{return D.PROFILE="profile",D.SSO_SESSION="sso-session",D.SERVICES="services",D})(UA||{}),AA=((D)=>{return D.HTTP_0_9="http/0.9",D.HTTP_1_0="http/1.0",D.TDS_8_0="tds/8.0",D})(AA||{})});var Wg;var MA=G(()=>{Wg=L(J0(),1)});var GA=()=>{};function Xg(D){return Object.keys(D).reduce((F,E)=>{const w=D[E];return{...F,[E]:Array.isArray(w)?[...w]:w}},{})}class rD{constructor(D){this.method=D.method||"GET",this.hostname=D.hostname||"localhost",this.port=D.port,this.query=D.query||{},this.headers=D.headers||{},this.body=D.body,this.protocol=D.protocol?D.protocol.slice(-1)!==":"?`${D.protocol}:`:D.protocol:"https:",this.path=D.path?D.path.charAt(0)!=="/"?`/${D.path}`:D.path:"/",this.username=D.username,this.password=D.password,this.fragment=D.fragment}static clone(D){const F=new rD({...D,headers:{...D.headers}});if(F.query)F.query=Xg(F.query);return F}static isInstance(D){if(!D)return!1;const F=D;return"method"in F&&"protocol"in F&&"hostname"in F&&"path"in F&&typeof F.query==="object"&&typeof F.headers==="object"}clone(){return rD.clone(this)}}class E8{constructor(D){this.statusCode=D.statusCode,this.reason=D.reason,this.headers=D.headers||{},this.body=D.body}static isInstance(D){if(!D)return!1;const F=D;return typeof F.statusCode==="number"&&typeof F.headers==="object"}}var YA=()=>{};var vD=G(()=>{EA();MA();GA();YA()});function y2(D){return D}var Jg=(D)=>(F)=>async(E)=>{if(!rD.isInstance(E.request))return F(E);const{request:w}=E,{handlerProtocol:$=""}=D.requestHandler.metadata||{};if($.indexOf("h2")>=0&&!w.headers[":authority"])delete w.headers.host,w.headers[":authority"]=w.hostname+(w.port?":"+w.port:"");else if(!w.headers.host){let C=w.hostname;if(w.port!=null)C+=`:${w.port}`;w.headers.host=C}return F(E)},zg,k2=(D)=>({applyToStack:(F)=>{F.add(Jg(D),zg)}});var z6=G(()=>{vD();zg={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0}});var Tg=()=>(D,F)=>async(E)=>{try{const w=await D(E),{clientName:$,commandName:C,logger:f,dynamoDbDocumentClientOptions:B={}}=F,{overrideInputFilterSensitiveLog:h,overrideOutputFilterSensitiveLog:U}=B,I=h??F.inputFilterSensitiveLog,A=U??F.outputFilterSensitiveLog,{$metadata:Y,...M}=w.output;return f?.info?.({clientName:$,commandName:C,input:I(E.input),output:A(M),metadata:Y}),w}catch(w){const{clientName:$,commandName:C,logger:f,dynamoDbDocumentClientOptions:B={}}=F,{overrideInputFilterSensitiveLog:h}=B,U=h??F.inputFilterSensitiveLog;throw f?.error?.({clientName:$,commandName:C,input:U(E.input),error:w,metadata:w.$metadata}),w}},Kg,b2=(D)=>({applyToStack:(F)=>{F.add(Tg(),Kg)}});var ZA=G(()=>{Kg={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0}});var T6=G(()=>{ZA()});var WA="X-Amzn-Trace-Id",Sg="AWS_LAMBDA_FUNCTION_NAME",Qg="_X_AMZN_TRACE_ID",Hg=(D)=>(F)=>async(E)=>{const{request:w}=E;if(!rD.isInstance(w)||D.runtime!=="node"||w.headers.hasOwnProperty(WA))return F(E);const $=process.env[Sg],C=process.env[Qg],f=(B)=>typeof B==="string"&&B.length>0;if(f($)&&f(C))w.headers[WA]=C;return F({...E,request:w})},Lg,x2=(D)=>({applyToStack:(F)=>{F.add(Hg(D),Lg)}});var K6=G(()=>{vD();Lg={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"}});var xF=W((I7D,TA)=>{var{defineProperty:yE,getOwnPropertyDescriptor:Rg,getOwnPropertyNames:Vg}=Object,Ng=Object.prototype.hasOwnProperty,JA=(D,F)=>yE(D,"name",{value:F,configurable:!0}),qg=(D,F)=>{for(var E in F)yE(D,E,{get:F[E],enumerable:!0})},Og=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Vg(F))if(!Ng.call(D,$)&&$!==E)yE(D,$,{get:()=>F[$],enumerable:!(w=Rg(F,$))||w.enumerable})}return D},jg=(D)=>Og(yE({},"__esModule",{value:!0}),D),zA={};qg(zA,{getSmithyContext:()=>Pg,normalizeProvider:()=>yg});TA.exports=jg(zA);var XA=J0(),Pg=JA((D)=>D[XA.SMITHY_CONTEXT_KEY]||(D[XA.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),yg=JA((D)=>{if(typeof D==="function")return D;const F=Promise.resolve(D);return()=>F},"normalizeProvider")});var p7=W((M7D,LA)=>{var{defineProperty:kE,getOwnPropertyDescriptor:kg,getOwnPropertyNames:bg}=Object,xg=Object.prototype.hasOwnProperty,v8=(D,F)=>kE(D,"name",{value:F,configurable:!0}),cg=(D,F)=>{for(var E in F)kE(D,E,{get:F[E],enumerable:!0})},gg=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of bg(F))if(!xg.call(D,$)&&$!==E)kE(D,$,{get:()=>F[$],enumerable:!(w=kg(F,$))||w.enumerable})}return D},rg=(D)=>gg(kE({},"__esModule",{value:!0}),D),KA={};cg(KA,{CredentialsProviderError:()=>_g,ProviderError:()=>bE,TokenProviderError:()=>sg,chain:()=>ug,fromStatic:()=>dg,memoize:()=>vg});LA.exports=rg(KA);var SA=class D extends Error{constructor(F,E=!0){var w;let $,C=!0;if(typeof E==="boolean")$=void 0,C=E;else if(E!=null&&typeof E==="object")$=E.logger,C=E.tryNextLink??!0;super(F);this.name="ProviderError",this.tryNextLink=C,Object.setPrototypeOf(this,D.prototype),(w=$==null?void 0:$.debug)==null||w.call($,`@smithy/property-provider ${C?"->":"(!)"} ${F}`)}static from(F,E=!0){return Object.assign(new this(F.message,E),F)}};v8(SA,"ProviderError");var bE=SA,QA=class D extends bE{constructor(F,E=!0){super(F,E);this.name="CredentialsProviderError",Object.setPrototypeOf(this,D.prototype)}};v8(QA,"CredentialsProviderError");var _g=QA,HA=class D extends bE{constructor(F,E=!0){super(F,E);this.name="TokenProviderError",Object.setPrototypeOf(this,D.prototype)}};v8(HA,"TokenProviderError");var sg=HA,ug=v8((...D)=>async()=>{if(D.length===0)throw new bE("No providers in chain");let F;for(let E of D)try{return await E()}catch(w){if(F=w,w==null?void 0:w.tryNextLink)continue;throw w}throw F},"chain"),dg=v8((D)=>()=>Promise.resolve(D),"fromStatic"),vg=v8((D,F,E)=>{let w,$,C,f=!1;const B=v8(async()=>{if(!$)$=D();try{w=await $,C=!0,f=!1}finally{$=void 0}return w},"coalesceProvider");if(F===void 0)return async(h)=>{if(!C||(h==null?void 0:h.forceRefresh))w=await B();return w};return async(h)=>{if(!C||(h==null?void 0:h.forceRefresh))w=await B();if(f)return w;if(E&&!E(w))return f=!0,w;if(F(w))return await B(),w;return w}},"memoize")});var S6=W((RA)=>{Object.defineProperty(RA,"__esModule",{value:!0});RA.getHomeDir=void 0;var mg=import.meta.require("os"),ng=import.meta.require("path"),a7={},lg=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},ig=()=>{const{HOME:D,USERPROFILE:F,HOMEPATH:E,HOMEDRIVE:w=`C:${ng.sep}`}=process.env;if(D)return D;if(F)return F;if(E)return`${w}${E}`;const $=lg();if(!a7[$])a7[$]=mg.homedir();return a7[$]};RA.getHomeDir=ig});var o7=W((NA)=>{Object.defineProperty(NA,"__esModule",{value:!0});NA.getSSOTokenFilepath=void 0;var pg=import.meta.require("crypto"),ag=import.meta.require("path"),og=S6(),tg=(D)=>{const E=pg.createHash("sha1").update(D).digest("hex");return ag.join(og.getHomeDir(),".aws","sso","cache",`${E}.json`)};NA.getSSOTokenFilepath=tg});var PA=W((OA)=>{Object.defineProperty(OA,"__esModule",{value:!0});OA.getSSOTokenFromFile=void 0;var eg=import.meta.require("fs"),Dr=o7(),{readFile:Fr}=eg.promises,Er=async(D)=>{const F=Dr.getSSOTokenFilepath(D),E=await Fr(F,"utf8");return JSON.parse(E)};OA.getSSOTokenFromFile=Er});var e7=W((yA)=>{Object.defineProperty(yA,"__esModule",{value:!0});yA.slurpFile=void 0;var wr=import.meta.require("fs"),{readFile:$r}=wr.promises,t7={},fr=(D,F)=>{if(!t7[D]||(F===null||F===void 0?void 0:F.ignoreCache))t7[D]=$r(D,"utf8");return t7[D]};yA.slurpFile=fr});var wf=W((X7D,gF)=>{var{defineProperty:gE,getOwnPropertyDescriptor:Cr,getOwnPropertyNames:Br}=Object,hr=Object.prototype.hasOwnProperty,s0=(D,F)=>gE(D,"name",{value:F,configurable:!0}),Ur=(D,F)=>{for(var E in F)gE(D,E,{get:F[E],enumerable:!0})},Df=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Br(F))if(!hr.call(D,$)&&$!==E)gE(D,$,{get:()=>F[$],enumerable:!(w=Cr(F,$))||w.enumerable})}return D},Ef=(D,F,E)=>(Df(D,F,"default"),E&&Df(E,F,"default")),Ar=(D)=>Df(gE({},"__esModule",{value:!0}),D),cF={};Ur(cF,{CONFIG_PREFIX_SEPARATOR:()=>m8,DEFAULT_PROFILE:()=>gA,ENV_PROFILE:()=>cA,getProfileName:()=>Ir,loadSharedConfigFiles:()=>_A,loadSsoSessionData:()=>Hr,parseKnownFiles:()=>Rr});gF.exports=Ar(cF);Ef(cF,S6(),gF.exports);var cA="AWS_PROFILE",gA="default",Ir=s0((D)=>D.profile||process.env[cA]||gA,"getProfileName");Ef(cF,o7(),gF.exports);Ef(cF,PA(),gF.exports);var xE=J0(),Mr=s0((D)=>Object.entries(D).filter(([F])=>{const E=F.indexOf(m8);if(E===-1)return!1;return Object.values(xE.IniSectionType).includes(F.substring(0,E))}).reduce((F,[E,w])=>{const $=E.indexOf(m8),C=E.substring(0,$)===xE.IniSectionType.PROFILE?E.substring($+1):E;return F[C]=w,F},{...D.default&&{default:D.default}}),"getConfigData"),cE=import.meta.require("path"),Gr=S6(),Yr="AWS_CONFIG_FILE",rA=s0(()=>process.env[Yr]||cE.join(Gr.getHomeDir(),".aws","config"),"getConfigFilepath"),Zr=S6(),Wr="AWS_SHARED_CREDENTIALS_FILE",Xr=s0(()=>process.env[Wr]||cE.join(Zr.getHomeDir(),".aws","credentials"),"getCredentialsFilepath"),Jr=S6(),zr=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,Tr=["__proto__","profile __proto__"],Ff=s0((D)=>{const F={};let E,w;for(let $ of D.split(/\r?\n/)){const C=$.split(/(^|\s)[;#]/)[0].trim();if(C[0]==="["&&C[C.length-1]==="]"){E=void 0,w=void 0;const B=C.substring(1,C.length-1),h=zr.exec(B);if(h){const[,U,,I]=h;if(Object.values(xE.IniSectionType).includes(U))E=[U,I].join(m8)}else E=B;if(Tr.includes(B))throw new Error(`Found invalid profile name "${B}"`)}else if(E){const B=C.indexOf("=");if(![0,-1].includes(B)){const[h,U]=[C.substring(0,B).trim(),C.substring(B+1).trim()];if(U==="")w=h;else{if(w&&$.trimStart()===$)w=void 0;F[E]=F[E]||{};const I=w?[w,h].join(m8):h;F[E][I]=U}}}}return F},"parseIni"),bA=e7(),xA=s0(()=>({}),"swallowError"),m8=".",_A=s0(async(D={})=>{const{filepath:F=Xr(),configFilepath:E=rA()}=D,w=Jr.getHomeDir();let C=F;if(F.startsWith("~/"))C=cE.join(w,F.slice(2));let f=E;if(E.startsWith("~/"))f=cE.join(w,E.slice(2));const B=await Promise.all([bA.slurpFile(f,{ignoreCache:D.ignoreCache}).then(Ff).then(Mr).catch(xA),bA.slurpFile(C,{ignoreCache:D.ignoreCache}).then(Ff).catch(xA)]);return{configFile:B[0],credentialsFile:B[1]}},"loadSharedConfigFiles"),Kr=s0((D)=>Object.entries(D).filter(([F])=>F.startsWith(xE.IniSectionType.SSO_SESSION+m8)).reduce((F,[E,w])=>({...F,[E.substring(E.indexOf(m8)+1)]:w}),{}),"getSsoSessionData"),Sr=e7(),Qr=s0(()=>({}),"swallowError"),Hr=s0(async(D={})=>Sr.slurpFile(D.configFilepath??rA()).then(Ff).then(Kr).catch(Qr),"loadSsoSessionData"),Lr=s0((...D)=>{const F={};for(let E of D)for(let[w,$]of Object.entries(E))if(F[w]!==void 0)Object.assign(F[w],$);else F[w]=$;return F},"mergeConfigFiles"),Rr=s0(async(D)=>{const F=await _A(D);return Lr(F.configFile,F.credentialsFile)},"parseKnownFiles")});var vA=W((J7D,dA)=>{function $f(D){try{const F=new Set(Array.from(D.match(/([A-Z_]){3,}/g)??[]));return F.delete("CONFIG"),F.delete("CONFIG_PREFIX_SEPARATOR"),F.delete("ENV"),[...F].join(", ")}catch(F){return D}}var{defineProperty:rE,getOwnPropertyDescriptor:Vr,getOwnPropertyNames:Nr}=Object,qr=Object.prototype.hasOwnProperty,Q6=(D,F)=>rE(D,"name",{value:F,configurable:!0}),Or=(D,F)=>{for(var E in F)rE(D,E,{get:F[E],enumerable:!0})},jr=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Nr(F))if(!qr.call(D,$)&&$!==E)rE(D,$,{get:()=>F[$],enumerable:!(w=Vr(F,$))||w.enumerable})}return D},Pr=(D)=>jr(rE({},"__esModule",{value:!0}),D),uA={};Or(uA,{loadConfig:()=>cr});dA.exports=Pr(uA);var rF=p7();Q6($f,"getSelectorName");var yr=Q6((D,F)=>async()=>{try{const E=D(process.env);if(E===void 0)throw new Error;return E}catch(E){throw new rF.CredentialsProviderError(E.message||`Not found in ENV: ${$f(D.toString())}`,{logger:F})}},"fromEnv"),sA=wf(),kr=Q6((D,{preferredFile:F="config",...E}={})=>async()=>{const w=sA.getProfileName(E),{configFile:$,credentialsFile:C}=await sA.loadSharedConfigFiles(E),f=C[w]||{},B=$[w]||{},h=F==="config"?{...f,...B}:{...B,...f};try{const I=D(h,F==="config"?$:C);if(I===void 0)throw new Error;return I}catch(U){throw new rF.CredentialsProviderError(U.message||`Not found in config files w/ profile [${w}]: ${$f(D.toString())}`,{logger:E.logger})}},"fromSharedConfigFiles"),br=Q6((D)=>typeof D==="function","isFunction"),xr=Q6((D)=>br(D)?async()=>await D():rF.fromStatic(D),"fromStatic"),cr=Q6(({environmentVariableSelector:D,configFileSelector:F,default:E},w={})=>rF.memoize(rF.chain(yr(D),kr(F,w),xr(E))),"loadConfig")});var aA=W((iA)=>{Object.defineProperty(iA,"__esModule",{value:!0});iA.getEndpointUrlConfig=void 0;var mA=wf(),nA="AWS_ENDPOINT_URL",lA="endpoint_url",gr=(D)=>({environmentVariableSelector:(F)=>{const E=D.split(" ").map((C)=>C.toUpperCase()),w=F[[nA,...E].join("_")];if(w)return w;const $=F[nA];if($)return $;return},configFileSelector:(F,E)=>{if(E&&F.services){const $=E[["services",F.services].join(mA.CONFIG_PREFIX_SEPARATOR)];if($){const C=D.split(" ").map((B)=>B.toLowerCase()),f=$[[C.join("_"),lA].join(mA.CONFIG_PREFIX_SEPARATOR)];if(f)return f}}const w=F[lA];if(w)return w;return},default:void 0});iA.getEndpointUrlConfig=gr});var ff=W((oA)=>{Object.defineProperty(oA,"__esModule",{value:!0});oA.getEndpointFromConfig=void 0;var rr=vA(),_r=aA(),sr=async(D)=>rr.loadConfig(_r.getEndpointUrlConfig(D!==null&&D!==void 0?D:""))();oA.getEndpointFromConfig=sr});var EI=W((K7D,FI)=>{function DI(D){const F={};if(D=D.replace(/^\?/,""),D)for(let E of D.split("&")){let[w,$=null]=E.split("=");if(w=decodeURIComponent(w),$)$=decodeURIComponent($);if(!(w in F))F[w]=$;else if(Array.isArray(F[w]))F[w].push($);else F[w]=[F[w],$]}return F}var{defineProperty:_E,getOwnPropertyDescriptor:ur,getOwnPropertyNames:dr}=Object,vr=Object.prototype.hasOwnProperty,mr=(D,F)=>_E(D,"name",{value:F,configurable:!0}),nr=(D,F)=>{for(var E in F)_E(D,E,{get:F[E],enumerable:!0})},lr=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of dr(F))if(!vr.call(D,$)&&$!==E)_E(D,$,{get:()=>F[$],enumerable:!(w=ur(F,$))||w.enumerable})}return D},ir=(D)=>lr(_E({},"__esModule",{value:!0}),D),eA={};nr(eA,{parseQueryString:()=>DI});FI.exports=ir(eA);mr(DI,"parseQueryString")});var CI=W((S7D,fI)=>{var{defineProperty:sE,getOwnPropertyDescriptor:pr,getOwnPropertyNames:ar}=Object,or=Object.prototype.hasOwnProperty,tr=(D,F)=>sE(D,"name",{value:F,configurable:!0}),er=(D,F)=>{for(var E in F)sE(D,E,{get:F[E],enumerable:!0})},D_=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of ar(F))if(!or.call(D,$)&&$!==E)sE(D,$,{get:()=>F[$],enumerable:!(w=pr(F,$))||w.enumerable})}return D},F_=(D)=>D_(sE({},"__esModule",{value:!0}),D),wI={};er(wI,{parseUrl:()=>$I});fI.exports=F_(wI);var E_=EI(),$I=tr((D)=>{if(typeof D==="string")return $I(new URL(D));const{hostname:F,pathname:E,port:w,protocol:$,search:C}=D;let f;if(C)f=E_.parseQueryString(C);return{hostname:F,port:w?parseInt(w):void 0,protocol:$,path:E,query:f}},"parseUrl")});var Bf=W((Q7D,GI)=>{function MI(D,F,E){return{applyToStack:(w)=>{w.add(hI(D,E),AI),w.add(UI(D,F),II)}}}var{defineProperty:uE,getOwnPropertyDescriptor:w_,getOwnPropertyNames:$_}=Object,f_=Object.prototype.hasOwnProperty,Cf=(D,F)=>uE(D,"name",{value:F,configurable:!0}),C_=(D,F)=>{for(var E in F)uE(D,E,{get:F[E],enumerable:!0})},B_=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of $_(F))if(!f_.call(D,$)&&$!==E)uE(D,$,{get:()=>F[$],enumerable:!(w=w_(F,$))||w.enumerable})}return D},h_=(D)=>B_(uE({},"__esModule",{value:!0}),D),BI={};C_(BI,{deserializerMiddleware:()=>hI,deserializerMiddlewareOption:()=>AI,getSerdePlugin:()=>MI,serializerMiddleware:()=>UI,serializerMiddlewareOption:()=>II});GI.exports=h_(BI);var hI=Cf((D,F)=>(E)=>async(w)=>{const{response:$}=await E(w);try{const C=await F($,D);return{response:$,output:C}}catch(C){if(Object.defineProperty(C,"$response",{value:$}),!("$metadata"in C)){if(C.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof C.$responseBodyText!=="undefined"){if(C.$response)C.$response.body=C.$responseBodyText}}throw C}},"deserializerMiddleware"),UI=Cf((D,F)=>(E,w)=>async($)=>{var C;const f=((C=w.endpointV2)==null?void 0:C.url)&&D.urlParser?async()=>D.urlParser(w.endpointV2.url):D.endpoint;if(!f)throw new Error("No valid endpoint provider available.");const B=await F($.input,{...D,endpoint:f});return E({...$,request:B})},"serializerMiddleware"),AI={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},II={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};Cf(MI,"getSerdePlugin")});var KI=W((H7D,TI)=>{var{defineProperty:vE,getOwnPropertyDescriptor:U_,getOwnPropertyNames:A_}=Object,I_=Object.prototype.hasOwnProperty,U2=(D,F)=>vE(D,"name",{value:F,configurable:!0}),M_=(D,F)=>{for(var E in F)vE(D,E,{get:F[E],enumerable:!0})},G_=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of A_(F))if(!I_.call(D,$)&&$!==E)vE(D,$,{get:()=>F[$],enumerable:!(w=U_(F,$))||w.enumerable})}return D},Y_=(D)=>G_(vE({},"__esModule",{value:!0}),D),ZI={};M_(ZI,{endpointMiddleware:()=>JI,endpointMiddlewareOptions:()=>zI,getEndpointFromInstructions:()=>WI,getEndpointPlugin:()=>H_,resolveEndpointConfig:()=>R_,resolveParams:()=>XI,toEndpointV1:()=>hf});TI.exports=Y_(ZI);var Z_=U2(async(D)=>{const F=(D==null?void 0:D.Bucket)||"";if(typeof D.Bucket==="string")D.Bucket=F.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(T_(F)){if(D.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!z_(F)||F.indexOf(".")!==-1&&!String(D.Endpoint).startsWith("http:")||F.toLowerCase()!==F||F.length<3)D.ForcePathStyle=!0;if(D.DisableMultiRegionAccessPoints)D.disableMultiRegionAccessPoints=!0,D.DisableMRAP=!0;return D},"resolveParamsForS3"),W_=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,X_=/(\d+\.){3}\d+/,J_=/\.\./,z_=U2((D)=>W_.test(D)&&!X_.test(D)&&!J_.test(D),"isDnsCompatibleBucketName"),T_=U2((D)=>{const[F,E,w,,,$]=D.split(":"),C=F==="arn"&&D.split(":").length>=6,f=Boolean(C&&E&&w&&$);if(C&&!f)throw new Error(`Invalid ARN: ${D} was an invalid ARN.`);return f},"isArnBucketName"),K_=U2((D,F,E)=>{const w=U2(async()=>{const $=E[D]??E[F];if(typeof $==="function")return $();return $},"configProvider");if(D==="credentialScope"||F==="CredentialScope")return async()=>{const $=typeof E.credentials==="function"?await E.credentials():E.credentials;return($==null?void 0:$.credentialScope)??($==null?void 0:$.CredentialScope)};if(D==="accountId"||F==="AccountId")return async()=>{const $=typeof E.credentials==="function"?await E.credentials():E.credentials;return($==null?void 0:$.accountId)??($==null?void 0:$.AccountId)};if(D==="endpoint"||F==="endpoint")return async()=>{const $=await w();if($&&typeof $==="object"){if("url"in $)return $.url.href;if("hostname"in $){const{protocol:C,hostname:f,port:B,path:h}=$;return`${C}//${f}${B?":"+B:""}${h}`}}return $};return w},"createConfigValueProvider"),S_=ff(),YI=CI(),hf=U2((D)=>{if(typeof D==="object"){if("url"in D)return YI.parseUrl(D.url);return D}return YI.parseUrl(D)},"toEndpointV1"),WI=U2(async(D,F,E,w)=>{if(!E.endpoint){let f;if(E.serviceConfiguredEndpoint)f=await E.serviceConfiguredEndpoint();else f=await S_.getEndpointFromConfig(E.serviceId);if(f)E.endpoint=()=>Promise.resolve(hf(f))}const $=await XI(D,F,E);if(typeof E.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return E.endpointProvider($,w)},"getEndpointFromInstructions"),XI=U2(async(D,F,E)=>{var w;const $={},C=((w=F==null?void 0:F.getEndpointParameterInstructions)==null?void 0:w.call(F))||{};for(let[f,B]of Object.entries(C))switch(B.type){case"staticContextParams":$[f]=B.value;break;case"contextParams":$[f]=D[B.name];break;case"clientContextParams":case"builtInParams":$[f]=await K_(B.name,f,E)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(B))}if(Object.keys(C).length===0)Object.assign($,E);if(String(E.serviceId).toLowerCase()==="s3")await Z_($);return $},"resolveParams"),dE=xF(),JI=U2(({config:D,instructions:F})=>{return(E,w)=>async($)=>{var C,f,B;const h=await WI($.input,{getEndpointParameterInstructions(){return F}},{...D},w);w.endpointV2=h,w.authSchemes=(C=h.properties)==null?void 0:C.authSchemes;const U=(f=w.authSchemes)==null?void 0:f[0];if(U){w.signing_region=U.signingRegion,w.signing_service=U.signingName;const I=dE.getSmithyContext(w),A=(B=I==null?void 0:I.selectedHttpAuthScheme)==null?void 0:B.httpAuthOption;if(A)A.signingProperties=Object.assign(A.signingProperties||{},{signing_region:U.signingRegion,signingRegion:U.signingRegion,signing_service:U.signingName,signingName:U.signingName,signingRegionSet:U.signingRegionSet},U.properties)}return E({...$})}},"endpointMiddleware"),Q_=Bf(),zI={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Q_.serializerMiddlewareOption.name},H_=U2((D,F)=>({applyToStack:(E)=>{E.addRelativeTo(JI({config:D,instructions:F}),zI)}}),"getEndpointPlugin"),L_=ff(),R_=U2((D)=>{const F=D.tls??!0,{endpoint:E}=D,w=E!=null?async()=>hf(await dE.normalizeProvider(E)()):void 0,C={...D,endpoint:w,tls:F,isCustomEndpoint:!!E,useDualstackEndpoint:dE.normalizeProvider(D.useDualstackEndpoint??!1),useFipsEndpoint:dE.normalizeProvider(D.useFipsEndpoint??!1)};let f=void 0;return C.serviceConfiguredEndpoint=async()=>{if(D.serviceId&&!f)f=L_.getEndpointFromConfig(D.serviceId);return f},C},"resolveEndpointConfig")});var H1=W((L7D,OI)=>{function VI(D){return Object.keys(D).reduce((F,E)=>{const w=D[E];return{...F,[E]:Array.isArray(w)?[...w]:w}},{})}function qI(D){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(D)}var{defineProperty:mE,getOwnPropertyDescriptor:V_,getOwnPropertyNames:N_}=Object,q_=Object.prototype.hasOwnProperty,w8=(D,F)=>mE(D,"name",{value:F,configurable:!0}),O_=(D,F)=>{for(var E in F)mE(D,E,{get:F[E],enumerable:!0})},j_=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of N_(F))if(!q_.call(D,$)&&$!==E)mE(D,$,{get:()=>F[$],enumerable:!(w=V_(F,$))||w.enumerable})}return D},P_=(D)=>j_(mE({},"__esModule",{value:!0}),D),SI={};O_(SI,{Field:()=>b_,Fields:()=>x_,HttpRequest:()=>c_,HttpResponse:()=>g_,IHttpRequest:()=>QI.HttpRequest,getHttpHandlerExtensionConfiguration:()=>y_,isValidHostname:()=>qI,resolveHttpHandlerRuntimeConfig:()=>k_});OI.exports=P_(SI);var y_=w8((D)=>{let F=D.httpHandler;return{setHttpHandler(E){F=E},httpHandler(){return F},updateHttpClientConfig(E,w){F.updateHttpClientConfig(E,w)},httpHandlerConfigs(){return F.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),k_=w8((D)=>{return{httpHandler:D.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),QI=J0(),HI=class D{constructor({name:F,kind:E=QI.FieldPosition.HEADER,values:w=[]}){this.name=F,this.kind=E,this.values=w}add(F){this.values.push(F)}set(F){this.values=F}remove(F){this.values=this.values.filter((E)=>E!==F)}toString(){return this.values.map((F)=>F.includes(",")||F.includes(" ")?`"${F}"`:F).join(", ")}get(){return this.values}};w8(HI,"Field");var b_=HI,LI=class D{constructor({fields:F=[],encoding:E="utf-8"}){this.entries={},F.forEach(this.setField.bind(this)),this.encoding=E}setField(F){this.entries[F.name.toLowerCase()]=F}getField(F){return this.entries[F.toLowerCase()]}removeField(F){delete this.entries[F.toLowerCase()]}getByType(F){return Object.values(this.entries).filter((E)=>E.kind===F)}};w8(LI,"Fields");var x_=LI,RI=class D{constructor(F){this.method=F.method||"GET",this.hostname=F.hostname||"localhost",this.port=F.port,this.query=F.query||{},this.headers=F.headers||{},this.body=F.body,this.protocol=F.protocol?F.protocol.slice(-1)!==":"?`${F.protocol}:`:F.protocol:"https:",this.path=F.path?F.path.charAt(0)!=="/"?`/${F.path}`:F.path:"/",this.username=F.username,this.password=F.password,this.fragment=F.fragment}static clone(F){const E=new D({...F,headers:{...F.headers}});if(E.query)E.query=VI(E.query);return E}static isInstance(F){if(!F)return!1;const E=F;return"method"in E&&"protocol"in E&&"hostname"in E&&"path"in E&&typeof E.query==="object"&&typeof E.headers==="object"}clone(){return D.clone(this)}};w8(RI,"HttpRequest");var c_=RI;w8(VI,"cloneQuery");var NI=class D{constructor(F){this.statusCode=F.statusCode,this.reason=F.reason,this.headers=F.headers||{},this.body=F.body}static isInstance(F){if(!F)return!1;const E=F;return typeof E.statusCode==="number"&&typeof E.headers==="object"}};w8(NI,"HttpResponse");var g_=NI;w8(qI,"isValidHostname")});var Uf=W((jI)=>{function __(D){return D&&D.__esModule?D:{default:D}}function s_(){if(nE>lE.length-16)r_.default.randomFillSync(lE),nE=0;return lE.slice(nE,nE+=16)}Object.defineProperty(jI,"__esModule",{value:!0});jI.default=s_;var r_=__(import.meta.require("crypto")),lE=new Uint8Array(256),nE=lE.length});var kI=W((PI)=>{Object.defineProperty(PI,"__esModule",{value:!0});PI.default=void 0;var d_=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;PI.default=d_});var _F=W((bI)=>{function m_(D){return D&&D.__esModule?D:{default:D}}function n_(D){return typeof D==="string"&&v_.default.test(D)}Object.defineProperty(bI,"__esModule",{value:!0});bI.default=void 0;var v_=m_(kI()),l_=n_;bI.default=l_});var sF=W((gI)=>{function p_(D){return D&&D.__esModule?D:{default:D}}function cI(D,F=0){return aD[D[F+0]]+aD[D[F+1]]+aD[D[F+2]]+aD[D[F+3]]+"-"+aD[D[F+4]]+aD[D[F+5]]+"-"+aD[D[F+6]]+aD[D[F+7]]+"-"+aD[D[F+8]]+aD[D[F+9]]+"-"+aD[D[F+10]]+aD[D[F+11]]+aD[D[F+12]]+aD[D[F+13]]+aD[D[F+14]]+aD[D[F+15]]}function a_(D,F=0){const E=cI(D,F);if(!i_.default(E))throw TypeError("Stringified UUID is invalid");return E}Object.defineProperty(gI,"__esModule",{value:!0});gI.default=void 0;gI.unsafeStringify=cI;var i_=p_(_F()),aD=[];for(let D=0;D<256;++D)aD.push((D+256).toString(16).slice(1));var o_=a_;gI.default=o_});var dI=W((sI)=>{function Fs(D){return D&&D.__esModule?D:{default:D}}function Es(D,F,E){let w=F&&E||0;const $=F||new Array(16);D=D||{};let C=D.node||_I,f=D.clockseq!==void 0?D.clockseq:Af;if(C==null||f==null){const Y=D.random||(D.rng||e_.default)();if(C==null)C=_I=[Y[0]|1,Y[1],Y[2],Y[3],Y[4],Y[5]];if(f==null)f=Af=(Y[6]<<8|Y[7])&16383}let B=D.msecs!==void 0?D.msecs:Date.now(),h=D.nsecs!==void 0?D.nsecs:Mf+1;const U=B-If+(h-Mf)/1e4;if(U<0&&D.clockseq===void 0)f=f+1&16383;if((U<0||B>If)&&D.nsecs===void 0)h=0;if(h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");If=B,Mf=h,Af=f,B+=12219292800000;const I=((B&268435455)*1e4+h)%4294967296;$[w++]=I>>>24&255,$[w++]=I>>>16&255,$[w++]=I>>>8&255,$[w++]=I&255;const A=B/4294967296*1e4&268435455;$[w++]=A>>>8&255,$[w++]=A&255,$[w++]=A>>>24&15|16,$[w++]=A>>>16&255,$[w++]=f>>>8|128,$[w++]=f&255;for(let Y=0;Y<6;++Y)$[w+Y]=C[Y];return F||Ds.unsafeStringify($)}Object.defineProperty(sI,"__esModule",{value:!0});sI.default=void 0;var e_=Fs(Uf()),Ds=sF(),_I,Af,If=0,Mf=0,ws=Es;sI.default=ws});var Gf=W((vI)=>{function fs(D){return D&&D.__esModule?D:{default:D}}function Cs(D){if(!$s.default(D))throw TypeError("Invalid UUID");let F;const E=new Uint8Array(16);return E[0]=(F=parseInt(D.slice(0,8),16))>>>24,E[1]=F>>>16&255,E[2]=F>>>8&255,E[3]=F&255,E[4]=(F=parseInt(D.slice(9,13),16))>>>8,E[5]=F&255,E[6]=(F=parseInt(D.slice(14,18),16))>>>8,E[7]=F&255,E[8]=(F=parseInt(D.slice(19,23),16))>>>8,E[9]=F&255,E[10]=(F=parseInt(D.slice(24,36),16))/1099511627776&255,E[11]=F/4294967296&255,E[12]=F>>>24&255,E[13]=F>>>16&255,E[14]=F>>>8&255,E[15]=F&255,E}Object.defineProperty(vI,"__esModule",{value:!0});vI.default=void 0;var $s=fs(_F()),Bs=Cs;vI.default=Bs});var Yf=W((iI)=>{function As(D){return D&&D.__esModule?D:{default:D}}function Is(D){D=unescape(encodeURIComponent(D));const F=[];for(let E=0;E<D.length;++E)F.push(D.charCodeAt(E));return F}function Ms(D,F,E){function w($,C,f,B){var h;if(typeof $==="string")$=Is($);if(typeof C==="string")C=Us.default(C);if(((h=C)===null||h===void 0?void 0:h.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let U=new Uint8Array(16+$.length);if(U.set(C),U.set($,C.length),U=E(U),U[6]=U[6]&15|F,U[8]=U[8]&63|128,f){B=B||0;for(let I=0;I<16;++I)f[B+I]=U[I];return f}return hs.unsafeStringify(U)}try{w.name=D}catch($){}return w.DNS=nI,w.URL=lI,w}Object.defineProperty(iI,"__esModule",{value:!0});iI.URL=iI.DNS=void 0;iI.default=Ms;var hs=sF(),Us=As(Gf()),nI="6ba7b810-9dad-11d1-80b4-00c04fd430c8";iI.DNS=nI;var lI="6ba7b811-9dad-11d1-80b4-00c04fd430c8";iI.URL=lI});var tI=W((aI)=>{function Ws(D){return D&&D.__esModule?D:{default:D}}function Xs(D){if(Array.isArray(D))D=Buffer.from(D);else if(typeof D==="string")D=Buffer.from(D,"utf8");return Zs.default.createHash("md5").update(D).digest()}Object.defineProperty(aI,"__esModule",{value:!0});aI.default=void 0;var Zs=Ws(import.meta.require("crypto")),Js=Xs;aI.default=Js});var EM=W((DM)=>{function eI(D){return D&&D.__esModule?D:{default:D}}Object.defineProperty(DM,"__esModule",{value:!0});DM.default=void 0;var zs=eI(Yf()),Ts=eI(tI()),Ks=zs.default("v3",48,Ts.default),Ss=Ks;DM.default=Ss});var fM=W((wM)=>{function Hs(D){return D&&D.__esModule?D:{default:D}}Object.defineProperty(wM,"__esModule",{value:!0});wM.default=void 0;var Qs=Hs(import.meta.require("crypto")),Ls={randomUUID:Qs.default.randomUUID};wM.default=Ls});var AM=W((hM)=>{function BM(D){return D&&D.__esModule?D:{default:D}}function Ns(D,F,E){if(CM.default.randomUUID&&!F&&!D)return CM.default.randomUUID();D=D||{};const w=D.random||(D.rng||Rs.default)();if(w[6]=w[6]&15|64,w[8]=w[8]&63|128,F){E=E||0;for(let $=0;$<16;++$)F[E+$]=w[$];return F}return Vs.unsafeStringify(w)}Object.defineProperty(hM,"__esModule",{value:!0});hM.default=void 0;var CM=BM(fM()),Rs=BM(Uf()),Vs=sF(),qs=Ns;hM.default=qs});var GM=W((IM)=>{function js(D){return D&&D.__esModule?D:{default:D}}function Ps(D){if(Array.isArray(D))D=Buffer.from(D);else if(typeof D==="string")D=Buffer.from(D,"utf8");return Os.default.createHash("sha1").update(D).digest()}Object.defineProperty(IM,"__esModule",{value:!0});IM.default=void 0;var Os=js(import.meta.require("crypto")),ys=Ps;IM.default=ys});var XM=W((ZM)=>{function YM(D){return D&&D.__esModule?D:{default:D}}Object.defineProperty(ZM,"__esModule",{value:!0});ZM.default=void 0;var ks=YM(Yf()),bs=YM(GM()),xs=ks.default("v5",80,bs.default),cs=xs;ZM.default=cs});var TM=W((JM)=>{Object.defineProperty(JM,"__esModule",{value:!0});JM.default=void 0;var gs="00000000-0000-0000-0000-000000000000";JM.default=gs});var QM=W((KM)=>{function _s(D){return D&&D.__esModule?D:{default:D}}function ss(D){if(!rs.default(D))throw TypeError("Invalid UUID");return parseInt(D.slice(14,15),16)}Object.defineProperty(KM,"__esModule",{value:!0});KM.default=void 0;var rs=_s(_F()),us=ss;KM.default=us});var Zf=W((A2)=>{function L1(D){return D&&D.__esModule?D:{default:D}}Object.defineProperty(A2,"__esModule",{value:!0});Object.defineProperty(A2,"NIL",{enumerable:!0,get:function(){return ls.default}});Object.defineProperty(A2,"parse",{enumerable:!0,get:function(){return os.default}});Object.defineProperty(A2,"stringify",{enumerable:!0,get:function(){return as.default}});Object.defineProperty(A2,"v1",{enumerable:!0,get:function(){return ds.default}});Object.defineProperty(A2,"v3",{enumerable:!0,get:function(){return vs.default}});Object.defineProperty(A2,"v4",{enumerable:!0,get:function(){return ms.default}});Object.defineProperty(A2,"v5",{enumerable:!0,get:function(){return ns.default}});Object.defineProperty(A2,"validate",{enumerable:!0,get:function(){return ps.default}});Object.defineProperty(A2,"version",{enumerable:!0,get:function(){return is.default}});var ds=L1(dI()),vs=L1(EM()),ms=L1(AM()),ns=L1(XM()),ls=L1(TM()),is=L1(QM()),ps=L1(_F()),as=L1(sF()),os=L1(Gf())});var Wf=W((u7D,VM)=>{var{defineProperty:iE,getOwnPropertyDescriptor:ts,getOwnPropertyNames:es}=Object,Du=Object.prototype.hasOwnProperty,H6=(D,F)=>iE(D,"name",{value:F,configurable:!0}),Fu=(D,F)=>{for(var E in F)iE(D,E,{get:F[E],enumerable:!0})},Eu=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of es(F))if(!Du.call(D,$)&&$!==E)iE(D,$,{get:()=>F[$],enumerable:!(w=ts(F,$))||w.enumerable})}return D},wu=(D)=>Eu(iE({},"__esModule",{value:!0}),D),HM={};Fu(HM,{isClockSkewCorrectedError:()=>LM,isClockSkewError:()=>Au,isRetryableByTrait:()=>Uu,isServerError:()=>Mu,isThrottlingError:()=>Iu,isTransientError:()=>RM});VM.exports=wu(HM);var $u=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],fu=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Cu=["TimeoutError","RequestTimeout","RequestTimeoutException"],Bu=[500,502,503,504],hu=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Uu=H6((D)=>D.$retryable!==void 0,"isRetryableByTrait"),Au=H6((D)=>$u.includes(D.name),"isClockSkewError"),LM=H6((D)=>{var F;return(F=D.$metadata)==null?void 0:F.clockSkewCorrected},"isClockSkewCorrectedError"),Iu=H6((D)=>{var F,E;return((F=D.$metadata)==null?void 0:F.httpStatusCode)===429||fu.includes(D.name)||((E=D.$retryable)==null?void 0:E.throttling)==!0},"isThrottlingError"),RM=H6((D)=>{var F;return LM(D)||Cu.includes(D.name)||hu.includes((D==null?void 0:D.code)||"")||Bu.includes(((F=D.$metadata)==null?void 0:F.httpStatusCode)||0)},"isTransientError"),Mu=H6((D)=>{var F;if(((F=D.$metadata)==null?void 0:F.httpStatusCode)!==void 0){const E=D.$metadata.httpStatusCode;if(500<=E&&E<=599&&!RM(D))return!0;return!1}return!1},"isServerError")});var sM=W((d7D,_M)=>{var{defineProperty:pE,getOwnPropertyDescriptor:Gu,getOwnPropertyNames:Yu}=Object,Zu=Object.prototype.hasOwnProperty,I2=(D,F)=>pE(D,"name",{value:F,configurable:!0}),Wu=(D,F)=>{for(var E in F)pE(D,E,{get:F[E],enumerable:!0})},Xu=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Yu(F))if(!Zu.call(D,$)&&$!==E)pE(D,$,{get:()=>F[$],enumerable:!(w=Gu(F,$))||w.enumerable})}return D},Ju=(D)=>Xu(pE({},"__esModule",{value:!0}),D),qM={};Wu(qM,{AdaptiveRetryStrategy:()=>Hu,ConfiguredRetryStrategy:()=>Lu,DEFAULT_MAX_ATTEMPTS:()=>Xf,DEFAULT_RETRY_DELAY_BASE:()=>uF,DEFAULT_RETRY_MODE:()=>zu,DefaultRateLimiter:()=>PM,INITIAL_RETRY_TOKENS:()=>Jf,INVOCATION_ID_HEADER:()=>Ku,MAXIMUM_RETRY_DELAY:()=>zf,NO_RETRY_INCREMENT:()=>xM,REQUEST_HEADER:()=>Su,RETRY_COST:()=>kM,RETRY_MODES:()=>OM,StandardRetryStrategy:()=>Tf,THROTTLING_RETRY_DELAY_BASE:()=>yM,TIMEOUT_RETRY_COST:()=>bM});_M.exports=Ju(qM);var OM=((D)=>{return D.STANDARD="standard",D.ADAPTIVE="adaptive",D})(OM||{}),Xf=3,zu="standard",Tu=Wf(),jM=class D{constructor(F){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=(F==null?void 0:F.beta)??0.7,this.minCapacity=(F==null?void 0:F.minCapacity)??1,this.minFillRate=(F==null?void 0:F.minFillRate)??0.5,this.scaleConstant=(F==null?void 0:F.scaleConstant)??0.4,this.smooth=(F==null?void 0:F.smooth)??0.8;const E=this.getCurrentTimeInSeconds();this.lastThrottleTime=E,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(F){if(!this.enabled)return;if(this.refillTokenBucket(),F>this.currentCapacity){const E=(F-this.currentCapacity)/this.fillRate*1000;await new Promise((w)=>setTimeout(w,E))}this.currentCapacity=this.currentCapacity-F}refillTokenBucket(){const F=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=F;return}const E=(F-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+E),this.lastTimestamp=F}updateClientSendingRate(F){let E;if(this.updateMeasuredRate(),Tu.isThrottlingError(F)){const $=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=$,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),E=this.cubicThrottle($),this.enableTokenBucket()}else this.calculateTimeWindow(),E=this.cubicSuccess(this.getCurrentTimeInSeconds());const w=Math.min(E,2*this.measuredTxRate);this.updateTokenBucketRate(w)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(F){return this.getPrecise(F*this.beta)}cubicSuccess(F){return this.getPrecise(this.scaleConstant*Math.pow(F-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(F){this.refillTokenBucket(),this.fillRate=Math.max(F,this.minFillRate),this.maxCapacity=Math.max(F,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const F=this.getCurrentTimeInSeconds(),E=Math.floor(F*2)/2;if(this.requestCount++,E>this.lastTxRateBucket){const w=this.requestCount/(E-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(w*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=E}}getPrecise(F){return parseFloat(F.toFixed(8))}};I2(jM,"DefaultRateLimiter");var PM=jM,uF=100,zf=20000,yM=500,Jf=500,kM=5,bM=10,xM=1,Ku="amz-sdk-invocation-id",Su="amz-sdk-request",Qu=I2(()=>{let D=uF;return{computeNextBackoffDelay:I2((w)=>{return Math.floor(Math.min(zf,Math.random()*2**w*D))},"computeNextBackoffDelay"),setDelayBase:I2((w)=>{D=w},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),NM=I2(({retryDelay:D,retryCount:F,retryCost:E})=>{return{getRetryCount:I2(()=>F,"getRetryCount"),getRetryDelay:I2(()=>Math.min(zf,D),"getRetryDelay"),getRetryCost:I2(()=>E,"getRetryCost")}},"createDefaultRetryToken"),cM=class D{constructor(F){this.maxAttempts=F,this.mode="standard",this.capacity=Jf,this.retryBackoffStrategy=Qu(),this.maxAttemptsProvider=typeof F==="function"?F:async()=>F}async acquireInitialRetryToken(F){return NM({retryDelay:uF,retryCount:0})}async refreshRetryTokenForRetry(F,E){const w=await this.getMaxAttempts();if(this.shouldRetry(F,E,w)){const $=E.errorType;this.retryBackoffStrategy.setDelayBase($==="THROTTLING"?yM:uF);const C=this.retryBackoffStrategy.computeNextBackoffDelay(F.getRetryCount()),f=E.retryAfterHint?Math.max(E.retryAfterHint.getTime()-Date.now()||0,C):C,B=this.getCapacityCost($);return this.capacity-=B,NM({retryDelay:f,retryCount:F.getRetryCount()+1,retryCost:B})}throw new Error("No retry token available")}recordSuccess(F){this.capacity=Math.max(Jf,this.capacity+(F.getRetryCost()??xM))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(F){return console.warn(`Max attempts provider could not resolve. Using default of ${Xf}`),Xf}}shouldRetry(F,E,w){return F.getRetryCount()+1<w&&this.capacity>=this.getCapacityCost(E.errorType)&&this.isRetryableError(E.errorType)}getCapacityCost(F){return F==="TRANSIENT"?bM:kM}isRetryableError(F){return F==="THROTTLING"||F==="TRANSIENT"}};I2(cM,"StandardRetryStrategy");var Tf=cM,gM=class D{constructor(F,E){this.maxAttemptsProvider=F,this.mode="adaptive";const{rateLimiter:w}=E??{};this.rateLimiter=w??new PM,this.standardRetryStrategy=new Tf(F)}async acquireInitialRetryToken(F){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(F)}async refreshRetryTokenForRetry(F,E){return this.rateLimiter.updateClientSendingRate(E),this.standardRetryStrategy.refreshRetryTokenForRetry(F,E)}recordSuccess(F){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(F)}};I2(gM,"AdaptiveRetryStrategy");var Hu=gM,rM=class D extends Tf{constructor(F,E=uF){super(typeof F==="function"?F:async()=>F);if(typeof E==="number")this.computeNextBackoffDelay=()=>E;else this.computeNextBackoffDelay=E}async refreshRetryTokenForRetry(F,E){const w=await super.refreshRetryTokenForRetry(F,E);return w.getRetryDelay=()=>this.computeNextBackoffDelay(w.getRetryCount()),w}};I2(rM,"ConfiguredRetryStrategy");var Lu=rM});var nM=W((v7D,mM)=>{var{defineProperty:aE,getOwnPropertyDescriptor:Ru,getOwnPropertyNames:Vu}=Object,Nu=Object.prototype.hasOwnProperty,u0=(D,F)=>aE(D,"name",{value:F,configurable:!0}),qu=(D,F)=>{for(var E in F)aE(D,E,{get:F[E],enumerable:!0})},Ou=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Vu(F))if(!Nu.call(D,$)&&$!==E)aE(D,$,{get:()=>F[$],enumerable:!(w=Ru(F,$))||w.enumerable})}return D},ju=(D)=>Ou(aE({},"__esModule",{value:!0}),D),vM={};qu(vM,{constructStack:()=>Kf});mM.exports=ju(vM);var n8=u0((D,F)=>{const E=[];if(D)E.push(D);if(F)for(let w of F)E.push(w);return E},"getAllAliases"),$8=u0((D,F)=>{return`${D||"anonymous"}${F&&F.length>0?` (a.k.a. ${F.join(",")})`:""}`},"getMiddlewareNameWithAliases"),Kf=u0(()=>{let D=[],F=[],E=!1;const w=new Set,$=u0((A)=>A.sort((Y,M)=>uM[M.step]-uM[Y.step]||dM[M.priority||"normal"]-dM[Y.priority||"normal"]),"sort"),C=u0((A)=>{let Y=!1;const M=u0((Z)=>{const z=n8(Z.name,Z.aliases);if(z.includes(A)){Y=!0;for(let X of z)w.delete(X);return!1}return!0},"filterCb");return D=D.filter(M),F=F.filter(M),Y},"removeByName"),f=u0((A)=>{let Y=!1;const M=u0((Z)=>{if(Z.middleware===A){Y=!0;for(let z of n8(Z.name,Z.aliases))w.delete(z);return!1}return!0},"filterCb");return D=D.filter(M),F=F.filter(M),Y},"removeByReference"),B=u0((A)=>{var Y;return D.forEach((M)=>{A.add(M.middleware,{...M})}),F.forEach((M)=>{A.addRelativeTo(M.middleware,{...M})}),(Y=A.identifyOnResolve)==null||Y.call(A,I.identifyOnResolve()),A},"cloneTo"),h=u0((A)=>{const Y=[];return A.before.forEach((M)=>{if(M.before.length===0&&M.after.length===0)Y.push(M);else Y.push(...h(M))}),Y.push(A),A.after.reverse().forEach((M)=>{if(M.before.length===0&&M.after.length===0)Y.push(M);else Y.push(...h(M))}),Y},"expandRelativeMiddlewareList"),U=u0((A=!1)=>{const Y=[],M=[],Z={};return D.forEach((X)=>{const J={...X,before:[],after:[]};for(let K of n8(J.name,J.aliases))Z[K]=J;Y.push(J)}),F.forEach((X)=>{const J={...X,before:[],after:[]};for(let K of n8(J.name,J.aliases))Z[K]=J;M.push(J)}),M.forEach((X)=>{if(X.toMiddleware){const J=Z[X.toMiddleware];if(J===void 0){if(A)return;throw new Error(`${X.toMiddleware} is not found when adding ${$8(X.name,X.aliases)} middleware ${X.relation} ${X.toMiddleware}`)}if(X.relation==="after")J.after.push(X);if(X.relation==="before")J.before.push(X)}}),$(Y).map(h).reduce((X,J)=>{return X.push(...J),X},[])},"getMiddlewareList"),I={add:(A,Y={})=>{const{name:M,override:Z,aliases:z}=Y,X={step:"initialize",priority:"normal",middleware:A,...Y},J=n8(M,z);if(J.length>0){if(J.some((K)=>w.has(K))){if(!Z)throw new Error(`Duplicate middleware name '${$8(M,z)}'`);for(let K of J){const H=D.findIndex((m)=>{var FD;return m.name===K||((FD=m.aliases)==null?void 0:FD.some(($D)=>$D===K))});if(H===-1)continue;const V=D[H];if(V.step!==X.step||X.priority!==V.priority)throw new Error(`"${$8(V.name,V.aliases)}" middleware with ${V.priority} priority in ${V.step} step cannot be overridden by "${$8(M,z)}" middleware with ${X.priority} priority in ${X.step} step.`);D.splice(H,1)}}for(let K of J)w.add(K)}D.push(X)},addRelativeTo:(A,Y)=>{const{name:M,override:Z,aliases:z}=Y,X={middleware:A,...Y},J=n8(M,z);if(J.length>0){if(J.some((K)=>w.has(K))){if(!Z)throw new Error(`Duplicate middleware name '${$8(M,z)}'`);for(let K of J){const H=F.findIndex((m)=>{var FD;return m.name===K||((FD=m.aliases)==null?void 0:FD.some(($D)=>$D===K))});if(H===-1)continue;const V=F[H];if(V.toMiddleware!==X.toMiddleware||V.relation!==X.relation)throw new Error(`"${$8(V.name,V.aliases)}" middleware ${V.relation} "${V.toMiddleware}" middleware cannot be overridden by "${$8(M,z)}" middleware ${X.relation} "${X.toMiddleware}" middleware.`);F.splice(H,1)}}for(let K of J)w.add(K)}F.push(X)},clone:()=>B(Kf()),use:(A)=>{A.applyToStack(I)},remove:(A)=>{if(typeof A==="string")return C(A);else return f(A)},removeByTag:(A)=>{let Y=!1;const M=u0((Z)=>{const{tags:z,name:X,aliases:J}=Z;if(z&&z.includes(A)){const K=n8(X,J);for(let H of K)w.delete(H);return Y=!0,!1}return!0},"filterCb");return D=D.filter(M),F=F.filter(M),Y},concat:(A)=>{var Y;const M=B(Kf());return M.use(A),M.identifyOnResolve(E||M.identifyOnResolve()||(((Y=A.identifyOnResolve)==null?void 0:Y.call(A))??!1)),M},applyToStack:B,identify:()=>{return U(!0).map((A)=>{const Y=A.step??A.relation+" "+A.toMiddleware;return $8(A.name,A.aliases)+" - "+Y})},identifyOnResolve(A){if(typeof A==="boolean")E=A;return E},resolve:(A,Y)=>{for(let M of U().map((Z)=>Z.middleware).reverse())A=M(A,Y);if(E)console.log(I.identify());return A}};return I},"constructStack"),uM={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},dM={high:3,normal:2,low:1}});var Sf=W((m7D,iM)=>{var{defineProperty:oE,getOwnPropertyDescriptor:Pu,getOwnPropertyNames:yu}=Object,ku=Object.prototype.hasOwnProperty,bu=(D,F)=>oE(D,"name",{value:F,configurable:!0}),xu=(D,F)=>{for(var E in F)oE(D,E,{get:F[E],enumerable:!0})},cu=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of yu(F))if(!ku.call(D,$)&&$!==E)oE(D,$,{get:()=>F[$],enumerable:!(w=Pu(F,$))||w.enumerable})}return D},gu=(D)=>cu(oE({},"__esModule",{value:!0}),D),lM={};xu(lM,{isArrayBuffer:()=>ru});iM.exports=gu(lM);var ru=bu((D)=>typeof ArrayBuffer==="function"&&D instanceof ArrayBuffer||Object.prototype.toString.call(D)==="[object ArrayBuffer]","isArrayBuffer")});var dF=W((n7D,oM)=>{var{defineProperty:tE,getOwnPropertyDescriptor:_u,getOwnPropertyNames:su}=Object,uu=Object.prototype.hasOwnProperty,pM=(D,F)=>tE(D,"name",{value:F,configurable:!0}),du=(D,F)=>{for(var E in F)tE(D,E,{get:F[E],enumerable:!0})},vu=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of su(F))if(!uu.call(D,$)&&$!==E)tE(D,$,{get:()=>F[$],enumerable:!(w=_u(F,$))||w.enumerable})}return D},mu=(D)=>vu(tE({},"__esModule",{value:!0}),D),aM={};du(aM,{fromArrayBuffer:()=>lu,fromString:()=>iu});oM.exports=mu(aM);var nu=Sf(),Qf=import.meta.require("buffer"),lu=pM((D,F=0,E=D.byteLength-F)=>{if(!nu.isArrayBuffer(D))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof D} (${D})`);return Qf.Buffer.from(D,F,E)},"fromArrayBuffer"),iu=pM((D,F)=>{if(typeof D!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof D} (${D})`);return F?Qf.Buffer.from(D,F):Qf.Buffer.from(D)},"fromString")});var DG=W((tM)=>{Object.defineProperty(tM,"__esModule",{value:!0});tM.fromBase64=void 0;var pu=dF(),au=/^[A-Za-z0-9+/]*={0,2}$/,ou=(D)=>{if(D.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!au.exec(D))throw new TypeError("Invalid base64 string.");const F=pu.fromString(D,"base64");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength)};tM.fromBase64=ou});var f8=W((i7D,$G)=>{var{defineProperty:eE,getOwnPropertyDescriptor:tu,getOwnPropertyNames:eu}=Object,Dd=Object.prototype.hasOwnProperty,Hf=(D,F)=>eE(D,"name",{value:F,configurable:!0}),Fd=(D,F)=>{for(var E in F)eE(D,E,{get:F[E],enumerable:!0})},Ed=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of eu(F))if(!Dd.call(D,$)&&$!==E)eE(D,$,{get:()=>F[$],enumerable:!(w=tu(F,$))||w.enumerable})}return D},wd=(D)=>Ed(eE({},"__esModule",{value:!0}),D),FG={};Fd(FG,{fromUtf8:()=>wG,toUint8Array:()=>$d,toUtf8:()=>fd});$G.exports=wd(FG);var EG=dF(),wG=Hf((D)=>{const F=EG.fromString(D,"utf8");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),$d=Hf((D)=>{if(typeof D==="string")return wG(D);if(ArrayBuffer.isView(D))return new Uint8Array(D.buffer,D.byteOffset,D.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(D)},"toUint8Array"),fd=Hf((D)=>{if(typeof D==="string")return D;if(typeof D!=="object"||typeof D.byteOffset!=="number"||typeof D.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return EG.fromArrayBuffer(D.buffer,D.byteOffset,D.byteLength).toString("utf8")},"toUtf8")});var BG=W((fG)=>{Object.defineProperty(fG,"__esModule",{value:!0});fG.toBase64=void 0;var Cd=dF(),Bd=f8(),hd=(D)=>{let F;if(typeof D==="string")F=Bd.fromUtf8(D);else F=D;if(typeof F!=="object"||typeof F.byteOffset!=="number"||typeof F.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return Cd.fromArrayBuffer(F.buffer,F.byteOffset,F.byteLength).toString("base64")};fG.toBase64=hd});var Fw=W((a7D,Dw)=>{var{defineProperty:hG,getOwnPropertyDescriptor:Ud,getOwnPropertyNames:Ad}=Object,Id=Object.prototype.hasOwnProperty,Lf=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Ad(F))if(!Id.call(D,$)&&$!==E)hG(D,$,{get:()=>F[$],enumerable:!(w=Ud(F,$))||w.enumerable})}return D},UG=(D,F,E)=>(Lf(D,F,"default"),E&&Lf(E,F,"default")),Md=(D)=>Lf(hG({},"__esModule",{value:!0}),D),Rf={};Dw.exports=Md(Rf);UG(Rf,DG(),Dw.exports);UG(Rf,BG(),Dw.exports)});var MG=W((AG)=>{Object.defineProperty(AG,"__esModule",{value:!0});AG.getAwsChunkedEncodingStream=void 0;var Gd=import.meta.require("stream"),Yd=(D,F)=>{const{base64Encoder:E,bodyLengthChecker:w,checksumAlgorithmFn:$,checksumLocationName:C,streamHasher:f}=F,B=E!==void 0&&$!==void 0&&C!==void 0&&f!==void 0,h=B?f($,D):void 0,U=new Gd.Readable({read:()=>{}});return D.on("data",(I)=>{const A=w(I)||0;U.push(`${A.toString(16)}\r\n`),U.push(I),U.push("\r\n")}),D.on("end",async()=>{if(U.push("0\r\n"),B){const I=E(await h);U.push(`${C}:${I}\r\n`),U.push("\r\n")}U.push(null)}),U};AG.getAwsChunkedEncodingStream=Yd});var Nf=W((t7D,ZG)=>{var{defineProperty:Ew,getOwnPropertyDescriptor:Zd,getOwnPropertyNames:Wd}=Object,Xd=Object.prototype.hasOwnProperty,Vf=(D,F)=>Ew(D,"name",{value:F,configurable:!0}),Jd=(D,F)=>{for(var E in F)Ew(D,E,{get:F[E],enumerable:!0})},zd=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Wd(F))if(!Xd.call(D,$)&&$!==E)Ew(D,$,{get:()=>F[$],enumerable:!(w=Zd(F,$))||w.enumerable})}return D},Td=(D)=>zd(Ew({},"__esModule",{value:!0}),D),GG={};Jd(GG,{escapeUri:()=>YG,escapeUriPath:()=>Sd});ZG.exports=Td(GG);var YG=Vf((D)=>encodeURIComponent(D).replace(/[!'()*]/g,Kd),"escapeUri"),Kd=Vf((D)=>`%${D.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Sd=Vf((D)=>D.split("/").map(YG).join("/"),"escapeUriPath")});var Of=W((e7D,JG)=>{function XG(D){const F=[];for(let E of Object.keys(D).sort()){const w=D[E];if(E=qf.escapeUri(E),Array.isArray(w))for(let $=0,C=w.length;$<C;$++)F.push(`${E}=${qf.escapeUri(w[$])}`);else{let $=E;if(w||typeof w==="string")$+=`=${qf.escapeUri(w)}`;F.push($)}}return F.join("&")}var{defineProperty:ww,getOwnPropertyDescriptor:Qd,getOwnPropertyNames:Hd}=Object,Ld=Object.prototype.hasOwnProperty,Rd=(D,F)=>ww(D,"name",{value:F,configurable:!0}),Vd=(D,F)=>{for(var E in F)ww(D,E,{get:F[E],enumerable:!0})},Nd=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Hd(F))if(!Ld.call(D,$)&&$!==E)ww(D,$,{get:()=>F[$],enumerable:!(w=Qd(F,$))||w.enumerable})}return D},qd=(D)=>Nd(ww({},"__esModule",{value:!0}),D),WG={};Vd(WG,{buildQueryString:()=>XG});JG.exports=qd(WG);var qf=Nf();Rd(XG,"buildQueryString")});var cG=W((DfD,xG)=>{async function yf(D,F,E=KG){const w=F.headers??{},$=w.Expect||w.expect;let C=-1,f=!1;if($==="100-continue")await Promise.race([new Promise((B)=>{C=Number(setTimeout(B,Math.max(KG,E)))}),new Promise((B)=>{D.on("continue",()=>{clearTimeout(C),B()}),D.on("error",()=>{f=!0,clearTimeout(C),B()})})]);if(!f)qG(D,F.body)}function qG(D,F){if(F instanceof NG.Readable){F.pipe(D);return}if(F){if(Buffer.isBuffer(F)||typeof F==="string"){D.end(F);return}const E=F;if(typeof E==="object"&&E.buffer&&typeof E.byteOffset==="number"&&typeof E.byteLength==="number"){D.end(Buffer.from(E.buffer,E.byteOffset,E.byteLength));return}D.end(Buffer.from(F));return}D.end()}async function bG(D){const F=[],E=D.getReader();let w=!1,$=0;while(!w){const{done:B,value:h}=await E.read();if(h)F.push(h),$+=h.length;w=B}const C=new Uint8Array($);let f=0;for(let B of F)C.set(B,f),f+=B.length;return C}var{create:Od,defineProperty:vF,getOwnPropertyDescriptor:jd,getOwnPropertyNames:Pd,getPrototypeOf:yd}=Object,kd=Object.prototype.hasOwnProperty,ID=(D,F)=>vF(D,"name",{value:F,configurable:!0}),bd=(D,F)=>{for(var E in F)vF(D,E,{get:F[E],enumerable:!0})},QG=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Pd(F))if(!kd.call(D,$)&&$!==E)vF(D,$,{get:()=>F[$],enumerable:!(w=jd(F,$))||w.enumerable})}return D},xd=(D,F,E)=>(E=D!=null?Od(yd(D)):{},QG(F||!D||!D.__esModule?vF(E,"default",{value:D,enumerable:!0}):E,D)),cd=(D)=>QG(vF({},"__esModule",{value:!0}),D),HG={};bd(HG,{DEFAULT_REQUEST_TIMEOUT:()=>dd,NodeHttp2Handler:()=>id,NodeHttpHandler:()=>vd,streamCollector:()=>ad});xG.exports=cd(HG);var LG=H1(),RG=Of(),jf=import.meta.require("http"),Pf=import.meta.require("https"),gd=["ECONNRESET","EPIPE","ETIMEDOUT"],VG=ID((D)=>{const F={};for(let E of Object.keys(D)){const w=D[E];F[E]=Array.isArray(w)?w.join(","):w}return F},"getTransformedHeaders"),zG=1000,rd=ID((D,F,E=0)=>{if(!E)return-1;const w=ID(($)=>{const C=setTimeout(()=>{D.destroy(),F(Object.assign(new Error(`Socket timed out without establishing a connection within ${E} ms`),{name:"TimeoutError"}))},E-$),f=ID((B)=>{if(B==null?void 0:B.connecting)B.on("connect",()=>{clearTimeout(C)});else clearTimeout(C)},"doWithSocket");if(D.socket)f(D.socket);else D.on("socket",f)},"registerTimeout");if(E<2000)return w(0),0;return setTimeout(w.bind(null,zG),zG)},"setConnectionTimeout"),_d=3000,sd=ID((D,{keepAlive:F,keepAliveMsecs:E},w=_d)=>{if(F!==!0)return-1;const $=ID(()=>{if(D.socket)D.socket.setKeepAlive(F,E||0);else D.on("socket",(C)=>{C.setKeepAlive(F,E||0)})},"registerListener");if(w===0)return $(),0;return setTimeout($,w)},"setSocketKeepAlive"),TG=3000,ud=ID((D,F,E=0)=>{const w=ID(($)=>{D.setTimeout(E-$,()=>{D.destroy(),F(Object.assign(new Error(`Connection timed out after ${E} ms`),{name:"TimeoutError"}))})},"registerTimeout");if(0<E&&E<6000)return w(0),0;return setTimeout(w.bind(null,E===0?0:TG),TG)},"setSocketTimeout"),NG=import.meta.require("stream"),KG=1000;ID(yf,"writeRequestBody");ID(qG,"writeBody");var dd=0,OG=class D{constructor(F){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((E,w)=>{if(typeof F==="function")F().then(($)=>{E(this.resolveDefaultConfig($))}).catch(w);else E(this.resolveDefaultConfig(F))})}static create(F){if(typeof(F==null?void 0:F.handle)==="function")return F;return new D(F)}static checkSocketUsage(F,E,w=console){var $,C,f;const{sockets:B,requests:h,maxSockets:U}=F;if(typeof U!=="number"||U===1/0)return E;const I=15000;if(Date.now()-I<E)return E;if(B&&h)for(let A in B){const Y=(($=B[A])==null?void 0:$.length)??0,M=((C=h[A])==null?void 0:C.length)??0;if(Y>=U&&M>=2*U)return(f=w==null?void 0:w.warn)==null||f.call(w,`@smithy/node-http-handler:WARN - socket usage at capacity=${Y} and ${M} additional requests are enqueued.
|
|
3
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
4
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return E}resolveDefaultConfig(F){const{requestTimeout:E,connectionTimeout:w,socketTimeout:$,httpAgent:C,httpsAgent:f}=F||{};return{connectionTimeout:w,requestTimeout:E??$,httpAgent:(()=>{if(C instanceof jf.Agent||typeof(C==null?void 0:C.destroy)==="function")return C;return new jf.Agent({keepAlive:!0,maxSockets:50,...C})})(),httpsAgent:(()=>{if(f instanceof Pf.Agent||typeof(f==null?void 0:f.destroy)==="function")return f;return new Pf.Agent({keepAlive:!0,maxSockets:50,...f})})(),logger:console}}destroy(){var F,E,w,$;(E=(F=this.config)==null?void 0:F.httpAgent)==null||E.destroy(),($=(w=this.config)==null?void 0:w.httpsAgent)==null||$.destroy()}async handle(F,{abortSignal:E}={}){if(!this.config)this.config=await this.configProvider;return new Promise((w,$)=>{let C=void 0;const f=[],B=ID(async(H)=>{await C,f.forEach(clearTimeout),w(H)},"resolve"),h=ID(async(H)=>{await C,f.forEach(clearTimeout),$(H)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(E==null?void 0:E.aborted){const H=new Error("Request aborted");H.name="AbortError",h(H);return}const U=F.protocol==="https:",I=U?this.config.httpsAgent:this.config.httpAgent;f.push(setTimeout(()=>{this.socketWarningTimestamp=D.checkSocketUsage(I,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));const A=RG.buildQueryString(F.query||{});let Y=void 0;if(F.username!=null||F.password!=null){const H=F.username??"",V=F.password??"";Y=`${H}:${V}`}let M=F.path;if(A)M+=`?${A}`;if(F.fragment)M+=`#${F.fragment}`;let Z=F.hostname??"";if(Z[0]==="["&&Z.endsWith("]"))Z=F.hostname.slice(1,-1);else Z=F.hostname;const z={headers:F.headers,host:Z,method:F.method,path:M,port:F.port,agent:I,auth:Y},J=(U?Pf.request:jf.request)(z,(H)=>{const V=new LG.HttpResponse({statusCode:H.statusCode||-1,reason:H.statusMessage,headers:VG(H.headers),body:H});B({response:V})});if(J.on("error",(H)=>{if(gd.includes(H.code))h(Object.assign(H,{name:"TimeoutError"}));else h(H)}),E){const H=ID(()=>{J.destroy();const V=new Error("Request aborted");V.name="AbortError",h(V)},"onAbort");if(typeof E.addEventListener==="function"){const V=E;V.addEventListener("abort",H,{once:!0}),J.once("close",()=>V.removeEventListener("abort",H))}else E.onabort=H}f.push(rd(J,h,this.config.connectionTimeout)),f.push(ud(J,h,this.config.requestTimeout));const K=z.agent;if(typeof K==="object"&&"keepAlive"in K)f.push(sd(J,{keepAlive:K.keepAlive,keepAliveMsecs:K.keepAliveMsecs}));C=yf(J,F,this.config.requestTimeout).catch((H)=>{return f.forEach(clearTimeout),$(H)})})}updateHttpClientConfig(F,E){this.config=void 0,this.configProvider=this.configProvider.then((w)=>{return{...w,[F]:E}})}httpHandlerConfigs(){return this.config??{}}};ID(OG,"NodeHttpHandler");var vd=OG,SG=import.meta.require("http2"),md=xd(import.meta.require("http2")),jG=class D{constructor(F){this.sessions=[],this.sessions=F??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(F){this.sessions.push(F)}contains(F){return this.sessions.includes(F)}remove(F){this.sessions=this.sessions.filter((E)=>E!==F)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(F){for(let E of this.sessions)if(E===F){if(!E.destroyed)E.destroy()}}};ID(jG,"NodeHttp2ConnectionPool");var nd=jG,PG=class D{constructor(F){if(this.sessionCache=new Map,this.config=F,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(F,E){const w=this.getUrlString(F),$=this.sessionCache.get(w);if($){const h=$.poll();if(h&&!this.config.disableConcurrency)return h}const C=md.default.connect(w);if(this.config.maxConcurrency)C.settings({maxConcurrentStreams:this.config.maxConcurrency},(h)=>{if(h)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+F.destination.toString())});C.unref();const f=ID(()=>{C.destroy(),this.deleteSession(w,C)},"destroySessionCb");if(C.on("goaway",f),C.on("error",f),C.on("frameError",f),C.on("close",()=>this.deleteSession(w,C)),E.requestTimeout)C.setTimeout(E.requestTimeout,f);const B=this.sessionCache.get(w)||new nd;return B.offerLast(C),this.sessionCache.set(w,B),C}deleteSession(F,E){const w=this.sessionCache.get(F);if(!w)return;if(!w.contains(E))return;w.remove(E),this.sessionCache.set(F,w)}release(F,E){var w;const $=this.getUrlString(F);(w=this.sessionCache.get($))==null||w.offerLast(E)}destroy(){for(let[F,E]of this.sessionCache){for(let w of E){if(!w.destroyed)w.destroy();E.remove(w)}this.sessionCache.delete(F)}}setMaxConcurrentStreams(F){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=F}setDisableConcurrentStreams(F){this.config.disableConcurrency=F}getUrlString(F){return F.destination.toString()}};ID(PG,"NodeHttp2ConnectionManager");var ld=PG,yG=class D{constructor(F){this.metadata={handlerProtocol:"h2"},this.connectionManager=new ld({}),this.configProvider=new Promise((E,w)=>{if(typeof F==="function")F().then(($)=>{E($||{})}).catch(w);else E(F||{})})}static create(F){if(typeof(F==null?void 0:F.handle)==="function")return F;return new D(F)}destroy(){this.connectionManager.destroy()}async handle(F,{abortSignal:E}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}const{requestTimeout:w,disableConcurrentStreams:$}=this.config;return new Promise((C,f)=>{var B;let h=!1,U=void 0;const I=ID(async(b)=>{await U,C(b)},"resolve"),A=ID(async(b)=>{await U,f(b)},"reject");if(E==null?void 0:E.aborted){h=!0;const b=new Error("Request aborted");b.name="AbortError",A(b);return}const{hostname:Y,method:M,port:Z,protocol:z,query:X}=F;let J="";if(F.username!=null||F.password!=null){const b=F.username??"",UD=F.password??"";J=`${b}:${UD}@`}const K=`${z}//${J}${Y}${Z?`:${Z}`:""}`,H={destination:new URL(K)},V=this.connectionManager.lease(H,{requestTimeout:(B=this.config)==null?void 0:B.sessionTimeout,disableConcurrentStreams:$||!1}),m=ID((b)=>{if($)this.destroySession(V);h=!0,A(b)},"rejectWithDestroy"),FD=RG.buildQueryString(X||{});let $D=F.path;if(FD)$D+=`?${FD}`;if(F.fragment)$D+=`#${F.fragment}`;const e=V.request({...F.headers,[SG.constants.HTTP2_HEADER_PATH]:$D,[SG.constants.HTTP2_HEADER_METHOD]:M});if(V.ref(),e.on("response",(b)=>{const UD=new LG.HttpResponse({statusCode:b[":status"]||-1,headers:VG(b),body:e});if(h=!0,I({response:UD}),$)V.close(),this.connectionManager.deleteSession(K,V)}),w)e.setTimeout(w,()=>{e.close();const b=new Error(`Stream timed out because of no activity for ${w} ms`);b.name="TimeoutError",m(b)});if(E){const b=ID(()=>{e.close();const UD=new Error("Request aborted");UD.name="AbortError",m(UD)},"onAbort");if(typeof E.addEventListener==="function"){const UD=E;UD.addEventListener("abort",b,{once:!0}),e.once("close",()=>UD.removeEventListener("abort",b))}else E.onabort=b}e.on("frameError",(b,UD,eD)=>{m(new Error(`Frame type id ${b} in stream id ${eD} has failed with code ${UD}.`))}),e.on("error",m),e.on("aborted",()=>{m(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${e.rstCode}.`))}),e.on("close",()=>{if(V.unref(),$)V.destroy();if(!h)m(new Error("Unexpected error: http2 request did not get a response"))}),U=yf(e,F,w)})}updateHttpClientConfig(F,E){this.config=void 0,this.configProvider=this.configProvider.then((w)=>{return{...w,[F]:E}})}httpHandlerConfigs(){return this.config??{}}destroySession(F){if(!F.destroyed)F.destroy()}};ID(yG,"NodeHttp2Handler");var id=yG,kG=class D extends NG.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(F,E,w){this.bufferedBytes.push(F),w()}};ID(kG,"Collector");var pd=kG,ad=ID((D)=>{if(od(D))return bG(D);return new Promise((F,E)=>{const w=new pd;D.pipe(w),D.on("error",($)=>{w.end(),E($)}),w.on("error",E),w.on("finish",function(){const $=new Uint8Array(Buffer.concat(this.bufferedBytes));F($)})})},"streamCollector"),od=ID((D)=>typeof ReadableStream==="function"&&D instanceof ReadableStream,"isReadableStreamInstance");ID(bG,"collectReadableStream")});var nG=W((FfD,mG)=>{function _G(D=0){return new Promise((F,E)=>{if(D)setTimeout(()=>{const w=new Error(`Request did not complete within ${D} ms`);w.name="TimeoutError",E(w)},D)})}async function uG(D){const F=await vG(D),E=Cv.fromBase64(F);return new Uint8Array(E)}async function dG(D){const F=[],E=D.getReader();let w=!1,$=0;while(!w){const{done:B,value:h}=await E.read();if(h)F.push(h),$+=h.length;w=B}const C=new Uint8Array($);let f=0;for(let B of F)C.set(B,f),f+=B.length;return C}function vG(D){return new Promise((F,E)=>{const w=new FileReader;w.onloadend=()=>{if(w.readyState!==2)return E(new Error("Reader aborted too early"));const $=w.result??"",C=$.indexOf(","),f=C>-1?C+1:$.length;F($.substring(f))},w.onabort=()=>E(new Error("Read aborted")),w.onerror=()=>E(w.error),w.readAsDataURL(D)})}var{defineProperty:fw,getOwnPropertyDescriptor:td,getOwnPropertyNames:ed}=Object,Dv=Object.prototype.hasOwnProperty,R1=(D,F)=>fw(D,"name",{value:F,configurable:!0}),Fv=(D,F)=>{for(var E in F)fw(D,E,{get:F[E],enumerable:!0})},Ev=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of ed(F))if(!Dv.call(D,$)&&$!==E)fw(D,$,{get:()=>F[$],enumerable:!(w=td(F,$))||w.enumerable})}return D},wv=(D)=>Ev(fw({},"__esModule",{value:!0}),D),rG={};Fv(rG,{FetchHttpHandler:()=>fv,keepAliveSupport:()=>$w,streamCollector:()=>Bv});mG.exports=wv(rG);var gG=H1(),$v=Of();R1(_G,"requestTimeout");var $w={supported:void 0},sG=class D{static create(F){if(typeof(F==null?void 0:F.handle)==="function")return F;return new D(F)}constructor(F){if(typeof F==="function")this.configProvider=F().then((E)=>E||{});else this.config=F??{},this.configProvider=Promise.resolve(this.config);if($w.supported===void 0)$w.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(F,{abortSignal:E}={}){var w;if(!this.config)this.config=await this.configProvider;const $=this.config.requestTimeout,C=this.config.keepAlive===!0,f=this.config.credentials;if(E==null?void 0:E.aborted){const K=new Error("Request aborted");return K.name="AbortError",Promise.reject(K)}let B=F.path;const h=$v.buildQueryString(F.query||{});if(h)B+=`?${h}`;if(F.fragment)B+=`#${F.fragment}`;let U="";if(F.username!=null||F.password!=null){const K=F.username??"",H=F.password??"";U=`${K}:${H}@`}const{port:I,method:A}=F,Y=`${F.protocol}//${U}${F.hostname}${I?`:${I}`:""}${B}`,M=A==="GET"||A==="HEAD"?void 0:F.body,Z={body:M,headers:new Headers(F.headers),method:A,credentials:f};if((w=this.config)==null?void 0:w.cache)Z.cache=this.config.cache;if(M)Z.duplex="half";if(typeof AbortController!=="undefined")Z.signal=E;if($w.supported)Z.keepalive=C;if(typeof this.config.requestInit==="function")Object.assign(Z,this.config.requestInit(F));let z=R1(()=>{},"removeSignalEventListener");const X=new Request(Y,Z),J=[fetch(X).then((K)=>{const H=K.headers,V={};for(let FD of H.entries())V[FD[0]]=FD[1];if(K.body==null)return K.blob().then((FD)=>({response:new gG.HttpResponse({headers:V,reason:K.statusText,statusCode:K.status,body:FD})}));return{response:new gG.HttpResponse({headers:V,reason:K.statusText,statusCode:K.status,body:K.body})}}),_G($)];if(E)J.push(new Promise((K,H)=>{const V=R1(()=>{const m=new Error("Request aborted");m.name="AbortError",H(m)},"onAbort");if(typeof E.addEventListener==="function"){const m=E;m.addEventListener("abort",V,{once:!0}),z=R1(()=>m.removeEventListener("abort",V),"removeSignalEventListener")}else E.onabort=V}));return Promise.race(J).finally(z)}updateHttpClientConfig(F,E){this.config=void 0,this.configProvider=this.configProvider.then((w)=>{return w[F]=E,w})}httpHandlerConfigs(){return this.config??{}}};R1(sG,"FetchHttpHandler");var fv=sG,Cv=Fw(),Bv=R1((D)=>{if(typeof Blob==="function"&&D instanceof Blob)return uG(D);return dG(D)},"streamCollector");R1(uG,"collectBlob");R1(dG,"collectStream");R1(vG,"readToBase64")});var L6=W((EfD,tG)=>{function aG(D){if(D.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const F=new Uint8Array(D.length/2);for(let E=0;E<D.length;E+=2){const w=D.slice(E,E+2).toLowerCase();if(w in kf)F[E/2]=kf[w];else throw new Error(`Cannot decode unrecognized sequence ${w} as hexadecimal`)}return F}function oG(D){let F="";for(let E=0;E<D.byteLength;E++)F+=pG[D[E]];return F}var{defineProperty:Cw,getOwnPropertyDescriptor:hv,getOwnPropertyNames:Uv}=Object,Av=Object.prototype.hasOwnProperty,lG=(D,F)=>Cw(D,"name",{value:F,configurable:!0}),Iv=(D,F)=>{for(var E in F)Cw(D,E,{get:F[E],enumerable:!0})},Mv=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Uv(F))if(!Av.call(D,$)&&$!==E)Cw(D,$,{get:()=>F[$],enumerable:!(w=hv(F,$))||w.enumerable})}return D},Gv=(D)=>Mv(Cw({},"__esModule",{value:!0}),D),iG={};Iv(iG,{fromHex:()=>aG,toHex:()=>oG});tG.exports=Gv(iG);var pG={},kf={};for(let D=0;D<256;D++){let F=D.toString(16).toLowerCase();if(F.length===1)F=`0${F}`;pG[D]=F,kf[F]=D}lG(aG,"fromHex");lG(oG,"toHex")});var mF=W((eG)=>{Object.defineProperty(eG,"__esModule",{value:!0});eG.isReadableStream=void 0;var Yv=(D)=>{var F;return typeof ReadableStream==="function"&&(((F=D===null||D===void 0?void 0:D.constructor)===null||F===void 0?void 0:F.name)===ReadableStream.name||D instanceof ReadableStream)};eG.isReadableStream=Yv});var CY=W(($Y)=>{Object.defineProperty($Y,"__esModule",{value:!0});$Y.sdkStreamMixin=void 0;var Zv=nG(),Wv=Fw(),Xv=L6(),Jv=f8(),FY=mF(),EY="The stream has already been transformed.",zv=(D)=>{var F,E;if(!wY(D)&&!FY.isReadableStream(D)){const f=((E=(F=D===null||D===void 0?void 0:D.__proto__)===null||F===void 0?void 0:F.constructor)===null||E===void 0?void 0:E.name)||D;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${f}`)}let w=!1;const $=async()=>{if(w)throw new Error(EY);return w=!0,await Zv.streamCollector(D)},C=(f)=>{if(typeof f.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return f.stream()};return Object.assign(D,{transformToByteArray:$,transformToString:async(f)=>{const B=await $();if(f==="base64")return Wv.toBase64(B);else if(f==="hex")return Xv.toHex(B);else if(f===void 0||f==="utf8"||f==="utf-8")return Jv.toUtf8(B);else if(typeof TextDecoder==="function")return new TextDecoder(f).decode(B);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(w)throw new Error(EY);if(w=!0,wY(D))return C(D);else if(FY.isReadableStream(D))return D;else throw new Error(`Cannot transform payload to web stream, got ${D}`)}})};$Y.sdkStreamMixin=zv;var wY=(D)=>typeof Blob==="function"&&D instanceof Blob});var AY=W((hY)=>{Object.defineProperty(hY,"__esModule",{value:!0});hY.sdkStreamMixin=void 0;var Tv=cG(),Kv=dF(),bf=import.meta.require("stream"),Sv=import.meta.require("util"),Qv=CY(),BY="The stream has already been transformed.",Hv=(D)=>{var F,E;if(!(D instanceof bf.Readable))try{return Qv.sdkStreamMixin(D)}catch(C){const f=((E=(F=D===null||D===void 0?void 0:D.__proto__)===null||F===void 0?void 0:F.constructor)===null||E===void 0?void 0:E.name)||D;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${f}`)}let w=!1;const $=async()=>{if(w)throw new Error(BY);return w=!0,await Tv.streamCollector(D)};return Object.assign(D,{transformToByteArray:$,transformToString:async(C)=>{const f=await $();if(C===void 0||Buffer.isEncoding(C))return Kv.fromArrayBuffer(f.buffer,f.byteOffset,f.byteLength).toString(C);else return new Sv.TextDecoder(C).decode(f)},transformToWebStream:()=>{if(w)throw new Error(BY);if(D.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof bf.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return w=!0,bf.Readable.toWeb(D)}})};hY.sdkStreamMixin=Hv});var GY=W((IY)=>{async function Lv(D){if(typeof D.stream==="function")D=D.stream();return D.tee()}Object.defineProperty(IY,"__esModule",{value:!0});IY.splitStream=void 0;IY.splitStream=Lv});var XY=W((ZY)=>{async function Nv(D){if(Vv.isReadableStream(D))return Rv.splitStream(D);const F=new YY.PassThrough,E=new YY.PassThrough;return D.pipe(F),D.pipe(E),[F,E]}Object.defineProperty(ZY,"__esModule",{value:!0});ZY.splitStream=void 0;var YY=import.meta.require("stream"),Rv=GY(),Vv=mF();ZY.splitStream=Nv});var TY=W((JY)=>{async function qv(D,F){var E;let w=0;const $=[],C=D.getReader();let f=!1;while(!f){const{done:U,value:I}=await C.read();if(I)$.push(I),w+=(E=I===null||I===void 0?void 0:I.byteLength)!==null&&E!==void 0?E:0;if(w>=F)break;f=U}C.releaseLock();const B=new Uint8Array(Math.min(F,w));let h=0;for(let U of $){if(U.byteLength>B.byteLength-h){B.set(U.subarray(0,B.byteLength-h),h);break}else B.set(U,h);h+=U.length}return B}Object.defineProperty(JY,"__esModule",{value:!0});JY.headStream=void 0;JY.headStream=qv});var HY=W((SY)=>{Object.defineProperty(SY,"__esModule",{value:!0});SY.headStream=void 0;var Ov=import.meta.require("stream"),jv=TY(),Pv=mF(),yv=(D,F)=>{if(Pv.isReadableStream(D))return jv.headStream(D,F);return new Promise((E,w)=>{const $=new KY;$.limit=F,D.pipe($),D.on("error",(C)=>{$.end(),w(C)}),$.on("error",w),$.on("finish",function(){const C=new Uint8Array(Buffer.concat(this.buffers));E(C)})})};SY.headStream=yv;class KY extends Ov.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=1/0,this.bytesBuffered=0}_write(D,F,E){var w;if(this.buffers.push(D),this.bytesBuffered+=(w=D.byteLength)!==null&&w!==void 0?w:0,this.bytesBuffered>=this.limit){const $=this.bytesBuffered-this.limit,C=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=C.subarray(0,C.byteLength-$),this.emit("finish")}E()}}});var OY=W((AfD,i8)=>{function VY(D,F="utf-8"){if(F==="base64")return LY.toBase64(D);return RY.toUtf8(D)}function NY(D,F){if(F==="base64")return cf.mutate(LY.fromBase64(D));return cf.mutate(RY.fromUtf8(D))}var{defineProperty:Bw,getOwnPropertyDescriptor:kv,getOwnPropertyNames:bv}=Object,xv=Object.prototype.hasOwnProperty,gf=(D,F)=>Bw(D,"name",{value:F,configurable:!0}),cv=(D,F)=>{for(var E in F)Bw(D,E,{get:F[E],enumerable:!0})},xf=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of bv(F))if(!xv.call(D,$)&&$!==E)Bw(D,$,{get:()=>F[$],enumerable:!(w=kv(F,$))||w.enumerable})}return D},nF=(D,F,E)=>(xf(D,F,"default"),E&&xf(E,F,"default")),gv=(D)=>xf(Bw({},"__esModule",{value:!0}),D),l8={};cv(l8,{Uint8ArrayBlobAdapter:()=>cf});i8.exports=gv(l8);var LY=Fw(),RY=f8();gf(VY,"transformToString");gf(NY,"transformFromString");var qY=class D extends Uint8Array{static fromString(F,E="utf-8"){switch(typeof F){case"string":return NY(F,E);default:throw new Error(`Unsupported conversion from ${typeof F} to Uint8ArrayBlobAdapter.`)}}static mutate(F){return Object.setPrototypeOf(F,D.prototype),F}transformToString(F="utf-8"){return VY(this,F)}};gf(qY,"Uint8ArrayBlobAdapter");var cf=qY;nF(l8,MG(),i8.exports);nF(l8,AY(),i8.exports);nF(l8,XY(),i8.exports);nF(l8,HY(),i8.exports);nF(l8,mF(),i8.exports)});var q6=W((IfD,DZ)=>{function dY(D){const F=D.getUTCFullYear(),E=D.getUTCMonth(),w=D.getUTCDay(),$=D.getUTCDate(),C=D.getUTCHours(),f=D.getUTCMinutes(),B=D.getUTCSeconds(),h=$<10?`0${$}`:`${$}`,U=C<10?`0${C}`:`${C}`,I=f<10?`0${f}`:`${f}`,A=B<10?`0${B}`:`${B}`;return`${Im[w]}, ${h} ${af[E]} ${F} ${U}:${I}:${A} GMT`}function Aw(D){return encodeURIComponent(D).replace(/[!'()*]/g,function(F){return"%"+F.charCodeAt(0).toString(16).toUpperCase()})}function of(D,F,E){let w,$,C;if(typeof F==="undefined"&&typeof E==="undefined")w={},C=D;else if(w=D,typeof F==="function")return $=F,C=E,nm(w,$,C);else C=F;for(let f of Object.keys(C)){if(!Array.isArray(C[f])){w[f]=C[f];continue}oY(w,null,C,f)}return w}function tY(D){if(D.includes(",")||D.includes('"'))D=`"${D.replace(/"/g,'\\"')}"`;return D}function eY(D,F,E){if(E<=0||!Number.isInteger(E))throw new Error("Invalid number of delimiters ("+E+") for splitEvery.");const w=D.split(F);if(E===1)return w;const $=[];let C="";for(let f=0;f<w.length;f++){if(C==="")C=w[f];else C+=F+w[f];if((f+1)%E===0)$.push(C),C=""}if(C!=="")$.push(C);return $}var{defineProperty:Iw,getOwnPropertyDescriptor:rv,getOwnPropertyNames:_v}=Object,sv=Object.prototype.hasOwnProperty,R=(D,F)=>Iw(D,"name",{value:F,configurable:!0}),uv=(D,F)=>{for(var E in F)Iw(D,E,{get:F[E],enumerable:!0})},dv=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of _v(F))if(!sv.call(D,$)&&$!==E)Iw(D,$,{get:()=>F[$],enumerable:!(w=rv(F,$))||w.enumerable})}return D},vv=(D)=>dv(Iw({},"__esModule",{value:!0}),D),PY={};uv(PY,{Client:()=>mv,Command:()=>xY,LazyJsonString:()=>um,NoOpLogger:()=>dm,SENSITIVE_STRING:()=>iv,ServiceException:()=>qm,StringWrapper:()=>oF,_json:()=>mf,collectBody:()=>nv,convertMap:()=>vm,createAggregatedClient:()=>pv,dateToUtcString:()=>dY,decorateServiceException:()=>mY,emitWarningIfUnsupportedVersion:()=>ym,expectBoolean:()=>ov,expectByte:()=>vf,expectFloat32:()=>hw,expectInt:()=>ev,expectInt32:()=>uf,expectLong:()=>pF,expectNonNull:()=>Fm,expectNumber:()=>iF,expectObject:()=>gY,expectShort:()=>df,expectString:()=>Em,expectUnion:()=>wm,extendedEncodeURIComponent:()=>Aw,getArrayIfSingleItem:()=>_m,getDefaultClientConfiguration:()=>gm,getDefaultExtensionConfiguration:()=>lY,getValueFromTextNode:()=>iY,handleFloat:()=>Cm,isSerializableHeaderValue:()=>sm,limitedParseDouble:()=>pf,limitedParseFloat:()=>Bm,limitedParseFloat32:()=>hm,loadConfigsForDefaultMode:()=>Pm,logger:()=>aF,map:()=>of,parseBoolean:()=>av,parseEpochTimestamp:()=>Tm,parseRfc3339DateTime:()=>Gm,parseRfc3339DateTimeWithOffset:()=>Zm,parseRfc7231DateTime:()=>zm,quoteHeader:()=>tY,resolveDefaultRuntimeConfig:()=>rm,resolvedPath:()=>pm,serializeDateTime:()=>om,serializeFloat:()=>am,splitEvery:()=>eY,splitHeader:()=>tm,strictParseByte:()=>uY,strictParseDouble:()=>lf,strictParseFloat:()=>$m,strictParseFloat32:()=>rY,strictParseInt:()=>Um,strictParseInt32:()=>Am,strictParseLong:()=>sY,strictParseShort:()=>R6,take:()=>mm,throwDefaultError:()=>nY,withBaseException:()=>Om});DZ.exports=vv(PY);var yY=nM(),kY=class D{constructor(F){this.config=F,this.middlewareStack=yY.constructStack()}send(F,E,w){const $=typeof E!=="function"?E:void 0,C=typeof E==="function"?E:w,f=$===void 0&&this.config.cacheMiddleware===!0;let B;if(f){if(!this.handlers)this.handlers=new WeakMap;const h=this.handlers;if(h.has(F.constructor))B=h.get(F.constructor);else B=F.resolveMiddleware(this.middlewareStack,this.config,$),h.set(F.constructor,B)}else delete this.handlers,B=F.resolveMiddleware(this.middlewareStack,this.config,$);if(C)B(F).then((h)=>C(null,h.output),(h)=>C(h)).catch(()=>{});else return B(F).then((h)=>h.output)}destroy(){var F,E,w;(w=(E=(F=this.config)==null?void 0:F.requestHandler)==null?void 0:E.destroy)==null||w.call(E),delete this.handlers}};R(kY,"Client");var mv=kY,rf=OY(),nv=R(async(D=new Uint8Array,F)=>{if(D instanceof Uint8Array)return rf.Uint8ArrayBlobAdapter.mutate(D);if(!D)return rf.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const E=F.streamCollector(D);return rf.Uint8ArrayBlobAdapter.mutate(await E)},"collectBody"),sf=J0(),bY=class D{constructor(){this.middlewareStack=yY.constructStack()}static classBuilder(){return new lv}resolveMiddlewareWithContext(F,E,w,{middlewareFn:$,clientName:C,commandName:f,inputFilterSensitiveLog:B,outputFilterSensitiveLog:h,smithyContext:U,additionalContext:I,CommandCtor:A}){for(let X of $.bind(this)(A,F,E,w))this.middlewareStack.use(X);const Y=F.concat(this.middlewareStack),{logger:M}=E,Z={logger:M,clientName:C,commandName:f,inputFilterSensitiveLog:B,outputFilterSensitiveLog:h,[sf.SMITHY_CONTEXT_KEY]:{commandInstance:this,...U},...I},{requestHandler:z}=E;return Y.resolve((X)=>z.handle(X.request,w||{}),Z)}};R(bY,"Command");var xY=bY,cY=class D{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(F)=>F,this._outputFilterSensitiveLog=(F)=>F,this._serializer=null,this._deserializer=null}init(F){this._init=F}ep(F){return this._ep=F,this}m(F){return this._middlewareFn=F,this}s(F,E,w={}){return this._smithyContext={service:F,operation:E,...w},this}c(F={}){return this._additionalContext=F,this}n(F,E){return this._clientName=F,this._commandName=E,this}f(F=(w)=>w,E=(w)=>w){return this._inputFilterSensitiveLog=F,this._outputFilterSensitiveLog=E,this}ser(F){return this._serializer=F,this}de(F){return this._deserializer=F,this}build(){var F;const E=this;let w;return w=(F=class extends xY{constructor(...[$]){super();this.serialize=E._serializer,this.deserialize=E._deserializer,this.input=$??{},E._init(this)}static getEndpointParameterInstructions(){return E._ep}resolveMiddleware($,C,f){return this.resolveMiddlewareWithContext($,C,f,{CommandCtor:w,middlewareFn:E._middlewareFn,clientName:E._clientName,commandName:E._commandName,inputFilterSensitiveLog:E._inputFilterSensitiveLog,outputFilterSensitiveLog:E._outputFilterSensitiveLog,smithyContext:E._smithyContext,additionalContext:E._additionalContext})}},R(F,"CommandRef"),F)}};R(cY,"ClassBuilder");var lv=cY,iv="***SensitiveInformation***",pv=R((D,F)=>{for(let E of Object.keys(D)){const w=D[E],$=R(async function(f,B,h){const U=new w(f);if(typeof B==="function")this.send(U,B);else if(typeof h==="function"){if(typeof B!=="object")throw new Error(`Expected http options but got ${typeof B}`);this.send(U,B||{},h)}else return this.send(U,B)},"methodImpl"),C=(E[0].toLowerCase()+E.slice(1)).replace(/Command$/,"");F.prototype[C]=$}},"createAggregatedClient"),av=R((D)=>{switch(D){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${D}"`)}},"parseBoolean"),ov=R((D)=>{if(D===null||D===void 0)return;if(typeof D==="number"){if(D===0||D===1)aF.warn(Uw(`Expected boolean, got ${typeof D}: ${D}`));if(D===0)return!1;if(D===1)return!0}if(typeof D==="string"){const F=D.toLowerCase();if(F==="false"||F==="true")aF.warn(Uw(`Expected boolean, got ${typeof D}: ${D}`));if(F==="false")return!1;if(F==="true")return!0}if(typeof D==="boolean")return D;throw new TypeError(`Expected boolean, got ${typeof D}: ${D}`)},"expectBoolean"),iF=R((D)=>{if(D===null||D===void 0)return;if(typeof D==="string"){const F=parseFloat(D);if(!Number.isNaN(F)){if(String(F)!==String(D))aF.warn(Uw(`Expected number but observed string: ${D}`));return F}}if(typeof D==="number")return D;throw new TypeError(`Expected number, got ${typeof D}: ${D}`)},"expectNumber"),tv=Math.ceil(340282346638528860000000000000000000000),hw=R((D)=>{const F=iF(D);if(F!==void 0&&!Number.isNaN(F)&&F!==1/0&&F!==-1/0){if(Math.abs(F)>tv)throw new TypeError(`Expected 32-bit float, got ${D}`)}return F},"expectFloat32"),pF=R((D)=>{if(D===null||D===void 0)return;if(Number.isInteger(D)&&!Number.isNaN(D))return D;throw new TypeError(`Expected integer, got ${typeof D}: ${D}`)},"expectLong"),ev=pF,uf=R((D)=>nf(D,32),"expectInt32"),df=R((D)=>nf(D,16),"expectShort"),vf=R((D)=>nf(D,8),"expectByte"),nf=R((D,F)=>{const E=pF(D);if(E!==void 0&&Dm(E,F)!==E)throw new TypeError(`Expected ${F}-bit integer, got ${D}`);return E},"expectSizedInt"),Dm=R((D,F)=>{switch(F){case 32:return Int32Array.of(D)[0];case 16:return Int16Array.of(D)[0];case 8:return Int8Array.of(D)[0]}},"castInt"),Fm=R((D,F)=>{if(D===null||D===void 0){if(F)throw new TypeError(`Expected a non-null value for ${F}`);throw new TypeError("Expected a non-null value")}return D},"expectNonNull"),gY=R((D)=>{if(D===null||D===void 0)return;if(typeof D==="object"&&!Array.isArray(D))return D;const F=Array.isArray(D)?"array":typeof D;throw new TypeError(`Expected object, got ${F}: ${D}`)},"expectObject"),Em=R((D)=>{if(D===null||D===void 0)return;if(typeof D==="string")return D;if(["boolean","number","bigint"].includes(typeof D))return aF.warn(Uw(`Expected string, got ${typeof D}: ${D}`)),String(D);throw new TypeError(`Expected string, got ${typeof D}: ${D}`)},"expectString"),wm=R((D)=>{if(D===null||D===void 0)return;const F=gY(D),E=Object.entries(F).filter(([,w])=>w!=null).map(([w])=>w);if(E.length===0)throw new TypeError("Unions must have exactly one non-null member. None were found.");if(E.length>1)throw new TypeError(`Unions must have exactly one non-null member. Keys ${E} were not null.`);return F},"expectUnion"),lf=R((D)=>{if(typeof D=="string")return iF(N6(D));return iF(D)},"strictParseDouble"),$m=lf,rY=R((D)=>{if(typeof D=="string")return hw(N6(D));return hw(D)},"strictParseFloat32"),fm=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,N6=R((D)=>{const F=D.match(fm);if(F===null||F[0].length!==D.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(D)},"parseNumber"),pf=R((D)=>{if(typeof D=="string")return _Y(D);return iF(D)},"limitedParseDouble"),Cm=pf,Bm=pf,hm=R((D)=>{if(typeof D=="string")return _Y(D);return hw(D)},"limitedParseFloat32"),_Y=R((D)=>{switch(D){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${D}`)}},"parseFloatString"),sY=R((D)=>{if(typeof D==="string")return pF(N6(D));return pF(D)},"strictParseLong"),Um=sY,Am=R((D)=>{if(typeof D==="string")return uf(N6(D));return uf(D)},"strictParseInt32"),R6=R((D)=>{if(typeof D==="string")return df(N6(D));return df(D)},"strictParseShort"),uY=R((D)=>{if(typeof D==="string")return vf(N6(D));return vf(D)},"strictParseByte"),Uw=R((D)=>{return String(new TypeError(D).stack||D).split("\n").slice(0,5).filter((F)=>!F.includes("stackTraceWarning")).join("\n")},"stackTraceWarning"),aF={warn:console.warn},Im=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],af=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];R(dY,"dateToUtcString");var Mm=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),Gm=R((D)=>{if(D===null||D===void 0)return;if(typeof D!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const F=Mm.exec(D);if(!F)throw new TypeError("Invalid RFC-3339 date-time value");const[E,w,$,C,f,B,h,U]=F,I=R6(V6(w)),A=c2($,"month",1,12),Y=c2(C,"day",1,31);return lF(I,A,Y,{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U})},"parseRfc3339DateTime"),Ym=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),Zm=R((D)=>{if(D===null||D===void 0)return;if(typeof D!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const F=Ym.exec(D);if(!F)throw new TypeError("Invalid RFC-3339 date-time value");const[E,w,$,C,f,B,h,U,I]=F,A=R6(V6(w)),Y=c2($,"month",1,12),M=c2(C,"day",1,31),Z=lF(A,Y,M,{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U});if(I.toUpperCase()!="Z")Z.setTime(Z.getTime()-Nm(I));return Z},"parseRfc3339DateTimeWithOffset"),Wm=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Xm=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Jm=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),zm=R((D)=>{if(D===null||D===void 0)return;if(typeof D!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let F=Wm.exec(D);if(F){const[E,w,$,C,f,B,h,U]=F;return lF(R6(V6(C)),_f($),c2(w,"day",1,31),{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U})}if(F=Xm.exec(D),F){const[E,w,$,C,f,B,h,U]=F;return Qm(lF(Km(C),_f($),c2(w,"day",1,31),{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U}))}if(F=Jm.exec(D),F){const[E,w,$,C,f,B,h,U]=F;return lF(R6(V6(U)),_f(w),c2($.trimLeft(),"day",1,31),{hours:C,minutes:f,seconds:B,fractionalMilliseconds:h})}throw new TypeError("Invalid RFC-7231 date-time value")},"parseRfc7231DateTime"),Tm=R((D)=>{if(D===null||D===void 0)return;let F;if(typeof D==="number")F=D;else if(typeof D==="string")F=lf(D);else if(typeof D==="object"&&D.tag===1)F=D.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(F)||F===1/0||F===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(F*1000))},"parseEpochTimestamp"),lF=R((D,F,E,w)=>{const $=F-1;return Lm(D,$,E),new Date(Date.UTC(D,$,E,c2(w.hours,"hour",0,23),c2(w.minutes,"minute",0,59),c2(w.seconds,"seconds",0,60),Vm(w.fractionalMilliseconds)))},"buildDate"),Km=R((D)=>{const F=new Date().getUTCFullYear(),E=Math.floor(F/100)*100+R6(V6(D));if(E<F)return E+100;return E},"parseTwoDigitYear"),Sm=1576800000000,Qm=R((D)=>{if(D.getTime()-new Date().getTime()>Sm)return new Date(Date.UTC(D.getUTCFullYear()-100,D.getUTCMonth(),D.getUTCDate(),D.getUTCHours(),D.getUTCMinutes(),D.getUTCSeconds(),D.getUTCMilliseconds()));return D},"adjustRfc850Year"),_f=R((D)=>{const F=af.indexOf(D);if(F<0)throw new TypeError(`Invalid month: ${D}`);return F+1},"parseMonthByShortName"),Hm=[31,28,31,30,31,30,31,31,30,31,30,31],Lm=R((D,F,E)=>{let w=Hm[F];if(F===1&&Rm(D))w=29;if(E>w)throw new TypeError(`Invalid day for ${af[F]} in ${D}: ${E}`)},"validateDayOfMonth"),Rm=R((D)=>{return D%4===0&&(D%100!==0||D%400===0)},"isLeapYear"),c2=R((D,F,E,w)=>{const $=uY(V6(D));if($<E||$>w)throw new TypeError(`${F} must be between ${E} and ${w}, inclusive`);return $},"parseDateValue"),Vm=R((D)=>{if(D===null||D===void 0)return 0;return rY("0."+D)*1000},"parseMilliseconds"),Nm=R((D)=>{const F=D[0];let E=1;if(F=="+")E=1;else if(F=="-")E=-1;else throw new TypeError(`Offset direction, ${F}, must be "+" or "-"`);const w=Number(D.substring(1,3)),$=Number(D.substring(4,6));return E*(w*60+$)*60*1000},"parseOffsetToMilliseconds"),V6=R((D)=>{let F=0;while(F<D.length-1&&D.charAt(F)==="0")F++;if(F===0)return D;return D.slice(F)},"stripLeadingZeroes"),vY=class D extends Error{constructor(F){super(F.message);Object.setPrototypeOf(this,D.prototype),this.name=F.name,this.$fault=F.$fault,this.$metadata=F.$metadata}};R(vY,"ServiceException");var qm=vY,mY=R((D,F={})=>{Object.entries(F).filter(([,w])=>w!==void 0).forEach(([w,$])=>{if(D[w]==null||D[w]==="")D[w]=$});const E=D.message||D.Message||"UnknownError";return D.message=E,delete D.Message,D},"decorateServiceException"),nY=R(({output:D,parsedBody:F,exceptionCtor:E,errorCode:w})=>{const $=jm(D),C=$.httpStatusCode?$.httpStatusCode+"":void 0,f=new E({name:(F==null?void 0:F.code)||(F==null?void 0:F.Code)||w||C||"UnknownError",$fault:"client",$metadata:$});throw mY(f,F)},"throwDefaultError"),Om=R((D)=>{return({output:F,parsedBody:E,errorCode:w})=>{nY({output:F,parsedBody:E,exceptionCtor:D,errorCode:w})}},"withBaseException"),jm=R((D)=>({httpStatusCode:D.statusCode,requestId:D.headers["x-amzn-requestid"]??D.headers["x-amzn-request-id"]??D.headers["x-amz-request-id"],extendedRequestId:D.headers["x-amz-id-2"],cfId:D.headers["x-amz-cf-id"]}),"deserializeMetadata"),Pm=R((D)=>{switch(D){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}},"loadConfigsForDefaultMode"),jY=!1,ym=R((D)=>{if(D&&!jY&&parseInt(D.substring(1,D.indexOf(".")))<16)jY=!0},"emitWarningIfUnsupportedVersion");R(Aw,"extendedEncodeURIComponent");var km=R((D)=>{const F=[];for(let E in sf.AlgorithmId){const w=sf.AlgorithmId[E];if(D[w]===void 0)continue;F.push({algorithmId:()=>w,checksumConstructor:()=>D[w]})}return{_checksumAlgorithms:F,addChecksumAlgorithm(E){this._checksumAlgorithms.push(E)},checksumAlgorithms(){return this._checksumAlgorithms}}},"getChecksumConfiguration"),bm=R((D)=>{const F={};return D.checksumAlgorithms().forEach((E)=>{F[E.algorithmId()]=E.checksumConstructor()}),F},"resolveChecksumRuntimeConfig"),xm=R((D)=>{let F=D.retryStrategy;return{setRetryStrategy(E){F=E},retryStrategy(){return F}}},"getRetryConfiguration"),cm=R((D)=>{const F={};return F.retryStrategy=D.retryStrategy(),F},"resolveRetryRuntimeConfig"),lY=R((D)=>{return{...km(D),...xm(D)}},"getDefaultExtensionConfiguration"),gm=lY,rm=R((D)=>{return{...bm(D),...cm(D)}},"resolveDefaultRuntimeConfig"),_m=R((D)=>Array.isArray(D)?D:[D],"getArrayIfSingleItem"),iY=R((D)=>{for(let E in D)if(D.hasOwnProperty(E)&&D[E]["#text"]!==void 0)D[E]=D[E]["#text"];else if(typeof D[E]==="object"&&D[E]!==null)D[E]=iY(D[E]);return D},"getValueFromTextNode"),sm=R((D)=>{return D!=null},"isSerializableHeaderValue"),oF=R(function(){const D=Object.getPrototypeOf(this).constructor,E=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(E,D.prototype),E},"StringWrapper");oF.prototype=Object.create(String.prototype,{constructor:{value:oF,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(oF,String);var pY=class D extends oF{deserializeJSON(){return JSON.parse(super.toString())}toJSON(){return super.toString()}static fromObject(F){if(F instanceof D)return F;else if(F instanceof String||typeof F==="string")return new D(F);return new D(JSON.stringify(F))}};R(pY,"LazyJsonString");var um=pY,aY=class D{trace(){}debug(){}info(){}warn(){}error(){}};R(aY,"NoOpLogger");var dm=aY;R(of,"map");var vm=R((D)=>{const F={};for(let[E,w]of Object.entries(D||{}))F[E]=[,w];return F},"convertMap"),mm=R((D,F)=>{const E={};for(let w in F)oY(E,D,F,w);return E},"take"),nm=R((D,F,E)=>{return of(D,Object.entries(E).reduce((w,[$,C])=>{if(Array.isArray(C))w[$]=C;else if(typeof C==="function")w[$]=[F,C()];else w[$]=[F,C];return w},{}))},"mapWithFilter"),oY=R((D,F,E,w)=>{if(F!==null){let f=E[w];if(typeof f==="function")f=[,f];const[B=lm,h=im,U=w]=f;if(typeof B==="function"&&B(F[U])||typeof B!=="function"&&!!B)D[w]=h(F[U]);return}let[$,C]=E[w];if(typeof C==="function"){let f;const B=$===void 0&&(f=C())!=null,h=typeof $==="function"&&!!$(void 0)||typeof $!=="function"&&!!$;if(B)D[w]=f;else if(h)D[w]=C()}else{const f=$===void 0&&C!=null,B=typeof $==="function"&&!!$(C)||typeof $!=="function"&&!!$;if(f||B)D[w]=C}},"applyInstruction"),lm=R((D)=>D!=null,"nonNullish"),im=R((D)=>D,"pass");R(tY,"quoteHeader");var pm=R((D,F,E,w,$,C)=>{if(F!=null&&F[E]!==void 0){const f=w();if(f.length<=0)throw new Error("Empty value provided for input HTTP label: "+E+".");D=D.replace($,C?f.split("/").map((B)=>Aw(B)).join("/"):Aw(f))}else throw new Error("No value provided for input HTTP label: "+E+".");return D},"resolvedPath"),am=R((D)=>{if(D!==D)return"NaN";switch(D){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return D}},"serializeFloat"),om=R((D)=>D.toISOString().replace(".000Z","Z"),"serializeDateTime"),mf=R((D)=>{if(D==null)return{};if(Array.isArray(D))return D.filter((F)=>F!=null).map(mf);if(typeof D==="object"){const F={};for(let E of Object.keys(D)){if(D[E]==null)continue;F[E]=mf(D[E])}return F}return D},"_json");R(eY,"splitEvery");var tm=R((D)=>{const F=D.length,E=[];let w=!1,$=void 0,C=0;for(let f=0;f<F;++f){const B=D[f];switch(B){case'"':if($!=="\\")w=!w;break;case",":if(!w)E.push(D.slice(C,f)),C=f+1;break;default:}$=B}return E.push(D.slice(C)),E.map((f)=>{f=f.trim();const B=f.length;if(B<2)return f;if(f[0]==='"'&&f[B-1]==='"')f=f.slice(1,B-1);return f.replace(/\\"/g,'"')})},"splitHeader")});var wZ=W((FZ)=>{Object.defineProperty(FZ,"__esModule",{value:!0});FZ.isStreamingPayload=void 0;var em=import.meta.require("stream"),Dn=(D)=>(D===null||D===void 0?void 0:D.body)instanceof em.Readable||typeof ReadableStream!=="undefined"&&(D===null||D===void 0?void 0:D.body)instanceof ReadableStream;FZ.isStreamingPayload=Dn});var KZ=W((YfD,TZ)=>{var{defineProperty:Mw,getOwnPropertyDescriptor:Fn,getOwnPropertyNames:En}=Object,wn=Object.prototype.hasOwnProperty,xD=(D,F)=>Mw(D,"name",{value:F,configurable:!0}),$n=(D,F)=>{for(var E in F)Mw(D,E,{get:F[E],enumerable:!0})},fn=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of En(F))if(!wn.call(D,$)&&$!==E)Mw(D,$,{get:()=>F[$],enumerable:!(w=Fn(F,$))||w.enumerable})}return D},Cn=(D)=>fn(Mw({},"__esModule",{value:!0}),D),fZ={};$n(fZ,{AdaptiveRetryStrategy:()=>Un,CONFIG_MAX_ATTEMPTS:()=>ef,CONFIG_RETRY_MODE:()=>YZ,ENV_MAX_ATTEMPTS:()=>tf,ENV_RETRY_MODE:()=>GZ,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>An,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>Mn,StandardRetryStrategy:()=>IZ,defaultDelayDecider:()=>BZ,defaultRetryDecider:()=>hZ,getOmitRetryHeadersPlugin:()=>Gn,getRetryAfterHint:()=>zZ,getRetryPlugin:()=>zn,omitRetryHeadersMiddleware:()=>ZZ,omitRetryHeadersMiddlewareOptions:()=>WZ,resolveRetryConfig:()=>In,retryMiddleware:()=>XZ,retryMiddlewareOptions:()=>JZ});TZ.exports=Cn(fZ);var O6=H1(),CZ=Zf(),HD=sM(),Bn=xD((D,F)=>{const E=D,w=(F==null?void 0:F.noRetryIncrement)??HD.NO_RETRY_INCREMENT,$=(F==null?void 0:F.retryCost)??HD.RETRY_COST,C=(F==null?void 0:F.timeoutRetryCost)??HD.TIMEOUT_RETRY_COST;let f=D;const B=xD((A)=>A.name==="TimeoutError"?C:$,"getCapacityAmount"),h=xD((A)=>B(A)<=f,"hasRetryTokens");return Object.freeze({hasRetryTokens:h,retrieveRetryTokens:xD((A)=>{if(!h(A))throw new Error("No retry token available");const Y=B(A);return f-=Y,Y},"retrieveRetryTokens"),releaseRetryTokens:xD((A)=>{f+=A??w,f=Math.min(f,E)},"releaseRetryTokens")})},"getDefaultRetryQuota"),BZ=xD((D,F)=>Math.floor(Math.min(HD.MAXIMUM_RETRY_DELAY,Math.random()*2**F*D)),"defaultDelayDecider"),C8=Wf(),hZ=xD((D)=>{if(!D)return!1;return C8.isRetryableByTrait(D)||C8.isClockSkewError(D)||C8.isThrottlingError(D)||C8.isTransientError(D)},"defaultRetryDecider"),UZ=xD((D)=>{if(D instanceof Error)return D;if(D instanceof Object)return Object.assign(new Error,D);if(typeof D==="string")return new Error(D);return new Error(`AWS SDK error wrapper for ${D}`)},"asSdkError"),AZ=class D{constructor(F,E){this.maxAttemptsProvider=F,this.mode=HD.RETRY_MODES.STANDARD,this.retryDecider=(E==null?void 0:E.retryDecider)??hZ,this.delayDecider=(E==null?void 0:E.delayDecider)??BZ,this.retryQuota=(E==null?void 0:E.retryQuota)??Bn(HD.INITIAL_RETRY_TOKENS)}shouldRetry(F,E,w){return E<w&&this.retryDecider(F)&&this.retryQuota.hasRetryTokens(F)}async getMaxAttempts(){let F;try{F=await this.maxAttemptsProvider()}catch(E){F=HD.DEFAULT_MAX_ATTEMPTS}return F}async retry(F,E,w){let $,C=0,f=0;const B=await this.getMaxAttempts(),{request:h}=E;if(O6.HttpRequest.isInstance(h))h.headers[HD.INVOCATION_ID_HEADER]=CZ.v4();while(!0)try{if(O6.HttpRequest.isInstance(h))h.headers[HD.REQUEST_HEADER]=`attempt=${C+1}; max=${B}`;if(w==null?void 0:w.beforeRequest)await w.beforeRequest();const{response:U,output:I}=await F(E);if(w==null?void 0:w.afterRequest)w.afterRequest(U);return this.retryQuota.releaseRetryTokens($),I.$metadata.attempts=C+1,I.$metadata.totalRetryDelay=f,{response:U,output:I}}catch(U){const I=UZ(U);if(C++,this.shouldRetry(I,C,B)){$=this.retryQuota.retrieveRetryTokens(I);const A=this.delayDecider(C8.isThrottlingError(I)?HD.THROTTLING_RETRY_DELAY_BASE:HD.DEFAULT_RETRY_DELAY_BASE,C),Y=hn(I.$response),M=Math.max(Y||0,A);f+=M,await new Promise((Z)=>setTimeout(Z,M));continue}if(!I.$metadata)I.$metadata={};throw I.$metadata.attempts=C,I.$metadata.totalRetryDelay=f,I}}};xD(AZ,"StandardRetryStrategy");var IZ=AZ,hn=xD((D)=>{if(!O6.HttpResponse.isInstance(D))return;const F=Object.keys(D.headers).find((C)=>C.toLowerCase()==="retry-after");if(!F)return;const E=D.headers[F],w=Number(E);if(!Number.isNaN(w))return w*1000;return new Date(E).getTime()-Date.now()},"getDelayFromRetryAfterHeader"),MZ=class D extends IZ{constructor(F,E){const{rateLimiter:w,...$}=E??{};super(F,$);this.rateLimiter=w??new HD.DefaultRateLimiter,this.mode=HD.RETRY_MODES.ADAPTIVE}async retry(F,E){return super.retry(F,E,{beforeRequest:async()=>{return this.rateLimiter.getSendToken()},afterRequest:(w)=>{this.rateLimiter.updateClientSendingRate(w)}})}};xD(MZ,"AdaptiveRetryStrategy");var Un=MZ,$Z=xF(),tf="AWS_MAX_ATTEMPTS",ef="max_attempts",An={environmentVariableSelector:(D)=>{const F=D[tf];if(!F)return;const E=parseInt(F);if(Number.isNaN(E))throw new Error(`Environment variable ${tf} mast be a number, got "${F}"`);return E},configFileSelector:(D)=>{const F=D[ef];if(!F)return;const E=parseInt(F);if(Number.isNaN(E))throw new Error(`Shared config file entry ${ef} mast be a number, got "${F}"`);return E},default:HD.DEFAULT_MAX_ATTEMPTS},In=xD((D)=>{const{retryStrategy:F}=D,E=$Z.normalizeProvider(D.maxAttempts??HD.DEFAULT_MAX_ATTEMPTS);return{...D,maxAttempts:E,retryStrategy:async()=>{if(F)return F;if(await $Z.normalizeProvider(D.retryMode)()===HD.RETRY_MODES.ADAPTIVE)return new HD.AdaptiveRetryStrategy(E);return new HD.StandardRetryStrategy(E)}}},"resolveRetryConfig"),GZ="AWS_RETRY_MODE",YZ="retry_mode",Mn={environmentVariableSelector:(D)=>D[GZ],configFileSelector:(D)=>D[YZ],default:HD.DEFAULT_RETRY_MODE},ZZ=xD(()=>(D)=>async(F)=>{const{request:E}=F;if(O6.HttpRequest.isInstance(E))delete E.headers[HD.INVOCATION_ID_HEADER],delete E.headers[HD.REQUEST_HEADER];return D(F)},"omitRetryHeadersMiddleware"),WZ={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},Gn=xD((D)=>({applyToStack:(F)=>{F.addRelativeTo(ZZ(),WZ)}}),"getOmitRetryHeadersPlugin"),Yn=q6(),Zn=wZ(),XZ=xD((D)=>(F,E)=>async(w)=>{var $;let C=await D.retryStrategy();const f=await D.maxAttempts();if(Wn(C)){C=C;let B=await C.acquireInitialRetryToken(E.partition_id),h=new Error,U=0,I=0;const{request:A}=w,Y=O6.HttpRequest.isInstance(A);if(Y)A.headers[HD.INVOCATION_ID_HEADER]=CZ.v4();while(!0)try{if(Y)A.headers[HD.REQUEST_HEADER]=`attempt=${U+1}; max=${f}`;const{response:M,output:Z}=await F(w);return C.recordSuccess(B),Z.$metadata.attempts=U+1,Z.$metadata.totalRetryDelay=I,{response:M,output:Z}}catch(M){const Z=Xn(M);if(h=UZ(M),Y&&Zn.isStreamingPayload(A))throw($=E.logger instanceof Yn.NoOpLogger?console:E.logger)==null||$.warn("An error was encountered in a non-retryable streaming request."),h;try{B=await C.refreshRetryTokenForRetry(B,Z)}catch(X){if(!h.$metadata)h.$metadata={};throw h.$metadata.attempts=U+1,h.$metadata.totalRetryDelay=I,h}U=B.getRetryCount();const z=B.getRetryDelay();I+=z,await new Promise((X)=>setTimeout(X,z))}}else{if(C=C,C==null?void 0:C.mode)E.userAgent=[...E.userAgent||[],["cfg/retry-mode",C.mode]];return C.retry(F,w)}},"retryMiddleware"),Wn=xD((D)=>typeof D.acquireInitialRetryToken!=="undefined"&&typeof D.refreshRetryTokenForRetry!=="undefined"&&typeof D.recordSuccess!=="undefined","isRetryStrategyV2"),Xn=xD((D)=>{const F={error:D,errorType:Jn(D)},E=zZ(D.$response);if(E)F.retryAfterHint=E;return F},"getRetryErrorInfo"),Jn=xD((D)=>{if(C8.isThrottlingError(D))return"THROTTLING";if(C8.isTransientError(D))return"TRANSIENT";if(C8.isServerError(D))return"SERVER_ERROR";return"CLIENT_ERROR"},"getRetryErrorType"),JZ={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},zn=xD((D)=>({applyToStack:(F)=>{F.add(XZ(D),JZ)}}),"getRetryPlugin"),zZ=xD((D)=>{if(!O6.HttpResponse.isInstance(D))return;const F=Object.keys(D.headers).find((C)=>C.toLowerCase()==="retry-after");if(!F)return;const E=D.headers[F],w=Number(E);if(!Number.isNaN(w))return new Date(w*1000);return new Date(E)},"getRetryAfterHint")});var _D=W((ZfD,_Z)=>{function HZ(D){const F=new Map;for(let E of D)F.set(E.schemeId,E);return F}function xZ(D,F){return new gZ(D,F)}function rZ(D,F,E,w,$){return JD(async function*C(f,B,...h){let U=f.startingToken||void 0,I=!0,A;while(I){if(B[E]=U,$)B[$]=B[$]??f.pageSize;if(f.client instanceof D)A=await dn(F,f.client,B,...h);else throw new Error(`Invalid client, expected instance of ${D.name}`);yield A;const Y=U;U=vn(A,w),I=!!(U&&(!f.stopOnSameToken||U!==Y))}return},"paginateOperation")}var{defineProperty:Yw,getOwnPropertyDescriptor:Tn,getOwnPropertyNames:Kn}=Object,Sn=Object.prototype.hasOwnProperty,JD=(D,F)=>Yw(D,"name",{value:F,configurable:!0}),Qn=(D,F)=>{for(var E in F)Yw(D,E,{get:F[E],enumerable:!0})},Hn=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Kn(F))if(!Sn.call(D,$)&&$!==E)Yw(D,$,{get:()=>F[$],enumerable:!(w=Tn(F,$))||w.enumerable})}return D},Ln=(D)=>Hn(Yw({},"__esModule",{value:!0}),D),SZ={};Qn(SZ,{DefaultIdentityProviderConfig:()=>kn,EXPIRATION_MS:()=>kZ,HttpApiKeyAuthSigner:()=>bn,HttpBearerAuthSigner:()=>xn,NoAuthSigner:()=>cn,RequestBuilder:()=>gZ,createIsIdentityExpiredFunction:()=>yZ,createPaginator:()=>rZ,doesIdentityRequireRefresh:()=>bZ,getHttpAuthSchemeEndpointRuleSetPlugin:()=>Vn,getHttpAuthSchemePlugin:()=>qn,getHttpSigningPlugin:()=>yn,getSmithyContext:()=>_n,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>LZ,httpAuthSchemeMiddleware:()=>D9,httpAuthSchemeMiddlewareOptions:()=>RZ,httpSigningMiddleware:()=>VZ,httpSigningMiddlewareOptions:()=>NZ,isIdentityExpired:()=>gn,memoizeIdentityProvider:()=>rn,normalizeProvider:()=>sn,requestBuilder:()=>xZ});_Z.exports=Ln(SZ);var QZ=xF();JD(HZ,"convertHttpAuthSchemesToMap");var D9=JD((D,F)=>(E,w)=>async($)=>{var C;const f=D.httpAuthSchemeProvider(await F.httpAuthSchemeParametersProvider(D,w,$.input)),B=HZ(D.httpAuthSchemes),h=QZ.getSmithyContext(w),U=[];for(let I of f){const A=B.get(I.schemeId);if(!A){U.push(`HttpAuthScheme \`${I.schemeId}\` was not enabled for this service.`);continue}const Y=A.identityProvider(await F.identityProviderConfigProvider(D));if(!Y){U.push(`HttpAuthScheme \`${I.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:M={},signingProperties:Z={}}=((C=I.propertiesExtractor)==null?void 0:C.call(I,D,w))||{};I.identityProperties=Object.assign(I.identityProperties||{},M),I.signingProperties=Object.assign(I.signingProperties||{},Z),h.selectedHttpAuthScheme={httpAuthOption:I,identity:await Y(I.identityProperties),signer:A.signer};break}if(!h.selectedHttpAuthScheme)throw new Error(U.join("\n"));return E($)},"httpAuthSchemeMiddleware"),Rn=KI(),LZ={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:Rn.endpointMiddlewareOptions.name},Vn=JD((D,{httpAuthSchemeParametersProvider:F,identityProviderConfigProvider:E})=>({applyToStack:(w)=>{w.addRelativeTo(D9(D,{httpAuthSchemeParametersProvider:F,identityProviderConfigProvider:E}),LZ)}}),"getHttpAuthSchemeEndpointRuleSetPlugin"),Nn=Bf(),RZ={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:Nn.serializerMiddlewareOption.name},qn=JD((D,{httpAuthSchemeParametersProvider:F,identityProviderConfigProvider:E})=>({applyToStack:(w)=>{w.addRelativeTo(D9(D,{httpAuthSchemeParametersProvider:F,identityProviderConfigProvider:E}),RZ)}}),"getHttpAuthSchemePlugin"),Zw=H1(),On=JD((D)=>(F)=>{throw F},"defaultErrorHandler"),jn=JD((D,F)=>{},"defaultSuccessHandler"),VZ=JD((D)=>(F,E)=>async(w)=>{if(!Zw.HttpRequest.isInstance(w.request))return F(w);const C=QZ.getSmithyContext(E).selectedHttpAuthScheme;if(!C)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:f={}},identity:B,signer:h}=C,U=await F({...w,request:await h.sign(w.request,B,f)}).catch((h.errorHandler||On)(f));return(h.successHandler||jn)(U.response,f),U},"httpSigningMiddleware"),Pn=KZ(),NZ={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:Pn.retryMiddlewareOptions.name},yn=JD((D)=>({applyToStack:(F)=>{F.addRelativeTo(VZ(D),NZ)}}),"getHttpSigningPlugin"),qZ=class D{constructor(F){this.authSchemes=new Map;for(let[E,w]of Object.entries(F))if(w!==void 0)this.authSchemes.set(E,w)}getIdentityProvider(F){return this.authSchemes.get(F)}};JD(qZ,"DefaultIdentityProviderConfig");var kn=qZ,Gw=J0(),OZ=class D{async sign(F,E,w){if(!w)throw new Error("request could not be signed with `apiKey` since the `name` and `in` signer properties are missing");if(!w.name)throw new Error("request could not be signed with `apiKey` since the `name` signer property is missing");if(!w.in)throw new Error("request could not be signed with `apiKey` since the `in` signer property is missing");if(!E.apiKey)throw new Error("request could not be signed with `apiKey` since the `apiKey` is not defined");const $=Zw.HttpRequest.clone(F);if(w.in===Gw.HttpApiKeyAuthLocation.QUERY)$.query[w.name]=E.apiKey;else if(w.in===Gw.HttpApiKeyAuthLocation.HEADER)$.headers[w.name]=w.scheme?`${w.scheme} ${E.apiKey}`:E.apiKey;else throw new Error("request can only be signed with `apiKey` locations `query` or `header`, but found: `"+w.in+"`");return $}};JD(OZ,"HttpApiKeyAuthSigner");var bn=OZ,jZ=class D{async sign(F,E,w){const $=Zw.HttpRequest.clone(F);if(!E.token)throw new Error("request could not be signed with `token` since the `token` is not defined");return $.headers.Authorization=`Bearer ${E.token}`,$}};JD(jZ,"HttpBearerAuthSigner");var xn=jZ,PZ=class D{async sign(F,E,w){return F}};JD(PZ,"NoAuthSigner");var cn=PZ,yZ=JD((D)=>(F)=>bZ(F)&&F.expiration.getTime()-Date.now()<D,"createIsIdentityExpiredFunction"),kZ=300000,gn=yZ(kZ),bZ=JD((D)=>D.expiration!==void 0,"doesIdentityRequireRefresh"),rn=JD((D,F,E)=>{if(D===void 0)return;const w=typeof D!=="function"?async()=>Promise.resolve(D):D;let $,C,f,B=!1;const h=JD(async(U)=>{if(!C)C=w(U);try{$=await C,f=!0,B=!1}finally{C=void 0}return $},"coalesceProvider");if(F===void 0)return async(U)=>{if(!f||(U==null?void 0:U.forceRefresh))$=await h(U);return $};return async(U)=>{if(!f||(U==null?void 0:U.forceRefresh))$=await h(U);if(B)return $;if(!E($))return B=!0,$;if(F($))return await h(U),$;return $}},"memoizeIdentityProvider"),_n=JD((D)=>D[Gw.SMITHY_CONTEXT_KEY]||(D[Gw.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),sn=JD((D)=>{if(typeof D==="function")return D;const F=Promise.resolve(D);return()=>F},"normalizeProvider"),un=q6();JD(xZ,"requestBuilder");var cZ=class D{constructor(F,E){this.input=F,this.context=E,this.query={},this.method="",this.headers={},this.path="",this.body=null,this.hostname="",this.resolvePathStack=[]}async build(){const{hostname:F,protocol:E="https",port:w,path:$}=await this.context.endpoint();this.path=$;for(let C of this.resolvePathStack)C(this.path);return new Zw.HttpRequest({protocol:E,hostname:this.hostname||F,port:w,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(F){return this.hostname=F,this}bp(F){return this.resolvePathStack.push((E)=>{this.path=`${(E==null?void 0:E.endsWith("/"))?E.slice(0,-1):E||""}`+F}),this}p(F,E,w,$){return this.resolvePathStack.push((C)=>{this.path=un.resolvedPath(C,this.input,F,E,w,$)}),this}h(F){return this.headers=F,this}q(F){return this.query=F,this}b(F){return this.body=F,this}m(F){return this.method=F,this}};JD(cZ,"RequestBuilder");var gZ=cZ,dn=JD(async(D,F,E,...w)=>{return await F.send(new D(E),...w)},"makePagedClientRequest");JD(rZ,"createPaginator");var vn=JD((D,F)=>{let E=D;const w=F.split(".");for(let $ of w){if(!E||typeof E!=="object")return;E=E[$]}return E},"get")});function mn(D){if(D===void 0)return!0;return typeof D==="string"&&D.length<=50}function g2(D){const F=sZ.normalizeProvider(D.userAgentAppId??F9);return{...D,customUserAgent:typeof D.customUserAgent==="string"?[[D.customUserAgent]]:D.customUserAgent,userAgentAppId:async()=>{const E=await F();if(!mn(E)){const w=D.logger?.constructor?.name==="NoOpLogger"||!D.logger?console:D.logger;if(typeof E!=="string")w?.warn("userAgentAppId must be a string or undefined.");else if(E.length>50)w?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return E}}}var sZ,F9=void 0;var uZ=G(()=>{sZ=L(_D(),1)});class M2{constructor({size:D,params:F}){if(this.data=new Map,this.parameters=[],this.capacity=D??50,F)this.parameters=F}get(D,F){const E=this.hash(D);if(E===!1)return F();if(!this.data.has(E)){if(this.data.size>this.capacity+10){const w=this.data.keys();let $=0;while(!0){const{value:C,done:f}=w.next();if(this.data.delete(C),f||++$>10)break}}this.data.set(E,F())}return this.data.get(E)}size(){return this.data.size}hash(D){let F="";const{parameters:E}=this;if(E.length===0)return!1;for(let w of E){const $=String(D[w]??"");if($.includes("|;"))return!1;F+=$+"|;"}return F}}var nn,tF=(D)=>nn.test(D)||D.startsWith("[")&&D.endsWith("]");var E9=G(()=>{nn=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$")});var ln,eF=(D,F=!1)=>{if(!F)return ln.test(D);const E=D.split(".");for(let w of E)if(!eF(w))return!1;return!0};var w9=G(()=>{ln=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$")});var C0;var Ww=G(()=>{C0={}});var V1="endpoints";function d0(D){if(typeof D!=="object"||D==null)return D;if("ref"in D)return`\$${d0(D.ref)}`;if("fn"in D)return`${D.fn}(${(D.argv||[]).map(d0).join(", ")})`;return JSON.stringify(D,null,2)}var D3=()=>{};var ZD;var dZ=G(()=>{ZD=class ZD extends Error{constructor(D){super(D);this.name="EndpointError"}}});var vZ=()=>{};var mZ=()=>{};var nZ=()=>{};var lZ=()=>{};var iZ=()=>{};var pZ=()=>{};var v0=G(()=>{dZ();vZ();mZ();nZ();lZ();iZ();pZ()});var aZ=(D,F)=>D===F;var oZ=(D)=>{const F=D.split("."),E=[];for(let w of F){const $=w.indexOf("[");if($!==-1){if(w.indexOf("]")!==w.length-1)throw new ZD(`Path: '${D}' does not end with ']'`);const C=w.slice($+1,-1);if(Number.isNaN(parseInt(C)))throw new ZD(`Invalid array index: '${C}' in path: '${D}'`);if($!==0)E.push(w.slice(0,$));E.push(C)}else E.push(w)}return E};var tZ=G(()=>{v0()});var Xw=(D,F)=>oZ(F).reduce((E,w)=>{if(typeof E!=="object")throw new ZD(`Index '${w}' in '${F}' not found in '${JSON.stringify(D)}'`);else if(Array.isArray(E))return E[parseInt(w)];return E[w]},D);var eZ=G(()=>{v0();tZ()});var DW=(D)=>D!=null;var FW=(D)=>!D;var Jw,$9,EW=(D)=>{const F=(()=>{try{if(D instanceof URL)return D;if(typeof D==="object"&&"hostname"in D){const{hostname:Y,port:M,protocol:Z="",path:z="",query:X={}}=D,J=new URL(`${Z}//${Y}${M?`:${M}`:""}${z}`);return J.search=Object.entries(X).map(([K,H])=>`${K}=${H}`).join("&"),J}return new URL(D)}catch(Y){return null}})();if(!F)return console.error(`Unable to parse ${JSON.stringify(D)} as a whatwg URL.`),null;const E=F.href,{host:w,hostname:$,pathname:C,protocol:f,search:B}=F;if(B)return null;const h=f.slice(0,-1);if(!Object.values(Jw.EndpointURLScheme).includes(h))return null;const U=tF($),I=E.includes(`${w}:${$9[h]}`)||typeof D==="string"&&D.includes(`${w}:${$9[h]}`),A=`${w}${I?`:${$9[h]}`:""}`;return{scheme:h,authority:A,path:C,normalizedPath:C.endsWith("/")?C:`${C}/`,isIp:U}};var wW=G(()=>{Jw=L(J0(),1);E9();$9={[Jw.EndpointURLScheme.HTTP]:80,[Jw.EndpointURLScheme.HTTPS]:443}});var $W=(D,F)=>D===F;var fW=(D,F,E,w)=>{if(F>=E||D.length<E)return null;if(!w)return D.substring(F,E);return D.substring(D.length-E,D.length-F)};var CW=(D)=>encodeURIComponent(D).replace(/[!*'()]/g,(F)=>`%${F.charCodeAt(0).toString(16).toUpperCase()}`);var f9=G(()=>{eZ();w9();wW()});var BW;var hW=G(()=>{f9();BW={booleanEquals:aZ,getAttr:Xw,isSet:DW,isValidHostLabel:eF,not:FW,parseURL:EW,stringEquals:$W,substring:fW,uriEncode:CW}});var zw=(D,F)=>{const E=[],w={...F.endpointParams,...F.referenceRecord};let $=0;while($<D.length){const C=D.indexOf("{",$);if(C===-1){E.push(D.slice($));break}E.push(D.slice($,C));const f=D.indexOf("}",C);if(f===-1){E.push(D.slice(C));break}if(D[C+1]==="{"&&D[f+1]==="}")E.push(D.slice(C+1,f)),$=f+2;const B=D.substring(C+1,f);if(B.includes("#")){const[h,U]=B.split("#");E.push(Xw(w[h],U))}else E.push(w[B]);$=f+1}return E.join("")};var C9=G(()=>{f9()});var UW=({ref:D},F)=>{return{...F.endpointParams,...F.referenceRecord}[D]};var B8=(D,F,E)=>{if(typeof D==="string")return zw(D,E);else if(D.fn)return Tw(D,E);else if(D.ref)return UW(D,E);throw new ZD(`'${F}': ${String(D)} is not a string, function or reference.`)};var F3=G(()=>{v0();B9();C9()});var Tw=({fn:D,argv:F},E)=>{const w=F.map((C)=>["boolean","number"].includes(typeof C)?C:B8(C,"arg",E)),$=D.split(".");if($[0]in C0&&$[1]!=null)return C0[$[0]][$[1]](...w);return BW[D](...w)};var B9=G(()=>{Ww();hW();F3()});var AW=({assign:D,...F},E)=>{if(D&&D in E.referenceRecord)throw new ZD(`'${D}' is already defined in Reference Record.`);const w=Tw(F,E);return E.logger?.debug?.(`${V1} evaluateCondition: ${d0(F)} = ${d0(w)}`),{result:w===""?!0:!!w,...D!=null&&{toAssign:{name:D,value:w}}}};var IW=G(()=>{D3();v0();B9()});var j6=(D=[],F)=>{const E={};for(let w of D){const{result:$,toAssign:C}=AW(w,{...F,referenceRecord:{...F.referenceRecord,...E}});if(!$)return{result:$};if(C)E[C.name]=C.value,F.logger?.debug?.(`${V1} assign: ${C.name} := ${d0(C.value)}`)}return{result:!0,referenceRecord:E}};var Kw=G(()=>{D3();IW()});var MW=(D,F)=>Object.entries(D).reduce((E,[w,$])=>({...E,[w]:$.map((C)=>{const f=B8(C,"Header value entry",F);if(typeof f!=="string")throw new ZD(`Header '${w}' value '${f}' is not a string`);return f})}),{});var GW=G(()=>{v0();F3()});var h9=(D,F)=>{if(Array.isArray(D))return D.map((E)=>h9(E,F));switch(typeof D){case"string":return zw(D,F);case"object":if(D===null)throw new ZD(`Unexpected endpoint property: ${D}`);return Sw(D,F);case"boolean":return D;default:throw new ZD(`Unexpected endpoint property type: ${typeof D}`)}};var YW=G(()=>{v0();C9();U9()});var Sw=(D,F)=>Object.entries(D).reduce((E,[w,$])=>({...E,[w]:h9($,F)}),{});var U9=G(()=>{YW()});var ZW=(D,F)=>{const E=B8(D,"Endpoint URL",F);if(typeof E==="string")try{return new URL(E)}catch(w){throw console.error(`Failed to construct URL with ${E}`,w),w}throw new ZD(`Endpoint URL must be a string, got ${typeof E}`)};var WW=G(()=>{v0();F3()});var XW=(D,F)=>{const{conditions:E,endpoint:w}=D,{result:$,referenceRecord:C}=j6(E,F);if(!$)return;const f={...F,referenceRecord:{...F.referenceRecord,...C}},{url:B,properties:h,headers:U}=w;return F.logger?.debug?.(`${V1} Resolving endpoint from template: ${d0(w)}`),{...U!=null&&{headers:MW(U,f)},...h!=null&&{properties:Sw(h,f)},url:ZW(B,f)}};var JW=G(()=>{D3();Kw();GW();U9();WW()});var zW=(D,F)=>{const{conditions:E,error:w}=D,{result:$,referenceRecord:C}=j6(E,F);if(!$)return;throw new ZD(B8(w,"Error",{...F,referenceRecord:{...F.referenceRecord,...C}}))};var TW=G(()=>{v0();Kw();F3()});var KW=(D,F)=>{const{conditions:E,rules:w}=D,{result:$,referenceRecord:C}=j6(E,F);if(!$)return;return Qw(w,{...F,referenceRecord:{...F.referenceRecord,...C}})};var SW=G(()=>{Kw();A9()});var Qw=(D,F)=>{for(let E of D)if(E.type==="endpoint"){const w=XW(E,F);if(w)return w}else if(E.type==="error")zW(E,F);else if(E.type==="tree"){const w=KW(E,F);if(w)return w}else throw new ZD(`Unknown endpoint rule: ${E}`);throw new ZD("Rules evaluation failed")};var A9=G(()=>{v0();JW();TW();SW()});var QW=G(()=>{Ww();A9()});var G2=(D,F)=>{const{endpointParams:E,logger:w}=F,{parameters:$,rules:C}=D;F.logger?.debug?.(`${V1} Initial EndpointParams: ${d0(E)}`);const f=Object.entries($).filter(([,U])=>U.default!=null).map(([U,I])=>[U,I.default]);if(f.length>0)for(let[U,I]of f)E[U]=E[U]??I;const B=Object.entries($).filter(([,U])=>U.required).map(([U])=>U);for(let U of B)if(E[U]==null)throw new ZD(`Missing required parameter: '${U}'`);const h=Qw(C,{endpointParams:E,logger:w,referenceRecord:{}});return F.logger?.debug?.(`${V1} Resolved endpoint: ${d0(h)}`),h};var HW=G(()=>{D3();v0();QW()});var Y2=G(()=>{E9();w9();Ww();HW();v0()});var I9=G(()=>{Y2()});var M9=(D,F=!1)=>{if(F){for(let E of D.split("."))if(!M9(E))return!1;return!0}if(!eF(D))return!1;if(D.length<3||D.length>63)return!1;if(D!==D.toLowerCase())return!1;if(tF(D))return!1;return!0};var LW=G(()=>{Y2();I9()});var RW=(D)=>{const F=D.split(":");if(F.length<6)return null;const[E,w,$,C,f,...B]=F;if(E!=="arn"||w===""||$===""||B.join(":")==="")return null;const h=B.map((U)=>U.split("/")).flat();return{partition:w,service:$,region:C,accountId:f,resourceId:h}};var NW;var VW=G(()=>{NW={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{}}],version:"1.1"}});var an,on="",qW=(D)=>{const{partitions:F}=an;for(let w of F){const{regions:$,outputs:C}=w;for(let[f,B]of Object.entries($))if(f===D)return{...C,...B}}for(let w of F){const{regionRegex:$,outputs:C}=w;if(new RegExp($).test(D))return{...C}}const E=F.find((w)=>w.id==="aws");if(!E)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...E.outputs}},OW=()=>on;var G9=G(()=>{VW();an=NW});var Z2;var jW=G(()=>{Y2();LW();G9();Z2={isVirtualHostableS3Bucket:M9,parseArn:RW,partition:qW};C0.aws=Z2});var PW=G(()=>{Y2()});var yW=G(()=>{Y2()});var kW=()=>{};var bW=()=>{};var xW=()=>{};var cW=()=>{};var gW=()=>{};var rW=G(()=>{yW();kW();bW();xW();cW();gW()});var p8=G(()=>{jW();G9();I9();PW();rW()});var Z9=W((n5D,Rw)=>{var _W,sW,uW,dW,vW,mW,nW,lW,iW,pW,aW,oW,tW,Hw,Y9,eW,DX,FX,P6,EX,wX,$X,fX,CX,BX,hX,UX,AX,Lw,IX,MX;(function(D){var F=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:{};if(typeof define==="function"&&define.amd)define("tslib",["exports"],function(w){D(E(F,E(w)))});else if(typeof Rw==="object"&&typeof n5D==="object")D(E(F,E(n5D)));else D(E(F));function E(w,$){if(w!==F)if(typeof Object.create==="function")Object.defineProperty(w,"__esModule",{value:!0});else w.__esModule=!0;return function(C,f){return w[C]=$?$(C,f):f}}})(function(D){var F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function($,C){$.__proto__=C}||function($,C){for(var f in C)if(Object.prototype.hasOwnProperty.call(C,f))$[f]=C[f]};_W=function($,C){if(typeof C!=="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");F($,C);function f(){this.constructor=$}$.prototype=C===null?Object.create(C):(f.prototype=C.prototype,new f)},sW=Object.assign||function($){for(var C,f=1,B=arguments.length;f<B;f++){C=arguments[f];for(var h in C)if(Object.prototype.hasOwnProperty.call(C,h))$[h]=C[h]}return $},uW=function($,C){var f={};for(var B in $)if(Object.prototype.hasOwnProperty.call($,B)&&C.indexOf(B)<0)f[B]=$[B];if($!=null&&typeof Object.getOwnPropertySymbols==="function"){for(var h=0,B=Object.getOwnPropertySymbols($);h<B.length;h++)if(C.indexOf(B[h])<0&&Object.prototype.propertyIsEnumerable.call($,B[h]))f[B[h]]=$[B[h]]}return f},dW=function($,C,f,B){var h=arguments.length,U=h<3?C:B===null?B=Object.getOwnPropertyDescriptor(C,f):B,I;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")U=Reflect.decorate($,C,f,B);else for(var A=$.length-1;A>=0;A--)if(I=$[A])U=(h<3?I(U):h>3?I(C,f,U):I(C,f))||U;return h>3&&U&&Object.defineProperty(C,f,U),U},vW=function($,C){return function(f,B){C(f,B,$)}},mW=function($,C,f,B,h,U){function I(m){if(m!==void 0&&typeof m!=="function")throw new TypeError("Function expected");return m}var A=B.kind,Y=A==="getter"?"get":A==="setter"?"set":"value",M=!C&&$?B.static?$:$.prototype:null,Z=C||(M?Object.getOwnPropertyDescriptor(M,B.name):{}),z,X=!1;for(var J=f.length-1;J>=0;J--){var K={};for(var H in B)K[H]=H==="access"?{}:B[H];for(var H in B.access)K.access[H]=B.access[H];K.addInitializer=function(m){if(X)throw new TypeError("Cannot add initializers after decoration has completed");U.push(I(m||null))};var V=f[J](A==="accessor"?{get:Z.get,set:Z.set}:Z[Y],K);if(A==="accessor"){if(V===void 0)continue;if(V===null||typeof V!=="object")throw new TypeError("Object expected");if(z=I(V.get))Z.get=z;if(z=I(V.set))Z.set=z;if(z=I(V.init))h.unshift(z)}else if(z=I(V))if(A==="field")h.unshift(z);else Z[Y]=z}if(M)Object.defineProperty(M,B.name,Z);X=!0},nW=function($,C,f){var B=arguments.length>2;for(var h=0;h<C.length;h++)f=B?C[h].call($,f):C[h].call($);return B?f:void 0},lW=function($){return typeof $==="symbol"?$:"".concat($)},iW=function($,C,f){if(typeof C==="symbol")C=C.description?"[".concat(C.description,"]"):"";return Object.defineProperty($,"name",{configurable:!0,value:f?"".concat(f," ",C):C})},pW=function($,C){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata($,C)},aW=function($,C,f,B){function h(U){return U instanceof f?U:new f(function(I){I(U)})}return new(f||(f=Promise))(function(U,I){function A(Z){try{M(B.next(Z))}catch(z){I(z)}}function Y(Z){try{M(B.throw(Z))}catch(z){I(z)}}function M(Z){Z.done?U(Z.value):h(Z.value).then(A,Y)}M((B=B.apply($,C||[])).next())})},oW=function($,C){var f={label:0,sent:function(){if(U[0]&1)throw U[1];return U[1]},trys:[],ops:[]},B,h,U,I=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return I.next=A(0),I.throw=A(1),I.return=A(2),typeof Symbol==="function"&&(I[Symbol.iterator]=function(){return this}),I;function A(M){return function(Z){return Y([M,Z])}}function Y(M){if(B)throw new TypeError("Generator is already executing.");while(I&&(I=0,M[0]&&(f=0)),f)try{if(B=1,h&&(U=M[0]&2?h.return:M[0]?h.throw||((U=h.return)&&U.call(h),0):h.next)&&!(U=U.call(h,M[1])).done)return U;if(h=0,U)M=[M[0]&2,U.value];switch(M[0]){case 0:case 1:U=M;break;case 4:return f.label++,{value:M[1],done:!1};case 5:f.label++,h=M[1],M=[0];continue;case 7:M=f.ops.pop(),f.trys.pop();continue;default:if((U=f.trys,!(U=U.length>0&&U[U.length-1]))&&(M[0]===6||M[0]===2)){f=0;continue}if(M[0]===3&&(!U||M[1]>U[0]&&M[1]<U[3])){f.label=M[1];break}if(M[0]===6&&f.label<U[1]){f.label=U[1],U=M;break}if(U&&f.label<U[2]){f.label=U[2],f.ops.push(M);break}if(U[2])f.ops.pop();f.trys.pop();continue}M=C.call($,f)}catch(Z){M=[6,Z],h=0}finally{B=U=0}if(M[0]&5)throw M[1];return{value:M[0]?M[1]:void 0,done:!0}}},tW=function($,C){for(var f in $)if(f!=="default"&&!Object.prototype.hasOwnProperty.call(C,f))Lw(C,$,f)},Lw=Object.create?function($,C,f,B){if(B===void 0)B=f;var h=Object.getOwnPropertyDescriptor(C,f);if(!h||("get"in h?!C.__esModule:h.writable||h.configurable))h={enumerable:!0,get:function(){return C[f]}};Object.defineProperty($,B,h)}:function($,C,f,B){if(B===void 0)B=f;$[B]=C[f]},Hw=function($){var C=typeof Symbol==="function"&&Symbol.iterator,f=C&&$[C],B=0;if(f)return f.call($);if($&&typeof $.length==="number")return{next:function(){if($&&B>=$.length)$=void 0;return{value:$&&$[B++],done:!$}}};throw new TypeError(C?"Object is not iterable.":"Symbol.iterator is not defined.")},Y9=function($,C){var f=typeof Symbol==="function"&&$[Symbol.iterator];if(!f)return $;var B=f.call($),h,U=[],I;try{while((C===void 0||C-- >0)&&!(h=B.next()).done)U.push(h.value)}catch(A){I={error:A}}finally{try{if(h&&!h.done&&(f=B.return))f.call(B)}finally{if(I)throw I.error}}return U},eW=function(){for(var $=[],C=0;C<arguments.length;C++)$=$.concat(Y9(arguments[C]));return $},DX=function(){for(var $=0,C=0,f=arguments.length;C<f;C++)$+=arguments[C].length;for(var B=Array($),h=0,C=0;C<f;C++)for(var U=arguments[C],I=0,A=U.length;I<A;I++,h++)B[h]=U[I];return B},FX=function($,C,f){if(f||arguments.length===2){for(var B=0,h=C.length,U;B<h;B++)if(U||!(B in C)){if(!U)U=Array.prototype.slice.call(C,0,B);U[B]=C[B]}}return $.concat(U||Array.prototype.slice.call(C))},P6=function($){return this instanceof P6?(this.v=$,this):new P6($)},EX=function($,C,f){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var B=f.apply($,C||[]),h,U=[];return h=Object.create((typeof AsyncIterator==="function"?AsyncIterator:Object).prototype),A("next"),A("throw"),A("return",I),h[Symbol.asyncIterator]=function(){return this},h;function I(J){return function(K){return Promise.resolve(K).then(J,z)}}function A(J,K){if(B[J]){if(h[J]=function(H){return new Promise(function(V,m){U.push([J,H,V,m])>1||Y(J,H)})},K)h[J]=K(h[J])}}function Y(J,K){try{M(B[J](K))}catch(H){X(U[0][3],H)}}function M(J){J.value instanceof P6?Promise.resolve(J.value.v).then(Z,z):X(U[0][2],J)}function Z(J){Y("next",J)}function z(J){Y("throw",J)}function X(J,K){if(J(K),U.shift(),U.length)Y(U[0][0],U[0][1])}},wX=function($){var C,f;return C={},B("next"),B("throw",function(h){throw h}),B("return"),C[Symbol.iterator]=function(){return this},C;function B(h,U){C[h]=$[h]?function(I){return(f=!f)?{value:P6($[h](I)),done:!1}:U?U(I):I}:U}},$X=function($){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var C=$[Symbol.asyncIterator],f;return C?C.call($):($=typeof Hw==="function"?Hw($):$[Symbol.iterator](),f={},B("next"),B("throw"),B("return"),f[Symbol.asyncIterator]=function(){return this},f);function B(U){f[U]=$[U]&&function(I){return new Promise(function(A,Y){I=$[U](I),h(A,Y,I.done,I.value)})}}function h(U,I,A,Y){Promise.resolve(Y).then(function(M){U({value:M,done:A})},I)}},fX=function($,C){if(Object.defineProperty)Object.defineProperty($,"raw",{value:C});else $.raw=C;return $};var E=Object.create?function($,C){Object.defineProperty($,"default",{enumerable:!0,value:C})}:function($,C){$.default=C};CX=function($){if($&&$.__esModule)return $;var C={};if($!=null){for(var f in $)if(f!=="default"&&Object.prototype.hasOwnProperty.call($,f))Lw(C,$,f)}return E(C,$),C},BX=function($){return $&&$.__esModule?$:{default:$}},hX=function($,C,f,B){if(f==="a"&&!B)throw new TypeError("Private accessor was defined without a getter");if(typeof C==="function"?$!==C||!B:!C.has($))throw new TypeError("Cannot read private member from an object whose class did not declare it");return f==="m"?B:f==="a"?B.call($):B?B.value:C.get($)},UX=function($,C,f,B,h){if(B==="m")throw new TypeError("Private method is not writable");if(B==="a"&&!h)throw new TypeError("Private accessor was defined without a setter");if(typeof C==="function"?$!==C||!h:!C.has($))throw new TypeError("Cannot write private member to an object whose class did not declare it");return B==="a"?h.call($,f):h?h.value=f:C.set($,f),f},AX=function($,C){if(C===null||typeof C!=="object"&&typeof C!=="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof $==="function"?C===$:$.has(C)},IX=function($,C,f){if(C!==null&&C!==void 0){if(typeof C!=="object"&&typeof C!=="function")throw new TypeError("Object expected.");var B,h;if(f){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");B=C[Symbol.asyncDispose]}if(B===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");if(B=C[Symbol.dispose],f)h=B}if(typeof B!=="function")throw new TypeError("Object not disposable.");if(h)B=function(){try{h.call(this)}catch(U){return Promise.reject(U)}};$.stack.push({value:C,dispose:B,async:f})}else if(f)$.stack.push({async:!0});return C};var w=typeof SuppressedError==="function"?SuppressedError:function($,C,f){var B=new Error(f);return B.name="SuppressedError",B.error=$,B.suppressed=C,B};MX=function($){function C(U){$.error=$.hasError?new w(U,$.error,"An error was suppressed during disposal."):U,$.hasError=!0}var f,B=0;function h(){while(f=$.stack.pop())try{if(!f.async&&B===1)return B=0,$.stack.push(f),Promise.resolve().then(h);if(f.dispose){var U=f.dispose.call(f.value);if(f.async)return B|=2,Promise.resolve(U).then(h,function(I){return C(I),h()})}else B|=1}catch(I){C(I)}if(B===1)return $.hasError?Promise.reject($.error):Promise.resolve();if($.hasError)throw $.error}return h()},D("__extends",_W),D("__assign",sW),D("__rest",uW),D("__decorate",dW),D("__param",vW),D("__esDecorate",mW),D("__runInitializers",nW),D("__propKey",lW),D("__setFunctionName",iW),D("__metadata",pW),D("__awaiter",aW),D("__generator",oW),D("__exportStar",tW),D("__createBinding",Lw),D("__values",Hw),D("__read",Y9),D("__spread",eW),D("__spreadArrays",DX),D("__spreadArray",FX),D("__await",P6),D("__asyncGenerator",EX),D("__asyncDelegator",wX),D("__asyncValues",$X),D("__makeTemplateObject",fX),D("__importStar",CX),D("__importDefault",BX),D("__classPrivateFieldGet",hX),D("__classPrivateFieldSet",UX),D("__classPrivateFieldIn",AX),D("__addDisposableResource",IX),D("__disposeResources",MX)})});var B0=W((l5D,XX)=>{function ZX(D,F,E){if(!D.$source)D.$source={};return D.$source[F]=E,D}function WX(D,F,E){if(!D.__aws_sdk_context)D.__aws_sdk_context={features:{}};else if(!D.__aws_sdk_context.features)D.__aws_sdk_context.features={};D.__aws_sdk_context.features[F]=E}var{defineProperty:Vw,getOwnPropertyDescriptor:tn,getOwnPropertyNames:en}=Object,Dl=Object.prototype.hasOwnProperty,W9=(D,F)=>Vw(D,"name",{value:F,configurable:!0}),Fl=(D,F)=>{for(var E in F)Vw(D,E,{get:F[E],enumerable:!0})},El=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of en(F))if(!Dl.call(D,$)&&$!==E)Vw(D,$,{get:()=>F[$],enumerable:!(w=tn(F,$))||w.enumerable})}return D},wl=(D)=>El(Vw({},"__esModule",{value:!0}),D),YX={};Fl(YX,{emitWarningIfUnsupportedVersion:()=>$l,setCredentialFeature:()=>ZX,setFeature:()=>WX});XX.exports=wl(YX);var GX=!1,$l=W9((D)=>{if(D&&!GX&&parseInt(D.substring(1,D.indexOf(".")))<18)GX=!0,process.emitWarning(`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
|
|
5
|
+
no longer support Node.js 16.x on January 6, 2025.
|
|
6
|
+
|
|
7
|
+
To continue receiving updates to AWS services, bug fixes, and security
|
|
8
|
+
updates please upgrade to a supported Node.js LTS version.
|
|
9
|
+
|
|
10
|
+
More information can be found at: https://a.co/74kJMmI`)},"emitWarningIfUnsupportedVersion");W9(ZX,"setCredentialFeature");W9(WX,"setFeature")});var cX=W((i5D,xX)=>{function K9(D){for(let F=0;F<8;F++)D[F]^=255;for(let F=7;F>-1;F--)if(D[F]++,D[F]!==0)break}var{defineProperty:yw,getOwnPropertyDescriptor:fl,getOwnPropertyNames:Cl}=Object,Bl=Object.prototype.hasOwnProperty,mD=(D,F)=>yw(D,"name",{value:F,configurable:!0}),hl=(D,F)=>{for(var E in F)yw(D,E,{get:F[E],enumerable:!0})},Ul=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Cl(F))if(!Bl.call(D,$)&&$!==E)yw(D,$,{get:()=>F[$],enumerable:!(w=fl(F,$))||w.enumerable})}return D},Al=(D)=>Ul(yw({},"__esModule",{value:!0}),D),SX={};hl(SX,{SignatureV4:()=>xl,clearCredentialCache:()=>Vl,createScope:()=>Ow,getCanonicalHeaders:()=>T9,getCanonicalQuery:()=>OX,getPayloadHash:()=>Pw,getSigningKey:()=>qX,moveHeadersToQuery:()=>kX,prepareRequest:()=>S9});xX.exports=Al(SX);var JX=xF(),X9=f8(),Il="X-Amz-Algorithm",Ml="X-Amz-Credential",QX="X-Amz-Date",Gl="X-Amz-SignedHeaders",Yl="X-Amz-Expires",HX="X-Amz-Signature",LX="X-Amz-Security-Token",RX="authorization",VX=QX.toLowerCase(),Zl="date",Wl=[RX,VX,Zl],Xl=HX.toLowerCase(),z9="x-amz-content-sha256",Jl=LX.toLowerCase(),zl={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},Tl=/^proxy-/,Kl=/^sec-/,J9="AWS4-HMAC-SHA256",Sl="AWS4-HMAC-SHA256-PAYLOAD",Ql="UNSIGNED-PAYLOAD",Hl=50,NX="aws4_request",Ll=604800,h8=L6(),Rl=f8(),y6={},qw=[],Ow=mD((D,F,E)=>`${D}/${F}/${E}/${NX}`,"createScope"),qX=mD(async(D,F,E,w,$)=>{const C=await zX(D,F.secretAccessKey,F.accessKeyId),f=`${E}:${w}:${$}:${h8.toHex(C)}:${F.sessionToken}`;if(f in y6)return y6[f];qw.push(f);while(qw.length>Hl)delete y6[qw.shift()];let B=`AWS4${F.secretAccessKey}`;for(let h of[E,w,$,NX])B=await zX(D,B,h);return y6[f]=B},"getSigningKey"),Vl=mD(()=>{qw.length=0,Object.keys(y6).forEach((D)=>{delete y6[D]})},"clearCredentialCache"),zX=mD((D,F,E)=>{const w=new D(F);return w.update(Rl.toUint8Array(E)),w.digest()},"hmac"),T9=mD(({headers:D},F,E)=>{const w={};for(let $ of Object.keys(D).sort()){if(D[$]==null)continue;const C=$.toLowerCase();if(C in zl||(F==null?void 0:F.has(C))||Tl.test(C)||Kl.test(C)){if(!E||E&&!E.has(C))continue}w[C]=D[$].trim().replace(/\s+/g," ")}return w},"getCanonicalHeaders"),jw=Nf(),OX=mD(({query:D={}})=>{const F=[],E={};for(let w of Object.keys(D)){if(w.toLowerCase()===Xl)continue;const $=jw.escapeUri(w);F.push($);const C=D[w];if(typeof C==="string")E[$]=`${$}=${jw.escapeUri(C)}`;else if(Array.isArray(C))E[$]=C.slice(0).reduce((f,B)=>f.concat([`${$}=${jw.escapeUri(B)}`]),[]).sort().join("&")}return F.sort().map((w)=>E[w]).filter((w)=>w).join("&")},"getCanonicalQuery"),Nl=Sf(),ql=f8(),Pw=mD(async({headers:D,body:F},E)=>{for(let w of Object.keys(D))if(w.toLowerCase()===z9)return D[w];if(F==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";else if(typeof F==="string"||ArrayBuffer.isView(F)||Nl.isArrayBuffer(F)){const w=new E;return w.update(ql.toUint8Array(F)),h8.toHex(await w.digest())}return Ql},"getPayloadHash"),TX=f8(),jX=class D{format(F){const E=[];for(let C of Object.keys(F)){const f=TX.fromUtf8(C);E.push(Uint8Array.from([f.byteLength]),f,this.formatHeaderValue(F[C]))}const w=new Uint8Array(E.reduce((C,f)=>C+f.byteLength,0));let $=0;for(let C of E)w.set(C,$),$+=C.byteLength;return w}formatHeaderValue(F){switch(F.type){case"boolean":return Uint8Array.from([F.value?0:1]);case"byte":return Uint8Array.from([2,F.value]);case"short":const E=new DataView(new ArrayBuffer(3));return E.setUint8(0,3),E.setInt16(1,F.value,!1),new Uint8Array(E.buffer);case"integer":const w=new DataView(new ArrayBuffer(5));return w.setUint8(0,4),w.setInt32(1,F.value,!1),new Uint8Array(w.buffer);case"long":const $=new Uint8Array(9);return $[0]=5,$.set(F.value.bytes,1),$;case"binary":const C=new DataView(new ArrayBuffer(3+F.value.byteLength));C.setUint8(0,6),C.setUint16(1,F.value.byteLength,!1);const f=new Uint8Array(C.buffer);return f.set(F.value,3),f;case"string":const B=TX.fromUtf8(F.value),h=new DataView(new ArrayBuffer(3+B.byteLength));h.setUint8(0,7),h.setUint16(1,B.byteLength,!1);const U=new Uint8Array(h.buffer);return U.set(B,3),U;case"timestamp":const I=new Uint8Array(9);return I[0]=8,I.set(Pl.fromNumber(F.value.valueOf()).bytes,1),I;case"uuid":if(!jl.test(F.value))throw new Error(`Invalid UUID received: ${F.value}`);const A=new Uint8Array(17);return A[0]=9,A.set(h8.fromHex(F.value.replace(/\-/g,"")),1),A}}};mD(jX,"HeaderFormatter");var Ol=jX,jl=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,PX=class D{constructor(F){if(this.bytes=F,F.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(F){if(F>9223372036854776000||F<-9223372036854776000)throw new Error(`${F} is too large (or, if negative, too small) to represent as an Int64`);const E=new Uint8Array(8);for(let w=7,$=Math.abs(Math.round(F));w>-1&&$>0;w--,$/=256)E[w]=$;if(F<0)K9(E);return new D(E)}valueOf(){const F=this.bytes.slice(0),E=F[0]&128;if(E)K9(F);return parseInt(h8.toHex(F),16)*(E?-1:1)}toString(){return String(this.valueOf())}};mD(PX,"Int64");var Pl=PX;mD(K9,"negate");var yl=mD((D,F)=>{D=D.toLowerCase();for(let E of Object.keys(F))if(D===E.toLowerCase())return!0;return!1},"hasHeader"),yX=H1(),kX=mD((D,F={})=>{var E,w;const{headers:$,query:C={}}=yX.HttpRequest.clone(D);for(let f of Object.keys($)){const B=f.toLowerCase();if(B.slice(0,6)==="x-amz-"&&!((E=F.unhoistableHeaders)==null?void 0:E.has(B))||((w=F.hoistableHeaders)==null?void 0:w.has(B)))C[f]=$[f],delete $[f]}return{...D,headers:$,query:C}},"moveHeadersToQuery"),S9=mD((D)=>{D=yX.HttpRequest.clone(D);for(let F of Object.keys(D.headers))if(Wl.indexOf(F.toLowerCase())>-1)delete D.headers[F];return D},"prepareRequest"),kl=mD((D)=>bl(D).toISOString().replace(/\.\d{3}Z$/,"Z"),"iso8601"),bl=mD((D)=>{if(typeof D==="number")return new Date(D*1000);if(typeof D==="string"){if(Number(D))return new Date(Number(D)*1000);return new Date(D)}return D},"toDate"),bX=class D{constructor({applyChecksum:F,credentials:E,region:w,service:$,sha256:C,uriEscapePath:f=!0}){this.headerFormatter=new Ol,this.service=$,this.sha256=C,this.uriEscapePath=f,this.applyChecksum=typeof F==="boolean"?F:!0,this.regionProvider=JX.normalizeProvider(w),this.credentialProvider=JX.normalizeProvider(E)}async presign(F,E={}){const{signingDate:w=new Date,expiresIn:$=3600,unsignableHeaders:C,unhoistableHeaders:f,signableHeaders:B,hoistableHeaders:h,signingRegion:U,signingService:I}=E,A=await this.credentialProvider();this.validateResolvedCredentials(A);const Y=U??await this.regionProvider(),{longDate:M,shortDate:Z}=Nw(w);if($>Ll)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const z=Ow(Z,Y,I??this.service),X=kX(S9(F),{unhoistableHeaders:f,hoistableHeaders:h});if(A.sessionToken)X.query[LX]=A.sessionToken;X.query[Il]=J9,X.query[Ml]=`${A.accessKeyId}/${z}`,X.query[QX]=M,X.query[Yl]=$.toString(10);const J=T9(X,C,B);return X.query[Gl]=KX(J),X.query[HX]=await this.getSignature(M,z,this.getSigningKey(A,Y,Z,I),this.createCanonicalRequest(X,J,await Pw(F,this.sha256))),X}async sign(F,E){if(typeof F==="string")return this.signString(F,E);else if(F.headers&&F.payload)return this.signEvent(F,E);else if(F.message)return this.signMessage(F,E);else return this.signRequest(F,E)}async signEvent({headers:F,payload:E},{signingDate:w=new Date,priorSignature:$,signingRegion:C,signingService:f}){const B=C??await this.regionProvider(),{shortDate:h,longDate:U}=Nw(w),I=Ow(h,B,f??this.service),A=await Pw({headers:{},body:E},this.sha256),Y=new this.sha256;Y.update(F);const M=h8.toHex(await Y.digest()),Z=[Sl,U,I,$,M,A].join("\n");return this.signString(Z,{signingDate:w,signingRegion:B,signingService:f})}async signMessage(F,{signingDate:E=new Date,signingRegion:w,signingService:$}){return this.signEvent({headers:this.headerFormatter.format(F.message.headers),payload:F.message.body},{signingDate:E,signingRegion:w,signingService:$,priorSignature:F.priorSignature}).then((f)=>{return{message:F.message,signature:f}})}async signString(F,{signingDate:E=new Date,signingRegion:w,signingService:$}={}){const C=await this.credentialProvider();this.validateResolvedCredentials(C);const f=w??await this.regionProvider(),{shortDate:B}=Nw(E),h=new this.sha256(await this.getSigningKey(C,f,B,$));return h.update(X9.toUint8Array(F)),h8.toHex(await h.digest())}async signRequest(F,{signingDate:E=new Date,signableHeaders:w,unsignableHeaders:$,signingRegion:C,signingService:f}={}){const B=await this.credentialProvider();this.validateResolvedCredentials(B);const h=C??await this.regionProvider(),U=S9(F),{longDate:I,shortDate:A}=Nw(E),Y=Ow(A,h,f??this.service);if(U.headers[VX]=I,B.sessionToken)U.headers[Jl]=B.sessionToken;const M=await Pw(U,this.sha256);if(!yl(z9,U.headers)&&this.applyChecksum)U.headers[z9]=M;const Z=T9(U,$,w),z=await this.getSignature(I,Y,this.getSigningKey(B,h,A,f),this.createCanonicalRequest(U,Z,M));return U.headers[RX]=`${J9} Credential=${B.accessKeyId}/${Y}, SignedHeaders=${KX(Z)}, Signature=${z}`,U}createCanonicalRequest(F,E,w){const $=Object.keys(E).sort();return`${F.method}
|
|
11
|
+
${this.getCanonicalPath(F)}
|
|
12
|
+
${OX(F)}
|
|
13
|
+
${$.map((C)=>`${C}:${E[C]}`).join("\n")}
|
|
14
|
+
|
|
15
|
+
${$.join(";")}
|
|
16
|
+
${w}`}async createStringToSign(F,E,w){const $=new this.sha256;$.update(X9.toUint8Array(w));const C=await $.digest();return`${J9}
|
|
17
|
+
${F}
|
|
18
|
+
${E}
|
|
19
|
+
${h8.toHex(C)}`}getCanonicalPath({path:F}){if(this.uriEscapePath){const E=[];for(let C of F.split("/")){if((C==null?void 0:C.length)===0)continue;if(C===".")continue;if(C==="..")E.pop();else E.push(C)}const w=`${(F==null?void 0:F.startsWith("/"))?"/":""}${E.join("/")}${E.length>0&&(F==null?void 0:F.endsWith("/"))?"/":""}`;return jw.escapeUri(w).replace(/%2F/g,"/")}return F}async getSignature(F,E,w,$){const C=await this.createStringToSign(F,E,$),f=new this.sha256(await w);return f.update(X9.toUint8Array(C)),h8.toHex(await f.digest())}getSigningKey(F,E,w,$){return qX(this.sha256,F,w,E,$||this.service)}validateResolvedCredentials(F){if(typeof F!=="object"||typeof F.accessKeyId!=="string"||typeof F.secretAccessKey!=="string")throw new Error("Resolved credential object is not valid")}};mD(bX,"SignatureV4");var xl=bX,Nw=mD((D)=>{const F=kl(D).replace(/[\-:]/g,"");return{longDate:F,shortDate:F.slice(0,8)}},"formatDate"),KX=mD((D)=>Object.keys(D).sort().join(";"),"getCanonicalHeaderList")});var lX=W((p5D,nX)=>{var{defineProperty:kw,getOwnPropertyDescriptor:cl,getOwnPropertyNames:gl}=Object,rl=Object.prototype.hasOwnProperty,q0=(D,F)=>kw(D,"name",{value:F,configurable:!0}),_l=(D,F)=>{for(var E in F)kw(D,E,{get:F[E],enumerable:!0})},sl=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of gl(F))if(!rl.call(D,$)&&$!==E)kw(D,$,{get:()=>F[$],enumerable:!(w=cl(F,$))||w.enumerable})}return D},ul=(D)=>sl(kw({},"__esModule",{value:!0}),D),uX={};_l(uX,{AWSSDKSigV4Signer:()=>nl,AwsSdkSigV4ASigner:()=>il,AwsSdkSigV4Signer:()=>L9,NODE_SIGV4A_CONFIG_OPTIONS:()=>ol,resolveAWSSDKSigV4Config:()=>el,resolveAwsSdkSigV4AConfig:()=>al,resolveAwsSdkSigV4Config:()=>mX,validateSigningProperties:()=>H9});nX.exports=ul(uX);var dl=H1(),vl=H1(),gX=q0((D)=>{var F,E;return vl.HttpResponse.isInstance(D)?((F=D.headers)==null?void 0:F.date)??((E=D.headers)==null?void 0:E.Date):void 0},"getDateHeader"),Q9=q0((D)=>new Date(Date.now()+D),"getSkewCorrectedDate"),ml=q0((D,F)=>Math.abs(Q9(F).getTime()-D)>=300000,"isClockSkewed"),rX=q0((D,F)=>{const E=Date.parse(D);if(ml(E,F))return E-Date.now();return F},"getUpdatedSystemClockOffset"),E3=q0((D,F)=>{if(!F)throw new Error(`Property \`${D}\` is not resolved for AWS SDK SigV4Auth`);return F},"throwSigningPropertyError"),H9=q0(async(D)=>{var F,E,w;const $=E3("context",D.context),C=E3("config",D.config),f=(w=(E=(F=$.endpointV2)==null?void 0:F.properties)==null?void 0:E.authSchemes)==null?void 0:w[0],h=await E3("signer",C.signer)(f),U=D==null?void 0:D.signingRegion,I=D==null?void 0:D.signingRegionSet,A=D==null?void 0:D.signingName;return{config:C,signer:h,signingRegion:U,signingRegionSet:I,signingName:A}},"validateSigningProperties"),dX=class D{async sign(F,E,w){var $;if(!dl.HttpRequest.isInstance(F))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const C=await H9(w),{config:f,signer:B}=C;let{signingRegion:h,signingName:U}=C;const I=w.context;if((($=I==null?void 0:I.authSchemes)==null?void 0:$.length)??0>1){const[Y,M]=I.authSchemes;if((Y==null?void 0:Y.name)==="sigv4a"&&(M==null?void 0:M.name)==="sigv4")h=(M==null?void 0:M.signingRegion)??h,U=(M==null?void 0:M.signingName)??U}return await B.sign(F,{signingDate:Q9(f.systemClockOffset),signingRegion:h,signingService:U})}errorHandler(F){return(E)=>{const w=E.ServerTime??gX(E.$response);if(w){const $=E3("config",F.config),C=$.systemClockOffset;if($.systemClockOffset=rX(w,$.systemClockOffset),$.systemClockOffset!==C&&E.$metadata)E.$metadata.clockSkewCorrected=!0}throw E}}successHandler(F,E){const w=gX(F);if(w){const $=E3("config",E.config);$.systemClockOffset=rX(w,$.systemClockOffset)}}};q0(dX,"AwsSdkSigV4Signer");var L9=dX,nl=L9,ll=H1(),vX=class D extends L9{async sign(F,E,w){var $;if(!ll.HttpRequest.isInstance(F))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const{config:C,signer:f,signingRegion:B,signingRegionSet:h,signingName:U}=await H9(w),A=(await(($=C.sigv4aSigningRegionSet)==null?void 0:$.call(C))??h??[B]).join(",");return await f.sign(F,{signingDate:Q9(C.systemClockOffset),signingRegion:A,signingService:U})}};q0(vX,"AwsSdkSigV4ASigner");var il=vX,pl=_D(),_X=p7(),al=q0((D)=>{return D.sigv4aSigningRegionSet=pl.normalizeProvider(D.sigv4aSigningRegionSet),D},"resolveAwsSdkSigV4AConfig"),ol={environmentVariableSelector(D){if(D.AWS_SIGV4A_SIGNING_REGION_SET)return D.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((F)=>F.trim());throw new _X.ProviderError("AWS_SIGV4A_SIGNING_REGION_SET not set in env.",{tryNextLink:!0})},configFileSelector(D){if(D.sigv4a_signing_region_set)return(D.sigv4a_signing_region_set??"").split(",").map((F)=>F.trim());throw new _X.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},tl=B0(),a8=_D(),sX=cX(),mX=q0((D)=>{let F=!1,E;if(D.credentials)F=!0,E=a8.memoizeIdentityProvider(D.credentials,a8.isIdentityExpired,a8.doesIdentityRequireRefresh);if(!E)if(D.credentialDefaultProvider)E=a8.normalizeProvider(D.credentialDefaultProvider(Object.assign({},D,{parentClientConfig:D})));else E=q0(async()=>{throw new Error("`credentials` is missing")},"normalizedCreds");const{signingEscapePath:w=!0,systemClockOffset:$=D.systemClockOffset||0,sha256:C}=D;let f;if(D.signer)f=a8.normalizeProvider(D.signer);else if(D.regionInfoProvider)f=q0(()=>a8.normalizeProvider(D.region)().then(async(B)=>[await D.regionInfoProvider(B,{useFipsEndpoint:await D.useFipsEndpoint(),useDualstackEndpoint:await D.useDualstackEndpoint()})||{},B]).then(([B,h])=>{const{signingRegion:U,signingService:I}=B;D.signingRegion=D.signingRegion||U||h,D.signingName=D.signingName||I||D.serviceId;const A={...D,credentials:E,region:D.signingRegion,service:D.signingName,sha256:C,uriEscapePath:w};return new(D.signerConstructor||sX.SignatureV4)(A)}),"signer");else f=q0(async(B)=>{B=Object.assign({},{name:"sigv4",signingName:D.signingName||D.defaultSigningName,signingRegion:await a8.normalizeProvider(D.region)(),properties:{}},B);const{signingRegion:h,signingName:U}=B;D.signingRegion=D.signingRegion||h,D.signingName=D.signingName||U||D.serviceId;const I={...D,credentials:E,region:D.signingRegion,service:D.signingName,sha256:C,uriEscapePath:w};return new(D.signerConstructor||sX.SignatureV4)(I)},"signer");return{...D,systemClockOffset:$,signingEscapePath:w,credentials:F?async()=>E().then((B)=>tl.setCredentialFeature(B,"CREDENTIALS_CODE","e")):E,signer:f}},"resolveAwsSdkSigV4Config"),el=mX});var bw=W(($i)=>{var Di=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",iX="[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]["+Di+"]*",Fi=new RegExp("^"+iX+"$"),Ei=function(D,F){const E=[];let w=F.exec(D);while(w){const $=[];$.startIndex=F.lastIndex-w[0].length;const C=w.length;for(let f=0;f<C;f++)$.push(w[f]);E.push($),w=F.exec(D)}return E},wi=function(D){const F=Fi.exec(D);return!(F===null||typeof F==="undefined")};$i.isExist=function(D){return typeof D!=="undefined"};$i.isEmptyObject=function(D){return Object.keys(D).length===0};$i.merge=function(D,F,E){if(F){const w=Object.keys(F),$=w.length;for(let C=0;C<$;C++)if(E==="strict")D[w[C]]=[F[w[C]]];else D[w[C]]=F[w[C]]}};$i.getValue=function(D){if($i.isExist(D))return D;else return""};$i.isName=wi;$i.getAllMatches=Ei;$i.nameRegexp=iX});var V9=W((Ti)=>{function aX(D){return D===" "||D==="\t"||D==="\n"||D==="\r"}function oX(D,F){const E=F;for(;F<D.length;F++)if(D[F]=="?"||D[F]==" "){const w=D.substr(E,F-E);if(F>5&&w==="xml")return kD("InvalidXml","XML declaration allowed only at the start of the document.",h0(D,F));else if(D[F]=="?"&&D[F+1]==">"){F++;break}else continue}return F}function tX(D,F){if(D.length>F+5&&D[F+1]==="-"&&D[F+2]==="-"){for(F+=3;F<D.length;F++)if(D[F]==="-"&&D[F+1]==="-"&&D[F+2]===">"){F+=2;break}}else if(D.length>F+8&&D[F+1]==="D"&&D[F+2]==="O"&&D[F+3]==="C"&&D[F+4]==="T"&&D[F+5]==="Y"&&D[F+6]==="P"&&D[F+7]==="E"){let E=1;for(F+=8;F<D.length;F++)if(D[F]==="<")E++;else if(D[F]===">"){if(E--,E===0)break}}else if(D.length>F+9&&D[F+1]==="["&&D[F+2]==="C"&&D[F+3]==="D"&&D[F+4]==="A"&&D[F+5]==="T"&&D[F+6]==="A"&&D[F+7]==="["){for(F+=8;F<D.length;F++)if(D[F]==="]"&&D[F+1]==="]"&&D[F+2]===">"){F+=2;break}}return F}function Yi(D,F){let E="",w="",$=!1;for(;F<D.length;F++){if(D[F]===Mi||D[F]===Gi)if(w==="")w=D[F];else if(w!==D[F]);else w="";else if(D[F]===">"){if(w===""){$=!0;break}}E+=D[F]}if(w!=="")return!1;return{value:E,index:F,tagClosed:$}}function eX(D,F){const E=R9.getAllMatches(D,Zi),w={};for(let $=0;$<E.length;$++){if(E[$][1].length===0)return kD("InvalidAttr","Attribute '"+E[$][2]+"' has no space in starting.",w3(E[$]));else if(E[$][3]!==void 0&&E[$][4]===void 0)return kD("InvalidAttr","Attribute '"+E[$][2]+"' is without value.",w3(E[$]));else if(E[$][3]===void 0&&!F.allowBooleanAttributes)return kD("InvalidAttr","boolean attribute '"+E[$][2]+"' is not allowed.",w3(E[$]));const C=E[$][2];if(!Ji(C))return kD("InvalidAttr","Attribute '"+C+"' is an invalid name.",w3(E[$]));if(!w.hasOwnProperty(C))w[C]=1;else return kD("InvalidAttr","Attribute '"+C+"' is repeated.",w3(E[$]))}return!0}function Wi(D,F){let E=/\d/;if(D[F]==="x")F++,E=/[\da-fA-F]/;for(;F<D.length;F++){if(D[F]===";")return F;if(!D[F].match(E))break}return-1}function Xi(D,F){if(F++,D[F]===";")return-1;if(D[F]==="#")return F++,Wi(D,F);let E=0;for(;F<D.length;F++,E++){if(D[F].match(/\w/)&&E<20)continue;if(D[F]===";")break;return-1}return F}function kD(D,F,E){return{err:{code:D,msg:F,line:E.line||E,col:E.col}}}function Ji(D){return R9.isName(D)}function zi(D){return R9.isName(D)}function h0(D,F){const E=D.substring(0,F).split(/\r?\n/);return{line:E.length,col:E[E.length-1].length+1}}function w3(D){return D.startIndex+D[1].length}var R9=bw(),Ii={allowBooleanAttributes:!1,unpairedTags:[]};Ti.validate=function(D,F){F=Object.assign({},Ii,F);const E=[];let w=!1,$=!1;if(D[0]==="\uFEFF")D=D.substr(1);for(let C=0;C<D.length;C++)if(D[C]==="<"&&D[C+1]==="?"){if(C+=2,C=oX(D,C),C.err)return C}else if(D[C]==="<"){let f=C;if(C++,D[C]==="!"){C=tX(D,C);continue}else{let B=!1;if(D[C]==="/")B=!0,C++;let h="";for(;C<D.length&&D[C]!==">"&&D[C]!==" "&&D[C]!=="\t"&&D[C]!=="\n"&&D[C]!=="\r";C++)h+=D[C];if(h=h.trim(),h[h.length-1]==="/")h=h.substring(0,h.length-1),C--;if(!zi(h)){let A;if(h.trim().length===0)A="Invalid space after '<'.";else A="Tag '"+h+"' is an invalid name.";return kD("InvalidTag",A,h0(D,C))}const U=Yi(D,C);if(U===!1)return kD("InvalidAttr","Attributes for '"+h+"' have open quote.",h0(D,C));let I=U.value;if(C=U.index,I[I.length-1]==="/"){const A=C-I.length;I=I.substring(0,I.length-1);const Y=eX(I,F);if(Y===!0)w=!0;else return kD(Y.err.code,Y.err.msg,h0(D,A+Y.err.line))}else if(B)if(!U.tagClosed)return kD("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",h0(D,C));else if(I.trim().length>0)return kD("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",h0(D,f));else if(E.length===0)return kD("InvalidTag","Closing tag '"+h+"' has not been opened.",h0(D,f));else{const A=E.pop();if(h!==A.tagName){let Y=h0(D,A.tagStartPos);return kD("InvalidTag","Expected closing tag '"+A.tagName+"' (opened in line "+Y.line+", col "+Y.col+") instead of closing tag '"+h+"'.",h0(D,f))}if(E.length==0)$=!0}else{const A=eX(I,F);if(A!==!0)return kD(A.err.code,A.err.msg,h0(D,C-I.length+A.err.line));if($===!0)return kD("InvalidXml","Multiple possible root nodes found.",h0(D,C));else if(F.unpairedTags.indexOf(h)!==-1);else E.push({tagName:h,tagStartPos:f});w=!0}for(C++;C<D.length;C++)if(D[C]==="<")if(D[C+1]==="!"){C++,C=tX(D,C);continue}else if(D[C+1]==="?"){if(C=oX(D,++C),C.err)return C}else break;else if(D[C]==="&"){const A=Xi(D,C);if(A==-1)return kD("InvalidChar","char '&' is not expected.",h0(D,C));C=A}else if($===!0&&!aX(D[C]))return kD("InvalidXml","Extra text at the end",h0(D,C));if(D[C]==="<")C--}}else{if(aX(D[C]))continue;return kD("InvalidChar","char '"+D[C]+"' is not expected.",h0(D,C))}if(!w)return kD("InvalidXml","Start tag expected.",1);else if(E.length==1)return kD("InvalidTag","Unclosed tag '"+E[0].tagName+"'.",h0(D,E[0].tagStartPos));else if(E.length>0)return kD("InvalidXml","Invalid '"+JSON.stringify(E.map((C)=>C.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0};var Mi='"',Gi="'",Zi=new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?',"g")});var FJ=W((Qi)=>{var DJ={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(D,F){return F},attributeValueProcessor:function(D,F){return F},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(D,F,E){return D}},Si=function(D){return Object.assign({},DJ,D)};Qi.buildOptions=Si;Qi.defaultOptions=DJ});var $J=W((e5D,wJ)=>{class EJ{constructor(D){this.tagname=D,this.child=[],this[":@"]={}}add(D,F){if(D==="__proto__")D="#__proto__";this.child.push({[D]:F})}addChild(D){if(D.tagname==="__proto__")D.tagname="#__proto__";if(D[":@"]&&Object.keys(D[":@"]).length>0)this.child.push({[D.tagname]:D.child,[":@"]:D[":@"]});else this.child.push({[D.tagname]:D.child})}}wJ.exports=EJ});var CJ=W((DCD,fJ)=>{function Vi(D,F){const E={};if(D[F+3]==="O"&&D[F+4]==="C"&&D[F+5]==="T"&&D[F+6]==="Y"&&D[F+7]==="P"&&D[F+8]==="E"){F=F+9;let w=1,$=!1,C=!1,f="";for(;F<D.length;F++)if(D[F]==="<"&&!C){if($&&Oi(D,F)){if(F+=7,[entityName,val,F]=Ni(D,F+1),val.indexOf("&")===-1)E[ki(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if($&&ji(D,F))F+=8;else if($&&Pi(D,F))F+=8;else if($&&yi(D,F))F+=9;else if(qi)C=!0;else throw new Error("Invalid DOCTYPE");w++,f=""}else if(D[F]===">"){if(C){if(D[F-1]==="-"&&D[F-2]==="-")C=!1,w--}else w--;if(w===0)break}else if(D[F]==="[")$=!0;else f+=D[F];if(w!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:E,i:F}}function Ni(D,F){let E="";for(;F<D.length&&(D[F]!=="'"&&D[F]!=='"');F++)E+=D[F];if(E=E.trim(),E.indexOf(" ")!==-1)throw new Error("External entites are not supported");const w=D[F++];let $="";for(;F<D.length&&D[F]!==w;F++)$+=D[F];return[E,$,F]}function qi(D,F){if(D[F+1]==="!"&&D[F+2]==="-"&&D[F+3]==="-")return!0;return!1}function Oi(D,F){if(D[F+1]==="!"&&D[F+2]==="E"&&D[F+3]==="N"&&D[F+4]==="T"&&D[F+5]==="I"&&D[F+6]==="T"&&D[F+7]==="Y")return!0;return!1}function ji(D,F){if(D[F+1]==="!"&&D[F+2]==="E"&&D[F+3]==="L"&&D[F+4]==="E"&&D[F+5]==="M"&&D[F+6]==="E"&&D[F+7]==="N"&&D[F+8]==="T")return!0;return!1}function Pi(D,F){if(D[F+1]==="!"&&D[F+2]==="A"&&D[F+3]==="T"&&D[F+4]==="T"&&D[F+5]==="L"&&D[F+6]==="I"&&D[F+7]==="S"&&D[F+8]==="T")return!0;return!1}function yi(D,F){if(D[F+1]==="!"&&D[F+2]==="N"&&D[F+3]==="O"&&D[F+4]==="T"&&D[F+5]==="A"&&D[F+6]==="T"&&D[F+7]==="I"&&D[F+8]==="O"&&D[F+9]==="N")return!0;return!1}function ki(D){if(Ri.isName(D))return D;else throw new Error(`Invalid entity name ${D}`)}var Ri=bw();fJ.exports=Vi});var hJ=W((FCD,BJ)=>{function gi(D,F={}){if(F=Object.assign({},ci,F),!D||typeof D!=="string")return D;let E=D.trim();if(F.skipLike!==void 0&&F.skipLike.test(E))return D;else if(F.hex&&bi.test(E))return Number.parseInt(E,16);else{const w=xi.exec(E);if(w){const $=w[1],C=w[2];let f=ri(w[3]);const B=w[4]||w[6];if(!F.leadingZeros&&C.length>0&&$&&E[2]!==".")return D;else if(!F.leadingZeros&&C.length>0&&!$&&E[1]!==".")return D;else{const h=Number(E),U=""+h;if(U.search(/[eE]/)!==-1)if(F.eNotation)return h;else return D;else if(B)if(F.eNotation)return h;else return D;else if(E.indexOf(".")!==-1)if(U==="0"&&f==="")return h;else if(U===f)return h;else if($&&U==="-"+f)return h;else return D;if(C)if(f===U)return h;else if($+f===U)return h;else return D;if(E===U)return h;else if(E===$+U)return h;return D}}else return D}}function ri(D){if(D&&D.indexOf(".")!==-1){if(D=D.replace(/0+$/,""),D===".")D="0";else if(D[0]===".")D="0"+D;else if(D[D.length-1]===".")D=D.substr(0,D.length-1);return D}return D}var bi=/^[-+]?0x[a-fA-F0-9]+$/,xi=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;if(!Number.parseInt&&window.parseInt)Number.parseInt=window.parseInt;if(!Number.parseFloat&&window.parseFloat)Number.parseFloat=window.parseFloat;var ci={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};BJ.exports=gi});var MJ=W((ECD,IJ)=>{function ui(D){const F=Object.keys(D);for(let E=0;E<F.length;E++){const w=F[E];this.lastEntities[w]={regex:new RegExp("&"+w+";","g"),val:D[w]}}}function di(D,F,E,w,$,C,f){if(D!==void 0){if(this.options.trimValues&&!w)D=D.trim();if(D.length>0){if(!f)D=this.replaceEntitiesValue(D);const B=this.options.tagValueProcessor(F,D,E,$,C);if(B===null||B===void 0)return D;else if(typeof B!==typeof D||B!==D)return B;else if(this.options.trimValues)return q9(D,this.options.parseTagValue,this.options.numberParseOptions);else if(D.trim()===D)return q9(D,this.options.parseTagValue,this.options.numberParseOptions);else return D}}}function vi(D){if(this.options.removeNSPrefix){const F=D.split(":"),E=D.charAt(0)==="/"?"/":"";if(F[0]==="xmlns")return"";if(F.length===2)D=E+F[1]}return D}function ni(D,F,E){if(!this.options.ignoreAttributes&&typeof D==="string"){const w=UJ.getAllMatches(D,mi),$=w.length,C={};for(let f=0;f<$;f++){const B=this.resolveNameSpace(w[f][1]);let h=w[f][4],U=this.options.attributeNamePrefix+B;if(B.length){if(this.options.transformAttributeName)U=this.options.transformAttributeName(U);if(U==="__proto__")U="#__proto__";if(h!==void 0){if(this.options.trimValues)h=h.trim();h=this.replaceEntitiesValue(h);const I=this.options.attributeValueProcessor(B,h,F);if(I===null||I===void 0)C[U]=h;else if(typeof I!==typeof h||I!==h)C[U]=I;else C[U]=q9(h,this.options.parseAttributeValue,this.options.numberParseOptions)}else if(this.options.allowBooleanAttributes)C[U]=!0}}if(!Object.keys(C).length)return;if(this.options.attributesGroupName){const f={};return f[this.options.attributesGroupName]=C,f}return C}}function ii(D,F,E){const w=this.options.updateTag(F.tagname,E,F[":@"]);if(w===!1);else if(typeof w==="string")F.tagname=w,D.addChild(F);else D.addChild(F)}function ai(D,F,E,w){if(D){if(w===void 0)w=Object.keys(F.child).length===0;if(D=this.parseTextData(D,F.tagname,E,!1,F[":@"]?Object.keys(F[":@"]).length!==0:!1,w),D!==void 0&&D!=="")F.add(this.options.textNodeName,D);D=""}return D}function oi(D,F,E){const w="*."+E;for(let $ in D){const C=D[$];if(w===C||F===C)return!0}return!1}function ti(D,F,E=">"){let w,$="";for(let C=F;C<D.length;C++){let f=D[C];if(w){if(f===w)w=""}else if(f==='"'||f==="'")w=f;else if(f===E[0])if(E[1]){if(D[C+1]===E[1])return{data:$,index:C}}else return{data:$,index:C};else if(f==="\t")f=" ";$+=f}}function o8(D,F,E,w){const $=D.indexOf(F,E);if($===-1)throw new Error(w);else return $+F.length-1}function N9(D,F,E,w=">"){const $=ti(D,F+1,w);if(!$)return;let C=$.data;const f=$.index,B=C.search(/\s/);let h=C,U=!0;if(B!==-1)h=C.substring(0,B),C=C.substring(B+1).trimStart();const I=h;if(E){const A=h.indexOf(":");if(A!==-1)h=h.substr(A+1),U=h!==$.data.substr(A+1)}return{tagName:h,tagExp:C,closeIndex:f,attrExpPresent:U,rawTagName:I}}function ei(D,F,E){const w=E;let $=1;for(;E<D.length;E++)if(D[E]==="<")if(D[E+1]==="/"){const C=o8(D,">",E,`${F} is not closed`);if(D.substring(E+2,C).trim()===F){if($--,$===0)return{tagContent:D.substring(w,E),i:C}}E=C}else if(D[E+1]==="?")E=o8(D,"?>",E+1,"StopNode is not closed.");else if(D.substr(E+1,3)==="!--")E=o8(D,"-->",E+3,"StopNode is not closed.");else if(D.substr(E+1,2)==="![")E=o8(D,"]]>",E,"StopNode is not closed.")-2;else{const C=N9(D,E,">");if(C){if((C&&C.tagName)===F&&C.tagExp[C.tagExp.length-1]!=="/")$++;E=C.closeIndex}}}function q9(D,F,E){if(F&&typeof D==="string"){const w=D.trim();if(w==="true")return!0;else if(w==="false")return!1;else return si(D,E)}else if(UJ.isExist(D))return D;else return""}var UJ=bw(),$3=$J(),_i=CJ(),si=hJ();class AJ{constructor(D){this.options=D,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:"\""}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(F,E)=>String.fromCharCode(Number.parseInt(E,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(F,E)=>String.fromCharCode(Number.parseInt(E,16))}},this.addExternalEntities=ui,this.parseXml=li,this.parseTextData=di,this.resolveNameSpace=vi,this.buildAttributesMap=ni,this.isItStopNode=oi,this.replaceEntitiesValue=pi,this.readStopNodeData=ei,this.saveTextToParentTag=ai,this.addChild=ii}}var mi=new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?',"gm"),li=function(D){D=D.replace(/\r\n?/g,"\n");const F=new $3("!xml");let E=F,w="",$="";for(let C=0;C<D.length;C++)if(D[C]==="<")if(D[C+1]==="/"){const B=o8(D,">",C,"Closing Tag is not closed.");let h=D.substring(C+2,B).trim();if(this.options.removeNSPrefix){const A=h.indexOf(":");if(A!==-1)h=h.substr(A+1)}if(this.options.transformTagName)h=this.options.transformTagName(h);if(E)w=this.saveTextToParentTag(w,E,$);const U=$.substring($.lastIndexOf(".")+1);if(h&&this.options.unpairedTags.indexOf(h)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${h}>`);let I=0;if(U&&this.options.unpairedTags.indexOf(U)!==-1)I=$.lastIndexOf(".",$.lastIndexOf(".")-1),this.tagsNodeStack.pop();else I=$.lastIndexOf(".");$=$.substring(0,I),E=this.tagsNodeStack.pop(),w="",C=B}else if(D[C+1]==="?"){let B=N9(D,C,!1,"?>");if(!B)throw new Error("Pi Tag is not closed.");if(w=this.saveTextToParentTag(w,E,$),this.options.ignoreDeclaration&&B.tagName==="?xml"||this.options.ignorePiTags);else{const h=new $3(B.tagName);if(h.add(this.options.textNodeName,""),B.tagName!==B.tagExp&&B.attrExpPresent)h[":@"]=this.buildAttributesMap(B.tagExp,$,B.tagName);this.addChild(E,h,$)}C=B.closeIndex+1}else if(D.substr(C+1,3)==="!--"){const B=o8(D,"-->",C+4,"Comment is not closed.");if(this.options.commentPropName){const h=D.substring(C+4,B-2);w=this.saveTextToParentTag(w,E,$),E.add(this.options.commentPropName,[{[this.options.textNodeName]:h}])}C=B}else if(D.substr(C+1,2)==="!D"){const B=_i(D,C);this.docTypeEntities=B.entities,C=B.i}else if(D.substr(C+1,2)==="!["){const B=o8(D,"]]>",C,"CDATA is not closed.")-2,h=D.substring(C+9,B);w=this.saveTextToParentTag(w,E,$);let U=this.parseTextData(h,E.tagname,$,!0,!1,!0,!0);if(U==null)U="";if(this.options.cdataPropName)E.add(this.options.cdataPropName,[{[this.options.textNodeName]:h}]);else E.add(this.options.textNodeName,U);C=B+2}else{let B=N9(D,C,this.options.removeNSPrefix),h=B.tagName;const U=B.rawTagName;let{tagExp:I,attrExpPresent:A,closeIndex:Y}=B;if(this.options.transformTagName)h=this.options.transformTagName(h);if(E&&w){if(E.tagname!=="!xml")w=this.saveTextToParentTag(w,E,$,!1)}const M=E;if(M&&this.options.unpairedTags.indexOf(M.tagname)!==-1)E=this.tagsNodeStack.pop(),$=$.substring(0,$.lastIndexOf("."));if(h!==F.tagname)$+=$?"."+h:h;if(this.isItStopNode(this.options.stopNodes,$,h)){let Z="";if(I.length>0&&I.lastIndexOf("/")===I.length-1){if(h[h.length-1]==="/")h=h.substr(0,h.length-1),$=$.substr(0,$.length-1),I=h;else I=I.substr(0,I.length-1);C=B.closeIndex}else if(this.options.unpairedTags.indexOf(h)!==-1)C=B.closeIndex;else{const X=this.readStopNodeData(D,U,Y+1);if(!X)throw new Error(`Unexpected end of ${U}`);C=X.i,Z=X.tagContent}const z=new $3(h);if(h!==I&&A)z[":@"]=this.buildAttributesMap(I,$,h);if(Z)Z=this.parseTextData(Z,h,$,!0,A,!0,!0);$=$.substr(0,$.lastIndexOf(".")),z.add(this.options.textNodeName,Z),this.addChild(E,z,$)}else{if(I.length>0&&I.lastIndexOf("/")===I.length-1){if(h[h.length-1]==="/")h=h.substr(0,h.length-1),$=$.substr(0,$.length-1),I=h;else I=I.substr(0,I.length-1);if(this.options.transformTagName)h=this.options.transformTagName(h);const Z=new $3(h);if(h!==I&&A)Z[":@"]=this.buildAttributesMap(I,$,h);this.addChild(E,Z,$),$=$.substr(0,$.lastIndexOf("."))}else{const Z=new $3(h);if(this.tagsNodeStack.push(E),h!==I&&A)Z[":@"]=this.buildAttributesMap(I,$,h);this.addChild(E,Z,$),E=Z}w="",C=Y}}else w+=D[C];return F.child},pi=function(D){if(this.options.processEntities){for(let F in this.docTypeEntities){const E=this.docTypeEntities[F];D=D.replace(E.regx,E.val)}for(let F in this.lastEntities){const E=this.lastEntities[F];D=D.replace(E.regex,E.val)}if(this.options.htmlEntities)for(let F in this.htmlEntities){const E=this.htmlEntities[F];D=D.replace(E.regex,E.val)}D=D.replace(this.ampEntity.regex,this.ampEntity.val)}return D};IJ.exports=AJ});var YJ=W(($p)=>{function Dp(D,F){return GJ(D,F)}function GJ(D,F,E){let w;const $={};for(let C=0;C<D.length;C++){const f=D[C],B=Fp(f);let h="";if(E===void 0)h=B;else h=E+"."+B;if(B===F.textNodeName)if(w===void 0)w=f[B];else w+=""+f[B];else if(B===void 0)continue;else if(f[B]){let U=GJ(f[B],F,h);const I=wp(U,F);if(f[":@"])Ep(U,f[":@"],h,F);else if(Object.keys(U).length===1&&U[F.textNodeName]!==void 0&&!F.alwaysCreateTextNode)U=U[F.textNodeName];else if(Object.keys(U).length===0)if(F.alwaysCreateTextNode)U[F.textNodeName]="";else U="";if($[B]!==void 0&&$.hasOwnProperty(B)){if(!Array.isArray($[B]))$[B]=[$[B]];$[B].push(U)}else if(F.isArray(B,h,I))$[B]=[U];else $[B]=U}}if(typeof w==="string"){if(w.length>0)$[F.textNodeName]=w}else if(w!==void 0)$[F.textNodeName]=w;return $}function Fp(D){const F=Object.keys(D);for(let E=0;E<F.length;E++){const w=F[E];if(w!==":@")return w}}function Ep(D,F,E,w){if(F){const $=Object.keys(F),C=$.length;for(let f=0;f<C;f++){const B=$[f];if(w.isArray(B,E+"."+B,!0,!0))D[B]=[F[B]];else D[B]=F[B]}}}function wp(D,F){const{textNodeName:E}=F,w=Object.keys(D).length;if(w===0)return!0;if(w===1&&(D[E]||typeof D[E]==="boolean"||D[E]===0))return!0;return!1}$p.prettify=Dp});var XJ=W(($CD,WJ)=>{var{buildOptions:Cp}=FJ(),Bp=MJ(),{prettify:hp}=YJ(),Up=V9();class ZJ{constructor(D){this.externalEntities={},this.options=Cp(D)}parse(D,F){if(typeof D==="string");else if(D.toString)D=D.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(F){if(F===!0)F={};const $=Up.validate(D,F);if($!==!0)throw Error(`${$.err.msg}:${$.err.line}:${$.err.col}`)}const E=new Bp(this.options);E.addExternalEntities(this.externalEntities);const w=E.parseXml(D);if(this.options.preserveOrder||w===void 0)return w;else return hp(w,this.options)}addEntity(D,F){if(F.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");else if(D.indexOf("&")!==-1||D.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");else if(F==="&")throw new Error("An entity with value '&' is not permitted");else this.externalEntities[D]=F}}WJ.exports=ZJ});var SJ=W((fCD,KJ)=>{function Ap(D,F){let E="";if(F.format&&F.indentBy.length>0)E="\n";return zJ(D,F,"",E)}function zJ(D,F,E,w){let $="",C=!1;for(let f=0;f<D.length;f++){const B=D[f],h=Ip(B);if(h===void 0)continue;let U="";if(E.length===0)U=h;else U=`${E}.${h}`;if(h===F.textNodeName){let Z=B[h];if(!Mp(U,F))Z=F.tagValueProcessor(h,Z),Z=TJ(Z,F);if(C)$+=w;$+=Z,C=!1;continue}else if(h===F.cdataPropName){if(C)$+=w;$+=`<![CDATA[${B[h][0][F.textNodeName]}]]>`,C=!1;continue}else if(h===F.commentPropName){$+=w+`<!--${B[h][0][F.textNodeName]}-->`,C=!0;continue}else if(h[0]==="?"){const Z=JJ(B[":@"],F),z=h==="?xml"?"":w;let X=B[h][0][F.textNodeName];X=X.length!==0?" "+X:"",$+=z+`<${h}${X}${Z}?>`,C=!0;continue}let I=w;if(I!=="")I+=F.indentBy;const A=JJ(B[":@"],F),Y=w+`<${h}${A}`,M=zJ(B[h],F,U,I);if(F.unpairedTags.indexOf(h)!==-1)if(F.suppressUnpairedNode)$+=Y+">";else $+=Y+"/>";else if((!M||M.length===0)&&F.suppressEmptyNode)$+=Y+"/>";else if(M&&M.endsWith(">"))$+=Y+`>${M}${w}</${h}>`;else{if($+=Y+">",M&&w!==""&&(M.includes("/>")||M.includes("</")))$+=w+F.indentBy+M+w;else $+=M;$+=`</${h}>`}C=!0}return $}function Ip(D){const F=Object.keys(D);for(let E=0;E<F.length;E++){const w=F[E];if(!D.hasOwnProperty(w))continue;if(w!==":@")return w}}function JJ(D,F){let E="";if(D&&!F.ignoreAttributes)for(let w in D){if(!D.hasOwnProperty(w))continue;let $=F.attributeValueProcessor(w,D[w]);if($=TJ($,F),$===!0&&F.suppressBooleanAttributes)E+=` ${w.substr(F.attributeNamePrefix.length)}`;else E+=` ${w.substr(F.attributeNamePrefix.length)}="${$}"`}return E}function Mp(D,F){D=D.substr(0,D.length-F.textNodeName.length-1);let E=D.substr(D.lastIndexOf(".")+1);for(let w in F.stopNodes)if(F.stopNodes[w]===D||F.stopNodes[w]==="*."+E)return!0;return!1}function TJ(D,F){if(D&&D.length>0&&F.processEntities)for(let E=0;E<F.entities.length;E++){const w=F.entities[E];D=D.replace(w.regex,w.val)}return D}KJ.exports=Ap});var HJ=W((CCD,QJ)=>{function U8(D){if(this.options=Object.assign({},Yp,D),this.options.ignoreAttributes||this.options.attributesGroupName)this.isAttribute=function(){return!1};else this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Xp;if(this.processTextOrObjNode=Zp,this.options.format)this.indentate=Wp,this.tagEndChar=">\n",this.newLine="\n";else this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""}function Zp(D,F,E){const w=this.j2x(D,E+1);if(D[this.options.textNodeName]!==void 0&&Object.keys(D).length===1)return this.buildTextValNode(D[this.options.textNodeName],F,w.attrStr,E);else return this.buildObjectNode(w.val,F,w.attrStr,E)}function Wp(D){return this.options.indentBy.repeat(D)}function Xp(D){if(D.startsWith(this.options.attributeNamePrefix)&&D!==this.options.textNodeName)return D.substr(this.attrPrefixLen);else return!1}var Gp=SJ(),Yp={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(D,F){return F},attributeValueProcessor:function(D,F){return F},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("\'","g"),val:"'"},{regex:new RegExp("\"","g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};U8.prototype.build=function(D){if(this.options.preserveOrder)return Gp(D,this.options);else{if(Array.isArray(D)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1)D={[this.options.arrayNodeName]:D};return this.j2x(D,0).val}};U8.prototype.j2x=function(D,F){let E="",w="";for(let $ in D){if(!Object.prototype.hasOwnProperty.call(D,$))continue;if(typeof D[$]==="undefined"){if(this.isAttribute($))w+=""}else if(D[$]===null)if(this.isAttribute($))w+="";else if($[0]==="?")w+=this.indentate(F)+"<"+$+"?"+this.tagEndChar;else w+=this.indentate(F)+"<"+$+"/"+this.tagEndChar;else if(D[$]instanceof Date)w+=this.buildTextValNode(D[$],$,"",F);else if(typeof D[$]!=="object"){const C=this.isAttribute($);if(C)E+=this.buildAttrPairStr(C,""+D[$]);else if($===this.options.textNodeName){let f=this.options.tagValueProcessor($,""+D[$]);w+=this.replaceEntitiesValue(f)}else w+=this.buildTextValNode(D[$],$,"",F)}else if(Array.isArray(D[$])){const C=D[$].length;let f="",B="";for(let h=0;h<C;h++){const U=D[$][h];if(typeof U==="undefined");else if(U===null)if($[0]==="?")w+=this.indentate(F)+"<"+$+"?"+this.tagEndChar;else w+=this.indentate(F)+"<"+$+"/"+this.tagEndChar;else if(typeof U==="object")if(this.options.oneListGroup){const I=this.j2x(U,F+1);if(f+=I.val,this.options.attributesGroupName&&U.hasOwnProperty(this.options.attributesGroupName))B+=I.attrStr}else f+=this.processTextOrObjNode(U,$,F);else if(this.options.oneListGroup){let I=this.options.tagValueProcessor($,U);I=this.replaceEntitiesValue(I),f+=I}else f+=this.buildTextValNode(U,$,"",F)}if(this.options.oneListGroup)f=this.buildObjectNode(f,$,B,F);w+=f}else if(this.options.attributesGroupName&&$===this.options.attributesGroupName){const C=Object.keys(D[$]),f=C.length;for(let B=0;B<f;B++)E+=this.buildAttrPairStr(C[B],""+D[$][C[B]])}else w+=this.processTextOrObjNode(D[$],$,F)}return{attrStr:E,val:w}};U8.prototype.buildAttrPairStr=function(D,F){if(F=this.options.attributeValueProcessor(D,""+F),F=this.replaceEntitiesValue(F),this.options.suppressBooleanAttributes&&F==="true")return" "+D;else return" "+D+'="'+F+'"'};U8.prototype.buildObjectNode=function(D,F,E,w){if(D==="")if(F[0]==="?")return this.indentate(w)+"<"+F+E+"?"+this.tagEndChar;else return this.indentate(w)+"<"+F+E+this.closeTag(F)+this.tagEndChar;else{let $="</"+F+this.tagEndChar,C="";if(F[0]==="?")C="?",$="";if((E||E==="")&&D.indexOf("<")===-1)return this.indentate(w)+"<"+F+E+C+">"+D+$;else if(this.options.commentPropName!==!1&&F===this.options.commentPropName&&C.length===0)return this.indentate(w)+`<!--${D}-->`+this.newLine;else return this.indentate(w)+"<"+F+E+C+this.tagEndChar+D+this.indentate(w)+$}};U8.prototype.closeTag=function(D){let F="";if(this.options.unpairedTags.indexOf(D)!==-1){if(!this.options.suppressUnpairedNode)F="/"}else if(this.options.suppressEmptyNode)F="/";else F=`></${D}`;return F};U8.prototype.buildTextValNode=function(D,F,E,w){if(this.options.cdataPropName!==!1&&F===this.options.cdataPropName)return this.indentate(w)+`<![CDATA[${D}]]>`+this.newLine;else if(this.options.commentPropName!==!1&&F===this.options.commentPropName)return this.indentate(w)+`<!--${D}-->`+this.newLine;else if(F[0]==="?")return this.indentate(w)+"<"+F+E+"?"+this.tagEndChar;else{let $=this.options.tagValueProcessor(F,D);if($=this.replaceEntitiesValue($),$==="")return this.indentate(w)+"<"+F+E+this.closeTag(F)+this.tagEndChar;else return this.indentate(w)+"<"+F+E+">"+$+"</"+F+this.tagEndChar}};U8.prototype.replaceEntitiesValue=function(D){if(D&&D.length>0&&this.options.processEntities)for(let F=0;F<this.options.entities.length;F++){const E=this.options.entities[F];D=D.replace(E.regex,E.val)}return D};QJ.exports=U8});var RJ=W((BCD,LJ)=>{var Jp=V9(),zp=XJ(),Tp=HJ();LJ.exports={XMLParser:zp,XMLValidator:Jp,XMLBuilder:Tp}});var PJ=W((hCD,jJ)=>{var{defineProperty:xw,getOwnPropertyDescriptor:Kp,getOwnPropertyNames:Sp}=Object,Qp=Object.prototype.hasOwnProperty,O0=(D,F)=>xw(D,"name",{value:F,configurable:!0}),Hp=(D,F)=>{for(var E in F)xw(D,E,{get:F[E],enumerable:!0})},Lp=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Sp(F))if(!Qp.call(D,$)&&$!==E)xw(D,$,{get:()=>F[$],enumerable:!(w=Kp(F,$))||w.enumerable})}return D},Rp=(D)=>Lp(xw({},"__esModule",{value:!0}),D),VJ={};Hp(VJ,{_toBool:()=>Np,_toNum:()=>qp,_toStr:()=>Vp,awsExpectUnion:()=>jp,loadRestJsonErrorCode:()=>kp,loadRestXmlErrorCode:()=>gp,parseJsonBody:()=>qJ,parseJsonErrorBody:()=>yp,parseXmlBody:()=>OJ,parseXmlErrorBody:()=>cp});jJ.exports=Rp(VJ);var Vp=O0((D)=>{if(D==null)return D;if(typeof D==="number"||typeof D==="bigint"){const F=new Error(`Received number ${D} where a string was expected.`);return F.name="Warning",console.warn(F),String(D)}if(typeof D==="boolean"){const F=new Error(`Received boolean ${D} where a string was expected.`);return F.name="Warning",console.warn(F),String(D)}return D},"_toStr"),Np=O0((D)=>{if(D==null)return D;if(typeof D==="string"){const F=D.toLowerCase();if(D!==""&&F!=="false"&&F!=="true"){const E=new Error(`Received string "${D}" where a boolean was expected.`);E.name="Warning",console.warn(E)}return D!==""&&F!=="false"}return D},"_toBool"),qp=O0((D)=>{if(D==null)return D;if(typeof D==="string"){const F=Number(D);if(F.toString()!==D){const E=new Error(`Received string "${D}" where a number was expected.`);return E.name="Warning",console.warn(E),D}return F}return D},"_toNum"),Op=q6(),jp=O0((D)=>{if(D==null)return;if(typeof D==="object"&&"__type"in D)delete D.__type;return Op.expectUnion(D)},"awsExpectUnion"),Pp=q6(),NJ=O0((D,F)=>Pp.collectBody(D,F).then((E)=>F.utf8Encoder(E)),"collectBodyString"),qJ=O0((D,F)=>NJ(D,F).then((E)=>{if(E.length)try{return JSON.parse(E)}catch(w){if((w==null?void 0:w.name)==="SyntaxError")Object.defineProperty(w,"$responseBodyText",{value:E});throw w}return{}}),"parseJsonBody"),yp=O0(async(D,F)=>{const E=await qJ(D,F);return E.message=E.message??E.Message,E},"parseJsonErrorBody"),kp=O0((D,F)=>{const E=O0((C,f)=>Object.keys(C).find((B)=>B.toLowerCase()===f.toLowerCase()),"findKey"),w=O0((C)=>{let f=C;if(typeof f==="number")f=f.toString();if(f.indexOf(",")>=0)f=f.split(",")[0];if(f.indexOf(":")>=0)f=f.split(":")[0];if(f.indexOf("#")>=0)f=f.split("#")[1];return f},"sanitizeErrorCode"),$=E(D.headers,"x-amzn-errortype");if($!==void 0)return w(D.headers[$]);if(F.code!==void 0)return w(F.code);if(F.__type!==void 0)return w(F.__type)},"loadRestJsonErrorCode"),bp=q6(),xp=RJ(),OJ=O0((D,F)=>NJ(D,F).then((E)=>{if(E.length){const w=new xp.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(h,U)=>U.trim()===""&&U.includes("\n")?"":void 0});w.addEntity("#xD","\r"),w.addEntity("#10","\n");let $;try{$=w.parse(E,!0)}catch(h){if(h&&typeof h==="object")Object.defineProperty(h,"$responseBodyText",{value:E});throw h}const C="#text",f=Object.keys($)[0],B=$[f];if(B[C])B[f]=B[C],delete B[C];return bp.getValueFromTextNode(B)}return{}}),"parseXmlBody"),cp=O0(async(D,F)=>{const E=await OJ(D,F);if(E.Error)E.Error.message=E.Error.message??E.Error.Message;return E},"parseXmlErrorBody"),gp=O0((D,F)=>{var E;if(((E=F==null?void 0:F.Error)==null?void 0:E.Code)!==void 0)return F.Error.Code;if((F==null?void 0:F.Code)!==void 0)return F.Code;if(D.statusCode==404)return"NotFound"},"loadRestXmlErrorCode")});var PD=W((f3)=>{Object.defineProperty(f3,"__esModule",{value:!0});var O9=Z9();O9.__exportStar(B0(),f3);O9.__exportStar(lX(),f3);O9.__exportStar(PJ(),f3)});async function yJ(D,F,E){const w=E.request;if(typeof F.accountIdEndpointMode==="function")switch(await F.accountIdEndpointMode?.()){case"disabled":k6.setFeature(D,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":k6.setFeature(D,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":k6.setFeature(D,"ACCOUNT_ID_MODE_REQUIRED","R");break}const $=D.__smithy_context?.selectedHttpAuthScheme?.identity;if($?.$source){const C=$;if(C.accountId)k6.setFeature(D,"RESOLVED_ACCOUNT_ID","T");for(let[f,B]of Object.entries(C.$source??{}))k6.setFeature(D,f,B)}}var k6;var kJ=G(()=>{k6=L(PD(),1)});var j9="user-agent",cw="x-amz-user-agent",P9=" ",gw="/",bJ,xJ,y9="-";var cJ=G(()=>{bJ=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,xJ=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g});function gJ(D){let F="";for(let E in D){const w=D[E];if(F.length+w.length+1<=1024){if(F.length)F+=","+w;else F+=w;continue}break}return F}var rp=(D)=>(F,E)=>async(w)=>{const{request:$}=w;if(!rD.isInstance($))return F(w);const{headers:C}=$,f=E?.userAgent?.map(rw)||[],B=(await D.defaultUserAgentProvider()).map(rw);await yJ(E,D,w);const h=E;B.push(`m/${gJ(Object.assign({},E.__smithy_context?.features,h.__aws_sdk_context?.features))}`);const U=D?.customUserAgent?.map(rw)||[],I=await D.userAgentAppId();if(I)B.push(rw([`app/${I}`]));const A=OW(),Y=(A?[A]:[]).concat([...B,...f,...U]).join(P9),M=[...B.filter((Z)=>Z.startsWith("aws-sdk-")),...U].join(P9);if(D.runtime!=="browser"){if(M)C[cw]=C[cw]?`${C[j9]} ${M}`:M;C[j9]=Y}else C[cw]=Y;return F({...w,request:$})},rw=(D)=>{const F=D[0].split(gw).map((f)=>f.replace(bJ,y9)).join(gw),E=D[1]?.replace(xJ,y9),w=F.indexOf(gw),$=F.substring(0,w);let C=F.substring(w+1);if($==="api")C=C.toLowerCase();return[$,C,E].filter((f)=>f&&f.length>0).reduce((f,B,h)=>{switch(h){case 0:return B;case 1:return`${f}/${B}`;default:return`${f}#${B}`}},"")},_p,r2=(D)=>({applyToStack:(F)=>{F.add(rp(D),_p)}});var rJ=G(()=>{p8();vD();kJ();cJ();_p={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0}});var t8=G(()=>{uZ();rJ()});var b6=(D,F,E)=>{if(!(F in D))return;if(D[F]==="true")return!0;if(D[F]==="false")return!1;throw new Error(`Cannot load ${E} "${F}". Expected "true" or "false", got ${D[F]}.`)};var A8;var _J=G(()=>{(function(D){D.ENV="env",D.CONFIG="shared config entry"})(A8||(A8={}))});var k9=G(()=>{_J()});var sp="AWS_USE_DUALSTACK_ENDPOINT",up="use_dualstack_endpoint",_2;var sJ=G(()=>{k9();_2={environmentVariableSelector:(D)=>b6(D,sp,A8.ENV),configFileSelector:(D)=>b6(D,up,A8.CONFIG),default:!1}});var dp="AWS_USE_FIPS_ENDPOINT",vp="use_fips_endpoint",s2;var uJ=G(()=>{k9();s2={environmentVariableSelector:(D)=>b6(D,dp,A8.ENV),configFileSelector:(D)=>b6(D,vp,A8.CONFIG),default:!1}});var b9,m0=(D)=>D[b9.SMITHY_CONTEXT_KEY]||(D[b9.SMITHY_CONTEXT_KEY]={});var dJ=G(()=>{b9=L(J0(),1)});var sD=(D)=>{if(typeof D==="function")return D;const F=Promise.resolve(D);return()=>F};var W2=G(()=>{dJ()});var vJ=G(()=>{W2()});var mJ=G(()=>{W2()});var nJ=G(()=>{sJ();uJ();vJ();mJ()});var n0,u2;var lJ=G(()=>{n0={environmentVariableSelector:(D)=>D.AWS_REGION,configFileSelector:(D)=>D.region,default:()=>{throw new Error("Region is missing")}},u2={preferredFile:"credentials"}});var _w=(D)=>typeof D==="string"&&(D.startsWith("fips-")||D.endsWith("-fips"));var x9=(D)=>_w(D)?["fips-aws-global","aws-fips"].includes(D)?"us-east-1":D.replace(/fips-(dkr-|prod-)?|-fips/,""):D;var iJ=()=>{};var d2=(D)=>{const{region:F,useFipsEndpoint:E}=D;if(!F)throw new Error("Region is missing");return{...D,region:async()=>{if(typeof F==="string")return x9(F);const w=await F();return x9(w)},useFipsEndpoint:async()=>{const w=typeof F==="string"?F:await F();if(_w(w))return!0;return typeof E!=="function"?Promise.resolve(!!E):E()}}};var pJ=G(()=>{iJ()});var aJ=G(()=>{lJ();pJ()});var oJ=()=>{};var tJ=()=>{};var eJ=()=>{};var Dz=G(()=>{oJ();tJ();eJ()});var l0=G(()=>{nJ();aJ();Dz()});function mp(D){return(F)=>async(E)=>{const w=E.request;if(rD.isInstance(w)){const{body:$,headers:C}=w;if($&&Object.keys(C).map((f)=>f.toLowerCase()).indexOf(Ez)===-1)try{const f=D($);w.headers={...w.headers,[Ez]:String(f)}}catch(f){}}return F({...E,request:w})}}var Ez="content-length",np,v2=(D)=>({applyToStack:(F)=>{F.add(mp(D.bodyLengthChecker),np)}});var x6=G(()=>{vD();np={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0}});var wz=async(D)=>{const F=D?.Bucket||"";if(typeof D.Bucket==="string")D.Bucket=F.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(op(F)){if(D.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!ap(F)||F.indexOf(".")!==-1&&!String(D.Endpoint).startsWith("http:")||F.toLowerCase()!==F||F.length<3)D.ForcePathStyle=!0;if(D.DisableMultiRegionAccessPoints)D.disableMultiRegionAccessPoints=!0,D.DisableMRAP=!0;return D},lp,ip,pp,ap=(D)=>lp.test(D)&&!ip.test(D)&&!pp.test(D),op=(D)=>{const[F,E,w,,,$]=D.split(":"),C=F==="arn"&&D.split(":").length>=6,f=Boolean(C&&E&&w&&$);if(C&&!f)throw new Error(`Invalid ARN: ${D} was an invalid ARN.`);return f};var $z=G(()=>{lp=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,ip=/(\d+\.){3}\d+/,pp=/\.\./});var fz=G(()=>{$z()});var Cz=(D,F,E)=>{const w=async()=>{const $=E[D]??E[F];if(typeof $==="function")return $();return $};if(D==="credentialScope"||F==="CredentialScope")return async()=>{const $=typeof E.credentials==="function"?await E.credentials():E.credentials;return $?.credentialScope??$?.CredentialScope};if(D==="accountId"||F==="AccountId")return async()=>{const $=typeof E.credentials==="function"?await E.credentials():E.credentials;return $?.accountId??$?.AccountId};if(D==="endpoint"||F==="endpoint")return async()=>{const $=await w();if($&&typeof $==="object"){if("url"in $)return $.url.href;if("hostname"in $){const{protocol:C,hostname:f,port:B,path:h}=$;return`${C}//${f}${B?":"+B:""}${h}`}}return $};return w};var i0;var C3=G(()=>{i0=class i0 extends Error{constructor(D,F=!0){let E,w=!0;if(typeof F==="boolean")E=void 0,w=F;else if(F!=null&&typeof F==="object")E=F.logger,w=F.tryNextLink??!0;super(D);this.name="ProviderError",this.tryNextLink=w,Object.setPrototypeOf(this,i0.prototype),E?.debug?.(`@smithy/property-provider ${w?"->":"(!)"} ${D}`)}static from(D,F=!0){return Object.assign(new this(D.message,F),D)}}});var x;var Bz=G(()=>{C3();x=class x extends i0{constructor(D,F=!0){super(D,F);this.name="CredentialsProviderError",Object.setPrototypeOf(this,x.prototype)}}});var z0;var hz=G(()=>{C3();z0=class z0 extends i0{constructor(D,F=!0){super(D,F);this.name="TokenProviderError",Object.setPrototypeOf(this,z0.prototype)}}});var N1=(...D)=>async()=>{if(D.length===0)throw new i0("No providers in chain");let F;for(let E of D)try{return await E()}catch(w){if(F=w,w?.tryNextLink)continue;throw w}throw F};var Uz=G(()=>{C3()});var Az=(D)=>()=>Promise.resolve(D);var e8=(D,F,E)=>{let w,$,C,f=!1;const B=async()=>{if(!$)$=D();try{w=await $,C=!0,f=!1}finally{$=void 0}return w};if(F===void 0)return async(h)=>{if(!C||h?.forceRefresh)w=await B();return w};return async(h)=>{if(!C||h?.forceRefresh)w=await B();if(f)return w;if(E&&!E(w))return f=!0,w;if(F(w))return await B(),w;return w}};var fD=G(()=>{Bz();C3();hz();Uz()});function sw(D){try{const F=new Set(Array.from(D.match(/([A-Z_]){3,}/g)??[]));return F.delete("CONFIG"),F.delete("CONFIG_PREFIX_SEPARATOR"),F.delete("ENV"),[...F].join(", ")}catch(F){return D}}var Iz=(D,F)=>async()=>{try{const E=D(process.env);if(E===void 0)throw new Error;return E}catch(E){throw new x(E.message||`Not found in ENV: ${sw(D.toString())}`,{logger:F})}};var Mz=G(()=>{fD()});import{homedir as tp}from"os";import{sep as ep}from"path";var c9,Da=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},I8=()=>{const{HOME:D,USERPROFILE:F,HOMEPATH:E,HOMEDRIVE:w=`C:${ep}`}=process.env;if(D)return D;if(F)return F;if(E)return`${w}${E}`;const $=Da();if(!c9[$])c9[$]=tp();return c9[$]};var c6=G(()=>{c9={}});var Gz="AWS_PROFILE",p0=(D)=>D.profile||process.env.AWS_PROFILE||"default";import{createHash as Fa}from"crypto";import{join as Ea}from"path";var uw=(D)=>{const E=Fa("sha1").update(D).digest("hex");return Ea(I8(),".aws","sso","cache",`${E}.json`)};var g9=G(()=>{c6()});import{promises as wa}from"fs";var $a,dw=async(D)=>{const F=uw(D),E=await $a(F,"utf8");return JSON.parse(E)};var Yz=G(()=>{g9();({readFile:$a}=wa)});var r9,Zz=(D)=>Object.entries(D).filter(([F])=>{const E=F.indexOf(a0);if(E===-1)return!1;return Object.values(r9.IniSectionType).includes(F.substring(0,E))}).reduce((F,[E,w])=>{const $=E.indexOf(a0),C=E.substring(0,$)===r9.IniSectionType.PROFILE?E.substring($+1):E;return F[C]=w,F},{...D.default&&{default:D.default}});var Wz=G(()=>{r9=L(J0(),1);g6()});import{join as fa}from"path";var Ca="AWS_CONFIG_FILE",vw=()=>process.env[Ca]||fa(I8(),".aws","config");var _9=G(()=>{c6()});import{join as Ba}from"path";var ha="AWS_SHARED_CREDENTIALS_FILE",Xz=()=>process.env[ha]||Ba(I8(),".aws","credentials");var Jz=G(()=>{c6()});var zz,Ua,Aa,B3=(D)=>{const F={};let E,w;for(let $ of D.split(/\r?\n/)){const C=$.split(/(^|\s)[;#]/)[0].trim();if(C[0]==="["&&C[C.length-1]==="]"){E=void 0,w=void 0;const B=C.substring(1,C.length-1),h=Ua.exec(B);if(h){const[,U,,I]=h;if(Object.values(zz.IniSectionType).includes(U))E=[U,I].join(a0)}else E=B;if(Aa.includes(B))throw new Error(`Found invalid profile name "${B}"`)}else if(E){const B=C.indexOf("=");if(![0,-1].includes(B)){const[h,U]=[C.substring(0,B).trim(),C.substring(B+1).trim()];if(U==="")w=h;else{if(w&&$.trimStart()===$)w=void 0;F[E]=F[E]||{};const I=w?[w,h].join(a0):h;F[E][I]=U}}}}return F};var s9=G(()=>{zz=L(J0(),1);g6();Ua=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,Aa=["__proto__","profile __proto__"]});import{promises as Ia}from"fs";var Ma,u9,h3=(D,F)=>{if(!u9[D]||F?.ignoreCache)u9[D]=Ma(D,"utf8");return u9[D]};var d9=G(()=>{({readFile:Ma}=Ia),u9={}});import{join as Tz}from"path";var Kz=()=>({}),a0=".",mw=async(D={})=>{const{filepath:F=Xz(),configFilepath:E=vw()}=D,w=I8();let C=F;if(F.startsWith("~/"))C=Tz(w,F.slice(2));let f=E;if(E.startsWith("~/"))f=Tz(w,E.slice(2));const B=await Promise.all([h3(f,{ignoreCache:D.ignoreCache}).then(B3).then(Zz).catch(Kz),h3(C,{ignoreCache:D.ignoreCache}).then(B3).catch(Kz)]);return{configFile:B[0],credentialsFile:B[1]}};var g6=G(()=>{Wz();_9();Jz();c6();s9();d9()});var Sz,Qz=(D)=>Object.entries(D).filter(([F])=>F.startsWith(Sz.IniSectionType.SSO_SESSION+a0)).reduce((F,[E,w])=>({...F,[E.substring(E.indexOf(a0)+1)]:w}),{});var Hz=G(()=>{Sz=L(J0(),1);g6()});var Ga=()=>({}),nw=async(D={})=>h3(D.configFilepath??vw()).then(B3).then(Qz).catch(Ga);var Lz=G(()=>{_9();Hz();s9();d9()});var Rz=(...D)=>{const F={};for(let E of D)for(let[w,$]of Object.entries(E))if(F[w]!==void 0)Object.assign(F[w],$);else F[w]=$;return F};var M8=async(D)=>{const F=await mw(D);return Rz(F.configFile,F.credentialsFile)};var Vz=G(()=>{g6()});var Nz=()=>{};var X2=G(()=>{c6();g9();Yz();g6();Lz();Vz();Nz()});var qz=(D,{preferredFile:F="config",...E}={})=>async()=>{const w=p0(E),{configFile:$,credentialsFile:C}=await mw(E),f=C[w]||{},B=$[w]||{},h=F==="config"?{...f,...B}:{...B,...f};try{const I=D(h,F==="config"?$:C);if(I===void 0)throw new Error;return I}catch(U){throw new x(U.message||`Not found in config files w/ profile [${w}]: ${sw(D.toString())}`,{logger:E.logger})}};var Oz=G(()=>{fD();X2()});var Ya=(D)=>typeof D==="function",jz=(D)=>Ya(D)?async()=>await D():Az(D);var Pz=G(()=>{fD()});var i=({environmentVariableSelector:D,configFileSelector:F,default:E},w={})=>e8(N1(Iz(D),qz(F,w),jz(E)));var yz=G(()=>{fD();Mz();Oz();Pz()});var m2=G(()=>{yz()});var kz="AWS_ENDPOINT_URL",bz="endpoint_url",xz=(D)=>({environmentVariableSelector:(F)=>{const E=D.split(" ").map((C)=>C.toUpperCase()),w=F[[kz,...E].join("_")];if(w)return w;const $=F[kz];if($)return $;return},configFileSelector:(F,E)=>{if(E&&F.services){const $=E[["services",F.services].join(a0)];if($){const C=D.split(" ").map((B)=>B.toLowerCase()),f=$[[C.join("_"),bz].join(a0)];if(f)return f}}const w=F[bz];if(w)return w;return},default:void 0});var cz=G(()=>{X2()});var lw=async(D)=>i(xz(D??""))();var v9=G(()=>{m2();cz()});function gz(D){const F={};if(D=D.replace(/^\?/,""),D)for(let E of D.split("&")){let[w,$=null]=E.split("=");if(w=decodeURIComponent(w),$)$=decodeURIComponent($);if(!(w in F))F[w]=$;else if(Array.isArray(F[w]))F[w].push($);else F[w]=[F[w],$]}return F}var D0=(D)=>{if(typeof D==="string")return D0(new URL(D));const{hostname:F,pathname:E,port:w,protocol:$,search:C}=D;let f;if(C)f=gz(C);return{hostname:F,port:w?parseInt(w):void 0,protocol:$,path:E,query:f}};var G8=()=>{};var iw=(D)=>{if(typeof D==="object"){if("url"in D)return D0(D.url);return D}return D0(D)};var pw=G(()=>{G8()});var rz=async(D,F,E,w)=>{if(!E.endpoint){let f;if(E.serviceConfiguredEndpoint)f=await E.serviceConfiguredEndpoint();else f=await lw(E.serviceId);if(f)E.endpoint=()=>Promise.resolve(iw(f))}const $=await Za(D,F,E);if(typeof E.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return E.endpointProvider($,w)},Za=async(D,F,E)=>{const w={},$=F?.getEndpointParameterInstructions?.()||{};for(let[C,f]of Object.entries($))switch(f.type){case"staticContextParams":w[C]=f.value;break;case"contextParams":w[C]=D[f.name];break;case"clientContextParams":case"builtInParams":w[C]=await Cz(f.name,C,E)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(f))}if(Object.keys($).length===0)Object.assign(w,E);if(String(E.serviceId).toLowerCase()==="s3")await wz(w);return w};var m9=G(()=>{fz();v9();pw()});var _z=G(()=>{m9();pw()});var sz=({config:D,instructions:F})=>{return(E,w)=>async($)=>{const C=await rz($.input,{getEndpointParameterInstructions(){return F}},{...D},w);w.endpointV2=C,w.authSchemes=C.properties?.authSchemes;const f=w.authSchemes?.[0];if(f){w.signing_region=f.signingRegion,w.signing_service=f.signingName;const h=m0(w)?.selectedHttpAuthScheme?.httpAuthOption;if(h)h.signingProperties=Object.assign(h.signingProperties||{},{signing_region:f.signingRegion,signingRegion:f.signingRegion,signing_service:f.signingName,signingName:f.signingName,signingRegionSet:f.signingRegionSet},f.properties)}return E({...$})}};var n9=G(()=>{W2();m9()});var uz=(D,F)=>(E)=>async(w)=>{const{response:$}=await E(w);try{const C=await F($,D);return{response:$,output:C}}catch(C){if(Object.defineProperty(C,"$response",{value:$}),!("$metadata"in C)){if(C.message+="\n Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",typeof C.$responseBodyText!=="undefined"){if(C.$response)C.$response.body=C.$responseBodyText}}throw C}};var dz=(D,F)=>(E,w)=>async($)=>{const C=w.endpointV2?.url&&D.urlParser?async()=>D.urlParser(w.endpointV2.url):D.endpoint;if(!C)throw new Error("No valid endpoint provider available.");const f=await F($.input,{...D,endpoint:C});return E({...$,request:f})};function p(D,F,E){return{applyToStack:(w)=>{w.add(uz(D,E),Wa),w.add(dz(D,F),l9)}}}var Wa,l9;var vz=G(()=>{Wa={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},l9={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0}});var LD=G(()=>{vz()});var Xa,a=(D,F)=>({applyToStack:(E)=>{E.addRelativeTo(sz({config:D,instructions:F}),Xa)}});var mz=G(()=>{LD();n9();Xa={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:l9.name}});var n2=(D)=>{const F=D.tls??!0,{endpoint:E}=D,w=E!=null?async()=>iw(await sD(E)()):void 0,C={...D,endpoint:w,tls:F,isCustomEndpoint:!!E,useDualstackEndpoint:sD(D.useDualstackEndpoint??!1),useFipsEndpoint:sD(D.useFipsEndpoint??!1)};let f=void 0;return C.serviceConfiguredEndpoint=async()=>{if(D.serviceId&&!f)f=lw(D.serviceId);return f},C};var nz=G(()=>{W2();v9();pw()});var lz=()=>{};var AD=G(()=>{_z();n9();mz();nz();lz()});var o0,D6=3,t0;var aw=G(()=>{(function(D){D.STANDARD="standard",D.ADAPTIVE="adaptive"})(o0||(o0={}));t0=o0.STANDARD});var iz,pz,az,oz;var tz=G(()=>{iz=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],pz=["TimeoutError","RequestTimeout","RequestTimeoutException"],az=[500,502,503,504],oz=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"]});var Ja=(D)=>D.$metadata?.clockSkewCorrected,r6=(D)=>D.$metadata?.httpStatusCode===429||iz.includes(D.name)||D.$retryable?.throttling==!0,ow=(D)=>Ja(D)||pz.includes(D.name)||oz.includes(D?.code||"")||az.includes(D.$metadata?.httpStatusCode||0),ez=(D)=>{if(D.$metadata?.httpStatusCode!==void 0){const F=D.$metadata.httpStatusCode;if(500<=F&&F<=599&&!ow(D))return!0;return!1}return!1};var U3=G(()=>{tz()});class tw{constructor(D){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=D?.beta??0.7,this.minCapacity=D?.minCapacity??1,this.minFillRate=D?.minFillRate??0.5,this.scaleConstant=D?.scaleConstant??0.4,this.smooth=D?.smooth??0.8;const F=this.getCurrentTimeInSeconds();this.lastThrottleTime=F,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1000}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(D){if(!this.enabled)return;if(this.refillTokenBucket(),D>this.currentCapacity){const F=(D-this.currentCapacity)/this.fillRate*1000;await new Promise((E)=>setTimeout(E,F))}this.currentCapacity=this.currentCapacity-D}refillTokenBucket(){const D=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=D;return}const F=(D-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+F),this.lastTimestamp=D}updateClientSendingRate(D){let F;if(this.updateMeasuredRate(),r6(D)){const w=!this.enabled?this.measuredTxRate:Math.min(this.measuredTxRate,this.fillRate);this.lastMaxRate=w,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),F=this.cubicThrottle(w),this.enableTokenBucket()}else this.calculateTimeWindow(),F=this.cubicSuccess(this.getCurrentTimeInSeconds());const E=Math.min(F,2*this.measuredTxRate);this.updateTokenBucketRate(E)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,0.3333333333333333))}cubicThrottle(D){return this.getPrecise(D*this.beta)}cubicSuccess(D){return this.getPrecise(this.scaleConstant*Math.pow(D-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(D){this.refillTokenBucket(),this.fillRate=Math.max(D,this.minFillRate),this.maxCapacity=Math.max(D,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){const D=this.getCurrentTimeInSeconds(),F=Math.floor(D*2)/2;if(this.requestCount++,F>this.lastTxRateBucket){const E=this.requestCount/(F-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(E*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=F}}getPrecise(D){return parseFloat(D.toFixed(8))}}var i9=G(()=>{U3()});var F6=100,A3=20000,p9=500,ew=500,a9=5,o9=10,t9=1,D$="amz-sdk-invocation-id",F$="amz-sdk-request";var DT=()=>{let D=F6;return{computeNextBackoffDelay:(w)=>{return Math.floor(Math.min(A3,Math.random()*2**w*D))},setDelayBase:(w)=>{D=w}}};var FT=()=>{};var e9=({retryDelay:D,retryCount:F,retryCost:E})=>{return{getRetryCount:()=>F,getRetryDelay:()=>Math.min(A3,D),getRetryCost:()=>E}};var ET=()=>{};class _6{constructor(D){this.maxAttempts=D,this.mode=o0.STANDARD,this.capacity=ew,this.retryBackoffStrategy=DT(),this.maxAttemptsProvider=typeof D==="function"?D:async()=>D}async acquireInitialRetryToken(D){return e9({retryDelay:F6,retryCount:0})}async refreshRetryTokenForRetry(D,F){const E=await this.getMaxAttempts();if(this.shouldRetry(D,F,E)){const w=F.errorType;this.retryBackoffStrategy.setDelayBase(w==="THROTTLING"?p9:F6);const $=this.retryBackoffStrategy.computeNextBackoffDelay(D.getRetryCount()),C=F.retryAfterHint?Math.max(F.retryAfterHint.getTime()-Date.now()||0,$):$,f=this.getCapacityCost(w);return this.capacity-=f,e9({retryDelay:C,retryCount:D.getRetryCount()+1,retryCost:f})}throw new Error("No retry token available")}recordSuccess(D){this.capacity=Math.max(ew,this.capacity+(D.getRetryCost()??t9))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch(D){return console.warn(`Max attempts provider could not resolve. Using default of ${D6}`),D6}}shouldRetry(D,F,E){return D.getRetryCount()+1<E&&this.capacity>=this.getCapacityCost(F.errorType)&&this.isRetryableError(F.errorType)}getCapacityCost(D){return D==="TRANSIENT"?o9:a9}isRetryableError(D){return D==="THROTTLING"||D==="TRANSIENT"}}var E$=G(()=>{aw();FT();ET()});class D5{constructor(D,F){this.maxAttemptsProvider=D,this.mode=o0.ADAPTIVE;const{rateLimiter:E}=F??{};this.rateLimiter=E??new tw,this.standardRetryStrategy=new _6(D)}async acquireInitialRetryToken(D){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(D)}async refreshRetryTokenForRetry(D,F){return this.rateLimiter.updateClientSendingRate(F),this.standardRetryStrategy.refreshRetryTokenForRetry(D,F)}recordSuccess(D){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(D)}}var wT=G(()=>{aw();i9();E$()});var $T=G(()=>{E$()});var fT=()=>{};var j0=G(()=>{wT();$T();i9();E$();aw();fT()});var l2,yAD,kAD,w$,bAD,xAD,cAD,gAD,rAD,_AD;var F5=G(()=>{l2=L(Zf(),1),yAD=l2.default.v1,kAD=l2.default.v3,w$=l2.default.v4,bAD=l2.default.v5,xAD=l2.default.NIL,cAD=l2.default.version,gAD=l2.default.validate,rAD=l2.default.stringify,_AD=l2.default.parse});var CT=G(()=>{j0()});var E5=G(()=>{j0()});var w5=G(()=>{U3()});var $5=(D)=>{if(D instanceof Error)return D;if(D instanceof Object)return Object.assign(new Error,D);if(typeof D==="string")return new Error(D);return new Error(`AWS SDK error wrapper for ${D}`)};var f5=G(()=>{vD();U3();j0();CT();E5();w5()});var BT=G(()=>{j0();f5()});var hT="AWS_MAX_ATTEMPTS",UT="max_attempts",i2,p2=(D)=>{const{retryStrategy:F}=D,E=sD(D.maxAttempts??D6);return{...D,maxAttempts:E,retryStrategy:async()=>{if(F)return F;if(await sD(D.retryMode)()===o0.ADAPTIVE)return new D5(E);return new _6(E)}}},za="AWS_RETRY_MODE",Ta="retry_mode",a2;var AT=G(()=>{W2();j0();i2={environmentVariableSelector:(D)=>{const F=D[hT];if(!F)return;const E=parseInt(F);if(Number.isNaN(E))throw new Error(`Environment variable ${hT} mast be a number, got "${F}"`);return E},configFileSelector:(D)=>{const F=D[UT];if(!F)return;const E=parseInt(F);if(Number.isNaN(E))throw new Error(`Shared config file entry ${UT} mast be a number, got "${F}"`);return E},default:D6},a2={environmentVariableSelector:(D)=>D[za],configFileSelector:(D)=>D[Ta],default:t0}});var IT=G(()=>{vD();j0()});var E6=(D,F)=>{const E=[];if(D)E.push(D);if(F)for(let w of F)E.push(w);return E},Y8=(D,F)=>{return`${D||"anonymous"}${F&&F.length>0?` (a.k.a. ${F.join(",")})`:""}`},s6=()=>{let D=[],F=[],E=!1;const w=new Set,$=(A)=>A.sort((Y,M)=>MT[M.step]-MT[Y.step]||GT[M.priority||"normal"]-GT[Y.priority||"normal"]),C=(A)=>{let Y=!1;const M=(Z)=>{const z=E6(Z.name,Z.aliases);if(z.includes(A)){Y=!0;for(let X of z)w.delete(X);return!1}return!0};return D=D.filter(M),F=F.filter(M),Y},f=(A)=>{let Y=!1;const M=(Z)=>{if(Z.middleware===A){Y=!0;for(let z of E6(Z.name,Z.aliases))w.delete(z);return!1}return!0};return D=D.filter(M),F=F.filter(M),Y},B=(A)=>{return D.forEach((Y)=>{A.add(Y.middleware,{...Y})}),F.forEach((Y)=>{A.addRelativeTo(Y.middleware,{...Y})}),A.identifyOnResolve?.(I.identifyOnResolve()),A},h=(A)=>{const Y=[];return A.before.forEach((M)=>{if(M.before.length===0&&M.after.length===0)Y.push(M);else Y.push(...h(M))}),Y.push(A),A.after.reverse().forEach((M)=>{if(M.before.length===0&&M.after.length===0)Y.push(M);else Y.push(...h(M))}),Y},U=(A=!1)=>{const Y=[],M=[],Z={};return D.forEach((X)=>{const J={...X,before:[],after:[]};for(let K of E6(J.name,J.aliases))Z[K]=J;Y.push(J)}),F.forEach((X)=>{const J={...X,before:[],after:[]};for(let K of E6(J.name,J.aliases))Z[K]=J;M.push(J)}),M.forEach((X)=>{if(X.toMiddleware){const J=Z[X.toMiddleware];if(J===void 0){if(A)return;throw new Error(`${X.toMiddleware} is not found when adding ${Y8(X.name,X.aliases)} middleware ${X.relation} ${X.toMiddleware}`)}if(X.relation==="after")J.after.push(X);if(X.relation==="before")J.before.push(X)}}),$(Y).map(h).reduce((X,J)=>{return X.push(...J),X},[])},I={add:(A,Y={})=>{const{name:M,override:Z,aliases:z}=Y,X={step:"initialize",priority:"normal",middleware:A,...Y},J=E6(M,z);if(J.length>0){if(J.some((K)=>w.has(K))){if(!Z)throw new Error(`Duplicate middleware name '${Y8(M,z)}'`);for(let K of J){const H=D.findIndex((m)=>m.name===K||m.aliases?.some((FD)=>FD===K));if(H===-1)continue;const V=D[H];if(V.step!==X.step||X.priority!==V.priority)throw new Error(`"${Y8(V.name,V.aliases)}" middleware with ${V.priority} priority in ${V.step} step cannot be overridden by "${Y8(M,z)}" middleware with ${X.priority} priority in ${X.step} step.`);D.splice(H,1)}}for(let K of J)w.add(K)}D.push(X)},addRelativeTo:(A,Y)=>{const{name:M,override:Z,aliases:z}=Y,X={middleware:A,...Y},J=E6(M,z);if(J.length>0){if(J.some((K)=>w.has(K))){if(!Z)throw new Error(`Duplicate middleware name '${Y8(M,z)}'`);for(let K of J){const H=F.findIndex((m)=>m.name===K||m.aliases?.some((FD)=>FD===K));if(H===-1)continue;const V=F[H];if(V.toMiddleware!==X.toMiddleware||V.relation!==X.relation)throw new Error(`"${Y8(V.name,V.aliases)}" middleware ${V.relation} "${V.toMiddleware}" middleware cannot be overridden by "${Y8(M,z)}" middleware ${X.relation} "${X.toMiddleware}" middleware.`);F.splice(H,1)}}for(let K of J)w.add(K)}F.push(X)},clone:()=>B(s6()),use:(A)=>{A.applyToStack(I)},remove:(A)=>{if(typeof A==="string")return C(A);else return f(A)},removeByTag:(A)=>{let Y=!1;const M=(Z)=>{const{tags:z,name:X,aliases:J}=Z;if(z&&z.includes(A)){const K=E6(X,J);for(let H of K)w.delete(H);return Y=!0,!1}return!0};return D=D.filter(M),F=F.filter(M),Y},concat:(A)=>{const Y=B(s6());return Y.use(A),Y.identifyOnResolve(E||Y.identifyOnResolve()||(A.identifyOnResolve?.()??!1)),Y},applyToStack:B,identify:()=>{return U(!0).map((A)=>{const Y=A.step??A.relation+" "+A.toMiddleware;return Y8(A.name,A.aliases)+" - "+Y})},identifyOnResolve(A){if(typeof A==="boolean")E=A;return E},resolve:(A,Y)=>{for(let M of U().map((Z)=>Z.middleware).reverse())A=M(A,Y);if(E)console.log(I.identify());return A}};return I},MT,GT;var YT=G(()=>{MT={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},GT={high:3,normal:2,low:1}});var C5=G(()=>{YT()});class P0{constructor(D){this.config=D,this.middlewareStack=s6()}send(D,F,E){const w=typeof F!=="function"?F:void 0,$=typeof F==="function"?F:E,C=w===void 0&&this.config.cacheMiddleware===!0;let f;if(C){if(!this.handlers)this.handlers=new WeakMap;const B=this.handlers;if(B.has(D.constructor))f=B.get(D.constructor);else f=D.resolveMiddleware(this.middlewareStack,this.config,w),B.set(D.constructor,f)}else delete this.handlers,f=D.resolveMiddleware(this.middlewareStack,this.config,w);if($)f(D).then((B)=>$(null,B.output),(B)=>$(B)).catch(()=>{});else return f(D).then((B)=>B.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var ZT=G(()=>{C5()});var WT=(D)=>typeof ArrayBuffer==="function"&&D instanceof ArrayBuffer||Object.prototype.toString.call(D)==="[object ArrayBuffer]";import{Buffer as B5}from"buffer";var q1=(D,F=0,E=D.byteLength-F)=>{if(!WT(D))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof D} (${D})`);return B5.from(D,F,E)},u6=(D,F)=>{if(typeof D!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof D} (${D})`);return F?B5.from(D,F):B5.from(D)};var w6=()=>{};var Ka,T0=(D)=>{if(D.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Ka.exec(D))throw new TypeError("Invalid base64 string.");const F=u6(D,"base64");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength)};var XT=G(()=>{w6();Ka=/^[A-Za-z0-9+/]*={0,2}$/});var F0=(D)=>{const F=u6(D,"utf8");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var h5=G(()=>{w6()});var JT=(D)=>{if(typeof D==="string")return F0(D);if(ArrayBuffer.isView(D))return new Uint8Array(D.buffer,D.byteOffset,D.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(D)};var zT=G(()=>{h5()});var K0=(D)=>{if(typeof D==="string")return D;if(typeof D!=="object"||typeof D.byteOffset!=="number"||typeof D.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return q1(D.buffer,D.byteOffset,D.byteLength).toString("utf8")};var TT=G(()=>{w6()});var o2=G(()=>{h5();zT();TT()});var S0=(D)=>{let F;if(typeof D==="string")F=F0(D);else F=D;if(typeof F!=="object"||typeof F.byteOffset!=="number"||typeof F.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return q1(F.buffer,F.byteOffset,F.byteLength).toString("base64")};var KT=G(()=>{w6();o2()});var O1=G(()=>{XT();KT()});function ST(D,F="utf-8"){if(F==="base64")return S0(D);return K0(D)}function QT(D,F){if(F==="base64")return j1.mutate(T0(D));return j1.mutate(F0(D))}var HT=G(()=>{O1();o2();U5()});var j1;var U5=G(()=>{HT();j1=class j1 extends Uint8Array{static fromString(D,F="utf-8"){switch(typeof D){case"string":return QT(D,F);default:throw new Error(`Unsupported conversion from ${typeof D} to Uint8ArrayBlobAdapter.`)}}static mutate(D){return Object.setPrototypeOf(D,j1.prototype),D}transformToString(D="utf-8"){return ST(this,D)}}});var LT=()=>{};var I3=(D)=>encodeURIComponent(D).replace(/[!'()*]/g,Sa),Sa=(D)=>`%${D.charCodeAt(0).toString(16).toUpperCase()}`;var RT=()=>{};var VT=G(()=>{RT()});function $$(D){const F=[];for(let E of Object.keys(D).sort()){const w=D[E];if(E=I3(E),Array.isArray(w))for(let $=0,C=w.length;$<C;$++)F.push(`${E}=${I3(w[$])}`);else{let $=E;if(w||typeof w==="string")$+=`=${I3(w)}`;F.push($)}}return F.join("&")}var f$=G(()=>{VT()});var NT;var qT=G(()=>{NT=["ECONNRESET","EPIPE","ETIMEDOUT"]});var A5=(D)=>{const F={};for(let E of Object.keys(D)){const w=D[E];F[E]=Array.isArray(w)?w.join(","):w}return F};var I5=()=>{};var OT=(D,F,E=0)=>{if(!E)return-1;const w=($)=>{const C=setTimeout(()=>{D.destroy(),F(Object.assign(new Error(`Socket timed out without establishing a connection within ${E} ms`),{name:"TimeoutError"}))},E-$),f=(B)=>{if(B?.connecting)B.on("connect",()=>{clearTimeout(C)});else clearTimeout(C)};if(D.socket)f(D.socket);else D.on("socket",f)};if(E<2000)return w(0),0;return setTimeout(w.bind(null,1000),1000)};var jT=(D,{keepAlive:F,keepAliveMsecs:E},w=3000)=>{if(F!==!0)return-1;const $=()=>{if(D.socket)D.socket.setKeepAlive(F,E||0);else D.on("socket",(C)=>{C.setKeepAlive(F,E||0)})};if(w===0)return $(),0;return setTimeout($,w)};var PT=(D,F,E=0)=>{const w=($)=>{D.setTimeout(E-$,()=>{D.destroy(),F(Object.assign(new Error(`Connection timed out after ${E} ms`),{name:"TimeoutError"}))})};if(0<E&&E<6000)return w(0),0;return setTimeout(w.bind(null,E===0?0:3000),3000)};import{Readable as Qa}from"stream";async function M5(D,F,E=yT){const w=F.headers??{},$=w.Expect||w.expect;let C=-1,f=!1;if($==="100-continue")await Promise.race([new Promise((B)=>{C=Number(setTimeout(B,Math.max(yT,E)))}),new Promise((B)=>{D.on("continue",()=>{clearTimeout(C),B()}),D.on("error",()=>{f=!0,clearTimeout(C),B()})})]);if(!f)Ha(D,F.body)}function Ha(D,F){if(F instanceof Qa){F.pipe(D);return}if(F){if(Buffer.isBuffer(F)||typeof F==="string"){D.end(F);return}const E=F;if(typeof E==="object"&&E.buffer&&typeof E.byteOffset==="number"&&typeof E.byteLength==="number"){D.end(Buffer.from(E.buffer,E.byteOffset,E.byteLength));return}D.end(Buffer.from(F));return}D.end()}var yT=1000;var G5=()=>{};import{Agent as kT,request as La}from"http";import{Agent as bT,request as Ra}from"https";class U0{static create(D){if(typeof D?.handle==="function")return D;return new U0(D)}static checkSocketUsage(D,F,E=console){const{sockets:w,requests:$,maxSockets:C}=D;if(typeof C!=="number"||C===1/0)return F;const f=15000;if(Date.now()-f<F)return F;if(w&&$)for(let B in w){const h=w[B]?.length??0,U=$[B]?.length??0;if(h>=C&&U>=2*C)return E?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${h} and ${U} additional requests are enqueued.
|
|
20
|
+
See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
|
|
21
|
+
or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return F}constructor(D){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((F,E)=>{if(typeof D==="function")D().then((w)=>{F(this.resolveDefaultConfig(w))}).catch(E);else F(this.resolveDefaultConfig(D))})}resolveDefaultConfig(D){const{requestTimeout:F,connectionTimeout:E,socketTimeout:w,httpAgent:$,httpsAgent:C}=D||{};return{connectionTimeout:E,requestTimeout:F??w,httpAgent:(()=>{if($ instanceof kT||typeof $?.destroy==="function")return $;return new kT({keepAlive:!0,maxSockets:50,...$})})(),httpsAgent:(()=>{if(C instanceof bT||typeof C?.destroy==="function")return C;return new bT({keepAlive:!0,maxSockets:50,...C})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(D,{abortSignal:F}={}){if(!this.config)this.config=await this.configProvider;return new Promise((E,w)=>{let $=void 0;const C=[],f=async(K)=>{await $,C.forEach(clearTimeout),E(K)},B=async(K)=>{await $,C.forEach(clearTimeout),w(K)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(F?.aborted){const K=new Error("Request aborted");K.name="AbortError",B(K);return}const h=D.protocol==="https:",U=h?this.config.httpsAgent:this.config.httpAgent;C.push(setTimeout(()=>{this.socketWarningTimestamp=U0.checkSocketUsage(U,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));const I=$$(D.query||{});let A=void 0;if(D.username!=null||D.password!=null){const K=D.username??"",H=D.password??"";A=`${K}:${H}`}let Y=D.path;if(I)Y+=`?${I}`;if(D.fragment)Y+=`#${D.fragment}`;let M=D.hostname??"";if(M[0]==="["&&M.endsWith("]"))M=D.hostname.slice(1,-1);else M=D.hostname;const Z={headers:D.headers,host:M,method:D.method,path:Y,port:D.port,agent:U,auth:A},X=(h?Ra:La)(Z,(K)=>{const H=new E8({statusCode:K.statusCode||-1,reason:K.statusMessage,headers:A5(K.headers),body:K});f({response:H})});if(X.on("error",(K)=>{if(NT.includes(K.code))B(Object.assign(K,{name:"TimeoutError"}));else B(K)}),F){const K=()=>{X.destroy();const H=new Error("Request aborted");H.name="AbortError",B(H)};if(typeof F.addEventListener==="function"){const H=F;H.addEventListener("abort",K,{once:!0}),X.once("close",()=>H.removeEventListener("abort",K))}else F.onabort=K}C.push(OT(X,B,this.config.connectionTimeout)),C.push(PT(X,B,this.config.requestTimeout));const J=Z.agent;if(typeof J==="object"&&"keepAlive"in J)C.push(jT(X,{keepAlive:J.keepAlive,keepAliveMsecs:J.keepAliveMsecs}));$=M5(X,D,this.config.requestTimeout).catch((K)=>{return C.forEach(clearTimeout),w(K)})})}updateHttpClientConfig(D,F){this.config=void 0,this.configProvider=this.configProvider.then((E)=>{return{...E,[D]:F}})}httpHandlerConfigs(){return this.config??{}}}var xT=G(()=>{vD();f$();qT();I5();G5()});var cT=()=>{};var gT=G(()=>{cT()});var rT=G(()=>{vD();f$();I5();gT();G5()});import{Writable as Va}from"stream";var Y5;var _T=G(()=>{Y5=class Y5 extends Va{constructor(){super(...arguments);this.bufferedBytes=[]}_write(D,F,E){this.bufferedBytes.push(D),E()}}});async function qa(D){const F=[],E=D.getReader();let w=!1,$=0;while(!w){const{done:B,value:h}=await E.read();if(h)F.push(h),$+=h.length;w=B}const C=new Uint8Array($);let f=0;for(let B of F)C.set(B,f),f+=B.length;return C}var e0=(D)=>{if(Na(D))return qa(D);return new Promise((F,E)=>{const w=new Y5;D.pipe(w),D.on("error",($)=>{w.end(),E($)}),w.on("error",E),w.on("finish",function(){const $=new Uint8Array(Buffer.concat(this.bufferedBytes));F($)})})},Na=(D)=>typeof ReadableStream==="function"&&D instanceof ReadableStream;var sT=G(()=>{_T()});var Z8=G(()=>{xT();rT();sT()});var uT=G(()=>{vD();f$()});async function Oa(D){const F=await Pa(D),E=T0(F);return new Uint8Array(E)}async function ja(D){const F=[],E=D.getReader();let w=!1,$=0;while(!w){const{done:B,value:h}=await E.read();if(h)F.push(h),$+=h.length;w=B}const C=new Uint8Array($);let f=0;for(let B of F)C.set(B,f),f+=B.length;return C}function Pa(D){return new Promise((F,E)=>{const w=new FileReader;w.onloadend=()=>{if(w.readyState!==2)return E(new Error("Reader aborted too early"));const $=w.result??"",C=$.indexOf(","),f=C>-1?C+1:$.length;F($.substring(f))},w.onabort=()=>E(new Error("Read aborted")),w.onerror=()=>E(w.error),w.readAsDataURL(D)})}var dT=(D)=>{if(typeof Blob==="function"&&D instanceof Blob)return Oa(D);return ja(D)};var vT=G(()=>{O1()});var mT=G(()=>{uT();vT()});var M3=(D)=>typeof ReadableStream==="function"&&(D?.constructor?.name===ReadableStream.name||D instanceof ReadableStream);var iT,nT="The stream has already been transformed.",pT=(D)=>{if(!lT(D)&&!M3(D)){const $=D?.__proto__?.constructor?.name||D;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${$}`)}let F=!1;const E=async()=>{if(F)throw new Error(nT);return F=!0,await dT(D)},w=($)=>{if(typeof $.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return $.stream()};return Object.assign(D,{transformToByteArray:E,transformToString:async($)=>{const C=await E();if($==="base64")return S0(C);else if($==="hex")return iT.toHex(C);else if($===void 0||$==="utf8"||$==="utf-8")return K0(C);else if(typeof TextDecoder==="function")return new TextDecoder($).decode(C);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(F)throw new Error(nT);if(F=!0,lT(D))return w(D);else if(M3(D))return D;else throw new Error(`Cannot transform payload to web stream, got ${D}`)}})},lT=(D)=>typeof Blob==="function"&&D instanceof Blob;var aT=G(()=>{mT();O1();iT=L(L6(),1);o2()});import{Readable as Z5}from"stream";import{TextDecoder as ya}from"util";var oT="The stream has already been transformed.",tT=(D)=>{if(!(D instanceof Z5))try{return pT(D)}catch(w){const $=D?.__proto__?.constructor?.name||D;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${$}`)}let F=!1;const E=async()=>{if(F)throw new Error(oT);return F=!0,await e0(D)};return Object.assign(D,{transformToByteArray:E,transformToString:async(w)=>{const $=await E();if(w===void 0||Buffer.isEncoding(w))return q1($.buffer,$.byteOffset,$.byteLength).toString(w);else return new ya(w).decode($)},transformToWebStream:()=>{if(F)throw new Error(oT);if(D.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Z5.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return F=!0,Z5.toWeb(D)}})};var eT=G(()=>{Z8();w6();aT()});var DK=()=>{};var FK=()=>{};var W5=G(()=>{U5();LT();eT();DK();FK()});var $6=async(D=new Uint8Array,F)=>{if(D instanceof Uint8Array)return j1.mutate(D);if(!D)return j1.mutate(new Uint8Array);const E=F.streamCollector(D);return j1.mutate(await E)};var EK=G(()=>{W5()});class l{constructor(){this.middlewareStack=s6()}static classBuilder(){return new $K}resolveMiddlewareWithContext(D,F,E,{middlewareFn:w,clientName:$,commandName:C,inputFilterSensitiveLog:f,outputFilterSensitiveLog:B,smithyContext:h,additionalContext:U,CommandCtor:I}){for(let z of w.bind(this)(I,D,F,E))this.middlewareStack.use(z);const A=D.concat(this.middlewareStack),{logger:Y}=F,M={logger:Y,clientName:$,commandName:C,inputFilterSensitiveLog:f,outputFilterSensitiveLog:B,[wK.SMITHY_CONTEXT_KEY]:{commandInstance:this,...h},...U},{requestHandler:Z}=F;return A.resolve((z)=>Z.handle(z.request,E||{}),M)}}class $K{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(D)=>D,this._outputFilterSensitiveLog=(D)=>D,this._serializer=null,this._deserializer=null}init(D){this._init=D}ep(D){return this._ep=D,this}m(D){return this._middlewareFn=D,this}s(D,F,E={}){return this._smithyContext={service:D,operation:F,...E},this}c(D={}){return this._additionalContext=D,this}n(D,F){return this._clientName=D,this._commandName=F,this}f(D=(E)=>E,F=(E)=>E){return this._inputFilterSensitiveLog=D,this._outputFilterSensitiveLog=F,this}ser(D){return this._serializer=D,this}de(D){return this._deserializer=D,this}build(){const D=this;let F;return F=class extends l{static getEndpointParameterInstructions(){return D._ep}constructor(...[E]){super();this.serialize=D._serializer,this.deserialize=D._deserializer,this.input=E??{},D._init(this)}resolveMiddleware(E,w,$){return this.resolveMiddlewareWithContext(E,w,$,{CommandCtor:F,middlewareFn:D._middlewareFn,clientName:D._clientName,commandName:D._commandName,inputFilterSensitiveLog:D._inputFilterSensitiveLog,outputFilterSensitiveLog:D._outputFilterSensitiveLog,smithyContext:D._smithyContext,additionalContext:D._additionalContext})}}}}var wK;var fK=G(()=>{C5();wK=L(J0(),1)});var wD="***SensitiveInformation***";var d6=(D,F)=>{for(let E of Object.keys(D)){const w=D[E],$=async function(f,B,h){const U=new w(f);if(typeof B==="function")this.send(U,B);else if(typeof h==="function"){if(typeof B!=="object")throw new Error(`Expected http options but got ${typeof B}`);this.send(U,B||{},h)}else return this.send(U,B)},C=(E[0].toLowerCase()+E.slice(1)).replace(/Command$/,"");F.prototype[C]=$}};var ka=(D)=>{if(D===null||D===void 0)return;if(typeof D==="string"){const F=parseFloat(D);if(!Number.isNaN(F)){if(String(F)!==String(D))IK.warn(AK(`Expected number but observed string: ${D}`));return F}}if(typeof D==="number")return D;throw new TypeError(`Expected number, got ${typeof D}: ${D}`)},ba,X5=(D)=>{const F=ka(D);if(F!==void 0&&!Number.isNaN(F)&&F!==1/0&&F!==-1/0){if(Math.abs(F)>ba)throw new TypeError(`Expected 32-bit float, got ${D}`)}return F},C$=(D)=>{if(D===null||D===void 0)return;if(Number.isInteger(D)&&!Number.isNaN(D))return D;throw new TypeError(`Expected integer, got ${typeof D}: ${D}`)},J2=(D)=>J5(D,32),CK=(D)=>J5(D,16),BK=(D)=>J5(D,8),J5=(D,F)=>{const E=C$(D);if(E!==void 0&&xa(E,F)!==E)throw new TypeError(`Expected ${F}-bit integer, got ${D}`);return E},xa=(D,F)=>{switch(F){case 32:return Int32Array.of(D)[0];case 16:return Int16Array.of(D)[0];case 8:return Int8Array.of(D)[0]}},yD=(D,F)=>{if(D===null||D===void 0){if(F)throw new TypeError(`Expected a non-null value for ${F}`);throw new TypeError("Expected a non-null value")}return D},Q0=(D)=>{if(D===null||D===void 0)return;if(typeof D==="object"&&!Array.isArray(D))return D;const F=Array.isArray(D)?"array":typeof D;throw new TypeError(`Expected object, got ${F}: ${D}`)},S=(D)=>{if(D===null||D===void 0)return;if(typeof D==="string")return D;if(["boolean","number","bigint"].includes(typeof D))return IK.warn(AK(`Expected string, got ${typeof D}: ${D}`)),String(D);throw new TypeError(`Expected string, got ${typeof D}: ${D}`)},hK=(D)=>{if(typeof D=="string")return X5(B$(D));return X5(D)},ca,B$=(D)=>{const F=D.match(ca);if(F===null||F[0].length!==D.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(D)},z5=(D)=>{if(typeof D=="string")return ga(D);return X5(D)},ga=(D)=>{switch(D){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw new Error(`Unable to parse float value: ${D}`)}},G3=(D)=>{if(typeof D==="string")return J2(B$(D));return J2(D)},T5=(D)=>{if(typeof D==="string")return CK(B$(D));return CK(D)},UK=(D)=>{if(typeof D==="string")return BK(B$(D));return BK(D)},AK=(D)=>{return String(new TypeError(D).stack||D).split("\n").slice(0,5).filter((F)=>!F.includes("stackTraceWarning")).join("\n")},IK;var K5=G(()=>{ba=Math.ceil(340282346638528860000000000000000000000),ca=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,IK={warn:console.warn}});var ra,_a,MK=(D)=>{if(D===null||D===void 0)return;if(typeof D!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const F=_a.exec(D);if(!F)throw new TypeError("Invalid RFC-3339 date-time value");const[E,w,$,C,f,B,h,U]=F,I=T5(S5(w)),A=f6($,"month",1,12),Y=f6(C,"day",1,31);return GK(I,A,Y,{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U})},sa,v6=(D)=>{if(D===null||D===void 0)return;if(typeof D!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const F=sa.exec(D);if(!F)throw new TypeError("Invalid RFC-3339 date-time value");const[E,w,$,C,f,B,h,U,I]=F,A=T5(S5(w)),Y=f6($,"month",1,12),M=f6(C,"day",1,31),Z=GK(A,Y,M,{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U});if(I.toUpperCase()!="Z")Z.setTime(Z.getTime()-na(I));return Z},rGD,_GD,sGD,GK=(D,F,E,w)=>{const $=F-1;return da(D,$,E),new Date(Date.UTC(D,$,E,f6(w.hours,"hour",0,23),f6(w.minutes,"minute",0,59),f6(w.seconds,"seconds",0,60),ma(w.fractionalMilliseconds)))},ua,da=(D,F,E)=>{let w=ua[F];if(F===1&&va(D))w=29;if(E>w)throw new TypeError(`Invalid day for ${ra[F]} in ${D}: ${E}`)},va=(D)=>{return D%4===0&&(D%100!==0||D%400===0)},f6=(D,F,E,w)=>{const $=UK(S5(D));if($<E||$>w)throw new TypeError(`${F} must be between ${E} and ${w}, inclusive`);return $},ma=(D)=>{if(D===null||D===void 0)return 0;return hK("0."+D)*1000},na=(D)=>{const F=D[0];let E=1;if(F=="+")E=1;else if(F=="-")E=-1;else throw new TypeError(`Offset direction, ${F}, must be "+" or "-"`);const w=Number(D.substring(1,3)),$=Number(D.substring(4,6));return E*(w*60+$)*60*1000},S5=(D)=>{let F=0;while(F<D.length-1&&D.charAt(F)==="0")F++;if(F===0)return D;return D.slice(F)};var YK=G(()=>{K5();ra=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],_a=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),sa=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),rGD=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),_GD=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),sGD=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),ua=[31,28,31,30,31,30,31,31,30,31,30,31]});var D2,u=(D,F={})=>{Object.entries(F).filter(([,w])=>w!==void 0).forEach(([w,$])=>{if(D[w]==null||D[w]==="")D[w]=$});const E=D.message||D.Message||"UnknownError";return D.message=E,delete D.Message,D};var Q5=G(()=>{D2=class D2 extends Error{constructor(D){super(D.message);Object.setPrototypeOf(this,D2.prototype),this.name=D.name,this.$fault=D.$fault,this.$metadata=D.$metadata}}});var la=({output:D,parsedBody:F,exceptionCtor:E,errorCode:w})=>{const $=ia(D),C=$.httpStatusCode?$.httpStatusCode+"":void 0,f=new E({name:F?.code||F?.Code||w||C||"UnknownError",$fault:"client",$metadata:$});throw u(f,F)},t2=(D)=>{return({output:F,parsedBody:E,errorCode:w})=>{la({output:F,parsedBody:E,exceptionCtor:D,errorCode:w})}},ia=(D)=>({httpStatusCode:D.statusCode,requestId:D.headers["x-amzn-requestid"]??D.headers["x-amzn-request-id"]??D.headers["x-amz-request-id"],extendedRequestId:D.headers["x-amz-id-2"],cfId:D.headers["x-amz-cf-id"]});var ZK=G(()=>{Q5()});var e2=(D)=>{switch(D){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var WK=!1,D1=(D)=>{if(D&&!WK&&parseInt(D.substring(1,D.indexOf(".")))<16)WK=!0};function h$(D){return encodeURIComponent(D).replace(/[!'()*]/g,function(F){return"%"+F.charCodeAt(0).toString(16).toUpperCase()})}var H5,XK=(D)=>{const F=[];for(let E in H5.AlgorithmId){const w=H5.AlgorithmId[E];if(D[w]===void 0)continue;F.push({algorithmId:()=>w,checksumConstructor:()=>D[w]})}return{_checksumAlgorithms:F,addChecksumAlgorithm(E){this._checksumAlgorithms.push(E)},checksumAlgorithms(){return this._checksumAlgorithms}}},JK=(D)=>{const F={};return D.checksumAlgorithms().forEach((E)=>{F[E.algorithmId()]=E.checksumConstructor()}),F};var zK=G(()=>{H5=L(J0(),1)});var TK=(D)=>{let F=D.retryStrategy;return{setRetryStrategy(E){F=E},retryStrategy(){return F}}},KK=(D)=>{const F={};return F.retryStrategy=D.retryStrategy(),F};var F1=(D)=>{return{...XK(D),...TK(D)}},E1=(D)=>{return{...JK(D),...KK(D)}};var SK=G(()=>{zK()});var QK=G(()=>{SK()});var W8=(D)=>{return D!=null};var L5=function(){const D=Object.getPrototypeOf(this).constructor,E=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(E,D.prototype),E};var HK=G(()=>{L5.prototype=Object.create(String.prototype,{constructor:{value:L5,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(L5,String)});class y0{trace(){}debug(){}info(){}warn(){}error(){}}function k(D,F,E){let w,$,C;if(typeof F==="undefined"&&typeof E==="undefined")w={},C=D;else if(w=D,typeof F==="function")return $=F,C=E,pa(w,$,C);else C=F;for(let f of Object.keys(C)){if(!Array.isArray(C[f])){w[f]=C[f];continue}LK(w,null,C,f)}return w}var c=(D,F)=>{const E={};for(let w in F)LK(E,D,F,w);return E},pa=(D,F,E)=>{return k(D,Object.entries(E).reduce((w,[$,C])=>{if(Array.isArray(C))w[$]=C;else if(typeof C==="function")w[$]=[F,C()];else w[$]=[F,C];return w},{}))},LK=(D,F,E,w)=>{if(F!==null){let f=E[w];if(typeof f==="function")f=[,f];const[B=aa,h=oa,U=w]=f;if(typeof B==="function"&&B(F[U])||typeof B!=="function"&&!!B)D[w]=h(F[U]);return}let[$,C]=E[w];if(typeof C==="function"){let f;const B=$===void 0&&(f=C())!=null,h=typeof $==="function"&&!!$(void 0)||typeof $!=="function"&&!!$;if(B)D[w]=f;else if(h)D[w]=C()}else{const f=$===void 0&&C!=null,B=typeof $==="function"&&!!$(C)||typeof $!=="function"&&!!$;if(f||B)D[w]=C}},aa=(D)=>D!=null,oa=(D)=>D;var RK=()=>{};var BD=(D)=>{if(D==null)return{};if(Array.isArray(D))return D.filter((F)=>F!=null).map(BD);if(typeof D==="object"){const F={};for(let E of Object.keys(D)){if(D[E]==null)continue;F[E]=BD(D[E])}return F}return D};var y=G(()=>{ZT();EK();fK();YK();ZK();Q5();QK();HK();K5();RK()});import{Readable as ta}from"stream";var VK=(D)=>D?.body instanceof ta||typeof ReadableStream!=="undefined"&&D?.body instanceof ReadableStream;var NK=()=>{};var ea=(D)=>(F,E)=>async(w)=>{let $=await D.retryStrategy();const C=await D.maxAttempts();if(Do($)){$=$;let f=await $.acquireInitialRetryToken(E.partition_id),B=new Error,h=0,U=0;const{request:I}=w,A=rD.isInstance(I);if(A)I.headers[D$]=w$();while(!0)try{if(A)I.headers[F$]=`attempt=${h+1}; max=${C}`;const{response:Y,output:M}=await F(w);return $.recordSuccess(f),M.$metadata.attempts=h+1,M.$metadata.totalRetryDelay=U,{response:Y,output:M}}catch(Y){const M=Fo(Y);if(B=$5(Y),A&&VK(I))throw(E.logger instanceof y0?console:E.logger)?.warn("An error was encountered in a non-retryable streaming request."),B;try{f=await $.refreshRetryTokenForRetry(f,M)}catch(z){if(!B.$metadata)B.$metadata={};throw B.$metadata.attempts=h+1,B.$metadata.totalRetryDelay=U,B}h=f.getRetryCount();const Z=f.getRetryDelay();U+=Z,await new Promise((z)=>setTimeout(z,Z))}}else{if($=$,$?.mode)E.userAgent=[...E.userAgent||[],["cfg/retry-mode",$.mode]];return $.retry(F,w)}},Do=(D)=>typeof D.acquireInitialRetryToken!=="undefined"&&typeof D.refreshRetryTokenForRetry!=="undefined"&&typeof D.recordSuccess!=="undefined",Fo=(D)=>{const F={error:D,errorType:Eo(D)},E=$o(D.$response);if(E)F.retryAfterHint=E;return F},Eo=(D)=>{if(r6(D))return"THROTTLING";if(ow(D))return"TRANSIENT";if(ez(D))return"SERVER_ERROR";return"CLIENT_ERROR"},wo,w1=(D)=>({applyToStack:(F)=>{F.add(ea(D),wo)}}),$o=(D)=>{if(!E8.isInstance(D))return;const F=Object.keys(D.headers).find((C)=>C.toLowerCase()==="retry-after");if(!F)return;const E=D.headers[F],w=Number(E);if(!Number.isNaN(w))return new Date(w*1000);return new Date(E)};var qK=G(()=>{vD();U3();y();j0();F5();NK();wo={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0}});var z2=G(()=>{BT();f5();AT();E5();IT();w5();qK()});var xK,A$="AWS_ACCESS_KEY_ID",I$="AWS_SECRET_ACCESS_KEY",cK="AWS_SESSION_TOKEN",gK="AWS_CREDENTIAL_EXPIRATION",rK="AWS_CREDENTIAL_SCOPE",_K="AWS_ACCOUNT_ID",R5=(D)=>async()=>{D?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");const F=process.env[A$],E=process.env[I$],w=process.env[cK],$=process.env[gK],C=process.env[rK],f=process.env[_K];if(F&&E){const B={accessKeyId:F,secretAccessKey:E,...w&&{sessionToken:w},...$&&{expiration:new Date($)},...C&&{credentialScope:C},...f&&{accountId:f}};return xK.setCredentialFeature(B,"CREDENTIALS_ENV_VARS","g"),B}throw new x("Unable to find environment variable credentials.",{logger:D?.logger})};var sK=G(()=>{xK=L(B0(),1);fD()});var uK={};_0(uK,{fromEnv:()=>R5,ENV_SESSION:()=>cK,ENV_SECRET:()=>I$,ENV_KEY:()=>A$,ENV_EXPIRATION:()=>gK,ENV_CREDENTIAL_SCOPE:()=>rK,ENV_ACCOUNT_ID:()=>_K});var V5=G(()=>{sK()});import{Buffer as Bo}from"buffer";import{request as ho}from"http";function X8(D){return new Promise((F,E)=>{const w=ho({method:"GET",...D,hostname:D.hostname?.replace(/^\[(.+)\]$/,"$1")});w.on("error",($)=>{E(Object.assign(new i0("Unable to connect to instance metadata service"),$)),w.destroy()}),w.on("timeout",()=>{E(new i0("TimeoutError from instance metadata service")),w.destroy()}),w.on("response",($)=>{const{statusCode:C=400}=$;if(C<200||300<=C)E(Object.assign(new i0("Error response received from instance metadata service"),{statusCode:C})),w.destroy();const f=[];$.on("data",(B)=>{f.push(B)}),$.on("end",()=>{F(Bo.concat(f)),w.destroy()})}),w.end()})}var M$=G(()=>{fD()});var G$=(D)=>Boolean(D)&&typeof D==="object"&&typeof D.AccessKeyId==="string"&&typeof D.SecretAccessKey==="string"&&typeof D.Token==="string"&&typeof D.Expiration==="string",Y$=(D)=>({accessKeyId:D.AccessKeyId,secretAccessKey:D.SecretAccessKey,sessionToken:D.Token,expiration:new Date(D.Expiration),...D.AccountId&&{accountId:D.AccountId}});var Uo=1000,Ao=0,Y3=({maxRetries:D=0,timeout:F=1000})=>({maxRetries:D,timeout:F});var Z3=(D,F)=>{let E=D();for(let w=0;w<F;w++)E=E.catch(D);return E};import{parse as Io}from"url";var Z$="AWS_CONTAINER_CREDENTIALS_FULL_URI",W$="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",N5="AWS_CONTAINER_AUTHORIZATION_TOKEN",Mo=(D={})=>{const{timeout:F,maxRetries:E}=Y3(D);return()=>Z3(async()=>{const w=await Xo({logger:D.logger}),$=JSON.parse(await Go(F,w));if(!G$($))throw new x("Invalid response received from instance metadata service.",{logger:D.logger});return Y$($)},E)},Go=async(D,F)=>{if(process.env[N5])F.headers={...F.headers,Authorization:process.env[N5]};return(await X8({...F,timeout:D})).toString()},Yo="169.254.170.2",Zo,Wo,Xo=async({logger:D})=>{if(process.env[W$])return{hostname:Yo,path:process.env[W$]};if(process.env[Z$]){const F=Io(process.env[Z$]);if(!F.hostname||!(F.hostname in Zo))throw new x(`${F.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:D});if(!F.protocol||!(F.protocol in Wo))throw new x(`${F.protocol} is not a valid container metadata service protocol`,{tryNextLink:!1,logger:D});return{...F,port:F.port?parseInt(F.port,10):void 0}}throw new x(`The container metadata credential provider cannot be used unless the ${W$} or ${Z$} environment variable is set`,{tryNextLink:!1,logger:D})};var dK=G(()=>{fD();M$();Zo={localhost:!0,"127.0.0.1":!0},Wo={"http:":!0,"https:":!0}});var X$;var vK=G(()=>{fD();X$=class X$ extends x{constructor(D,F=!0){super(D,F);this.tryNextLink=F,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,X$.prototype)}}});var C6;var q5=G(()=>{(function(D){D.IPv4="http://169.254.169.254",D.IPv6="http://[fd00:ec2::254]"})(C6||(C6={}))});var mK;var nK=G(()=>{mK={environmentVariableSelector:(D)=>D.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(D)=>D.ec2_metadata_service_endpoint,default:void 0}});var J8;var O5=G(()=>{(function(D){D.IPv4="IPv4",D.IPv6="IPv6"})(J8||(J8={}))});var Jo="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",zo="ec2_metadata_service_endpoint_mode",lK;var iK=G(()=>{O5();lK={environmentVariableSelector:(D)=>D[Jo],configFileSelector:(D)=>D[zo],default:J8.IPv4}});var J$=async()=>D0(await To()||await Ko()),To=async()=>i(mK)(),Ko=async()=>{const D=await i(lK)();switch(D){case J8.IPv4:return C6.IPv4;case J8.IPv6:return C6.IPv6;default:throw new Error(`Unsupported endpoint mode: ${D}. Select from ${Object.values(J8)}`)}};var j5=G(()=>{m2();G8();q5();nK();O5();iK()});var P5=(D,F)=>{const E=300+Math.floor(Math.random()*300),w=new Date(Date.now()+E*1000);F.warn(`Attempting credential expiration extension due to a credential service availability issue. A refresh of these credentials will be attempted after ${new Date(w)}.\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html`);const $=D.originalExpiration??D.expiration;return{...D,...$?{originalExpiration:$}:{},expiration:w}};var pK=(D,F={})=>{const E=F?.logger||console;let w;return async()=>{let $;try{if($=await D(),$.expiration&&$.expiration.getTime()<Date.now())$=P5($,E)}catch(C){if(w)E.warn("Credential renew failed: ",C),$=P5(w,E);else throw C}return w=$,$}};var aK=()=>{};var eK="/latest/meta-data/iam/security-credentials/",So="/latest/api/token",y5="AWS_EC2_METADATA_V1_DISABLED",oK="ec2_metadata_v1_disabled",tK="x-aws-ec2-metadata-token",Qo=(D={})=>pK(Ho(D),{logger:D.logger}),Ho=(D={})=>{let F=!1;const{logger:E,profile:w}=D,{timeout:$,maxRetries:C}=Y3(D),f=async(B,h)=>{if(F||h.headers?.[tK]==null){let A=!1,Y=!1;const M=await i({environmentVariableSelector:(Z)=>{const z=Z[y5];if(Y=!!z&&z!=="false",z===void 0)throw new x(`${y5} not set in env, checking config file next.`,{logger:D.logger});return Y},configFileSelector:(Z)=>{const z=Z[oK];return A=!!z&&z!=="false",A},default:!1},{profile:w})();if(D.ec2MetadataV1Disabled||M){const Z=[];if(D.ec2MetadataV1Disabled)Z.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(A)Z.push(`config file profile (${oK})`);if(Y)Z.push(`process environment variable (${y5})`);throw new X$(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${Z.join(", ")}].`)}}const I=(await Z3(async()=>{let A;try{A=await Ro(h)}catch(Y){if(Y.statusCode===401)F=!1;throw Y}return A},B)).trim();return Z3(async()=>{let A;try{A=await Vo(I,h,D)}catch(Y){if(Y.statusCode===401)F=!1;throw Y}return A},B)};return async()=>{const B=await J$();if(F)return E?.debug("AWS SDK Instance Metadata","using v1 fallback (no token fetch)"),f(C,{...B,timeout:$});else{let h;try{h=(await Lo({...B,timeout:$})).toString()}catch(U){if(U?.statusCode===400)throw Object.assign(U,{message:"EC2 Metadata token request returned error"});else if(U.message==="TimeoutError"||[403,404,405].includes(U.statusCode))F=!0;return E?.debug("AWS SDK Instance Metadata","using v1 fallback (initial)"),f(C,{...B,timeout:$})}return f(C,{...B,headers:{[tK]:h},timeout:$})}}},Lo=async(D)=>X8({...D,path:So,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),Ro=async(D)=>(await X8({...D,path:eK})).toString(),Vo=async(D,F,E)=>{const w=JSON.parse((await X8({...F,path:eK+D})).toString());if(!G$(w))throw new x("Invalid response received from instance metadata service.",{logger:E.logger});return Y$(w)};var DS=G(()=>{m2();fD();vK();M$();j5();aK()});var FS=()=>{};var W3={};_0(W3,{providerConfigFromInit:()=>Y3,httpRequest:()=>X8,getInstanceMetadataEndpoint:()=>J$,fromInstanceMetadata:()=>Qo,fromContainerMetadata:()=>Mo,Endpoint:()=>C6,ENV_CMDS_RELATIVE_URI:()=>W$,ENV_CMDS_FULL_URI:()=>Z$,ENV_CMDS_AUTH_TOKEN:()=>N5,DEFAULT_TIMEOUT:()=>Uo,DEFAULT_MAX_RETRIES:()=>Ao});var X3=G(()=>{dK();DS();FS();M$();j5();q5()});var No="169.254.170.2",qo="169.254.170.23",Oo="[fd00:ec2::23]",ES=(D,F)=>{if(D.protocol==="https:")return;if(D.hostname===No||D.hostname===qo||D.hostname===Oo)return;if(D.hostname.includes("[")){if(D.hostname==="[::1]"||D.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(D.hostname==="localhost")return;const E=D.hostname.split("."),w=($)=>{const C=parseInt($,10);return 0<=C&&C<=255};if(E[0]==="127"&&w(E[1])&&w(E[2])&&w(E[3])&&E.length===4)return}throw new x(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
22
|
+
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
23
|
+
- ECS container host 169.254.170.2
|
|
24
|
+
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:F})};var wS=G(()=>{fD()});function $S(D){return new rD({protocol:D.protocol,hostname:D.hostname,port:Number(D.port),path:D.pathname,query:Array.from(D.searchParams.entries()).reduce((F,[E,w])=>{return F[E]=w,F},{}),fragment:D.hash})}async function fS(D,F){const w=await tT(D.body).transformToString();if(D.statusCode===200){const $=JSON.parse(w);if(typeof $.AccessKeyId!=="string"||typeof $.SecretAccessKey!=="string"||typeof $.Token!=="string"||typeof $.Expiration!=="string")throw new x("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:F});return{accessKeyId:$.AccessKeyId,secretAccessKey:$.SecretAccessKey,sessionToken:$.Token,expiration:MK($.Expiration)}}if(D.statusCode>=400&&D.statusCode<500){let $={};try{$=JSON.parse(w)}catch(C){}throw Object.assign(new x(`Server responded with status: ${D.statusCode}`,{logger:F}),{Code:$.Code,Message:$.Message})}throw new x(`Server responded with status: ${D.statusCode}`,{logger:F})}var CS=G(()=>{fD();vD();y();W5()});var BS=(D,F,E)=>{return async()=>{for(let w=0;w<F;++w)try{return await D()}catch($){await new Promise((C)=>setTimeout(C,E))}return await D()}};import jo from"fs/promises";var hS,Po="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",yo="http://169.254.170.2",ko="AWS_CONTAINER_CREDENTIALS_FULL_URI",bo="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",xo="AWS_CONTAINER_AUTHORIZATION_TOKEN",US=(D={})=>{D.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let F;const E=D.awsContainerCredentialsRelativeUri??process.env[Po],w=D.awsContainerCredentialsFullUri??process.env[ko],$=D.awsContainerAuthorizationToken??process.env[xo],C=D.awsContainerAuthorizationTokenFile??process.env[bo],f=D.logger?.constructor?.name==="NoOpLogger"||!D.logger?console.warn:D.logger.warn;if(E&&w)f("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),f("awsContainerCredentialsFullUri will take precedence.");if($&&C)f("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),f("awsContainerAuthorizationToken will take precedence.");if(w)F=w;else if(E)F=`${yo}${E}`;else throw new x(`No HTTP credential provider host provided.
|
|
25
|
+
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:D.logger});const B=new URL(F);ES(B,D.logger);const h=new U0({requestTimeout:D.timeout??1000,connectionTimeout:D.timeout??1000});return BS(async()=>{const U=$S(B);if($)U.headers.Authorization=$;else if(C)U.headers.Authorization=(await jo.readFile(C)).toString();try{const I=await h.handle(U);return fS(I.response).then((A)=>hS.setCredentialFeature(A,"CREDENTIALS_HTTP","z"))}catch(I){throw new x(String(I),{logger:D.logger})}},D.maxRetries??3,D.timeout??1000)};var AS=G(()=>{hS=L(B0(),1);Z8();fD();wS();CS()});var k5={};_0(k5,{fromHttp:()=>US});var b5=G(()=>{AS()});var co="AWS_EC2_METADATA_DISABLED",IS=async(D)=>{const{ENV_CMDS_FULL_URI:F,ENV_CMDS_RELATIVE_URI:E,fromContainerMetadata:w,fromInstanceMetadata:$}=await Promise.resolve().then(() => (X3(),W3));if(process.env[E]||process.env[F]){D.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromHttp/fromContainerMetadata");const{fromHttp:C}=await Promise.resolve().then(() => (b5(),k5));return N1(C(D),w(D))}if(process.env[co])return async()=>{throw new x("EC2 Instance Metadata Service access disabled",{logger:D.logger})};return D.logger?.debug("@aws-sdk/credential-provider-node - remoteProvider::fromInstanceMetadata"),$(D)};var MS=G(()=>{fD()});var x5=(D)=>D&&(typeof D.sso_start_url==="string"||typeof D.sso_account_id==="string"||typeof D.sso_session==="string"||typeof D.sso_region==="string"||typeof D.sso_role_name==="string");var GS=300000,m6="To refresh this SSO session run 'aws sso login' with the corresponding profile.";function go(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}function c5(D){return{schemeId:"smithy.api#noAuth"}}var YS,ZS=async(D,F,E)=>{return{operation:m0(F).operation,region:await sD(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},WS=(D)=>{const F=[];switch(D.operation){case"CreateToken":{F.push(c5(D));break}case"RegisterClient":{F.push(c5(D));break}case"StartDeviceAuthorization":{F.push(c5(D));break}default:F.push(go(D))}return F},XS=(D)=>{return{...YS.resolveAwsSdkSigV4Config(D)}};var g5=G(()=>{YS=L(PD(),1);W2()});var JS=(D)=>{return{...D,useDualstackEndpoint:D.useDualstackEndpoint??!1,useFipsEndpoint:D.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},z8;var n6=G(()=>{z8={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var TS;var zS=G(()=>{TS={name:"@aws-sdk/client-sso-oidc",description:"AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",version:"3.668.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso-oidc","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso-oidc"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.667.0","@aws-sdk/credential-provider-node":"3.668.0","@aws-sdk/middleware-host-header":"3.667.0","@aws-sdk/middleware-logger":"3.667.0","@aws-sdk/middleware-recursion-detection":"3.667.0","@aws-sdk/middleware-user-agent":"3.668.0","@aws-sdk/region-config-resolver":"3.667.0","@aws-sdk/types":"3.667.0","@aws-sdk/util-endpoints":"3.667.0","@aws-sdk/util-user-agent-browser":"3.667.0","@aws-sdk/util-user-agent-node":"3.668.0","@smithy/config-resolver":"^3.0.9","@smithy/core":"^2.4.8","@smithy/fetch-http-handler":"^3.2.9","@smithy/hash-node":"^3.0.7","@smithy/invalid-dependency":"^3.0.7","@smithy/middleware-content-length":"^3.0.9","@smithy/middleware-endpoint":"^3.1.4","@smithy/middleware-retry":"^3.0.23","@smithy/middleware-serde":"^3.0.7","@smithy/middleware-stack":"^3.0.7","@smithy/node-config-provider":"^3.1.8","@smithy/node-http-handler":"^3.2.4","@smithy/protocol-http":"^4.1.4","@smithy/smithy-client":"^3.4.0","@smithy/types":"^3.5.0","@smithy/url-parser":"^3.0.7","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.23","@smithy/util-defaults-mode-node":"^3.0.23","@smithy/util-endpoints":"^2.1.3","@smithy/util-middleware":"^3.0.7","@smithy/util-retry":"^3.0.7","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",peerDependencies:{"@aws-sdk/client-sts":"^3.668.0"},browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso-oidc"}}});var r5;var _5=G(()=>{r5={isCrtAvailable:!1}});var KS=()=>{if(r5.isCrtAvailable)return["md/crt-avail"];return null};var SS=G(()=>{_5()});import{platform as _o,release as so}from"os";import{env as QS,versions as uo}from"process";var vo=({serviceId:D,clientVersion:F})=>{return async(E)=>{const w=[["aws-sdk-js",F],["ua","2.1"],[`os/${_o()}`,so()],["lang/js"],["md/nodejs",`${uo.node}`]],$=KS();if($)w.push($);if(D)w.push([`api/${D}`,F]);if(QS.AWS_EXECUTION_ENV)w.push([`exec-env/${QS.AWS_EXECUTION_ENV}`]);const C=await E?.userAgentAppId?.();return C?[...w,[`app/${C}`]]:[...w]}},$1;var HS=G(()=>{SS();_5();$1=vo});var mo="AWS_SDK_UA_APP_ID",no="sdk-ua-app-id",f1;var LS=G(()=>{t8();f1={environmentVariableSelector:(D)=>D[mo],configFileSelector:(D)=>D[no],default:F9}});var l6=G(()=>{HS();LS()});import{Buffer as lo}from"buffer";import{createHash as io,createHmac as po}from"crypto";function RS(D,F){if(lo.isBuffer(D))return D;if(typeof D==="string")return u6(D,F);if(ArrayBuffer.isView(D))return q1(D.buffer,D.byteOffset,D.byteLength);return q1(D)}class T2{constructor(D,F){this.algorithmIdentifier=D,this.secret=F,this.reset()}update(D,F){this.hash.update(JT(RS(D,F)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?po(this.algorithmIdentifier,RS(this.secret)):io(this.algorithmIdentifier)}}var i6=G(()=>{w6();o2()});import{fstatSync as ao,lstatSync as oo}from"fs";var C1=(D)=>{if(!D)return 0;if(typeof D==="string")return Buffer.byteLength(D);else if(typeof D.byteLength==="number")return D.byteLength;else if(typeof D.size==="number")return D.size;else if(typeof D.start==="number"&&typeof D.end==="number")return D.end+1-D.start;else if(typeof D.path==="string"||Buffer.isBuffer(D.path))return oo(D.path).size;else if(typeof D.fd==="number")return ao(D.fd).size;throw new Error(`Body Length computation failed for ${D}`)};var VS=()=>{};var p6=G(()=>{VS()});var NS,qS,OS,xS,cS,F2,jS,gS,PS,yS,kS,bS,to,rS;var _S=G(()=>{NS={["required"]:!1,type:"String"},qS={["required"]:!0,default:!1,type:"Boolean"},OS={["ref"]:"Endpoint"},xS={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},cS={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},F2={},jS={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},gS={["ref"]:"PartitionResult"},PS={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[gS,"supportsDualStack"]}]},yS=[xS],kS=[cS],bS=[{["ref"]:"Region"}],to={version:"1.0",parameters:{Region:NS,UseDualStack:qS,UseFIPS:qS,Endpoint:NS},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[OS]}],rules:[{conditions:yS,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:kS,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:OS,properties:F2,headers:F2},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:bS}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:bS,assign:"PartitionResult"}],rules:[{conditions:[xS,cS],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,jS]},PS],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:F2,headers:F2},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:yS,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[jS,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[gS,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:F2,headers:F2},type:"endpoint"},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:F2,headers:F2},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:kS,rules:[{conditions:[PS],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:F2,headers:F2},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:F2,headers:F2},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},rS=to});var eo,sS=(D,F={})=>{return eo.get(D,()=>G2(rS,{endpointParams:D,logger:F.logger}))};var uS=G(()=>{p8();Y2();_S();eo=new M2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]});C0.aws=Z2});var dS,vS,mS=(D)=>{return{apiVersion:"2019-06-10",base64Decoder:D?.base64Decoder??T0,base64Encoder:D?.base64Encoder??S0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??sS,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??WS,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new dS.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(F)=>F.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new vS.NoAuthSigner}],logger:D?.logger??new y0,serviceId:D?.serviceId??"SSO OIDC",urlParser:D?.urlParser??D0,utf8Decoder:D?.utf8Decoder??F0,utf8Encoder:D?.utf8Encoder??K0}};var nS=G(()=>{dS=L(PD(),1),vS=L(_D(),1);y();G8();O1();o2();g5();uS()});var lS="AWS_EXECUTION_ENV",s5="AWS_REGION",u5="AWS_DEFAULT_REGION",iS="AWS_EC2_METADATA_DISABLED",pS,aS="/latest/meta-data/placement/region";var oS=G(()=>{pS=["in-region","cross-region","mobile","standard","legacy"]});var tS;var eS=G(()=>{tS={environmentVariableSelector:(D)=>{return D.AWS_DEFAULTS_MODE},configFileSelector:(D)=>{return D.defaults_mode},default:"legacy"}});var B1=({region:D=i(n0),defaultsMode:F=i(tS)}={})=>e8(async()=>{const E=typeof F==="function"?await F():F;switch(E?.toLowerCase()){case"auto":return Dt(D);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(E?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${pS.join(", ")}, got ${E}`)}}),Dt=async(D)=>{if(D){const F=typeof D==="function"?await D():D,E=await Ft();if(!E)return"standard";if(F===E)return"in-region";else return"cross-region"}return"standard"},Ft=async()=>{if(process.env[lS]&&(process.env[s5]||process.env[u5]))return process.env[s5]??process.env[u5];if(!process.env[iS])try{const{getInstanceMetadataEndpoint:D,httpRequest:F}=await Promise.resolve().then(() => (X3(),W3)),E=await D();return(await F({...E,path:aS})).toString()}catch(D){}};var DQ=G(()=>{l0();m2();fD();oS();eS()});var a6=G(()=>{DQ()});var FQ,EQ=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=mS(D);return FQ.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,credentialDefaultProvider:D?.credentialDefaultProvider??K2,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:TS.version}),maxAttempts:D?.maxAttempts??i(i2),region:D?.region??i(n0,u2),requestHandler:U0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...a2,default:async()=>(await E()).retryMode||t0}),sha256:D?.sha256??T2.bind(null,"sha256"),streamCollector:D?.streamCollector??e0,useDualstackEndpoint:D?.useDualstackEndpoint??i(_2),useFipsEndpoint:D?.useFipsEndpoint??i(s2),userAgentAppId:D?.userAgentAppId??i(f1)}};var wQ=G(()=>{zS();FQ=L(PD(),1);o6();l6();l0();i6();z2();m2();Z8();p6();j0();nS();y();a6();y()});var h1=(D)=>{let F=async()=>{if(D.region===void 0)throw new Error("Region is missing from runtimeConfig");const E=D.region;if(typeof E==="string")return E;return E()};return{setRegion(E){F=E},region(){return F}}},U1=(D)=>{return{region:D.region()}};var $Q=()=>{};var fQ=()=>{};var CQ=G(()=>{fQ()});var BQ=G(()=>{$Q();CQ()});var t6=G(()=>{BQ()});var hQ=(D)=>{const F=D.httpAuthSchemes;let{httpAuthSchemeProvider:E,credentials:w}=D;return{setHttpAuthScheme($){const C=F.findIndex((f)=>f.schemeId===$.schemeId);if(C===-1)F.push($);else F.splice(C,1,$)},httpAuthSchemes(){return F},setHttpAuthSchemeProvider($){E=$},httpAuthSchemeProvider(){return E},setCredentials($){w=$},credentials(){return w}}},UQ=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var z$=(D)=>D,AQ=(D,F)=>{const E={...z$(h1(D)),...z$(F1(D)),...z$(j2(D)),...z$(hQ(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...P2(E),...UQ(E)}};var IQ=G(()=>{t6();vD();y()});var e6,T$;var d5=G(()=>{z6();T6();K6();t8();l0();e6=L(_D(),1);x6();AD();z2();y();g5();n6();wQ();IQ();T$=class T$ extends P0{constructor(...[D]){const F=EQ(D||{}),E=JS(F),w=g2(E),$=p2(w),C=d2($),f=y2(C),B=n2(f),h=XS(B),U=AQ(h,D?.extensions||[]);super(U);this.config=U,this.middlewareStack.use(r2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(v2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(x2(this.config)),this.middlewareStack.use(e6.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ZS,identityProviderConfigProvider:async(I)=>new e6.DefaultIdentityProviderConfig({"aws.auth#sigv4":I.credentials})})),this.middlewareStack.use(e6.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}});var bD;var K$=G(()=>{y();bD=class bD extends D2{constructor(D){super(D);Object.setPrototypeOf(this,bD.prototype)}}});var J3,z3,T3,K3,S3,Q3,H3,L3,R3,V3,N3,q3,O3,j3,v5=(D)=>({...D,...D.clientSecret&&{clientSecret:wD},...D.refreshToken&&{refreshToken:wD},...D.codeVerifier&&{codeVerifier:wD}}),m5=(D)=>({...D,...D.accessToken&&{accessToken:wD},...D.refreshToken&&{refreshToken:wD},...D.idToken&&{idToken:wD}}),n5=(D)=>({...D,...D.refreshToken&&{refreshToken:wD},...D.assertion&&{assertion:wD},...D.subjectToken&&{subjectToken:wD},...D.codeVerifier&&{codeVerifier:wD}}),l5=(D)=>({...D,...D.accessToken&&{accessToken:wD},...D.refreshToken&&{refreshToken:wD},...D.idToken&&{idToken:wD}}),i5=(D)=>({...D,...D.clientSecret&&{clientSecret:wD}}),p5=(D)=>({...D,...D.clientSecret&&{clientSecret:wD}});var B6=G(()=>{y();K$();J3=class J3 extends bD{constructor(D){super({name:"AccessDeniedException",$fault:"client",...D});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,J3.prototype),this.error=D.error,this.error_description=D.error_description}};z3=class z3 extends bD{constructor(D){super({name:"AuthorizationPendingException",$fault:"client",...D});this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,z3.prototype),this.error=D.error,this.error_description=D.error_description}};T3=class T3 extends bD{constructor(D){super({name:"ExpiredTokenException",$fault:"client",...D});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,T3.prototype),this.error=D.error,this.error_description=D.error_description}};K3=class K3 extends bD{constructor(D){super({name:"InternalServerException",$fault:"server",...D});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,K3.prototype),this.error=D.error,this.error_description=D.error_description}};S3=class S3 extends bD{constructor(D){super({name:"InvalidClientException",$fault:"client",...D});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,S3.prototype),this.error=D.error,this.error_description=D.error_description}};Q3=class Q3 extends bD{constructor(D){super({name:"InvalidGrantException",$fault:"client",...D});this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,Q3.prototype),this.error=D.error,this.error_description=D.error_description}};H3=class H3 extends bD{constructor(D){super({name:"InvalidRequestException",$fault:"client",...D});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,H3.prototype),this.error=D.error,this.error_description=D.error_description}};L3=class L3 extends bD{constructor(D){super({name:"InvalidScopeException",$fault:"client",...D});this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,L3.prototype),this.error=D.error,this.error_description=D.error_description}};R3=class R3 extends bD{constructor(D){super({name:"SlowDownException",$fault:"client",...D});this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,R3.prototype),this.error=D.error,this.error_description=D.error_description}};V3=class V3 extends bD{constructor(D){super({name:"UnauthorizedClientException",$fault:"client",...D});this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,V3.prototype),this.error=D.error,this.error_description=D.error_description}};N3=class N3 extends bD{constructor(D){super({name:"UnsupportedGrantTypeException",$fault:"client",...D});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,N3.prototype),this.error=D.error,this.error_description=D.error_description}};q3=class q3 extends bD{constructor(D){super({name:"InvalidRequestRegionException",$fault:"client",...D});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,q3.prototype),this.error=D.error,this.error_description=D.error_description,this.endpoint=D.endpoint,this.region=D.region}};O3=class O3 extends bD{constructor(D){super({name:"InvalidClientMetadataException",$fault:"client",...D});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,O3.prototype),this.error=D.error,this.error_description=D.error_description}};j3=class j3 extends bD{constructor(D){super({name:"InvalidRedirectUriException",$fault:"client",...D});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,j3.prototype),this.error=D.error,this.error_description=D.error_description}}});var P1,P3,MQ=async(D,F)=>{const E=P3.requestBuilder(D,F),w={"content-type":"application/json"};E.bp("/token");let $;return $=JSON.stringify(c(D,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:(C)=>BD(C)})),E.m("POST").h(w).b($),E.build()},GQ=async(D,F)=>{const E=P3.requestBuilder(D,F),w={"content-type":"application/json"};E.bp("/token");const $=k({[Jt]:[,"t"]});let C;return C=JSON.stringify(c(D,{assertion:[],clientId:[],code:[],codeVerifier:[],grantType:[],redirectUri:[],refreshToken:[],requestedTokenType:[],scope:(f)=>BD(f),subjectToken:[],subjectTokenType:[]})),E.m("POST").h(w).q($).b(C),E.build()},YQ=async(D,F)=>{const E=P3.requestBuilder(D,F),w={"content-type":"application/json"};E.bp("/client/register");let $;return $=JSON.stringify(c(D,{clientName:[],clientType:[],entitledApplicationArn:[],grantTypes:(C)=>BD(C),issuerUrl:[],redirectUris:(C)=>BD(C),scopes:(C)=>BD(C)})),E.m("POST").h(w).b($),E.build()},ZQ=async(D,F)=>{const E=P3.requestBuilder(D,F),w={"content-type":"application/json"};E.bp("/device_authorization");let $;return $=JSON.stringify(c(D,{clientId:[],clientSecret:[],startUrl:[]})),E.m("POST").h(w).b($),E.build()},WQ=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return S$(D,F);const E=k({$metadata:nD(D)}),w=yD(Q0(await P1.parseJsonBody(D.body,F)),"body"),$=c(w,{accessToken:S,expiresIn:J2,idToken:S,refreshToken:S,tokenType:S});return Object.assign(E,$),E},XQ=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return S$(D,F);const E=k({$metadata:nD(D)}),w=yD(Q0(await P1.parseJsonBody(D.body,F)),"body"),$=c(w,{accessToken:S,expiresIn:J2,idToken:S,issuedTokenType:S,refreshToken:S,scope:BD,tokenType:S});return Object.assign(E,$),E},JQ=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return S$(D,F);const E=k({$metadata:nD(D)}),w=yD(Q0(await P1.parseJsonBody(D.body,F)),"body"),$=c(w,{authorizationEndpoint:S,clientId:S,clientIdIssuedAt:C$,clientSecret:S,clientSecretExpiresAt:C$,tokenEndpoint:S});return Object.assign(E,$),E},zQ=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return S$(D,F);const E=k({$metadata:nD(D)}),w=yD(Q0(await P1.parseJsonBody(D.body,F)),"body"),$=c(w,{deviceCode:S,expiresIn:J2,interval:J2,userCode:S,verificationUri:S,verificationUriComplete:S});return Object.assign(E,$),E},S$=async(D,F)=>{const E={...D,body:await P1.parseJsonErrorBody(D.body,F)},w=P1.loadRestJsonErrorCode(D,E.body);switch(w){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await $t(E,F);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await ft(E,F);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Ct(E,F);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Bt(E,F);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await ht(E,F);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await At(E,F);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await Mt(E,F);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await Yt(E,F);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await Zt(E,F);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await Wt(E,F);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await Xt(E,F);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await Gt(E,F);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await Ut(E,F);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await It(E,F);default:const $=E.body;return wt({output:D,parsedBody:$,errorCode:w})}},wt,$t=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new J3({$metadata:nD(D),...E});return u(C,D.body)},ft=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new z3({$metadata:nD(D),...E});return u(C,D.body)},Ct=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new T3({$metadata:nD(D),...E});return u(C,D.body)},Bt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new K3({$metadata:nD(D),...E});return u(C,D.body)},ht=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new S3({$metadata:nD(D),...E});return u(C,D.body)},Ut=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new O3({$metadata:nD(D),...E});return u(C,D.body)},At=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new Q3({$metadata:nD(D),...E});return u(C,D.body)},It=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new j3({$metadata:nD(D),...E});return u(C,D.body)},Mt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new H3({$metadata:nD(D),...E});return u(C,D.body)},Gt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{endpoint:S,error:S,error_description:S,region:S});Object.assign(E,$);const C=new q3({$metadata:nD(D),...E});return u(C,D.body)},Yt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new L3({$metadata:nD(D),...E});return u(C,D.body)},Zt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new R3({$metadata:nD(D),...E});return u(C,D.body)},Wt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new V3({$metadata:nD(D),...E});return u(C,D.body)},Xt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new N3({$metadata:nD(D),...E});return u(C,D.body)},nD=(D)=>({httpStatusCode:D.statusCode,requestId:D.headers["x-amzn-requestid"]??D.headers["x-amzn-request-id"]??D.headers["x-amz-request-id"],extendedRequestId:D.headers["x-amz-id-2"],cfId:D.headers["x-amz-cf-id"]}),Jt="aws_iam";var y3=G(()=>{P1=L(PD(),1),P3=L(_D(),1);y();B6();K$();wt=t2(bD)});var Q$;var a5=G(()=>{AD();LD();y();n6();B6();y3();Q$=class Q$ extends l.classBuilder().ep(z8).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(v5,m5).ser(MQ).de(WQ).build(){}});var H$;var o5=G(()=>{AD();LD();y();n6();B6();y3();H$=class H$ extends l.classBuilder().ep(z8).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(n5,l5).ser(GQ).de(XQ).build(){}});var L$;var t5=G(()=>{AD();LD();y();n6();B6();y3();L$=class L$ extends l.classBuilder().ep(z8).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,i5).ser(YQ).de(JQ).build(){}});var R$;var e5=G(()=>{AD();LD();y();n6();B6();y3();R$=class R$ extends l.classBuilder().ep(z8).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(p5,void 0).ser(ZQ).de(zQ).build(){}});var zt,DC;var TQ=G(()=>{y();a5();o5();t5();e5();d5();zt={CreateTokenCommand:Q$,CreateTokenWithIAMCommand:H$,RegisterClientCommand:L$,StartDeviceAuthorizationCommand:R$};DC=class DC extends T${};d6(zt,DC)});var KQ=G(()=>{a5();o5();t5();e5()});var SQ=G(()=>{B6()});var FC={};_0(FC,{__Client:()=>P0,UnsupportedGrantTypeException:()=>N3,UnauthorizedClientException:()=>V3,StartDeviceAuthorizationRequestFilterSensitiveLog:()=>p5,StartDeviceAuthorizationCommand:()=>R$,SlowDownException:()=>R3,SSOOIDCServiceException:()=>bD,SSOOIDCClient:()=>T$,SSOOIDC:()=>DC,RegisterClientResponseFilterSensitiveLog:()=>i5,RegisterClientCommand:()=>L$,InvalidScopeException:()=>L3,InvalidRequestRegionException:()=>q3,InvalidRequestException:()=>H3,InvalidRedirectUriException:()=>j3,InvalidGrantException:()=>Q3,InvalidClientMetadataException:()=>O3,InvalidClientException:()=>S3,InternalServerException:()=>K3,ExpiredTokenException:()=>T3,CreateTokenWithIAMResponseFilterSensitiveLog:()=>l5,CreateTokenWithIAMRequestFilterSensitiveLog:()=>n5,CreateTokenWithIAMCommand:()=>H$,CreateTokenResponseFilterSensitiveLog:()=>m5,CreateTokenRequestFilterSensitiveLog:()=>v5,CreateTokenCommand:()=>Q$,AuthorizationPendingException:()=>z3,AccessDeniedException:()=>J3,$Command:()=>l});var EC=G(()=>{d5();TQ();KQ();SQ();K$()});var wC,QQ=async(D)=>{const{SSOOIDCClient:F}=await Promise.resolve().then(() => (EC(),FC));if(wC[D])return wC[D];const E=new F({region:D});return wC[D]=E,E};var HQ=G(()=>{wC={}});var LQ=async(D,F)=>{const{CreateTokenCommand:E}=await Promise.resolve().then(() => (EC(),FC));return(await QQ(F)).send(new E({clientId:D.clientId,clientSecret:D.clientSecret,refreshToken:D.refreshToken,grantType:"refresh_token"}))};var RQ=G(()=>{HQ()});var $C=(D)=>{if(D.expiration&&D.expiration.getTime()<Date.now())throw new z0(`Token is expired. ${m6}`,!1)};var VQ=G(()=>{fD()});var T8=(D,F,E=!1)=>{if(typeof F==="undefined")throw new z0(`Value not present for '${D}' in SSO Token${E?". Cannot refresh":""}. ${m6}`,!1)};var NQ=G(()=>{fD()});import{promises as Tt}from"fs";var Kt,qQ=(D,F)=>{const E=uw(D),w=JSON.stringify(F,null,2);return Kt(E,w)};var OQ=G(()=>{X2();({writeFile:Kt}=Tt)});var jQ,PQ=(D={})=>async()=>{D.logger?.debug("@aws-sdk/token-providers - fromSso");const F=await M8(D),E=p0(D),w=F[E];if(!w)throw new z0(`Profile '${E}' could not be found in shared credentials file.`,!1);else if(!w.sso_session)throw new z0(`Profile '${E}' is missing required property 'sso_session'.`);const $=w.sso_session,f=(await nw(D))[$];if(!f)throw new z0(`Sso session '${$}' could not be found in shared credentials file.`,!1);for(let M of["sso_start_url","sso_region"])if(!f[M])throw new z0(`Sso session '${$}' is missing required property '${M}'.`,!1);const{sso_start_url:B,sso_region:h}=f;let U;try{U=await dw($)}catch(M){throw new z0(`The SSO session token associated with profile=${E} was not found or is invalid. ${m6}`,!1)}T8("accessToken",U.accessToken),T8("expiresAt",U.expiresAt);const{accessToken:I,expiresAt:A}=U,Y={token:I,expiration:new Date(A)};if(Y.expiration.getTime()-Date.now()>GS)return Y;if(Date.now()-jQ.getTime()<30000)return $C(Y),Y;T8("clientId",U.clientId,!0),T8("clientSecret",U.clientSecret,!0),T8("refreshToken",U.refreshToken,!0);try{jQ.setTime(Date.now());const M=await LQ(U,h);T8("accessToken",M.accessToken),T8("expiresIn",M.expiresIn);const Z=new Date(Date.now()+M.expiresIn*1000);try{await qQ($,{...U,accessToken:M.accessToken,expiresAt:Z.toISOString(),refreshToken:M.refreshToken})}catch(z){}return{token:M.accessToken,expiration:Z}}catch(M){return $C(Y),Y}};var yQ=G(()=>{fD();X2();RQ();VQ();NQ();OQ();jQ=new Date(0)});var kQ=G(()=>{fD()});var bQ=G(()=>{fD()});var xQ=G(()=>{yQ();kQ();bQ()});function St(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}function V$(D){return{schemeId:"smithy.api#noAuth"}}var cQ,gQ=async(D,F,E)=>{return{operation:m0(F).operation,region:await sD(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},rQ=(D)=>{const F=[];switch(D.operation){case"GetRoleCredentials":{F.push(V$(D));break}case"ListAccountRoles":{F.push(V$(D));break}case"ListAccounts":{F.push(V$(D));break}case"Logout":{F.push(V$(D));break}default:F.push(St(D))}return F},_Q=(D)=>{return{...cQ.resolveAwsSdkSigV4Config(D)}};var fC=G(()=>{cQ=L(PD(),1);W2()});var sQ=(D)=>{return{...D,useDualstackEndpoint:D.useDualstackEndpoint??!1,useFipsEndpoint:D.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},K8;var DF=G(()=>{K8={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var dQ;var uQ=G(()=>{dQ={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.668.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.667.0","@aws-sdk/middleware-host-header":"3.667.0","@aws-sdk/middleware-logger":"3.667.0","@aws-sdk/middleware-recursion-detection":"3.667.0","@aws-sdk/middleware-user-agent":"3.668.0","@aws-sdk/region-config-resolver":"3.667.0","@aws-sdk/types":"3.667.0","@aws-sdk/util-endpoints":"3.667.0","@aws-sdk/util-user-agent-browser":"3.667.0","@aws-sdk/util-user-agent-node":"3.668.0","@smithy/config-resolver":"^3.0.9","@smithy/core":"^2.4.8","@smithy/fetch-http-handler":"^3.2.9","@smithy/hash-node":"^3.0.7","@smithy/invalid-dependency":"^3.0.7","@smithy/middleware-content-length":"^3.0.9","@smithy/middleware-endpoint":"^3.1.4","@smithy/middleware-retry":"^3.0.23","@smithy/middleware-serde":"^3.0.7","@smithy/middleware-stack":"^3.0.7","@smithy/node-config-provider":"^3.1.8","@smithy/node-http-handler":"^3.2.4","@smithy/protocol-http":"^4.1.4","@smithy/smithy-client":"^3.4.0","@smithy/types":"^3.5.0","@smithy/url-parser":"^3.0.7","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.23","@smithy/util-defaults-mode-node":"^3.0.23","@smithy/util-endpoints":"^2.1.3","@smithy/util-middleware":"^3.0.7","@smithy/util-retry":"^3.0.7","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}}});var vQ,mQ,nQ,tQ,eQ,E2,lQ,DH,iQ,pQ,aQ,oQ,Ht,FH;var EH=G(()=>{vQ={["required"]:!1,type:"String"},mQ={["required"]:!0,default:!1,type:"Boolean"},nQ={["ref"]:"Endpoint"},tQ={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},eQ={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},E2={},lQ={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},DH={["ref"]:"PartitionResult"},iQ={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[DH,"supportsDualStack"]}]},pQ=[tQ],aQ=[eQ],oQ=[{["ref"]:"Region"}],Ht={version:"1.0",parameters:{Region:vQ,UseDualStack:mQ,UseFIPS:mQ,Endpoint:vQ},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[nQ]}],rules:[{conditions:pQ,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:aQ,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:nQ,properties:E2,headers:E2},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:oQ}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:oQ,assign:"PartitionResult"}],rules:[{conditions:[tQ,eQ],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,lQ]},iQ],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:E2,headers:E2},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:pQ,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[lQ,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[DH,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:E2,headers:E2},type:"endpoint"},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:E2,headers:E2},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:aQ,rules:[{conditions:[iQ],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:E2,headers:E2},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:E2,headers:E2},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},FH=Ht});var Lt,wH=(D,F={})=>{return Lt.get(D,()=>G2(FH,{endpointParams:D,logger:F.logger}))};var $H=G(()=>{p8();Y2();EH();Lt=new M2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]});C0.aws=Z2});var fH,CH,BH=(D)=>{return{apiVersion:"2019-06-10",base64Decoder:D?.base64Decoder??T0,base64Encoder:D?.base64Encoder??S0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??wH,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??rQ,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new fH.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(F)=>F.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new CH.NoAuthSigner}],logger:D?.logger??new y0,serviceId:D?.serviceId??"SSO",urlParser:D?.urlParser??D0,utf8Decoder:D?.utf8Decoder??F0,utf8Encoder:D?.utf8Encoder??K0}};var hH=G(()=>{fH=L(PD(),1),CH=L(_D(),1);y();G8();O1();o2();fC();$H()});var UH,AH=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=BH(D);return UH.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:dQ.version}),maxAttempts:D?.maxAttempts??i(i2),region:D?.region??i(n0,u2),requestHandler:U0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...a2,default:async()=>(await E()).retryMode||t0}),sha256:D?.sha256??T2.bind(null,"sha256"),streamCollector:D?.streamCollector??e0,useDualstackEndpoint:D?.useDualstackEndpoint??i(_2),useFipsEndpoint:D?.useFipsEndpoint??i(s2),userAgentAppId:D?.userAgentAppId??i(f1)}};var IH=G(()=>{uQ();UH=L(PD(),1);l6();l0();i6();z2();m2();Z8();p6();j0();hH();y();a6();y()});var MH=(D)=>{const F=D.httpAuthSchemes;let{httpAuthSchemeProvider:E,credentials:w}=D;return{setHttpAuthScheme($){const C=F.findIndex((f)=>f.schemeId===$.schemeId);if(C===-1)F.push($);else F.splice(C,1,$)},httpAuthSchemes(){return F},setHttpAuthSchemeProvider($){E=$},httpAuthSchemeProvider(){return E},setCredentials($){w=$},credentials(){return w}}},GH=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var N$=(D)=>D,YH=(D,F)=>{const E={...N$(h1(D)),...N$(F1(D)),...N$(j2(D)),...N$(MH(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...P2(E),...GH(E)}};var ZH=G(()=>{t6();vD();y()});var FF,y1;var k3=G(()=>{z6();T6();K6();t8();l0();FF=L(_D(),1);x6();AD();z2();y();fC();DF();IH();ZH();y1=class y1 extends P0{constructor(...[D]){const F=AH(D||{}),E=sQ(F),w=g2(E),$=p2(w),C=d2($),f=y2(C),B=n2(f),h=_Q(B),U=YH(h,D?.extensions||[]);super(U);this.config=U,this.middlewareStack.use(r2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(v2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(x2(this.config)),this.middlewareStack.use(FF.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:gQ,identityProviderConfigProvider:async(I)=>new FF.DefaultIdentityProviderConfig({"aws.auth#sigv4":I.credentials})})),this.middlewareStack.use(FF.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}});var k1;var CC=G(()=>{y();k1=class k1 extends D2{constructor(D){super(D);Object.setPrototypeOf(this,k1.prototype)}}});var q$,O$,j$,P$,WH=(D)=>({...D,...D.accessToken&&{accessToken:wD}}),Rt=(D)=>({...D,...D.secretAccessKey&&{secretAccessKey:wD},...D.sessionToken&&{sessionToken:wD}}),XH=(D)=>({...D,...D.roleCredentials&&{roleCredentials:Rt(D.roleCredentials)}}),JH=(D)=>({...D,...D.accessToken&&{accessToken:wD}}),zH=(D)=>({...D,...D.accessToken&&{accessToken:wD}}),TH=(D)=>({...D,...D.accessToken&&{accessToken:wD}});var h6=G(()=>{y();CC();q$=class q$ extends k1{constructor(D){super({name:"InvalidRequestException",$fault:"client",...D});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,q$.prototype)}};O$=class O$ extends k1{constructor(D){super({name:"ResourceNotFoundException",$fault:"client",...D});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,O$.prototype)}};j$=class j$ extends k1{constructor(D){super({name:"TooManyRequestsException",$fault:"client",...D});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,j$.prototype)}};P$=class P$ extends k1{constructor(D){super({name:"UnauthorizedException",$fault:"client",...D});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,P$.prototype)}}});var S8,b3,KH=async(D,F)=>{const E=b3.requestBuilder(D,F),w=k({},W8,{[b$]:D[k$]});E.bp("/federation/credentials");const $=k({[yt]:[,yD(D[Pt],"roleName")],[OH]:[,yD(D[qH],"accountId")]});let C;return E.m("GET").h(w).q($).b(C),E.build()},SH=async(D,F)=>{const E=b3.requestBuilder(D,F),w=k({},W8,{[b$]:D[k$]});E.bp("/assignment/roles");const $=k({[kH]:[,D[yH]],[PH]:[()=>D.maxResults!==void 0,()=>D[jH].toString()],[OH]:[,yD(D[qH],"accountId")]});let C;return E.m("GET").h(w).q($).b(C),E.build()},QH=async(D,F)=>{const E=b3.requestBuilder(D,F),w=k({},W8,{[b$]:D[k$]});E.bp("/assignment/accounts");const $=k({[kH]:[,D[yH]],[PH]:[()=>D.maxResults!==void 0,()=>D[jH].toString()]});let C;return E.m("GET").h(w).q($).b(C),E.build()},HH=async(D,F)=>{const E=b3.requestBuilder(D,F),w=k({},W8,{[b$]:D[k$]});E.bp("/logout");let $;return E.m("POST").h(w).b($),E.build()},LH=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return y$(D,F);const E=k({$metadata:Q8(D)}),w=yD(Q0(await S8.parseJsonBody(D.body,F)),"body"),$=c(w,{roleCredentials:BD});return Object.assign(E,$),E},RH=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return y$(D,F);const E=k({$metadata:Q8(D)}),w=yD(Q0(await S8.parseJsonBody(D.body,F)),"body"),$=c(w,{nextToken:S,roleList:BD});return Object.assign(E,$),E},VH=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return y$(D,F);const E=k({$metadata:Q8(D)}),w=yD(Q0(await S8.parseJsonBody(D.body,F)),"body"),$=c(w,{accountList:BD,nextToken:S});return Object.assign(E,$),E},NH=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return y$(D,F);const E=k({$metadata:Q8(D)});return await $6(D.body,F),E},y$=async(D,F)=>{const E={...D,body:await S8.parseJsonErrorBody(D.body,F)},w=S8.loadRestJsonErrorCode(D,E.body);switch(w){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await Nt(E,F);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await qt(E,F);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await Ot(E,F);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await jt(E,F);default:const $=E.body;return Vt({output:D,parsedBody:$,errorCode:w})}},Vt,Nt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new q$({$metadata:Q8(D),...E});return u(C,D.body)},qt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new O$({$metadata:Q8(D),...E});return u(C,D.body)},Ot=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new j$({$metadata:Q8(D),...E});return u(C,D.body)},jt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new P$({$metadata:Q8(D),...E});return u(C,D.body)},Q8=(D)=>({httpStatusCode:D.statusCode,requestId:D.headers["x-amzn-requestid"]??D.headers["x-amzn-request-id"]??D.headers["x-amz-request-id"],extendedRequestId:D.headers["x-amz-id-2"],cfId:D.headers["x-amz-cf-id"]}),qH="accountId",k$="accessToken",OH="account_id",jH="maxResults",PH="max_result",yH="nextToken",kH="next_token",Pt="roleName",yt="role_name",b$="x-amz-sso_bearer_token";var x3=G(()=>{S8=L(PD(),1),b3=L(_D(),1);y();h6();CC();Vt=t2(k1)});var c3;var BC=G(()=>{AD();LD();y();DF();h6();x3();c3=class c3 extends l.classBuilder().ep(K8).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(WH,XH).ser(KH).de(LH).build(){}});var g3;var x$=G(()=>{AD();LD();y();DF();h6();x3();g3=class g3 extends l.classBuilder().ep(K8).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("SWBPortalService","ListAccountRoles",{}).n("SSOClient","ListAccountRolesCommand").f(JH,void 0).ser(SH).de(RH).build(){}});var r3;var c$=G(()=>{AD();LD();y();DF();h6();x3();r3=class r3 extends l.classBuilder().ep(K8).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("SWBPortalService","ListAccounts",{}).n("SSOClient","ListAccountsCommand").f(zH,void 0).ser(QH).de(VH).build(){}});var hC;var UC=G(()=>{AD();LD();y();DF();h6();x3();hC=class hC extends l.classBuilder().ep(K8).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("SWBPortalService","Logout",{}).n("SSOClient","LogoutCommand").f(TH,void 0).ser(HH).de(NH).build(){}});var kt,bH;var xH=G(()=>{y();BC();x$();c$();UC();k3();kt={GetRoleCredentialsCommand:c3,ListAccountRolesCommand:g3,ListAccountsCommand:r3,LogoutCommand:hC};bH=class bH extends y1{};d6(kt,bH)});var cH=G(()=>{BC();x$();c$();UC()});var gH=()=>{};var rH,rKD;var _H=G(()=>{rH=L(_D(),1);x$();k3();rKD=rH.createPaginator(y1,g3,"nextToken","nextToken","maxResults")});var sH,dKD;var uH=G(()=>{sH=L(_D(),1);c$();k3();dKD=sH.createPaginator(y1,r3,"nextToken","nextToken","maxResults")});var dH=G(()=>{gH();_H();uH()});var vH=G(()=>{h6()});var mH=G(()=>{k3();xH();cH();dH();vH()});var nH={};_0(nH,{SSOClient:()=>y1,GetRoleCredentialsCommand:()=>c3});var lH=G(()=>{mH()});var AC,_3=!1,IC=async({ssoStartUrl:D,ssoSession:F,ssoAccountId:E,ssoRegion:w,ssoRoleName:$,ssoClient:C,clientConfig:f,profile:B,logger:h})=>{let U;const I="To refresh this SSO session run aws sso login with the corresponding profile.";if(F)try{const $D=await PQ({profile:B})();U={accessToken:$D.token,expiresAt:new Date($D.expiration).toISOString()}}catch($D){throw new x($D.message,{tryNextLink:_3,logger:h})}else try{U=await dw(D)}catch($D){throw new x("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:_3,logger:h})}if(new Date(U.expiresAt).getTime()-Date.now()<=0)throw new x("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:_3,logger:h});const{accessToken:A}=U,{SSOClient:Y,GetRoleCredentialsCommand:M}=await Promise.resolve().then(() => (lH(),nH)),Z=C||new Y(Object.assign({},f??{},{region:f?.region??w}));let z;try{z=await Z.send(new M({accountId:E,roleName:$,accessToken:A}))}catch($D){throw new x($D,{tryNextLink:_3,logger:h})}const{roleCredentials:{accessKeyId:X,secretAccessKey:J,sessionToken:K,expiration:H,credentialScope:V,accountId:m}={}}=z;if(!X||!J||!K||!H)throw new x("SSO returns an invalid temporary credential.",{tryNextLink:_3,logger:h});const FD={accessKeyId:X,secretAccessKey:J,sessionToken:K,expiration:new Date(H),...V&&{credentialScope:V},...m&&{accountId:m}};if(F)AC.setCredentialFeature(FD,"CREDENTIALS_SSO","s");else AC.setCredentialFeature(FD,"CREDENTIALS_SSO_LEGACY","u");return FD};var iH=G(()=>{AC=L(B0(),1);xQ();fD();X2()});var MC=(D,F)=>{const{sso_start_url:E,sso_account_id:w,sso_region:$,sso_role_name:C}=D;if(!E||!w||!$||!C)throw new x(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(D).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:F});return D};var GC=G(()=>{fD()});var bt=(D={})=>async()=>{D.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:F,ssoAccountId:E,ssoRegion:w,ssoRoleName:$,ssoSession:C}=D,{ssoClient:f}=D,B=p0(D);if(!F&&!E&&!w&&!$&&!C){const U=(await M8(D))[B];if(!U)throw new x(`Profile ${B} was not found.`,{logger:D.logger});if(!x5(U))throw new x(`Profile ${B} is not configured with SSO credentials.`,{logger:D.logger});if(U?.sso_session){const X=(await nw(D))[U.sso_session],J=` configurations in profile ${B} and sso-session ${U.sso_session}`;if(w&&w!==X.sso_region)throw new x("Conflicting SSO region"+J,{tryNextLink:!1,logger:D.logger});if(F&&F!==X.sso_start_url)throw new x("Conflicting SSO start_url"+J,{tryNextLink:!1,logger:D.logger});U.sso_region=X.sso_region,U.sso_start_url=X.sso_start_url}const{sso_start_url:I,sso_account_id:A,sso_region:Y,sso_role_name:M,sso_session:Z}=MC(U,D.logger);return IC({ssoStartUrl:I,ssoSession:Z,ssoAccountId:A,ssoRegion:Y,ssoRoleName:M,ssoClient:f,clientConfig:D.clientConfig,profile:B})}else if(!F||!E||!w||!$)throw new x('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:D.logger});else return IC({ssoStartUrl:F,ssoSession:C,ssoAccountId:E,ssoRegion:w,ssoRoleName:$,ssoClient:f,clientConfig:D.clientConfig,profile:B})};var pH=G(()=>{fD();X2();iH();GC()});var aH=()=>{};var YC={};_0(YC,{validateSsoProfile:()=>MC,isSsoProfile:()=>x5,fromSSO:()=>bt});var ZC=G(()=>{pH();aH();GC()});var oH,tH=(D,F,E)=>{const w={EcsContainer:async($)=>{const{fromHttp:C}=await Promise.resolve().then(() => (b5(),k5)),{fromContainerMetadata:f}=await Promise.resolve().then(() => (X3(),W3));return E?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>N1(C($??{}),f($))().then(WC)},Ec2InstanceMetadata:async($)=>{E?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:C}=await Promise.resolve().then(() => (X3(),W3));return async()=>C($)().then(WC)},Environment:async($)=>{E?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:C}=await Promise.resolve().then(() => (V5(),uK));return async()=>C($)().then(WC)}};if(D in w)return w[D];else throw new x(`Unsupported credential source in profile ${F}. Got ${D}, expected EcsContainer or Ec2InstanceMetadata or Environment.`,{logger:E})},WC=(D)=>oH.setCredentialFeature(D,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p");var eH=G(()=>{oH=L(B0(),1);fD()});function xt(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}function DL(D){return{schemeId:"smithy.api#noAuth"}}var FL,EL=async(D,F,E)=>{return{operation:m0(F).operation,region:await sD(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},wL=(D)=>{const F=[];switch(D.operation){case"AssumeRoleWithSAML":{F.push(DL(D));break}case"AssumeRoleWithWebIdentity":{F.push(DL(D));break}default:F.push(xt(D))}return F},ct=(D)=>({...D,stsClientCtor:b1}),$L=(D)=>{const F=ct(D);return{...FL.resolveAwsSdkSigV4Config(F)}};var XC=G(()=>{FL=L(PD(),1);W2();s3()});var fL=(D)=>{return{...D,useDualstackEndpoint:D.useDualstackEndpoint??!1,useFipsEndpoint:D.useFipsEndpoint??!1,useGlobalEndpoint:D.useGlobalEndpoint??!1,defaultSigningName:"sts"}},E0;var A1=G(()=>{E0={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var BL;var CL=G(()=>{BL={name:"@aws-sdk/client-sts",description:"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",version:"3.668.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts",test:"yarn test:unit","test:unit":"jest"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.668.0","@aws-sdk/core":"3.667.0","@aws-sdk/credential-provider-node":"3.668.0","@aws-sdk/middleware-host-header":"3.667.0","@aws-sdk/middleware-logger":"3.667.0","@aws-sdk/middleware-recursion-detection":"3.667.0","@aws-sdk/middleware-user-agent":"3.668.0","@aws-sdk/region-config-resolver":"3.667.0","@aws-sdk/types":"3.667.0","@aws-sdk/util-endpoints":"3.667.0","@aws-sdk/util-user-agent-browser":"3.667.0","@aws-sdk/util-user-agent-node":"3.668.0","@smithy/config-resolver":"^3.0.9","@smithy/core":"^2.4.8","@smithy/fetch-http-handler":"^3.2.9","@smithy/hash-node":"^3.0.7","@smithy/invalid-dependency":"^3.0.7","@smithy/middleware-content-length":"^3.0.9","@smithy/middleware-endpoint":"^3.1.4","@smithy/middleware-retry":"^3.0.23","@smithy/middleware-serde":"^3.0.7","@smithy/middleware-stack":"^3.0.7","@smithy/node-config-provider":"^3.1.8","@smithy/node-http-handler":"^3.2.4","@smithy/protocol-http":"^4.1.4","@smithy/smithy-client":"^3.4.0","@smithy/types":"^3.5.0","@smithy/url-parser":"^3.0.7","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.23","@smithy/util-defaults-mode-node":"^3.0.23","@smithy/util-endpoints":"^2.1.3","@smithy/util-middleware":"^3.0.7","@smithy/util-retry":"^3.0.7","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sts"}}});var hL,JC,XL,UL,oD,AL,JL,zL,w0,k0,IL,TL,KL,ML,SL,GL,YL,ZL,WL,rt,QL;var HL=G(()=>{hL={["required"]:!1,["type"]:"String"},JC={["required"]:!0,default:!1,["type"]:"Boolean"},XL={["ref"]:"Endpoint"},UL={["fn"]:"isSet",["argv"]:[{["ref"]:"Region"}]},oD={["ref"]:"Region"},AL={["fn"]:"aws.partition",["argv"]:[oD],assign:"PartitionResult"},JL={["ref"]:"UseFIPS"},zL={["ref"]:"UseDualStack"},w0={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"us-east-1"}]},headers:{}},k0={},IL={conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"aws-global"]}],["endpoint"]:w0,["type"]:"endpoint"},TL={["fn"]:"booleanEquals",["argv"]:[JL,!0]},KL={["fn"]:"booleanEquals",["argv"]:[zL,!0]},ML={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},SL={["ref"]:"PartitionResult"},GL={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[SL,"supportsDualStack"]}]},YL=[{["fn"]:"isSet",["argv"]:[XL]}],ZL=[TL],WL=[KL],rt={version:"1.0",parameters:{Region:hL,UseDualStack:JC,UseFIPS:JC,Endpoint:hL,UseGlobalEndpoint:JC},rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},{["fn"]:"not",["argv"]:YL},UL,AL,{["fn"]:"booleanEquals",["argv"]:[JL,!1]},{["fn"]:"booleanEquals",["argv"]:[zL,!1]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"ap-northeast-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"ap-south-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"ap-southeast-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"ap-southeast-2"]}],endpoint:w0,["type"]:"endpoint"},IL,{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"ca-central-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"eu-central-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"eu-north-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"eu-west-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"eu-west-2"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"eu-west-3"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"sa-east-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"us-east-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"us-east-2"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"us-west-1"]}],endpoint:w0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[oD,"us-west-2"]}],endpoint:w0,["type"]:"endpoint"},{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"{Region}"}]},headers:k0},["type"]:"endpoint"}],["type"]:"tree"},{conditions:YL,rules:[{conditions:ZL,error:"Invalid Configuration: FIPS and custom endpoint are not supported",["type"]:"error"},{conditions:WL,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",["type"]:"error"},{endpoint:{url:XL,properties:k0,headers:k0},["type"]:"endpoint"}],["type"]:"tree"},{conditions:[UL],rules:[{conditions:[AL],rules:[{conditions:[TL,KL],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,ML]},GL],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k0,headers:k0},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",["type"]:"error"}],["type"]:"tree"},{conditions:ZL,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[ML,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[SL,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:k0,headers:k0},["type"]:"endpoint"},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k0,headers:k0},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",["type"]:"error"}],["type"]:"tree"},{conditions:WL,rules:[{conditions:[GL],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k0,headers:k0},["type"]:"endpoint"}],["type"]:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",["type"]:"error"}],["type"]:"tree"},IL,{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:k0,headers:k0},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Configuration: Missing Region",["type"]:"error"}]},QL=rt});var _t,LL=(D,F={})=>{return _t.get(D,()=>G2(QL,{endpointParams:D,logger:F.logger}))};var RL=G(()=>{p8();Y2();HL();_t=new M2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]});C0.aws=Z2});var VL,NL,qL=(D)=>{return{apiVersion:"2011-06-15",base64Decoder:D?.base64Decoder??T0,base64Encoder:D?.base64Encoder??S0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??LL,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??wL,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new VL.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(F)=>F.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new NL.NoAuthSigner}],logger:D?.logger??new y0,serviceId:D?.serviceId??"STS",urlParser:D?.urlParser??D0,utf8Decoder:D?.utf8Decoder??F0,utf8Encoder:D?.utf8Encoder??K0}};var OL=G(()=>{VL=L(PD(),1),NL=L(_D(),1);y();G8();O1();o2();XC();RL()});var g$,jL,PL=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=qL(D);return g$.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,credentialDefaultProvider:D?.credentialDefaultProvider??K2,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:BL.version}),httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:($)=>$.getIdentityProvider("aws.auth#sigv4")||(async(C)=>await K2(C?.__config||{})()),signer:new g$.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:($)=>$.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new jL.NoAuthSigner}],maxAttempts:D?.maxAttempts??i(i2),region:D?.region??i(n0,u2),requestHandler:U0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...a2,default:async()=>(await E()).retryMode||t0}),sha256:D?.sha256??T2.bind(null,"sha256"),streamCollector:D?.streamCollector??e0,useDualstackEndpoint:D?.useDualstackEndpoint??i(_2),useFipsEndpoint:D?.useFipsEndpoint??i(s2),userAgentAppId:D?.userAgentAppId??i(f1)}};var yL=G(()=>{CL();g$=L(PD(),1);o6();l6();l0();jL=L(_D(),1);i6();z2();m2();Z8();p6();j0();OL();y();a6();y()});var kL=(D)=>{const F=D.httpAuthSchemes;let{httpAuthSchemeProvider:E,credentials:w}=D;return{setHttpAuthScheme($){const C=F.findIndex((f)=>f.schemeId===$.schemeId);if(C===-1)F.push($);else F.splice(C,1,$)},httpAuthSchemes(){return F},setHttpAuthSchemeProvider($){E=$},httpAuthSchemeProvider(){return E},setCredentials($){w=$},credentials(){return w}}},bL=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var r$=(D)=>D,xL=(D,F)=>{const E={...r$(h1(D)),...r$(F1(D)),...r$(j2(D)),...r$(kL(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...P2(E),...bL(E)}};var cL=G(()=>{t6();vD();y()});var EF,b1;var s3=G(()=>{z6();T6();K6();t8();l0();EF=L(_D(),1);x6();AD();z2();y();XC();A1();yL();cL();b1=class b1 extends P0{constructor(...[D]){const F=PL(D||{}),E=fL(F),w=g2(E),$=p2(w),C=d2($),f=y2(C),B=n2(f),h=$L(B),U=xL(h,D?.extensions||[]);super(U);this.config=U,this.middlewareStack.use(r2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(v2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(x2(this.config)),this.middlewareStack.use(EF.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:EL,identityProviderConfigProvider:async(I)=>new EF.DefaultIdentityProviderConfig({"aws.auth#sigv4":I.credentials})})),this.middlewareStack.use(EF.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}});var A0;var _$=G(()=>{y();A0=class A0 extends D2{constructor(D){super(D);Object.setPrototypeOf(this,A0.prototype)}}});var u3,d3,v3,m3,n3,l3,i3,p3,wF=(D)=>({...D,...D.SecretAccessKey&&{SecretAccessKey:wD}}),zC=(D)=>({...D,...D.Credentials&&{Credentials:wF(D.Credentials)}}),TC=(D)=>({...D,...D.SAMLAssertion&&{SAMLAssertion:wD}}),KC=(D)=>({...D,...D.Credentials&&{Credentials:wF(D.Credentials)}}),SC=(D)=>({...D,...D.WebIdentityToken&&{WebIdentityToken:wD}}),QC=(D)=>({...D,...D.Credentials&&{Credentials:wF(D.Credentials)}}),HC=(D)=>({...D,...D.Credentials&&{Credentials:wF(D.Credentials)}}),LC=(D)=>({...D,...D.Credentials&&{Credentials:wF(D.Credentials)}});var H8=G(()=>{y();_$();u3=class u3 extends A0{constructor(D){super({name:"ExpiredTokenException",$fault:"client",...D});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,u3.prototype)}};d3=class d3 extends A0{constructor(D){super({name:"MalformedPolicyDocumentException",$fault:"client",...D});this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,d3.prototype)}};v3=class v3 extends A0{constructor(D){super({name:"PackedPolicyTooLargeException",$fault:"client",...D});this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,v3.prototype)}};m3=class m3 extends A0{constructor(D){super({name:"RegionDisabledException",$fault:"client",...D});this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,m3.prototype)}};n3=class n3 extends A0{constructor(D){super({name:"IDPRejectedClaimException",$fault:"client",...D});this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,n3.prototype)}};l3=class l3 extends A0{constructor(D){super({name:"InvalidIdentityTokenException",$fault:"client",...D});this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,l3.prototype)}};i3=class i3 extends A0{constructor(D){super({name:"IDPCommunicationErrorException",$fault:"client",...D});this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,i3.prototype)}};p3=class p3 extends A0{constructor(D){super({name:"InvalidAuthorizationMessageException",$fault:"client",...D});this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,p3.prototype)}}});var S2,gL=async(D,F)=>{const E=V8;let w;return w=j8({...pt(D,F),[q8]:Re,[O8]:N8}),R8(F,E,"/",void 0,w)},rL=async(D,F)=>{const E=V8;let w;return w=j8({...at(D,F),[q8]:Ve,[O8]:N8}),R8(F,E,"/",void 0,w)},_L=async(D,F)=>{const E=V8;let w;return w=j8({...ot(D,F),[q8]:Ne,[O8]:N8}),R8(F,E,"/",void 0,w)},sL=async(D,F)=>{const E=V8;let w;return w=j8({...tt(D,F),[q8]:qe,[O8]:N8}),R8(F,E,"/",void 0,w)},uL=async(D,F)=>{const E=V8;let w;return w=j8({...et(D,F),[q8]:Oe,[O8]:N8}),R8(F,E,"/",void 0,w)},dL=async(D,F)=>{const E=V8;let w;return w=j8({...De(D,F),[q8]:je,[O8]:N8}),R8(F,E,"/",void 0,w)},vL=async(D,F)=>{const E=V8;let w;return w=j8({...Fe(D,F),[q8]:Pe,[O8]:N8}),R8(F,E,"/",void 0,w)},mL=async(D,F)=>{const E=V8;let w;return w=j8({...Ee(D,F),[q8]:ye,[O8]:N8}),R8(F,E,"/",void 0,w)},nL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await S2.parseXmlBody(D.body,F);let w={};return w=he(E.AssumeRoleResult,F),{$metadata:$0(D),...w}},lL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await S2.parseXmlBody(D.body,F);let w={};return w=Ue(E.AssumeRoleWithSAMLResult,F),{$metadata:$0(D),...w}},iL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await S2.parseXmlBody(D.body,F);let w={};return w=Ae(E.AssumeRoleWithWebIdentityResult,F),{$metadata:$0(D),...w}},pL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await S2.parseXmlBody(D.body,F);let w={};return w=Ie(E.DecodeAuthorizationMessageResult,F),{$metadata:$0(D),...w}},aL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await S2.parseXmlBody(D.body,F);let w={};return w=Ye(E.GetAccessKeyInfoResult,F),{$metadata:$0(D),...w}},oL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await S2.parseXmlBody(D.body,F);let w={};return w=Ze(E.GetCallerIdentityResult,F),{$metadata:$0(D),...w}},tL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await S2.parseXmlBody(D.body,F);let w={};return w=We(E.GetFederationTokenResult,F),{$metadata:$0(D),...w}},eL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await S2.parseXmlBody(D.body,F);let w={};return w=Xe(E.GetSessionTokenResult,F),{$metadata:$0(D),...w}},L8=async(D,F)=>{const E={...D,body:await S2.parseXmlErrorBody(D.body,F)},w=ke(D,E.body);switch(w){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await st(E,F);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await nt(E,F);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await lt(E,F);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await it(E,F);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await dt(E,F);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await mt(E,F);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await ut(E,F);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await vt(E,F);default:const $=E.body;return Le({output:D,parsedBody:$.Error,errorCode:w})}},st=async(D,F)=>{const E=D.body,w=Me(E.Error,F),$=new u3({$metadata:$0(D),...w});return u($,E)},ut=async(D,F)=>{const E=D.body,w=Je(E.Error,F),$=new i3({$metadata:$0(D),...w});return u($,E)},dt=async(D,F)=>{const E=D.body,w=ze(E.Error,F),$=new n3({$metadata:$0(D),...w});return u($,E)},vt=async(D,F)=>{const E=D.body,w=Te(E.Error,F),$=new p3({$metadata:$0(D),...w});return u($,E)},mt=async(D,F)=>{const E=D.body,w=Ke(E.Error,F),$=new l3({$metadata:$0(D),...w});return u($,E)},nt=async(D,F)=>{const E=D.body,w=Se(E.Error,F),$=new d3({$metadata:$0(D),...w});return u($,E)},lt=async(D,F)=>{const E=D.body,w=Qe(E.Error,F),$=new v3({$metadata:$0(D),...w});return u($,E)},it=async(D,F)=>{const E=D.body,w=He(E.Error,F),$=new m3({$metadata:$0(D),...w});return u($,E)},pt=(D,F)=>{const E={};if(D[g1]!=null)E[g1]=D[g1];if(D[BF]!=null)E[BF]=D[BF];if(D[$2]!=null){const w=s$(D[$2],F);if(D[$2]?.length===0)E.PolicyArns=[];Object.entries(w).forEach(([$,C])=>{const f=`PolicyArns.${$}`;E[f]=C})}if(D[w2]!=null)E[w2]=D[w2];if(D[M0]!=null)E[M0]=D[M0];if(D[UF]!=null){const w=DR(D[UF],F);if(D[UF]?.length===0)E.Tags=[];Object.entries(w).forEach(([$,C])=>{const f=`Tags.${$}`;E[f]=C})}if(D[pC]!=null){const w=Be(D[pC],F);if(D[pC]?.length===0)E.TransitiveTagKeys=[];Object.entries(w).forEach(([$,C])=>{const f=`TransitiveTagKeys.${$}`;E[f]=C})}if(D[OC]!=null)E[OC]=D[OC];if(D[hF]!=null)E[hF]=D[hF];if(D[AF]!=null)E[AF]=D[AF];if(D[C2]!=null)E[C2]=D[C2];if(D[_C]!=null){const w=fe(D[_C],F);if(D[_C]?.length===0)E.ProvidedContexts=[];Object.entries(w).forEach(([$,C])=>{const f=`ProvidedContexts.${$}`;E[f]=C})}return E},at=(D,F)=>{const E={};if(D[g1]!=null)E[g1]=D[g1];if(D[gC]!=null)E[gC]=D[gC];if(D[mC]!=null)E[mC]=D[mC];if(D[$2]!=null){const w=s$(D[$2],F);if(D[$2]?.length===0)E.PolicyArns=[];Object.entries(w).forEach(([$,C])=>{const f=`PolicyArns.${$}`;E[f]=C})}if(D[w2]!=null)E[w2]=D[w2];if(D[M0]!=null)E[M0]=D[M0];return E},ot=(D,F)=>{const E={};if(D[g1]!=null)E[g1]=D[g1];if(D[BF]!=null)E[BF]=D[BF];if(D[tC]!=null)E[tC]=D[tC];if(D[sC]!=null)E[sC]=D[sC];if(D[$2]!=null){const w=s$(D[$2],F);if(D[$2]?.length===0)E.PolicyArns=[];Object.entries(w).forEach(([$,C])=>{const f=`PolicyArns.${$}`;E[f]=C})}if(D[w2]!=null)E[w2]=D[w2];if(D[M0]!=null)E[M0]=D[M0];return E},tt=(D,F)=>{const E={};if(D[jC]!=null)E[jC]=D[jC];return E},et=(D,F)=>{const E={};if(D[$F]!=null)E[$F]=D[$F];return E},De=(D,F)=>{return{}},Fe=(D,F)=>{const E={};if(D[xC]!=null)E[xC]=D[xC];if(D[w2]!=null)E[w2]=D[w2];if(D[$2]!=null){const w=s$(D[$2],F);if(D[$2]?.length===0)E.PolicyArns=[];Object.entries(w).forEach(([$,C])=>{const f=`PolicyArns.${$}`;E[f]=C})}if(D[M0]!=null)E[M0]=D[M0];if(D[UF]!=null){const w=DR(D[UF],F);if(D[UF]?.length===0)E.Tags=[];Object.entries(w).forEach(([$,C])=>{const f=`Tags.${$}`;E[f]=C})}return E},Ee=(D,F)=>{const E={};if(D[M0]!=null)E[M0]=D[M0];if(D[hF]!=null)E[hF]=D[hF];if(D[AF]!=null)E[AF]=D[AF];return E},s$=(D,F)=>{const E={};let w=1;for(let $ of D){if($===null)continue;const C=we($,F);Object.entries(C).forEach(([f,B])=>{E[`member.${w}.${f}`]=B}),w++}return E},we=(D,F)=>{const E={};if(D[eC]!=null)E[eC]=D[eC];return E},$e=(D,F)=>{const E={};if(D[rC]!=null)E[rC]=D[rC];if(D[VC]!=null)E[VC]=D[VC];return E},fe=(D,F)=>{const E={};let w=1;for(let $ of D){if($===null)continue;const C=$e($,F);Object.entries(C).forEach(([f,B])=>{E[`member.${w}.${f}`]=B}),w++}return E},Ce=(D,F)=>{const E={};if(D[bC]!=null)E[bC]=D[bC];if(D[oC]!=null)E[oC]=D[oC];return E},Be=(D,F)=>{const E={};let w=1;for(let $ of D){if($===null)continue;E[`member.${w}`]=$,w++}return E},DR=(D,F)=>{const E={};let w=1;for(let $ of D){if($===null)continue;const C=Ce($,F);Object.entries(C).forEach(([f,B])=>{E[`member.${w}.${f}`]=B}),w++}return E},DB=(D,F)=>{const E={};if(D[RC]!=null)E[RC]=S(D[RC]);if(D[c1]!=null)E[c1]=S(D[c1]);return E},he=(D,F)=>{const E={};if(D[I0]!=null)E[I0]=a3(D[I0],F);if(D[x1]!=null)E[x1]=DB(D[x1],F);if(D[f2]!=null)E[f2]=G3(D[f2]);if(D[C2]!=null)E[C2]=S(D[C2]);return E},Ue=(D,F)=>{const E={};if(D[I0]!=null)E[I0]=a3(D[I0],F);if(D[x1]!=null)E[x1]=DB(D[x1],F);if(D[f2]!=null)E[f2]=G3(D[f2]);if(D[dC]!=null)E[dC]=S(D[dC]);if(D[lC]!=null)E[lC]=S(D[lC]);if(D[kC]!=null)E[kC]=S(D[kC]);if(D[CF]!=null)E[CF]=S(D[CF]);if(D[cC]!=null)E[cC]=S(D[cC]);if(D[C2]!=null)E[C2]=S(D[C2]);return E},Ae=(D,F)=>{const E={};if(D[I0]!=null)E[I0]=a3(D[I0],F);if(D[nC]!=null)E[nC]=S(D[nC]);if(D[x1]!=null)E[x1]=DB(D[x1],F);if(D[f2]!=null)E[f2]=G3(D[f2]);if(D[uC]!=null)E[uC]=S(D[uC]);if(D[CF]!=null)E[CF]=S(D[CF]);if(D[C2]!=null)E[C2]=S(D[C2]);return E},a3=(D,F)=>{const E={};if(D[$F]!=null)E[$F]=S(D[$F]);if(D[vC]!=null)E[vC]=S(D[vC]);if(D[iC]!=null)E[iC]=S(D[iC]);if(D[qC]!=null)E[qC]=yD(v6(D[qC]));return E},Ie=(D,F)=>{const E={};if(D[NC]!=null)E[NC]=S(D[NC]);return E},Me=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},Ge=(D,F)=>{const E={};if(D[yC]!=null)E[yC]=S(D[yC]);if(D[c1]!=null)E[c1]=S(D[c1]);return E},Ye=(D,F)=>{const E={};if(D[fF]!=null)E[fF]=S(D[fF]);return E},Ze=(D,F)=>{const E={};if(D[aC]!=null)E[aC]=S(D[aC]);if(D[fF]!=null)E[fF]=S(D[fF]);if(D[c1]!=null)E[c1]=S(D[c1]);return E},We=(D,F)=>{const E={};if(D[I0]!=null)E[I0]=a3(D[I0],F);if(D[PC]!=null)E[PC]=Ge(D[PC],F);if(D[f2]!=null)E[f2]=G3(D[f2]);return E},Xe=(D,F)=>{const E={};if(D[I0]!=null)E[I0]=a3(D[I0],F);return E},Je=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},ze=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},Te=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},Ke=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},Se=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},Qe=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},He=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},$0=(D)=>({httpStatusCode:D.statusCode,requestId:D.headers["x-amzn-requestid"]??D.headers["x-amzn-request-id"]??D.headers["x-amz-request-id"],extendedRequestId:D.headers["x-amz-id-2"],cfId:D.headers["x-amz-cf-id"]}),Le,R8=async(D,F,E,w,$)=>{const{hostname:C,protocol:f="https",port:B,path:h}=await D.endpoint(),U={protocol:f,hostname:C,port:B,method:"POST",path:h.endsWith("/")?h.slice(0,-1)+E:h+E,headers:F};if(w!==void 0)U.hostname=w;if($!==void 0)U.body=$;return new rD(U)},V8,N8="2011-06-15",q8="Action",$F="AccessKeyId",Re="AssumeRole",RC="AssumedRoleId",x1="AssumedRoleUser",Ve="AssumeRoleWithSAML",Ne="AssumeRoleWithWebIdentity",fF="Account",c1="Arn",CF="Audience",I0="Credentials",VC="ContextAssertion",qe="DecodeAuthorizationMessage",NC="DecodedMessage",M0="DurationSeconds",qC="Expiration",OC="ExternalId",jC="EncodedMessage",PC="FederatedUser",yC="FederatedUserId",Oe="GetAccessKeyInfo",je="GetCallerIdentity",Pe="GetFederationToken",ye="GetSessionToken",kC="Issuer",bC="Key",xC="Name",cC="NameQualifier",w2="Policy",$2="PolicyArns",gC="PrincipalArn",rC="ProviderArn",_C="ProvidedContexts",sC="ProviderId",f2="PackedPolicySize",uC="Provider",g1="RoleArn",BF="RoleSessionName",dC="Subject",vC="SecretAccessKey",mC="SAMLAssertion",nC="SubjectFromWebIdentityToken",C2="SourceIdentity",hF="SerialNumber",lC="SubjectType",iC="SessionToken",UF="Tags",AF="TokenCode",pC="TransitiveTagKeys",aC="UserId",O8="Version",oC="Value",tC="WebIdentityToken",eC="arn",zD="message",j8=(D)=>Object.entries(D).map(([F,E])=>h$(F)+"="+h$(E)).join("&"),ke=(D,F)=>{if(F.Error?.Code!==void 0)return F.Error.Code;if(D.statusCode==404)return"NotFound"};var r1=G(()=>{S2=L(PD(),1);vD();y();H8();_$();Le=t2(A0),V8={"content-type":"application/x-www-form-urlencoded"}});var IF;var u$=G(()=>{AD();LD();y();A1();H8();r1();IF=class IF extends l.classBuilder().ep(E0).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,zC).ser(gL).de(nL).build(){}});var d$;var FB=G(()=>{AD();LD();y();A1();H8();r1();d$=class d$ extends l.classBuilder().ep(E0).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithSAML",{}).n("STSClient","AssumeRoleWithSAMLCommand").f(TC,KC).ser(rL).de(lL).build(){}});var MF;var v$=G(()=>{AD();LD();y();A1();H8();r1();MF=class MF extends l.classBuilder().ep(E0).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(SC,QC).ser(_L).de(iL).build(){}});var m$;var EB=G(()=>{AD();LD();y();A1();r1();m$=class m$ extends l.classBuilder().ep(E0).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","DecodeAuthorizationMessage",{}).n("STSClient","DecodeAuthorizationMessageCommand").f(void 0,void 0).ser(sL).de(pL).build(){}});var n$;var wB=G(()=>{AD();LD();y();A1();r1();n$=class n$ extends l.classBuilder().ep(E0).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetAccessKeyInfo",{}).n("STSClient","GetAccessKeyInfoCommand").f(void 0,void 0).ser(uL).de(aL).build(){}});var l$;var $B=G(()=>{AD();LD();y();A1();r1();l$=class l$ extends l.classBuilder().ep(E0).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetCallerIdentity",{}).n("STSClient","GetCallerIdentityCommand").f(void 0,void 0).ser(dL).de(oL).build(){}});var i$;var fB=G(()=>{AD();LD();y();A1();H8();r1();i$=class i$ extends l.classBuilder().ep(E0).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetFederationToken",{}).n("STSClient","GetFederationTokenCommand").f(void 0,HC).ser(vL).de(tL).build(){}});var p$;var CB=G(()=>{AD();LD();y();A1();H8();r1();p$=class p$ extends l.classBuilder().ep(E0).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetSessionToken",{}).n("STSClient","GetSessionTokenCommand").f(void 0,LC).ser(mL).de(eL).build(){}});var be,BB;var FR=G(()=>{y();u$();FB();v$();EB();wB();$B();fB();CB();s3();be={AssumeRoleCommand:IF,AssumeRoleWithSAMLCommand:d$,AssumeRoleWithWebIdentityCommand:MF,DecodeAuthorizationMessageCommand:m$,GetAccessKeyInfoCommand:n$,GetCallerIdentityCommand:l$,GetFederationTokenCommand:i$,GetSessionTokenCommand:p$};BB=class BB extends b1{};d6(be,BB)});var ER=G(()=>{u$();FB();v$();EB();wB();$B();fB();CB()});var wR=G(()=>{H8()});var a$,$R="us-east-1",fR=(D)=>{if(typeof D?.Arn==="string"){const F=D.Arn.split(":");if(F.length>4&&F[4]!=="")return F[4]}return},CR=async(D,F,E)=>{const w=typeof D==="function"?await D():D,$=typeof F==="function"?await F():F;return E?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${w} (provider)`,`${$} (parent client)`,`${$R} (STS default)`),w??$??$R},BR=(D,F)=>{let E,w;return async($,C)=>{if(w=$,!E){const{logger:I=D?.parentClientConfig?.logger,region:A,requestHandler:Y=D?.parentClientConfig?.requestHandler,credentialProviderLogger:M}=D,Z=await CR(A,D?.parentClientConfig?.region,M),z=!UR(Y);E=new F({credentialDefaultProvider:()=>async()=>w,region:Z,requestHandler:z?Y:void 0,logger:I})}const{Credentials:f,AssumedRoleUser:B}=await E.send(new IF(C));if(!f||!f.AccessKeyId||!f.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${C.RoleArn}`);const h=fR(B),U={accessKeyId:f.AccessKeyId,secretAccessKey:f.SecretAccessKey,sessionToken:f.SessionToken,expiration:f.Expiration,...f.CredentialScope&&{credentialScope:f.CredentialScope},...h&&{accountId:h}};return a$.setCredentialFeature(U,"CREDENTIALS_STS_ASSUME_ROLE","i"),U}},hR=(D,F)=>{let E;return async(w)=>{if(!E){const{logger:h=D?.parentClientConfig?.logger,region:U,requestHandler:I=D?.parentClientConfig?.requestHandler,credentialProviderLogger:A}=D,Y=await CR(U,D?.parentClientConfig?.region,A),M=!UR(I);E=new F({region:Y,requestHandler:M?I:void 0,logger:h})}const{Credentials:$,AssumedRoleUser:C}=await E.send(new MF(w));if(!$||!$.AccessKeyId||!$.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${w.RoleArn}`);const f=fR(C),B={accessKeyId:$.AccessKeyId,secretAccessKey:$.SecretAccessKey,sessionToken:$.SessionToken,expiration:$.Expiration,...$.CredentialScope&&{credentialScope:$.CredentialScope},...f&&{accountId:f}};if(f)a$.setCredentialFeature(B,"RESOLVED_ACCOUNT_ID","T");return a$.setCredentialFeature(B,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),B}},UR=(D)=>{return D?.metadata?.handlerProtocol==="h2"};var AR=G(()=>{a$=L(B0(),1);u$();v$()});var IR=(D,F)=>{if(!F)return D;else return class E extends D{constructor(w){super(w);for(let $ of F)this.middlewareStack.use($)}}},MR=(D={},F)=>BR(D,IR(b1,F)),GR=(D={},F)=>hR(D,IR(b1,F)),xe=(D)=>(F)=>D({roleAssumer:MR(F),roleAssumerWithWebIdentity:GR(F),...F});var YR=G(()=>{AR();s3()});var hB={};_0(hB,{getDefaultRoleAssumerWithWebIdentity:()=>GR,getDefaultRoleAssumer:()=>MR,decorateDefaultCredentialProvider:()=>xe,__Client:()=>P0,STSServiceException:()=>A0,STSClient:()=>b1,STS:()=>BB,RegionDisabledException:()=>m3,PackedPolicyTooLargeException:()=>v3,MalformedPolicyDocumentException:()=>d3,InvalidIdentityTokenException:()=>l3,InvalidAuthorizationMessageException:()=>p3,IDPRejectedClaimException:()=>n3,IDPCommunicationErrorException:()=>i3,GetSessionTokenResponseFilterSensitiveLog:()=>LC,GetSessionTokenCommand:()=>p$,GetFederationTokenResponseFilterSensitiveLog:()=>HC,GetFederationTokenCommand:()=>i$,GetCallerIdentityCommand:()=>l$,GetAccessKeyInfoCommand:()=>n$,ExpiredTokenException:()=>u3,DecodeAuthorizationMessageCommand:()=>m$,CredentialsFilterSensitiveLog:()=>wF,AssumeRoleWithWebIdentityResponseFilterSensitiveLog:()=>QC,AssumeRoleWithWebIdentityRequestFilterSensitiveLog:()=>SC,AssumeRoleWithWebIdentityCommand:()=>MF,AssumeRoleWithSAMLResponseFilterSensitiveLog:()=>KC,AssumeRoleWithSAMLRequestFilterSensitiveLog:()=>TC,AssumeRoleWithSAMLCommand:()=>d$,AssumeRoleResponseFilterSensitiveLog:()=>zC,AssumeRoleCommand:()=>IF,$Command:()=>l});var UB=G(()=>{s3();FR();ER();wR();YR();_$()});var AB,WR=(D,{profile:F="default",logger:E}={})=>{return Boolean(D)&&typeof D==="object"&&typeof D.role_arn==="string"&&["undefined","string"].indexOf(typeof D.role_session_name)>-1&&["undefined","string"].indexOf(typeof D.external_id)>-1&&["undefined","string"].indexOf(typeof D.mfa_serial)>-1&&(ce(D,{profile:F,logger:E})||ge(D,{profile:F,logger:E}))},ce=(D,{profile:F,logger:E})=>{const w=typeof D.source_profile==="string"&&typeof D.credential_source==="undefined";if(w)E?.debug?.(` ${F} isAssumeRoleWithSourceProfile source_profile=${D.source_profile}`);return w},ge=(D,{profile:F,logger:E})=>{const w=typeof D.credential_source==="string"&&typeof D.source_profile==="undefined";if(w)E?.debug?.(` ${F} isCredentialSourceProfile credential_source=${D.credential_source}`);return w},XR=async(D,F,E,w={})=>{E.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const $=F[D];if(!E.roleAssumer){const{getDefaultRoleAssumer:B}=await Promise.resolve().then(() => (UB(),hB));E.roleAssumer=B({...E.clientConfig,credentialProviderLogger:E.logger,parentClientConfig:E?.parentClientConfig},E.clientPlugins)}const{source_profile:C}=$;if(C&&C in w)throw new x(`Detected a cycle attempting to resolve credentials for profile ${p0(E)}. Profiles visited: `+Object.keys(w).join(", "),{logger:E.logger});E.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${C?`source_profile=[${C}]`:`profile=[${D}]`}`);const f=C?o$(C,F,E,{...w,[C]:!0},ZR(F[C]??{})):(await tH($.credential_source,D,E.logger)(E))();if(ZR($))return f.then((B)=>AB.setCredentialFeature(B,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"));else{const B={RoleArn:$.role_arn,RoleSessionName:$.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:$.external_id,DurationSeconds:parseInt($.duration_seconds||"3600",10)},{mfa_serial:h}=$;if(h){if(!E.mfaCodeProvider)throw new x(`Profile ${D} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:E.logger,tryNextLink:!1});B.SerialNumber=h,B.TokenCode=await E.mfaCodeProvider(h)}const U=await f;return E.roleAssumer(U,B).then((I)=>AB.setCredentialFeature(I,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},ZR=(D)=>{return!D.role_arn&&!!D.credential_source};var JR=G(()=>{AB=L(B0(),1);fD();X2();eH();IB()});var zR,TR=(D,F,E)=>{if(F.Version!==1)throw Error(`Profile ${D} credential_process did not return Version 1.`);if(F.AccessKeyId===void 0||F.SecretAccessKey===void 0)throw Error(`Profile ${D} credential_process returned invalid credentials.`);if(F.Expiration){const C=new Date;if(new Date(F.Expiration)<C)throw Error(`Profile ${D} credential_process returned expired credentials.`)}let w=F.AccountId;if(!w&&E?.[D]?.aws_account_id)w=E[D].aws_account_id;const $={accessKeyId:F.AccessKeyId,secretAccessKey:F.SecretAccessKey,...F.SessionToken&&{sessionToken:F.SessionToken},...F.Expiration&&{expiration:new Date(F.Expiration)},...F.CredentialScope&&{credentialScope:F.CredentialScope},...w&&{accountId:w}};return zR.setCredentialFeature($,"CREDENTIALS_PROCESS","w"),$};var KR=G(()=>{zR=L(B0(),1)});import{exec as re}from"child_process";import{promisify as _e}from"util";var SR=async(D,F,E)=>{const w=F[D];if(F[D]){const $=w.credential_process;if($!==void 0){const C=_e(re);try{const{stdout:f}=await C($);let B;try{B=JSON.parse(f.trim())}catch{throw Error(`Profile ${D} credential_process returned invalid JSON.`)}return TR(D,B,F)}catch(f){throw new x(f.message,{logger:E})}}else throw new x(`Profile ${D} did not contain credential_process.`,{logger:E})}else throw new x(`Profile ${D} could not be found in shared credentials file.`,{logger:E})};var QR=G(()=>{fD();KR()});var se=(D={})=>async()=>{D.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const F=await M8(D);return SR(p0(D),F,D.logger)};var HR=G(()=>{X2();QR()});var MB={};_0(MB,{fromProcess:()=>se});var GB=G(()=>{HR()});var LR,RR=(D)=>Boolean(D)&&typeof D==="object"&&typeof D.credential_process==="string",VR=async(D,F)=>Promise.resolve().then(() => (GB(),MB)).then(({fromProcess:E})=>E({...D,profile:F})().then((w)=>LR.setCredentialFeature(w,"CREDENTIALS_PROFILE_PROCESS","v")));var NR=G(()=>{LR=L(B0(),1)});var YB,qR=async(D,F,E={})=>{const{fromSSO:w}=await Promise.resolve().then(() => (ZC(),YC));return w({profile:D,logger:E.logger})().then(($)=>{if(F.sso_session)return YB.setCredentialFeature($,"CREDENTIALS_PROFILE_SSO","r");else return YB.setCredentialFeature($,"CREDENTIALS_PROFILE_SSO_LEGACY","t")})},OR=(D)=>D&&(typeof D.sso_start_url==="string"||typeof D.sso_account_id==="string"||typeof D.sso_session==="string"||typeof D.sso_region==="string"||typeof D.sso_role_name==="string");var jR=G(()=>{YB=L(B0(),1)});var PR,ZB=(D)=>Boolean(D)&&typeof D==="object"&&typeof D.aws_access_key_id==="string"&&typeof D.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof D.aws_session_token)>-1&&["undefined","string"].indexOf(typeof D.aws_account_id)>-1,WB=async(D,F)=>{F?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials");const E={accessKeyId:D.aws_access_key_id,secretAccessKey:D.aws_secret_access_key,sessionToken:D.aws_session_token,...D.aws_credential_scope&&{credentialScope:D.aws_credential_scope},...D.aws_account_id&&{accountId:D.aws_account_id}};return PR.setCredentialFeature(E,"CREDENTIALS_PROFILE","n")};var yR=G(()=>{PR=L(B0(),1)});var XB=(D)=>async()=>{D.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:F,roleSessionName:E,webIdentityToken:w,providerId:$,policyArns:C,policy:f,durationSeconds:B}=D;let{roleAssumerWithWebIdentity:h}=D;if(!h){const{getDefaultRoleAssumerWithWebIdentity:U}=await Promise.resolve().then(() => (UB(),hB));h=U({...D.clientConfig,credentialProviderLogger:D.logger,parentClientConfig:D.parentClientConfig},D.clientPlugins)}return h({RoleArn:F,RoleSessionName:E??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:w,ProviderId:$,PolicyArns:C,Policy:f,DurationSeconds:B})};import{readFileSync as ue}from"fs";var bR,kR="AWS_WEB_IDENTITY_TOKEN_FILE",de="AWS_ROLE_ARN",ve="AWS_ROLE_SESSION_NAME",me=(D={})=>async()=>{D.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const F=D?.webIdentityTokenFile??process.env[kR],E=D?.roleArn??process.env[de],w=D?.roleSessionName??process.env[ve];if(!F||!E)throw new x("Web identity configuration not specified",{logger:D.logger});const $=await XB({...D,webIdentityToken:ue(F,{encoding:"ascii"}),roleArn:E,roleSessionName:w})();if(F===process.env[kR])bR.setCredentialFeature($,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return $};var xR=G(()=>{bR=L(B0(),1);fD()});var JB={};_0(JB,{fromWebToken:()=>XB,fromTokenFile:()=>me});var zB=G(()=>{xR()});var cR,gR=(D)=>Boolean(D)&&typeof D==="object"&&typeof D.web_identity_token_file==="string"&&typeof D.role_arn==="string"&&["undefined","string"].indexOf(typeof D.role_session_name)>-1,rR=async(D,F)=>Promise.resolve().then(() => (zB(),JB)).then(({fromTokenFile:E})=>E({webIdentityTokenFile:D.web_identity_token_file,roleArn:D.role_arn,roleSessionName:D.role_session_name,roleAssumerWithWebIdentity:F.roleAssumerWithWebIdentity,logger:F.logger,parentClientConfig:F.parentClientConfig})().then((w)=>cR.setCredentialFeature(w,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")));var _R=G(()=>{cR=L(B0(),1)});var o$=async(D,F,E,w={},$=!1)=>{const C=F[D];if(Object.keys(w).length>0&&ZB(C))return WB(C,E);if($||WR(C,{profile:D,logger:E.logger}))return XR(D,F,E,w);if(ZB(C))return WB(C,E);if(gR(C))return rR(C,E);if(RR(C))return VR(E,D);if(OR(C))return await qR(D,C,E);throw new x(`Could not resolve credentials using profile: [${D}] in configuration/credentials file(s).`,{logger:E.logger})};var IB=G(()=>{fD();JR();NR();jR();yR();_R()});var ne=(D={})=>async()=>{D.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const F=await M8(D);return o$(p0(D),F,D)};var sR=G(()=>{X2();IB()});var uR={};_0(uR,{fromIni:()=>ne});var dR=G(()=>{sR()});var vR=!1,K2=(D={})=>e8(N1(async()=>{if(D.profile??process.env[Gz]){if(process.env[A$]&&process.env[I$]){if(!vR)(D.logger?.warn&&D.logger?.constructor?.name!=="NoOpLogger"?D.logger.warn:console.warn)(`@aws-sdk/credential-provider-node - defaultProvider::fromEnv WARNING:
|
|
26
|
+
Multiple credential sources detected:
|
|
27
|
+
Both AWS_PROFILE and the pair AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY static credentials are set.
|
|
28
|
+
This SDK will proceed with the AWS_PROFILE value.
|
|
29
|
+
|
|
30
|
+
However, a future version may change this behavior to prefer the ENV static credentials.
|
|
31
|
+
Please ensure that your environment only sets either the AWS_PROFILE or the
|
|
32
|
+
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY pair.
|
|
33
|
+
`),vR=!0}throw new x("AWS_PROFILE is set, skipping fromEnv provider.",{logger:D.logger,tryNextLink:!0})}return D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromEnv"),R5(D)()},async()=>{D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromSSO");const{ssoStartUrl:F,ssoAccountId:E,ssoRegion:w,ssoRoleName:$,ssoSession:C}=D;if(!F&&!E&&!w&&!$&&!C)throw new x("Skipping SSO provider in default chain (inputs do not include SSO fields).",{logger:D.logger});const{fromSSO:f}=await Promise.resolve().then(() => (ZC(),YC));return f(D)()},async()=>{D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");const{fromIni:F}=await Promise.resolve().then(() => (dR(),uR));return F(D)()},async()=>{D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");const{fromProcess:F}=await Promise.resolve().then(() => (GB(),MB));return F(D)()},async()=>{D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");const{fromTokenFile:F}=await Promise.resolve().then(() => (zB(),JB));return F(D)()},async()=>{return D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await IS(D))()},async()=>{throw new x("Could not load credentials from any providers",{tryNextLink:!1,logger:D.logger})}),ie,le),le=(D)=>D?.expiration!==void 0,ie=(D)=>D?.expiration!==void 0&&D.expiration.getTime()-Date.now()<300000;var mR=G(()=>{V5();fD();X2();MS()});var o6=G(()=>{mR()});var nN=W((aB,oB)=>{(function(D,F){if(typeof aB==="object"&&typeof oB==="object")oB.exports=F();else if(typeof define==="function"&&define.amd)define(function(){return F()});else D.pluralize=F()})(aB,function(){var D=[],F=[],E={},w={},$={};function C(M){if(typeof M==="string")return new RegExp("^"+M+"$","i");return M}function f(M,Z){if(M===Z)return Z;if(M===M.toLowerCase())return Z.toLowerCase();if(M===M.toUpperCase())return Z.toUpperCase();if(M[0]===M[0].toUpperCase())return Z.charAt(0).toUpperCase()+Z.substr(1).toLowerCase();return Z.toLowerCase()}function B(M,Z){return M.replace(/\$(\d{1,2})/g,function(z,X){return Z[X]||""})}function h(M,Z){return M.replace(Z[0],function(z,X){var J=B(Z[1],arguments);if(z==="")return f(M[X-1],J);return f(z,J)})}function U(M,Z,z){if(!M.length||E.hasOwnProperty(M))return Z;var X=z.length;while(X--){var J=z[X];if(J[0].test(Z))return h(Z,J)}return Z}function I(M,Z,z){return function(X){var J=X.toLowerCase();if(Z.hasOwnProperty(J))return f(X,J);if(M.hasOwnProperty(J))return f(X,M[J]);return U(J,X,z)}}function A(M,Z,z,X){return function(J){var K=J.toLowerCase();if(Z.hasOwnProperty(K))return!0;if(M.hasOwnProperty(K))return!1;return U(K,K,z)===K}}function Y(M,Z,z){var X=Z===1?Y.singular(M):Y.plural(M);return(z?Z+" ":"")+X}return Y.plural=I($,w,D),Y.isPlural=A($,w,D),Y.singular=I(w,$,F),Y.isSingular=A(w,$,F),Y.addPluralRule=function(M,Z){D.push([C(M),Z])},Y.addSingularRule=function(M,Z){F.push([C(M),Z])},Y.addUncountableRule=function(M){if(typeof M==="string"){E[M.toLowerCase()]=!0;return}Y.addPluralRule(M,"$0"),Y.addSingularRule(M,"$0")},Y.addIrregularRule=function(M,Z){Z=Z.toLowerCase(),M=M.toLowerCase(),$[M]=Z,w[Z]=M},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(M){return Y.addIrregularRule(M[0],M[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(M){return Y.addPluralRule(M[0],M[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(M){return Y.addSingularRule(M[0],M[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[e\u00E9]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(Y.addUncountableRule),Y})});var lN=W((tB,eB)=>{(function(D,F,E){if(typeof tB==="object")eB.exports=E(),eB.exports.default=E();else if(typeof define==="function"&&define.amd)define(E);else F[D]=E()})("slugify",tB,function(){var D=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E'","\u0538":"Y'","\u0539":"T'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C'","\u053F":"K","\u0540":"H","\u0541":"D'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P'","\u0554":"Q'","\u0555":"O''","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"'","\u2019":"'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}`),F=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');function E(w,$){if(typeof w!=="string")throw new Error("slugify: string argument expected");$=typeof $==="string"?{replacement:$}:$||{};var C=F[$.locale]||{},f=$.replacement===void 0?"-":$.replacement,B=$.trim===void 0?!0:$.trim,h=w.normalize().split("").reduce(function(U,I){var A=C[I];if(A===void 0)A=D[I];if(A===void 0)A=I;if(A===f)A=" ";return U+A.replace($.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");if($.strict)h=h.replace(/[^A-Za-z0-9\s]/g,"");if(B)h=h.trim();if(h=h.replace(/\s+/g,f),$.lower)h=h.toLowerCase();return h}return E.extend=function(w){Object.assign(D,w)},E})});var RD=W((Q4,wh)=>{function Eh(D){return Eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},Eh(D)}function G0D(D){var F=typeof D==="string"||D instanceof String;if(!F){var E=Eh(D);if(D===null)E="null";else if(E==="object")E=D.constructor.name;throw new TypeError("Expected a string but received a ".concat(E))}}Object.defineProperty(Q4,"__esModule",{value:!0});Q4.default=G0D;wh.exports=Q4.default;wh.exports.default=Q4.default});var L4=W((H4,fh)=>{function W0D(D){return D&&D.__esModule?D:{default:D}}function $h(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(Z0D.default(D),F=String(F),!F)return $h(D,4)||$h(D,6);if(F==="4")return X0D.test(D);if(F==="6")return J0D.test(D);return!1}Object.defineProperty(H4,"__esModule",{value:!0});H4.default=$h;var Z0D=W0D(RD()),pN="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",b8="(".concat(pN,"[.]){3}").concat(pN),X0D=new RegExp("^".concat(b8,"$")),cD="(?:[0-9a-fA-F]{1,4})",J0D=new RegExp("^("+"(?:".concat(cD,":){7}(?:").concat(cD,"|:)|")+"(?:".concat(cD,":){6}(?:").concat(b8,"|:").concat(cD,"|:)|")+"(?:".concat(cD,":){5}(?::").concat(b8,"|(:").concat(cD,"){1,2}|:)|")+"(?:".concat(cD,":){4}(?:(:").concat(cD,"){0,1}:").concat(b8,"|(:").concat(cD,"){1,3}|:)|")+"(?:".concat(cD,":){3}(?:(:").concat(cD,"){0,2}:").concat(b8,"|(:").concat(cD,"){1,4}|:)|")+"(?:".concat(cD,":){2}(?:(:").concat(cD,"){0,3}:").concat(b8,"|(:").concat(cD,"){1,5}|:)|")+"(?:".concat(cD,":){1}(?:(:").concat(cD,"){0,4}:").concat(b8,"|(:").concat(cD,"){1,6}|:)|")+"(?::((?::".concat(cD,"){0,5}:").concat(b8,"|(?::").concat(cD,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");fh.exports=H4.default;fh.exports.default=H4.default});var x8=W((R4,Ch)=>{function T0D(){var D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},F=arguments.length>1?arguments[1]:void 0;for(var E in F)if(typeof D[E]==="undefined")D[E]=F[E];return D}Object.defineProperty(R4,"__esModule",{value:!0});R4.default=T0D;Ch.exports=R4.default;Ch.exports.default=R4.default});var oN=W((V4,Bh)=>{function aN(D){return D&&D.__esModule?D:{default:D}}function V0D(D,F){S0D.default(D),F=Q0D.default(F,R0D);var E=D.length;if(F.urlSafe)return L0D.test(D);if(E%4!==0||H0D.test(D))return!1;var w=D.indexOf("=");return w===-1||w===E-1||w===E-2&&D[E-1]==="="}Object.defineProperty(V4,"__esModule",{value:!0});V4.default=V0D;var S0D=aN(RD()),Q0D=aN(x8()),H0D=/[^A-Z0-9+\/=]/i,L0D=/^[A-Z0-9_\-]*$/i,R0D={urlSafe:!1};Bh.exports=V4.default;Bh.exports.default=V4.default});var eN=W((N4,hh)=>{function tN(D){return D&&D.__esModule?D:{default:D}}function j0D(D){q0D.default(D);var F=D.split("."),E=F.length;if(E!==3)return!1;return F.reduce(function(w,$){return w&&O0D.default($,{urlSafe:!0})},!0)}Object.defineProperty(N4,"__esModule",{value:!0});N4.default=j0D;var q0D=tN(RD()),O0D=tN(oN());hh.exports=N4.default;hh.exports.default=N4.default});var Ah=W((q4,Uh)=>{function Dq(D){return D&&D.__esModule?D:{default:D}}function x0D(D,F){if(y0D.default(D),F=k0D.default(F,b0D),F.allow_trailing_dot&&D[D.length-1]===".")D=D.substring(0,D.length-1);if(F.allow_wildcard===!0&&D.indexOf("*.")===0)D=D.substring(2);var E=D.split("."),w=E[E.length-1];if(F.require_tld){if(E.length<2)return!1;if(!F.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(w))return!1;if(/\s/.test(w))return!1}if(!F.allow_numeric_tld&&/^\d+$/.test(w))return!1;return E.every(function($){if($.length>63&&!F.ignore_max_length)return!1;if(!/^[a-z_\u00a1-\uffff0-9-]+$/i.test($))return!1;if(/[\uff01-\uff5e]/.test($))return!1;if(/^-|-$/.test($))return!1;if(!F.allow_underscores&&/_/.test($))return!1;return!0})}Object.defineProperty(q4,"__esModule",{value:!0});q4.default=x0D;var y0D=Dq(RD()),k0D=Dq(x8()),b0D={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};Uh.exports=q4.default;Uh.exports.default=q4.default});var $q=W((j4,Ih)=>{function O4(D){return D&&D.__esModule?D:{default:D}}function s0D(D,F){return m0D(D)||v0D(D,F)||d0D(D,F)||u0D()}function u0D(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d0D(D,F){if(!D)return;if(typeof D==="string")return Eq(D,F);var E=Object.prototype.toString.call(D).slice(8,-1);if(E==="Object"&&D.constructor)E=D.constructor.name;if(E==="Map"||E==="Set")return Array.from(D);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return Eq(D,F)}function Eq(D,F){if(F==null||F>D.length)F=D.length;for(var E=0,w=new Array(F);E<F;E++)w[E]=D[E];return w}function v0D(D,F){var E=D==null?null:typeof Symbol!="undefined"&&D[Symbol.iterator]||D["@@iterator"];if(E!=null){var w,$,C,f,B=[],h=!0,U=!1;try{if(C=(E=E.call(D)).next,F===0){if(Object(E)!==E)return;h=!1}else for(;!(h=(w=C.call(E)).done)&&(B.push(w.value),B.length!==F);h=!0);}catch(I){U=!0,$=I}finally{try{if(!h&&E.return!=null&&(f=E.return(),Object(f)!==f))return}finally{if(U)throw $}}return B}}function m0D(D){if(Array.isArray(D))return D}function i0D(D){return Object.prototype.toString.call(D)==="[object RegExp]"}function wq(D,F){for(var E=0;E<F.length;E++){var w=F[E];if(D===w||i0D(w)&&w.test(D))return!0}return!1}function p0D(D,F){if(g0D.default(D),!D||/[\s<>]/.test(D))return!1;if(D.indexOf("mailto:")===0)return!1;if(F=_0D.default(F,n0D),F.validate_length&&D.length>=2083)return!1;if(!F.allow_fragments&&D.includes("#"))return!1;if(!F.allow_query_components&&(D.includes("?")||D.includes("&")))return!1;var E,w,$,C,f,B,h,U;if(h=D.split("#"),D=h.shift(),h=D.split("?"),D=h.shift(),h=D.split("://"),h.length>1){if(E=h.shift().toLowerCase(),F.require_valid_protocol&&F.protocols.indexOf(E)===-1)return!1}else if(F.require_protocol)return!1;else if(D.slice(0,2)==="//"){if(!F.allow_protocol_relative_urls)return!1;h[0]=D.slice(2)}if(D=h.join("://"),D==="")return!1;if(h=D.split("/"),D=h.shift(),D===""&&!F.require_host)return!0;if(h=D.split("@"),h.length>1){if(F.disallow_auth)return!1;if(h[0]==="")return!1;if(w=h.shift(),w.indexOf(":")>=0&&w.split(":").length>2)return!1;var I=w.split(":"),A=s0D(I,2),Y=A[0],M=A[1];if(Y===""&&M==="")return!1}C=h.join("@"),B=null,U=null;var Z=C.match(l0D);if(Z)$="",U=Z[1],B=Z[2]||null;else if(h=C.split(":"),$=h.shift(),h.length)B=h.join(":");if(B!==null&&B.length>0){if(f=parseInt(B,10),!/^[0-9]+$/.test(B)||f<=0||f>65535)return!1}else if(F.require_port)return!1;if(F.host_whitelist)return wq($,F.host_whitelist);if($===""&&!F.require_host)return!0;if(!Fq.default($)&&!r0D.default($,F)&&(!U||!Fq.default(U,6)))return!1;if($=$||U,F.host_blacklist&&wq($,F.host_blacklist))return!1;return!0}Object.defineProperty(j4,"__esModule",{value:!0});j4.default=p0D;var g0D=O4(RD()),r0D=O4(Ah()),Fq=O4(L4()),_0D=O4(x8()),n0D={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0},l0D=/^\[([^\]]+)\](?::([0-9]+))?$/;Ih.exports=j4.default;Ih.exports.default=j4.default});var fq=W((P4,Mh)=>{function t0D(D){return D&&D.__esModule?D:{default:D}}function D2D(D){return o0D.default(D),e0D.test(D)}Object.defineProperty(P4,"__esModule",{value:!0});P4.default=D2D;var o0D=t0D(RD()),e0D=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;Mh.exports=P4.default;Mh.exports.default=P4.default});var hq=W((Cq)=>{function w2D(D){return D&&D.__esModule?D:{default:D}}function $2D(D){var F=D.filter(function(E){return!(E in y4)});if(F.length>0)return!1;return!0}function f2D(D,F){var E=D.replace(/[\s\-]+/gi,"").toUpperCase(),w=E.slice(0,2).toUpperCase(),$=w in y4;if(F.whitelist){if(!$2D(F.whitelist))return!1;var C=F.whitelist.includes(w);if(!C)return!1}if(F.blacklist){var f=F.blacklist.includes(w);if(f)return!1}return $&&y4[w].test(E)}function C2D(D){var F=D.replace(/[^A-Z0-9]+/gi,"").toUpperCase(),E=F.slice(4)+F.slice(0,4),w=E.replace(/[A-Z]/g,function(C){return C.charCodeAt(0)-55}),$=w.match(/\d{1,7}/g).reduce(function(C,f){return Number(C+f)%97},"");return $===1}function B2D(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return E2D.default(D),f2D(D,F)&&C2D(D)}Object.defineProperty(Cq,"__esModule",{value:!0});Cq.default=B2D;Cq.locales=void 0;var E2D=w2D(RD()),y4={AD:/^(AD[0-9]{2})\d{8}[A-Z0-9]{12}$/,AE:/^(AE[0-9]{2})\d{3}\d{16}$/,AL:/^(AL[0-9]{2})\d{8}[A-Z0-9]{16}$/,AT:/^(AT[0-9]{2})\d{16}$/,AZ:/^(AZ[0-9]{2})[A-Z0-9]{4}\d{20}$/,BA:/^(BA[0-9]{2})\d{16}$/,BE:/^(BE[0-9]{2})\d{12}$/,BG:/^(BG[0-9]{2})[A-Z]{4}\d{6}[A-Z0-9]{8}$/,BH:/^(BH[0-9]{2})[A-Z]{4}[A-Z0-9]{14}$/,BR:/^(BR[0-9]{2})\d{23}[A-Z]{1}[A-Z0-9]{1}$/,BY:/^(BY[0-9]{2})[A-Z0-9]{4}\d{20}$/,CH:/^(CH[0-9]{2})\d{5}[A-Z0-9]{12}$/,CR:/^(CR[0-9]{2})\d{18}$/,CY:/^(CY[0-9]{2})\d{8}[A-Z0-9]{16}$/,CZ:/^(CZ[0-9]{2})\d{20}$/,DE:/^(DE[0-9]{2})\d{18}$/,DK:/^(DK[0-9]{2})\d{14}$/,DO:/^(DO[0-9]{2})[A-Z]{4}\d{20}$/,DZ:/^(DZ\d{24})$/,EE:/^(EE[0-9]{2})\d{16}$/,EG:/^(EG[0-9]{2})\d{25}$/,ES:/^(ES[0-9]{2})\d{20}$/,FI:/^(FI[0-9]{2})\d{14}$/,FO:/^(FO[0-9]{2})\d{14}$/,FR:/^(FR[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,GB:/^(GB[0-9]{2})[A-Z]{4}\d{14}$/,GE:/^(GE[0-9]{2})[A-Z0-9]{2}\d{16}$/,GI:/^(GI[0-9]{2})[A-Z]{4}[A-Z0-9]{15}$/,GL:/^(GL[0-9]{2})\d{14}$/,GR:/^(GR[0-9]{2})\d{7}[A-Z0-9]{16}$/,GT:/^(GT[0-9]{2})[A-Z0-9]{4}[A-Z0-9]{20}$/,HR:/^(HR[0-9]{2})\d{17}$/,HU:/^(HU[0-9]{2})\d{24}$/,IE:/^(IE[0-9]{2})[A-Z0-9]{4}\d{14}$/,IL:/^(IL[0-9]{2})\d{19}$/,IQ:/^(IQ[0-9]{2})[A-Z]{4}\d{15}$/,IR:/^(IR[0-9]{2})0\d{2}0\d{18}$/,IS:/^(IS[0-9]{2})\d{22}$/,IT:/^(IT[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,JO:/^(JO[0-9]{2})[A-Z]{4}\d{22}$/,KW:/^(KW[0-9]{2})[A-Z]{4}[A-Z0-9]{22}$/,KZ:/^(KZ[0-9]{2})\d{3}[A-Z0-9]{13}$/,LB:/^(LB[0-9]{2})\d{4}[A-Z0-9]{20}$/,LC:/^(LC[0-9]{2})[A-Z]{4}[A-Z0-9]{24}$/,LI:/^(LI[0-9]{2})\d{5}[A-Z0-9]{12}$/,LT:/^(LT[0-9]{2})\d{16}$/,LU:/^(LU[0-9]{2})\d{3}[A-Z0-9]{13}$/,LV:/^(LV[0-9]{2})[A-Z]{4}[A-Z0-9]{13}$/,MA:/^(MA[0-9]{26})$/,MC:/^(MC[0-9]{2})\d{10}[A-Z0-9]{11}\d{2}$/,MD:/^(MD[0-9]{2})[A-Z0-9]{20}$/,ME:/^(ME[0-9]{2})\d{18}$/,MK:/^(MK[0-9]{2})\d{3}[A-Z0-9]{10}\d{2}$/,MR:/^(MR[0-9]{2})\d{23}$/,MT:/^(MT[0-9]{2})[A-Z]{4}\d{5}[A-Z0-9]{18}$/,MU:/^(MU[0-9]{2})[A-Z]{4}\d{19}[A-Z]{3}$/,MZ:/^(MZ[0-9]{2})\d{21}$/,NL:/^(NL[0-9]{2})[A-Z]{4}\d{10}$/,NO:/^(NO[0-9]{2})\d{11}$/,PK:/^(PK[0-9]{2})[A-Z0-9]{4}\d{16}$/,PL:/^(PL[0-9]{2})\d{24}$/,PS:/^(PS[0-9]{2})[A-Z0-9]{4}\d{21}$/,PT:/^(PT[0-9]{2})\d{21}$/,QA:/^(QA[0-9]{2})[A-Z]{4}[A-Z0-9]{21}$/,RO:/^(RO[0-9]{2})[A-Z]{4}[A-Z0-9]{16}$/,RS:/^(RS[0-9]{2})\d{18}$/,SA:/^(SA[0-9]{2})\d{2}[A-Z0-9]{18}$/,SC:/^(SC[0-9]{2})[A-Z]{4}\d{20}[A-Z]{3}$/,SE:/^(SE[0-9]{2})\d{20}$/,SI:/^(SI[0-9]{2})\d{15}$/,SK:/^(SK[0-9]{2})\d{20}$/,SM:/^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,SV:/^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,TL:/^(TL[0-9]{2})\d{19}$/,TN:/^(TN[0-9]{2})\d{20}$/,TR:/^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,UA:/^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,VA:/^(VA[0-9]{2})\d{18}$/,VG:/^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,XK:/^(XK[0-9]{2})\d{16}$/},ajD=Cq.locales=Object.keys(y4)});var Uq=W((k4,Gh)=>{function A2D(D){return D&&D.__esModule?D:{default:D}}function M2D(D,F){U2D.default(D);var E=I2D[![void 0,null].includes(F)?F:"all"];return!!E&&E.test(D)}Object.defineProperty(k4,"__esModule",{value:!0});k4.default=M2D;var U2D=A2D(RD()),I2D={1:/^[0-9A-F]{8}-[0-9A-F]{4}-1[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,2:/^[0-9A-F]{8}-[0-9A-F]{4}-2[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,7:/^[0-9A-F]{8}-[0-9A-F]{4}-7[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};Gh.exports=k4.default;Gh.exports.default=k4.default});var Aq=W((b4,Yh)=>{function Z2D(D){return D&&D.__esModule?D:{default:D}}function X2D(D){return Y2D.default(D),W2D.test(D)}Object.defineProperty(b4,"__esModule",{value:!0});b4.default=X2D;var Y2D=Z2D(RD()),W2D=/^[\x00-\x7F]+$/;Yh.exports=b4.default;Yh.exports.default=b4.default});var Iq=W((x4,Wh)=>{function T2D(D){return D&&D.__esModule?D:{default:D}}function Zh(D){return Zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(F){return typeof F}:function(F){return F&&typeof Symbol=="function"&&F.constructor===Symbol&&F!==Symbol.prototype?"symbol":typeof F},Zh(D)}function K2D(D,F){z2D.default(D);var E,w;if(Zh(F)==="object")E=F.min||0,w=F.max;else E=arguments[1],w=arguments[2];var $=encodeURI(D).split(/%..|./).length-1;return $>=E&&(typeof w==="undefined"||$<=w)}Object.defineProperty(x4,"__esModule",{value:!0});x4.default=K2D;var z2D=T2D(RD());Wh.exports=x4.default;Wh.exports.default=x4.default});var Gq=W((c4,Jh)=>{function t3(D){return D&&D.__esModule?D:{default:D}}function k2D(D){var F=D.replace(/^"(.+)"$/,"$1");if(!F.trim())return!1;var E=/[\.";<>]/.test(F);if(E){if(F===D)return!1;var w=F.split('"').length===F.split('\\"').length;if(!w)return!1}return!0}function b2D(D,F){if(Q2D.default(D),F=L2D.default(F,R2D),F.require_display_name||F.allow_display_name){var E=D.match(V2D);if(E){var w=E[1];if(D=D.replace(w,"").replace(/(^<|>$)/g,""),w.endsWith(" "))w=w.slice(0,-1);if(!k2D(w))return!1}else if(F.require_display_name)return!1}if(!F.ignore_max_length&&D.length>y2D)return!1;var $=D.split("@"),C=$.pop(),f=C.toLowerCase();if(F.host_blacklist.includes(f))return!1;if(F.host_whitelist.length>0&&!F.host_whitelist.includes(f))return!1;var B=$.join("@");if(F.domain_specific_validation&&(f==="gmail.com"||f==="googlemail.com")){B=B.toLowerCase();var h=B.split("+")[0];if(!Xh.default(h.replace(/\./g,""),{min:6,max:30}))return!1;var U=h.split(".");for(var I=0;I<U.length;I++)if(!q2D.test(U[I]))return!1}if(F.ignore_max_length===!1&&(!Xh.default(B,{max:64})||!Xh.default(C,{max:254})))return!1;if(!H2D.default(C,{require_tld:F.require_tld,ignore_max_length:F.ignore_max_length,allow_underscores:F.allow_underscores})){if(!F.allow_ip_domain)return!1;if(!Mq.default(C)){if(!C.startsWith("[")||!C.endsWith("]"))return!1;var A=C.slice(1,-1);if(A.length===0||!Mq.default(A))return!1}}if(B[0]==='"')return B=B.slice(1,B.length-1),F.allow_utf8_local_part?P2D.test(B):O2D.test(B);var Y=F.allow_utf8_local_part?j2D:N2D,M=B.split(".");for(var Z=0;Z<M.length;Z++)if(!Y.test(M[Z]))return!1;if(F.blacklisted_chars){if(B.search(new RegExp("[".concat(F.blacklisted_chars,"]+"),"g"))!==-1)return!1}return!0}Object.defineProperty(c4,"__esModule",{value:!0});c4.default=b2D;var Q2D=t3(RD()),Xh=t3(Iq()),H2D=t3(Ah()),Mq=t3(L4()),L2D=t3(x8()),R2D={allow_display_name:!1,allow_underscores:!1,require_display_name:!1,allow_utf8_local_part:!0,require_tld:!0,blacklisted_chars:"",ignore_max_length:!1,host_blacklist:[],host_whitelist:[]},V2D=/^([^\x00-\x1F\x7F-\x9F\cX]+)</i,N2D=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,q2D=/^[a-z\d]+$/,O2D=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,j2D=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A1-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,P2D=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,y2D=254;Jh.exports=c4.default;Jh.exports.default=c4.default});var m4=W((Tq)=>{Object.defineProperty(Tq,"__esModule",{value:!0});Tq.farsiLocales=Tq.englishLocales=Tq.dotDecimal=Tq.decimal=Tq.commaDecimal=Tq.bengaliLocales=Tq.arabicLocales=Tq.alphanumeric=Tq.alpha=void 0;var H0=Tq.alpha={"en-US":/^[A-Z]+$/i,"az-AZ":/^[A-VXYZ\u00C7\u018F\u011E\u0130\u0131\u00D6\u015E\u00DC]+$/i,"bg-BG":/^[\u0410-\u042F]+$/i,"cs-CZ":/^[A-Z\u00C1\u010C\u010E\u00C9\u011A\u00CD\u0147\u00D3\u0158\u0160\u0164\u00DA\u016E\u00DD\u017D]+$/i,"da-DK":/^[A-Z\u00C6\u00D8\u00C5]+$/i,"de-DE":/^[A-Z\u00C4\u00D6\u00DC\u00DF]+$/i,"el-GR":/^[\u0391-\u03CE]+$/i,"es-ES":/^[A-Z\u00C1\u00C9\u00CD\u00D1\u00D3\u00DA\u00DC]+$/i,"fa-IR":/^[\u0627\u0628\u067E\u062A\u062B\u062C\u0686\u062D\u062E\u062F\u0630\u0631\u0632\u0698\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u06A9\u06AF\u0644\u0645\u0646\u0648\u0647\u06CC]+$/i,"fi-FI":/^[A-Z\u00C5\u00C4\u00D6]+$/i,"fr-FR":/^[A-Z\u00C0\u00C2\u00C6\u00C7\u00C9\u00C8\u00CA\u00CB\u00CF\u00CE\u00D4\u0152\u00D9\u00DB\u00DC\u0178]+$/i,"it-IT":/^[A-Z\u00C0\u00C9\u00C8\u00CC\u00CE\u00D3\u00D2\u00D9]+$/i,"ja-JP":/^[\u3041-\u3093\u30A1-\u30F6\uFF66-\uFF9F\u4E00-\u9FA0\u30FC\u30FB\u3002\u3001]+$/i,"nb-NO":/^[A-Z\u00C6\u00D8\u00C5]+$/i,"nl-NL":/^[A-Z\u00C1\u00C9\u00CB\u00CF\u00D3\u00D6\u00DC\u00DA]+$/i,"nn-NO":/^[A-Z\u00C6\u00D8\u00C5]+$/i,"hu-HU":/^[A-Z\u00C1\u00C9\u00CD\u00D3\u00D6\u0150\u00DA\u00DC\u0170]+$/i,"pl-PL":/^[A-Z\u0104\u0106\u0118\u015A\u0141\u0143\u00D3\u017B\u0179]+$/i,"pt-PT":/^[A-Z\u00C3\u00C1\u00C0\u00C2\u00C4\u00C7\u00C9\u00CA\u00CB\u00CD\u00CF\u00D5\u00D3\u00D4\u00D6\u00DA\u00DC]+$/i,"ru-RU":/^[\u0410-\u042F\u0401]+$/i,"kk-KZ":/^[\u0410-\u042F\u0401\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[A-Z\u010C\u0106\u0110\u0160\u017D]+$/i,"sk-SK":/^[A-Z\u00C1\u010C\u010E\u00C9\u00CD\u0147\u00D3\u0160\u0164\u00DA\u00DD\u017D\u0139\u0154\u013D\u00C4\u00D4]+$/i,"sr-RS@latin":/^[A-Z\u010C\u0106\u017D\u0160\u0110]+$/i,"sr-RS":/^[\u0410-\u042F\u0402\u0408\u0409\u040A\u040B\u040F]+$/i,"sv-SE":/^[A-Z\u00C5\u00C4\u00D6]+$/i,"th-TH":/^[\u0E01-\u0E50\s]+$/i,"tr-TR":/^[A-Z\u00C7\u011E\u0130\u0131\u00D6\u015E\u00DC]+$/i,"uk-UA":/^[\u0410-\u0429\u042C\u042E\u042F\u0404I\u0407\u0490\u0456]+$/i,"vi-VN":/^[A-Z\u00C0\u00C1\u1EA0\u1EA2\u00C3\u00C2\u1EA6\u1EA4\u1EAC\u1EA8\u1EAA\u0102\u1EB0\u1EAE\u1EB6\u1EB2\u1EB4\u0110\u00C8\u00C9\u1EB8\u1EBA\u1EBC\u00CA\u1EC0\u1EBE\u1EC6\u1EC2\u1EC4\u00CC\u00CD\u1ECA\u1EC8\u0128\u00D2\u00D3\u1ECC\u1ECE\u00D5\u00D4\u1ED2\u1ED0\u1ED8\u1ED4\u1ED6\u01A0\u1EDC\u1EDA\u1EE2\u1EDE\u1EE0\u00D9\u00DA\u1EE4\u1EE6\u0168\u01AF\u1EEA\u1EE8\u1EF0\u1EEC\u1EEE\u1EF2\u00DD\u1EF4\u1EF6\u1EF8]+$/i,"ko-KR":/^[\u3131-\u314E\u314F-\u3163\uAC00-\uD7A3]*$/,"ku-IQ":/^[\u0626\u0627\u0628\u067E\u062A\u062C\u0686\u062D\u062E\u062F\u0631\u0695\u0632\u0698\u0633\u0634\u0639\u063A\u0641\u06A4\u0642\u06A9\u06AF\u0644\u06B5\u0645\u0646\u0648\u06C6\u06BE\u06D5\u06CC\u06CE\u064A\u0637\u0624\u062B\u0622\u0625\u0623\u0643\u0636\u0635\u0629\u0638\u0630]+$/i,ar:/^[\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\u0670]+$/,he:/^[\u05D0-\u05EA]+$/,fa:/^['\u0622\u0627\u0621\u0623\u0624\u0626\u0628\u067E\u062A\u062B\u062C\u0686\u062D\u062E\u062F\u0630\u0631\u0632\u0698\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u06A9\u06AF\u0644\u0645\u0646\u0648\u0647\u0629\u06CC']+$/i,bn:/^['\u0980\u0981\u0982\u0983\u0985\u0986\u0987\u0988\u0989\u098A\u098B\u098C\u098F\u0990\u0993\u0994\u0995\u0996\u0997\u0998\u0999\u099A\u099B\u099C\u099D\u099E\u099F\u09A0\u09A1\u09A2\u09A3\u09A4\u09A5\u09A6\u09A7\u09A8\u09AA\u09AB\u09AC\u09AD\u09AE\u09AF\u09B0\u09B2\u09B6\u09B7\u09B8\u09B9\u09BC\u09BD\u09BE\u09BF\u09C0\u09C1\u09C2\u09C3\u09C4\u09C7\u09C8\u09CB\u09CC\u09CD\u09CE\u09D7\u09DC\u09DD\u09DF\u09E0\u09E1\u09E2\u09E3\u09F0\u09F1\u09F2\u09F3\u09F4\u09F5\u09F6\u09F7\u09F8\u09F9\u09FA\u09FB']+$/,eo:/^[ABC\u0108D-G\u011CH\u0124IJ\u0134K-PRS\u015CTU\u016CVZ]+$/i,"hi-IN":/^[\u0900-\u0961]+[\u0972-\u097F]*$/i,"si-LK":/^[\u0D80-\u0DFF]+$/},L0=Tq.alphanumeric={"en-US":/^[0-9A-Z]+$/i,"az-AZ":/^[0-9A-VXYZ\u00C7\u018F\u011E\u0130\u0131\u00D6\u015E\u00DC]+$/i,"bg-BG":/^[0-9\u0410-\u042F]+$/i,"cs-CZ":/^[0-9A-Z\u00C1\u010C\u010E\u00C9\u011A\u00CD\u0147\u00D3\u0158\u0160\u0164\u00DA\u016E\u00DD\u017D]+$/i,"da-DK":/^[0-9A-Z\u00C6\u00D8\u00C5]+$/i,"de-DE":/^[0-9A-Z\u00C4\u00D6\u00DC\u00DF]+$/i,"el-GR":/^[0-9\u0391-\u03C9]+$/i,"es-ES":/^[0-9A-Z\u00C1\u00C9\u00CD\u00D1\u00D3\u00DA\u00DC]+$/i,"fi-FI":/^[0-9A-Z\u00C5\u00C4\u00D6]+$/i,"fr-FR":/^[0-9A-Z\u00C0\u00C2\u00C6\u00C7\u00C9\u00C8\u00CA\u00CB\u00CF\u00CE\u00D4\u0152\u00D9\u00DB\u00DC\u0178]+$/i,"it-IT":/^[0-9A-Z\u00C0\u00C9\u00C8\u00CC\u00CE\u00D3\u00D2\u00D9]+$/i,"ja-JP":/^[0-9\uFF10-\uFF19\u3041-\u3093\u30A1-\u30F6\uFF66-\uFF9F\u4E00-\u9FA0\u30FC\u30FB\u3002\u3001]+$/i,"hu-HU":/^[0-9A-Z\u00C1\u00C9\u00CD\u00D3\u00D6\u0150\u00DA\u00DC\u0170]+$/i,"nb-NO":/^[0-9A-Z\u00C6\u00D8\u00C5]+$/i,"nl-NL":/^[0-9A-Z\u00C1\u00C9\u00CB\u00CF\u00D3\u00D6\u00DC\u00DA]+$/i,"nn-NO":/^[0-9A-Z\u00C6\u00D8\u00C5]+$/i,"pl-PL":/^[0-9A-Z\u0104\u0106\u0118\u015A\u0141\u0143\u00D3\u017B\u0179]+$/i,"pt-PT":/^[0-9A-Z\u00C3\u00C1\u00C0\u00C2\u00C4\u00C7\u00C9\u00CA\u00CB\u00CD\u00CF\u00D5\u00D3\u00D4\u00D6\u00DA\u00DC]+$/i,"ru-RU":/^[0-9\u0410-\u042F\u0401]+$/i,"kk-KZ":/^[0-9\u0410-\u042F\u0401\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,"sl-SI":/^[0-9A-Z\u010C\u0106\u0110\u0160\u017D]+$/i,"sk-SK":/^[0-9A-Z\u00C1\u010C\u010E\u00C9\u00CD\u0147\u00D3\u0160\u0164\u00DA\u00DD\u017D\u0139\u0154\u013D\u00C4\u00D4]+$/i,"sr-RS@latin":/^[0-9A-Z\u010C\u0106\u017D\u0160\u0110]+$/i,"sr-RS":/^[0-9\u0410-\u042F\u0402\u0408\u0409\u040A\u040B\u040F]+$/i,"sv-SE":/^[0-9A-Z\u00C5\u00C4\u00D6]+$/i,"th-TH":/^[\u0E01-\u0E59\s]+$/i,"tr-TR":/^[0-9A-Z\u00C7\u011E\u0130\u0131\u00D6\u015E\u00DC]+$/i,"uk-UA":/^[0-9\u0410-\u0429\u042C\u042E\u042F\u0404I\u0407\u0490\u0456]+$/i,"ko-KR":/^[0-9\u3131-\u314E\u314F-\u3163\uAC00-\uD7A3]*$/,"ku-IQ":/^[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u06690-9\u0626\u0627\u0628\u067E\u062A\u062C\u0686\u062D\u062E\u062F\u0631\u0695\u0632\u0698\u0633\u0634\u0639\u063A\u0641\u06A4\u0642\u06A9\u06AF\u0644\u06B5\u0645\u0646\u0648\u06C6\u06BE\u06D5\u06CC\u06CE\u064A\u0637\u0624\u062B\u0622\u0625\u0623\u0643\u0636\u0635\u0629\u0638\u0630]+$/i,"vi-VN":/^[0-9A-Z\u00C0\u00C1\u1EA0\u1EA2\u00C3\u00C2\u1EA6\u1EA4\u1EAC\u1EA8\u1EAA\u0102\u1EB0\u1EAE\u1EB6\u1EB2\u1EB4\u0110\u00C8\u00C9\u1EB8\u1EBA\u1EBC\u00CA\u1EC0\u1EBE\u1EC6\u1EC2\u1EC4\u00CC\u00CD\u1ECA\u1EC8\u0128\u00D2\u00D3\u1ECC\u1ECE\u00D5\u00D4\u1ED2\u1ED0\u1ED8\u1ED4\u1ED6\u01A0\u1EDC\u1EDA\u1EE2\u1EDE\u1EE0\u00D9\u00DA\u1EE4\u1EE6\u0168\u01AF\u1EEA\u1EE8\u1EF0\u1EEC\u1EEE\u1EF2\u00DD\u1EF4\u1EF6\u1EF8]+$/i,ar:/^[\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u06690-9\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\u0670]+$/,he:/^[0-9\u05D0-\u05EA]+$/,fa:/^['0-9\u0622\u0627\u0621\u0623\u0624\u0626\u0628\u067E\u062A\u062B\u062C\u0686\u062D\u062E\u062F\u0630\u0631\u0632\u0698\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\u0641\u0642\u06A9\u06AF\u0644\u0645\u0646\u0648\u0647\u0629\u06CC\u06F1\u06F2\u06F3\u06F4\u06F5\u06F6\u06F7\u06F8\u06F9\u06F0']+$/i,bn:/^['\u0980\u0981\u0982\u0983\u0985\u0986\u0987\u0988\u0989\u098A\u098B\u098C\u098F\u0990\u0993\u0994\u0995\u0996\u0997\u0998\u0999\u099A\u099B\u099C\u099D\u099E\u099F\u09A0\u09A1\u09A2\u09A3\u09A4\u09A5\u09A6\u09A7\u09A8\u09AA\u09AB\u09AC\u09AD\u09AE\u09AF\u09B0\u09B2\u09B6\u09B7\u09B8\u09B9\u09BC\u09BD\u09BE\u09BF\u09C0\u09C1\u09C2\u09C3\u09C4\u09C7\u09C8\u09CB\u09CC\u09CD\u09CE\u09D7\u09DC\u09DD\u09DF\u09E0\u09E1\u09E2\u09E3\u09E6\u09E7\u09E8\u09E9\u09EA\u09EB\u09EC\u09ED\u09EE\u09EF\u09F0\u09F1\u09F2\u09F3\u09F4\u09F5\u09F6\u09F7\u09F8\u09F9\u09FA\u09FB']+$/,eo:/^[0-9ABC\u0108D-G\u011CH\u0124IJ\u0134K-PRS\u015CTU\u016CVZ]+$/i,"hi-IN":/^[\u0900-\u0963]+[\u0966-\u097F]*$/i,"si-LK":/^[0-9\u0D80-\u0DFF]+$/},G0=Tq.decimal={"en-US":".",ar:"\u066B"},Yq=Tq.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"];for(g4=0;g4<Yq.length;g4++)e3="en-".concat(Yq[g4]),H0[e3]=H0["en-US"],L0[e3]=L0["en-US"],G0[e3]=G0["en-US"];var e3,g4,Zq=Tq.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"];for(r4=0;r4<Zq.length;r4++)DE="ar-".concat(Zq[r4]),H0[DE]=H0.ar,L0[DE]=L0.ar,G0[DE]=G0.ar;var DE,r4,Wq=Tq.farsiLocales=["IR","AF"];for(s4=0;s4<Wq.length;s4++)_4="fa-".concat(Wq[s4]),L0[_4]=L0.fa,G0[_4]=G0.ar;var _4,s4,Xq=Tq.bengaliLocales=["BD","IN"];for(u4=0;u4<Xq.length;u4++)FE="bn-".concat(Xq[u4]),H0[FE]=H0.bn,L0[FE]=L0.bn,G0[FE]=G0["en-US"];var FE,u4,Jq=Tq.dotDecimal=["ar-EG","ar-LB","ar-LY"],zq=Tq.commaDecimal=["bg-BG","cs-CZ","da-DK","de-DE","el-GR","en-ZM","eo","es-ES","fr-CA","fr-FR","id-ID","it-IT","ku-IQ","hi-IN","hu-HU","nb-NO","nn-NO","nl-NL","pl-PL","pt-PT","ru-RU","kk-KZ","si-LK","sl-SI","sr-RS@latin","sr-RS","sv-SE","tr-TR","uk-UA","vi-VN"];for(d4=0;d4<Jq.length;d4++)G0[Jq[d4]]=G0["en-US"];var d4;for(v4=0;v4<zq.length;v4++)G0[zq[v4]]=",";var v4;H0["fr-CA"]=H0["fr-FR"];L0["fr-CA"]=L0["fr-FR"];H0["pt-BR"]=H0["pt-PT"];L0["pt-BR"]=L0["pt-PT"];G0["pt-BR"]=G0["pt-PT"];H0["pl-Pl"]=H0["pl-PL"];L0["pl-Pl"]=L0["pl-PL"];G0["pl-Pl"]=G0["pl-PL"];H0["fa-AF"]=H0.fa});var Hq=W((Sq)=>{function n2D(D){return D&&D.__esModule?D:{default:D}}function l2D(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};m2D.default(D);var w=D,$=E.ignore;if($)if($ instanceof RegExp)w=w.replace($,"");else if(typeof $==="string")w=w.replace(new RegExp("[".concat($.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(F in zh.alpha)return zh.alpha[F].test(w);throw new Error("Invalid locale '".concat(F,"'"))}Object.defineProperty(Sq,"__esModule",{value:!0});Sq.default=l2D;Sq.locales=void 0;var m2D=n2D(RD()),zh=m4(),ejD=Sq.locales=Object.keys(zh.alpha)});var Rq=W((n4,Th)=>{function Lq(D){return D&&D.__esModule?D:{default:D}}function E1D(D,F){if(p2D.default(D),F=a2D.default(F,F1D),!D.includes(","))return!1;var E=D.split(",");if(E[0].startsWith("(")&&!E[1].endsWith(")")||E[1].endsWith(")")&&!E[0].startsWith("("))return!1;if(F.checkDMS)return e2D.test(E[0])&&D1D.test(E[1]);return o2D.test(E[0])&&t2D.test(E[1])}Object.defineProperty(n4,"__esModule",{value:!0});n4.default=E1D;var p2D=Lq(RD()),a2D=Lq(x8()),o2D=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,t2D=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,e2D=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,D1D=/^\s*([1-7]?\d{1,2}\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|180\D+0\D+0)\D+[EWew]?$/i,F1D={checkDMS:!1};Th.exports=n4.default;Th.exports.default=n4.default});var Nq=W((l4,Kh)=>{Object.defineProperty(l4,"__esModule",{value:!0});l4.default=void 0;var $1D=function D(F,E){return F.some(function(w){return E===w})},FPD=l4.default=$1D;Kh.exports=l4.default;Kh.exports.default=l4.default});var Oq=W((i4,Qh)=>{function Sh(D){return D&&D.__esModule?D:{default:D}}function h1D(D){var F=new RegExp("^[-+]?([0-9]+)?(\\".concat(qq.decimal[D.locale],"[0-9]{").concat(D.decimal_digits,"})").concat(D.force_decimal?"":"?","$"));return F}function I1D(D,F){if(C1D.default(D),F=f1D.default(F,U1D),F.locale in qq.decimal)return!B1D.default(A1D,D.replace(/ /g,""))&&h1D(F).test(D);throw new Error("Invalid locale '".concat(F.locale,"'"))}Object.defineProperty(i4,"__esModule",{value:!0});i4.default=I1D;var f1D=Sh(x8()),C1D=Sh(RD()),B1D=Sh(Nq()),qq=m4(),U1D={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},A1D=["","-","+"];Qh.exports=i4.default;Qh.exports.default=i4.default});var jq=W((p4,Hh)=>{function Y1D(D){return D&&D.__esModule?D:{default:D}}function W1D(D){return G1D.default(D),Z1D.test(D)}Object.defineProperty(p4,"__esModule",{value:!0});p4.default=W1D;var G1D=Y1D(RD()),Z1D=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;Hh.exports=p4.default;Hh.exports.default=p4.default});var Pq=W((a4,Lh)=>{function z1D(D){return D&&D.__esModule?D:{default:D}}function T1D(D){J1D.default(D);var F=D.replace(/[- ]+/g,""),E=0,w,$,C;for(var f=F.length-1;f>=0;f--){if(w=F.substring(f,f+1),$=parseInt(w,10),C)if($*=2,$>=10)E+=$%10+1;else E+=$;else E+=$;C=!C}return!!(E%10===0?F:!1)}Object.defineProperty(a4,"__esModule",{value:!0});a4.default=T1D;var J1D=z1D(RD());Lh.exports=a4.default;Lh.exports.default=a4.default});var kq=W((o4,Rh)=>{function yq(D){return D&&D.__esModule?D:{default:D}}function L1D(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};S1D.default(D);var E=F.provider,w=D.replace(/[- ]+/g,"");if(E&&E.toLowerCase()in zF){if(!zF[E.toLowerCase()].test(w))return!1}else if(E&&!(E.toLowerCase()in zF))throw new Error("".concat(E," is not a valid credit card provider."));else if(!H1D.some(function($){return $.test(w)}))return!1;return Q1D.default(D)}Object.defineProperty(o4,"__esModule",{value:!0});o4.default=L1D;var S1D=yq(RD()),Q1D=yq(Pq()),zF={amex:/^3[47][0-9]{13}$/,dinersclub:/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,discover:/^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,jcb:/^(?:2131|1800|35\d{3})\d{11}$/,mastercard:/^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,unionpay:/^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,visa:/^(?:4[0-9]{12})(?:[0-9]{3,6})?$/},H1D=function(){var D=[];for(var F in zF)if(zF.hasOwnProperty(F))D.push(zF[F]);return D}();Rh.exports=o4.default;Rh.exports.default=o4.default});var cq=W((bq)=>{function N1D(D){return D&&D.__esModule?D:{default:D}}function q1D(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};V1D.default(D);var w=D,$=E.ignore;if($)if($ instanceof RegExp)w=w.replace($,"");else if(typeof $==="string")w=w.replace(new RegExp("[".concat($.replace(/[-[\]{}()*+?.,\\^$|#\\s]/g,"\\$&"),"]"),"g"),"");else throw new Error("ignore should be instance of a String or RegExp");if(F in Vh.alphanumeric)return Vh.alphanumeric[F].test(w);throw new Error("Invalid locale '".concat(F,"'"))}Object.defineProperty(bq,"__esModule",{value:!0});bq.default=q1D;bq.locales=void 0;var V1D=N1D(RD()),Vh=m4(),EPD=bq.locales=Object.keys(Vh.alphanumeric)});var rq=W((t4,Nh)=>{function P1D(D){return D&&D.__esModule?D:{default:D}}function y1D(D,F){j1D.default(D);var E=D.replace(/\s/g,"").toUpperCase();return F.toUpperCase()in gq&&gq[F].test(E)}Object.defineProperty(t4,"__esModule",{value:!0});t4.default=y1D;var j1D=P1D(RD()),gq={AM:/^[A-Z]{2}\d{7}$/,AR:/^[A-Z]{3}\d{6}$/,AT:/^[A-Z]\d{7}$/,AU:/^[A-Z]\d{7}$/,AZ:/^[A-Z]{1}\d{8}$/,BE:/^[A-Z]{2}\d{6}$/,BG:/^\d{9}$/,BR:/^[A-Z]{2}\d{6}$/,BY:/^[A-Z]{2}\d{7}$/,CA:/^[A-Z]{2}\d{6}$/,CH:/^[A-Z]\d{7}$/,CN:/^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$/,CY:/^[A-Z](\d{6}|\d{8})$/,CZ:/^\d{8}$/,DE:/^[CFGHJKLMNPRTVWXYZ0-9]{9}$/,DK:/^\d{9}$/,DZ:/^\d{9}$/,EE:/^([A-Z]\d{7}|[A-Z]{2}\d{7})$/,ES:/^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/,FI:/^[A-Z]{2}\d{7}$/,FR:/^\d{2}[A-Z]{2}\d{5}$/,GB:/^\d{9}$/,GR:/^[A-Z]{2}\d{7}$/,HR:/^\d{9}$/,HU:/^[A-Z]{2}(\d{6}|\d{7})$/,IE:/^[A-Z0-9]{2}\d{7}$/,IN:/^[A-Z]{1}-?\d{7}$/,ID:/^[A-C]\d{7}$/,IR:/^[A-Z]\d{8}$/,IS:/^(A)\d{7}$/,IT:/^[A-Z0-9]{2}\d{7}$/,JM:/^[Aa]\d{7}$/,JP:/^[A-Z]{2}\d{7}$/,KR:/^[MS]\d{8}$/,KZ:/^[a-zA-Z]\d{7}$/,LI:/^[a-zA-Z]\d{5}$/,LT:/^[A-Z0-9]{8}$/,LU:/^[A-Z0-9]{8}$/,LV:/^[A-Z0-9]{2}\d{7}$/,LY:/^[A-Z0-9]{8}$/,MT:/^\d{7}$/,MZ:/^([A-Z]{2}\d{7})|(\d{2}[A-Z]{2}\d{5})$/,MY:/^[AHK]\d{8}$/,MX:/^\d{10,11}$/,NL:/^[A-Z]{2}[A-Z0-9]{6}\d$/,NZ:/^([Ll]([Aa]|[Dd]|[Ff]|[Hh])|[Ee]([Aa]|[Pp])|[Nn])\d{6}$/,PH:/^([A-Z](\d{6}|\d{7}[A-Z]))|([A-Z]{2}(\d{6}|\d{7}))$/,PK:/^[A-Z]{2}\d{7}$/,PL:/^[A-Z]{2}\d{7}$/,PT:/^[A-Z]\d{6}$/,RO:/^\d{8,9}$/,RU:/^\d{9}$/,SE:/^\d{8}$/,SL:/^(P)[A-Z]\d{7}$/,SK:/^[0-9A-Z]\d{7}$/,TH:/^[A-Z]{1,2}\d{6,7}$/,TR:/^[A-Z]\d{8}$/,UA:/^[A-Z]{2}\d{6}$/,US:/^\d{9}$/,ZA:/^[TAMD]\d{8}$/};Nh.exports=t4.default;Nh.exports.default=t4.default});var Oh=W((sq)=>{function x1D(D){return D&&D.__esModule?D:{default:D}}function c1D(D,F){if(b1D.default(D),F in TF)return TF[F].test(D);else if(F==="any"){for(var E in TF)if(TF.hasOwnProperty(E)){var w=TF[E];if(w.test(D))return!0}return!1}throw new Error("Invalid locale '".concat(F,"'"))}Object.defineProperty(sq,"__esModule",{value:!0});sq.default=c1D;sq.locales=void 0;var b1D=x1D(RD()),_q=/^\d{3}$/,g0=/^\d{4}$/,Y0=/^\d{5}$/,qh=/^\d{6}$/,TF={AD:/^AD\d{3}$/,AT:g0,AU:g0,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:g0,BG:g0,BR:/^\d{5}-\d{3}$/,BY:/^2[1-4]\d{4}$/,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:g0,CN:/^(0[1-7]|1[012356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[1-5]|8[1345]|9[09])\d{4}$/,CZ:/^\d{3}\s?\d{2}$/,DE:Y0,DK:g0,DO:Y0,DZ:Y0,EE:Y0,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:Y0,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HT:/^HT\d{4}$/,HU:g0,ID:Y0,IE:/^(?!.*(?:o))[A-Za-z]\d[\dw]\s\w{4}$/i,IL:/^(\d{5}|\d{7})$/,IN:/^((?!10|29|35|54|55|65|66|86|87|88|89)[1-9][0-9]{5})$/,IR:/^(?!(\d)\1{3})[13-9]{4}[1346-9][013-9]{5}$/,IS:_q,IT:Y0,JP:/^\d{3}\-\d{4}$/,KE:Y0,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:g0,LV:/^LV\-\d{4}$/,LK:Y0,MG:_q,MX:Y0,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:Y0,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:g0,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:g0,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:qh,RU:qh,SA:Y0,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:qh,SI:g0,SK:/^\d{3}\s?\d{2}$/,TH:Y0,TN:g0,TW:/^\d{3}(\d{2})?$/,UA:Y0,US:/^\d{5}(-\d{4})?$/,ZA:g0,ZM:Y0},$PD=sq.locales=Object.keys(TF)});var jh=W((dq)=>{function _1D(D){return D&&D.__esModule?D:{default:D}}function s1D(D,F,E){if(r1D.default(D),E&&E.strictMode&&!D.startsWith("+"))return!1;if(Array.isArray(F))return F.some(function(C){if(TD.hasOwnProperty(C)){var f=TD[C];if(f.test(D))return!0}return!1});else if(F in TD)return TD[F].test(D);else if(!F||F==="any"){for(var w in TD)if(TD.hasOwnProperty(w)){var $=TD[w];if($.test(D))return!0}return!1}throw new Error("Invalid locale '".concat(F,"'"))}Object.defineProperty(dq,"__esModule",{value:!0});dq.default=s1D;dq.locales=void 0;var r1D=_1D(RD()),TD={"am-AM":/^(\+?374|0)(33|4[134]|55|77|88|9[13-689])\d{6}$/,"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-BH":/^(\+?973)?(3|6)\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-LB":/^(\+?961)?((3|81)\d{6}|7\d{7})$/,"ar-EG":/^((\+?20)|0)?1[0125]\d{8}$/,"ar-IQ":/^(\+?964|0)?7[0-9]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-KW":/^(\+?965)([569]\d{7}|41\d{6})$/,"ar-LY":/^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,"ar-MA":/^(?:(?:\+|00)212|0)[5-7]\d{8}$/,"ar-OM":/^((\+|00)968)?(9[1-9])\d{6}$/,"ar-PS":/^(\+?970|0)5[6|9](\d{7})$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SD":/^((\+?249)|0)?(9[012369]|1[012])\d{7}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"az-AZ":/^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,"bs-BA":/^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"bn-BD":/^(\+?880|0)1[13456789][0-9]{8}$/,"ca-AD":/^(\+376)?[346]\d{5}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,"de-AT":/^(\+43|0)\d{1,4}\d{3,12}$/,"de-CH":/^(\+41|0)([1-9])\d{1,9}$/,"de-LU":/^(\+352)?((6\d1)\d{6})$/,"dv-MV":/^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,"el-GR":/^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,"el-CY":/^(\+?357?)?(9(9|6)\d{6})$/,"en-AI":/^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-AG":/^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,"en-BM":/^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,"en-BS":/^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-GG":/^(\+?44|0)1481\d{6}$/,"en-GH":/^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,"en-GY":/^(\+592|0)6\d{6}$/,"en-HK":/^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,"en-MO":/^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,"en-IE":/^(\+?353|0)8[356789]\d{7}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-JM":/^(\+?876)?\d{7}$/,"en-KE":/^(\+?254|0)(7|1)\d{8}$/,"fr-CF":/^(\+?236| ?)(70|75|77|72|21|22)\d{6}$/,"en-SS":/^(\+?211|0)(9[1257])\d{7}$/,"en-KI":/^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,"en-KN":/^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,"en-LS":/^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,"en-MT":/^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,"en-MU":/^(\+?230|0)?\d{8}$/,"en-MW":/^(\+?265|0)(((77|88|31|99|98|21)\d{7})|(((111)|1)\d{6})|(32000\d{4}))$/,"en-NA":/^(\+?264|0)(6|8)\d{7}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)[28]\d{7,9}$/,"en-PG":/^(\+?675|0)?(7\d|8[18])\d{6}$/,"en-PK":/^((00|\+)?92|0)3[0-6]\d{8}$/,"en-PH":/^(09|\+639)\d{9}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[3689]\d{7}$/,"en-SL":/^(\+?232|0)\d{8}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"en-ZW":/^(\+263)[0-9]{9}$/,"en-BW":/^(\+?267)?(7[1-8]{1})\d{6}$/,"es-AR":/^\+?549(11|[2368]\d)\d{8}$/,"es-BO":/^(\+?591)?(6|7)\d{7}$/,"es-CO":/^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,"es-CL":/^(\+?56|0)[2-9]\d{1}\d{7}$/,"es-CR":/^(\+506)?[2-8]\d{7}$/,"es-CU":/^(\+53|0053)?5\d{7}$/,"es-DO":/^(\+?1)?8[024]9\d{7}$/,"es-HN":/^(\+?504)?[9|8|3|2]\d{7}$/,"es-EC":/^(\+?593|0)([2-7]|9[2-9])\d{7}$/,"es-ES":/^(\+?34)?[6|7]\d{8}$/,"es-PE":/^(\+?51)?9\d{8}$/,"es-MX":/^(\+?52)?(1|01)?\d{10,11}$/,"es-NI":/^(\+?505)\d{7,8}$/,"es-PA":/^(\+?507)\d{7,8}$/,"es-PY":/^(\+?595|0)9[9876]\d{7}$/,"es-SV":/^(\+?503)?[67]\d{7}$/,"es-UY":/^(\+598|0)9[1-9][\d]{6}$/,"es-VE":/^(\+?58)?(2|4)\d{9}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,"fj-FJ":/^(\+?679)?\s?\d{3}\s?\d{4}$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-BF":/^(\+226|0)[67]\d{7}$/,"fr-BJ":/^(\+229)\d{8}$/,"fr-CD":/^(\+?243|0)?(8|9)\d{8}$/,"fr-CM":/^(\+?237)6[0-9]{8}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"fr-GF":/^(\+?594|0|00594)[67]\d{8}$/,"fr-GP":/^(\+?590|0|00590)[67]\d{8}$/,"fr-MQ":/^(\+?596|0|00596)[67]\d{8}$/,"fr-PF":/^(\+?689)?8[789]\d{6}$/,"fr-RE":/^(\+?262|0|00262)[67]\d{8}$/,"fr-WF":/^(\+681)?\d{6}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,"hu-HU":/^(\+?36|06)(20|30|31|50|70)\d{7}$/,"id-ID":/^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,"ir-IR":/^(\+98|0)?9\d{9}$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"it-SM":/^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,"ja-JP":/^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,"ka-GE":/^(\+?995)?(79\d{7}|5\d{8})$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"ky-KG":/^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"lv-LV":/^(\+?371)2\d{7}$/,"mg-MG":/^((\+?261|0)(2|3)\d)?\d{7}$/,"mn-MN":/^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,"my-MM":/^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,"ms-MY":/^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,"mz-MZ":/^(\+?258)?8[234567]\d{7}$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"ne-NP":/^(\+?977)?9[78]\d{8}$/,"nl-BE":/^(\+?32|0)4\d{8}$/,"nl-NL":/^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,"nl-AW":/^(\+)?297(56|59|64|73|74|99)\d{5}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?([5-8]\d|45) ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"pt-AO":/^(\+244)\d{9}$/,"ro-MD":/^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,"ro-RO":/^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"si-LK":/^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,"sl-SI":/^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"so-SO":/^(\+?252|0)((6[0-9])\d{7}|(7[1-9])\d{7})$/,"sq-AL":/^(\+355|0)6[789]\d{6}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"tg-TJ":/^(\+?992)?[5][5]\d{7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"tk-TM":/^(\+993|993|8)\d{8}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"uz-UZ":/^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,"vi-VN":/^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,"zh-CN":/^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/,"dz-BT":/^(\+?975|0)?(17|16|77|02)\d{6}$/,"ar-YE":/^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,"ar-EH":/^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,"fa-AF":/^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/};TD["en-CA"]=TD["en-US"];TD["fr-CA"]=TD["en-CA"];TD["fr-BE"]=TD["nl-BE"];TD["zh-HK"]=TD["en-HK"];TD["zh-MO"]=TD["en-MO"];TD["ga-IE"]=TD["en-IE"];TD["fr-CH"]=TD["de-CH"];TD["it-CH"]=TD["fr-CH"];var CPD=dq.locales=Object.keys(TD)});var ch=W((bh,xh)=>{(function(D,F){typeof bh=="object"&&typeof xh!="undefined"?xh.exports=F():typeof define=="function"&&define.amd?define(F):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs=F()})(bh,function(){var D=1000,F=60000,E=3600000,w="millisecond",$="second",C="minute",f="hour",B="day",h="week",U="month",I="quarter",A="year",Y="date",M="Invalid Date",Z=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,X={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(_){var j=["th","st","nd","rd"],N=_%100;return"["+_+(j[(N-20)%10]||j[N]||j[0])+"]"}},J=function(_,j,N){var g=String(_);return!g||g.length>=j?_:""+Array(j+1-g.length).join(N)+_},K={s:J,z:function(_){var j=-_.utcOffset(),N=Math.abs(j),g=Math.floor(N/60),P=N%60;return(j<=0?"+":"-")+J(g,2,"0")+":"+J(P,2,"0")},m:function _(j,N){if(j.date()<N.date())return-_(N,j);var g=12*(N.year()-j.year())+(N.month()-j.month()),P=j.clone().add(g,U),v=N-P<0,n=j.clone().add(g+(v?-1:1),U);return+(-(g+(N-P)/(v?P-n:n-P))||0)},a:function(_){return _<0?Math.ceil(_)||0:Math.floor(_)},p:function(_){return{M:U,y:A,w:h,d:B,D:Y,h:f,m:C,s:$,ms:w,Q:I}[_]||String(_||"").toLowerCase().replace(/s$/,"")},u:function(_){return _===void 0}},H="en",V={};V[H]=X;var m="$isDayjsObject",FD=function(_){return _ instanceof UD||!(!_||!_[m])},$D=function _(j,N,g){var P;if(!j)return H;if(typeof j=="string"){var v=j.toLowerCase();V[v]&&(P=v),N&&(V[v]=N,P=v);var n=j.split("-");if(!P&&n.length>1)return _(n[0])}else{var DD=j.name;V[DD]=j,P=DD}return!g&&P&&(H=P),P||!g&&H},e=function(_,j){if(FD(_))return _.clone();var N=typeof j=="object"?j:{};return N.date=_,N.args=arguments,new UD(N)},b=K;b.l=$D,b.i=FD,b.w=function(_,j){return e(_,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var UD=function(){function _(N){this.$L=$D(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[m]=!0}var j=_.prototype;return j.parse=function(N){this.$d=function(g){var{date:P,utc:v}=g;if(P===null)return new Date(NaN);if(b.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var n=P.match(Z);if(n){var DD=n[2]-1||0,YD=(n[7]||"0").substring(0,3);return v?new Date(Date.UTC(n[1],DD,n[3]||1,n[4]||0,n[5]||0,n[6]||0,YD)):new Date(n[1],DD,n[3]||1,n[4]||0,n[5]||0,n[6]||0,YD)}}return new Date(P)}(N),this.init()},j.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},j.$utils=function(){return b},j.isValid=function(){return this.$d.toString()!==M},j.isSame=function(N,g){var P=e(N);return this.startOf(g)<=P&&P<=this.endOf(g)},j.isAfter=function(N,g){return e(N)<this.startOf(g)},j.isBefore=function(N,g){return this.endOf(g)<e(N)},j.$g=function(N,g,P){return b.u(N)?this[g]:this.set(P,N)},j.unix=function(){return Math.floor(this.valueOf()/1000)},j.valueOf=function(){return this.$d.getTime()},j.startOf=function(N,g){var P=this,v=!!b.u(g)||g,n=b.p(N),DD=function(O2,pD){var r0=b.w(P.$u?Date.UTC(P.$y,pD,O2):new Date(P.$y,pD,O2),P);return v?r0:r0.endOf(B)},YD=function(O2,pD){return b.w(P.toDate()[O2].apply(P.toDate("s"),(v?[0,0,0,0]:[23,59,59,999]).slice(pD)),P)},QD=this.$W,dD=this.$M,X0=this.$D,D8="set"+(this.$u?"UTC":"");switch(n){case A:return v?DD(1,0):DD(31,11);case U:return v?DD(1,dD):DD(0,dD+1);case h:var S1=this.$locale().weekStart||0,d8=(QD<S1?QD+7:QD)-S1;return DD(v?X0-d8:X0+(6-d8),dD);case B:case Y:return YD(D8+"Hours",0);case f:return YD(D8+"Minutes",1);case C:return YD(D8+"Seconds",2);case $:return YD(D8+"Milliseconds",3);default:return this.clone()}},j.endOf=function(N){return this.startOf(N,!1)},j.$set=function(N,g){var P,v=b.p(N),n="set"+(this.$u?"UTC":""),DD=(P={},P[B]=n+"Date",P[Y]=n+"Date",P[U]=n+"Month",P[A]=n+"FullYear",P[f]=n+"Hours",P[C]=n+"Minutes",P[$]=n+"Seconds",P[w]=n+"Milliseconds",P)[v],YD=v===B?this.$D+(g-this.$W):g;if(v===U||v===A){var QD=this.clone().set(Y,1);QD.$d[DD](YD),QD.init(),this.$d=QD.set(Y,Math.min(this.$D,QD.daysInMonth())).$d}else DD&&this.$d[DD](YD);return this.init(),this},j.set=function(N,g){return this.clone().$set(N,g)},j.get=function(N){return this[b.p(N)]()},j.add=function(N,g){var P,v=this;N=Number(N);var n=b.p(g),DD=function(dD){var X0=e(v);return b.w(X0.date(X0.date()+Math.round(dD*N)),v)};if(n===U)return this.set(U,this.$M+N);if(n===A)return this.set(A,this.$y+N);if(n===B)return DD(1);if(n===h)return DD(7);var YD=(P={},P[C]=F,P[f]=E,P[$]=D,P)[n]||1,QD=this.$d.getTime()+N*YD;return b.w(QD,this)},j.subtract=function(N,g){return this.add(-1*N,g)},j.format=function(N){var g=this,P=this.$locale();if(!this.isValid())return P.invalidDate||M;var v=N||"YYYY-MM-DDTHH:mm:ssZ",n=b.z(this),DD=this.$H,YD=this.$m,QD=this.$M,dD=P.weekdays,X0=P.months,D8=P.meridiem,S1=function(pD,r0,Q1,F8){return pD&&(pD[r0]||pD(g,v))||Q1[r0].slice(0,F8)},d8=function(pD){return b.s(DD%12||12,pD,"0")},O2=D8||function(pD,r0,Q1){var F8=pD<12?"AM":"PM";return Q1?F8.toLowerCase():F8};return v.replace(z,function(pD,r0){return r0||function(Q1){switch(Q1){case"YY":return String(g.$y).slice(-2);case"YYYY":return b.s(g.$y,4,"0");case"M":return QD+1;case"MM":return b.s(QD+1,2,"0");case"MMM":return S1(P.monthsShort,QD,X0,3);case"MMMM":return S1(X0,QD);case"D":return g.$D;case"DD":return b.s(g.$D,2,"0");case"d":return String(g.$W);case"dd":return S1(P.weekdaysMin,g.$W,dD,2);case"ddd":return S1(P.weekdaysShort,g.$W,dD,3);case"dddd":return dD[g.$W];case"H":return String(DD);case"HH":return b.s(DD,2,"0");case"h":return d8(1);case"hh":return d8(2);case"a":return O2(DD,YD,!0);case"A":return O2(DD,YD,!1);case"m":return String(YD);case"mm":return b.s(YD,2,"0");case"s":return String(g.$s);case"ss":return b.s(g.$s,2,"0");case"SSS":return b.s(g.$ms,3,"0");case"Z":return n}return null}(pD)||n.replace(":","")})},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(N,g,P){var v,n=this,DD=b.p(g),YD=e(N),QD=(YD.utcOffset()-this.utcOffset())*F,dD=this-YD,X0=function(){return b.m(n,YD)};switch(DD){case A:v=X0()/12;break;case U:v=X0();break;case I:v=X0()/3;break;case h:v=(dD-QD)/604800000;break;case B:v=(dD-QD)/86400000;break;case f:v=dD/E;break;case C:v=dD/F;break;case $:v=dD/D;break;default:v=dD}return P?v:b.a(v)},j.daysInMonth=function(){return this.endOf(U).$D},j.$locale=function(){return V[this.$L]},j.locale=function(N,g){if(!N)return this.$L;var P=this.clone(),v=$D(N,g,!0);return v&&(P.$L=v),P},j.clone=function(){return b.w(this.$d,this)},j.toDate=function(){return new Date(this.valueOf())},j.toJSON=function(){return this.isValid()?this.toISOString():null},j.toISOString=function(){return this.$d.toISOString()},j.toString=function(){return this.$d.toUTCString()},_}(),eD=UD.prototype;return e.prototype=eD,[["$ms",w],["$s",$],["$m",C],["$H",f],["$W",B],["$M",U],["$y",A],["$D",Y]].forEach(function(_){eD[_[1]]=function(j){return this.$g(j,_[0],_[1])}}),e.extend=function(_,j){return _.$i||(_(j,UD,e),_.$i=!0),e},e.locale=$D,e.isDayjs=FD,e.unix=function(_){return e(1000*_)},e.en=V[H],e.Ls=V,e.p={},e})});var ZO=W((gh,rh)=>{(function(D,F){typeof gh=="object"&&typeof rh!="undefined"?rh.exports=F():typeof define=="function"&&define.amd?define(F):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs_plugin_isSameOrAfter=F()})(gh,function(){return function(D,F){F.prototype.isSameOrAfter=function(E,w){return this.isSame(E,w)||this.isAfter(E,w)}}})});var WO=W((_h,sh)=>{(function(D,F){typeof _h=="object"&&typeof sh!="undefined"?sh.exports=F():typeof define=="function"&&define.amd?define(F):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs_plugin_isSameOrBefore=F()})(_h,function(){return function(D,F){F.prototype.isSameOrBefore=function(E,w){return this.isSame(E,w)||this.isBefore(E,w)}}})});var XO=W((uh,dh)=>{(function(D,F){typeof uh=="object"&&typeof dh!="undefined"?dh.exports=F():typeof define=="function"&&define.amd?define(F):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs_plugin_customParseFormat=F()})(uh,function(){var D={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},F=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,E=/\d/,w=/\d\d/,$=/\d\d?/,C=/\d*[^-_:/,()\s\d]+/,f={},B=function(Z){return(Z=+Z)+(Z>68?1900:2000)},h=function(Z){return function(z){this[Z]=+z}},U=[/[+-]\d\d:?(\d\d)?|Z/,function(Z){(this.zone||(this.zone={})).offset=function(z){if(!z)return 0;if(z==="Z")return 0;var X=z.match(/([+-]|\d\d)/g),J=60*X[1]+(+X[2]||0);return J===0?0:X[0]==="+"?-J:J}(Z)}],I=function(Z){var z=f[Z];return z&&(z.indexOf?z:z.s.concat(z.f))},A=function(Z,z){var X,J=f.meridiem;if(J){for(var K=1;K<=24;K+=1)if(Z.indexOf(J(K,0,z))>-1){X=K>12;break}}else X=Z===(z?"pm":"PM");return X},Y={A:[C,function(Z){this.afternoon=A(Z,!1)}],a:[C,function(Z){this.afternoon=A(Z,!0)}],Q:[E,function(Z){this.month=3*(Z-1)+1}],S:[E,function(Z){this.milliseconds=100*+Z}],SS:[w,function(Z){this.milliseconds=10*+Z}],SSS:[/\d{3}/,function(Z){this.milliseconds=+Z}],s:[$,h("seconds")],ss:[$,h("seconds")],m:[$,h("minutes")],mm:[$,h("minutes")],H:[$,h("hours")],h:[$,h("hours")],HH:[$,h("hours")],hh:[$,h("hours")],D:[$,h("day")],DD:[w,h("day")],Do:[C,function(Z){var z=f.ordinal,X=Z.match(/\d+/);if(this.day=X[0],z)for(var J=1;J<=31;J+=1)z(J).replace(/\[|\]/g,"")===Z&&(this.day=J)}],w:[$,h("week")],ww:[w,h("week")],M:[$,h("month")],MM:[w,h("month")],MMM:[C,function(Z){var z=I("months"),X=(I("monthsShort")||z.map(function(J){return J.slice(0,3)})).indexOf(Z)+1;if(X<1)throw new Error;this.month=X%12||X}],MMMM:[C,function(Z){var z=I("months").indexOf(Z)+1;if(z<1)throw new Error;this.month=z%12||z}],Y:[/[+-]?\d+/,h("year")],YY:[w,function(Z){this.year=B(Z)}],YYYY:[/\d{4}/,h("year")],Z:U,ZZ:U};function M(Z){var z,X;z=Z,X=f&&f.formats;for(var J=(Z=z.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(e,b,UD){var eD=UD&&UD.toUpperCase();return b||X[UD]||D[UD]||X[eD].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(_,j,N){return j||N.slice(1)})})).match(F),K=J.length,H=0;H<K;H+=1){var V=J[H],m=Y[V],FD=m&&m[0],$D=m&&m[1];J[H]=$D?{regex:FD,parser:$D}:V.replace(/^\[|\]$/g,"")}return function(e){for(var b={},UD=0,eD=0;UD<K;UD+=1){var _=J[UD];if(typeof _=="string")eD+=_.length;else{var{regex:j,parser:N}=_,g=e.slice(eD),P=j.exec(g)[0];N.call(b,P),e=e.replace(P,"")}}return function(v){var n=v.afternoon;if(n!==void 0){var DD=v.hours;n?DD<12&&(v.hours+=12):DD===12&&(v.hours=0),delete v.afternoon}}(b),b}}return function(Z,z,X){X.p.customParseFormat=!0,Z&&Z.parseTwoDigitYear&&(B=Z.parseTwoDigitYear);var J=z.prototype,K=J.parse;J.parse=function(H){var{date:V,utc:m,args:FD}=H;this.$u=m;var $D=FD[1];if(typeof $D=="string"){var e=FD[2]===!0,b=FD[3]===!0,UD=e||b,eD=FD[2];b&&(eD=FD[2]),f=this.$locale(),!e&&eD&&(f=X.Ls[eD]),this.$d=function(g,P,v,n){try{if(["x","X"].indexOf(P)>-1)return new Date((P==="X"?1000:1)*g);var DD=M(P)(g),YD=DD.year,QD=DD.month,dD=DD.day,X0=DD.hours,D8=DD.minutes,S1=DD.seconds,d8=DD.milliseconds,O2=DD.zone,pD=DD.week,r0=new Date,Q1=dD||(YD||QD?1:r0.getDate()),F8=YD||r0.getFullYear(),qE=0;YD&&!QD||(qE=QD>0?QD-1:r0.getMonth());var OE,v7=X0||0,m7=D8||0,n7=S1||0,l7=d8||0;return O2?new Date(Date.UTC(F8,qE,Q1,v7,m7,n7,l7+60*O2.offset*1000)):v?new Date(Date.UTC(F8,qE,Q1,v7,m7,n7,l7)):(OE=new Date(F8,qE,Q1,v7,m7,n7,l7),pD&&(OE=n(OE).week(pD).toDate()),OE)}catch(g4D){return new Date("")}}(V,$D,m,X),this.init(),eD&&eD!==!0&&(this.$L=this.locale(eD).$L),UD&&V!=this.format($D)&&(this.$d=new Date("")),f={}}else if($D instanceof Array)for(var _=$D.length,j=1;j<=_;j+=1){FD[1]=$D[j-1];var N=X.apply(this,FD);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}j===_&&(this.$d=new Date(""))}else K.call(this,H)}}})});var JO=W((D7,nh)=>{function F8D(D){return D&&D.__esModule?D:{default:D}}function E8D(D){return D8D.default(D),D.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")}Object.defineProperty(D7,"__esModule",{value:!0});D7.default=E8D;var D8D=F8D(RD());nh.exports=D7.default;nh.exports.default=D7.default});var zO=W((F7,lh)=>{function f8D(D){return D&&D.__esModule?D:{default:D}}function I8D(D){if(D.length>1)return D;return""}function M8D(D,F){F=$8D.default(F,C8D);var E=D.split("@"),w=E.pop(),$=E.join("@"),C=[$,w];if(C[1]=C[1].toLowerCase(),C[1]==="gmail.com"||C[1]==="googlemail.com"){if(F.gmail_remove_subaddress)C[0]=C[0].split("+")[0];if(F.gmail_remove_dots)C[0]=C[0].replace(/\.+/g,I8D);if(!C[0].length)return!1;if(F.all_lowercase||F.gmail_lowercase)C[0]=C[0].toLowerCase();C[1]=F.gmail_convert_googlemaildotcom?"gmail.com":C[1]}else if(B8D.indexOf(C[1])>=0){if(F.icloud_remove_subaddress)C[0]=C[0].split("+")[0];if(!C[0].length)return!1;if(F.all_lowercase||F.icloud_lowercase)C[0]=C[0].toLowerCase()}else if(h8D.indexOf(C[1])>=0){if(F.outlookdotcom_remove_subaddress)C[0]=C[0].split("+")[0];if(!C[0].length)return!1;if(F.all_lowercase||F.outlookdotcom_lowercase)C[0]=C[0].toLowerCase()}else if(U8D.indexOf(C[1])>=0){if(F.yahoo_remove_subaddress){var f=C[0].split("-");C[0]=f.length>1?f.slice(0,-1).join("-"):f[0]}if(!C[0].length)return!1;if(F.all_lowercase||F.yahoo_lowercase)C[0]=C[0].toLowerCase()}else if(A8D.indexOf(C[1])>=0){if(F.all_lowercase||F.yandex_lowercase)C[0]=C[0].toLowerCase();C[1]="yandex.ru"}else if(F.all_lowercase)C[0]=C[0].toLowerCase();return C.join("@")}Object.defineProperty(F7,"__esModule",{value:!0});F7.default=M8D;var $8D=f8D(x8()),C8D={all_lowercase:!0,gmail_lowercase:!0,gmail_remove_dots:!0,gmail_remove_subaddress:!0,gmail_convert_googlemaildotcom:!0,outlookdotcom_lowercase:!0,outlookdotcom_remove_subaddress:!0,yahoo_lowercase:!0,yahoo_remove_subaddress:!0,yandex_lowercase:!0,icloud_lowercase:!0,icloud_remove_subaddress:!0},B8D=["icloud.com","me.com"],h8D=["hotmail.at","hotmail.be","hotmail.ca","hotmail.cl","hotmail.co.il","hotmail.co.nz","hotmail.co.th","hotmail.co.uk","hotmail.com","hotmail.com.ar","hotmail.com.au","hotmail.com.br","hotmail.com.gr","hotmail.com.mx","hotmail.com.pe","hotmail.com.tr","hotmail.com.vn","hotmail.cz","hotmail.de","hotmail.dk","hotmail.es","hotmail.fr","hotmail.hu","hotmail.id","hotmail.ie","hotmail.in","hotmail.it","hotmail.jp","hotmail.kr","hotmail.lv","hotmail.my","hotmail.ph","hotmail.pt","hotmail.sa","hotmail.sg","hotmail.sk","live.be","live.co.uk","live.com","live.com.ar","live.com.mx","live.de","live.es","live.eu","live.fr","live.it","live.nl","msn.com","outlook.at","outlook.be","outlook.cl","outlook.co.il","outlook.co.nz","outlook.co.th","outlook.com","outlook.com.ar","outlook.com.au","outlook.com.br","outlook.com.gr","outlook.com.pe","outlook.com.tr","outlook.com.vn","outlook.cz","outlook.de","outlook.dk","outlook.es","outlook.fr","outlook.hu","outlook.id","outlook.ie","outlook.in","outlook.it","outlook.jp","outlook.kr","outlook.lv","outlook.my","outlook.ph","outlook.pt","outlook.sa","outlook.sg","outlook.sk","passport.com"],U8D=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],A8D=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];lh.exports=F7.default;lh.exports.default=F7.default});function th(D){return D!==null&&typeof D==="object"}function EU(D,F,E=".",w){if(!th(F))return EU(D,{},E,w);const $=Object.assign({},F);for(let C in D){if(C==="__proto__"||C==="constructor")continue;const f=D[C];if(f===null||f===void 0)continue;if(w&&w($,C,f,E))continue;if(Array.isArray(f)&&Array.isArray($[C]))$[C]=[...f,...$[C]];else if(th(f)&&th($[C]))$[C]=EU(f,$[C],(E?`${E}.`:"")+C.toString(),w);else $[C]=f}return $}function w6D(D){return(...F)=>F.reduce((E,w)=>EU(E,w,"",D),{})}function f6D(D){return Object.prototype.toString.call(D)==="[object Object]"}function C6D(D){if(!f6D(D))return!1;if(!D.message&&!D.args)return!1;if(D.stack)return!1;return!0}function DU(D,F={},E=3){if(D===void 0)return E;if(typeof D==="number")return D;if(F[D]&&F[D].level!==void 0)return F[D].level;return E}function UP(D={}){return new iD(D)}class iD{constructor(D={}){const F=D.types||FU;this.options=$6D({...D,defaults:{...D.defaults},level:DU(D.level,F),reporters:[...D.reporters||[]]},{types:FU,throttle:1000,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(let E in F){const w={type:E,...this.options.defaults,...F[E]};this[E]=this._wrapLogFn(w),this[E].raw=this._wrapLogFn(w,!0)}if(this.options.mockFn)this.mockTypes();this._lastLog={}}get level(){return this.options.level}set level(D){this.options.level=DU(D,this.options.types,this.options.level)}prompt(D,F){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(D,F)}create(D){const F=new iD({...this.options,...D});if(this._mockFn)F.mockTypes(this._mockFn);return F}withDefaults(D){return this.create({...this.options,defaults:{...this.options.defaults,...D}})}withTag(D){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+D:D})}addReporter(D){return this.options.reporters.push(D),this}removeReporter(D){if(D){const F=this.options.reporters.indexOf(D);if(F>=0)return this.options.reporters.splice(F,1)}else this.options.reporters.splice(0);return this}setReporters(D){return this.options.reporters=Array.isArray(D)?D:[D],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(let D in this.options.types){if(!console["__"+D])console["__"+D]=console[D];console[D]=this[D].raw}}restoreConsole(){for(let D in this.options.types)if(console["__"+D])console[D]=console["__"+D],delete console["__"+D]}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(D,F){if(!D)return;if(!D.__write)D.__write=D.write;D.write=(E)=>{this[F].raw(String(E).trim())}}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(D){if(!D)return;if(D.__write)D.write=D.__write,delete D.__write}pauseLogs(){eh=!0}resumeLogs(){eh=!1;const D=hP.splice(0);for(let F of D)F[0]._logFn(F[1],F[2])}mockTypes(D){const F=D||this.options.mockFn;if(this._mockFn=F,typeof F!=="function")return;for(let E in this.options.types)this[E]=F(E,this.options.types[E])||this[E],this[E].raw=this[E]}_wrapLogFn(D,F){return(...E)=>{if(eh){hP.push([this,D,E,F]);return}return this._logFn(D,E,F)}}_logFn(D,F,E){if((D.level||0)>this.level)return!1;const w={date:new Date,args:[],...D,level:DU(D.level,this.options.types)};if(!E&&F.length===1&&C6D(F[0]))Object.assign(w,F[0]);else w.args=[...F];if(w.message)w.args.unshift(w.message),delete w.message;if(w.additional){if(!Array.isArray(w.additional))w.additional=w.additional.split("\n");w.args.push("\n"+w.additional.join("\n")),delete w.additional}w.type=typeof w.type==="string"?w.type.toLowerCase():"log",w.tag=typeof w.tag==="string"?w.tag:"";const $=(f=!1)=>{const B=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&B>0){const h=[...this._lastLog.object.args];if(B>1)h.push(`(repeated ${B} times)`);this._log({...this._lastLog.object,args:h}),this._lastLog.count=1}if(f)this._lastLog.object=w,this._log(w)};clearTimeout(this._lastLog.timeout);const C=this._lastLog.time&&w.date?w.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=w.date,C<this.options.throttle)try{const f=JSON.stringify([w.type,w.tag,w.args]),B=this._lastLog.serialized===f;if(this._lastLog.serialized=f,B){if(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin){this._lastLog.timeout=setTimeout($,this.options.throttle);return}}}catch{}$(!0)}_log(D){for(let F of this.options.reporters)F.log(D,{options:this.options})}}var lD,FU,$6D,eh=!1,hP;var C7=G(()=>{lD={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},FU={silent:{level:-1},fatal:{level:lD.fatal},error:{level:lD.error},warn:{level:lD.warn},log:{level:lD.log},info:{level:lD.info},success:{level:lD.success},fail:{level:lD.fail},ready:{level:lD.info},start:{level:lD.info},box:{level:lD.info},debug:{level:lD.debug},trace:{level:lD.trace},verbose:{level:lD.verbose}},$6D=w6D(),hP=[];iD.prototype.add=iD.prototype.addReporter;iD.prototype.remove=iD.prototype.removeReporter;iD.prototype.clear=iD.prototype.removeReporter;iD.prototype.withScope=iD.prototype.withTag;iD.prototype.mock=iD.prototype.mockTypes;iD.prototype.pause=iD.prototype.pauseLogs;iD.prototype.resume=iD.prototype.resumeLogs});import{formatWithOptions as B6D}from"util";import{sep as h6D}from"path";function $U(D){const F=process.cwd()+h6D;return D.split("\n").splice(1).map((w)=>w.trim().replace("file://","").replace(F,""))}function U6D(D,F){return(F.__write||F.write).call(F,D)}class B7{formatStack(D,F){return" "+$U(D).join("\n ")}formatArgs(D,F){const E=D.map((w)=>{if(w&&typeof w.stack==="string")return w.message+"\n"+this.formatStack(w.stack,F);return w});return B6D(F,...E)}formatDate(D,F){return F.date?D.toLocaleTimeString():""}filterAndJoin(D){return D.filter(Boolean).join(" ")}formatLogObj(D,F){const E=this.formatArgs(D.args,F);if(D.type==="box")return"\n"+[wU(D.tag),D.title&&D.title,...E.split("\n")].filter(Boolean).map((w)=>" > "+w).join("\n")+"\n";return this.filterAndJoin([wU(D.type),wU(D.tag),E])}log(D,F){const E=this.formatLogObj(D,{columns:F.options.stdout.columns||0,...F.options.formatOptions});return U6D(E+"\n",D.level<2?F.options.stderr||process.stderr:F.options.stdout||process.stdout)}}var wU=(D)=>D?`[${D}]`:"";var h7=()=>{};import*as U7 from"tty";function YP(D,F,E,w,$=F.slice(0,Math.max(0,D))+w,C=F.slice(Math.max(0,D+E.length)),f=C.indexOf(E)){return $+(f<0?C:YP(f,C,E,w))}function X6D(D,F,E,w,$){return D<0?E+F+w:E+YP(D,F,w,$)+w}function J6D(D,F,E=D,w=D.length+1){return($)=>$||!($===""||$===void 0)?X6D((""+$).indexOf(F,w),$,D,F,E):""}function o(D,F,E){return J6D(`\x1B[${D}m`,`\x1B[${F}m`,E)}function z6D(D=W6D){return D?AP:Object.fromEntries(Object.keys(AP).map((F)=>[F,String]))}function ZP(D,F="reset"){return Q[D]||Q[F]}function Z0(D){return D.replace(new RegExp(T6D,"g"),"")}function fU(D,F={}){const E={...F,style:{...K6D,...F.style}},w=D.split("\n"),$=[],C=ZP(E.style.borderColor),f={...typeof E.style.borderStyle==="string"?IP[E.style.borderStyle]||IP.solid:E.style.borderStyle};if(C)for(let M in f)f[M]=C(f[M]);const B=E.style.padding%2===0?E.style.padding:E.style.padding+1,h=w.length+B,U=Math.max(...w.map((M)=>M.length))+B,I=U+B,A=E.style.marginLeft>0?" ".repeat(E.style.marginLeft):"";if(E.style.marginTop>0)$.push("".repeat(E.style.marginTop));if(E.title){const M=f.h.repeat(Math.floor((U-Z0(E.title).length)/2)),Z=f.h.repeat(U-Z0(E.title).length-Z0(M).length+B);$.push(`${A}${f.tl}${M}${E.title}${Z}${f.tr}`)}else $.push(`${A}${f.tl}${f.h.repeat(I)}${f.tr}`);const Y=E.style.valign==="center"?Math.floor((h-w.length)/2):E.style.valign==="top"?h-w.length-B:h-w.length;for(let M=0;M<h;M++)if(M<Y||M>=Y+w.length)$.push(`${A}${f.v}${" ".repeat(I)}${f.v}`);else{const Z=w[M-Y],z=" ".repeat(B),X=" ".repeat(U-Z0(Z).length);$.push(`${A}${f.v}${z}${Z}${X}${f.v}`)}if($.push(`${A}${f.bl}${f.h.repeat(I)}${f.br}`),E.style.marginBottom>0)$.push("".repeat(E.style.marginBottom));return $.join("\n")}var c8,MP,A6D,I6D,M6D,G6D,GP,Y6D,Z6D,W6D,AP,Q,T6D,IP,K6D;var hE=G(()=>{({env:c8={},argv:MP=[],platform:A6D=""}=typeof process==="undefined"?{}:process),I6D="NO_COLOR"in c8||MP.includes("--no-color"),M6D="FORCE_COLOR"in c8||MP.includes("--color"),G6D=A6D==="win32",GP=c8.TERM==="dumb",Y6D=U7&&U7.isatty&&U7.isatty(1)&&c8.TERM&&!GP,Z6D="CI"in c8&&(("GITHUB_ACTIONS"in c8)||("GITLAB_CI"in c8)||("CIRCLECI"in c8)),W6D=!I6D&&(M6D||G6D&&!GP||Y6D||Z6D),AP={reset:o(0,0),bold:o(1,22,"\x1B[22m\x1B[1m"),dim:o(2,22,"\x1B[22m\x1B[2m"),italic:o(3,23),underline:o(4,24),inverse:o(7,27),hidden:o(8,28),strikethrough:o(9,29),black:o(30,39),red:o(31,39),green:o(32,39),yellow:o(33,39),blue:o(34,39),magenta:o(35,39),cyan:o(36,39),white:o(37,39),gray:o(90,39),bgBlack:o(40,49),bgRed:o(41,49),bgGreen:o(42,49),bgYellow:o(43,49),bgBlue:o(44,49),bgMagenta:o(45,49),bgCyan:o(46,49),bgWhite:o(47,49),blackBright:o(90,39),redBright:o(91,39),greenBright:o(92,39),yellowBright:o(93,39),blueBright:o(94,39),magentaBright:o(95,39),cyanBright:o(96,39),whiteBright:o(97,39),bgBlackBright:o(100,49),bgRedBright:o(101,49),bgGreenBright:o(102,49),bgYellowBright:o(103,49),bgBlueBright:o(104,49),bgMagentaBright:o(105,49),bgCyanBright:o(106,49),bgWhiteBright:o(107,49)},Q=z6D(),T6D=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"),IP={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},K6D={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1}});var kP={};_0(kP,{prompt:()=>fFD});import{stdin as S6D,stdout as Q6D}from"process";import WP from"readline";import{WriteStream as H6D}from"tty";import L6D from"tty";function P6D({onlyFirst:D=!1}={}){const F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}function VP(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(P6D(),"")}function UE(D,F={}){if(typeof D!="string"||D.length===0||(F={ambiguousIsNarrow:!0,...F},D=VP(D),D.length===0))return 0;D=D.replace(b6D()," ");const E=F.ambiguousIsNarrow?1:2;let w=0;for(let $ of D){const C=$.codePointAt(0);if(C<=31||C>=127&&C<=159||C>=768&&C<=879)continue;switch(k6D.eastAsianWidth($)){case"F":case"W":w+=2;break;case"A":w+=E;break;default:w+=1}}return w}function g6D(){const D=new Map;for(let[F,E]of Object.entries(SD)){for(let[w,$]of Object.entries(E))SD[w]={open:`\x1B[${$[0]}m`,close:`\x1B[${$[1]}m`},E[w]=SD[w],D.set($[0],$[1]);Object.defineProperty(SD,F,{value:E,enumerable:!1})}return Object.defineProperty(SD,"codes",{value:D,enumerable:!1}),SD.color.close="\x1B[39m",SD.bgColor.close="\x1B[49m",SD.color.ansi=XP(),SD.color.ansi256=JP(),SD.color.ansi16m=zP(),SD.bgColor.ansi=XP(BU),SD.bgColor.ansi256=JP(BU),SD.bgColor.ansi16m=zP(BU),Object.defineProperties(SD,{rgbToAnsi256:{value:(F,E,w)=>F===E&&E===w?F<8?16:F>248?231:Math.round((F-8)/247*24)+232:16+36*Math.round(F/255*5)+6*Math.round(E/255*5)+Math.round(w/255*5),enumerable:!1},hexToRgb:{value:(F)=>{const E=/[a-f\d]{6}|[a-f\d]{3}/i.exec(F.toString(16));if(!E)return[0,0,0];let[w]=E;w.length===3&&(w=[...w].map((C)=>C+C).join(""));const $=Number.parseInt(w,16);return[$>>16&255,$>>8&255,$&255]},enumerable:!1},hexToAnsi256:{value:(F)=>SD.rgbToAnsi256(...SD.hexToRgb(F)),enumerable:!1},ansi256ToAnsi:{value:(F)=>{if(F<8)return 30+F;if(F<16)return 90+(F-8);let E,w,$;if(F>=232)E=((F-232)*10+8)/255,w=E,$=E;else{F-=16;const B=F%36;E=Math.floor(F/36)/5,w=Math.floor(B/6)/5,$=B%6/5}const C=Math.max(E,w,$)*2;if(C===0)return 30;let f=30+(Math.round($)<<2|Math.round(w)<<1|Math.round(E));return C===2&&(f+=60),f},enumerable:!1},rgbToAnsi:{value:(F,E,w)=>SD.ansi256ToAnsi(SD.rgbToAnsi256(F,E,w)),enumerable:!1},hexToAnsi:{value:(F)=>SD.ansi256ToAnsi(SD.hexToAnsi256(F)),enumerable:!1}}),SD}function SP(D,F,E){return String(D).normalize().replace(/\r\n/g,`
|
|
34
|
+
`).split(`
|
|
35
|
+
`).map((w)=>v6D(w,F,E)).join(`
|
|
36
|
+
`)}function m6D(D,F){if(D===F)return;const E=D.split(`
|
|
37
|
+
`),w=F.split(`
|
|
38
|
+
`),$=[];for(let C=0;C<Math.max(E.length,w.length);C++)E[C]!==w[C]&&$.push(C);return $}function A7(D,F){D.isTTY&&D.setRawMode(F)}async function fFD(D,F={}){if(!F.type||F.type==="text")return await FFD({message:D,defaultValue:F.default,placeholder:F.placeholder,initialValue:F.initial});if(F.type==="confirm")return await EFD({message:D,initialValue:F.initial});if(F.type==="select")return await wFD({message:D,options:F.options.map((E)=>typeof E==="string"?{value:E,label:E}:E)});if(F.type==="multiselect")return await $FD({message:D,options:F.options.map((E)=>typeof E==="string"?{value:E,label:E}:E),required:F.required});throw new Error(`Unknown prompt type: ${F.type}`)}class AE{constructor({render:D,input:F=S6D,output:E=Q6D,...w},$=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=w,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=D.bind(this),this._track=$,this.input=F,this.output=E}prompt(){const D=new H6D(0);return D._write=(F,E,w)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),w()},this.input.pipe(D),this.rl=WP.createInterface({input:this.input,output:D,tabSize:2,prompt:"",escapeCodeTimeout:50}),WP.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),A7(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((F,E)=>{this.once("submit",()=>{this.output.write(H2.cursor.show),this.output.off("resize",this.render),A7(this.input,!1),F(this.value)}),this.once("cancel",()=>{this.output.write(H2.cursor.show),this.output.off("resize",this.render),A7(this.input,!1),F(n6D)})})}on(D,F){const E=this.subscribers.get(D)??[];E.push({cb:F}),this.subscribers.set(D,E)}once(D,F){const E=this.subscribers.get(D)??[];E.push({cb:F,once:!0}),this.subscribers.set(D,E)}emit(D,...F){const E=this.subscribers.get(D)??[],w=[];for(let $ of E)$.cb(...F),$.once&&w.push(()=>E.splice(E.indexOf($),1));for(let $ of w)$()}unsubscribe(){this.subscribers.clear()}onKeypress(D,F){if(this.state==="error"&&(this.state="active"),F?.name&&!this._track&&QP.has(F.name)&&this.emit("cursor",QP.get(F.name)),F?.name&&l6D.has(F.name)&&this.emit("cursor",F.name),D&&(D.toLowerCase()==="y"||D.toLowerCase()==="n")&&this.emit("confirm",D.toLowerCase()==="y"),D&&this.emit("key",D.toLowerCase()),F?.name==="return"){if(this.opts.validate){const E=this.opts.validate(this.value);E&&(this.error=E,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}D===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
39
|
+
`),A7(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=SP(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
40
|
+
`).length-1;this.output.write(H2.cursor.move(-999,D*-1))}render(){const D=SP(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(H2.cursor.hide);else{const F=m6D(this._prevFrame,D);if(this.restoreCursor(),F&&F?.length===1){const E=F[0];this.output.write(H2.cursor.move(0,E)),this.output.write(H2.erase.lines(1));const w=D.split(`
|
|
41
|
+
`);this.output.write(w[E]),this._prevFrame=D,this.output.write(H2.cursor.move(0,w.length-E-1));return}else if(F&&F?.length>1){const E=F[0];this.output.write(H2.cursor.move(0,E)),this.output.write(H2.erase.down());const w=D.split(`
|
|
42
|
+
`).slice(E);this.output.write(w.join(`
|
|
43
|
+
`)),this._prevFrame=D;return}this.output.write(H2.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}}var UU="\x1B",VD,R6D="\x07",AU,V6D,N6D,H2,YU,q6D,O6D,KD=(D,F,E=D)=>(w)=>{let $=""+w,C=$.indexOf(F,D.length);return~C?D+LP($,F,E,C)+F:D+$+F},LP=(D,F,E,w)=>{let $=D.substring(0,w)+E,C=D.substring(w+F.length),f=C.indexOf(F);return~f?$+LP(C,F,E,f):$+C},RP=(D=O6D)=>({isColorSupported:D,reset:D?(F)=>`\x1B[0m${F}\x1B[0m`:String,bold:D?KD("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:D?KD("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:D?KD("\x1B[3m","\x1B[23m"):String,underline:D?KD("\x1B[4m","\x1B[24m"):String,inverse:D?KD("\x1B[7m","\x1B[27m"):String,hidden:D?KD("\x1B[8m","\x1B[28m"):String,strikethrough:D?KD("\x1B[9m","\x1B[29m"):String,black:D?KD("\x1B[30m","\x1B[39m"):String,red:D?KD("\x1B[31m","\x1B[39m"):String,green:D?KD("\x1B[32m","\x1B[39m"):String,yellow:D?KD("\x1B[33m","\x1B[39m"):String,blue:D?KD("\x1B[34m","\x1B[39m"):String,magenta:D?KD("\x1B[35m","\x1B[39m"):String,cyan:D?KD("\x1B[36m","\x1B[39m"):String,white:D?KD("\x1B[37m","\x1B[39m"):String,gray:D?KD("\x1B[90m","\x1B[39m"):String,bgBlack:D?KD("\x1B[40m","\x1B[49m"):String,bgRed:D?KD("\x1B[41m","\x1B[49m"):String,bgGreen:D?KD("\x1B[42m","\x1B[49m"):String,bgYellow:D?KD("\x1B[43m","\x1B[49m"):String,bgBlue:D?KD("\x1B[44m","\x1B[49m"):String,bgMagenta:D?KD("\x1B[45m","\x1B[49m"):String,bgCyan:D?KD("\x1B[46m","\x1B[49m"):String,bgWhite:D?KD("\x1B[47m","\x1B[49m"):String}),j6D,CU,IU,y6D,k6D,b6D=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},BU=10,XP=(D=0)=>(F)=>`\x1B[${F+D}m`,JP=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,zP=(D=0)=>(F,E,w)=>`\x1B[${38+D};2;${F};${E};${w}m`,SD,x6D,c6D,r6D,I7,_6D=39,ZU="\x07",NP="[",s6D="]",qP="m",WU,TP=(D)=>`${I7.values().next().value}${NP}${D}${qP}`,KP=(D)=>`${I7.values().next().value}${WU}${D}${ZU}`,u6D=(D)=>D.split(" ").map((F)=>UE(F)),hU=(D,F,E)=>{const w=[...F];let $=!1,C=!1,f=UE(VP(D[D.length-1]));for(let[B,h]of w.entries()){const U=UE(h);if(f+U<=E?D[D.length-1]+=h:(D.push(h),f=0),I7.has(h)&&($=!0,C=w.slice(B+1).join("").startsWith(WU)),$){C?h===ZU&&($=!1,C=!1):h===qP&&($=!1);continue}f+=U,f===E&&B<w.length-1&&(D.push(""),f=0)}!f&&D[D.length-1].length>0&&D.length>1&&(D[D.length-2]+=D.pop())},d6D=(D)=>{const F=D.split(" ");let E=F.length;for(;E>0&&!(UE(F[E-1])>0);)E--;return E===F.length?D:F.slice(0,E).join(" ")+F.slice(E).join("")},v6D=(D,F,E={})=>{if(E.trim!==!1&&D.trim()==="")return"";let w="",$,C;const f=u6D(D);let B=[""];for(let[U,I]of D.split(" ").entries()){E.trim!==!1&&(B[B.length-1]=B[B.length-1].trimStart());let A=UE(B[B.length-1]);if(U!==0&&(A>=F&&(E.wordWrap===!1||E.trim===!1)&&(B.push(""),A=0),(A>0||E.trim===!1)&&(B[B.length-1]+=" ",A++)),E.hard&&f[U]>F){const Y=F-A,M=1+Math.floor((f[U]-Y-1)/F);Math.floor((f[U]-1)/F)<M&&B.push(""),hU(B,I,F);continue}if(A+f[U]>F&&A>0&&f[U]>0){if(E.wordWrap===!1&&A<F){hU(B,I,F);continue}B.push("")}if(A+f[U]>F&&E.wordWrap===!1){hU(B,I,F);continue}B[B.length-1]+=I}E.trim!==!1&&(B=B.map((U)=>d6D(U)));const h=[...B.join(`
|
|
44
|
+
`)];for(let[U,I]of h.entries()){if(w+=I,I7.has(I)){const{groups:Y}=new RegExp(`(?:\\${NP}(?<code>\\d+)m|\\${WU}(?<uri>.*)${ZU})`).exec(h.slice(U).join(""))||{groups:{}};if(Y.code!==void 0){const M=Number.parseFloat(Y.code);$=M===_6D?void 0:M}else Y.uri!==void 0&&(C=Y.uri.length===0?void 0:Y.uri)}const A=r6D.codes.get(Number($));h[U+1]===`
|
|
45
|
+
`?(C&&(w+=KP("")),$&&A&&(w+=TP(A))):I===`
|
|
46
|
+
`&&($&&A&&(w+=TP($)),C&&(w+=KP(C)))}return w},n6D,QP,l6D,OP,jP,PP,yP,i6D,u1=(D,F)=>i6D?D:F,p6D,a6D,o6D,t6D,XD="",VF="",MU,GU,e6D,HP,DFD,M7=(D)=>{switch(D){case"initial":case"active":return Q.cyan(p6D);case"cancel":return Q.red(a6D);case"error":return Q.yellow(o6D);case"submit":return Q.green(t6D)}},FFD=(D)=>{return new yP({validate:D.validate,placeholder:D.placeholder,defaultValue:D.defaultValue,initialValue:D.initialValue,render(){const F=`${Q.gray(XD)}
|
|
47
|
+
${M7(this.state)} ${D.message}
|
|
48
|
+
`,E=D.placeholder?Q.inverse(D.placeholder[0])+Q.dim(D.placeholder.slice(1)):Q.inverse(Q.hidden("_")),w=this.value?this.valueWithCursor:E;switch(this.state){case"error":return`${F.trim()}
|
|
49
|
+
${Q.yellow(XD)} ${w}
|
|
50
|
+
${Q.yellow(VF)} ${Q.yellow(this.error)}
|
|
51
|
+
`;case"submit":return`${F}${Q.gray(XD)} ${Q.dim(this.value||D.placeholder)}`;case"cancel":return`${F}${Q.gray(XD)} ${Q.strikethrough(Q.dim(this.value??""))}${this.value?.trim()?"\n"+Q.gray(XD):""}`;default:return`${F}${Q.cyan(XD)} ${w}
|
|
52
|
+
${Q.cyan(VF)}
|
|
53
|
+
`}}}).prompt()},EFD=(D)=>{const F=D.active??"Yes",E=D.inactive??"No";return new OP({active:F,inactive:E,initialValue:D.initialValue??!0,render(){const w=`${Q.gray(XD)}
|
|
54
|
+
${M7(this.state)} ${D.message}
|
|
55
|
+
`,$=this.value?F:E;switch(this.state){case"submit":return`${w}${Q.gray(XD)} ${Q.dim($)}`;case"cancel":return`${w}${Q.gray(XD)} ${Q.strikethrough(Q.dim($))}
|
|
56
|
+
${Q.gray(XD)}`;default:return`${w}${Q.cyan(XD)} ${this.value?`${Q.green(MU)} ${F}`:`${Q.dim(GU)} ${Q.dim(F)}`} ${Q.dim("/")} ${this.value?`${Q.dim(GU)} ${Q.dim(E)}`:`${Q.green(MU)} ${E}`}
|
|
57
|
+
${Q.cyan(VF)}
|
|
58
|
+
`}}}).prompt()},wFD=(D)=>{const F=(E,w)=>{const $=E.label??String(E.value);switch(w){case"active":return`${Q.green(MU)} ${$} ${E.hint?Q.dim(`(${E.hint})`):""}`;case"selected":return`${Q.dim($)}`;case"cancelled":return`${Q.strikethrough(Q.dim($))}`}return`${Q.dim(GU)} ${Q.dim($)}`};return new PP({options:D.options,initialValue:D.initialValue,render(){const E=`${Q.gray(XD)}
|
|
59
|
+
${M7(this.state)} ${D.message}
|
|
60
|
+
`;switch(this.state){case"submit":return`${E}${Q.gray(XD)} ${F(this.options[this.cursor],"selected")}`;case"cancel":return`${E}${Q.gray(XD)} ${F(this.options[this.cursor],"cancelled")}
|
|
61
|
+
${Q.gray(XD)}`;default:return`${E}${Q.cyan(XD)} ${this.options.map((w,$)=>F(w,$===this.cursor?"active":"inactive")).join(`
|
|
62
|
+
${Q.cyan(XD)} `)}
|
|
63
|
+
${Q.cyan(VF)}
|
|
64
|
+
`}}}).prompt()},$FD=(D)=>{const F=(E,w)=>{const $=E.label??String(E.value);switch(w){case"active":return`${Q.cyan(e6D)} ${$} ${E.hint?Q.dim(`(${E.hint})`):""}`;case"selected":return`${Q.green(HP)} ${Q.dim($)}`;case"cancelled":return`${Q.strikethrough(Q.dim($))}`;case"active-selected":return`${Q.green(HP)} ${$} ${E.hint?Q.dim(`(${E.hint})`):""}`;case"submitted":return`${Q.dim($)}`}return`${Q.dim(DFD)} ${Q.dim($)}`};return new jP({options:D.options,initialValues:D.initialValues,required:D.required??!0,cursorAt:D.cursorAt,validate(E){if(this.required&&E.length===0)return`Please select at least one option.
|
|
65
|
+
${Q.reset(Q.dim(`Press ${Q.gray(Q.bgWhite(Q.inverse(" space ")))} to select, ${Q.gray(Q.bgWhite(Q.inverse(" enter ")))} to submit`))}`},render(){const E=`${Q.gray(XD)}
|
|
66
|
+
${M7(this.state)} ${D.message}
|
|
67
|
+
`;switch(this.state){case"submit":return`${E}${Q.gray(XD)} ${this.options.filter(({value:w})=>this.value.includes(w)).map((w)=>F(w,"submitted")).join(Q.dim(", "))||Q.dim("none")}`;case"cancel":{const w=this.options.filter(({value:$})=>this.value.includes($)).map(($)=>F($,"cancelled")).join(Q.dim(", "));return`${E}${Q.gray(XD)} ${w.trim()?`${w}
|
|
68
|
+
${Q.gray(XD)}`:""}`}case"error":{const w=this.error.split("\n").map(($,C)=>C===0?`${Q.yellow(VF)} ${Q.yellow($)}`:` ${$}`).join("\n");return E+Q.yellow(XD)+" "+this.options.map(($,C)=>{const f=this.value.includes($.value),B=C===this.cursor;if(B&&f)return F($,"active-selected");if(f)return F($,"selected");return F($,B?"active":"inactive")}).join(`
|
|
69
|
+
${Q.yellow(XD)} `)+"\n"+w+"\n"}default:return`${E}${Q.cyan(XD)} ${this.options.map((w,$)=>{const C=this.value.includes(w.value),f=$===this.cursor;if(f&&C)return F(w,"active-selected");if(C)return F(w,"selected");return F(w,f?"active":"inactive")}).join(`
|
|
70
|
+
${Q.cyan(XD)} `)}
|
|
71
|
+
${Q.cyan(VF)}
|
|
72
|
+
`}}}).prompt()};var bP=G(()=>{zU();hE();C7();h7();VD=`${UU}[`,AU={to(D,F){if(!F)return`${VD}${D+1}G`;return`${VD}${F+1};${D+1}H`},move(D,F){let E="";if(D<0)E+=`${VD}${-D}D`;else if(D>0)E+=`${VD}${D}C`;if(F<0)E+=`${VD}${-F}A`;else if(F>0)E+=`${VD}${F}B`;return E},up:(D=1)=>`${VD}${D}A`,down:(D=1)=>`${VD}${D}B`,forward:(D=1)=>`${VD}${D}C`,backward:(D=1)=>`${VD}${D}D`,nextLine:(D=1)=>`${VD}E`.repeat(D),prevLine:(D=1)=>`${VD}F`.repeat(D),left:`${VD}G`,hide:`${VD}?25l`,show:`${VD}?25h`,save:`${UU}7`,restore:`${UU}8`},V6D={up:(D=1)=>`${VD}S`.repeat(D),down:(D=1)=>`${VD}T`.repeat(D)},N6D={screen:`${VD}2J`,up:(D=1)=>`${VD}1J`.repeat(D),down:(D=1)=>`${VD}J`.repeat(D),line:`${VD}2K`,lineEnd:`${VD}K`,lineStart:`${VD}1K`,lines(D){let F="";for(let E=0;E<D;E++)F+=this.line+(E<D-1?AU.up():"");if(D)F+=AU.left;return F}},H2={cursor:AU,scroll:V6D,erase:N6D,beep:R6D},YU={exports:{}},q6D=L6D,O6D=!(("NO_COLOR"in process.env)||process.argv.includes("--no-color"))&&(("FORCE_COLOR"in process.env)||process.argv.includes("--color")||process.platform==="win32"||q6D.isatty(1)&&process.env.TERM!=="dumb"||("CI"in process.env));YU.exports=RP();YU.exports.createColors=RP;j6D=YU.exports,CU=XU(j6D),IU={},y6D={get exports(){return IU},set exports(D){IU=D}};(function(D){var F={};D.exports=F,F.eastAsianWidth=function(w){var $=w.charCodeAt(0),C=w.length==2?w.charCodeAt(1):0,f=$;return 55296<=$&&$<=56319&&56320<=C&&C<=57343&&($&=1023,C&=1023,f=$<<10|C,f+=65536),f==12288||65281<=f&&f<=65376||65504<=f&&f<=65510?"F":f==8361||65377<=f&&f<=65470||65474<=f&&f<=65479||65482<=f&&f<=65487||65490<=f&&f<=65495||65498<=f&&f<=65500||65512<=f&&f<=65518?"H":4352<=f&&f<=4447||4515<=f&&f<=4519||4602<=f&&f<=4607||9001<=f&&f<=9002||11904<=f&&f<=11929||11931<=f&&f<=12019||12032<=f&&f<=12245||12272<=f&&f<=12283||12289<=f&&f<=12350||12353<=f&&f<=12438||12441<=f&&f<=12543||12549<=f&&f<=12589||12593<=f&&f<=12686||12688<=f&&f<=12730||12736<=f&&f<=12771||12784<=f&&f<=12830||12832<=f&&f<=12871||12880<=f&&f<=13054||13056<=f&&f<=19903||19968<=f&&f<=42124||42128<=f&&f<=42182||43360<=f&&f<=43388||44032<=f&&f<=55203||55216<=f&&f<=55238||55243<=f&&f<=55291||63744<=f&&f<=64255||65040<=f&&f<=65049||65072<=f&&f<=65106||65108<=f&&f<=65126||65128<=f&&f<=65131||110592<=f&&f<=110593||127488<=f&&f<=127490||127504<=f&&f<=127546||127552<=f&&f<=127560||127568<=f&&f<=127569||131072<=f&&f<=194367||177984<=f&&f<=196605||196608<=f&&f<=262141?"W":32<=f&&f<=126||162<=f&&f<=163||165<=f&&f<=166||f==172||f==175||10214<=f&&f<=10221||10629<=f&&f<=10630?"Na":f==161||f==164||167<=f&&f<=168||f==170||173<=f&&f<=174||176<=f&&f<=180||182<=f&&f<=186||188<=f&&f<=191||f==198||f==208||215<=f&&f<=216||222<=f&&f<=225||f==230||232<=f&&f<=234||236<=f&&f<=237||f==240||242<=f&&f<=243||247<=f&&f<=250||f==252||f==254||f==257||f==273||f==275||f==283||294<=f&&f<=295||f==299||305<=f&&f<=307||f==312||319<=f&&f<=322||f==324||328<=f&&f<=331||f==333||338<=f&&f<=339||358<=f&&f<=359||f==363||f==462||f==464||f==466||f==468||f==470||f==472||f==474||f==476||f==593||f==609||f==708||f==711||713<=f&&f<=715||f==717||f==720||728<=f&&f<=731||f==733||f==735||768<=f&&f<=879||913<=f&&f<=929||931<=f&&f<=937||945<=f&&f<=961||963<=f&&f<=969||f==1025||1040<=f&&f<=1103||f==1105||f==8208||8211<=f&&f<=8214||8216<=f&&f<=8217||8220<=f&&f<=8221||8224<=f&&f<=8226||8228<=f&&f<=8231||f==8240||8242<=f&&f<=8243||f==8245||f==8251||f==8254||f==8308||f==8319||8321<=f&&f<=8324||f==8364||f==8451||f==8453||f==8457||f==8467||f==8470||8481<=f&&f<=8482||f==8486||f==8491||8531<=f&&f<=8532||8539<=f&&f<=8542||8544<=f&&f<=8555||8560<=f&&f<=8569||f==8585||8592<=f&&f<=8601||8632<=f&&f<=8633||f==8658||f==8660||f==8679||f==8704||8706<=f&&f<=8707||8711<=f&&f<=8712||f==8715||f==8719||f==8721||f==8725||f==8730||8733<=f&&f<=8736||f==8739||f==8741||8743<=f&&f<=8748||f==8750||8756<=f&&f<=8759||8764<=f&&f<=8765||f==8776||f==8780||f==8786||8800<=f&&f<=8801||8804<=f&&f<=8807||8810<=f&&f<=8811||8814<=f&&f<=8815||8834<=f&&f<=8835||8838<=f&&f<=8839||f==8853||f==8857||f==8869||f==8895||f==8978||9312<=f&&f<=9449||9451<=f&&f<=9547||9552<=f&&f<=9587||9600<=f&&f<=9615||9618<=f&&f<=9621||9632<=f&&f<=9633||9635<=f&&f<=9641||9650<=f&&f<=9651||9654<=f&&f<=9655||9660<=f&&f<=9661||9664<=f&&f<=9665||9670<=f&&f<=9672||f==9675||9678<=f&&f<=9681||9698<=f&&f<=9701||f==9711||9733<=f&&f<=9734||f==9737||9742<=f&&f<=9743||9748<=f&&f<=9749||f==9756||f==9758||f==9792||f==9794||9824<=f&&f<=9825||9827<=f&&f<=9829||9831<=f&&f<=9834||9836<=f&&f<=9837||f==9839||9886<=f&&f<=9887||9918<=f&&f<=9919||9924<=f&&f<=9933||9935<=f&&f<=9953||f==9955||9960<=f&&f<=9983||f==10045||f==10071||10102<=f&&f<=10111||11093<=f&&f<=11097||12872<=f&&f<=12879||57344<=f&&f<=63743||65024<=f&&f<=65039||f==65533||127232<=f&&f<=127242||127248<=f&&f<=127277||127280<=f&&f<=127337||127344<=f&&f<=127386||917760<=f&&f<=917999||983040<=f&&f<=1048573||1048576<=f&&f<=1114109?"A":"N"},F.characterLength=function(w){var $=this.eastAsianWidth(w);return $=="F"||$=="W"||$=="A"?2:1};function E(w){return w.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}F.length=function(w){for(var $=E(w),C=0,f=0;f<$.length;f++)C=C+this.characterLength($[f]);return C},F.slice=function(w,$,C){textLen=F.length(w),$=$||0,C=C||1,$<0&&($=textLen+$),C<0&&(C=textLen+C);for(var f="",B=0,h=E(w),U=0;U<h.length;U++){var I=h[U],A=F.length(I);if(B>=$-(A==2?1:0))if(B+A<=C)f+=I;else break;B+=A}return f}})(y6D);k6D=IU,SD={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(SD.modifier);x6D=Object.keys(SD.color),c6D=Object.keys(SD.bgColor);[...x6D];r6D=g6D(),I7=new Set(["\x1B","\x9B"]),WU=`${s6D}8;;`,n6D=Symbol("clack:cancel"),QP=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),l6D=new Set(["up","down","left","right","space","enter"]);OP=class OP extends AE{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(F)=>{this.output.write(H2.cursor.move(0,-1)),this.value=F,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};jP=class jP extends AE{constructor(D){super(D,!1),this.cursor=0,this.options=D.options,this.value=[...D.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:F})=>F===D.cursorAt),0),this.on("key",(F)=>{F==="a"&&this.toggleAll()}),this.on("cursor",(F)=>{switch(F){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){const D=this.value.length===this.options.length;this.value=D?[]:this.options.map((F)=>F.value)}toggleValue(){const D=this.value.includes(this._value);this.value=D?this.value.filter((F)=>F!==this._value):[...this.value,this._value]}};PP=class PP extends AE{constructor(D){super(D,!1),this.cursor=0,this.options=D.options,this.cursor=this.options.findIndex(({value:F})=>F===D.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(F)=>{switch(F){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};yP=class yP extends AE{constructor(D){super(D),this.valueWithCursor="",this.on("finalize",()=>{this.value||(this.value=D.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${CU.inverse(CU.hidden("_"))}`;else{const F=this.value.slice(0,this.cursor),E=this.value.slice(this.cursor);this.valueWithCursor=`${F}${CU.inverse(E[0])}${E.slice(1)}`}})}get cursor(){return this._cursor}};i6D=JU(),p6D=u1("\u276F",">"),a6D=u1("\u25A0","x"),o6D=u1("\u25B2","x"),t6D=u1("\u2714","\u221A"),MU=u1("\u25CF",">"),GU=u1("\u25CB"," "),e6D=u1("\u25FB","[\u2022]"),HP=u1("\u25FC","[+]"),DFD=u1("\u25FB","[ ]")});import L2 from"process";function BFD(D){for(let F of CFD){const E=F[1]||F[0];if(D[E])return{name:F[0].toLowerCase(),...F[2]}}if(D.SHELL&&D.SHELL==="/bin/jsh")return{name:"stackblitz",ci:!1};return{name:"",ci:!1}}function ME(D){return D?D!=="false":!1}function IFD({onlyFirst:D=!1}={}){const F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(F,D?void 0:"g")}function GFD(D){if(typeof D!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(MFD,"")}function XU(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function XFD(D,F){if(typeof D!=="string"||D.length===0)return 0;if(F={ambiguousIsNarrow:!0,countAnsiEscapeCodes:!1,...F},!F.countAnsiEscapeCodes)D=GFD(D);if(D.length===0)return 0;const E=F.ambiguousIsNarrow?1:2;let w=0;for(let{segment:$}of new Intl.Segmenter().segment(D)){const C=$.codePointAt(0);if(C<=31||C>=127&&C<=159)continue;if(C>=768&&C<=879)continue;if(WFD().test($)){w+=2;continue}switch(ZFD.eastAsianWidth($)){case"F":case"W":{w+=2;break}case"A":{w+=E;break}default:w+=1}}return w}function JU(){if(L2.platform!=="win32")return L2.env.TERM!=="linux";return Boolean(L2.env.CI)||Boolean(L2.env.WT_SESSION)||Boolean(L2.env.TERMINUS_SUBLIME)||L2.env.ConEmuTask==="{cmd::Cmder}"||L2.env.TERM_PROGRAM==="Terminus-Sublime"||L2.env.TERM_PROGRAM==="vscode"||L2.env.TERM==="xterm-256color"||L2.env.TERM==="alacritty"||L2.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function cP(D){if(!Intl.Segmenter)return Z0(D).length;return XFD(D)}function G7(D){return D.replace(/`([^`]+)`/gm,(F,E)=>Q.cyan(E)).replace(/\s+_([^_]+)_\s+/gm,(F,E)=>` ${Q.underline(E)} `)}function KFD(D="white"){return Q[D]||Q.white}function SFD(D="bgWhite"){return Q[`bg${D[0].toUpperCase()}${D.slice(1)}`]||Q.bgWhite}function Z7(D={}){let F=QFD();if(process.env.CONSOLA_LEVEL)F=Number.parseInt(process.env.CONSOLA_LEVEL)??F;return UP({level:F,defaults:{level:F},stdout:process.stdout,stderr:process.stderr,prompt:(...w)=>Promise.resolve().then(() => (bP(),kP)).then(($)=>$.prompt(...w)),reporters:D.reporters||[D.fancy??!(rP||TU)?new sP:new B7],...D})}function QFD(){if(AFD)return lD.debug;if(TU)return lD.warn;return lD.info}var CFD,Y7,IE,gP,hFD,rP,UFD,AFD,TU,MFD,_P,YFD,ZFD,WFD=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},JFD,zFD,TFD,Y1=(D,F)=>TFD?D:F,xP,sP,KU;var zU=G(()=>{C7();h7();hE();CFD=[["APPVEYOR"],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"]],Y7=typeof process!=="undefined"?process:{},IE=Y7.env||{},gP=BFD(IE),hFD=typeof process!=="undefined"&&process.env&&"development"||"";Y7.platform;gP.name;rP=ME(IE.CI)||gP.ci!==!1,UFD=ME(Y7.stdout&&Y7.stdout.isTTY),AFD=ME(IE.DEBUG),TU=hFD==="test"||ME(IE.TEST);ME(IE.MINIMAL);MFD=IFD(),_P={exports:{}};(function(D){var F={};D.exports=F,F.eastAsianWidth=function(w){var $=w.charCodeAt(0),C=w.length==2?w.charCodeAt(1):0,f=$;if(55296<=$&&$<=56319&&(56320<=C&&C<=57343))$&=1023,C&=1023,f=$<<10|C,f+=65536;if(f==12288||65281<=f&&f<=65376||65504<=f&&f<=65510)return"F";if(f==8361||65377<=f&&f<=65470||65474<=f&&f<=65479||65482<=f&&f<=65487||65490<=f&&f<=65495||65498<=f&&f<=65500||65512<=f&&f<=65518)return"H";if(4352<=f&&f<=4447||4515<=f&&f<=4519||4602<=f&&f<=4607||9001<=f&&f<=9002||11904<=f&&f<=11929||11931<=f&&f<=12019||12032<=f&&f<=12245||12272<=f&&f<=12283||12289<=f&&f<=12350||12353<=f&&f<=12438||12441<=f&&f<=12543||12549<=f&&f<=12589||12593<=f&&f<=12686||12688<=f&&f<=12730||12736<=f&&f<=12771||12784<=f&&f<=12830||12832<=f&&f<=12871||12880<=f&&f<=13054||13056<=f&&f<=19903||19968<=f&&f<=42124||42128<=f&&f<=42182||43360<=f&&f<=43388||44032<=f&&f<=55203||55216<=f&&f<=55238||55243<=f&&f<=55291||63744<=f&&f<=64255||65040<=f&&f<=65049||65072<=f&&f<=65106||65108<=f&&f<=65126||65128<=f&&f<=65131||110592<=f&&f<=110593||127488<=f&&f<=127490||127504<=f&&f<=127546||127552<=f&&f<=127560||127568<=f&&f<=127569||131072<=f&&f<=194367||177984<=f&&f<=196605||196608<=f&&f<=262141)return"W";if(32<=f&&f<=126||162<=f&&f<=163||165<=f&&f<=166||f==172||f==175||10214<=f&&f<=10221||10629<=f&&f<=10630)return"Na";if(f==161||f==164||167<=f&&f<=168||f==170||173<=f&&f<=174||176<=f&&f<=180||182<=f&&f<=186||188<=f&&f<=191||f==198||f==208||215<=f&&f<=216||222<=f&&f<=225||f==230||232<=f&&f<=234||236<=f&&f<=237||f==240||242<=f&&f<=243||247<=f&&f<=250||f==252||f==254||f==257||f==273||f==275||f==283||294<=f&&f<=295||f==299||305<=f&&f<=307||f==312||319<=f&&f<=322||f==324||328<=f&&f<=331||f==333||338<=f&&f<=339||358<=f&&f<=359||f==363||f==462||f==464||f==466||f==468||f==470||f==472||f==474||f==476||f==593||f==609||f==708||f==711||713<=f&&f<=715||f==717||f==720||728<=f&&f<=731||f==733||f==735||768<=f&&f<=879||913<=f&&f<=929||931<=f&&f<=937||945<=f&&f<=961||963<=f&&f<=969||f==1025||1040<=f&&f<=1103||f==1105||f==8208||8211<=f&&f<=8214||8216<=f&&f<=8217||8220<=f&&f<=8221||8224<=f&&f<=8226||8228<=f&&f<=8231||f==8240||8242<=f&&f<=8243||f==8245||f==8251||f==8254||f==8308||f==8319||8321<=f&&f<=8324||f==8364||f==8451||f==8453||f==8457||f==8467||f==8470||8481<=f&&f<=8482||f==8486||f==8491||8531<=f&&f<=8532||8539<=f&&f<=8542||8544<=f&&f<=8555||8560<=f&&f<=8569||f==8585||8592<=f&&f<=8601||8632<=f&&f<=8633||f==8658||f==8660||f==8679||f==8704||8706<=f&&f<=8707||8711<=f&&f<=8712||f==8715||f==8719||f==8721||f==8725||f==8730||8733<=f&&f<=8736||f==8739||f==8741||8743<=f&&f<=8748||f==8750||8756<=f&&f<=8759||8764<=f&&f<=8765||f==8776||f==8780||f==8786||8800<=f&&f<=8801||8804<=f&&f<=8807||8810<=f&&f<=8811||8814<=f&&f<=8815||8834<=f&&f<=8835||8838<=f&&f<=8839||f==8853||f==8857||f==8869||f==8895||f==8978||9312<=f&&f<=9449||9451<=f&&f<=9547||9552<=f&&f<=9587||9600<=f&&f<=9615||9618<=f&&f<=9621||9632<=f&&f<=9633||9635<=f&&f<=9641||9650<=f&&f<=9651||9654<=f&&f<=9655||9660<=f&&f<=9661||9664<=f&&f<=9665||9670<=f&&f<=9672||f==9675||9678<=f&&f<=9681||9698<=f&&f<=9701||f==9711||9733<=f&&f<=9734||f==9737||9742<=f&&f<=9743||9748<=f&&f<=9749||f==9756||f==9758||f==9792||f==9794||9824<=f&&f<=9825||9827<=f&&f<=9829||9831<=f&&f<=9834||9836<=f&&f<=9837||f==9839||9886<=f&&f<=9887||9918<=f&&f<=9919||9924<=f&&f<=9933||9935<=f&&f<=9953||f==9955||9960<=f&&f<=9983||f==10045||f==10071||10102<=f&&f<=10111||11093<=f&&f<=11097||12872<=f&&f<=12879||57344<=f&&f<=63743||65024<=f&&f<=65039||f==65533||127232<=f&&f<=127242||127248<=f&&f<=127277||127280<=f&&f<=127337||127344<=f&&f<=127386||917760<=f&&f<=917999||983040<=f&&f<=1048573||1048576<=f&&f<=1114109)return"A";return"N"},F.characterLength=function(w){var $=this.eastAsianWidth(w);if($=="F"||$=="W"||$=="A")return 2;else return 1};function E(w){return w.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}F.length=function(w){var $=E(w),C=0;for(var f=0;f<$.length;f++)C=C+this.characterLength($[f]);return C},F.slice=function(w,$,C){if(textLen=F.length(w),$=$?$:0,C=C?C:1,$<0)$=textLen+$;if(C<0)C=textLen+C;var f="",B=0,h=E(w);for(var U=0;U<h.length;U++){var I=h[U],A=F.length(I);if(B>=$-(A==2?1:0))if(B+A<=C)f+=I;else break;B+=A}return f}})(_P);YFD=_P.exports,ZFD=XU(YFD),JFD={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},zFD={0:"red",1:"yellow"},TFD=JU(),xP={error:Y1("\u2716","\xD7"),fatal:Y1("\u2716","\xD7"),ready:Y1("\u2714","\u221A"),warn:Y1("\u26A0","\u203C"),info:Y1("\u2139","i"),success:Y1("\u2714","\u221A"),debug:Y1("\u2699","D"),trace:Y1("\u2192","\u2192"),fail:Y1("\u2716","\xD7"),start:Y1("\u25D0","o"),log:""};sP=class sP extends B7{formatStack(D){return"\n"+$U(D).map((F)=>" "+F.replace(/^at +/,(E)=>Q.gray(E)).replace(/\((.+)\)/,(E,w)=>`(${Q.cyan(w)})`)).join("\n")}formatType(D,F,E){const w=JFD[D.type]||zFD[D.level]||"gray";if(F)return SFD(w)(Q.black(` ${D.type.toUpperCase()} `));const $=typeof xP[D.type]==="string"?xP[D.type]:D.icon||D.type;return $?KFD(w)($):""}formatLogObj(D,F){const[E,...w]=this.formatArgs(D.args,F).split("\n");if(D.type==="box")return fU(G7(E+(w.length>0?"\n"+w.join("\n"):"")),{title:D.title?G7(D.title):void 0,style:D.style});const $=this.formatDate(D.date,F),C=$&&Q.gray($),f=D.badge??D.level<2,B=this.formatType(D,f,F),h=D.tag?Q.gray(D.tag):"";let U;const I=this.filterAndJoin([B,G7(E)]),A=this.filterAndJoin(F.columns?[h,C]:[h]),Y=(F.columns||0)-cP(I)-cP(A)-2;if(U=Y>0&&(F.columns||0)>=80?I+" ".repeat(Y)+A:(A?`${Q.gray(`[${A}]`)} `:"")+I,U+=G7(w.length>0?"\n"+w.join("\n"):""),D.type==="trace"){const M=new Error("Trace: "+D.message);U+=this.formatStack(M.stack||"")}return f?"\n"+U+"\n":U}};KU=Z7()});var qD=W((LcD,Ly)=>{function Hy(D,F){let E=0,w,$="",C="";for(;E<D.length;E++)if(w=D[E],$+=w.open,C+=w.close,F.includes(w.close))F=F.replace(w.rgx,w.close+w.open);return $+F+C}function i3D(D,F){let E={has:D,keys:F};return E.reset=CD.reset.bind(E),E.bold=CD.bold.bind(E),E.dim=CD.dim.bind(E),E.italic=CD.italic.bind(E),E.underline=CD.underline.bind(E),E.inverse=CD.inverse.bind(E),E.hidden=CD.hidden.bind(E),E.strikethrough=CD.strikethrough.bind(E),E.black=CD.black.bind(E),E.red=CD.red.bind(E),E.green=CD.green.bind(E),E.yellow=CD.yellow.bind(E),E.blue=CD.blue.bind(E),E.magenta=CD.magenta.bind(E),E.cyan=CD.cyan.bind(E),E.white=CD.white.bind(E),E.gray=CD.gray.bind(E),E.grey=CD.grey.bind(E),E.bgBlack=CD.bgBlack.bind(E),E.bgRed=CD.bgRed.bind(E),E.bgGreen=CD.bgGreen.bind(E),E.bgYellow=CD.bgYellow.bind(E),E.bgBlue=CD.bgBlue.bind(E),E.bgMagenta=CD.bgMagenta.bind(E),E.bgCyan=CD.bgCyan.bind(E),E.bgWhite=CD.bgWhite.bind(E),E}function GD(D,F){let E={open:`\x1B[${D}m`,close:`\x1B[${F}m`,rgx:new RegExp(`\\x1b\\[${F}m`,"g")};return function(w){if(this!==void 0&&this.has!==void 0)return this.has.includes(D)||(this.has.push(D),this.keys.push(E)),w===void 0?this:CD.enabled?Hy(this.keys,w+""):w+"";return w===void 0?i3D([D],[E]):CD.enabled?Hy([E],w+""):w+""}}var{FORCE_COLOR:m3D,NODE_DISABLE_COLORS:n3D,TERM:l3D}=process.env,CD={enabled:!n3D&&l3D!=="dumb"&&m3D!=="0",reset:GD(0,0),bold:GD(1,22),dim:GD(2,22),italic:GD(3,23),underline:GD(4,24),inverse:GD(7,27),hidden:GD(8,28),strikethrough:GD(9,29),black:GD(30,39),red:GD(31,39),green:GD(32,39),yellow:GD(33,39),blue:GD(34,39),magenta:GD(35,39),cyan:GD(36,39),white:GD(37,39),gray:GD(90,39),grey:GD(90,39),bgBlack:GD(40,49),bgRed:GD(41,49),bgGreen:GD(42,49),bgYellow:GD(43,49),bgBlue:GD(44,49),bgMagenta:GD(45,49),bgCyan:GD(46,49),bgWhite:GD(47,49)};Ly.exports=CD});var Vy=W((RcD,Ry)=>{Ry.exports=(D,F)=>{if(D.meta&&D.name!=="escape")return;if(D.ctrl){if(D.name==="a")return"first";if(D.name==="c")return"abort";if(D.name==="d")return"abort";if(D.name==="e")return"last";if(D.name==="g")return"reset"}if(F){if(D.name==="j")return"down";if(D.name==="k")return"up"}if(D.name==="return")return"submit";if(D.name==="enter")return"submit";if(D.name==="backspace")return"delete";if(D.name==="delete")return"deleteForward";if(D.name==="abort")return"abort";if(D.name==="escape")return"exit";if(D.name==="tab")return"next";if(D.name==="pagedown")return"nextPage";if(D.name==="pageup")return"prevPage";if(D.name==="home")return"home";if(D.name==="end")return"end";if(D.name==="up")return"up";if(D.name==="down")return"down";if(D.name==="right")return"right";if(D.name==="left")return"left";return!1}});var Q7=W((VcD,Ny)=>{Ny.exports=(D)=>{const F=["[\\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("|"),E=new RegExp(F,"g");return typeof D==="string"?D.replace(E,""):D}});var jD=W((NcD,qy)=>{var OD=`${"\x1B"}[`,NU={to(D,F){if(!F)return`${OD}${D+1}G`;return`${OD}${F+1};${D+1}H`},move(D,F){let E="";if(D<0)E+=`${OD}${-D}D`;else if(D>0)E+=`${OD}${D}C`;if(F<0)E+=`${OD}${-F}A`;else if(F>0)E+=`${OD}${F}B`;return E},up:(D=1)=>`${OD}${D}A`,down:(D=1)=>`${OD}${D}B`,forward:(D=1)=>`${OD}${D}C`,backward:(D=1)=>`${OD}${D}D`,nextLine:(D=1)=>`${OD}E`.repeat(D),prevLine:(D=1)=>`${OD}F`.repeat(D),left:`${OD}G`,hide:`${OD}?25l`,show:`${OD}?25h`,save:`${"\x1B"}7`,restore:`${"\x1B"}8`},p3D={up:(D=1)=>`${OD}S`.repeat(D),down:(D=1)=>`${OD}T`.repeat(D)},a3D={screen:`${OD}2J`,up:(D=1)=>`${OD}1J`.repeat(D),down:(D=1)=>`${OD}J`.repeat(D),line:`${OD}2K`,lineEnd:`${OD}K`,lineStart:`${OD}1K`,lines(D){let F="";for(let E=0;E<D;E++)F+=this.line+(E<D-1?NU.up():"");if(D)F+=NU.left;return F}};qy.exports={cursor:NU,scroll:p3D,erase:a3D,beep:"\x07"}});var ky=W((qcD,yy)=>{function o3D(D,F){var E=typeof Symbol!=="undefined"&&D[Symbol.iterator]||D["@@iterator"];if(!E){if(Array.isArray(D)||(E=t3D(D))||F&&D&&typeof D.length==="number"){if(E)D=E;var w=0,$=function h(){};return{s:$,n:function h(){if(w>=D.length)return{done:!0};return{done:!1,value:D[w++]}},e:function h(U){throw U},f:$}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C=!0,f=!1,B;return{s:function h(){E=E.call(D)},n:function h(){var U=E.next();return C=U.done,U},e:function h(U){f=!0,B=U},f:function h(){try{if(!C&&E.return!=null)E.return()}finally{if(f)throw B}}}}function t3D(D,F){if(!D)return;if(typeof D==="string")return Oy(D,F);var E=Object.prototype.toString.call(D).slice(8,-1);if(E==="Object"&&D.constructor)E=D.constructor.name;if(E==="Map"||E==="Set")return Array.from(D);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return Oy(D,F)}function Oy(D,F){if(F==null||F>D.length)F=D.length;for(var E=0,w=new Array(F);E<F;E++)w[E]=D[E];return w}var e3D=Q7(),Py=jD(),jy=Py.erase,DED=Py.cursor,FED=(D)=>[...e3D(D)].length;yy.exports=function(D,F){if(!F)return jy.line+DED.to(0);let E=0;const w=D.split(/\r?\n/);var $=o3D(w),C;try{for($.s();!(C=$.n()).done;){let f=C.value;E+=1+Math.floor(Math.max(FED(f)-1,0)/F)}}catch(f){$.e(f)}finally{$.f()}return jy.lines(E)}});var qU=W((OcD,by)=>{var ZE={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},EED={arrowUp:ZE.arrowUp,arrowDown:ZE.arrowDown,arrowLeft:ZE.arrowLeft,arrowRight:ZE.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},wED=process.platform==="win32"?EED:ZE;by.exports=wED});var cy=W((jcD,xy)=>{var OF=qD(),Z6=qU(),OU=Object.freeze({password:{scale:1,render:(D)=>"*".repeat(D.length)},emoji:{scale:2,render:(D)=>"\uD83D\uDE03".repeat(D.length)},invisible:{scale:0,render:(D)=>""},default:{scale:1,render:(D)=>`${D}`}}),$ED=(D)=>OU[D]||OU.default,WE=Object.freeze({aborted:OF.red(Z6.cross),done:OF.green(Z6.tick),exited:OF.yellow(Z6.cross),default:OF.cyan("?")}),fED=(D,F,E)=>F?WE.aborted:E?WE.exited:D?WE.done:WE.default,CED=(D)=>OF.gray(D?Z6.ellipsis:Z6.pointerSmall),BED=(D,F)=>OF.gray(D?F?Z6.pointerSmall:"+":Z6.line);xy.exports={styles:OU,render:$ED,symbols:WE,symbol:fED,delimiter:CED,item:BED}});var ry=W((PcD,gy)=>{var hED=Q7();gy.exports=function(D,F){let E=String(hED(D)||"").split(/\r?\n/);if(!F)return E.length;return E.map((w)=>Math.ceil(w.length/F)).reduce((w,$)=>w+$)}});var sy=W((ycD,_y)=>{_y.exports=(D,F={})=>{const E=Number.isSafeInteger(parseInt(F.margin))?new Array(parseInt(F.margin)).fill(" ").join(""):F.margin||"",w=F.width;return(D||"").split(/\r?\n/g).map(($)=>$.split(/\s+/g).reduce((C,f)=>{if(f.length+E.length>=w||C[C.length-1].length+f.length+1<w)C[C.length-1]+=` ${f}`;else C.push(`${E}${f}`);return C},[E]).join("\n")).join("\n")}});var dy=W((kcD,uy)=>{uy.exports=(D,F,E)=>{E=E||F;let w=Math.min(F-E,D-Math.floor(E/2));if(w<0)w=0;let $=Math.min(w+E,F);return{startIndex:w,endIndex:$}}});var N2=W((bcD,vy)=>{vy.exports={action:Vy(),clear:ky(),style:cy(),strip:Q7(),figures:qU(),lines:ry(),wrap:sy(),entriesToDisplay:dy()}});var n1=W((xcD,iy)=>{var my=import.meta.require("readline"),UED=N2(),AED=UED.action,IED=import.meta.require("events"),ny=jD(),MED=ny.beep,GED=ny.cursor,YED=qD();class ly extends IED{constructor(D={}){super();this.firstRender=!0,this.in=D.stdin||process.stdin,this.out=D.stdout||process.stdout,this.onRender=(D.onRender||(()=>{return})).bind(this);const F=my.createInterface({input:this.in,escapeCodeTimeout:50});if(my.emitKeypressEvents(this.in,F),this.in.isTTY)this.in.setRawMode(!0);const E=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,w=($,C)=>{let f=AED(C,E);if(f===!1)this._&&this._($,C);else if(typeof this[f]==="function")this[f](C);else this.bell()};this.close=()=>{if(this.out.write(GED.show),this.in.removeListener("keypress",w),this.in.isTTY)this.in.setRawMode(!1);F.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",w)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(MED)}render(){if(this.onRender(YED),this.firstRender)this.firstRender=!1}}iy.exports=ly});var Dk=W((ccD,ey)=>{function py(D,F,E,w,$,C,f){try{var B=D[C](f),h=B.value}catch(U){E(U);return}if(B.done)F(h);else Promise.resolve(h).then(w,$)}function ay(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){py(C,w,$,f,B,"next",h)}function B(h){py(C,w,$,f,B,"throw",h)}f(void 0)})}}var H7=qD(),ZED=n1(),oy=jD(),WED=oy.erase,XE=oy.cursor,L7=N2(),jU=L7.style,PU=L7.clear,XED=L7.lines,JED=L7.figures;class ty extends ZED{constructor(D={}){super(D);this.transform=jU.render(D.style),this.scale=this.transform.scale,this.msg=D.message,this.initial=D.initial||"",this.validator=D.validate||(()=>!0),this.value="",this.errorMsg=D.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=PU("",this.out.columns),this.render()}set value(D){if(!D&&this.initial)this.placeholder=!0,this.rendered=H7.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(D);this._value=D,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!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("\n"),this.close()}validate(){var D=this;return ay(function*(){let F=yield D.validator(D.value);if(typeof F==="string")D.errorMsg=F,F=!1;D.error=!F})()}submit(){var D=this;return ay(function*(){if(D.value=D.value||D.initial,D.cursorOffset=0,D.cursor=D.rendered.length,yield D.validate(),D.error){D.red=!0,D.fire(),D.render();return}D.done=!0,D.aborted=!1,D.fire(),D.render(),D.out.write("\n"),D.close()})()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(D){if(this.placeholder)return;this.cursor=this.cursor+D,this.cursorOffset+=D}_(D,F){let E=this.value.slice(0,this.cursor),w=this.value.slice(this.cursor);this.value=`${E}${D}${w}`,this.red=!1,this.cursor=this.placeholder?0:E.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let D=this.value.slice(0,this.cursor-1),F=this.value.slice(this.cursor);if(this.value=`${D}${F}`,this.red=!1,this.isCursorAtStart())this.cursorOffset=0;else this.cursorOffset++,this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let D=this.value.slice(0,this.cursor),F=this.value.slice(this.cursor+1);if(this.value=`${D}${F}`,this.red=!1,this.isCursorAtEnd())this.cursorOffset=0;else 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(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(XE.down(XED(this.outputError,this.out.columns)-1)+PU(this.outputError,this.out.columns));this.out.write(PU(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[jU.symbol(this.done,this.aborted),H7.bold(this.msg),jU.delimiter(this.done),this.red?H7.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":JED.pointerSmall} ${H7.red().italic(F)}`,"");this.out.write(WED.line+XE.to(0)+this.outputText+XE.save+this.outputError+XE.restore+XE.move(this.cursorOffset,0))}}ey.exports=ty});var fk=W((gcD,$k)=>{var l1=qD(),zED=n1(),JE=N2(),Fk=JE.style,Ek=JE.clear,R7=JE.figures,TED=JE.wrap,KED=JE.entriesToDisplay,SED=jD(),QED=SED.cursor;class wk extends zED{constructor(D={}){super(D);this.msg=D.message,this.hint=D.hint||"- Use arrow-keys. Return to submit.",this.warn=D.warn||"- This option is disabled",this.cursor=D.initial||0,this.choices=D.choices.map((F,E)=>{if(typeof F==="string")F={title:F,value:E};return{title:F&&(F.title||F.value||F),value:F&&(F.value===void 0?E:F.value),description:F&&F.description,selected:F&&F.selected,disabled:F&&F.disabled}}),this.optionsPerPage=D.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Ek("",this.out.columns),this.render()}moveCursor(D){this.cursor=D,this.value=this.choices[D].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("\n"),this.close()}submit(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close();else this.bell()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){if(this.cursor===0)this.moveCursor(this.choices.length-1);else this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)this.moveCursor(0);else this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(D,F){if(D===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(QED.hide);else this.out.write(Ek(this.outputText,this.out.columns));super.render();let D=KED(this.cursor,this.choices.length,this.optionsPerPage),F=D.startIndex,E=D.endIndex;if(this.outputText=[Fk.symbol(this.done,this.aborted),l1.bold(this.msg),Fk.delimiter(!1),this.done?this.selection.title:this.selection.disabled?l1.yellow(this.warn):l1.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let w=F;w<E;w++){let $,C,f="",B=this.choices[w];if(w===F&&F>0)C=R7.arrowUp;else if(w===E-1&&E<this.choices.length)C=R7.arrowDown;else C=" ";if(B.disabled)$=this.cursor===w?l1.gray().underline(B.title):l1.strikethrough().gray(B.title),C=(this.cursor===w?l1.bold().gray(R7.pointer)+" ":" ")+C;else if($=this.cursor===w?l1.cyan().underline(B.title):B.title,C=(this.cursor===w?l1.cyan(R7.pointer)+" ":" ")+C,B.description&&this.cursor===w){if(f=` - ${B.description}`,C.length+$.length+f.length>=this.out.columns||B.description.split(/\r?\n/).length>1)f="\n"+TED(B.description,{margin:3,width:this.out.columns})}this.outputText+=`${C} ${$}${l1.gray(f)}\n`}}this.out.write(this.outputText)}}$k.exports=wk});var Mk=W((rcD,Ik)=>{var V7=qD(),HED=n1(),hk=N2(),Ck=hk.style,LED=hk.clear,Uk=jD(),Bk=Uk.cursor,RED=Uk.erase;class Ak extends HED{constructor(D={}){super(D);this.msg=D.message,this.value=!!D.initial,this.active=D.active||"on",this.inactive=D.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("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),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()}_(D,F){if(D===" ")this.value=!this.value;else if(D==="1")this.value=!0;else if(D==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(Bk.hide);else this.out.write(LED(this.outputText,this.out.columns));super.render(),this.outputText=[Ck.symbol(this.done,this.aborted),V7.bold(this.msg),Ck.delimiter(this.done),this.value?this.inactive:V7.cyan().underline(this.inactive),V7.gray("/"),this.value?V7.cyan().underline(this.active):this.active].join(" "),this.out.write(RED.line+Bk.to(0)+this.outputText)}}Ik.exports=Ak});var Z1=W((_cD,Gk)=>{class N7{constructor({token:D,date:F,parts:E,locales:w}){this.token=D,this.date=F||new Date,this.parts=E||[this],this.locales=w||{}}up(){}down(){}next(){const D=this.parts.indexOf(this);return this.parts.find((F,E)=>E>D&&F instanceof N7)}setTo(D){}prev(){let D=[].concat(this.parts).reverse();const F=D.indexOf(this);return D.find((E,w)=>w>F&&E instanceof N7)}toString(){return String(this.date)}}Gk.exports=N7});var Wk=W((scD,Zk)=>{var VED=Z1();class Yk extends VED{constructor(D={}){super(D)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let D=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?D.toUpperCase():D}}Zk.exports=Yk});var zk=W((ucD,Jk)=>{var NED=Z1(),qED=(D)=>{return D=D%10,D===1?"st":D===2?"nd":D===3?"rd":"th"};class Xk extends NED{constructor(D={}){super(D)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(D){this.date.setDate(parseInt(D.substr(-2)))}toString(){let D=this.date.getDate(),F=this.date.getDay();return this.token==="DD"?String(D).padStart(2,"0"):this.token==="Do"?D+qED(D):this.token==="d"?F+1:this.token==="ddd"?this.locales.weekdaysShort[F]:this.token==="dddd"?this.locales.weekdays[F]:D}}Jk.exports=Xk});var Sk=W((dcD,Kk)=>{var OED=Z1();class Tk extends OED{constructor(D={}){super(D)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(D){this.date.setHours(parseInt(D.substr(-2)))}toString(){let D=this.date.getHours();if(/h/.test(this.token))D=D%12||12;return this.token.length>1?String(D).padStart(2,"0"):D}}Kk.exports=Tk});var Lk=W((vcD,Hk)=>{var jED=Z1();class Qk extends jED{constructor(D={}){super(D)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(D){this.date.setMilliseconds(parseInt(D.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}Hk.exports=Qk});var Nk=W((mcD,Vk)=>{var PED=Z1();class Rk extends PED{constructor(D={}){super(D)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(D){this.date.setMinutes(parseInt(D.substr(-2)))}toString(){let D=this.date.getMinutes();return this.token.length>1?String(D).padStart(2,"0"):D}}Vk.exports=Rk});var jk=W((ncD,Ok)=>{var yED=Z1();class qk extends yED{constructor(D={}){super(D)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(D){D=parseInt(D.substr(-2))-1,this.date.setMonth(D<0?0:D)}toString(){let D=this.date.getMonth(),F=this.token.length;return F===2?String(D+1).padStart(2,"0"):F===3?this.locales.monthsShort[D]:F===4?this.locales.months[D]:String(D+1)}}Ok.exports=qk});var kk=W((lcD,yk)=>{var kED=Z1();class Pk extends kED{constructor(D={}){super(D)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(D){this.date.setSeconds(parseInt(D.substr(-2)))}toString(){let D=this.date.getSeconds();return this.token.length>1?String(D).padStart(2,"0"):D}}yk.exports=Pk});var ck=W((icD,xk)=>{var bED=Z1();class bk extends bED{constructor(D={}){super(D)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(D){this.date.setFullYear(D.substr(-4))}toString(){let D=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?D.substr(-2):D}}xk.exports=bk});var rk=W((pcD,gk)=>{gk.exports={DatePart:Z1(),Meridiem:Wk(),Day:zk(),Hours:Sk(),Milliseconds:Lk(),Minutes:Nk(),Month:jk(),Seconds:kk(),Year:ck()}});var ak=W((acD,pk)=>{function _k(D,F,E,w,$,C,f){try{var B=D[C](f),h=B.value}catch(U){E(U);return}if(B.done)F(h);else Promise.resolve(h).then(w,$)}function sk(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){_k(C,w,$,f,B,"next",h)}function B(h){_k(C,w,$,f,B,"throw",h)}f(void 0)})}}var yU=qD(),xED=n1(),kU=N2(),uk=kU.style,dk=kU.clear,cED=kU.figures,lk=jD(),gED=lk.erase,vk=lk.cursor,i1=rk(),mk=i1.DatePart,rED=i1.Meridiem,_ED=i1.Day,sED=i1.Hours,uED=i1.Milliseconds,dED=i1.Minutes,vED=i1.Month,mED=i1.Seconds,nED=i1.Year,lED=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,nk={1:({token:D})=>D.replace(/\\(.)/g,"$1"),2:(D)=>new _ED(D),3:(D)=>new vED(D),4:(D)=>new nED(D),5:(D)=>new rED(D),6:(D)=>new sED(D),7:(D)=>new dED(D),8:(D)=>new mED(D),9:(D)=>new uED(D)},iED={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(",")};class ik extends xED{constructor(D={}){super(D);this.msg=D.message,this.cursor=0,this.typed="",this.locales=Object.assign(iED,D.locales),this._date=D.initial||new Date,this.errorMsg=D.error||"Please Enter A Valid Value",this.validator=D.validate||(()=>!0),this.mask=D.mask||"YYYY-MM-DD HH:mm:ss",this.clear=dk("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(D){if(D)this._date.setTime(D.getTime())}set mask(D){let F;this.parts=[];while(F=lED.exec(D)){let w=F.shift(),$=F.findIndex((C)=>C!=null);this.parts.push($ in nk?nk[$]({token:F[$]||w,date:this.date,parts:this.parts,locales:this.locales}):F[$]||w)}let E=this.parts.reduce((w,$)=>{if(typeof $==="string"&&typeof w[w.length-1]==="string")w[w.length-1]+=$;else w.push($);return w},[]);this.parts.splice(0),this.parts.push(...E),this.reset()}moveCursor(D){this.typed="",this.cursor=D,this.fire()}reset(){this.moveCursor(this.parts.findIndex((D)=>D instanceof mk)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var D=this;return sk(function*(){let F=yield D.validator(D.value);if(typeof F==="string")D.errorMsg=F,F=!1;D.error=!F})()}submit(){var D=this;return sk(function*(){if(yield D.validate(),D.error){D.color="red",D.fire(),D.render();return}D.done=!0,D.aborted=!1,D.fire(),D.render(),D.out.write("\n"),D.close()})()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let D=this.parts[this.cursor].prev();if(D==null)return this.bell();this.moveCursor(this.parts.indexOf(D)),this.render()}right(){let D=this.parts[this.cursor].next();if(D==null)return this.bell();this.moveCursor(this.parts.indexOf(D)),this.render()}next(){let D=this.parts[this.cursor].next();this.moveCursor(D?this.parts.indexOf(D):this.parts.findIndex((F)=>F instanceof mk)),this.render()}_(D){if(/\d/.test(D))this.typed+=D,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(vk.hide);else this.out.write(dk(this.outputText,this.out.columns));if(super.render(),this.outputText=[uk.symbol(this.done,this.aborted),yU.bold(this.msg),uk.delimiter(!1),this.parts.reduce((D,F,E)=>D.concat(E===this.cursor&&!this.done?yU.cyan().underline(F.toString()):F),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":cED.pointerSmall} ${yU.red().italic(F)}`,"");this.out.write(gED.line+vk.to(0)+this.outputText)}}pk.exports=ik});var $b=W((ocD,wb)=>{function ok(D,F,E,w,$,C,f){try{var B=D[C](f),h=B.value}catch(U){E(U);return}if(B.done)F(h);else Promise.resolve(h).then(w,$)}function tk(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){ok(C,w,$,f,B,"next",h)}function B(h){ok(C,w,$,f,B,"throw",h)}f(void 0)})}}var q7=qD(),pED=n1(),Fb=jD(),O7=Fb.cursor,aED=Fb.erase,j7=N2(),bU=j7.style,oED=j7.figures,ek=j7.clear,tED=j7.lines,eED=/[0-9]/,xU=(D)=>D!==void 0,Db=(D,F)=>{let E=Math.pow(10,F);return Math.round(D*E)/E};class Eb extends pED{constructor(D={}){super(D);this.transform=bU.render(D.style),this.msg=D.message,this.initial=xU(D.initial)?D.initial:"",this.float=!!D.float,this.round=D.round||2,this.inc=D.increment||1,this.min=xU(D.min)?D.min:-1/0,this.max=xU(D.max)?D.max:1/0,this.errorMsg=D.error||"Please Enter A Valid Value",this.validator=D.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(D){if(!D&&D!==0)this.placeholder=!0,this.rendered=q7.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${Db(D,this.round)}`),this._value=Db(D,this.round);this.fire()}get value(){return this._value}parse(D){return this.float?parseFloat(D):parseInt(D)}valid(D){return D==="-"||D==="."&&this.float||eED.test(D)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let D=this.value;this.value=D!==""?D:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}validate(){var D=this;return tk(function*(){let F=yield D.validator(D.value);if(typeof F==="string")D.errorMsg=F,F=!1;D.error=!F})()}submit(){var D=this;return tk(function*(){if(yield D.validate(),D.error){D.color="red",D.fire(),D.render();return}let F=D.value;D.value=F!==""?F:D.initial,D.done=!0,D.aborted=!1,D.error=!1,D.fire(),D.render(),D.out.write("\n"),D.close()})()}up(){if(this.typed="",this.value==="")this.value=this.min-this.inc;if(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;if(this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let D=this.value.toString();if(D.length===0)return this.bell();if(this.value=this.parse(D=D.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()}_(D,F){if(!this.valid(D))return this.bell();const E=Date.now();if(E-this.lastHit>1000)this.typed="";if(this.typed+=D,this.lastHit=E,this.color="cyan",D===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire(),this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(O7.down(tED(this.outputError,this.out.columns)-1)+ek(this.outputError,this.out.columns));this.out.write(ek(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[bU.symbol(this.done,this.aborted),q7.bold(this.msg),bU.delimiter(this.done),!this.done||!this.done&&!this.placeholder?q7[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":oED.pointerSmall} ${q7.red().italic(F)}`,"");this.out.write(aED.line+O7.to(0)+this.outputText+O7.save+this.outputError+O7.restore)}}wb.exports=Eb});var cU=W((tcD,hb)=>{var W1=qD(),DwD=jD(),FwD=DwD.cursor,EwD=n1(),zE=N2(),fb=zE.clear,r8=zE.figures,Cb=zE.style,wwD=zE.wrap,$wD=zE.entriesToDisplay;class Bb extends EwD{constructor(D={}){super(D);if(this.msg=D.message,this.cursor=D.cursor||0,this.scrollIndex=D.cursor||0,this.hint=D.hint||"",this.warn=D.warn||"- This option is disabled -",this.minSelected=D.min,this.showMinError=!1,this.maxChoices=D.max,this.instructions=D.instructions,this.optionsPerPage=D.optionsPerPage||10,this.value=D.choices.map((F,E)=>{if(typeof F==="string")F={title:F,value:E};return{title:F&&(F.title||F.value||F),description:F&&F.description,value:F&&(F.value===void 0?E:F.value),selected:F&&F.selected,disabled:F&&F.disabled}}),this.clear=fb("",this.out.columns),!D.overrideRender)this.render()}reset(){this.value.map((D)=>!D.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((D)=>D.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const D=this.value.filter((F)=>F.selected);if(this.minSelected&&D.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),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(){if(this.cursor===0)this.cursor=this.value.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.value.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((D)=>D.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const D=this.value[this.cursor];if(D.selected)D.selected=!1,this.render();else if(D.disabled||this.value.filter((F)=>F.selected).length>=this.maxChoices)return this.bell();else D.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const D=!this.value[this.cursor].selected;this.value.filter((F)=>!F.disabled).forEach((F)=>F.selected=D),this.render()}_(D,F){if(D===" ")this.handleSpaceToggle();else if(D==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`\nInstructions:\n ${r8.arrowUp}/${r8.arrowDown}: Highlight option\n ${r8.arrowLeft}/${r8.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?" a: Toggle all\n":"")+" enter/return: Complete answer"}return""}renderOption(D,F,E,w){const $=(F.selected?W1.green(r8.radioOn):r8.radioOff)+" "+w+" ";let C,f;if(F.disabled)C=D===E?W1.gray().underline(F.title):W1.strikethrough().gray(F.title);else if(C=D===E?W1.cyan().underline(F.title):F.title,D===E&&F.description){if(f=` - ${F.description}`,$.length+C.length+f.length>=this.out.columns||F.description.split(/\r?\n/).length>1)f="\n"+wwD(F.description,{margin:$.length,width:this.out.columns})}return $+C+W1.gray(f||"")}paginateOptions(D){if(D.length===0)return W1.red("No matches for this query.");let F=$wD(this.cursor,D.length,this.optionsPerPage),E=F.startIndex,w=F.endIndex,$,C=[];for(let f=E;f<w;f++){if(f===E&&E>0)$=r8.arrowUp;else if(f===w-1&&w<D.length)$=r8.arrowDown;else $=" ";C.push(this.renderOption(this.cursor,D[f],f,$))}return"\n"+C.join("\n")}renderOptions(D){if(!this.done)return this.paginateOptions(D);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((F)=>F.selected).map((F)=>F.title).join(", ");const D=[W1.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)D.push(W1.yellow(this.warn));return D.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(FwD.hide);super.render();let D=[Cb.symbol(this.done,this.aborted),W1.bold(this.msg),Cb.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)D+=W1.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;D+=this.renderOptions(this.value),this.out.write(this.clear+D),this.clear=fb(D,this.out.columns)}}hb.exports=Bb});var Wb=W((ecD,Zb)=>{function Ub(D,F,E,w,$,C,f){try{var B=D[C](f),h=B.value}catch(U){E(U);return}if(B.done)F(h);else Promise.resolve(h).then(w,$)}function fwD(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){Ub(C,w,$,f,B,"next",h)}function B(h){Ub(C,w,$,f,B,"throw",h)}f(void 0)})}}var TE=qD(),CwD=n1(),Gb=jD(),BwD=Gb.erase,Ab=Gb.cursor,KE=N2(),gU=KE.style,Ib=KE.clear,rU=KE.figures,hwD=KE.wrap,UwD=KE.entriesToDisplay,Mb=(D,F)=>D[F]&&(D[F].value||D[F].title||D[F]),AwD=(D,F)=>D[F]&&(D[F].title||D[F].value||D[F]),IwD=(D,F)=>{const E=D.findIndex((w)=>w.value===F||w.title===F);return E>-1?E:void 0};class Yb extends CwD{constructor(D={}){super(D);this.msg=D.message,this.suggest=D.suggest,this.choices=D.choices,this.initial=typeof D.initial==="number"?D.initial:IwD(D.choices,D.initial),this.select=this.initial||D.cursor||0,this.i18n={noMatches:D.noMatches||"no matches found"},this.fallback=D.fallback||this.initial,this.clearFirst=D.clearFirst||!1,this.suggestions=[],this.input="",this.limit=D.limit||10,this.cursor=0,this.transform=gU.render(D.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Ib("",this.out.columns),this.complete(this.render),this.render()}set fallback(D){this._fb=Number.isSafeInteger(parseInt(D))?parseInt(D):D}get fallback(){let D;if(typeof this._fb==="number")D=this.choices[this._fb];else if(typeof this._fb==="string")D={title:this._fb};return D||this._fb||{title:this.i18n.noMatches}}moveSelect(D){if(this.select=D,this.suggestions.length>0)this.value=Mb(this.suggestions,D);else this.value=this.fallback.value;this.fire()}complete(D){var F=this;return fwD(function*(){const E=F.completing=F.suggest(F.input,F.choices),w=yield E;if(F.completing!==E)return;F.suggestions=w.map((C,f,B)=>({title:AwD(B,f),value:Mb(B,f),description:C.description})),F.completing=!1;const $=Math.max(w.length-1,0);F.moveSelect(Math.min($,F.select)),D&&D()})()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){if(this.clearFirst&&this.input.length>0)this.reset();else this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(D,F){let E=this.input.slice(0,this.cursor),w=this.input.slice(this.cursor);this.input=`${E}${D}${w}`,this.cursor=E.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let D=this.input.slice(0,this.cursor-1),F=this.input.slice(this.cursor);this.input=`${D}${F}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let D=this.input.slice(0,this.cursor),F=this.input.slice(this.cursor+1);this.input=`${D}${F}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){if(this.select===0)this.moveSelect(this.suggestions.length-1);else this.moveSelect(this.select-1);this.render()}down(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else 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(D,F,E,w){let $,C=E?rU.arrowUp:w?rU.arrowDown:" ",f=F?TE.cyan().underline(D.title):D.title;if(C=(F?TE.cyan(rU.pointer)+" ":" ")+C,D.description){if($=` - ${D.description}`,C.length+f.length+$.length>=this.out.columns||D.description.split(/\r?\n/).length>1)$="\n"+hwD(D.description,{margin:3,width:this.out.columns})}return C+" "+f+TE.gray($||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(Ab.hide);else this.out.write(Ib(this.outputText,this.out.columns));super.render();let D=UwD(this.select,this.choices.length,this.limit),F=D.startIndex,E=D.endIndex;if(this.outputText=[gU.symbol(this.done,this.aborted,this.exited),TE.bold(this.msg),gU.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const w=this.suggestions.slice(F,E).map(($,C)=>this.renderOption($,this.select===C+F,C===0&&F>0,C+F===E-1&&E<this.choices.length)).join("\n");this.outputText+="\n"+(w||TE.gray(this.fallback.title))}this.out.write(BwD.line+Ab.to(0)+this.outputText)}}Zb.exports=Yb});var Kb=W((DgD,Tb)=>{var p1=qD(),MwD=jD(),GwD=MwD.cursor,YwD=cU(),_U=N2(),Xb=_U.clear,Jb=_U.style,jF=_U.figures;class zb extends YwD{constructor(D={}){D.overrideRender=!0;super(D);this.inputValue="",this.clear=Xb("",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(){if(this.cursor===0)this.cursor=this.filteredOptions.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.filteredOptions.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((D)=>D.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){const D=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((E)=>{if(this.inputValue){if(typeof E.title==="string"){if(E.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof E.value==="string"){if(E.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});const F=this.filteredOptions.findIndex((E)=>E===D);this.cursor=F<0?0:F,this.render()}handleSpaceToggle(){const D=this.filteredOptions[this.cursor];if(D.selected)D.selected=!1,this.render();else if(D.disabled||this.value.filter((F)=>F.selected).length>=this.maxChoices)return this.bell();else D.selected=!0,this.render()}handleInputChange(D){this.inputValue=this.inputValue+D,this.updateFilteredOptions()}_(D,F){if(D===" ")this.handleSpaceToggle();else this.handleInputChange(D)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
|
|
73
|
+
Instructions:
|
|
74
|
+
${jF.arrowUp}/${jF.arrowDown}: Highlight option
|
|
75
|
+
${jF.arrowLeft}/${jF.arrowRight}/[space]: Toggle selection
|
|
76
|
+
[a,b,c]/delete: Filter choices
|
|
77
|
+
enter/return: Complete answer
|
|
78
|
+
`}return""}renderCurrentInput(){return`
|
|
79
|
+
Filtered results for: ${this.inputValue?this.inputValue:p1.gray("Enter something to filter")}\n`}renderOption(D,F,E){let w;if(F.disabled)w=D===E?p1.gray().underline(F.title):p1.strikethrough().gray(F.title);else w=D===E?p1.cyan().underline(F.title):F.title;return(F.selected?p1.green(jF.radioOn):jF.radioOff)+" "+w}renderDoneOrInstructions(){if(this.done)return this.value.filter((F)=>F.selected).map((F)=>F.title).join(", ");const D=[p1.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)D.push(p1.yellow(this.warn));return D.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(GwD.hide);super.render();let D=[Jb.symbol(this.done,this.aborted),p1.bold(this.msg),Jb.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)D+=p1.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;D+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+D),this.clear=Xb(D,this.out.columns)}}Tb.exports=zb});var qb=W((FgD,Nb)=>{var Sb=qD(),ZwD=n1(),Lb=N2(),Qb=Lb.style,WwD=Lb.clear,Rb=jD(),XwD=Rb.erase,Hb=Rb.cursor;class Vb extends ZwD{constructor(D={}){super(D);this.msg=D.message,this.value=D.initial,this.initialValue=!!D.initial,this.yesMsg=D.yes||"yes",this.yesOption=D.yesOption||"(Y/n)",this.noMsg=D.no||"no",this.noOption=D.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("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(D,F){if(D.toLowerCase()==="y")return this.value=!0,this.submit();if(D.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(Hb.hide);else this.out.write(WwD(this.outputText,this.out.columns));super.render(),this.outputText=[Qb.symbol(this.done,this.aborted),Sb.bold(this.msg),Qb.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Sb.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(XwD.line+Hb.to(0)+this.outputText)}}Nb.exports=Vb});var jb=W((EgD,Ob)=>{Ob.exports={TextPrompt:Dk(),SelectPrompt:fk(),TogglePrompt:Mk(),DatePrompt:ak(),NumberPrompt:$b(),MultiselectPrompt:cU(),AutocompletePrompt:Wb(),AutocompleteMultiselectPrompt:Kb(),ConfirmPrompt:qb()}});var yb=W((Pb)=>{function X1(D,F,E={}){return new Promise((w,$)=>{const C=new JwD[D](F),f=E.onAbort||P7,B=E.onSubmit||P7,h=E.onExit||P7;C.on("state",F.onState||P7),C.on("submit",(U)=>w(B(U))),C.on("exit",(U)=>w(h(U))),C.on("abort",(U)=>$(f(U)))})}var V0=Pb,JwD=jb(),P7=(D)=>D;V0.text=(D)=>X1("TextPrompt",D);V0.password=(D)=>{return D.style="password",V0.text(D)};V0.invisible=(D)=>{return D.style="invisible",V0.text(D)};V0.number=(D)=>X1("NumberPrompt",D);V0.date=(D)=>X1("DatePrompt",D);V0.confirm=(D)=>X1("ConfirmPrompt",D);V0.list=(D)=>{const F=D.separator||",";return X1("TextPrompt",D,{onSubmit:(E)=>E.split(F).map((w)=>w.trim())})};V0.toggle=(D)=>X1("TogglePrompt",D);V0.select=(D)=>X1("SelectPrompt",D);V0.multiselect=(D)=>{D.choices=[].concat(D.choices||[]);const F=(E)=>E.filter((w)=>w.selected).map((w)=>w.value);return X1("MultiselectPrompt",D,{onAbort:F,onSubmit:F})};V0.autocompleteMultiselect=(D)=>{D.choices=[].concat(D.choices||[]);const F=(E)=>E.filter((w)=>w.selected).map((w)=>w.value);return X1("AutocompleteMultiselectPrompt",D,{onAbort:F,onSubmit:F})};var zwD=(D,F)=>Promise.resolve(F.filter((E)=>E.title.slice(0,D.length).toLowerCase()===D.toLowerCase()));V0.autocomplete=(D)=>{return D.suggest=D.suggest||zwD,D.choices=[].concat(D.choices||[]),X1("AutocompletePrompt",D)}});var sb=W(($gD,_b)=>{function kb(D,F){var E=Object.keys(D);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(D);if(F)w=w.filter(function($){return Object.getOwnPropertyDescriptor(D,$).enumerable});E.push.apply(E,w)}return E}function bb(D){for(var F=1;F<arguments.length;F++){var E=arguments[F]!=null?arguments[F]:{};if(F%2)kb(Object(E),!0).forEach(function(w){TwD(D,w,E[w])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(D,Object.getOwnPropertyDescriptors(E));else kb(Object(E)).forEach(function(w){Object.defineProperty(D,w,Object.getOwnPropertyDescriptor(E,w))})}return D}function TwD(D,F,E){if(F in D)Object.defineProperty(D,F,{value:E,enumerable:!0,configurable:!0,writable:!0});else D[F]=E;return D}function KwD(D,F){var E=typeof Symbol!=="undefined"&&D[Symbol.iterator]||D["@@iterator"];if(!E){if(Array.isArray(D)||(E=SwD(D))||F&&D&&typeof D.length==="number"){if(E)D=E;var w=0,$=function h(){};return{s:$,n:function h(){if(w>=D.length)return{done:!0};return{done:!1,value:D[w++]}},e:function h(U){throw U},f:$}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C=!0,f=!1,B;return{s:function h(){E=E.call(D)},n:function h(){var U=E.next();return C=U.done,U},e:function h(U){f=!0,B=U},f:function h(){try{if(!C&&E.return!=null)E.return()}finally{if(f)throw B}}}}function SwD(D,F){if(!D)return;if(typeof D==="string")return xb(D,F);var E=Object.prototype.toString.call(D).slice(8,-1);if(E==="Object"&&D.constructor)E=D.constructor.name;if(E==="Map"||E==="Set")return Array.from(D);if(E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E))return xb(D,F)}function xb(D,F){if(F==null||F>D.length)F=D.length;for(var E=0,w=new Array(F);E<F;E++)w[E]=D[E];return w}function cb(D,F,E,w,$,C,f){try{var B=D[C](f),h=B.value}catch(U){E(U);return}if(B.done)F(h);else Promise.resolve(h).then(w,$)}function gb(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){cb(C,w,$,f,B,"next",h)}function B(h){cb(C,w,$,f,B,"throw",h)}f(void 0)})}}function _8(){return uU.apply(this,arguments)}function uU(){return uU=gb(function*(D=[],{onSubmit:F=rb,onCancel:E=rb}={}){const w={},$=_8._override||{};D=[].concat(D);let C,f,B,h,U,I;const A=function(){var X=gb(function*(J,K,H=!1){if(!H&&J.validate&&J.validate(K)!==!0)return;return J.format?yield J.format(K,w):K});return function J(K,H){return X.apply(this,arguments)}}();var Y=KwD(D),M;try{for(Y.s();!(M=Y.n()).done;){f=M.value;var Z=f;if(h=Z.name,U=Z.type,typeof U==="function")U=yield U(C,bb({},w),f),f.type=U;if(!U)continue;for(let X in f){if(QwD.includes(X))continue;let J=f[X];f[X]=typeof J==="function"?yield J(C,bb({},w),I):J}if(I=f,typeof f.message!=="string")throw new Error("prompt message is required");var z=f;if(h=z.name,U=z.type,sU[U]===void 0)throw new Error(`prompt type (${U}) is not defined`);if($[f.name]!==void 0){if(C=yield A(f,$[f.name]),C!==void 0){w[h]=C;continue}}try{C=_8._injected?HwD(_8._injected,f.initial):yield sU[U](f),w[h]=C=yield A(f,C,!0),B=yield F(f,C,w)}catch(X){B=!(yield E(f,w))}if(B)return w}}catch(X){Y.e(X)}finally{Y.f()}return w}),uU.apply(this,arguments)}function HwD(D,F){const E=D.shift();if(E instanceof Error)throw E;return E===void 0?F:E}function LwD(D){_8._injected=(_8._injected||[]).concat(D)}function RwD(D){_8._override=Object.assign({},D)}var sU=yb(),QwD=["suggest","format","onState","validate","onRender","type"],rb=()=>{};_b.exports=Object.assign(_8,{prompt:_8,prompts:sU,inject:LwD,override:RwD})});var db=W((fgD,ub)=>{ub.exports=(D,F)=>{if(D.meta&&D.name!=="escape")return;if(D.ctrl){if(D.name==="a")return"first";if(D.name==="c")return"abort";if(D.name==="d")return"abort";if(D.name==="e")return"last";if(D.name==="g")return"reset"}if(F){if(D.name==="j")return"down";if(D.name==="k")return"up"}if(D.name==="return")return"submit";if(D.name==="enter")return"submit";if(D.name==="backspace")return"delete";if(D.name==="delete")return"deleteForward";if(D.name==="abort")return"abort";if(D.name==="escape")return"exit";if(D.name==="tab")return"next";if(D.name==="pagedown")return"nextPage";if(D.name==="pageup")return"prevPage";if(D.name==="home")return"home";if(D.name==="end")return"end";if(D.name==="up")return"up";if(D.name==="down")return"down";if(D.name==="right")return"right";if(D.name==="left")return"left";return!1}});var y7=W((CgD,vb)=>{vb.exports=(D)=>{const F=["[\\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("|"),E=new RegExp(F,"g");return typeof D==="string"?D.replace(E,""):D}});var lb=W((BgD,nb)=>{var VwD=y7(),{erase:mb,cursor:NwD}=jD(),qwD=(D)=>[...VwD(D)].length;nb.exports=function(D,F){if(!F)return mb.line+NwD.to(0);let E=0;const w=D.split(/\r?\n/);for(let $ of w)E+=1+Math.floor(Math.max(qwD($)-1,0)/F);return mb.lines(E)}});var dU=W((hgD,ib)=>{var SE={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},OwD={arrowUp:SE.arrowUp,arrowDown:SE.arrowDown,arrowLeft:SE.arrowLeft,arrowRight:SE.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},jwD=process.platform==="win32"?OwD:SE;ib.exports=jwD});var ab=W((UgD,pb)=>{var PF=qD(),W6=dU(),vU=Object.freeze({password:{scale:1,render:(D)=>"*".repeat(D.length)},emoji:{scale:2,render:(D)=>"\uD83D\uDE03".repeat(D.length)},invisible:{scale:0,render:(D)=>""},default:{scale:1,render:(D)=>`${D}`}}),PwD=(D)=>vU[D]||vU.default,QE=Object.freeze({aborted:PF.red(W6.cross),done:PF.green(W6.tick),exited:PF.yellow(W6.cross),default:PF.cyan("?")}),ywD=(D,F,E)=>F?QE.aborted:E?QE.exited:D?QE.done:QE.default,kwD=(D)=>PF.gray(D?W6.ellipsis:W6.pointerSmall),bwD=(D,F)=>PF.gray(D?F?W6.pointerSmall:"+":W6.line);pb.exports={styles:vU,render:PwD,symbols:QE,symbol:ywD,delimiter:kwD,item:bwD}});var tb=W((AgD,ob)=>{var xwD=y7();ob.exports=function(D,F){let E=String(xwD(D)||"").split(/\r?\n/);if(!F)return E.length;return E.map((w)=>Math.ceil(w.length/F)).reduce((w,$)=>w+$)}});var Dx=W((IgD,eb)=>{eb.exports=(D,F={})=>{const E=Number.isSafeInteger(parseInt(F.margin))?new Array(parseInt(F.margin)).fill(" ").join(""):F.margin||"",w=F.width;return(D||"").split(/\r?\n/g).map(($)=>$.split(/\s+/g).reduce((C,f)=>{if(f.length+E.length>=w||C[C.length-1].length+f.length+1<w)C[C.length-1]+=` ${f}`;else C.push(`${E}${f}`);return C},[E]).join("\n")).join("\n")}});var Ex=W((MgD,Fx)=>{Fx.exports=(D,F,E)=>{E=E||F;let w=Math.min(F-E,D-Math.floor(E/2));if(w<0)w=0;let $=Math.min(w+E,F);return{startIndex:w,endIndex:$}}});var q2=W((GgD,wx)=>{wx.exports={action:db(),clear:lb(),style:ab(),strip:y7(),figures:dU(),lines:tb(),wrap:Dx(),entriesToDisplay:Ex()}});var a1=W((YgD,Cx)=>{var $x=import.meta.require("readline"),{action:cwD}=q2(),gwD=import.meta.require("events"),{beep:rwD,cursor:_wD}=jD(),swD=qD();class fx extends gwD{constructor(D={}){super();this.firstRender=!0,this.in=D.stdin||process.stdin,this.out=D.stdout||process.stdout,this.onRender=(D.onRender||(()=>{return})).bind(this);const F=$x.createInterface({input:this.in,escapeCodeTimeout:50});if($x.emitKeypressEvents(this.in,F),this.in.isTTY)this.in.setRawMode(!0);const E=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,w=($,C)=>{let f=cwD(C,E);if(f===!1)this._&&this._($,C);else if(typeof this[f]==="function")this[f](C);else this.bell()};this.close=()=>{if(this.out.write(_wD.show),this.in.removeListener("keypress",w),this.in.isTTY)this.in.setRawMode(!1);F.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",w)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(rwD)}render(){if(this.onRender(swD),this.firstRender)this.firstRender=!1}}Cx.exports=fx});var Ux=W((ZgD,hx)=>{var k7=qD(),uwD=a1(),{erase:dwD,cursor:HE}=jD(),{style:mU,clear:nU,lines:vwD,figures:mwD}=q2();class Bx extends uwD{constructor(D={}){super(D);this.transform=mU.render(D.style),this.scale=this.transform.scale,this.msg=D.message,this.initial=D.initial||"",this.validator=D.validate||(()=>!0),this.value="",this.errorMsg=D.error||"Please Enter A Valid Value",this.cursor=Number(!!this.initial),this.cursorOffset=0,this.clear=nU("",this.out.columns),this.render()}set value(D){if(!D&&this.initial)this.placeholder=!0,this.rendered=k7.gray(this.transform.render(this.initial));else this.placeholder=!1,this.rendered=this.transform.render(D);this._value=D,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=Number(!!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("\n"),this.close()}async validate(){let D=await this.validator(this.value);if(typeof D==="string")this.errorMsg=D,D=!1;this.error=!D}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("\n"),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(D){if(this.placeholder)return;this.cursor=this.cursor+D,this.cursorOffset+=D}_(D,F){let E=this.value.slice(0,this.cursor),w=this.value.slice(this.cursor);this.value=`${E}${D}${w}`,this.red=!1,this.cursor=this.placeholder?0:E.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let D=this.value.slice(0,this.cursor-1),F=this.value.slice(this.cursor);if(this.value=`${D}${F}`,this.red=!1,this.isCursorAtStart())this.cursorOffset=0;else this.cursorOffset++,this.moveCursor(-1);this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let D=this.value.slice(0,this.cursor),F=this.value.slice(this.cursor+1);if(this.value=`${D}${F}`,this.red=!1,this.isCursorAtEnd())this.cursorOffset=0;else 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(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(HE.down(vwD(this.outputError,this.out.columns)-1)+nU(this.outputError,this.out.columns));this.out.write(nU(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[mU.symbol(this.done,this.aborted),k7.bold(this.msg),mU.delimiter(this.done),this.red?k7.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":mwD.pointerSmall} ${k7.red().italic(F)}`,"");this.out.write(dwD.line+HE.to(0)+this.outputText+HE.save+this.outputError+HE.restore+HE.move(this.cursorOffset,0))}}hx.exports=Bx});var Yx=W((WgD,Gx)=>{var o1=qD(),nwD=a1(),{style:Ax,clear:Ix,figures:b7,wrap:lwD,entriesToDisplay:iwD}=q2(),{cursor:pwD}=jD();class Mx extends nwD{constructor(D={}){super(D);this.msg=D.message,this.hint=D.hint||"- Use arrow-keys. Return to submit.",this.warn=D.warn||"- This option is disabled",this.cursor=D.initial||0,this.choices=D.choices.map((F,E)=>{if(typeof F==="string")F={title:F,value:E};return{title:F&&(F.title||F.value||F),value:F&&(F.value===void 0?E:F.value),description:F&&F.description,selected:F&&F.selected,disabled:F&&F.disabled}}),this.optionsPerPage=D.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Ix("",this.out.columns),this.render()}moveCursor(D){this.cursor=D,this.value=this.choices[D].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("\n"),this.close()}submit(){if(!this.selection.disabled)this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close();else this.bell()}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){if(this.cursor===0)this.moveCursor(this.choices.length-1);else this.moveCursor(this.cursor-1);this.render()}down(){if(this.cursor===this.choices.length-1)this.moveCursor(0);else this.moveCursor(this.cursor+1);this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(D,F){if(D===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;if(this.firstRender)this.out.write(pwD.hide);else this.out.write(Ix(this.outputText,this.out.columns));super.render();let{startIndex:D,endIndex:F}=iwD(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Ax.symbol(this.done,this.aborted),o1.bold(this.msg),Ax.delimiter(!1),this.done?this.selection.title:this.selection.disabled?o1.yellow(this.warn):o1.gray(this.hint)].join(" "),!this.done){this.outputText+="\n";for(let E=D;E<F;E++){let w,$,C="",f=this.choices[E];if(E===D&&D>0)$=b7.arrowUp;else if(E===F-1&&F<this.choices.length)$=b7.arrowDown;else $=" ";if(f.disabled)w=this.cursor===E?o1.gray().underline(f.title):o1.strikethrough().gray(f.title),$=(this.cursor===E?o1.bold().gray(b7.pointer)+" ":" ")+$;else if(w=this.cursor===E?o1.cyan().underline(f.title):f.title,$=(this.cursor===E?o1.cyan(b7.pointer)+" ":" ")+$,f.description&&this.cursor===E){if(C=` - ${f.description}`,$.length+w.length+C.length>=this.out.columns||f.description.split(/\r?\n/).length>1)C="\n"+lwD(f.description,{margin:3,width:this.out.columns})}this.outputText+=`${$} ${w}${o1.gray(C)}\n`}}this.out.write(this.outputText)}}Gx.exports=Mx});var zx=W((XgD,Jx)=>{var x7=qD(),awD=a1(),{style:Zx,clear:owD}=q2(),{cursor:Wx,erase:twD}=jD();class Xx extends awD{constructor(D={}){super(D);this.msg=D.message,this.value=!!D.initial,this.active=D.active||"on",this.inactive=D.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("\n"),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),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()}_(D,F){if(D===" ")this.value=!this.value;else if(D==="1")this.value=!0;else if(D==="0")this.value=!1;else return this.bell();this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(Wx.hide);else this.out.write(owD(this.outputText,this.out.columns));super.render(),this.outputText=[Zx.symbol(this.done,this.aborted),x7.bold(this.msg),Zx.delimiter(this.done),this.value?this.inactive:x7.cyan().underline(this.inactive),x7.gray("/"),this.value?x7.cyan().underline(this.active):this.active].join(" "),this.out.write(twD.line+Wx.to(0)+this.outputText)}}Jx.exports=Xx});var J1=W((JgD,Tx)=>{class c7{constructor({token:D,date:F,parts:E,locales:w}){this.token=D,this.date=F||new Date,this.parts=E||[this],this.locales=w||{}}up(){}down(){}next(){const D=this.parts.indexOf(this);return this.parts.find((F,E)=>E>D&&F instanceof c7)}setTo(D){}prev(){let D=[].concat(this.parts).reverse();const F=D.indexOf(this);return D.find((E,w)=>w>F&&E instanceof c7)}toString(){return String(this.date)}}Tx.exports=c7});var Qx=W((zgD,Sx)=>{var ewD=J1();class Kx extends ewD{constructor(D={}){super(D)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let D=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?D.toUpperCase():D}}Sx.exports=Kx});var Rx=W((TgD,Lx)=>{var D$D=J1(),F$D=(D)=>{return D=D%10,D===1?"st":D===2?"nd":D===3?"rd":"th"};class Hx extends D$D{constructor(D={}){super(D)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(D){this.date.setDate(parseInt(D.substr(-2)))}toString(){let D=this.date.getDate(),F=this.date.getDay();return this.token==="DD"?String(D).padStart(2,"0"):this.token==="Do"?D+F$D(D):this.token==="d"?F+1:this.token==="ddd"?this.locales.weekdaysShort[F]:this.token==="dddd"?this.locales.weekdays[F]:D}}Lx.exports=Hx});var qx=W((KgD,Nx)=>{var E$D=J1();class Vx extends E$D{constructor(D={}){super(D)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(D){this.date.setHours(parseInt(D.substr(-2)))}toString(){let D=this.date.getHours();if(/h/.test(this.token))D=D%12||12;return this.token.length>1?String(D).padStart(2,"0"):D}}Nx.exports=Vx});var Px=W((SgD,jx)=>{var w$D=J1();class Ox extends w$D{constructor(D={}){super(D)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(D){this.date.setMilliseconds(parseInt(D.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}}jx.exports=Ox});var bx=W((QgD,kx)=>{var $$D=J1();class yx extends $$D{constructor(D={}){super(D)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(D){this.date.setMinutes(parseInt(D.substr(-2)))}toString(){let D=this.date.getMinutes();return this.token.length>1?String(D).padStart(2,"0"):D}}kx.exports=yx});var gx=W((HgD,cx)=>{var f$D=J1();class xx extends f$D{constructor(D={}){super(D)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(D){D=parseInt(D.substr(-2))-1,this.date.setMonth(D<0?0:D)}toString(){let D=this.date.getMonth(),F=this.token.length;return F===2?String(D+1).padStart(2,"0"):F===3?this.locales.monthsShort[D]:F===4?this.locales.months[D]:String(D+1)}}cx.exports=xx});var sx=W((LgD,_x)=>{var C$D=J1();class rx extends C$D{constructor(D={}){super(D)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(D){this.date.setSeconds(parseInt(D.substr(-2)))}toString(){let D=this.date.getSeconds();return this.token.length>1?String(D).padStart(2,"0"):D}}_x.exports=rx});var vx=W((RgD,dx)=>{var B$D=J1();class ux extends B$D{constructor(D={}){super(D)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(D){this.date.setFullYear(D.substr(-4))}toString(){let D=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?D.substr(-2):D}}dx.exports=ux});var nx=W((VgD,mx)=>{mx.exports={DatePart:J1(),Meridiem:Qx(),Day:Rx(),Hours:qx(),Milliseconds:Px(),Minutes:bx(),Month:gx(),Seconds:sx(),Year:vx()}});var Dc=W((NgD,ex)=>{var lU=qD(),h$D=a1(),{style:lx,clear:ix,figures:U$D}=q2(),{erase:A$D,cursor:px}=jD(),{DatePart:ax,Meridiem:I$D,Day:M$D,Hours:G$D,Milliseconds:Y$D,Minutes:Z$D,Month:W$D,Seconds:X$D,Year:J$D}=nx(),z$D=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,ox={1:({token:D})=>D.replace(/\\(.)/g,"$1"),2:(D)=>new M$D(D),3:(D)=>new W$D(D),4:(D)=>new J$D(D),5:(D)=>new I$D(D),6:(D)=>new G$D(D),7:(D)=>new Z$D(D),8:(D)=>new X$D(D),9:(D)=>new Y$D(D)},T$D={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(",")};class tx extends h$D{constructor(D={}){super(D);this.msg=D.message,this.cursor=0,this.typed="",this.locales=Object.assign(T$D,D.locales),this._date=D.initial||new Date,this.errorMsg=D.error||"Please Enter A Valid Value",this.validator=D.validate||(()=>!0),this.mask=D.mask||"YYYY-MM-DD HH:mm:ss",this.clear=ix("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(D){if(D)this._date.setTime(D.getTime())}set mask(D){let F;this.parts=[];while(F=z$D.exec(D)){let w=F.shift(),$=F.findIndex((C)=>C!=null);this.parts.push($ in ox?ox[$]({token:F[$]||w,date:this.date,parts:this.parts,locales:this.locales}):F[$]||w)}let E=this.parts.reduce((w,$)=>{if(typeof $==="string"&&typeof w[w.length-1]==="string")w[w.length-1]+=$;else w.push($);return w},[]);this.parts.splice(0),this.parts.push(...E),this.reset()}moveCursor(D){this.typed="",this.cursor=D,this.fire()}reset(){this.moveCursor(this.parts.findIndex((D)=>D instanceof ax)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let D=await this.validator(this.value);if(typeof D==="string")this.errorMsg=D,D=!1;this.error=!D}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("\n"),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let D=this.parts[this.cursor].prev();if(D==null)return this.bell();this.moveCursor(this.parts.indexOf(D)),this.render()}right(){let D=this.parts[this.cursor].next();if(D==null)return this.bell();this.moveCursor(this.parts.indexOf(D)),this.render()}next(){let D=this.parts[this.cursor].next();this.moveCursor(D?this.parts.indexOf(D):this.parts.findIndex((F)=>F instanceof ax)),this.render()}_(D){if(/\d/.test(D))this.typed+=D,this.parts[this.cursor].setTo(this.typed),this.render()}render(){if(this.closed)return;if(this.firstRender)this.out.write(px.hide);else this.out.write(ix(this.outputText,this.out.columns));if(super.render(),this.outputText=[lx.symbol(this.done,this.aborted),lU.bold(this.msg),lx.delimiter(!1),this.parts.reduce((D,F,E)=>D.concat(E===this.cursor&&!this.done?lU.cyan().underline(F.toString()):F),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":U$D.pointerSmall} ${lU.red().italic(F)}`,"");this.out.write(A$D.line+px.to(0)+this.outputText)}}ex.exports=tx});var fc=W((qgD,$c)=>{var g7=qD(),K$D=a1(),{cursor:r7,erase:S$D}=jD(),{style:iU,figures:Q$D,clear:Fc,lines:H$D}=q2(),L$D=/[0-9]/,pU=(D)=>D!==void 0,Ec=(D,F)=>{let E=Math.pow(10,F);return Math.round(D*E)/E};class wc extends K$D{constructor(D={}){super(D);this.transform=iU.render(D.style),this.msg=D.message,this.initial=pU(D.initial)?D.initial:"",this.float=!!D.float,this.round=D.round||2,this.inc=D.increment||1,this.min=pU(D.min)?D.min:-1/0,this.max=pU(D.max)?D.max:1/0,this.errorMsg=D.error||"Please Enter A Valid Value",this.validator=D.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(D){if(!D&&D!==0)this.placeholder=!0,this.rendered=g7.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${Ec(D,this.round)}`),this._value=Ec(D,this.round);this.fire()}get value(){return this._value}parse(D){return this.float?parseFloat(D):parseInt(D)}valid(D){return D==="-"||D==="."&&this.float||L$D.test(D)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let D=this.value;this.value=D!==""?D:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}async validate(){let D=await this.validator(this.value);if(typeof D==="string")this.errorMsg=D,D=!1;this.error=!D}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let D=this.value;this.value=D!==""?D:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}up(){if(this.typed="",this.value==="")this.value=this.min-this.inc;if(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;if(this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let D=this.value.toString();if(D.length===0)return this.bell();if(this.value=this.parse(D=D.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()}_(D,F){if(!this.valid(D))return this.bell();const E=Date.now();if(E-this.lastHit>1000)this.typed="";if(this.typed+=D,this.lastHit=E,this.color="cyan",D===".")return this.fire();if(this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max)this.value=this.max;if(this.value<this.min)this.value=this.min;this.fire(),this.render()}render(){if(this.closed)return;if(!this.firstRender){if(this.outputError)this.out.write(r7.down(H$D(this.outputError,this.out.columns)-1)+Fc(this.outputError,this.out.columns));this.out.write(Fc(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[iU.symbol(this.done,this.aborted),g7.bold(this.msg),iU.delimiter(this.done),!this.done||!this.done&&!this.placeholder?g7[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":Q$D.pointerSmall} ${g7.red().italic(F)}`,"");this.out.write(S$D.line+r7.to(0)+this.outputText+r7.save+this.outputError+r7.restore)}}$c.exports=wc});var aU=W((OgD,Uc)=>{var z1=qD(),{cursor:R$D}=jD(),V$D=a1(),{clear:Cc,figures:s8,style:Bc,wrap:N$D,entriesToDisplay:q$D}=q2();class hc extends V$D{constructor(D={}){super(D);if(this.msg=D.message,this.cursor=D.cursor||0,this.scrollIndex=D.cursor||0,this.hint=D.hint||"",this.warn=D.warn||"- This option is disabled -",this.minSelected=D.min,this.showMinError=!1,this.maxChoices=D.max,this.instructions=D.instructions,this.optionsPerPage=D.optionsPerPage||10,this.value=D.choices.map((F,E)=>{if(typeof F==="string")F={title:F,value:E};return{title:F&&(F.title||F.value||F),description:F&&F.description,value:F&&(F.value===void 0?E:F.value),selected:F&&F.selected,disabled:F&&F.disabled}}),this.clear=Cc("",this.out.columns),!D.overrideRender)this.render()}reset(){this.value.map((D)=>!D.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter((D)=>D.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){const D=this.value.filter((F)=>F.selected);if(this.minSelected&&D.length<this.minSelected)this.showMinError=!0,this.render();else this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),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(){if(this.cursor===0)this.cursor=this.value.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.value.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((D)=>D.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const D=this.value[this.cursor];if(D.selected)D.selected=!1,this.render();else if(D.disabled||this.value.filter((F)=>F.selected).length>=this.maxChoices)return this.bell();else D.selected=!0,this.render()}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const D=!this.value[this.cursor].selected;this.value.filter((F)=>!F.disabled).forEach((F)=>F.selected=D),this.render()}_(D,F){if(D===" ")this.handleSpaceToggle();else if(D==="a")this.toggleAll();else return this.bell()}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`\nInstructions:\n ${s8.arrowUp}/${s8.arrowDown}: Highlight option\n ${s8.arrowLeft}/${s8.arrowRight}/[space]: Toggle selection\n`+(this.maxChoices===void 0?" a: Toggle all\n":"")+" enter/return: Complete answer"}return""}renderOption(D,F,E,w){const $=(F.selected?z1.green(s8.radioOn):s8.radioOff)+" "+w+" ";let C,f;if(F.disabled)C=D===E?z1.gray().underline(F.title):z1.strikethrough().gray(F.title);else if(C=D===E?z1.cyan().underline(F.title):F.title,D===E&&F.description){if(f=` - ${F.description}`,$.length+C.length+f.length>=this.out.columns||F.description.split(/\r?\n/).length>1)f="\n"+N$D(F.description,{margin:$.length,width:this.out.columns})}return $+C+z1.gray(f||"")}paginateOptions(D){if(D.length===0)return z1.red("No matches for this query.");let{startIndex:F,endIndex:E}=q$D(this.cursor,D.length,this.optionsPerPage),w,$=[];for(let C=F;C<E;C++){if(C===F&&F>0)w=s8.arrowUp;else if(C===E-1&&E<D.length)w=s8.arrowDown;else w=" ";$.push(this.renderOption(this.cursor,D[C],C,w))}return"\n"+$.join("\n")}renderOptions(D){if(!this.done)return this.paginateOptions(D);return""}renderDoneOrInstructions(){if(this.done)return this.value.filter((F)=>F.selected).map((F)=>F.title).join(", ");const D=[z1.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)D.push(z1.yellow(this.warn));return D.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(R$D.hide);super.render();let D=[Bc.symbol(this.done,this.aborted),z1.bold(this.msg),Bc.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)D+=z1.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;D+=this.renderOptions(this.value),this.out.write(this.clear+D),this.clear=Cc(D,this.out.columns)}}Uc.exports=hc});var Zc=W((jgD,Yc)=>{var LE=qD(),O$D=a1(),{erase:j$D,cursor:Ac}=jD(),{style:oU,clear:Ic,figures:tU,wrap:P$D,entriesToDisplay:y$D}=q2(),Mc=(D,F)=>D[F]&&(D[F].value||D[F].title||D[F]),k$D=(D,F)=>D[F]&&(D[F].title||D[F].value||D[F]),b$D=(D,F)=>{const E=D.findIndex((w)=>w.value===F||w.title===F);return E>-1?E:void 0};class Gc extends O$D{constructor(D={}){super(D);this.msg=D.message,this.suggest=D.suggest,this.choices=D.choices,this.initial=typeof D.initial==="number"?D.initial:b$D(D.choices,D.initial),this.select=this.initial||D.cursor||0,this.i18n={noMatches:D.noMatches||"no matches found"},this.fallback=D.fallback||this.initial,this.clearFirst=D.clearFirst||!1,this.suggestions=[],this.input="",this.limit=D.limit||10,this.cursor=0,this.transform=oU.render(D.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Ic("",this.out.columns),this.complete(this.render),this.render()}set fallback(D){this._fb=Number.isSafeInteger(parseInt(D))?parseInt(D):D}get fallback(){let D;if(typeof this._fb==="number")D=this.choices[this._fb];else if(typeof this._fb==="string")D={title:this._fb};return D||this._fb||{title:this.i18n.noMatches}}moveSelect(D){if(this.select=D,this.suggestions.length>0)this.value=Mc(this.suggestions,D);else this.value=this.fallback.value;this.fire()}async complete(D){const F=this.completing=this.suggest(this.input,this.choices),E=await F;if(this.completing!==F)return;this.suggestions=E.map(($,C,f)=>({title:k$D(f,C),value:Mc(f,C),description:$.description})),this.completing=!1;const w=Math.max(E.length-1,0);this.moveSelect(Math.min(w,this.select)),D&&D()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){if(this.clearFirst&&this.input.length>0)this.reset();else this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(D,F){let E=this.input.slice(0,this.cursor),w=this.input.slice(this.cursor);this.input=`${E}${D}${w}`,this.cursor=E.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let D=this.input.slice(0,this.cursor-1),F=this.input.slice(this.cursor);this.input=`${D}${F}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let D=this.input.slice(0,this.cursor),F=this.input.slice(this.cursor+1);this.input=`${D}${F}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){if(this.select===0)this.moveSelect(this.suggestions.length-1);else this.moveSelect(this.select-1);this.render()}down(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else this.moveSelect(this.select+1);this.render()}next(){if(this.select===this.suggestions.length-1)this.moveSelect(0);else 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(D,F,E,w){let $,C=E?tU.arrowUp:w?tU.arrowDown:" ",f=F?LE.cyan().underline(D.title):D.title;if(C=(F?LE.cyan(tU.pointer)+" ":" ")+C,D.description){if($=` - ${D.description}`,C.length+f.length+$.length>=this.out.columns||D.description.split(/\r?\n/).length>1)$="\n"+P$D(D.description,{margin:3,width:this.out.columns})}return C+" "+f+LE.gray($||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(Ac.hide);else this.out.write(Ic(this.outputText,this.out.columns));super.render();let{startIndex:D,endIndex:F}=y$D(this.select,this.choices.length,this.limit);if(this.outputText=[oU.symbol(this.done,this.aborted,this.exited),LE.bold(this.msg),oU.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const E=this.suggestions.slice(D,F).map((w,$)=>this.renderOption(w,this.select===$+D,$===0&&D>0,$+D===F-1&&F<this.choices.length)).join("\n");this.outputText+="\n"+(E||LE.gray(this.fallback.title))}this.out.write(j$D.line+Ac.to(0)+this.outputText)}}Yc.exports=Gc});var Tc=W((PgD,zc)=>{var t1=qD(),{cursor:x$D}=jD(),c$D=aU(),{clear:Wc,style:Xc,figures:yF}=q2();class Jc extends c$D{constructor(D={}){D.overrideRender=!0;super(D);this.inputValue="",this.clear=Wc("",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(){if(this.cursor===0)this.cursor=this.filteredOptions.length-1;else this.cursor--;this.render()}down(){if(this.cursor===this.filteredOptions.length-1)this.cursor=0;else this.cursor++;this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter((D)=>D.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){if(this.inputValue.length)this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions()}updateFilteredOptions(){const D=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter((E)=>{if(this.inputValue){if(typeof E.title==="string"){if(E.title.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}if(typeof E.value==="string"){if(E.value.toLowerCase().includes(this.inputValue.toLowerCase()))return!0}return!1}return!0});const F=this.filteredOptions.findIndex((E)=>E===D);this.cursor=F<0?0:F,this.render()}handleSpaceToggle(){const D=this.filteredOptions[this.cursor];if(D.selected)D.selected=!1,this.render();else if(D.disabled||this.value.filter((F)=>F.selected).length>=this.maxChoices)return this.bell();else D.selected=!0,this.render()}handleInputChange(D){this.inputValue=this.inputValue+D,this.updateFilteredOptions()}_(D,F){if(D===" ")this.handleSpaceToggle();else this.handleInputChange(D)}renderInstructions(){if(this.instructions===void 0||this.instructions){if(typeof this.instructions==="string")return this.instructions;return`
|
|
80
|
+
Instructions:
|
|
81
|
+
${yF.arrowUp}/${yF.arrowDown}: Highlight option
|
|
82
|
+
${yF.arrowLeft}/${yF.arrowRight}/[space]: Toggle selection
|
|
83
|
+
[a,b,c]/delete: Filter choices
|
|
84
|
+
enter/return: Complete answer
|
|
85
|
+
`}return""}renderCurrentInput(){return`
|
|
86
|
+
Filtered results for: ${this.inputValue?this.inputValue:t1.gray("Enter something to filter")}\n`}renderOption(D,F,E){let w;if(F.disabled)w=D===E?t1.gray().underline(F.title):t1.strikethrough().gray(F.title);else w=D===E?t1.cyan().underline(F.title):F.title;return(F.selected?t1.green(yF.radioOn):yF.radioOff)+" "+w}renderDoneOrInstructions(){if(this.done)return this.value.filter((F)=>F.selected).map((F)=>F.title).join(", ");const D=[t1.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];if(this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled)D.push(t1.yellow(this.warn));return D.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(x$D.hide);super.render();let D=[Xc.symbol(this.done,this.aborted),t1.bold(this.msg),Xc.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)D+=t1.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1;D+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+D),this.clear=Wc(D,this.out.columns)}}zc.exports=Jc});var Rc=W((ygD,Lc)=>{var Kc=qD(),g$D=a1(),{style:Sc,clear:r$D}=q2(),{erase:_$D,cursor:Qc}=jD();class Hc extends g$D{constructor(D={}){super(D);this.msg=D.message,this.value=D.initial,this.initialValue=!!D.initial,this.yesMsg=D.yes||"yes",this.yesOption=D.yesOption||"(Y/n)",this.noMsg=D.no||"no",this.noOption=D.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("\n"),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write("\n"),this.close()}_(D,F){if(D.toLowerCase()==="y")return this.value=!0,this.submit();if(D.toLowerCase()==="n")return this.value=!1,this.submit();return this.bell()}render(){if(this.closed)return;if(this.firstRender)this.out.write(Qc.hide);else this.out.write(r$D(this.outputText,this.out.columns));super.render(),this.outputText=[Sc.symbol(this.done,this.aborted),Kc.bold(this.msg),Sc.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Kc.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(_$D.line+Qc.to(0)+this.outputText)}}Lc.exports=Hc});var Nc=W((kgD,Vc)=>{Vc.exports={TextPrompt:Ux(),SelectPrompt:Yx(),TogglePrompt:zx(),DatePrompt:Dc(),NumberPrompt:fc(),MultiselectPrompt:aU(),AutocompletePrompt:Zc(),AutocompleteMultiselectPrompt:Tc(),ConfirmPrompt:Rc()}});var Oc=W((qc)=>{function T1(D,F,E={}){return new Promise((w,$)=>{const C=new s$D[D](F),f=E.onAbort||_7,B=E.onSubmit||_7,h=E.onExit||_7;C.on("state",F.onState||_7),C.on("submit",(U)=>w(B(U))),C.on("exit",(U)=>w(h(U))),C.on("abort",(U)=>$(f(U)))})}var N0=qc,s$D=Nc(),_7=(D)=>D;N0.text=(D)=>T1("TextPrompt",D);N0.password=(D)=>{return D.style="password",N0.text(D)};N0.invisible=(D)=>{return D.style="invisible",N0.text(D)};N0.number=(D)=>T1("NumberPrompt",D);N0.date=(D)=>T1("DatePrompt",D);N0.confirm=(D)=>T1("ConfirmPrompt",D);N0.list=(D)=>{const F=D.separator||",";return T1("TextPrompt",D,{onSubmit:(E)=>E.split(F).map((w)=>w.trim())})};N0.toggle=(D)=>T1("TogglePrompt",D);N0.select=(D)=>T1("SelectPrompt",D);N0.multiselect=(D)=>{D.choices=[].concat(D.choices||[]);const F=(E)=>E.filter((w)=>w.selected).map((w)=>w.value);return T1("MultiselectPrompt",D,{onAbort:F,onSubmit:F})};N0.autocompleteMultiselect=(D)=>{D.choices=[].concat(D.choices||[]);const F=(E)=>E.filter((w)=>w.selected).map((w)=>w.value);return T1("AutocompleteMultiselectPrompt",D,{onAbort:F,onSubmit:F})};var u$D=(D,F)=>Promise.resolve(F.filter((E)=>E.title.slice(0,D.length).toLowerCase()===D.toLowerCase()));N0.autocomplete=(D)=>{return D.suggest=D.suggest||u$D,D.choices=[].concat(D.choices||[]),T1("AutocompletePrompt",D)}});var yc=W((xgD,Pc)=>{async function u8(D=[],{onSubmit:F=jc,onCancel:E=jc}={}){const w={},$=u8._override||{};D=[].concat(D);let C,f,B,h,U,I;const A=async(Y,M,Z=!1)=>{if(!Z&&Y.validate&&Y.validate(M)!==!0)return;return Y.format?await Y.format(M,w):M};for(f of D){if({name:h,type:U}=f,typeof U==="function")U=await U(C,{...w},f),f.type=U;if(!U)continue;for(let Y in f){if(d$D.includes(Y))continue;let M=f[Y];f[Y]=typeof M==="function"?await M(C,{...w},I):M}if(I=f,typeof f.message!=="string")throw new Error("prompt message is required");if({name:h,type:U}=f,eU[U]===void 0)throw new Error(`prompt type (${U}) is not defined`);if($[f.name]!==void 0){if(C=await A(f,$[f.name]),C!==void 0){w[h]=C;continue}}try{C=u8._injected?v$D(u8._injected,f.initial):await eU[U](f),w[h]=C=await A(f,C,!0),B=await F(f,C,w)}catch(Y){B=!await E(f,w)}if(B)return w}return w}function v$D(D,F){const E=D.shift();if(E instanceof Error)throw E;return E===void 0?F:E}function m$D(D){u8._injected=(u8._injected||[]).concat(D)}function n$D(D){u8._override=Object.assign({},D)}var eU=Oc(),d$D=["suggest","format","onState","validate","onRender","type"],jc=()=>{};Pc.exports=Object.assign(u8,{prompt:u8,prompts:eU,inject:m$D,override:n$D})});var bc=W((cgD,kc)=>{function l$D(D){D=(Array.isArray(D)?D:D.split(".")).map(Number);let F=0,E=process.versions.node.split(".").map(Number);for(;F<D.length;F++){if(E[F]>D[F])return!1;if(D[F]>E[F])return!0}return!1}kc.exports=l$D("8.6.0")?sb():yc()});var nc=W((prD,mc)=>{function VE(D){this.capacity=D|0,this.map=Object.create(null),this.list=new u7}function u7(){this.firstNode=null,this.lastNode=null}function y4D(D,F){this.key=D,this.val=F,this.prev=null,this.next=null}mc.exports=function(D){return new VE(D)};VE.prototype.get=function(D){var F=this.map[D];if(F==null)return;return this.used(F),F.val};VE.prototype.set=function(D,F){var E=this.map[D];if(E!=null)E.val=F;else{if(!this.capacity)this.prune();if(!this.capacity)return!1;E=new y4D(D,F),this.map[D]=E,this.capacity--}return this.used(E),!0};VE.prototype.used=function(D){this.list.moveToFront(D)};VE.prototype.prune=function(){var D=this.list.pop();if(D!=null)delete this.map[D.key],this.capacity++};u7.prototype.moveToFront=function(D){if(this.firstNode==D)return;if(this.remove(D),this.firstNode==null)this.firstNode=D,this.lastNode=D,D.prev=null,D.next=null;else D.prev=null,D.next=this.firstNode,D.next.prev=D,this.firstNode=D};u7.prototype.pop=function(){var D=this.lastNode;if(D!=null)this.remove(D);return D};u7.prototype.remove=function(D){if(this.firstNode==D)this.firstNode=D.next;else if(D.prev!=null)D.prev.next=D.next;if(this.lastNode==D)this.lastNode=D.prev;else if(D.next!=null)D.next.prev=D.prev}});var ec=W((tc)=>{function NE(D,F,E){return ac.createHmac("sha256",D).update(F,"utf8").digest(E)}function FA(D,F){return ac.createHash("sha256").update(D,"utf8").digest(F)}function oc(D){return D.replace(/[!'()*]/g,function(F){return"%"+F.charCodeAt(0).toString(16).toUpperCase()})}function d7(D){return oc(encodeURIComponent(D))}function gD(D,F){if(typeof D==="string")D=k4D.parse(D);var E=D.headers=Object.assign({},D.headers||{}),w=(!this.service||!this.region)&&this.matchHost(D.hostname||D.host||E.Host||E.host);if(this.request=D,this.credentials=F||this.defaultCredentials(),this.service=D.service||w[0]||"",this.region=D.region||w[1]||"us-east-1",this.service==="email")this.service="ses";if(!D.method&&D.body)D.method="POST";if(!E.Host&&!E.host){if(E.Host=D.hostname||D.host||this.createHost(),D.port)E.Host+=":"+D.port}if(!D.hostname&&!D.host)D.hostname=E.Host||E.host;this.isCodeCommitGit=this.service==="codecommit"&&D.method==="GIT",this.extraHeadersToIgnore=D.extraHeadersToIgnore||Object.create(null),this.extraHeadersToInclude=D.extraHeadersToInclude||Object.create(null)}var ic=tc,k4D=import.meta.require("url"),pc=import.meta.require("querystring"),ac=import.meta.require("crypto"),b4D=nc(),lc=b4D(1000),x4D={authorization:!0,connection:!0,"x-amzn-trace-id":!0,"user-agent":!0,expect:!0,"presigned-expires":!0,range:!0};gD.prototype.matchHost=function(D){var F=(D||"").match(/([^\.]{1,63})\.(?:([^\.]{0,63})\.)?amazonaws\.com(\.cn)?$/),E=(F||[]).slice(1,3);if(E[1]==="es"||E[1]==="aoss")E=E.reverse();if(E[1]=="s3")E[0]="s3",E[1]="us-east-1";else for(var w=0;w<2;w++)if(/^s3-/.test(E[w])){E[1]=E[w].slice(3),E[0]="s3";break}return E};gD.prototype.isSingleRegion=function(){if(["s3","sdb"].indexOf(this.service)>=0&&this.region==="us-east-1")return!0;return["cloudfront","ls","route53","iam","importexport","sts"].indexOf(this.service)>=0};gD.prototype.createHost=function(){var D=this.isSingleRegion()?"":"."+this.region,F=this.service==="ses"?"email":this.service;return F+D+".amazonaws.com"};gD.prototype.prepareRequest=function(){this.parsePath();var D=this.request,F=D.headers,E;if(D.signQuery){if(this.parsedPath.query=E=this.parsedPath.query||{},this.credentials.sessionToken)E["X-Amz-Security-Token"]=this.credentials.sessionToken;if(this.service==="s3"&&!E["X-Amz-Expires"])E["X-Amz-Expires"]=86400;if(E["X-Amz-Date"])this.datetime=E["X-Amz-Date"];else E["X-Amz-Date"]=this.getDateTime();E["X-Amz-Algorithm"]="AWS4-HMAC-SHA256",E["X-Amz-Credential"]=this.credentials.accessKeyId+"/"+this.credentialString(),E["X-Amz-SignedHeaders"]=this.signedHeaders()}else{if(!D.doNotModifyHeaders&&!this.isCodeCommitGit){if(D.body&&!F["Content-Type"]&&!F["content-type"])F["Content-Type"]="application/x-www-form-urlencoded; charset=utf-8";if(D.body&&!F["Content-Length"]&&!F["content-length"])F["Content-Length"]=Buffer.byteLength(D.body);if(this.credentials.sessionToken&&!F["X-Amz-Security-Token"]&&!F["x-amz-security-token"])F["X-Amz-Security-Token"]=this.credentials.sessionToken;if(this.service==="s3"&&!F["X-Amz-Content-Sha256"]&&!F["x-amz-content-sha256"])F["X-Amz-Content-Sha256"]=FA(this.request.body||"","hex");if(F["X-Amz-Date"]||F["x-amz-date"])this.datetime=F["X-Amz-Date"]||F["x-amz-date"];else F["X-Amz-Date"]=this.getDateTime()}delete F.Authorization,delete F.authorization}};gD.prototype.sign=function(){if(!this.parsedPath)this.prepareRequest();if(this.request.signQuery)this.parsedPath.query["X-Amz-Signature"]=this.signature();else this.request.headers.Authorization=this.authHeader();return this.request.path=this.formatPath(),this.request};gD.prototype.getDateTime=function(){if(!this.datetime){var D=this.request.headers,F=new Date(D.Date||D.date||new Date);if(this.datetime=F.toISOString().replace(/[:\-]|\.\d{3}/g,""),this.isCodeCommitGit)this.datetime=this.datetime.slice(0,-1)}return this.datetime};gD.prototype.getDate=function(){return this.getDateTime().substr(0,8)};gD.prototype.authHeader=function(){return["AWS4-HMAC-SHA256 Credential="+this.credentials.accessKeyId+"/"+this.credentialString(),"SignedHeaders="+this.signedHeaders(),"Signature="+this.signature()].join(", ")};gD.prototype.signature=function(){var D=this.getDate(),F=[this.credentials.secretAccessKey,D,this.region,this.service].join(),E,w,$,C=lc.get(F);if(!C)E=NE("AWS4"+this.credentials.secretAccessKey,D),w=NE(E,this.region),$=NE(w,this.service),C=NE($,"aws4_request"),lc.set(F,C);return NE(C,this.stringToSign(),"hex")};gD.prototype.stringToSign=function(){return["AWS4-HMAC-SHA256",this.getDateTime(),this.credentialString(),FA(this.canonicalString(),"hex")].join("\n")};gD.prototype.canonicalString=function(){if(!this.parsedPath)this.prepareRequest();var D=this.parsedPath.path,F=this.parsedPath.query,E=this.request.headers,w="",$=this.service!=="s3",C=this.service==="s3"||this.request.doNotEncodePath,f=this.service==="s3",B=this.service==="s3",h;if(this.service==="s3"&&this.request.signQuery)h="UNSIGNED-PAYLOAD";else if(this.isCodeCommitGit)h="";else h=E["X-Amz-Content-Sha256"]||E["x-amz-content-sha256"]||FA(this.request.body||"","hex");if(F){var U=Object.keys(F).reduce(function(A,Y){if(!Y)return A;return A[d7(Y)]=!Array.isArray(F[Y])?F[Y]:B?F[Y][0]:F[Y],A},{}),I=[];Object.keys(U).sort().forEach(function(A){if(!Array.isArray(U[A]))I.push(A+"="+d7(U[A]));else U[A].map(d7).sort().forEach(function(Y){I.push(A+"="+Y)})}),w=I.join("&")}if(D!=="/"){if($)D=D.replace(/\/{2,}/g,"/");if(D=D.split("/").reduce(function(A,Y){if($&&Y==="..")A.pop();else if(!$||Y!=="."){if(C)Y=decodeURIComponent(Y.replace(/\+/g," "));A.push(d7(Y))}return A},[]).join("/"),D[0]!=="/")D="/"+D;if(f)D=D.replace(/%2F/g,"/")}return[this.request.method||"GET",D,w,this.canonicalHeaders()+"\n",this.signedHeaders(),h].join("\n")};gD.prototype.filterHeaders=function(){var D=this.request.headers,F=this.extraHeadersToInclude,E=this.extraHeadersToIgnore;this.filteredHeaders=Object.keys(D).map(function(w){return[w.toLowerCase(),D[w]]}).filter(function(w){return F[w[0]]||x4D[w[0]]==null&&!E[w[0]]}).sort(function(w,$){return w[0]<$[0]?-1:1})};gD.prototype.canonicalHeaders=function(){if(!this.filteredHeaders)this.filterHeaders();return this.filteredHeaders.map(function(D){return D[0]+":"+D[1].toString().trim().replace(/\s+/g," ")}).join("\n")};gD.prototype.signedHeaders=function(){if(!this.filteredHeaders)this.filterHeaders();return this.filteredHeaders.map(function(D){return D[0]}).join(";")};gD.prototype.credentialString=function(){return[this.getDate(),this.region,this.service,"aws4_request"].join("/")};gD.prototype.defaultCredentials=function(){var D=process.env;return{accessKeyId:D.AWS_ACCESS_KEY_ID||D.AWS_ACCESS_KEY,secretAccessKey:D.AWS_SECRET_ACCESS_KEY||D.AWS_SECRET_KEY,sessionToken:D.AWS_SESSION_TOKEN}};gD.prototype.parsePath=function(){var D=this.request.path||"/";if(/[^0-9A-Za-z;,/?:@&=+$\-_.!~*'()#%]/.test(D))D=encodeURI(decodeURI(D));var F=D.indexOf("?"),E=null;if(F>=0)E=pc.parse(D.slice(F+1)),D=D.slice(0,F);this.parsedPath={path:D,query:E}};gD.prototype.formatPath=function(){var D=this.parsedPath.path,F=this.parsedPath.query;if(!F)return D;if(F[""]!=null)delete F[""];return D+"?"+oc(pc.stringify(F))};ic.RequestSigner=gD;ic.sign=function(D,F){return new gD(D,F).sign()}});import jDD from"process";z6();T6();K6();t8();l0();var YF=L(_D(),1);var Fz=(D)=>({...D,eventStreamMarshaller:D.eventStreamSerdeProvider(D)});x6();AD();z2();y();var OK=L(PD(),1);W2();function fo(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}var jK=async(D,F,E)=>{return{operation:m0(F).operation,region:await sD(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},PK=(D)=>{const F=[];switch(D.operation){default:F.push(fo(D))}return F},yK=(D)=>{return{...OK.resolveAwsSdkSigV4Config(D)}};var kK=(D)=>{return{...D,useDualstackEndpoint:D.useDualstackEndpoint??!1,useFipsEndpoint:D.useFipsEndpoint??!1,defaultSigningName:"bedrock"}},U$={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var bK={name:"@aws-sdk/client-bedrock-runtime",description:"AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",version:"3.668.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-bedrock-runtime","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo bedrock-runtime"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.668.0","@aws-sdk/client-sts":"3.668.0","@aws-sdk/core":"3.667.0","@aws-sdk/credential-provider-node":"3.668.0","@aws-sdk/middleware-host-header":"3.667.0","@aws-sdk/middleware-logger":"3.667.0","@aws-sdk/middleware-recursion-detection":"3.667.0","@aws-sdk/middleware-user-agent":"3.668.0","@aws-sdk/region-config-resolver":"3.667.0","@aws-sdk/types":"3.667.0","@aws-sdk/util-endpoints":"3.667.0","@aws-sdk/util-user-agent-browser":"3.667.0","@aws-sdk/util-user-agent-node":"3.668.0","@smithy/config-resolver":"^3.0.9","@smithy/core":"^2.4.8","@smithy/eventstream-serde-browser":"^3.0.10","@smithy/eventstream-serde-config-resolver":"^3.0.7","@smithy/eventstream-serde-node":"^3.0.9","@smithy/fetch-http-handler":"^3.2.9","@smithy/hash-node":"^3.0.7","@smithy/invalid-dependency":"^3.0.7","@smithy/middleware-content-length":"^3.0.9","@smithy/middleware-endpoint":"^3.1.4","@smithy/middleware-retry":"^3.0.23","@smithy/middleware-serde":"^3.0.7","@smithy/middleware-stack":"^3.0.7","@smithy/node-config-provider":"^3.1.8","@smithy/node-http-handler":"^3.2.4","@smithy/protocol-http":"^4.1.4","@smithy/smithy-client":"^3.4.0","@smithy/types":"^3.5.0","@smithy/url-parser":"^3.0.7","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.23","@smithy/util-defaults-mode-node":"^3.0.23","@smithy/util-endpoints":"^2.1.3","@smithy/util-middleware":"^3.0.7","@smithy/util-retry":"^3.0.7","@smithy/util-stream":"^3.1.9","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-bedrock-runtime",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-bedrock-runtime"}};var SV=L(PD(),1);o6();l6();l0();var nR=L(Z9(),1),{__extends:eLD,__assign:DRD,__rest:FRD,__decorate:ERD,__param:wRD,__esDecorate:$RD,__runInitializers:fRD,__propKey:CRD,__setFunctionName:BRD,__metadata:hRD,__awaiter:lR,__generator:iR,__exportStar:URD,__createBinding:ARD,__values:pR,__read:IRD,__spread:MRD,__spreadArrays:GRD,__spreadArray:YRD,__await:ZRD,__asyncGenerator:WRD,__asyncDelegator:XRD,__asyncValues:JRD,__makeTemplateObject:zRD,__importStar:TRD,__importDefault:KRD,__classPrivateFieldGet:SRD,__classPrivateFieldSet:QRD,__classPrivateFieldIn:HRD,__addDisposableResource:LRD,__disposeResources:RRD}=nR.default;import{Buffer as aR}from"buffer";var oR=(D,F)=>{if(typeof D!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof D} (${D})`);return F?aR.from(D,F):aR.from(D)};var TB=(D)=>{const F=oR(D,"utf8");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function KB(D){if(D instanceof Uint8Array)return D;if(typeof D==="string")return pe(D);if(ArrayBuffer.isView(D))return new Uint8Array(D.buffer,D.byteOffset,D.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(D)}var pe=typeof Buffer!=="undefined"&&Buffer.from?function(D){return Buffer.from(D,"utf8")}:TB;function SB(D){if(typeof D==="string")return D.length===0;return D.byteLength===0}function QB(D){return new Uint8Array([(D&4278190080)>>24,(D&16711680)>>16,(D&65280)>>8,D&255])}function HB(D){if(!Uint32Array.from){var F=new Uint32Array(D.length),E=0;while(E<D.length)F[E]=D[E],E+=1;return F}return Uint32Array.from(D)}var ae=function(){function D(){this.crc32=new U6}return D.prototype.update=function(F){if(SB(F))return;this.crc32.update(KB(F))},D.prototype.digest=function(){return lR(this,void 0,void 0,function(){return iR(this,function(F){return[2,QB(this.crc32.digest())]})})},D.prototype.reset=function(){this.crc32=new U6},D}();var U6=function(){function D(){this.checksum=4294967295}return D.prototype.update=function(F){var E,w;try{for(var $=pR(F),C=$.next();!C.done;C=$.next()){var f=C.value;this.checksum=this.checksum>>>8^te[(this.checksum^f)&255]}}catch(B){E={error:B}}finally{try{if(C&&!C.done&&(w=$.return))w.call($)}finally{if(E)throw E.error}}return this},D.prototype.digest=function(){return(this.checksum^4294967295)>>>0},D}();var oe=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117],te=HB(oe);var P8=L(L6(),1);var eR=L(L6(),1);function tR(D){for(let F=0;F<8;F++)D[F]^=255;for(let F=7;F>-1;F--)if(D[F]++,D[F]!==0)break}class GF{constructor(D){if(this.bytes=D,D.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(D){if(D>9223372036854776000||D<-9223372036854776000)throw new Error(`${D} is too large (or, if negative, too small) to represent as an Int64`);const F=new Uint8Array(8);for(let E=7,w=Math.abs(Math.round(D));E>-1&&w>0;E--,w/=256)F[E]=w;if(D<0)tR(F);return new GF(F)}valueOf(){const D=this.bytes.slice(0),F=D[0]&128;if(F)tR(D);return parseInt(eR.toHex(D),16)*(F?-1:1)}toString(){return String(this.valueOf())}}class LB{constructor(D,F){this.toUtf8=D,this.fromUtf8=F}format(D){const F=[];for(let $ of Object.keys(D)){const C=this.fromUtf8($);F.push(Uint8Array.from([C.byteLength]),C,this.formatHeaderValue(D[$]))}const E=new Uint8Array(F.reduce(($,C)=>$+C.byteLength,0));let w=0;for(let $ of F)E.set($,w),w+=$.byteLength;return E}formatHeaderValue(D){switch(D.type){case"boolean":return Uint8Array.from([D.value?0:1]);case"byte":return Uint8Array.from([2,D.value]);case"short":const F=new DataView(new ArrayBuffer(3));return F.setUint8(0,3),F.setInt16(1,D.value,!1),new Uint8Array(F.buffer);case"integer":const E=new DataView(new ArrayBuffer(5));return E.setUint8(0,4),E.setInt32(1,D.value,!1),new Uint8Array(E.buffer);case"long":const w=new Uint8Array(9);return w[0]=5,w.set(D.value.bytes,1),w;case"binary":const $=new DataView(new ArrayBuffer(3+D.value.byteLength));$.setUint8(0,6),$.setUint16(1,D.value.byteLength,!1);const C=new Uint8Array($.buffer);return C.set(D.value,3),C;case"string":const f=this.fromUtf8(D.value),B=new DataView(new ArrayBuffer(3+f.byteLength));B.setUint8(0,7),B.setUint16(1,f.byteLength,!1);const h=new Uint8Array(B.buffer);return h.set(f,3),h;case"timestamp":const U=new Uint8Array(9);return U[0]=8,U.set(GF.fromNumber(D.value.valueOf()).bytes,1),U;case"uuid":if(!BDD.test(D.value))throw new Error(`Invalid UUID received: ${D.value}`);const I=new Uint8Array(17);return I[0]=9,I.set(P8.fromHex(D.value.replace(/\-/g,"")),1),I}}parse(D){const F={};let E=0;while(E<D.byteLength){const w=D.getUint8(E++),$=this.toUtf8(new Uint8Array(D.buffer,D.byteOffset+E,w));switch(E+=w,D.getUint8(E++)){case 0:F[$]={type:FV,value:!0};break;case 1:F[$]={type:FV,value:!1};break;case 2:F[$]={type:ee,value:D.getInt8(E++)};break;case 3:F[$]={type:DDD,value:D.getInt16(E,!1)},E+=2;break;case 4:F[$]={type:FDD,value:D.getInt32(E,!1)},E+=4;break;case 5:F[$]={type:EDD,value:new GF(new Uint8Array(D.buffer,D.byteOffset+E,8))},E+=8;break;case 6:const C=D.getUint16(E,!1);E+=2,F[$]={type:wDD,value:new Uint8Array(D.buffer,D.byteOffset+E,C)},E+=C;break;case 7:const f=D.getUint16(E,!1);E+=2,F[$]={type:$DD,value:this.toUtf8(new Uint8Array(D.buffer,D.byteOffset+E,f))},E+=f;break;case 8:F[$]={type:fDD,value:new Date(new GF(new Uint8Array(D.buffer,D.byteOffset+E,8)).valueOf())},E+=8;break;case 9:const B=new Uint8Array(D.buffer,D.byteOffset+E,16);E+=16,F[$]={type:CDD,value:`${P8.toHex(B.subarray(0,4))}-${P8.toHex(B.subarray(4,6))}-${P8.toHex(B.subarray(6,8))}-${P8.toHex(B.subarray(8,10))}-${P8.toHex(B.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return F}}var DV;(function(D){D[D.boolTrue=0]="boolTrue",D[D.boolFalse=1]="boolFalse",D[D.byte=2]="byte",D[D.short=3]="short",D[D.integer=4]="integer",D[D.long=5]="long",D[D.byteArray=6]="byteArray",D[D.string=7]="string",D[D.timestamp=8]="timestamp",D[D.uuid=9]="uuid"})(DV||(DV={}));var FV="boolean",ee="byte",DDD="short",FDD="integer",EDD="long",wDD="binary",$DD="string",fDD="timestamp",CDD="uuid",BDD=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function wV({byteLength:D,byteOffset:F,buffer:E}){if(D<hDD)throw new Error("Provided message too short to accommodate event stream message overhead");const w=new DataView(E,F,D),$=w.getUint32(0,!1);if(D!==$)throw new Error("Reported message length does not match received message length");const C=w.getUint32(EV,!1),f=w.getUint32(y8,!1),B=w.getUint32(D-A6,!1),h=new U6().update(new Uint8Array(E,F,y8));if(f!==h.digest())throw new Error(`The prelude checksum specified in the message (${f}) does not match the calculated CRC32 checksum (${h.digest()})`);if(h.update(new Uint8Array(E,F+y8,D-(y8+A6))),B!==h.digest())throw new Error(`The message checksum (${h.digest()}) did not match the expected value of ${B}`);return{headers:new DataView(E,F+y8+A6,C),body:new Uint8Array(E,F+y8+A6+C,$-C-(y8+A6+A6))}}var EV=4,y8=EV*2,A6=4,hDD=y8+A6*2;class RB{constructor(D,F){this.headerMarshaller=new LB(D,F),this.messageBuffer=[],this.isEndOfStream=!1}feed(D){this.messageBuffer.push(this.decode(D))}endOfStream(){this.isEndOfStream=!0}getMessage(){const D=this.messageBuffer.pop(),F=this.isEndOfStream;return{getMessage(){return D},isEndOfStream(){return F}}}getAvailableMessages(){const D=this.messageBuffer;this.messageBuffer=[];const F=this.isEndOfStream;return{getMessages(){return D},isEndOfStream(){return F}}}encode({headers:D,body:F}){const E=this.headerMarshaller.format(D),w=E.byteLength+F.byteLength+16,$=new Uint8Array(w),C=new DataView($.buffer,$.byteOffset,$.byteLength),f=new U6;return C.setUint32(0,w,!1),C.setUint32(4,E.byteLength,!1),C.setUint32(8,f.update($.subarray(0,8)).digest(),!1),$.set(E,12),$.set(F,E.byteLength+12),C.setUint32(w-4,f.update($.subarray(8,w-4)).digest(),!1),$}decode(D){const{headers:F,body:E}=wV(D);return{headers:this.headerMarshaller.parse(F),body:E}}formatHeaders(D){return this.headerMarshaller.format(D)}}class VB{constructor(D){this.options=D}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let D of this.options.inputStream)yield this.options.decoder.decode(D)}}class NB{constructor(D){this.options=D}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let D of this.options.messageStream)yield this.options.encoder.encode(D);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class qB{constructor(D){this.options=D}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let D of this.options.messageStream){const F=await this.options.deserializer(D);if(F===void 0)continue;yield F}}}class OB{constructor(D){this.options=D}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let D of this.options.inputStream)yield this.options.serializer(D)}}function $V(D){let F=0,E=0,w=null,$=null;const C=(B)=>{if(typeof B!=="number")throw new Error("Attempted to allocate an event message where size was not a number: "+B);F=B,E=4,w=new Uint8Array(B),new DataView(w.buffer).setUint32(0,B,!1)},f=async function*(){const B=D[Symbol.asyncIterator]();while(!0){const{value:h,done:U}=await B.next();if(U){if(!F)return;else if(F===E)yield w;else throw new Error("Truncated event message received.");return}const I=h.length;let A=0;while(A<I){if(!w){const M=I-A;if(!$)$=new Uint8Array(4);const Z=Math.min(4-E,M);if($.set(h.slice(A,A+Z),E),E+=Z,A+=Z,E<4)break;C(new DataView($.buffer).getUint32(0,!1)),$=null}const Y=Math.min(F-E,I-A);if(w.set(h.slice(A,A+Y),E),E+=Y,A+=Y,F&&F===E)yield w,w=null,F=0,E=0}}};return{[Symbol.asyncIterator]:f}}function fV(D,F){return async function(E){const{value:w}=E.headers[":message-type"];if(w==="error"){const $=new Error(E.headers[":error-message"].value||"UnknownError");throw $.name=E.headers[":error-code"].value,$}else if(w==="exception"){const $=E.headers[":exception-type"].value,C={[$]:E},f=await D(C);if(f.$unknown){const B=new Error(F(E.body));throw B.name=$,B}throw f[$]}else if(w==="event"){const $={[E.headers[":event-type"].value]:E},C=await D($);if(C.$unknown)return;return C}else throw Error(`Unrecognizable event type: ${E.headers[":event-type"].value}`)}}class t${constructor({utf8Encoder:D,utf8Decoder:F}){this.eventStreamCodec=new RB(D,F),this.utfEncoder=D}deserialize(D,F){const E=$V(D);return new qB({messageStream:new VB({inputStream:E,decoder:this.eventStreamCodec}),deserializer:fV(F,this.utfEncoder)})}serialize(D,F){return new NB({messageStream:new OB({inputStream:D,serializer:F}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as UDD}from"stream";async function*CV(D){let F=!1,E=!1;const w=new Array;D.on("error",($)=>{if(!F)F=!0;if($)throw $}),D.on("data",($)=>{w.push($)}),D.on("end",()=>{F=!0});while(!E){const $=await new Promise((C)=>setTimeout(()=>C(w.shift()),0));if($)yield $;E=F&&w.length===0}}class jB{constructor({utf8Encoder:D,utf8Decoder:F}){this.universalMarshaller=new t$({utf8Decoder:F,utf8Encoder:D})}deserialize(D,F){const E=typeof D[Symbol.asyncIterator]==="function"?D:CV(D);return this.universalMarshaller.deserialize(E,F)}serialize(D,F){return UDD.from(this.universalMarshaller.serialize(D,F))}}var BV=(D)=>new jB(D);i6();z2();m2();Z8();p6();j0();var TV=L(PD(),1);y();G8();O1();o2();p8();Y2();var hV={["required"]:!1,type:"String"},UV={["required"]:!0,default:!1,type:"Boolean"},AV={["ref"]:"Endpoint"},WV={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},XV={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},I1={},IV={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},MV={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsDualStack"]}]},GV=[WV],YV=[XV],ZV=[{["ref"]:"Region"}],ADD={version:"1.0",parameters:{Region:hV,UseDualStack:UV,UseFIPS:UV,Endpoint:hV},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[AV]}],rules:[{conditions:GV,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{rules:[{conditions:YV,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:AV,properties:I1,headers:I1},type:"endpoint"}],type:"tree"}],type:"tree"},{rules:[{conditions:[{["fn"]:"isSet",["argv"]:ZV}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:ZV,assign:"PartitionResult"}],rules:[{conditions:[WV,XV],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,IV]},MV],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:I1,headers:I1},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:GV,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[IV,!0]}],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime-fips.{Region}.{PartitionResult#dnsSuffix}",properties:I1,headers:I1},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:YV,rules:[{conditions:[MV],rules:[{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:I1,headers:I1},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{rules:[{endpoint:{url:"https://bedrock-runtime.{Region}.{PartitionResult#dnsSuffix}",properties:I1,headers:I1},type:"endpoint"}],type:"tree"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}],type:"tree"}]},JV=ADD;var IDD=new M2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),zV=(D,F={})=>{return IDD.get(D,()=>G2(JV,{endpointParams:D,logger:F.logger}))};C0.aws=Z2;var KV=(D)=>{return{apiVersion:"2023-09-30",base64Decoder:D?.base64Decoder??T0,base64Encoder:D?.base64Encoder??S0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??zV,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??PK,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new TV.AwsSdkSigV4Signer}],logger:D?.logger??new y0,serviceId:D?.serviceId??"Bedrock Runtime",urlParser:D?.urlParser??D0,utf8Decoder:D?.utf8Decoder??F0,utf8Encoder:D?.utf8Encoder??K0}};y();a6();y();var QV=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=KV(D);return SV.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,credentialDefaultProvider:D?.credentialDefaultProvider??K2,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:bK.version}),eventStreamSerdeProvider:D?.eventStreamSerdeProvider??BV,maxAttempts:D?.maxAttempts??i(i2),region:D?.region??i(n0,u2),requestHandler:U0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...a2,default:async()=>(await E()).retryMode||t0}),sha256:D?.sha256??T2.bind(null,"sha256"),streamCollector:D?.streamCollector??e0,useDualstackEndpoint:D?.useDualstackEndpoint??i(_2),useFipsEndpoint:D?.useFipsEndpoint??i(s2),userAgentAppId:D?.userAgentAppId??i(f1)}};t6();vD();y();var HV=(D)=>{const F=D.httpAuthSchemes;let{httpAuthSchemeProvider:E,credentials:w}=D;return{setHttpAuthScheme($){const C=F.findIndex((f)=>f.schemeId===$.schemeId);if(C===-1)F.push($);else F.splice(C,1,$)},httpAuthSchemes(){return F},setHttpAuthSchemeProvider($){E=$},httpAuthSchemeProvider(){return E},setCredentials($){w=$},credentials(){return w}}},LV=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var e$=(D)=>D,RV=(D,F)=>{const E={...e$(h1(D)),...e$(F1(D)),...e$(j2(D)),...e$(HV(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...P2(E),...LV(E)}};class PB extends P0{constructor(...[D]){const F=QV(D||{}),E=kK(F),w=g2(E),$=p2(w),C=d2($),f=y2(C),B=n2(f),h=Fz(B),U=yK(h),I=RV(U,D?.extensions||[]);super(I);this.config=I,this.middlewareStack.use(r2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(v2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(x2(this.config)),this.middlewareStack.use(YF.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:jK,identityProviderConfigProvider:async(A)=>new YF.DefaultIdentityProviderConfig({"aws.auth#sigv4":A.credentials})})),this.middlewareStack.use(YF.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}var b0=L(PD(),1),_B=L(_D(),1);y();y();class f0 extends D2{constructor(D){super(D);Object.setPrototypeOf(this,f0.prototype)}}y();class D4 extends f0{constructor(D){super({name:"AccessDeniedException",$fault:"client",...D});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,D4.prototype)}}var VV;(function(D){D.visit=(F,E)=>{if(F.text!==void 0)return E.text(F.text);return E._(F.$unknown[0],F.$unknown[1])}})(VV||(VV={}));class F4 extends f0{constructor(D){super({name:"InternalServerException",$fault:"server",...D});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,F4.prototype)}}class E4 extends f0{constructor(D){super({name:"ResourceNotFoundException",$fault:"client",...D});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,E4.prototype)}}class w4 extends f0{constructor(D){super({name:"ServiceQuotaExceededException",$fault:"client",...D});this.name="ServiceQuotaExceededException",this.$fault="client",Object.setPrototypeOf(this,w4.prototype)}}class $4 extends f0{constructor(D){super({name:"ThrottlingException",$fault:"client",...D});this.name="ThrottlingException",this.$fault="client",Object.setPrototypeOf(this,$4.prototype)}}class f4 extends f0{constructor(D){super({name:"ValidationException",$fault:"client",...D});this.name="ValidationException",this.$fault="client",Object.setPrototypeOf(this,f4.prototype)}}var yB;(function(D){D.visit=(F,E)=>{if(F.bytes!==void 0)return E.bytes(F.bytes);return E._(F.$unknown[0],F.$unknown[1])}})(yB||(yB={}));var NV;(function(D){D.visit=(F,E)=>{if(F.text!==void 0)return E.text(F.text);return E._(F.$unknown[0],F.$unknown[1])}})(NV||(NV={}));var kB;(function(D){D.visit=(F,E)=>{if(F.bytes!==void 0)return E.bytes(F.bytes);return E._(F.$unknown[0],F.$unknown[1])}})(kB||(kB={}));var bB;(function(D){D.visit=(F,E)=>{if(F.json!==void 0)return E.json(F.json);if(F.text!==void 0)return E.text(F.text);if(F.image!==void 0)return E.image(F.image);if(F.document!==void 0)return E.document(F.document);return E._(F.$unknown[0],F.$unknown[1])}})(bB||(bB={}));var xB;(function(D){D.visit=(F,E)=>{if(F.text!==void 0)return E.text(F.text);if(F.image!==void 0)return E.image(F.image);if(F.document!==void 0)return E.document(F.document);if(F.toolUse!==void 0)return E.toolUse(F.toolUse);if(F.toolResult!==void 0)return E.toolResult(F.toolResult);if(F.guardContent!==void 0)return E.guardContent(F.guardContent);return E._(F.$unknown[0],F.$unknown[1])}})(xB||(xB={}));var qV;(function(D){D.visit=(F,E)=>{if(F.text!==void 0)return E.text(F.text);if(F.guardContent!==void 0)return E.guardContent(F.guardContent);return E._(F.$unknown[0],F.$unknown[1])}})(qV||(qV={}));var OV;(function(D){D.visit=(F,E)=>{if(F.auto!==void 0)return E.auto(F.auto);if(F.any!==void 0)return E.any(F.any);if(F.tool!==void 0)return E.tool(F.tool);return E._(F.$unknown[0],F.$unknown[1])}})(OV||(OV={}));var cB;(function(D){D.visit=(F,E)=>{if(F.json!==void 0)return E.json(F.json);return E._(F.$unknown[0],F.$unknown[1])}})(cB||(cB={}));var gB;(function(D){D.visit=(F,E)=>{if(F.toolSpec!==void 0)return E.toolSpec(F.toolSpec);return E._(F.$unknown[0],F.$unknown[1])}})(gB||(gB={}));var jV;(function(D){D.visit=(F,E)=>{if(F.message!==void 0)return E.message(F.message);return E._(F.$unknown[0],F.$unknown[1])}})(jV||(jV={}));class C4 extends f0{constructor(D){super({name:"ModelErrorException",$fault:"client",...D});this.name="ModelErrorException",this.$fault="client",Object.setPrototypeOf(this,C4.prototype),this.originalStatusCode=D.originalStatusCode,this.resourceName=D.resourceName}}class B4 extends f0{constructor(D){super({name:"ModelNotReadyException",$fault:"client",...D});this.name="ModelNotReadyException",this.$fault="client",this.$retryable={},Object.setPrototypeOf(this,B4.prototype)}}class h4 extends f0{constructor(D){super({name:"ModelTimeoutException",$fault:"client",...D});this.name="ModelTimeoutException",this.$fault="client",Object.setPrototypeOf(this,h4.prototype)}}class U4 extends f0{constructor(D){super({name:"ServiceUnavailableException",$fault:"server",...D});this.name="ServiceUnavailableException",this.$fault="server",Object.setPrototypeOf(this,U4.prototype)}}var PV;(function(D){D.visit=(F,E)=>{if(F.text!==void 0)return E.text(F.text);if(F.toolUse!==void 0)return E.toolUse(F.toolUse);return E._(F.$unknown[0],F.$unknown[1])}})(PV||(PV={}));var yV;(function(D){D.visit=(F,E)=>{if(F.toolUse!==void 0)return E.toolUse(F.toolUse);return E._(F.$unknown[0],F.$unknown[1])}})(yV||(yV={}));class A4 extends f0{constructor(D){super({name:"ModelStreamErrorException",$fault:"client",...D});this.name="ModelStreamErrorException",this.$fault="client",Object.setPrototypeOf(this,A4.prototype),this.originalStatusCode=D.originalStatusCode,this.originalMessage=D.originalMessage}}var kV;(function(D){D.visit=(F,E)=>{if(F.messageStart!==void 0)return E.messageStart(F.messageStart);if(F.contentBlockStart!==void 0)return E.contentBlockStart(F.contentBlockStart);if(F.contentBlockDelta!==void 0)return E.contentBlockDelta(F.contentBlockDelta);if(F.contentBlockStop!==void 0)return E.contentBlockStop(F.contentBlockStop);if(F.messageStop!==void 0)return E.messageStop(F.messageStop);if(F.metadata!==void 0)return E.metadata(F.metadata);if(F.internalServerException!==void 0)return E.internalServerException(F.internalServerException);if(F.modelStreamErrorException!==void 0)return E.modelStreamErrorException(F.modelStreamErrorException);if(F.validationException!==void 0)return E.validationException(F.validationException);if(F.throttlingException!==void 0)return E.throttlingException(F.throttlingException);if(F.serviceUnavailableException!==void 0)return E.serviceUnavailableException(F.serviceUnavailableException);return E._(F.$unknown[0],F.$unknown[1])}})(kV||(kV={}));var bV;(function(D){D.visit=(F,E)=>{if(F.chunk!==void 0)return E.chunk(F.chunk);if(F.internalServerException!==void 0)return E.internalServerException(F.internalServerException);if(F.modelStreamErrorException!==void 0)return E.modelStreamErrorException(F.modelStreamErrorException);if(F.validationException!==void 0)return E.validationException(F.validationException);if(F.throttlingException!==void 0)return E.throttlingException(F.throttlingException);if(F.modelTimeoutException!==void 0)return E.modelTimeoutException(F.modelTimeoutException);if(F.serviceUnavailableException!==void 0)return E.serviceUnavailableException(F.serviceUnavailableException);return E._(F.$unknown[0],F.$unknown[1])}})(bV||(bV={}));var xV=(D)=>({...D,...D.body&&{body:wD}}),cV=(D)=>({...D,...D.body&&{body:wD}}),gV=(D)=>({...D,...D.body&&{body:wD}});var rV=(D)=>({...D,...D.body&&{body:"STREAMING_CONTENT"}});var _V=async(D,F)=>{const E=_B.requestBuilder(D,F),w=k({},W8,{[sB]:D[I4]||"application/octet-stream",[rB]:D[rB],[EN]:D[eV],[DN]:D[oV],[FN]:D[tV]});E.bp("/model/{modelId}/invoke"),E.p("modelId",()=>D.modelId,"{modelId}",!1);let $;if(D.body!==void 0)$=D.body;return E.m("POST").h(w).b($),E.build()},sV=async(D,F)=>{const E=_B.requestBuilder(D,F),w=k({},W8,{[sB]:D[I4]||"application/octet-stream",[qDD]:D[rB],[EN]:D[eV],[DN]:D[oV],[FN]:D[tV]});E.bp("/model/{modelId}/invoke-with-response-stream"),E.p("modelId",()=>D.modelId,"{modelId}",!1);let $;if(D.body!==void 0)$=D.body;return E.m("POST").h(w).b($),E.build()};var uV=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return vV(D,F);const E=k({$metadata:x0(D),[I4]:[,D.headers[sB]]}),w=await $6(D.body,F);return E.body=w,E},dV=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return vV(D,F);const E=k({$metadata:x0(D),[I4]:[,D.headers[ODD]]}),w=D.body;return E.body=TDD(w,F),E},vV=async(D,F)=>{const E={...D,body:await b0.parseJsonErrorBody(D.body,F)},w=b0.loadRestJsonErrorCode(D,E.body);switch(w){case"AccessDeniedException":case"com.amazonaws.bedrockruntime#AccessDeniedException":throw await ZDD(E,F);case"InternalServerException":case"com.amazonaws.bedrockruntime#InternalServerException":throw await mV(E,F);case"ResourceNotFoundException":case"com.amazonaws.bedrockruntime#ResourceNotFoundException":throw await JDD(E,F);case"ServiceQuotaExceededException":case"com.amazonaws.bedrockruntime#ServiceQuotaExceededException":throw await zDD(E,F);case"ThrottlingException":case"com.amazonaws.bedrockruntime#ThrottlingException":throw await pV(E,F);case"ValidationException":case"com.amazonaws.bedrockruntime#ValidationException":throw await aV(E,F);case"ModelErrorException":case"com.amazonaws.bedrockruntime#ModelErrorException":throw await WDD(E,F);case"ModelNotReadyException":case"com.amazonaws.bedrockruntime#ModelNotReadyException":throw await XDD(E,F);case"ModelTimeoutException":case"com.amazonaws.bedrockruntime#ModelTimeoutException":throw await lV(E,F);case"ServiceUnavailableException":case"com.amazonaws.bedrockruntime#ServiceUnavailableException":throw await iV(E,F);case"ModelStreamErrorException":case"com.amazonaws.bedrockruntime#ModelStreamErrorException":throw await nV(E,F);default:const $=E.body;return YDD({output:D,parsedBody:$,errorCode:w})}},YDD=t2(f0),ZDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new D4({$metadata:x0(D),...E});return u(C,D.body)},mV=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new F4({$metadata:x0(D),...E});return u(C,D.body)},WDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S,originalStatusCode:J2,resourceName:S});Object.assign(E,$);const C=new C4({$metadata:x0(D),...E});return u(C,D.body)},XDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new B4({$metadata:x0(D),...E});return u(C,D.body)},nV=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S,originalMessage:S,originalStatusCode:J2});Object.assign(E,$);const C=new A4({$metadata:x0(D),...E});return u(C,D.body)},lV=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new h4({$metadata:x0(D),...E});return u(C,D.body)},JDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new E4({$metadata:x0(D),...E});return u(C,D.body)},zDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new w4({$metadata:x0(D),...E});return u(C,D.body)},iV=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new U4({$metadata:x0(D),...E});return u(C,D.body)},pV=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new $4({$metadata:x0(D),...E});return u(C,D.body)},aV=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new f4({$metadata:x0(D),...E});return u(C,D.body)};var TDD=(D,F)=>{return F.eventStreamMarshaller.deserialize(D,async(E)=>{if(E.chunk!=null)return{chunk:await HDD(E.chunk,F)};if(E.internalServerException!=null)return{internalServerException:await KDD(E.internalServerException,F)};if(E.modelStreamErrorException!=null)return{modelStreamErrorException:await SDD(E.modelStreamErrorException,F)};if(E.validationException!=null)return{validationException:await VDD(E.validationException,F)};if(E.throttlingException!=null)return{throttlingException:await RDD(E.throttlingException,F)};if(E.modelTimeoutException!=null)return{modelTimeoutException:await QDD(E.modelTimeoutException,F)};if(E.serviceUnavailableException!=null)return{serviceUnavailableException:await LDD(E.serviceUnavailableException,F)};return{$unknown:D}})};var KDD=async(D,F)=>{const E={...D,body:await b0.parseJsonBody(D.body,F)};return mV(E,F)};var SDD=async(D,F)=>{const E={...D,body:await b0.parseJsonBody(D.body,F)};return nV(E,F)},QDD=async(D,F)=>{const E={...D,body:await b0.parseJsonBody(D.body,F)};return lV(E,F)},HDD=async(D,F)=>{const E={},w=await b0.parseJsonBody(D.body,F);return Object.assign(E,NDD(w,F)),E},LDD=async(D,F)=>{const E={...D,body:await b0.parseJsonBody(D.body,F)};return iV(E,F)},RDD=async(D,F)=>{const E={...D,body:await b0.parseJsonBody(D.body,F)};return pV(E,F)},VDD=async(D,F)=>{const E={...D,body:await b0.parseJsonBody(D.body,F)};return aV(E,F)};var NDD=(D,F)=>{return c(D,{bytes:F.base64Decoder})};var x0=(D)=>({httpStatusCode:D.statusCode,requestId:D.headers["x-amzn-requestid"]??D.headers["x-amzn-request-id"]??D.headers["x-amz-request-id"],extendedRequestId:D.headers["x-amz-id-2"],cfId:D.headers["x-amz-cf-id"]});var rB="accept",I4="contentType",sB="content-type",oV="guardrailIdentifier",tV="guardrailVersion",eV="trace",qDD="x-amzn-bedrock-accept",ODD="x-amzn-bedrock-content-type",DN="x-amzn-bedrock-guardrailidentifier",FN="x-amzn-bedrock-guardrailversion",EN="x-amzn-bedrock-trace";AD();LD();y();class ZF extends l.classBuilder().ep(U$).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModel",{}).n("BedrockRuntimeClient","InvokeModelCommand").f(xV,cV).ser(_V).de(uV).build(){}AD();LD();y();class uB extends l.classBuilder().ep(U$).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModelWithResponseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","InvokeModelWithResponseStreamCommand").f(gV,rV).ser(sV).de(dV).build(){}async function XqD(D){WF.debug(D);const F=new ZF(D),E=await o3.send(F);return WF.debug("Successfully invoke model"),WF.debug(E),E}async function JqD(D){WF.debug(D);const F=new uB(D),E=await o3.send(F);return WF.debug("Successfully invoke model with response stream"),WF.debug(E),E}var o3=new PB({region:jDD.env.REGION||"us-east-1"}),WF=console;async function KqD(D,F={}){const{maxTokenCount:E=512,temperature:w=0,topP:$=0.9}=F,C=new ZF({modelId:"amazon.titan-text-express-v1",contentType:"application/json",accept:"*/*",body:JSON.stringify({inputText:`Summarize the following text: ${D}`,textGenerationConfig:{maxTokenCount:E,stopSequences:[],temperature:w,topP:$}})});try{const f=await o3.send(C);return JSON.parse(new TextDecoder().decode(f.body)).results[0].outputText}catch(f){throw console.error("Error summarizing text:",f),f}}async function SqD(D,F={}){const{maxTokenCount:E=512,temperature:w=0,topP:$=0.9}=F,C=new ZF({modelId:"amazon.titan-text-express-v1",contentType:"application/json",accept:"*/*",body:JSON.stringify({inputText:D,textGenerationConfig:{maxTokenCount:E,stopSequences:[],temperature:w,topP:$}})});try{const f=await o3.send(C);return JSON.parse(new TextDecoder().decode(f.body)).results[0].outputText}catch(f){throw console.error("Error asking question:",f),f}}import iDD from"process";z6();T6();K6();t8();l0();var JF=L(_D(),1);x6();AD();z2();y();var wN=L(PD(),1);W2();function PDD(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}var $N=async(D,F,E)=>{return{operation:m0(F).operation,region:await sD(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},fN=(D)=>{const F=[];switch(D.operation){default:F.push(PDD(D))}return F},CN=(D)=>{return{...wN.resolveAwsSdkSigV4Config(D)}};var BN=(D)=>{return{...D,useDualstackEndpoint:D.useDualstackEndpoint??!1,useFipsEndpoint:D.useFipsEndpoint??!1,defaultSigningName:"bedrock"}},XF={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var hN={name:"@aws-sdk/client-bedrock",description:"AWS SDK for JavaScript Bedrock Client for Node.js, Browser and React Native",version:"3.668.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-bedrock","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo bedrock"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.668.0","@aws-sdk/client-sts":"3.668.0","@aws-sdk/core":"3.667.0","@aws-sdk/credential-provider-node":"3.668.0","@aws-sdk/middleware-host-header":"3.667.0","@aws-sdk/middleware-logger":"3.667.0","@aws-sdk/middleware-recursion-detection":"3.667.0","@aws-sdk/middleware-user-agent":"3.668.0","@aws-sdk/region-config-resolver":"3.667.0","@aws-sdk/types":"3.667.0","@aws-sdk/util-endpoints":"3.667.0","@aws-sdk/util-user-agent-browser":"3.667.0","@aws-sdk/util-user-agent-node":"3.668.0","@smithy/config-resolver":"^3.0.9","@smithy/core":"^2.4.8","@smithy/fetch-http-handler":"^3.2.9","@smithy/hash-node":"^3.0.7","@smithy/invalid-dependency":"^3.0.7","@smithy/middleware-content-length":"^3.0.9","@smithy/middleware-endpoint":"^3.1.4","@smithy/middleware-retry":"^3.0.23","@smithy/middleware-serde":"^3.0.7","@smithy/middleware-stack":"^3.0.7","@smithy/node-config-provider":"^3.1.8","@smithy/node-http-handler":"^3.2.4","@smithy/protocol-http":"^4.1.4","@smithy/smithy-client":"^3.4.0","@smithy/types":"^3.5.0","@smithy/url-parser":"^3.0.7","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.23","@smithy/util-defaults-mode-node":"^3.0.23","@smithy/util-endpoints":"^2.1.3","@smithy/util-middleware":"^3.0.7","@smithy/util-retry":"^3.0.7","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2",uuid:"^9.0.1"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96","@types/uuid":"^9.0.4",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-bedrock",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-bedrock"}};var QN=L(PD(),1);o6();l6();l0();i6();z2();m2();Z8();p6();j0();var KN=L(PD(),1);y();G8();O1();o2();p8();Y2();var UN={["required"]:!1,type:"String"},AN={["required"]:!0,default:!1,type:"Boolean"},IN={["ref"]:"Endpoint"},XN={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},JN={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},M1={},MN={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},GN={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsDualStack"]}]},YN=[XN],ZN=[JN],WN=[{["ref"]:"Region"}],kDD={version:"1.0",parameters:{Region:UN,UseDualStack:AN,UseFIPS:AN,Endpoint:UN},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[IN]}],rules:[{conditions:YN,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{rules:[{conditions:ZN,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:IN,properties:M1,headers:M1},type:"endpoint"}],type:"tree"}],type:"tree"},{rules:[{conditions:[{["fn"]:"isSet",["argv"]:WN}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:WN,assign:"PartitionResult"}],rules:[{conditions:[XN,JN],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,MN]},GN],rules:[{rules:[{endpoint:{url:"https://bedrock-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:M1,headers:M1},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:YN,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[MN,!0]}],rules:[{rules:[{endpoint:{url:"https://bedrock-fips.{Region}.{PartitionResult#dnsSuffix}",properties:M1,headers:M1},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:ZN,rules:[{conditions:[GN],rules:[{rules:[{endpoint:{url:"https://bedrock.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:M1,headers:M1},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{rules:[{endpoint:{url:"https://bedrock.{Region}.{PartitionResult#dnsSuffix}",properties:M1,headers:M1},type:"endpoint"}],type:"tree"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}],type:"tree"}]},zN=kDD;var bDD=new M2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),TN=(D,F={})=>{return bDD.get(D,()=>G2(zN,{endpointParams:D,logger:F.logger}))};C0.aws=Z2;var SN=(D)=>{return{apiVersion:"2023-04-20",base64Decoder:D?.base64Decoder??T0,base64Encoder:D?.base64Encoder??S0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??TN,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??fN,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new KN.AwsSdkSigV4Signer}],logger:D?.logger??new y0,serviceId:D?.serviceId??"Bedrock",urlParser:D?.urlParser??D0,utf8Decoder:D?.utf8Decoder??F0,utf8Encoder:D?.utf8Encoder??K0}};y();a6();y();var HN=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=SN(D);return QN.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,credentialDefaultProvider:D?.credentialDefaultProvider??K2,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:hN.version}),maxAttempts:D?.maxAttempts??i(i2),region:D?.region??i(n0,u2),requestHandler:U0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...a2,default:async()=>(await E()).retryMode||t0}),sha256:D?.sha256??T2.bind(null,"sha256"),streamCollector:D?.streamCollector??e0,useDualstackEndpoint:D?.useDualstackEndpoint??i(_2),useFipsEndpoint:D?.useFipsEndpoint??i(s2),userAgentAppId:D?.userAgentAppId??i(f1)}};t6();vD();y();var LN=(D)=>{const F=D.httpAuthSchemes;let{httpAuthSchemeProvider:E,credentials:w}=D;return{setHttpAuthScheme($){const C=F.findIndex((f)=>f.schemeId===$.schemeId);if(C===-1)F.push($);else F.splice(C,1,$)},httpAuthSchemes(){return F},setHttpAuthSchemeProvider($){E=$},httpAuthSchemeProvider(){return E},setCredentials($){w=$},credentials(){return w}}},RN=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var M4=(D)=>D,VN=(D,F)=>{const E={...M4(h1(D)),...M4(F1(D)),...M4(j2(D)),...M4(LN(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...P2(E),...RN(E)}};class dB extends P0{constructor(...[D]){const F=HN(D||{}),E=BN(F),w=g2(E),$=p2(w),C=d2($),f=y2(C),B=n2(f),h=CN(B),U=VN(h,D?.extensions||[]);super(U);this.config=U,this.middlewareStack.use(r2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(v2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(x2(this.config)),this.middlewareStack.use(JF.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:$N,identityProviderConfigProvider:async(I)=>new JF.DefaultIdentityProviderConfig({"aws.auth#sigv4":I.credentials})})),this.middlewareStack.use(JF.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}y();y();class c0 extends D2{constructor(D){super(D);Object.setPrototypeOf(this,c0.prototype)}}class G4 extends c0{constructor(D){super({name:"AccessDeniedException",$fault:"client",...D});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,G4.prototype)}}class Y4 extends c0{constructor(D){super({name:"ConflictException",$fault:"client",...D});this.name="ConflictException",this.$fault="client",Object.setPrototypeOf(this,Y4.prototype)}}class Z4 extends c0{constructor(D){super({name:"InternalServerException",$fault:"server",...D});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,Z4.prototype)}}class W4 extends c0{constructor(D){super({name:"ResourceNotFoundException",$fault:"client",...D});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,W4.prototype)}}class X4 extends c0{constructor(D){super({name:"ThrottlingException",$fault:"client",...D});this.name="ThrottlingException",this.$fault="client",Object.setPrototypeOf(this,X4.prototype)}}class J4 extends c0{constructor(D){super({name:"ValidationException",$fault:"client",...D});this.name="ValidationException",this.$fault="client",Object.setPrototypeOf(this,J4.prototype)}}var NN;(function(D){D.visit=(F,E)=>{if(F.s3Uri!==void 0)return E.s3Uri(F.s3Uri);return E._(F.$unknown[0],F.$unknown[1])}})(NN||(NN={}));var qN;(function(D){D.visit=(F,E)=>{if(F.automated!==void 0)return E.automated(F.automated);if(F.human!==void 0)return E.human(F.human);return E._(F.$unknown[0],F.$unknown[1])}})(qN||(qN={}));var ON;(function(D){D.visit=(F,E)=>{if(F.bedrockModel!==void 0)return E.bedrockModel(F.bedrockModel);return E._(F.$unknown[0],F.$unknown[1])}})(ON||(ON={}));var jN;(function(D){D.visit=(F,E)=>{if(F.models!==void 0)return E.models(F.models);return E._(F.$unknown[0],F.$unknown[1])}})(jN||(jN={}));class z4 extends c0{constructor(D){super({name:"ServiceQuotaExceededException",$fault:"client",...D});this.name="ServiceQuotaExceededException",this.$fault="client",Object.setPrototypeOf(this,z4.prototype)}}class T4 extends c0{constructor(D){super({name:"TooManyTagsException",$fault:"client",...D});this.name="TooManyTagsException",this.$fault="client",Object.setPrototypeOf(this,T4.prototype),this.resourceName=D.resourceName}}var PN;(function(D){D.visit=(F,E)=>{if(F.s3DataSource!==void 0)return E.s3DataSource(F.s3DataSource);return E._(F.$unknown[0],F.$unknown[1])}})(PN||(PN={}));var yN;(function(D){D.visit=(F,E)=>{if(F.s3InputDataConfig!==void 0)return E.s3InputDataConfig(F.s3InputDataConfig);return E._(F.$unknown[0],F.$unknown[1])}})(yN||(yN={}));var kN;(function(D){D.visit=(F,E)=>{if(F.s3OutputDataConfig!==void 0)return E.s3OutputDataConfig(F.s3OutputDataConfig);return E._(F.$unknown[0],F.$unknown[1])}})(kN||(kN={}));var _1=L(PD(),1),K4=L(_D(),1);y();F5();var rN=async(D,F)=>{const E=K4.requestBuilder(D,F),w={"content-type":"application/json"};E.bp("/model-customization-jobs");let $;return $=JSON.stringify(c(D,{baseModelIdentifier:[],clientRequestToken:[!0,(C)=>C??w$()],customModelKmsKeyId:[],customModelName:[],customModelTags:(C)=>BD(C),customizationType:[],hyperParameters:(C)=>BD(C),jobName:[],jobTags:(C)=>BD(C),outputDataConfig:(C)=>BD(C),roleArn:[],trainingDataConfig:(C)=>BD(C),validationDataConfig:(C)=>BD(C),vpcConfig:(C)=>BD(C)})),E.m("POST").h(w).b($),E.build()};var _N=async(D,F)=>{const E=K4.requestBuilder(D,F),w={};E.bp("/model-customization-jobs/{jobIdentifier}"),E.p("jobIdentifier",()=>D.jobIdentifier,"{jobIdentifier}",!1);let $;return E.m("GET").h(w).b($),E.build()};var sN=async(D,F)=>{const E=K4.requestBuilder(D,F),w={};E.bp("/foundation-models");const $=k({[gN]:[,D[gN]],[bN]:[,D[bN]],[cN]:[,D[cN]],[xN]:[,D[xN]]});let C;return E.m("GET").h(w).q($).b(C),E.build()};var uN=async(D,F)=>{if(D.statusCode!==201&&D.statusCode>=300)return vB(D,F);const E=k({$metadata:Q2(D)}),w=yD(Q0(await _1.parseJsonBody(D.body,F)),"body"),$=c(w,{jobArn:S});return Object.assign(E,$),E};var dN=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return vB(D,F);const E=k({$metadata:Q2(D)}),w=yD(Q0(await _1.parseJsonBody(D.body,F)),"body"),$=c(w,{baseModelArn:S,clientRequestToken:S,creationTime:(C)=>yD(v6(C)),customizationType:S,endTime:(C)=>yD(v6(C)),failureMessage:S,hyperParameters:BD,jobArn:S,jobName:S,lastModifiedTime:(C)=>yD(v6(C)),outputDataConfig:BD,outputModelArn:S,outputModelKmsKeyArn:S,outputModelName:S,roleArn:S,status:S,trainingDataConfig:BD,trainingMetrics:(C)=>mDD(C,F),validationDataConfig:BD,validationMetrics:(C)=>nDD(C,F),vpcConfig:BD});return Object.assign(E,$),E};var vN=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return vB(D,F);const E=k({$metadata:Q2(D)}),w=yD(Q0(await _1.parseJsonBody(D.body,F)),"body"),$=c(w,{modelSummaries:BD});return Object.assign(E,$),E};var vB=async(D,F)=>{const E={...D,body:await _1.parseJsonErrorBody(D.body,F)},w=_1.loadRestJsonErrorCode(D,E.body);switch(w){case"AccessDeniedException":case"com.amazonaws.bedrock#AccessDeniedException":throw await cDD(E,F);case"ConflictException":case"com.amazonaws.bedrock#ConflictException":throw await gDD(E,F);case"InternalServerException":case"com.amazonaws.bedrock#InternalServerException":throw await rDD(E,F);case"ResourceNotFoundException":case"com.amazonaws.bedrock#ResourceNotFoundException":throw await _DD(E,F);case"ThrottlingException":case"com.amazonaws.bedrock#ThrottlingException":throw await uDD(E,F);case"ValidationException":case"com.amazonaws.bedrock#ValidationException":throw await vDD(E,F);case"ServiceQuotaExceededException":case"com.amazonaws.bedrock#ServiceQuotaExceededException":throw await sDD(E,F);case"TooManyTagsException":case"com.amazonaws.bedrock#TooManyTagsException":throw await dDD(E,F);default:const $=E.body;return xDD({output:D,parsedBody:$,errorCode:w})}},xDD=t2(c0),cDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new G4({$metadata:Q2(D),...E});return u(C,D.body)},gDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new Y4({$metadata:Q2(D),...E});return u(C,D.body)},rDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new Z4({$metadata:Q2(D),...E});return u(C,D.body)},_DD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new W4({$metadata:Q2(D),...E});return u(C,D.body)},sDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new z4({$metadata:Q2(D),...E});return u(C,D.body)},uDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new X4({$metadata:Q2(D),...E});return u(C,D.body)},dDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S,resourceName:S});Object.assign(E,$);const C=new T4({$metadata:Q2(D),...E});return u(C,D.body)},vDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new J4({$metadata:Q2(D),...E});return u(C,D.body)};var mDD=(D,F)=>{return c(D,{trainingLoss:z5})},nDD=(D,F)=>{return(D||[]).filter((w)=>w!=null).map((w)=>{return lDD(w,F)})},lDD=(D,F)=>{return c(D,{validationLoss:z5})},Q2=(D)=>({httpStatusCode:D.statusCode,requestId:D.headers["x-amzn-requestid"]??D.headers["x-amzn-request-id"]??D.headers["x-amz-request-id"],extendedRequestId:D.headers["x-amz-id-2"],cfId:D.headers["x-amz-cf-id"]});var bN="byCustomizationType",xN="byInferenceType";var cN="byOutputModality",gN="byProvider";AD();LD();y();class mB extends l.classBuilder().ep(XF).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockControlPlaneService","CreateModelCustomizationJob",{}).n("BedrockClient","CreateModelCustomizationJobCommand").f(void 0,void 0).ser(rN).de(uN).build(){}AD();LD();y();class nB extends l.classBuilder().ep(XF).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockControlPlaneService","GetModelCustomizationJob",{}).n("BedrockClient","GetModelCustomizationJobCommand").f(void 0,void 0).ser(_N).de(dN).build(){}AD();LD();y();class lB extends l.classBuilder().ep(XF).m(function(D,F,E,w){return[p(E,this.serialize,this.deserialize),a(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockControlPlaneService","ListFoundationModels",{}).n("BedrockClient","ListFoundationModelsCommand").f(void 0,void 0).ser(sN).de(vN).build(){}async function tOD(D){s1.debug(D);const F=new mB(D),E=await iB.send(F);return s1.debug("Successfully create model customization job"),s1.debug(E),E}async function eOD(D){s1.debug(D);const F=new nB(D),E=await iB.send(F);return s1.debug("Successfully get model customization job"),s1.debug(E),E}async function DjD(D){s1.debug(D);const F=new lB(D),E=await iB.send(F);return s1.debug("Successfully list foundation models"),s1.debug(E),E}var iB=new dB({region:iDD.env.REGION||"us-east-1"}),s1=console;o6();import c4D from"process";var fjD=process.argv,CjD=`${process.platform}-${process.arch} node-${process.version}`;import{access as y3D,appendFile as Jy,mkdir as zy}from"fs/promises";import{dirname as k3D}from"path";import b3D from"process";var ND={};_0(ND,{ui:()=>j3D,team:()=>O3D,storage:()=>q3D,services:()=>N3D,security:()=>R3D,searchEngine:()=>V3D,queue:()=>L3D,ports:()=>H3D,payment:()=>Q3D,overrides:()=>LU,notification:()=>S3D,logging:()=>K3D,localUrl:()=>bFD,library:()=>T3D,hashing:()=>z3D,git:()=>J3D,errors:()=>X3D,email:()=>W3D,docs:()=>Z3D,dns:()=>Y3D,determineAppEnv:()=>P3D,defineUi:()=>C3D,defineStorage:()=>f3D,defineStacksConfig:()=>xFD,defineSms:()=>$3D,defineServices:()=>w3D,defineSecurity:()=>E3D,defineSearchEngine:()=>F3D,defineQueue:()=>D3D,definePayment:()=>eFD,defineNotification:()=>tFD,defineModel:()=>B3D,defineLibrary:()=>oFD,defineJob:()=>uFD,defineHashing:()=>aFD,defineGit:()=>pFD,defineEvents:()=>h3D,defineEmailConfig:()=>lFD,defineEmail:()=>iFD,defineDns:()=>nFD,defineDependencies:()=>mFD,defineDatabase:()=>vFD,defineCronJob:()=>dFD,defineCli:()=>sFD,defineChat:()=>_FD,defineCdn:()=>rFD,defineCache:()=>gFD,defineApp:()=>cFD,defaults:()=>HU,database:()=>G3D,config:()=>MD,cloud:()=>I3D,cli:()=>M3D,cache:()=>A3D,app:()=>G6,analytics:()=>U3D,ai:()=>RU});import{basename as JbD,delimiter as zbD,dirname as vP,extname as TbD,isAbsolute as KbD,join as SbD,normalize as QbD,parse as HbD,relative as LFD,resolve as uP,sep as LbD,toNamespacedPath as RbD}from"path";import dP from"process";import W7 from"process";var pDD=new Set([".","!","?"]),ZjD=new Set([...pDD,":",'"',"'","\u201D"]);var k8=L(nN(),1);var U0D=L(lN(),1);function Dh(D){return typeof D==="string"}var q={required:"The {{ field }} field must be defined",string:"The {{ field }} field must be a string",email:"The {{ field }} field must be a valid email address",mobile:"The {{ field }} field must be a valid mobile phone number",creditCard:"The {{ field }} field must be a valid {{ providersList }} card number",passport:"The {{ field }} field must be a valid passport number",postalCode:"The {{ field }} field must be a valid postal code",regex:"The {{ field }} field format is invalid",ascii:"The {{ field }} field must only contain ASCII characters",iban:"The {{ field }} field must be a valid IBAN number",jwt:"The {{ field }} field must be a valid JWT token",coordinates:"The {{ field }} field must contain latitude and longitude coordinates",url:"The {{ field }} field must be a valid URL",activeUrl:"The {{ field }} field must be a valid URL",alpha:"The {{ field }} field must contain only letters",alphaNumeric:"The {{ field }} field must contain only letters and numbers",minLength:"The {{ field }} field must have at least {{ min }} characters",maxLength:"The {{ field }} field must not be greater than {{ max }} characters",fixedLength:"The {{ field }} field must be {{ size }} characters long",confirmed:"The {{ field }} field and {{ otherField }} field must be the same",endsWith:"The {{ field }} field must end with {{ substring }}",startsWith:"The {{ field }} field must start with {{ substring }}",sameAs:"The {{ field }} field and {{ otherField }} field must be the same",notSameAs:"The {{ field }} field and {{ otherField }} field must be different",in:"The selected {{ field }} is invalid",notIn:"The selected {{ field }} is invalid",ipAddress:"The {{ field }} field must be a valid IP address",uuid:"The {{ field }} field must be a valid UUID",hexCode:"The {{ field }} field must be a valid hex color code",boolean:"The value must be a boolean",number:"The {{ field }} field must be a number","number.in":"The selected {{ field }} is not in {{ values }}",min:"The {{ field }} field must be at least {{ min }}",max:"The {{ field }} field must not be greater than {{ max }}",range:"The {{ field }} field must be between {{ min }} and {{ max }}",positive:"The {{ field }} field must be positive",negative:"The {{ field }} field must be negative",decimal:"The {{ field }} field must have {{ digits }} decimal places",withoutDecimals:"The {{ field }} field must be an integer",accepted:"The {{ field }} field must be accepted",enum:"The selected {{ field }} is invalid",literal:"The {{ field }} field must be {{ expectedValue }}",object:"The {{ field }} field must be an object",array:"The {{ field }} field must be an array","array.minLength":"The {{ field }} field must have at least {{ min }} items","array.maxLength":"The {{ field }} field must not have more than {{ max }} items","array.fixedLength":"The {{ field }} field must contain {{ size }} items",notEmpty:"The {{ field }} field must not be empty",distinct:"The {{ field }} field has duplicate values",record:"The {{ field }} field must be an object","record.minLength":"The {{ field }} field must have at least {{ min }} items","record.maxLength":"The {{ field }} field must not have more than {{ max }} items","record.fixedLength":"The {{ field }} field must contain {{ size }} items",tuple:"The {{ field }} field must be an array",union:"Invalid value provided for {{ field }} field",unionGroup:"Invalid value provided for {{ field }} field",unionOfTypes:"Invalid value provided for {{ field }} field",date:"The {{ field }} field must be a datetime value","date.equals":"The {{ field }} field must be a date equal to {{ expectedValue }}","date.after":"The {{ field }} field must be a date after {{ expectedValue }}","date.before":"The {{ field }} field must be a date before {{ expectedValue }}","date.afterOrEqual":"The {{ field }} field must be a date after or equal to {{ expectedValue }}","date.beforeOrEqual":"The {{ field }} field must be a date before or equal to {{ expectedValue }}","date.sameAs":"The {{ field }} field and {{ otherField }} field must be the same","date.notSameAs":"The {{ field }} field and {{ otherField }} field must be different","date.afterField":"The {{ field }} field must be a date after {{ otherField }}","date.afterOrSameAs":"The {{ field }} field must be a date after or same as {{ otherField }}","date.beforeField":"The {{ field }} field must be a date before {{ otherField }}","date.beforeOrSameAs":"The {{ field }} field must be a date before or same as {{ otherField }}","date.weekend":"The {{ field }} field is not a weekend","date.weekday":"The {{ field }} field is not a weekday"},iN={"":"data"};var M0D=Object.defineProperty,S4=(D,F)=>{for(var E in F)M0D(D,E,{get:F[E],enumerable:!0})};function Fh(D,F,E,w,$){for(F=F.split?F.split("."):F,w=0;w<F.length;w++)D=D?D[F[w]]:$;return D===$?E:D}var nq=L(L4(),1),lq=L(eN(),1),iq=L($q(),1),pq=L(fq(),1),aq=L(hq(),1),oq=L(Uq(),1),tq=L(Aq(),1),eq=L(Gq(),1),DO=L(Hq(),1),FO=L(Rq(),1),EO=L(Oq(),1),wO=L(jq(),1),$O=L(kq(),1),fO=L(cq(),1),CO=L(rq(),1),BO=L(Oh(),1),hO=L(jh(),1),UO=L(jh(),1),AO=L(Oh(),1),EE=class{#D;#F;constructor(D,F){this.#D=D,this.#F=F||{}}#E(D,F){if(!D.includes("{{"))return D;return D.replace(/(\\)?{{(.*?)}}/g,(E,w,$)=>{const C=$.trim().split(".");let f=F;while(C.length){if(f===null||typeof f!=="object")return;const B=C.shift();f=Object.hasOwn(f,B)?f[B]:void 0}return f})}getMessage(D,F,E,w){const $=this.#F[E.name]||E.name,C=this.#D[`${E.getFieldPath()}.${F}`];if(C)return this.#E(C,{field:$,...w});const f=this.#D[`${E.wildCardPath}.${F}`];if(f)return this.#E(f,{field:$,...w});const B=this.#D[F];if(B)return this.#E(B,{field:$,...w});return this.#E(D,{field:$,...w})}toJSON(){return{messages:this.#D,fields:this.#F}}},e4={};S4(e4,{E_VALIDATION_ERROR:()=>mq});var Ph=class extends Error{constructor(D,F){super("Validation failure",F);this.messages=D;const E=this.constructor;Error.captureStackTrace(this,E)}status=422;code="E_VALIDATION_ERROR";get[Symbol.toStringTag](){return this.constructor.name}toString(){return`${this.name} [${this.code}]: ${this.message}`}},mq=Ph,yh=class{hasErrors=!1;errors=[];report(D,F,E,w){const $={message:D,rule:F,field:E.getFieldPath()};if(w)$.meta=w;if(E.isArrayMember)$.index=E.name;this.hasErrors=!0,this.errors.push($)}createError(){return new mq(this.errors)}},d1D=["1",1,"true",!0,"on"],v1D=["0",0,"false",!1],d={exists(D){return D!==null&&D!==void 0},isMissing(D){return!this.exists(D)},isTrue(D){return d1D.includes(D)},isFalse(D){return v1D.includes(D)},isString(D){return typeof D==="string"},isObject(D){return!!(D&&typeof D==="object"&&!Array.isArray(D))},hasKeys(D,F){for(let E of F)if(E in D===!1)return!1;return!0},isArray(D){return Array.isArray(D)},isNumeric(D){return!Number.isNaN(Number(D))},asNumber(D){return D===null?Number.NaN:Number(D)},asBoolean(D){if(this.isTrue(D))return!0;if(this.isFalse(D))return!1;return null},isEmail:eq.default.default,isURL:iq.default.default,isAlpha:DO.default.default,isAlphaNumeric:fO.default.default,isIP:nq.default.default,isUUID:oq.default.default,isAscii:tq.default.default,isCreditCard:$O.default.default,isIBAN:aq.default.default,isJWT:lq.default.default,isLatLong:FO.default.default,isMobilePhone:hO.default.default,isPassportNumber:CO.default.default,isPostalCode:BO.default.default,isSlug:pq.default.default,isDecimal:EO.default.default,mobileLocales:UO.locales,postalCountryCodes:AO.locales,passportCountryCodes:["AM","AR","AT","AU","AZ","BE","BG","BR","BY","CA","CH","CY","CZ","DE","DK","DZ","ES","FI","FR","GB","GR","HR","HU","IE","IN","ID","IR","IS","IT","JM","JP","KR","KZ","LI","LT","LU","LV","LY","MT","MZ","MY","MX","NL","NZ","PH","PK","PL","PT","RO","RU","SE","SL","SK","TH","TR","UA","US"],isHexColor:(D)=>{if(!D.startsWith("#"))return!1;return wO.default.default(D)},isActiveURL:async(D)=>{const{resolve4:F,resolve6:E}=await import("dns/promises");try{const{hostname:w}=new URL(D);if((await E(w)).length)return!0;else return(await F(w)).length>0}catch{return!1}},isDistinct:(D,F)=>{const E=new Set;if(!F){for(let $ of D)if(d.exists($))if(E.has($))return!1;else E.add($);return!0}const w=Array.isArray(F)?F:[F];for(let $ of D)if(d.isObject($)&&d.hasKeys($,w)){const C=w.map((f)=>$[f]).join("_");if(E.has(C))return!1;else E.add(C)}return!0},getNestedValue(D,F){if(D.indexOf(".")>-1)return Fh(F.data,D);return F.parent[D]}};function O(D,F){const E={validator:D,isAsync:F?.isAsync||D.constructor.name==="AsyncFunction",implicit:F?.implicit??!1};return function(...w){return{rule:E,options:w[0]}}}var KF=class{static macro(D,F){this.prototype[D]=F}static getter(D,F,E=!1){Object.defineProperty(this.prototype,D,{get(){const w=F.call(this);if(E)Object.defineProperty(this,D,{configurable:!1,enumerable:!1,value:w,writable:!1});return w},configurable:!0,enumerable:!1})}};var m1D=/[\p{Lu}]/u,n1D=/[\p{Ll}]/u,IO=/^[\p{Lu}](?![\p{Lu}])/gu,YO=/([\p{Alpha}\p{N}_]|$)/u,kh=/[_.\- ]+/,l1D=new RegExp("^"+kh.source),MO=new RegExp(kh.source+YO.source,"gu"),GO=new RegExp("\\d+"+YO.source,"gu"),i1D=(D,F,E,w)=>{let $=!1,C=!1,f=!1,B=!1;for(let h=0;h<D.length;h++){const U=D[h];if(B=h>2?D[h-3]==="-":!0,$&&m1D.test(U))D=D.slice(0,h)+"-"+D.slice(h),$=!1,f=C,C=!0,h++;else if(C&&f&&n1D.test(U)&&(!B||w))D=D.slice(0,h-1)+"-"+D.slice(h-1),f=C,C=!1,$=!0;else $=F(U)===U&&E(U)!==U,f=C,C=E(U)===U&&F(U)!==U}return D},p1D=(D,F)=>{return IO.lastIndex=0,D.replaceAll(IO,(E)=>F(E))},a1D=(D,F)=>{return MO.lastIndex=0,GO.lastIndex=0,D.replaceAll(GO,(E,w,$)=>["_","-"].includes(D.charAt($+E.length))?E:F(E)).replaceAll(MO,(E,w)=>F(w))};function tD(D,F){if(!(typeof D==="string"||Array.isArray(D)))throw new TypeError("Expected the input to be `string | string[]`");if(F={pascalCase:!1,preserveConsecutiveUppercase:!1,...F},Array.isArray(D))D=D.map((C)=>C.trim()).filter((C)=>C.length).join("-");else D=D.trim();if(D.length===0)return"";const E=F.locale===!1?(C)=>C.toLowerCase():(C)=>C.toLocaleLowerCase(F.locale),w=F.locale===!1?(C)=>C.toUpperCase():(C)=>C.toLocaleUpperCase(F.locale);if(D.length===1){if(kh.test(D))return"";return F.pascalCase?w(D):E(D)}if(D!==E(D))D=i1D(D,E,w,F.preserveConsecutiveUppercase);if(D=D.replace(l1D,""),D=F.preserveConsecutiveUppercase?p1D(D,E):E(D),F.pascalCase)D=w(D.charAt(0))+D.slice(1);return a1D(D,w)}var nj=L(ch(),1),WD=L(ch(),1),lj=L(ZO(),1),ij=L(WO(),1),pj=L(XO(),1);function ah(D){return new aj(D)}var vh=(D,F)=>F.some((E)=>E instanceof RegExp?E.test(D):E===D),o1D=new Set(["https:","http:","file:"]),t1D=(D)=>{try{const{protocol:F}=new URL(D);return F.endsWith(":")&&!F.includes(".")&&!o1D.has(F)}catch{return!1}},e1D=(D,{stripHash:F})=>{const E=/^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(D);if(!E)throw new Error(`Invalid URL: ${D}`);let{type:w,data:$,hash:C}=E.groups;const f=w.split(";");C=F?"":C;let B=!1;if(f[f.length-1]==="base64")f.pop(),B=!0;const h=f.shift()?.toLowerCase()??"",I=[...f.map((A)=>{let[Y,M=""]=A.split("=").map((Z)=>Z.trim());if(Y==="charset"){if(M=M.toLowerCase(),M==="us-ascii")return""}return`${Y}${M?`=${M}`:""}`}).filter(Boolean)];if(B)I.push("base64");if(I.length>0||h&&h!=="text/plain")I.unshift(h);return`data:${I.join(";")},${B?$.trim():$}${C?`#${C}`:""}`};function mh(D,F){if(F={defaultProtocol:"http",normalizeProtocol:!0,forceHttp:!1,forceHttps:!1,stripAuthentication:!0,stripHash:!1,stripTextFragment:!0,stripWWW:!0,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:!0,removeSingleSlash:!0,removeDirectoryIndex:!1,removeExplicitPort:!1,sortQueryParameters:!0,...F},typeof F.defaultProtocol==="string"&&!F.defaultProtocol.endsWith(":"))F.defaultProtocol=`${F.defaultProtocol}:`;if(D=D.trim(),/^data:/i.test(D))return e1D(D,F);if(t1D(D))return D;const E=D.startsWith("//");if(!(!E&&/^\.*\//.test(D)))D=D.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,F.defaultProtocol);const $=new URL(D);if(F.forceHttp&&F.forceHttps)throw new Error("The `forceHttp` and `forceHttps` options cannot be used together");if(F.forceHttp&&$.protocol==="https:")$.protocol="http:";if(F.forceHttps&&$.protocol==="http:")$.protocol="https:";if(F.stripAuthentication)$.username="",$.password="";if(F.stripHash)$.hash="";else if(F.stripTextFragment)$.hash=$.hash.replace(/#?:~:text.*?$/i,"");if($.pathname){const f=/\b[a-z][a-z\d+\-.]{1,50}:\/\//g;let B=0,h="";for(;;){const I=f.exec($.pathname);if(!I)break;const A=I[0],Y=I.index,M=$.pathname.slice(B,Y);h+=M.replace(/\/{2,}/g,"/"),h+=A,B=Y+A.length}const U=$.pathname.slice(B,$.pathname.length);h+=U.replace(/\/{2,}/g,"/"),$.pathname=h}if($.pathname)try{$.pathname=decodeURI($.pathname)}catch{}if(F.removeDirectoryIndex===!0)F.removeDirectoryIndex=[/^index\.[a-z]+$/];if(Array.isArray(F.removeDirectoryIndex)&&F.removeDirectoryIndex.length>0){let f=$.pathname.split("/");const B=f[f.length-1];if(vh(B,F.removeDirectoryIndex))f=f.slice(0,-1),$.pathname=f.slice(1).join("/")+"/"}if($.hostname){if($.hostname=$.hostname.replace(/\.$/,""),F.stripWWW&&/^www\.(?!www\.)[a-z\-\d]{1,63}\.[a-z.\-\d]{2,63}$/.test($.hostname))$.hostname=$.hostname.replace(/^www\./,"")}if(Array.isArray(F.removeQueryParameters)){for(let f of[...$.searchParams.keys()])if(vh(f,F.removeQueryParameters))$.searchParams.delete(f)}if(!Array.isArray(F.keepQueryParameters)&&F.removeQueryParameters===!0)$.search="";if(Array.isArray(F.keepQueryParameters)&&F.keepQueryParameters.length>0){for(let f of[...$.searchParams.keys()])if(!vh(f,F.keepQueryParameters))$.searchParams.delete(f)}if(F.sortQueryParameters){$.searchParams.sort();try{$.search=decodeURIComponent($.search)}catch{}}if(F.removeTrailingSlash)$.pathname=$.pathname.replace(/\/$/,"");if(F.removeExplicitPort&&$.port)$.port="";const C=D;if(D=$.toString(),!F.removeSingleSlash&&$.pathname==="/"&&!C.endsWith("/")&&$.hash==="")D=D.replace(/\/$/,"");if((F.removeTrailingSlash||$.pathname==="/")&&$.hash===""&&F.removeSingleSlash)D=D.replace(/\/$/,"");if(E&&!F.normalizeProtocol)D=D.replace(/^http:\/\//,"//");if(F.stripProtocol)D=D.replace(/^(?:https?:)?\/\//,"");return D}var EP=L(JO(),1),wP=L(zO(),1);function oh(D){return new a8D(D)}function Z8D({parseFnRefId:D,variableName:F,wildCardPath:E,isArrayMember:w,valueExpression:$,parentExpression:C,fieldNameExpression:f,parentValueExpression:B}){const h=D?`refs['${D}'](${$}, {
|
|
87
|
+
data: root,
|
|
88
|
+
meta: meta,
|
|
89
|
+
parent: ${B}
|
|
90
|
+
})`:$;let U="";if(C==="root"||C==="root_item")U=f;else if(f!=="''")U=`${C}.getFieldPath() + '.' + ${f}`;return`const ${F} = defineValue(${h}, {
|
|
91
|
+
data: root,
|
|
92
|
+
meta: meta,
|
|
93
|
+
name: ${f},
|
|
94
|
+
wildCardPath: '${E}',
|
|
95
|
+
getFieldPath() {
|
|
96
|
+
return ${U};
|
|
97
|
+
},
|
|
98
|
+
mutate: defineValue,
|
|
99
|
+
report: report,
|
|
100
|
+
isValid: true,
|
|
101
|
+
parent: ${B},
|
|
102
|
+
isArrayMember: ${w},
|
|
103
|
+
});`}function TO({variableName:D,guardedCodeSnippet:F}){return`if (ensureIsArray(${D})) {
|
|
104
|
+
${F}
|
|
105
|
+
}`}function E7({variableName:D,bail:F,guardedCodeSnippet:E}){if(!F)return E;return`if (${D}.isValid) {
|
|
106
|
+
${E}
|
|
107
|
+
}`}function wE({allowNull:D,conditional:F,variableName:E,outputExpression:w,transformFnRefId:$}){if(!D)return"";return`${F||"if"}(${E}.value === null) {
|
|
108
|
+
${w} = ${$?`refs['${$}'](null, ${E});`:"null;"}
|
|
109
|
+
}`}function W8D(D,F){const[E,w]=D;if(E&&w)return`if (${E} && ${w}) {
|
|
110
|
+
${F}
|
|
111
|
+
}`;if(E)return`if (${E}) {
|
|
112
|
+
${F}
|
|
113
|
+
}`;if(w)return`if (${w}) {
|
|
114
|
+
${F}
|
|
115
|
+
}`;return F}function X8D({isAsync:D,implicit:F,ruleFnId:E},w,$,C){const f=`refs['${E}']`,B=`${f}.validator(${w}.value, ${f}.options, ${w});`,h=$?`${w}.isValid`:"",U=F||C?"":`${w}.isDefined`;return W8D([h,U],D?`await ${B}`:`${B}`)}function $E({bail:D,validations:F,variableName:E,dropMissingCheck:w}){return`${F.map(($)=>X8D($,E,D,w)).join("\n")}`}function KO({variableName:D,outputExpression:F,outputValueExpression:E}){return`const ${D}_out = ${E};
|
|
116
|
+
${F} = ${D}_out;`}function fE({allowNull:D,isOptional:F,variableName:E}){if(F===!1)if(D===!1)return`ensureExists(${E});`;else return`ensureIsDefined(${E});`;return""}function z8D({variableName:D,loopCodeSnippet:F,startingIndex:E}){return E=E||0,`const ${D}_items_size = ${D}.value.length;
|
|
117
|
+
for (let ${D}_i = ${E}; ${D}_i < ${D}_items_size; ${D}_i++) {
|
|
118
|
+
${F}
|
|
119
|
+
}`}function K8D({parseFnRefId:D,variableName:F}){if(D)return`${F}.value = refs['${D}'](${F}.value);`;return""}function SO({variableName:D,conditionalFnRefId:F}){return`else {
|
|
120
|
+
refs['${F}'](${D}.value, ${D});
|
|
121
|
+
}`}function QO({conditional:D,variableName:F,conditionalFnRefId:E,guardedCodeSnippet:w}){return`${D}(refs['${E}'](${F}.value, ${F})) {
|
|
122
|
+
${w}
|
|
123
|
+
}`}function Q8D({variableName:D,loopCodeSnippet:F}){return`const ${D}_keys = Object.keys(${D}.value);
|
|
124
|
+
const ${D}_keys_size = ${D}_keys.length;
|
|
125
|
+
for (let ${D}_key_i = 0; ${D}_key_i < ${D}_keys_size; ${D}_key_i++) {
|
|
126
|
+
const ${D}_i = ${D}_keys[${D}_key_i];
|
|
127
|
+
${F}
|
|
128
|
+
}`}function HO({variableName:D,guardedCodeSnippet:F}){return`if (ensureIsObject(${D})) {
|
|
129
|
+
${F}
|
|
130
|
+
}`}function LO({variableName:D,outputExpression:F,outputValueExpression:E}){return`const ${D}_out = ${E};
|
|
131
|
+
${F} = ${D}_out;`}function L8D(D){return`[${D.map((F)=>`"${F}"`).join(", ")}]`}function R8D({variableName:D,fieldsToIgnore:F,allowUnknownProperties:E}){if(!E)return"";const w=L8D(F);return`moveProperties(${D}.value, ${D}_out, ${w});`}function N8D(D){return{parentExpression:D.variableName,parentValueExpression:D.variableName,fieldNameExpression:"''",fieldPathExpression:"''",wildCardPath:"",variableName:`${D.variableName}_item`,valueExpression:"root",outputExpression:D.outputExpression,isArrayMember:!1}}function q8D({variableName:D,outputExpression:F,transformFnRefId:E}){const w=E?`refs['${E}'](${D}.value, ${D})`:`${D}.value`;return`if (${D}.isDefined && ${D}.isValid) {
|
|
132
|
+
${F} = ${w};
|
|
133
|
+
}`}function j8D(D){const F=D.wildCardPath!==""?`${D.wildCardPath}.*`:"*";return{parentExpression:D.variableName,parentValueExpression:`${D.variableName}.value`,fieldNameExpression:`${D.variableName}_i`,fieldPathExpression:F,wildCardPath:F,variableName:`${D.variableName}_item`,valueExpression:`${D.variableName}.value[${D.variableName}_i]`,outputExpression:`${D.variableName}_out[${D.variableName}_i]`,isArrayMember:!0}}function P8D(D,F){const E=F.wildCardPath!==""?`${F.wildCardPath}.${D.fieldName}`:D.fieldName;return{parentExpression:F.variableName,parentValueExpression:`${F.variableName}.value`,fieldNameExpression:`${D.fieldName}`,fieldPathExpression:E,wildCardPath:E,variableName:`${F.variableName}_item_${D.fieldName}`,valueExpression:`${F.variableName}.value[${D.fieldName}]`,outputExpression:`${F.variableName}_out[${D.propertyName}]`,isArrayMember:!0}}function y8D(){return`if(errorReporter.hasErrors) {
|
|
134
|
+
throw errorReporter.createError();
|
|
135
|
+
}`}function k8D(D,F,E){const w=E.wildCardPath!==""?`${E.wildCardPath}.${D.fieldName}`:D.fieldName;return{parentExpression:E.variableName,parentValueExpression:`${E.variableName}.value`,fieldNameExpression:`'${D.fieldName}'`,fieldPathExpression:w,wildCardPath:w,variableName:`${D.propertyName}_${F}`,valueExpression:`${E.variableName}.value['${D.fieldName}']`,outputExpression:`${E.variableName}_out['${D.propertyName}']`,isArrayMember:!1}}function b8D(D){const F=D.wildCardPath!==""?`${D.wildCardPath}.*`:"*";return{parentExpression:D.variableName,parentValueExpression:`${D.variableName}.value`,fieldNameExpression:`${D.variableName}_i`,fieldPathExpression:F,wildCardPath:F,variableName:`${D.variableName}_item`,valueExpression:`${D.variableName}.value[${D.variableName}_i]`,outputExpression:`${D.variableName}_out[${D.variableName}_i]`,isArrayMember:!1}}function x8D(D){return`function report(message, rule, field, args) {
|
|
136
|
+
field.isValid = false;
|
|
137
|
+
errorReporter.report(messagesProvider.getMessage(message, rule, field, args), rule, field, args);
|
|
138
|
+
};
|
|
139
|
+
function defineValue(value, field) {
|
|
140
|
+
${D.convertEmptyStringsToNull?"if (value === '') { value = null; }":""}
|
|
141
|
+
field.value = value;
|
|
142
|
+
field.isDefined = value !== undefined && value !== null;
|
|
143
|
+
return field;
|
|
144
|
+
};
|
|
145
|
+
function ensureExists(field) {
|
|
146
|
+
if (field.value === undefined || field.value === null) {
|
|
147
|
+
field.report(REQUIRED, 'required', field);
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
return true;
|
|
151
|
+
};
|
|
152
|
+
function ensureIsDefined(field) {
|
|
153
|
+
if (field.value === undefined) {
|
|
154
|
+
field.report(REQUIRED, 'required', field);
|
|
155
|
+
return false;
|
|
156
|
+
}
|
|
157
|
+
return true;
|
|
158
|
+
};
|
|
159
|
+
function ensureIsObject(field) {
|
|
160
|
+
if (!field.isDefined) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
if (typeof field.value == 'object' && !Array.isArray(field.value)) {
|
|
164
|
+
return true;
|
|
165
|
+
}
|
|
166
|
+
field.report(NOT_AN_OBJECT, 'object', field);
|
|
167
|
+
return false;
|
|
168
|
+
};
|
|
169
|
+
function ensureIsArray(field) {
|
|
170
|
+
if (!field.isDefined) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
if (Array.isArray(field.value)) {
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
field.report(NOT_AN_ARRAY, 'array', field);
|
|
177
|
+
return false;
|
|
178
|
+
};
|
|
179
|
+
function copyProperties(val) {
|
|
180
|
+
let k, out, tmp;
|
|
181
|
+
|
|
182
|
+
if (Array.isArray(val)) {
|
|
183
|
+
out = Array((k = val.length))
|
|
184
|
+
while (k--) out[k] = (tmp = val[k]) && typeof tmp == 'object' ? copyProperties(tmp) : tmp
|
|
185
|
+
return out
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (Object.prototype.toString.call(val) === '[object Object]') {
|
|
189
|
+
out = {} // null
|
|
190
|
+
for (k in val) {
|
|
191
|
+
out[k] = (tmp = val[k]) && typeof tmp == 'object' ? copyProperties(tmp) : tmp
|
|
192
|
+
}
|
|
193
|
+
return out
|
|
194
|
+
}
|
|
195
|
+
return val
|
|
196
|
+
};
|
|
197
|
+
function moveProperties(source, destination, ignoreKeys) {
|
|
198
|
+
for (let key in source) {
|
|
199
|
+
if (!ignoreKeys.includes(key)) {
|
|
200
|
+
const value = source[key]
|
|
201
|
+
destination[key] = copyProperties(value)
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
};`}function c8D(D){return`const REQUIRED = '${D.required}';
|
|
205
|
+
const NOT_AN_OBJECT = '${D.object}';
|
|
206
|
+
const NOT_AN_ARRAY = '${D.array}';`}function VO(){let D=0;const F={};return{toJSON(){return F},track(E){D++;const w=`ref://${D}`;return F[w]=E,w},trackValidation(E){return this.track(E)},trackParser(E){return this.track(E)},trackTransformer(E){return this.track(E)},trackConditional(E){return this.track(E)}}}var Y8D=class D{#D="";newLine="\n";writeStatement(F){this.#D=`${this.#D}${this.newLine}${F}`}child(){return new D}toString(){return this.#D}flush(){this.#D=""}},SF=class{#D;#F;field;constructor(D,F,E,w){if(this.#F=w,this.#D=D,this.#F)this.field=this.#F;else F.variablesCounter++,this.field=F.createFieldFor(D,E)}defineField(D){if(!this.#F)D.writeStatement(Z8D({fieldNameExpression:this.field.fieldNameExpression,isArrayMember:this.field.isArrayMember,parentExpression:this.field.parentExpression,parentValueExpression:this.field.parentValueExpression,valueExpression:this.field.valueExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath,parseFnRefId:"parseFnId"in this.#D?this.#D.parseFnId:void 0}))}},J8D=class extends SF{#D;#F;#E;constructor(D,F,E,w,$){super(D,E,w,$);this.#D=D,this.#F=F,this.#E=E}#w(){const D=this.#F.child(),F={type:"tuple",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath};return this.#D.properties.forEach((E)=>{this.#E.compileNode(E,D,F)}),D.toString()}compile(){this.defineField(this.#F),this.#F.writeStatement(fE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName}));const D=E7({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${KO({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:this.#D.allowUnknownProperties?`copyProperties(${this.field.variableName}.value)`:"[]"})}${this.#w()}`}),F=TO({variableName:this.field.variableName,guardedCodeSnippet:`${$E({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!0})}${this.#F.newLine}${D}`});this.#F.writeStatement(`${F}${this.#F.newLine}${wE({allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}},T8D=class extends SF{#D;#F;#E;constructor(D,F,E,w,$){super(D,E,w,$);this.#D=D,this.#F=F,this.#E=E}#w(){const D=this.#F.child();this.#E.compileNode(this.#D.each,D,{type:"array",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath});const F=this.#F.child();return F.writeStatement(z8D({variableName:this.field.variableName,startingIndex:0,loopCodeSnippet:D.toString()})),D.flush(),F.toString()}compile(){this.defineField(this.#F),this.#F.writeStatement(fE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName}));const D=E7({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${KO({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"[]"})}${this.#F.newLine}${this.#w()}`}),F=TO({variableName:this.field.variableName,guardedCodeSnippet:`${$E({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!0})}${this.#F.newLine}${D}`});this.#F.writeStatement(`${F}${this.#F.newLine}${wE({allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}},S8D=class extends SF{#D;#F;#E;#w;constructor(D,F,E,w,$){super(D,E,w,$);this.#F=D,this.#E=F,this.#w=w,this.#D=E}#$(){const D=this.#E.child();if(this.#F.conditions.forEach((F,E)=>{const w=this.#E.child();if("parseFnId"in F.schema)w.writeStatement(K8D({parseFnRefId:F.schema.parseFnId,variableName:this.field.variableName}));this.#D.compileNode(F.schema,w,this.#w,this.field),D.writeStatement(QO({conditional:E===0?"if":"else if",variableName:this.field.variableName,conditionalFnRefId:F.conditionalFnRefId,guardedCodeSnippet:w.toString()})),w.flush()}),this.#F.elseConditionalFnRefId&&this.#F.conditions.length)D.writeStatement(SO({variableName:this.field.variableName,conditionalFnRefId:this.#F.elseConditionalFnRefId}));return D.toString()}compile(){this.defineField(this.#E),this.#E.writeStatement(this.#$())}},H8D=class extends SF{#D;#F;#E;constructor(D,F,E,w,$){super(D,E,w,$);this.#D=D,this.#F=F,this.#E=E}#w(){const D=this.#F.child(),F=this.#F.child();return this.#E.compileNode(this.#D.each,F,{type:"record",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath}),D.writeStatement(Q8D({variableName:this.field.variableName,loopCodeSnippet:F.toString()})),F.flush(),D.toString()}compile(){this.defineField(this.#F),this.#F.writeStatement(fE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName}));const D=E7({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${LO({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"{}"})}${this.#w()}`}),F=HO({variableName:this.field.variableName,guardedCodeSnippet:`${$E({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!0})}${this.#F.newLine}${D}`});this.#F.writeStatement(`${F}${this.#F.newLine}${wE({allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}},V8D=class extends SF{#D;#F;#E;constructor(D,F,E,w,$){super(D,E,w,$);this.#D=D,this.#F=F,this.#E=E}#w(D){let F=D.properties.map((w)=>w.fieldName);const E=D.groups.flatMap((w)=>this.#$(w));return F.concat(E)}#$(D){return D.conditions.flatMap((F)=>{return this.#w(F.schema)})}#f(){const D=this.#F.child(),F={type:"object",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath};return this.#D.properties.forEach((E)=>this.#E.compileNode(E,D,F)),D.toString()}#C(){const D=this.#F.child(),F={type:"object",fieldPathExpression:this.field.fieldPathExpression,outputExpression:this.field.outputExpression,variableName:this.field.variableName,wildCardPath:this.field.wildCardPath};return this.#D.groups.forEach((E)=>this.#B(E,D,F)),D.toString()}#B(D,F,E){if(D.conditions.forEach((w,$)=>{const C=F.child();w.schema.properties.forEach((f)=>{this.#E.compileNode(f,C,E)}),w.schema.groups.forEach((f)=>{this.#B(f,C,E)}),F.writeStatement(QO({variableName:this.field.variableName,conditional:$===0?"if":"else if",conditionalFnRefId:w.conditionalFnRefId,guardedCodeSnippet:C.toString()}))}),D.elseConditionalFnRefId&&D.conditions.length)F.writeStatement(SO({variableName:this.field.variableName,conditionalFnRefId:D.elseConditionalFnRefId}))}compile(){this.defineField(this.#F),this.#F.writeStatement(fE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName}));const D=E7({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${LO({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"{}"})}${this.#F.newLine}${this.#f()}${this.#F.newLine}${this.#C()}${this.#F.newLine}${R8D({variableName:this.field.variableName,allowUnknownProperties:this.#D.allowUnknownProperties,fieldsToIgnore:this.#D.allowUnknownProperties?this.#w(this.#D):[]})}`}),F=HO({variableName:this.field.variableName,guardedCodeSnippet:`${$E({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!0})}${D}`});this.#F.writeStatement(`${F}${this.#F.newLine}${wE({variableName:this.field.variableName,allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,conditional:"else if"})}`)}},O8D=class extends SF{#D;#F;constructor(D,F,E,w,$){super(D,E,w,$);this.#D=D,this.#F=F}compile(){this.defineField(this.#F),this.#F.writeStatement(fE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName})),this.#F.writeStatement($E({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!1})),this.#F.writeStatement(`${q8D({variableName:this.field.variableName,outputExpression:this.field.outputExpression,transformFnRefId:this.#D.transformFnId})}${this.#F.newLine}${wE({variableName:this.field.variableName,allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,transformFnRefId:this.#D.transformFnId,conditional:"else if"})}`)}},g8D=Object.getPrototypeOf(async function(){}).constructor,RO=class{variablesCounter=0;#D;#F;#E=new Y8D;constructor(D,F){this.#D=D,this.#F=F||{convertEmptyStringsToNull:!1}}#w(){this.#E.writeStatement(c8D({required:"value is required",object:"value is not a valid object",array:"value is not a valid array",...this.#F.messages})),this.#E.writeStatement(x8D(this.#F)),this.#E.writeStatement("let out;")}#$(){this.#E.writeStatement(y8D()),this.#E.writeStatement("return out;")}#f(){this.compileNode(this.#D.schema,this.#E,{type:"root",variableName:"root",outputExpression:"out",fieldPathExpression:"out",wildCardPath:""})}#C(){return new g8D("root","meta","refs","messagesProvider","errorReporter",this.#E.toString())}createFieldFor(D,F){switch(F.type){case"array":return j8D(F);case"root":return N8D(F);case"object":return k8D(D,this.variablesCounter,F);case"tuple":return P8D(D,F);case"record":return b8D(F)}}compileNode(D,F,E,w){switch(D.type){case"literal":return new O8D(D,F,this,E,w).compile();case"array":return new T8D(D,F,this,E,w).compile();case"record":return new H8D(D,F,this,E,w).compile();case"object":return new V8D(D,F,this,E,w).compile();case"tuple":return new J8D(D,F,this,E,w).compile();case"union":return new S8D(D,F,this,E,w).compile()}}compile(){this.#w(),this.#f(),this.#$();const D=this.#C();return this.variablesCounter=0,this.#E.flush(),D}};var vj={};S4(vj,{COTYPE:()=>s8D,IS_OF_TYPE:()=>B2,ITYPE:()=>r8D,OTYPE:()=>_8D,PARSE:()=>ED,UNIQUE_NAME:()=>R0,VALIDATION:()=>I6});var R0=Symbol.for("schema_name"),B2=Symbol.for("is_of_type"),ED=Symbol.for("parse"),r8D=Symbol.for("opaque_input_type"),_8D=Symbol.for("opaque_type"),s8D=Symbol.for("camelcase_opaque_type"),I6=Symbol.for("to_validation"),QF=O((D,F,E)=>{const w=F(E);if(!E.isDefined&&w)E.report(q.required,"required",E)},{implicit:!0}),$7=class extends KF{optional(D){return new d8D(this,D)}nullable(){return new u8D(this)}transform(D){return new v8D(D,this)}},u8D=class D extends $7{#D;constructor(F){super();this.#D=F}clone(){return new D(this.#D.clone())}[ED](F,E,w){const $=this.#D[ED](F,E,w);return $.allowNull=!0,$}},d8D=class D extends $7{#D;validations;constructor(F,E){super();this.#D=F,this.validations=E||[]}cloneValidations(){return this.validations.map((F)=>{return{options:F.options,rule:F.rule}})}compileValidations(F){return this.validations.map((E)=>{return{ruleFnId:F.track({validator:E.rule.validator,options:E.options}),implicit:E.rule.implicit,isAsync:E.rule.isAsync}})}use(F){return this.validations.push(I6 in F?F[I6]():F),this}requiredWhen(F,E,w){if(typeof F==="function")return this.use(QF(F));let $;switch(E){case"=":$=(C)=>C===w;break;case"!=":$=(C)=>C!==w;break;case"in":$=(C)=>w.includes(C);break;case"notIn":$=(C)=>!w.includes(C);break;case">":$=(C)=>C>w;break;case"<":$=(C)=>C<w;break;case">=":$=(C)=>C>=w;break;case"<=":$=(C)=>C<=w}return this.use(QF((C)=>{const f=d.getNestedValue(F,C);return $(f)}))}requiredIfExists(F){const E=Array.isArray(F)?F:[F];return this.use(QF((w)=>{return E.every(($)=>d.exists(d.getNestedValue($,w)))}))}requiredIfAnyExists(F){return this.use(QF((E)=>{return F.some((w)=>d.exists(d.getNestedValue(w,E)))}))}requiredIfMissing(F){const E=Array.isArray(F)?F:[F];return this.use(QF((w)=>{return E.every(($)=>d.isMissing(d.getNestedValue($,w)))}))}requiredIfAnyMissing(F){return this.use(QF((E)=>{return F.some((w)=>d.isMissing(d.getNestedValue(w,E)))}))}clone(){return new D(this.#D.clone(),this.cloneValidations())}[ED](F,E,w){const $=this.#D[ED](F,E,w);return $.isOptional=!0,$.validations=$.validations.concat(this.compileValidations(E)),$}},v8D=class D extends $7{#D;#F;constructor(F,E){super();this.#F=F,this.#D=E}clone(){return new D(this.#F,this.#D.clone())}[ED](F,E,w){const $=this.#D[ED](F,E,w);return $.transformFnId=E.trackTransformer(this.#F),$}},G1=class extends $7{options;validations;constructor(D,F){super();this.options={bail:!0,allowNull:!1,isOptional:!1,...D},this.validations=F||[]}cloneValidations(){return this.validations.map((D)=>{return{options:D.options,rule:D.rule}})}cloneOptions(){return{...this.options}}compileValidations(D){return this.validations.map((F)=>{return{ruleFnId:D.track({validator:F.rule.validator,options:F.options}),implicit:F.rule.implicit,isAsync:F.rule.isAsync}})}parse(D){return this.options.parse=D,this}use(D){return this.validations.push(I6 in D?D[I6]():D),this}bail(D){return this.options.bail=D,this}[ED](D,F,E){return{type:"literal",fieldName:D,propertyName:E.toCamelCase?tD(D):D,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?F.trackParser(this.options.parse):void 0,validations:this.compileValidations(F)}}},mj=class D extends G1{constructor(F,E){super(F,E)}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},w7=O((D,F,E)=>{const w=typeof F.choices==="function"?F.choices(E):F.choices;if(!w.includes(D))E.report(q.enum,"enum",E,{choices:w})}),HF=class D extends G1{static rules={enum:w7};#D;getChoices(){return this.#D}constructor(F,E,w){super(E,w||[w7({choices:F})]);this.#D=F}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},M6=["YYYY-MM-DD","YYYY-MM-DD HH:mm:ss"];WD.default.extend(pj.default);WD.default.extend(lj.default);WD.default.extend(ij.default);var m8D=O((D,F,E)=>{if(typeof D!=="string"&&typeof D!=="number"){E.report(q.date,"date",E);return}let w=!1,$=F.formats||M6;if(Array.isArray($))$=[...$],w=$.includes("x");else if(typeof $!=="string")$={...$},w=$.format==="x";const C=w?d.asNumber(D):D,f=w&&!Number.isNaN(C)?WD.default(C):WD.default(D,$,!0);if(!f.isValid()){E.report(q.date,"date",E);return}E.meta.$value=f,E.meta.$formats=$,E.mutate(f.toDate(),E)}),NO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=F.format||M6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=WD.default(f,$,!0);if(!B.isValid())throw new Error(`Invalid datetime value "${f}" value provided to the equals rule`);if(!C.isSame(B,w))E.report(q["date.equals"],"date.equals",E,{expectedValue:f,compare:w})}),qO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=F.format||M6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=f==="today"?WD.default():f==="tomorrow"?WD.default().add(1,"day"):WD.default(f,$,!0);if(!B.isValid())throw new Error(`Invalid datetime value "${f}" value provided to the after rule`);if(!C.isAfter(B,w))E.report(q["date.after"],"date.after",E,{expectedValue:f,compare:w})}),OO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=F.format||M6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=f==="today"?WD.default():f==="tomorrow"?WD.default().add(1,"day"):WD.default(f,$,!0);if(!B.isValid())throw new Error(`Invalid datetime value "${f}" value provided to the afterOrEqual rule`);if(!C.isSameOrAfter(B,w))E.report(q["date.afterOrEqual"],"date.afterOrEqual",E,{expectedValue:f,compare:w})}),jO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=F.format||M6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=f==="today"?WD.default():f==="yesterday"?WD.default().subtract(1,"day"):WD.default(f,$,!0);if(!B.isValid())throw new Error(`Invalid datetime value "${f}" value provided to the before rule`);if(!C.isBefore(B,w))E.report(q["date.before"],"date.before",E,{expectedValue:f,compare:w})}),PO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=F.format||M6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=f==="today"?WD.default():f==="yesterday"?WD.default().subtract(1,"day"):WD.default(f,$,!0);if(!B.isValid())throw new Error(`Invalid datetime value "${f}" value provided to the beforeOrEqual rule`);if(!C.isSameOrBefore(B,w))E.report(q["date.beforeOrEqual"],"date.beforeOrEqual",E,{expectedValue:f,compare:w})}),yO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=E.meta.$value,C=F.format||E.meta.$formats,f=d.getNestedValue(F.otherField,E),B=WD.default(f,C,!0);if(!B.isValid())return;if(!$.isSame(B,w))E.report(q["date.sameAs"],"date.sameAs",E,{otherField:F.otherField,expectedValue:f,compare:w})}),kO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=E.meta.$value,C=F.format||E.meta.$formats,f=d.getNestedValue(F.otherField,E),B=WD.default(f,C,!0);if(!B.isValid())return;if($.isSame(B,w))E.report(q["date.notSameAs"],"date.notSameAs",E,{otherField:F.otherField,expectedValue:f,compare:w})}),bO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=E.meta.$value,C=F.format||E.meta.$formats,f=d.getNestedValue(F.otherField,E),B=WD.default(f,C,!0);if(!B.isValid())return;if(!$.isAfter(B,w))E.report(q["date.afterField"],"date.afterField",E,{otherField:F.otherField,expectedValue:f,compare:w})}),xO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=E.meta.$value,C=F.format||E.meta.$formats,f=d.getNestedValue(F.otherField,E),B=WD.default(f,C,!0);if(!B.isValid())return;if(!$.isSameOrAfter(B,w))E.report(q["date.afterOrSameAs"],"date.afterOrSameAs",E,{otherField:F.otherField,expectedValue:f,compare:w})}),cO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=E.meta.$value,C=F.format||E.meta.$formats,f=d.getNestedValue(F.otherField,E),B=WD.default(f,C,!0);if(!B.isValid())return;if(!$.isBefore(B,w))E.report(q["date.beforeField"],"date.beforeField",E,{otherField:F.otherField,expectedValue:f,compare:w})}),gO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=E.meta.$value,C=F.format||E.meta.$formats,f=d.getNestedValue(F.otherField,E),B=WD.default(f,C,!0);if(!B.isValid())return;if(!$.isSameOrBefore(B,w))E.report(q["date.beforeOrSameAs"],"date.beforeOrSameAs",E,{otherField:F.otherField,expectedValue:f,compare:w})}),rO=O((D,F,E)=>{if(!E.meta.$value)return;const $=E.meta.$value.day();if($!==0&&$!==6)E.report(q["date.weekend"],"date.weekend",E)}),_O=O((D,F,E)=>{if(!E.meta.$value)return;const $=E.meta.$value.day();if($===0||$===6)E.report(q["date.weekday"],"date.weekday",E)}),ph=class D extends G1{static rules={equals:NO,after:qO,afterOrEqual:OO,before:jO,beforeOrEqual:PO,sameAs:yO,notSameAs:kO,afterField:bO,afterOrSameAs:xO,beforeField:cO,beforeOrSameAs:gO,weekend:rO,weekday:_O};[R0]="vine.date";[B2]=(F)=>{if(typeof F!=="string")return!1;return nj.default(F,this.options.formats||M6,!0).isValid()};constructor(F,E){super(F,E||[m8D(F||{})])}equals(F,E){return this.use(NO({expectedValue:F,...E}))}after(F,E){return this.use(qO({expectedValue:F,...E}))}afterOrEqual(F,E){return this.use(OO({expectedValue:F,...E}))}before(F,E){return this.use(jO({expectedValue:F,...E}))}beforeOrEqual(F,E){return this.use(PO({expectedValue:F,...E}))}sameAs(F,E){return this.use(yO({otherField:F,...E}))}notSameAs(F,E){return this.use(kO({otherField:F,...E}))}afterField(F,E){return this.use(bO({otherField:F,...E}))}afterOrSameAs(F,E){return this.use(xO({otherField:F,...E}))}beforeField(F,E){return this.use(cO({otherField:F,...E}))}beforeOrSameAs(F,E){return this.use(gO({otherField:F,...E}))}weekend(){return this.use(rO())}weekday(){return this.use(_O())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},aj=class D{#D;#F=(F,E)=>{E.report(q.union,"union",E)};constructor(F){this.#D=F}otherwise(F){return this.#F=F,this}clone(){const F=new D(this.#D);return F.otherwise(this.#F),F}[ED](F,E,w){return{type:"union",fieldName:F,propertyName:w.toCamelCase?tD(F):F,elseConditionalFnRefId:E.trackConditional(this.#F),conditions:this.#D.map(($)=>$[ED](F,E,w))}}},oj=class{#D;#F;constructor(D,F){this.#D=F,this.#F=D}[ED](D,F,E){return{conditionalFnRefId:F.trackConditional(this.#F),schema:this.#D[ED](D,F,E)}}};ah.if=function D(F,E){return new oj(F,E)};ah.else=function D(F){return new oj(()=>!0,F)};var CE=class extends KF{optional(){return new l8D(this)}nullable(){return new n8D(this)}},n8D=class D extends CE{#D;constructor(F){super();this.#D=F}clone(){return new D(this.#D.clone())}[ED](F,E,w){const $=this.#D[ED](F,E,w);if($.type!=="union")$.allowNull=!0;return $}},l8D=class D extends CE{#D;constructor(F){super();this.#D=F}clone(){return new D(this.#D.clone())}[ED](F,E,w){const $=this.#D[ED](F,E,w);if($.type!=="union")$.isOptional=!0;return $}},BE=class extends CE{options;validations;constructor(D,F){super();this.options=D||{bail:!0,allowNull:!1,isOptional:!1},this.validations=F||[]}cloneValidations(){return this.validations.map((D)=>{return{options:D.options,rule:D.rule}})}cloneOptions(){return{...this.options}}compileValidations(D){return this.validations.map((F)=>{return{ruleFnId:D.track({validator:F.rule.validator,options:F.options}),implicit:F.rule.implicit,isAsync:F.rule.isAsync}})}parse(D){return this.options.parse=D,this}use(D){return this.validations.push(I6 in D?D[I6]():D),this}bail(D){return this.options.bail=D,this}},tj=class D extends BE{#D;#F=!1;[R0]="vine.array";[B2]=(F)=>{return Array.isArray(F)};constructor(F,E,w){super(E,w);this.#D=F}allowUnknownProperties(){return this.#F=!0,this}clone(){const F=new D(this.#D.map((E)=>E.clone()),this.cloneOptions(),this.cloneValidations());if(this.#F)F.allowUnknownProperties();return F}[ED](F,E,w){return{type:"tuple",fieldName:F,propertyName:w.toCamelCase?tD(F):F,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,allowUnknownProperties:this.#F,parseFnId:this.options.parse?E.trackParser(this.options.parse):void 0,validations:this.compileValidations(E),properties:this.#D.map(($,C)=>$[ED](String(C),E,w))}}},sO=O((D,F,E)=>{if(!E.isValid)return;if(D.length<F.min)E.report(q["array.minLength"],"array.minLength",E,F)}),uO=O((D,F,E)=>{if(!E.isValid)return;if(D.length>F.max)E.report(q["array.maxLength"],"array.maxLength",E,F)}),dO=O((D,F,E)=>{if(!E.isValid)return;if(D.length!==F.size)E.report(q["array.fixedLength"],"array.fixedLength",E,F)}),vO=O((D,F,E)=>{if(!E.isValid)return;if(D.length<=0)E.report(q.notEmpty,"notEmpty",E)}),mO=O((D,F,E)=>{if(!E.isValid)return;if(!d.isDistinct(D,F.fields))E.report(q.distinct,"distinct",E,F)}),nO=O((D,F,E)=>{if(!E.isValid)return;E.mutate(D.filter((w)=>d.exists(w)&&w!==""),E)}),ej=class D extends BE{static rules={compact:nO,notEmpty:vO,distinct:mO,minLength:sO,maxLength:uO,fixedLength:dO};#D;[R0]="vine.array";[B2]=(F)=>{return Array.isArray(F)};constructor(F,E,w){super(E,w);this.#D=F}minLength(F){return this.use(sO({min:F}))}maxLength(F){return this.use(uO({max:F}))}fixedLength(F){return this.use(dO({size:F}))}notEmpty(){return this.use(vO())}distinct(F){return this.use(mO({fields:F}))}compact(){return this.use(nO())}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[ED](F,E,w){return{type:"array",fieldName:F,propertyName:w.toCamelCase?tD(F):F,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[ED]("*",E,w),parseFnId:this.options.parse?E.trackParser(this.options.parse):void 0,validations:this.compileValidations(E)}}},i8D=class D extends CE{#D;[R0]="types.object";[B2]=(F)=>{return F!==null&&typeof F==="object"&&!Array.isArray(F)};constructor(F){super();this.#D=F}clone(){return new D(this.#D.clone())}[ED](F,E,w){return w.toCamelCase=!0,this.#D[ED](F,E,w)}},DP=class D extends BE{#D;#F=[];#E=!1;[R0]="vine.object";[B2]=(F)=>{return F!==null&&typeof F==="object"&&!Array.isArray(F)};constructor(F,E,w){super(E,w);this.#D=F}getProperties(){return Object.keys(this.#D).reduce((F,E)=>{return F[E]=this.#D[E].clone(),F},{})}allowUnknownProperties(){return this.#E=!0,this}merge(F){return this.#F.push(F),this}clone(){const F=new D(this.getProperties(),this.cloneOptions(),this.cloneValidations());if(this.#F.forEach((E)=>F.merge(E)),this.#E)F.allowUnknownProperties();return F}toCamelCase(){return new i8D(this)}[ED](F,E,w){return{type:"object",fieldName:F,propertyName:w.toCamelCase?tD(F):F,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,parseFnId:this.options.parse?E.trackParser(this.options.parse):void 0,allowUnknownProperties:this.#E,validations:this.compileValidations(E),properties:Object.keys(this.#D).map(($)=>{return this.#D[$][ED]($,E,w)}),groups:this.#F.map(($)=>{return $[ED](E,w)})}}},lO=O((D,F,E)=>{if(!E.isValid)return;if(Object.keys(D).length<F.min)E.report(q["record.minLength"],"record.minLength",E,F)}),iO=O((D,F,E)=>{if(!E.isValid)return;if(Object.keys(D).length>F.max)E.report(q["record.maxLength"],"record.maxLength",E,F)}),pO=O((D,F,E)=>{if(!E.isValid)return;if(Object.keys(D).length!==F.size)E.report(q["record.fixedLength"],"record.fixedLength",E,F)}),aO=O((D,F,E)=>{if(!E.isValid)return;F(Object.keys(D),E)}),FP=class D extends BE{static rules={maxLength:iO,minLength:lO,fixedLength:pO,validateKeys:aO};#D;[R0]="vine.object";[B2]=(F)=>{return F!==null&&typeof F==="object"&&!Array.isArray(F)};constructor(F,E,w){super(E,w);this.#D=F}minLength(F){return this.use(lO({min:F}))}maxLength(F){return this.use(iO({max:F}))}fixedLength(F){return this.use(pO({size:F}))}validateKeys(...F){return this.use(aO(...F))}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[ED](F,E,w){return{type:"record",fieldName:F,propertyName:w.toCamelCase?tD(F):F,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[ED]("*",E,w),parseFnId:this.options.parse?E.trackParser(this.options.parse):void 0,validations:this.compileValidations(E)}}},oO=O((D,F,E)=>{if(typeof D!=="string")E.report(q.string,"string",E)}),tO=O((D,F,E)=>{if(!E.isValid)return;if(!d.isEmail(D,F))E.report(q.email,"email",E)}),eO=O((D,F,E)=>{if(!E.isValid)return;const w=F&&typeof F==="function"?F(E):F,$=w?.locale||"any";if(!d.isMobilePhone(D,$,w))E.report(q.mobile,"mobile",E)}),Dj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isIP(D,F?.version))E.report(q.ipAddress,"ipAddress",E)}),Fj=O((D,F,E)=>{if(!E.isValid)return;if(!F.test(D))E.report(q.regex,"regex",E)}),Ej=O((D,F,E)=>{if(!E.isValid)return;if(!d.isHexColor(D))E.report(q.hexCode,"hexCode",E)}),wj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isURL(D,F))E.report(q.url,"url",E)}),$j=O(async(D,F,E)=>{if(!E.isValid)return;if(!await d.isActiveURL(D))E.report(q.activeUrl,"activeUrl",E)}),fj=O((D,F,E)=>{if(!E.isValid)return;let w="a-zA-Z";if(F){if(F.allowSpaces)w+="\\s";if(F.allowDashes)w+="-";if(F.allowUnderscores)w+="_"}if(!new RegExp(`^[${w}]+\$`).test(D))E.report(q.alpha,"alpha",E)}),Cj=O((D,F,E)=>{if(!E.isValid)return;let w="a-zA-Z0-9";if(F){if(F.allowSpaces)w+="\\s";if(F.allowDashes)w+="-";if(F.allowUnderscores)w+="_"}if(!new RegExp(`^[${w}]+\$`).test(D))E.report(q.alphaNumeric,"alphaNumeric",E)}),Bj=O((D,F,E)=>{if(!E.isValid)return;if(D.length<F.min)E.report(q.minLength,"minLength",E,F)}),hj=O((D,F,E)=>{if(!E.isValid)return;if(D.length>F.max)E.report(q.maxLength,"maxLength",E,F)}),Uj=O((D,F,E)=>{if(!E.isValid)return;if(D.length!==F.size)E.report(q.fixedLength,"fixedLength",E,F)}),Aj=O((D,F,E)=>{if(!E.isValid)return;if(!D.endsWith(F.substring))E.report(q.endsWith,"endsWith",E,F)}),Ij=O((D,F,E)=>{if(!E.isValid)return;if(!D.startsWith(F.substring))E.report(q.startsWith,"startsWith",E,F)}),Mj=O((D,F,E)=>{if(!E.isValid)return;if(d.getNestedValue(F.otherField,E)!==D){E.report(q.sameAs,"sameAs",E,F);return}}),Gj=O((D,F,E)=>{if(!E.isValid)return;if(d.getNestedValue(F.otherField,E)===D){E.report(q.notSameAs,"notSameAs",E,F);return}}),Yj=O((D,F,E)=>{if(!E.isValid)return;const w=F?.confirmationField||`${E.name}_confirmation`;if(E.parent[w]!==D){E.report(q.confirmed,"confirmed",E,{otherField:w});return}}),Zj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(D.trim(),E)}),Wj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(wP.default.default(D,F),E)}),Xj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(D.toLocaleUpperCase(F),E)}),Jj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(D.toLocaleLowerCase(F),E)}),zj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(tD(D),E)}),Tj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(EP.default.default(D),E)}),Kj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(mh(D,F),E)}),Sj=O((D,F,E)=>{if(!E.isValid)return;if(!(typeof F.choices==="function"?F.choices(E):F.choices).includes(D)){E.report(q.in,"in",E,F);return}}),Qj=O((D,F,E)=>{if(!E.isValid)return;if((typeof F.list==="function"?F.list(E):F.list).includes(D)){E.report(q.notIn,"notIn",E,F);return}}),Hj=O((D,F,E)=>{if(!E.isValid)return;const w=F?typeof F==="function"?F(E)?.provider||[]:F.provider:[];if(!w.length){if(!d.isCreditCard(D))E.report(q.creditCard,"creditCard",E,{providersList:"credit"})}else if(!w.find((C)=>d.isCreditCard(D,{provider:C})))E.report(q.creditCard,"creditCard",E,{providers:w,providersList:w.join("/")})}),Lj=O((D,F,E)=>{if(!E.isValid)return;const w=typeof F==="function"?F(E).countryCode:F.countryCode;if(!w.find((C)=>d.isPassportNumber(D,C)))E.report(q.passport,"passport",E,{countryCodes:w})}),Rj=O((D,F,E)=>{if(!E.isValid)return;const w=F?typeof F==="function"?F(E)?.countryCode||[]:F.countryCode:[];if(!w.length){if(!d.isPostalCode(D,"any"))E.report(q.postalCode,"postalCode",E)}else if(!w.find((C)=>d.isPostalCode(D,C)))E.report(q.postalCode,"postalCode",E,{countryCodes:w})}),Vj=O((D,F,E)=>{if(!E.isValid)return;if(!F||!F.version){if(!d.isUUID(D))E.report(q.uuid,"uuid",E)}else if(!F.version.find(($)=>d.isUUID(D,$)))E.report(q.uuid,"uuid",E,F)}),Nj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isAscii(D))E.report(q.ascii,"ascii",E)}),qj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isIBAN(D))E.report(q.iban,"iban",E)}),Oj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isJWT(D))E.report(q.jwt,"jwt",E)}),jj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isLatLong(D))E.report(q.coordinates,"coordinates",E)}),f7=class D extends G1{static rules={in:Sj,jwt:Oj,url:wj,iban:qj,uuid:Vj,trim:Zj,email:tO,alpha:fj,ascii:Nj,notIn:Qj,regex:Fj,escape:Tj,sameAs:Mj,mobile:eO,string:oO,hexCode:Ej,passport:Lj,endsWith:Aj,confirmed:Yj,activeUrl:$j,minLength:Bj,notSameAs:Gj,maxLength:hj,ipAddress:Dj,creditCard:Hj,postalCode:Rj,startsWith:Ij,toUpperCase:Xj,toLowerCase:Jj,toCamelCase:zj,fixedLength:Uj,coordinates:jj,normalizeUrl:Kj,alphaNumeric:Cj,normalizeEmail:Wj};[R0]="vine.string";[B2]=(F)=>{return typeof F==="string"};constructor(F,E){super(F,E||[oO()])}url(...F){return this.use(wj(...F))}activeUrl(){return this.use($j())}email(...F){return this.use(tO(...F))}mobile(...F){return this.use(eO(...F))}ipAddress(F){return this.use(Dj(F?{version:F}:void 0))}hexCode(){return this.use(Ej())}regex(F){return this.use(Fj(F))}alpha(F){return this.use(fj(F))}alphaNumeric(F){return this.use(Cj(F))}minLength(F){return this.use(Bj({min:F}))}maxLength(F){return this.use(hj({max:F}))}fixedLength(F){return this.use(Uj({size:F}))}confirmed(F){return this.use(Yj(F))}trim(){return this.use(Zj())}normalizeEmail(F){return this.use(Wj(F))}toUpperCase(){return this.use(Xj())}toLowerCase(){return this.use(Jj())}toCamelCase(){return this.use(zj())}escape(){return this.use(Tj())}normalizeUrl(...F){return this.use(Kj(...F))}startsWith(F){return this.use(Ij({substring:F}))}endsWith(F){return this.use(Aj({substring:F}))}sameAs(F){return this.use(Mj({otherField:F}))}notSameAs(F){return this.use(Gj({otherField:F}))}in(F){return this.use(Sj({choices:F}))}notIn(F){return this.use(Qj({list:F}))}creditCard(...F){return this.use(Hj(...F))}passport(...F){return this.use(Lj(...F))}postalCode(...F){return this.use(Rj(...F))}uuid(...F){return this.use(Vj(...F))}ascii(){return this.use(Nj())}iban(){return this.use(qj())}jwt(){return this.use(Oj())}coordinates(){return this.use(jj())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},Pj=O((D,F,E)=>{const w=F.strict?D:d.asNumber(D);if(typeof w!=="number"||Number.isNaN(w)||w===Number.POSITIVE_INFINITY||w===Number.NEGATIVE_INFINITY){E.report(q.number,"number",E);return}E.mutate(w,E)}),yj=O((D,F,E)=>{if(!E.isValid)return;if(D<F.min)E.report(q.min,"min",E,F)}),kj=O((D,F,E)=>{if(!E.isValid)return;if(D>F.max)E.report(q.max,"max",E,F)}),bj=O((D,F,E)=>{if(!E.isValid)return;if(D<F.min||D>F.max)E.report(q.range,"range",E,F)}),xj=O((D,F,E)=>{if(!E.isValid)return;if(D<0)E.report(q.positive,"positive",E)}),cj=O((D,F,E)=>{if(!E.isValid)return;if(D>=0)E.report(q.negative,"negative",E)}),gj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isDecimal(String(D),{force_decimal:F.range[0]!==0,decimal_digits:F.range.join(",")}))E.report(q.decimal,"decimal",E,{digits:F.range.join("-")})}),rj=O((D,F,E)=>{if(!E.isValid)return;if(!Number.isInteger(D))E.report(q.withoutDecimals,"withoutDecimals",E)}),_j=O((D,F,E)=>{if(!E.isValid)return;if(!F.values.includes(D))E.report(q["number.in"],"in",E,F)}),LF=class D extends G1{static rules={in:_j,max:kj,min:yj,range:bj,number:Pj,decimal:gj,negative:cj,positive:xj,withoutDecimals:rj};[R0]="vine.number";[B2]=(F)=>{const E=d.asNumber(F);return!Number.isNaN(E)};constructor(F,E){super(F,E||[Pj(F||{})])}min(F){return this.use(yj({min:F}))}max(F){return this.use(kj({max:F}))}range(F){return this.use(bj({min:F[0],max:F[1]}))}positive(){return this.use(xj())}negative(){return this.use(cj())}decimal(F){return this.use(gj({range:Array.isArray(F)?F:[F]}))}withoutDecimals(){return this.use(rj())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}in(F){return this.use(_j({values:F}))}},sj=O((D,F,E)=>{const w=F.strict===!0?D:d.asBoolean(D);if(typeof w!=="boolean"){E.report(q.boolean,"boolean",E);return}E.mutate(w,E)}),RF=class D extends G1{static rules={boolean:sj};[R0]="vine.boolean";[B2]=(F)=>{return typeof(this.options.strict===!0?F:d.asBoolean(F))==="boolean"};constructor(F,E){super(F,E||[sj(F||{})])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},uj=O((D,F,E)=>{let w=D;if(typeof F.expectedValue==="boolean")w=d.asBoolean(D);else if(typeof F.expectedValue==="number")w=d.asNumber(D);if(w!==F.expectedValue){E.report(q.literal,"literal",E,F);return}E.mutate(w,E)}),$P=class D extends G1{static rules={equals:uj};#D;constructor(F,E,w){super(E,w||[uj({expectedValue:F})]);this.#D=F}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},p8D=["on","1","yes","true",!0,1],dj=O((D,F,E)=>{if(!p8D.includes(D))E.report(q.accepted,"accepted",E)}),fP=class D extends G1{static rules={accepted:dj};constructor(F,E){super(F,E||[dj()])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},a8D=class D{#D;#F=(F,E)=>{E.report(q.unionGroup,"unionGroup",E)};constructor(F){this.#D=F}clone(){const F=new D(this.#D);return F.otherwise(this.#F),F}otherwise(F){return this.#F=F,this}[ED](F,E){return{type:"group",elseConditionalFnRefId:F.trackConditional(this.#F),conditions:this.#D.map((w)=>w[ED](F,E))}}},CP=class{#D;#F;constructor(D,F){this.#D=F,this.#F=D}[ED](D,F){return{schema:{type:"sub_object",properties:Object.keys(this.#D).map((E)=>{return this.#D[E][ED](E,D,F)}),groups:[]},conditionalFnRefId:D.trackConditional(this.#F)}}};oh.if=function D(F,E){return new CP(F,E)};oh.else=function D(F){return new CP(()=>!0,F)};var o8D=class D extends G1{static rules={enum:w7};#D;constructor(F,E,w){super(E,w||[w7({choices:Object.values(F)})]);this.#D=F}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},t8D=class D{#D;#F=(F,E)=>{E.report(q.unionOfTypes,"unionOfTypes",E)};constructor(F){this.#D=F}otherwise(F){return this.#F=F,this}clone(){const F=new D(this.#D);return F.otherwise(this.#F),F}[ED](F,E,w){return{type:"union",fieldName:F,propertyName:w.toCamelCase?tD(F):F,elseConditionalFnRefId:E.trackConditional(this.#F),conditions:this.#D.map(($)=>{return{conditionalFnRefId:E.trackConditional((C,f)=>{return $[B2](C,f)}),schema:$[ED](F,E,w)}})}}},e8D=class extends KF{group=oh;union=ah;string(){return new f7}boolean(D){return new RF(D)}accepted(){return new fP}number(D){return new LF(D)}date(D){return new ph(D)}literal(D){return new $P(D)}object(D){return new DP(D)}array(D){return new ej(D)}tuple(D){return new tj(D)}record(D){return new FP(D)}enum(D){if(Array.isArray(D)||typeof D==="function")return new HF(D);return new o8D(D)}any(){return new mj}unionOfTypes(D){const F=new Set;return D.forEach((E)=>{if(!E[B2]||!E[R0])throw new Error(`Cannot use "${E.constructor.name}". The schema type is not compatible for use with "vine.unionOfTypes"`);if(F.has(E[R0]))throw new Error(`Cannot use duplicate schema "${E[R0]}". "vine.unionOfTypes" needs distinct schema types only`);F.add(E[R0])}),F.clear(),new t8D(D)}},D6D={required:q.required,array:q.array,object:q.object},ih=class{#D;messagesProvider;errorReporter;#F(D){const F=VO();return{compilerNode:{type:"root",schema:D[ED]("",F,{toCamelCase:!1})},refs:F.toJSON()}}constructor(D,F){const{compilerNode:E,refs:w}=this.#F(D);this.#D={schema:E,refs:w};const $=F.metaDataValidator,C=new RO(E,{convertEmptyStringsToNull:F.convertEmptyStringsToNull,messages:D6D}).compile();if(this.errorReporter=F.errorReporter,this.messagesProvider=F.messagesProvider,$)this.validate=(f,B)=>{let h=B??{};const U=h.meta??{},I=h.errorReporter??this.errorReporter,A=h.messagesProvider??this.messagesProvider;return $(U),C(f,U,w,A,I())};else this.validate=(f,B)=>{let h=B??{};const U=h.meta??{},I=h.errorReporter??this.errorReporter,A=h.messagesProvider??this.messagesProvider;return C(f,U,w,A,I())}}async tryValidate(D,...[F]){try{return[null,await this.validate(D,F)]}catch(E){if(E instanceof Ph)return[E,null];throw E}}toJSON(){const{schema:D,refs:F}=this.#D;return{schema:structuredClone(D),refs:F}}},BP=class extends e8D{messagesProvider=new EE(q,iN);errorReporter=()=>new yh;convertEmptyStringsToNull=!1;helpers=d;createRule=O;compile(D){return new ih(D,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter})}withMetaData(D){return{compile:(F)=>{return new ih(F,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter,metaDataValidator:D})}}}validate(D){return this.compile(D.schema).validate(D.data,D)}tryValidate(D){return this.compile(D.schema).tryValidate(D.data,D)}},F6D=new BP,r=F6D;zU();C7();h7();hE();function HFD(){const D=/--verbose(?!\s*=\s*false|\s+false)(?:\s+|=true)?(?:$|\s)/,F=SU();if(D.test(F))return 4;return 3}var GE={...Z7({level:HFD()}),warning:(D)=>console.warn(D),dump:(...D)=>console.log(...D),dd:(...D)=>{console.log(...D),W7.exit(1)},echo:(D)=>console.log(D)};var d1={info:async(D,F)=>{if(F?.styled===!1)console.log(D);else GE.info(D);await g8(`INFO: ${Z0(D)}`)},success:async(D,F)=>{if(F?.styled===!1)console.log(D);else GE.success(D);await g8(`SUCCESS: ${Z0(D)}`)},warn:async(D,F)=>{if(F?.styled===!1)console.log(D);else GE.warn(D);await g8(`WARN: ${Z0(D)}`)},warning:async(D,F)=>{if(F?.styled===!1)console.log(D);else GE.warn(D);await g8(`WARN: ${Z0(D)}`)},error:async(D,F)=>{YE(D,F)},debug:async(...D)=>{const E=`DEBUG: ${D.map((w)=>typeof w==="object"?JSON.stringify(w,null,2):w).join(" ")}`;if(W7.env.APP_ENV==="production"||W7.env.APP_ENV==="prod")return g8(E);GE.debug(E),await g8(Z0(E))},dump:(...D)=>D.forEach((F)=>console.log(F)),dd:(...D)=>{D.forEach((F)=>console.log(F)),W7.exit(1)},echo:(...D)=>console.log(...D)};function mP(D){return J7(`database/${D||""}`)}function RFD(D){return J7(`app/${D||""}`)}function nP(D){return RFD(`Commands/${D||""}`)}function QU(D){return z7(`logs/${D||""}`)}function J7(D="",F){let E=dP.cwd();while(E.includes("storage"))E=uP(E,"..");const w=uP(E,D);if(F?.relative)return LFD(dP.cwd(),w);return w}function z7(D){return J7(`storage/${D||""}`)}var NFD={ai:{deploy:!1,models:["amazon.titan-embed-text-v1","amazon.titan-text-express-v1","amazon.titan-embed-image-v1","amazon.titan-image-generator-v1","anthropic.claude-v1","anthropic.claude-v2","anthropic.claude-v2:1","anthropic.claude-instant-v1","meta.llama2-13b-chat-v1","meta.llama2-70b-chat-v1"]},analytics:{driver:void 0},app:{name:"Stacks",description:"A Stacks application.",env:"local",url:"stacks.localhost",debug:!0,key:"",timezone:"UTC",locale:"en",fallbackLocale:"en",cipher:"AES-256-CBC",docMode:!1,redirectUrls:[],maintenanceMode:!1},cli:{name:"My Custom CLI",command:"my-custom-cli",description:"Stacks is a full-stack framework for TypeScript.",source:nP(),deploy:!1},cache:{driver:"redis",prefix:"stx",ttl:3600,drivers:{redis:{connection:"default",host:"localhost",port:6379,username:"",password:""}}},cloud:{type:"serverless",driver:"aws",storage:{},environments:["production","staging","development"],firewall:{enabled:!0,countryCodes:[],ipAddresses:[],queryString:[],httpHeaders:[],rateLimitPerMinute:1000,useIpReputationLists:!0,useKnownBadInputsRuleSet:!0},cdn:{allowedMethods:"GET_HEAD",cachedMethods:"GET_HEAD",minTtl:0,defaultTtl:86400,maxTtl:31536000,compress:!0,priceClass:"PriceClass_All",originShieldRegion:"us-east-1",cookieBehavior:"none",allowList:{cookies:[],headers:[],queryStrings:[]},realtimeLogs:{enabled:!0,samplingRate:2}},fileSystem:!1},database:{default:"sqlite",connections:{sqlite:{database:mP("stacks.sqlite"),prefix:""}},migrations:"migrations",migrationLocks:"migration_locks"},dns:{driver:"aws",a:[],aaaa:[],cname:[],mx:[],txt:[]},docs:{lang:"en-US",title:"Stacks",description:"Rapid application, cloud & library framework.",lastUpdated:!0,deploy:!1,themeConfig:{editLink:{pattern:"https://github.com/stacksjs/stacks/edit/main/docs/docs/:path",text:"Edit this page on GitHub"},footer:{message:"Released under the MIT License.",copyright:"Copyright \xA9 2024-present Stacks.js, Inc."}}},email:{from:{name:"Stacks",address:"no-reply@stacksjs.org"},mailboxes:[],server:{scan:!0}},errors:{messages:{string:"The {{ field }} field must be a string",email:"The {{ field }} field must be a valid email address",regex:"The {{ field }} field format is invalid",url:"The {{ field }} field must be a valid URL",activeUrl:"The {{ field }} field must be a valid URL",alpha:"The {{ field }} field must contain only letters",alphaNumeric:"The {{ field }} field must contain only letters and numbers",minLength:"The {{ field }} field must have at least {{ min }} characters",maxLength:"The {{ field }} field must not be greater than {{ max }} characters",fixedLength:"The {{ field }} field must be {{ size }} characters long",confirmed:"The {{ field }} field and {{ otherField }} field must be the same",endsWith:"The {{ field }} field must end with {{ substring }}",startsWith:"The {{ field }} field must start with {{ substring }}",sameAs:"The {{ field }} field and {{ otherField }} field must be the same",notSameAs:"The {{ field }} field and {{ otherField }} field must be different",in:"The selected {{ field }} is invalid",notIn:"The selected {{ field }} is invalid",ipAddress:"The {{ field }} field must be a valid IP address",uuid:"The {{ field }} field must be a valid UUID",ascii:"The {{ field }} field must only contain ASCII characters",creditCard:"The {{ field }} field must be a valid {{ providersList }} card number",hexCode:"The {{ field }} field must be a valid hex color code",iban:"The {{ field }} field must be a valid IBAN number",jwt:"The {{ field }} field must be a valid JWT token",coordinates:"The {{ field }} field must contain latitude and longitude coordinates",mobile:"The {{ field }} field must be a valid mobile phone number",passport:"The {{ field }} field must be a valid passport number",postalCode:"The {{ field }} field must be a valid postal code",boolean:"The value must be a boolean",number:"The {{ field }} field must be a number",min:"The {{ field }} field must be at least {{ min }}",max:"The {{ field }} field must not be greater than {{ max }}",range:"The {{ field }} field must be between {{ min }} and {{ max }}",positive:"The {{ field }} field must be positive",negative:"The {{ field }} field must be negative",decimal:"The {{ field }} field must have {{ digits }} decimal places",withoutDecimals:"The {{ field }} field must not have decimal places",date:"The {{ field }} field must be a datetime value","date.equals":"The {{ field }} field must be a date equal to {{ expectedValue }}","date.after":"The {{ field }} field must be a date after {{ expectedValue }}","date.before":"The {{ field }} field must be a date before {{ expectedValue }}","date.afterOrEqual":"The {{ field }} field must be a date after or equal to {{ expectedValue }}","date.beforeOrEqual":"The {{ field }} field must be a date before or equal to {{ expectedValue }}","date.sameAs":"The {{ field }} field and {{ otherField }} field must be the same","date.notSameAs":"The {{ field }} field and {{ otherField }} field must be different","date.afterField":"The {{ field }} field must be a date after {{ otherField }}",accepted:"The {{ field }} field must be accepted",enum:"The selected {{ field }} is invalid",literal:"The {{ field }} field must be {{ expectedValue }}",object:"The {{ field }} field must be an object",record:"The {{ field }} field must be an object","record.minLength":"The {{ field }} field must have at least {{ min }} items","record.maxLength":"The {{ field }} field must not have more than {{ max }} items","record.fixedLength":"The {{ field }} field must contain {{ size }} items",array:"The {{ field }} field must be an array","array.minLength":"The {{ field }} field must have at least {{ min }} items","array.maxLength":"The {{ field }} field must not have more than {{ max }} items","array.fixedLength":"The {{ field }} field must contain {{ size }} items",notEmpty:"The {{ field }} field must not be empty",distinct:"The {{ field }} field has duplicate values",tuple:"The {{ field }} field must be an array",union:"Invalid value provided for {{ field }} field",unionGroup:"Invalid value provided for {{ field }} field",unionOfTypes:"Invalid value provided for {{ field }} field"}},git:{hooks:{"pre-commit":"lint-staged"},scopes:["","ci","deps","dx","release","docs","test","core","actions","arrays","auth","build","cache","cli","cloud","collections","config","database","datetime","docs","errors","git","lint","x-ray","modules","notifications","objects","path","realtime","router","buddy","security","server","storage","strings","tests","types","ui","utils"],messages:{type:"Select the type of change that you\u2019re committing:",scope:"Select the SCOPE of this change (optional):",customScope:"Select the SCOPE of this change:",subject:"Write a SHORT, IMPERATIVE tense description of the change:\n",body:'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',breaking:'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',footerPrefixesSelect:"Select the ISSUES type of the change list by this change (optional):",customFooterPrefixes:"Input ISSUES prefix:",footer:"List any ISSUES by this change. E.g.: #31, #34:\n",confirmCommit:"Are you sure you want to proceed with the commit above?"},types:[{value:"feat",name:"feat: \u2728 A new feature",emoji:":sparkles:"},{value:"fix",name:"fix: \uD83D\uDC1B A bug fix",emoji:":bug:"},{value:"docs",name:"docs: \uD83D\uDCDD Documentation only changes",emoji:":memo:"},{value:"style",name:"style: \uD83D\uDC84 Changes that do not affect the meaning of the code",emoji:":lipstick:"},{value:"refactor",name:"refactor: \u267B\uFE0F A code change that neither fixes a bug nor adds a feature",emoji:":recycle:"},{value:"perf",name:"perf: \u26A1\uFE0F A code change that improves performance",emoji:":zap:"},{value:"test",name:"test: \u2705 Adding missing tests or adjusting existing tests",emoji:":white_check_mark:"},{value:"build",name:"build: \uD83D\uDCE6\uFE0F Changes that affect the build system or external dependencies",emoji:":package:"},{value:"ci",name:"ci: \uD83C\uDFA1 Changes to our CI configuration files and scripts",emoji:":ferris_wheel:"},{value:"chore",name:"chore: \uD83D\uDD28 Other changes that don\u2019t modify src or test files",emoji:":hammer:"},{value:"revert",name:"revert: \u23EA\uFE0F Reverts a previous commit",emoji:":rewind:"}]},hashing:{driver:"argon2",bcrypt:{rounds:10,cost:4},argon2:{memory:65536,time:1}},library:{name:"hello-world",owner:"@stacksjs",repository:"stacksjs/stacks",license:"MIT",author:"Chris Breuer",contributors:["Chris Breuer <chris@stacksjs.org>"],defaultLanguage:"en",vueComponents:{name:"hello-world-vue",description:"Your Vue component library description",keywords:["component","library","vue","vite","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},webComponents:{name:"hello-world-elements",description:"Your framework agnostic web component library description.",keywords:["custom-elements","web-components","library","framework-agnostic","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},functions:{name:"hello-world-fx",description:"Your function library description.",keywords:["functions","composables","library","typescript","javascript"],shouldGenerateSourcemap:!1,files:["counter","dark"]}},logging:{logsPath:"storage/logs/stacks.log",deploymentsPath:"storage/logs/deployments.log"},notification:{default:"email"},payment:{driver:"stripe"},ports:{frontend:3000,backend:3001,admin:3002,library:3003,desktop:3004,email:3005,docs:3006,inspect:3007,api:3008,systemTray:3009,database:3010},queue:{default:"sync",connections:{sync:{driver:"sync"},database:{driver:"database",table:"jobs",queue:"default",retry_after:90},redis:{driver:"redis",connection:"default",queue:"default",retry_after:90},sqs:{driver:"sqs",key:"",secret:"",prefix:"",suffix:"",queue:"default",region:"us-east-1"}}},searchEngine:{driver:"opensearch"},security:{firewall:{enabled:!0,countryCodes:[],ipAddresses:[],queryString:[],httpHeaders:[],rateLimitPerMinute:1000,useIpReputationLists:!0,useKnownBadInputsRuleSet:!0}},services:{aws:{accountId:"",appId:"",apiKey:"",region:"us-east-1"},algolia:{appId:"",apiKey:""},meilisearch:{appId:"",apiKey:""},stripe:{appId:"",apiKey:""}},storage:{driver:"s3"},team:{name:"Stacks",members:{"Chris Breuer":"chris@stacksjs.org"}},ui:{shortcuts:[["btn","inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer"]],safelist:"prose prose-sm m-auto text-left",trigger:":stx:",classPrefix:"stx-",reset:"tailwind",icons:["heroicons"],fonts:{email:{title:"Mona",text:"Hubot"},desktop:{title:"Mona",text:"Hubot"},mobile:{title:"Mona",text:"Hubot"},web:{title:"Mona",text:"Hubot"}}}},HU=NFD;var lP={default:"meta.llama2-70b-chat-v1",models:["amazon.titan-text-express-v1","amazon.titan-text-lite-v1","meta.llama2-70b-chat-v1"],deploy:!0};var iP={driver:"fathom",drivers:{googleAnalytics:{trackingId:"UA-XXXXXXXXX-X"},fathom:{siteId:"WOLZMJDL"}}};import jFD from"process";function yFD(){return typeof Bun!=="undefined"?Bun.env:jFD.env}var pP={APP_NAME:r.string(),APP_ENV:r.enum(["local","dev","stage","prod"]),APP_KEY:r.string(),APP_URL:r.string(),PORT:r.number(),PORT_BACKEND:r.number(),PORT_ADMIN:r.number(),PORT_LIBRARY:r.number(),PORT_DESKTOP:r.number(),PORT_EMAIL:r.number(),PORT_DOCS:r.number(),PORT_INSPECT:r.number(),PORT_API:r.number(),PORT_SYSTEM_TRAY:r.number(),APP_MAINTENANCE:r.boolean(),DEBUG:r.boolean(),API_PREFIX:r.string(),DOCS_PREFIX:r.string(),DB_CONNECTION:r.enum(["mysql","sqlite","postgres"]),DB_HOST:r.string(),DB_PORT:r.number(),DB_DATABASE:r.string(),DB_USERNAME:r.string(),DB_PASSWORD:r.string(),AWS_ACCOUNT_ID:r.string(),AWS_ACCESS_KEY_ID:r.string(),AWS_SECRET_ACCESS_KEY:r.string(),AWS_DEFAULT_REGION:r.string(),AWS_DEFAULT_PASSWORD:r.string(),MAIL_MAILER:r.enum(["ses","sendmail","log","smtp"]),MAIL_HOST:r.string(),MAIL_PORT:r.number(),MAIL_USERNAME:r.string(),MAIL_PASSWORD:r.string(),MAIL_ENCRYPTION:r.string(),MAIL_FROM_NAME:r.string(),MAIL_FROM_ADDRESS:r.string(),SEARCH_ENGINE_DRIVER:r.enum(["meilisearch","algolia","typesense"]),MEILISEARCH_HOST:r.string(),MEILISEARCH_KEY:r.string(),FRONTEND_APP_ENV:r.enum(["development","staging","production"]),FRONTEND_APP_URL:r.string()};var qFD={APP_ENV:["local","dev","development","staging","prod","production"],DB_CONNECTION:["mysql","sqlite","postgres","dynamodb"],MAIL_MAILER:["smtp","mailgun","ses","postmark","sendmail","log"],SEARCH_ENGINE_DRIVER:["opensearch"],FRONTEND_APP_ENV:["development","staging","production"]},OFD=Object.entries(pP).reduce((D,[F,E])=>{let w;switch(typeof E){case"string":w=r.string();break;case"number":w=r.number();break;case"boolean":w=r.boolean();break;default:if(Array.isArray(E)){w=r.enum(E);break}if(typeof E==="object"){const C=Symbol.for("schema_name"),f=E[C];if(f==="vine.string"){w=r.string();break}if(f==="vine.number"){w=r.number();break}if(f==="vine.boolean"){w=r.boolean();break}if(!f){w=r.enum(qFD.APP_ENV);break}console.error("Unknown env value type",typeof E)}throw new Error(`Invalid env value for ${F}`)}const $=F;return D[$]=w,D},{}),rbD=r.object(OFD);var PFD={get:(D,F)=>{const E=D[F];if(typeof E==="string"&&/^\d+$/.test(E)&&F!=="AWS_ACCOUNT_ID")return Number(E);if(typeof E==="string"&&/^true|false$/.test(E))return E==="true";if(E instanceof HF)return D[F];if(E instanceof RF)return!!D[F];if(E instanceof LF)return Number(D[F]);return E}},s=new Proxy(yFD(),PFD);var aP={name:s.APP_NAME??"Stacks",description:"Stacks is a full-stack framework for building modern web applications.",env:s.APP_ENV??"local",url:s.APP_URL??"stacks.localhost",redirectUrls:["stacksjs.com"],debug:s.DEBUG??!1,key:s.APP_KEY,maintenanceMode:s.APP_MAINTENANCE??!1,docMode:!1,timezone:"America/Los_Angeles",locale:"en",fallbackLocale:"en",cipher:"aes-256-cbc"};var oP={driver:"dynamodb",prefix:"stacks",ttl:3600,drivers:{dynamodb:{key:s.AWS_ACCESS_KEY_ID||"",secret:s.AWS_SECRET_ACCESS_KEY||"",region:s.AWS_DEFAULT_REGION||"us-east-1",table:"cache",endpoint:""},memcached:{persistent_id:"",sasl:["",""],options:{},servers:[{host:"127.0.0.1",port:11211,weight:100}]},redis:{connection:"cache",host:"127.0.0.1",port:6379,password:"",username:"stacks"}}};var tP={name:"My Custom CLI",command:"custom-cli",description:"This is an example command to illustrate how to create your own commands. Check out `../app/commands` for more.",deploy:!0};var T7={firewall:{enabled:!0,countryCodes:["RU","IR"],ipAddresses:[],rateLimitPerMinute:1000,useIpReputationLists:!0,useKnownBadInputsRuleSet:!0,queryString:[],httpHeaders:[]}};var eP={type:"serverless",driver:"aws",firewall:T7.firewall,environments:["production","staging","development"],storage:{},api:{prefix:s.API_PREFIX||"api",description:"My awesome Stacks API",deploy:!0,memorySize:512,prewarm:10,timeout:30},cdn:{compress:!0,allowedMethods:"ALL",cachedMethods:"GET_HEAD",originShieldRegion:"us-east-1",minTtl:0,defaultTtl:86400,maxTtl:31536000,cookieBehavior:"none",allowList:{cookies:[],headers:[],queryStrings:[]},realtimeLogs:{enabled:!0,samplingRate:1}},fileSystem:!0};var Dy={default:s.DB_CONNECTION||"sqlite",connections:{sqlite:{database:s.DB_DATABASE||"database/stacks.sqlite",prefix:""},dynamodb:{key:s.AWS_ACCESS_KEY_ID||"",secret:s.AWS_SECRET_ACCESS_KEY||"",region:s.AWS_DEFAULT_REGION||"us-east-1",prefix:s.DB_DATABASE||"stacks",endpoint:"http://localhost",port:s.DB_PORT||8000},mysql:{name:s.DB_DATABASE||"stacks",host:s.DB_HOST||"127.0.0.1",port:s.DB_PORT||3306,username:s.DB_USERNAME||"root",password:s.DB_PASSWORD||"",prefix:""},postgres:{name:s.DB_DATABASE||"stacks",host:s.DB_HOST||"127.0.0.1",port:s.DB_PORT||3306,username:s.DB_USERNAME||"",password:s.DB_PASSWORD||"",prefix:""}},migrations:"migrations",migrationLocks:"migration_locks"};var Fy={a:[{name:s.APP_URL||"",address:"10.0.0.1",ttl:300},{name:"www",address:"@",ttl:300}],aaaa:[],cname:[],mx:[],txt:[],nameservers:[]};var Ey={from:{name:s.MAIL_FROM_NAME||"Stacks",address:s.MAIL_FROM_ADDRESS||"no-reply@stacksjs.org"},mailboxes:["chris@stacksjs.org","blake@stacksjs.org","glenn@stacksjs.org"],url:s.APP_URL||"http://localhost:3000",charset:"UTF-8",server:{scan:!0}};var wy={messages:{string:"The {{ field }} field must be a string",email:"The {{ field }} field must be a valid email address",regex:"The {{ field }} field format is invalid",url:"The {{ field }} field must be a valid URL",activeUrl:"The {{ field }} field must be a valid URL",alpha:"The {{ field }} field must contain only letters",alphaNumeric:"The {{ field }} field must contain only letters and numbers",minLength:"The {{ field }} field must have at least {{ min }} characters",maxLength:"The {{ field }} field must not be greater than {{ max }} characters",fixedLength:"The {{ field }} field must be {{ size }} characters long",confirmed:"The {{ field }} field and {{ otherField }} field must be the same",endsWith:"The {{ field }} field must end with {{ substring }}",startsWith:"The {{ field }} field must start with {{ substring }}",sameAs:"The {{ field }} field and {{ otherField }} field must be the same",notSameAs:"The {{ field }} field and {{ otherField }} field must be different",in:"The selected {{ field }} is invalid",notIn:"The selected {{ field }} is invalid",ipAddress:"The {{ field }} field must be a valid IP address",uuid:"The {{ field }} field must be a valid UUID",ascii:"The {{ field }} field must only contain ASCII characters",creditCard:"The {{ field }} field must be a valid {{ providersList }} card number",hexCode:"The {{ field }} field must be a valid hex color code",iban:"The {{ field }} field must be a valid IBAN number",jwt:"The {{ field }} field must be a valid JWT token",coordinates:"The {{ field }} field must contain latitude and longitude coordinates",mobile:"The {{ field }} field must be a valid mobile phone number",passport:"The {{ field }} field must be a valid passport number",postalCode:"The {{ field }} field must be a valid postal code",boolean:"The value must be a boolean",number:"The {{ field }} field must be a number",min:"The {{ field }} field must be at least {{ min }}",max:"The {{ field }} field must not be greater than {{ max }}",range:"The {{ field }} field must be between {{ min }} and {{ max }}",positive:"The {{ field }} field must be positive",negative:"The {{ field }} field must be negative",decimal:"The {{ field }} field must have {{ digits }} decimal places",withoutDecimals:"The {{ field }} field must not have decimal places",date:"The {{ field }} field must be a datetime value","date.equals":"The {{ field }} field must be a date equal to {{ expectedValue }}","date.after":"The {{ field }} field must be a date after {{ expectedValue }}","date.before":"The {{ field }} field must be a date before {{ expectedValue }}","date.afterOrEqual":"The {{ field }} field must be a date after or equal to {{ expectedValue }}","date.beforeOrEqual":"The {{ field }} field must be a date before or equal to {{ expectedValue }}","date.sameAs":"The {{ field }} field and {{ otherField }} field must be the same","date.notSameAs":"The {{ field }} field and {{ otherField }} field must be different","date.afterField":"The {{ field }} field must be a date after {{ otherField }}",accepted:"The {{ field }} field must be accepted",enum:"The selected {{ field }} is invalid",literal:"The {{ field }} field must be {{ expectedValue }}",object:"The {{ field }} field must be an object",record:"The {{ field }} field must be an object","record.minLength":"The {{ field }} field must have at least {{ min }} items","record.maxLength":"The {{ field }} field must not have more than {{ max }} items","record.fixedLength":"The {{ field }} field must contain {{ size }} items",array:"The {{ field }} field must be an array","array.minLength":"The {{ field }} field must have at least {{ min }} items","array.maxLength":"The {{ field }} field must not have more than {{ max }} items","array.fixedLength":"The {{ field }} field must contain {{ size }} items",notEmpty:"The {{ field }} field must not be empty",distinct:"The {{ field }} field has duplicate values",tuple:"The {{ field }} field must be an array",union:"Invalid value provided for {{ field }} field",unionGroup:"Invalid value provided for {{ field }} field",unionOfTypes:"Invalid value provided for {{ field }} field"}};var $y={hooks:{"pre-commit":"lint-staged"},scopes:["","ci","deps","dx","release","docs","test","core","actions","arrays","auth","build","cache","cli","cloud","collections","config","database","datetime","docs","errors","git","lint","x-ray","modules","notifications","objects","path","realtime","router","buddy","security","server","storage","strings","tests","types","ui","utils"],messages:{type:"Select the type of change that you\u2019re committing:",scope:"Select the SCOPE of this change (optional):",customScope:"Select the SCOPE of this change:",subject:"Write a SHORT, IMPERATIVE tense description of the change:\n",body:'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',breaking:'List any BREAKING CHANGES (optional). Use "|" to break new line:\n',footerPrefixesSelect:"Select the ISSUES type of the change list by this change (optional):",customFooterPrefixes:"Input ISSUES prefix:",footer:"List any ISSUES by this change. E.g.: #31, #34:\n",confirmCommit:"Are you sure you want to proceed with the commit above?"},types:[{value:"feat",name:"feat: \u2728 A new feature",emoji:":sparkles:"},{value:"fix",name:"fix: \uD83D\uDC1B A bug fix",emoji:":bug:"},{value:"docs",name:"docs: \uD83D\uDCDD Documentation only changes",emoji:":memo:"},{value:"style",name:"style: \uD83D\uDC84 Changes that do not affect the meaning of the code",emoji:":lipstick:"},{value:"refactor",name:"refactor: \u267B\uFE0F A code change that neither fixes a bug nor adds a feature",emoji:":recycle:"},{value:"perf",name:"perf: \u26A1\uFE0F A code change that improves performance",emoji:":zap:"},{value:"test",name:"test: \u2705 Adding missing tests or adjusting existing tests",emoji:":white_check_mark:"},{value:"build",name:"build: \uD83D\uDCE6\uFE0F Changes that affect the build system or external dependencies",emoji:":package:"},{value:"ci",name:"ci: \uD83C\uDFA1 Changes to our CI configuration files and scripts",emoji:":ferris_wheel:"},{value:"chore",name:"chore: \uD83D\uDD28 Other changes that don\u2019t modify src or test files",emoji:":hammer:"},{value:"revert",name:"revert: \u23EA\uFE0F Reverts a previous commit",emoji:":rewind:"}]};var fy={driver:"argon2",bcrypt:{rounds:10,cost:4},argon2:{memory:65536,threads:1,time:1}};var Cy={name:"hello-world",owner:"@stacksjs",repository:"stacksjs/stacks",license:"MIT",author:"Chris Breuer",contributors:["Chris Breuer <chris@stacksjs.org>"],defaultLanguage:"en",releaseable:!0,vueComponents:{name:"hello-world-vue",description:"Your Vue component library description",keywords:["component","library","vue","vite","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},webComponents:{name:"hello-world-elements",description:"Your framework agnostic web component library description.",keywords:["custom-elements","web-components","library","framework-agnostic","typescript","javascript"],tags:[{name:["HelloWorld","AppHelloWorld"],description:"The Hello World custom element, built via this framework.",attributes:[{name:"greeting",description:"The greeting."}]}]},functions:{name:"hello-world-fx",description:"Your function library description.",keywords:["functions","composables","library","typescript","javascript"],shouldGenerateSourcemap:!1,files:["counter","dark"]}};var By={logsPath:z7("logs/stacks.log"),deploymentsPath:z7("logs/deployments.log")};var hy={default:"email"};var Uy={driver:"stripe"};var Ay={frontend:s.PORT??3000,backend:s.PORT_BACKEND??3001,admin:s.PORT_ADMIN??3002,library:s.PORT_LIBRARY??3003,desktop:s.PORT_DESKTOP??3004,email:s.PORT_EMAIL??3005,docs:s.PORT_DOCS??3006,inspect:s.PORT_INSPECT??3007,api:s.PORT_API??3008,systemTray:s.PORT_SYSTEM_TRAY??3009,database:3010};var Iy={default:"sync",connections:{sync:{driver:"sync"},sqs:{driver:"sqs",key:"",secret:"",prefix:"",suffix:"",queue:"default",region:"us-east-1"}}};var My={driver:"opensearch"};var Gy={aws:{accountId:s.AWS_ACCOUNT_ID||"",appId:s.AWS_ACCESS_KEY_ID||"",apiKey:s.AWS_SECRET_ACCESS_KEY||"",region:s.AWS_DEFAULT_REGION||"us-east-1"},algolia:{appId:"",apiKey:""},meilisearch:{appId:"",apiKey:""},lemonSqueezy:{appId:"",apiKey:""},stripe:{appId:"",apiKey:""}};var Yy={driver:"s3"};var Zy={name:"Stacks",members:{chris:"chris@stacksjs.org",blake:"blake@stacksjs.org",zoltan:"zoltan@stacksjs.org",freddy:"freddy@stacksjs.org",glenn:"glenn@stacksjs.org",dorell:"dorell@stacksjs.org",avery:"avery@stacksjs.org",adelino:"adelino@stacksjs.org"}};var Wy={shortcuts:[["btn","inline-flex items-center px-4 py-2 ml-2 border border-transparent shadow-sm text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-pointer"]],safelist:"prose prose-sm m-auto text-left",trigger:":stx:",classPrefix:"stx-",reset:"tailwind",icons:["heroicons"],fonts:{email:{title:"Mona",text:"Hubot"},desktop:{title:"Mona",text:"Hubot"},mobile:{title:"Mona",text:"Hubot"},web:{title:"Mona",text:"Hubot"}},theme:{colors:{veryCool:"#0000ff",brand:{primary:"hsl(var(--hue, 217) 78% 51%)"}}}};var kFD={ai:lP,analytics:iP,app:aP,cache:oP,cli:tP,cloud:eP,database:Dy,dns:Fy,email:Ey,errors:wy,git:$y,hashing:fy,library:Cy,logging:By,notification:hy,queue:Iy,payment:Uy,ports:Ay,searchEngine:My,security:T7,services:Gy,storage:Yy,team:Zy,ui:Wy},LU=kFD;async function Xy(D){if(!D?.port)D={port:3000};return console.log("Creating local tunnel",D.port),"localTunnel"}async function v1(D){return await Xy({port:D})}async function bFD({domain:D=ND.app.url||"stacks",type:F="frontend",localhost:E=!1,https:w=void 0,network:$=void 0}={}){let C=D.replace(/\.[^.]+$/,".localhost");switch(F){case"frontend":if($)return await v1(ND.ports?.frontend||3000);if(E)return`http://localhost:${ND.ports?.frontend}`;break;case"backend":if($)return await v1(ND.ports?.backend||3001);if(E)return`http://localhost:${ND.ports?.backend}`;C=`api.${C}`;break;case"admin":if($)return await v1(ND.ports?.admin||3002);if(E)return`http://localhost:${ND.ports?.admin}`;C=`admin.${C}`;break;case"library":if($)return await v1(ND.ports?.library||3003);if(E)return`http://localhost:${ND.ports?.library}`;C=`libs.${C}`;break;case"email":if($)return await v1(ND.ports?.email||3005);if(E)return`http://localhost:${ND.ports?.email}`;C=`email.${C}`;break;case"desktop":if($)return await v1(ND.ports?.desktop||3004);if(E)return`http://localhost:${ND.ports?.desktop}`;C=`desktop.${C}`;break;case"docs":if($)return await v1(ND.ports?.docs||3006);if(E)return`http://localhost:${ND.ports?.docs}`;C=`docs.${C}`;break;case"inspect":if($)return await v1(ND.ports?.inspect||3007);if(E)return`http://localhost:${ND.ports?.inspect}`;C=`inspect.${C}`;break;default:if(E)return`http://localhost:${ND.ports?.frontend}`}if(w)return`https://${C}`;return`http://${C}`}function xFD(D){return D}function cFD(D){return D}function gFD(D){return D}function rFD(D){return D}function _FD(D){return D}function sFD(D){return D}function uFD(D){return D}function dFD(D){return D}function vFD(D){return D}function mFD(D){return D}function nFD(D){return D}function lFD(D){return D}function iFD(D){return D}function pFD(D){return D}function aFD(D){return D}function oFD(D){return D}function tFD(D){return D}function eFD(D){return D}function D3D(D){return D}function F3D(D){return D}function E3D(D){return D}function w3D(D){return D}function $3D(D){return D}function f3D(D){return D}function C3D(D){return D}function B3D(D){return D}function h3D(D){return D}function P3D(){if(G6.env==="local")return"dev";if(G6.env==="development")return"dev";if(G6.env==="staging")return"stage";if(G6.env==="production")return"prod";if(!G6.env)throw new Error("Couldn\'t determine app environment");return G6.env}var MD={...HU,...LU},RU=MD.ai,U3D=MD.analytics,G6=MD.app,A3D=MD.cache,I3D=MD.cloud,M3D=MD.cli,G3D=MD.database,Y3D=MD.dns,Z3D=MD.docs,W3D=MD.email,X3D=MD.errors,J3D=MD.git,z3D=MD.hashing,T3D=MD.library,K3D=MD.logging,S3D=MD.notification,Q3D=MD.payment,H3D=MD.ports,L3D=MD.queue,R3D=MD.security,V3D=MD.searchEngine,N3D=MD.services,q3D=MD.storage,O3D=MD.team,j3D=MD.ui;function YE(D,F){let E;if(Dh(D))E=D;else if(D instanceof Error)E=D.message;else if(F instanceof Error)E=F.message;else E=String(D);return g8(`ERROR: ${Z0(E)}`),VU.handle(D,F)}async function g8(D,F){const E=`[${new Date().toISOString()}] ${D}\n`;try{const w=F?.logFile??ND.logging.logsPath??"storage/logs/stacks.log";try{await y3D(w)}catch{console.log("Creating log file directory...",w),await zy(k3D(w),{recursive:!0})}await Jy(w,E)}catch(w){console.error("Failed to write to log file:",w)}}class VU{static isTestEnvironment=!1;static shouldExitProcess=!0;static handle(D,F){if(this.shouldExitProcess=F?.shouldExit!==!1,F?.silent!==!0)this.writeErrorToConsole(D);let E;if(F?.message)E=F.message;else if(D instanceof Error)E=D.message;else if(typeof D==="string")E=D;else E=JSON.stringify(D);const w=new Error(E);if(D instanceof Error)Object.assign(w,D);return this.writeErrorToFile(w).catch(($)=>console.error($)),w}static handleError(D,F){return this.handle(D,F),D}static async writeErrorToFile(D){if(!(D instanceof Error)){console.error("Error is not an instance of Error:",D);return}const F=`[${new Date().toISOString()}] ${D.name}: ${D.message}\n`,E=QU("stacks.log")??QU("errors.log");try{await zy(vP(E),{recursive:!0}),await Jy(E,F)}catch(w){console.error("Failed to write to error file:",w)}}static writeErrorToConsole(D){console.error(D);const F=typeof D==="string"?D:D instanceof Error?D.message:JSON.stringify(D);if(F.includes("bunx --bun cdk destroy")||F===`Failed to execute command: ${NF("bunx --bun eslint . --fix")}`||F===`Failed to execute command: ${NF("bun storage/framework/core/actions/src/lint/fix.ts")}`){if(!this.isTestEnvironment)console.log("No need to worry. The edge function is currently being destroyed. Please run `buddy undeploy` shortly again, and continue doing so until it succeeds running."),console.log("Hoping to see you back soon!")}if(this.shouldExitProcess)b3D.exit(1)}}function qF(D,F,E,w){function $(C){return C instanceof E?C:new E(function(f){f(C)})}return new(E||(E=Promise))(function(C,f){function B(I){try{U(w.next(I))}catch(A){f(A)}}function h(I){try{U(w.throw(I))}catch(A){f(A)}}function U(I){I.done?C(I.value):$(I.value).then(B,h)}U((w=w.apply(D,[])).next())})}function Ty(D){var F=typeof Symbol==="function"&&Symbol.iterator,E=F&&D[F],w=0;if(E)return E.call(D);if(D&&typeof D.length==="number")return{next:function(){if(D&&w>=D.length)D=void 0;return{value:D&&D[w++],done:!D}}};throw new TypeError(F?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y6(D){return this instanceof Y6?(this.v=D,this):new Y6(D)}function c3D(D,F,E){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var w=E.apply(D,F||[]),$,C=[];return $={},f("next"),f("throw"),f("return"),$[Symbol.asyncIterator]=function(){return this},$;function f(Y){if(w[Y])$[Y]=function(M){return new Promise(function(Z,z){C.push([Y,M,Z,z])>1||B(Y,M)})}}function B(Y,M){try{h(w[Y](M))}catch(Z){A(C[0][3],Z)}}function h(Y){Y.value instanceof Y6?Promise.resolve(Y.value.v).then(U,I):A(C[0][2],Y)}function U(Y){B("next",Y)}function I(Y){B("throw",Y)}function A(Y,M){if(Y(M),C.shift(),C.length)B(C[0][0],C[0][1])}}function g3D(D){var F,E;return F={},w("next"),w("throw",function($){throw $}),w("return"),F[Symbol.iterator]=function(){return this},F;function w($,C){F[$]=D[$]?function(f){return(E=!E)?{value:Y6(D[$](f)),done:$==="return"}:C?C(f):f}:C}}function r3D(D){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var F=D[Symbol.asyncIterator],E;return F?F.call(D):(D=typeof Ty==="function"?Ty(D):D[Symbol.iterator](),E={},w("next"),w("throw"),w("return"),E[Symbol.asyncIterator]=function(){return this},E);function w(C){E[C]=D[C]&&function(f){return new Promise(function(B,h){f=D[C](f),$(B,h,f.done,f.value)})}}function $(C,f,B,h){Promise.resolve(h).then(function(U){C({value:U,done:B})},f)}}function V2(D){return new h2(D)}var x3D={withStackTrace:!1},Ky=(D,F,E=x3D)=>{const w=F.isOk()?{type:"Ok",value:F.value}:{type:"Err",value:F.error},$=E.withStackTrace?new Error().stack:void 0;return{data:w,message:D,stack:$}};class uD{constructor(D){this._promise=D}static fromSafePromise(D){const F=D.then((E)=>new R2(E));return new uD(F)}static fromPromise(D,F){const E=D.then((w)=>new R2(w)).catch((w)=>new h2(F(w)));return new uD(E)}static fromThrowable(D,F){return(...E)=>{return new uD((()=>qF(this,void 0,void 0,function*(){try{return new R2(yield D(...E))}catch(w){return new h2(F?F(w):w)}}))())}}static combine(D){return u3D(D)}static combineWithAllErrors(D){return d3D(D)}map(D){return new uD(this._promise.then((F)=>qF(this,void 0,void 0,function*(){if(F.isErr())return new h2(F.error);return new R2(yield D(F.value))})))}andThrough(D){return new uD(this._promise.then((F)=>qF(this,void 0,void 0,function*(){if(F.isErr())return new h2(F.error);const E=yield D(F.value);if(E.isErr())return new h2(E.error);return new R2(F.value)})))}andTee(D){return new uD(this._promise.then((F)=>qF(this,void 0,void 0,function*(){if(F.isErr())return new h2(F.error);try{yield D(F.value)}catch(E){}return new R2(F.value)})))}mapErr(D){return new uD(this._promise.then((F)=>qF(this,void 0,void 0,function*(){if(F.isOk())return new R2(F.value);return new h2(yield D(F.error))})))}andThen(D){return new uD(this._promise.then((F)=>{if(F.isErr())return new h2(F.error);const E=D(F.value);return E instanceof uD?E._promise:E}))}orElse(D){return new uD(this._promise.then((F)=>qF(this,void 0,void 0,function*(){if(F.isErr())return D(F.error);return new R2(F.value)})))}match(D,F){return this._promise.then((E)=>E.match(D,F))}unwrapOr(D){return this._promise.then((F)=>F.unwrapOr(D))}safeUnwrap(){return c3D(this,arguments,function*D(){return yield Y6(yield Y6(yield*g3D(r3D(yield Y6(this._promise.then((F)=>F.safeUnwrap()))))))})}then(D,F){return this._promise.then(D,F)}}var K7=(D)=>new uD(Promise.resolve(new h2(D))),_3D=uD.fromPromise,s3D=uD.fromSafePromise,XcD=uD.fromThrowable,Sy=(D)=>{let F=m1([]);for(let E of D)if(E.isErr()){F=V2(E.error);break}else F.map((w)=>w.push(E.value));return F},u3D=(D)=>uD.fromSafePromise(Promise.all(D)).andThen(Sy),Qy=(D)=>{let F=m1([]);for(let E of D)if(E.isErr()&&F.isErr())F.error.push(E.error);else if(E.isErr()&&F.isOk())F=V2([E.error]);else if(E.isOk()&&F.isOk())F.value.push(E.value);return F},d3D=(D)=>uD.fromSafePromise(Promise.all(D)).andThen(Qy),S7;(function(D){function F($,C){return(...f)=>{try{const B=$(...f);return m1(B)}catch(B){return V2(C?C(B):B)}}}D.fromThrowable=F;function E($){return Sy($)}D.combine=E;function w($){return Qy($)}D.combineWithAllErrors=w})(S7||(S7={}));var m1=(D)=>new R2(D);class R2{constructor(D){this.value=D}isOk(){return!0}isErr(){return!this.isOk()}map(D){return m1(D(this.value))}mapErr(D){return m1(this.value)}andThen(D){return D(this.value)}andThrough(D){return D(this.value).map((F)=>this.value)}andTee(D){try{D(this.value)}catch(F){}return m1(this.value)}orElse(D){return m1(this.value)}asyncAndThen(D){return D(this.value)}asyncAndThrough(D){return D(this.value).map(()=>this.value)}asyncMap(D){return uD.fromSafePromise(D(this.value))}unwrapOr(D){return this.value}match(D,F){return D(this.value)}safeUnwrap(){const D=this.value;return function*(){return D}()}_unsafeUnwrap(D){return this.value}_unsafeUnwrapErr(D){throw Ky("Called `_unsafeUnwrapErr` on an Ok",this,D)}}class h2{constructor(D){this.error=D}isOk(){return!1}isErr(){return!this.isOk()}map(D){return V2(this.error)}mapErr(D){return V2(D(this.error))}andThrough(D){return V2(this.error)}andTee(D){return V2(this.error)}andThen(D){return V2(this.error)}orElse(D){return D(this.error)}asyncAndThen(D){return K7(this.error)}asyncAndThrough(D){return K7(this.error)}asyncMap(D){return K7(this.error)}unwrapOr(D){return D}match(D,F){return F(this.error)}safeUnwrap(){const D=this.error;return function*(){throw yield V2(D),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(D){throw Ky("Called `_unsafeUnwrap` on an Err",this,D)}_unsafeUnwrapErr(D){return this.error}}var v3D=S7.fromThrowable;var i$D=L(bc(),1);function t(D,F,E=1){const w=`\x1B[${D}m`,$=`\x1B[${F}m`,C=new RegExp(`\\x1b\\[${F}m`,"g");return(f)=>{return xc.enabled&&xc.supportLevel>=E?w+(""+f).replace(C,w)+$:""+f}}var X6=!0,kF=typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:{},RE=0;if(kF.process&&kF.process.env&&kF.process.stdout){const{FORCE_COLOR:D,NODE_DISABLE_COLORS:F,NO_COLOR:E,TERM:w,COLORTERM:$}=kF.process.env;if(F||E||D==="0")X6=!1;else if(D==="1"||D==="2"||D==="3")X6=!0;else if(w==="dumb")X6=!1;else if("CI"in kF.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((C)=>(C in kF.process.env)))X6=!0;else X6=process.stdout.isTTY;if(X6)if(process.platform==="win32")RE=3;else if($&&($==="truecolor"||$==="24bit"))RE=3;else if(w&&(w.endsWith("-256color")||w.endsWith("256")))RE=2;else RE=1}var xc={enabled:X6,supportLevel:RE},p$D=t(0,0),cc=t(1,22),gc=t(2,22),NF=t(3,23),a$D=t(4,24),o$D=t(7,27),t$D=t(8,28),e$D=t(9,29),D4D=t(30,39),F4D=t(31,39),rc=t(32,39),E4D=t(33,39),w4D=t(34,39),$4D=t(35,39),_c=t(36,39),f4D=t(97,39),sc=t(90,39),C4D=t(37,39),B4D=t(91,39),h4D=t(92,39),U4D=t(93,39),A4D=t(94,39),I4D=t(95,39),M4D=t(96,39),G4D=t(40,49),Y4D=t(41,49),Z4D=t(42,49),W4D=t(43,49),X4D=t(44,49),J4D=t(45,49),uc=t(46,49),z4D=t(107,49),T4D=t(100,49),K4D=t(101,49),S4D=t(102,49),Q4D=t(103,49),H4D=t(104,49),L4D=t(105,49),R4D=t(106,49),V4D=t(47,49);import q4D from"process";function SU(D){if(Array.isArray(D)){if(D=Array.from(new Set(D)),Array.isArray(D)&&D[0]&&!D[0].startsWith("-"))D.shift();return D.join(" ")}if(typeof D==="object"&&D!==null)return Object.entries(D).map(([F,E])=>{if(E===!0)return`--${F}`;return`--${F} ${E}`}).join(" ");return SU(q4D.argv.slice(2))}import O4D from"process";function DA(D){if(Array.isArray(D))return[...D];return{...D}}function dc(D){if(Array.isArray(D))return D;return[D]}function s7(D,...F){dc(F).forEach((E)=>{delete D[E]})}function K1(D){return typeof D==="object"&&!Array.isArray(D)&&D!==null}var e1=(D)=>Array.isArray(D),W0=(D)=>typeof D==="function";function J6(D,F){try{return F.split(".").reduce((E,w)=>E[w],D)}catch(E){return D}}function bF(D){if(Array.isArray(D))return[...D];if("all"in D&&typeof D.all==="function")return D.all();return Object.values(D)}function vc(D){return new hD(D)}function P4D(){let D=-1;return{next:()=>{return D+=1,{value:this.items[D],done:D>=this.items.length}}}}class hD{items;constructor(D=[]){this.items=D}[Symbol.iterator]=P4D;toJSON(){return this.items}all(){return this.items}average(D){if(D===void 0)return this.sum()/Number(this.items.length);if(W0(D))return Number(new this.constructor(this.items).sum(D))/Number(this.items.length);return Number(new this.constructor(this.items).pluck(D).sum())/Number(this.items.length)}avg=this.average;chunk(D){const F=[],E=Array.isArray(this.items)?this.items:Object.values(this.items);for(let w=0;w<E.length;w+=D)F.push(E.slice(w,w+D));return new hD(F)}collapse(){return new this.constructor([].concat(...this.items))}combine(D){if(typeof D==="string")D=[D];if(!Array.isArray(D))throw new TypeError("The values must be an array or a string");const F={};return(Array.isArray(this.items)?this.items:Object.keys(this.items)).forEach((w,$)=>{if(D[$]!==void 0)F[w]=D[$]}),new hD(F)}concat(D){let F=D;if(D instanceof this.constructor)F=D.all();else if(typeof D==="object")F=[],Object.keys(D).forEach((w)=>{F.push(D[w])});const E=DA(this.items);return F.forEach((w)=>{if(typeof w==="object")Object.keys(w).forEach(($)=>E.push(w[$]));else E.push(w)}),new this.constructor(E)}contains(D,F){if(typeof D==="function")return this.items.some(D);if(Array.isArray(this.items))return this.items.includes(D);if(F!==void 0){if(Array.isArray(this.items))return this.items.some((E)=>E[D]!==void 0&&E[D]===F);return D in this.items&&this.items[D]===F}if(Array.isArray(this.items))return this.items.includes(D);return Object.values(this.items).includes(D)}containsOneItem(){if(typeof this.items==="string")return!0;return Object.keys(this.items).length===1}count(D){if(D)return this.filter(D).count();return Object.keys(this.items).length}countBy(D){const F={};return this.each((E)=>{const w=D?D(E):E;F[w]=(F[w]||0)+1}),new hD(F)}crossJoin(...D){function F(E,w,$){let C=$[0];if(C instanceof hD)C=C.all();const f=$.slice(1),B=!f.length;let h=[];for(let U=0;U<C.length;U+=1){const I=E.slice();if(I.push(C[U]),B)h.push(I);else h=h.concat(F(I,w,f))}return h}return new this.constructor(F([],this.constructor,[].concat([this.items],D)))}dd(){console.log(JSON.stringify(this.all(),null,2)),O4D.exit()}diff(D){let F;if(D instanceof this.constructor)F=D.all();else F=D;const E=this.items.filter((w)=>!F.includes(w));return new this.constructor(E)}diffAssoc(D){let F=D;if(D instanceof this.constructor)F=D.all();const E={};return Object.keys(this.items).forEach((w)=>{if(F[w]===void 0||F[w]!==this.items[w])E[w]=this.items[w]}),new this.constructor(E)}diffKeys(D){let F;if(D instanceof this.constructor)F=D.all();else F=D;const E=Object.keys(F),w=Object.keys(this.items).filter(($)=>!E.includes($));return new this.constructor(this.items).only(w)}diffUsing(D,F){if(console.log("Original collection:",this.items),console.log("Array to compare:",D),D===null)return new hD(this.items);const E=this.items.filter((w)=>{return D.findIndex((C)=>{return F(w,C)===0})===-1});return new hD(E)}doesntContain(D,F){if(console.log("doesntContain called with:",{key:D,value:F}),typeof D==="function")return console.log("Function branch"),!this.contains(D);if(F!==void 0)return console.log("Key-value pair branch"),!this.contains((E)=>{return console.log("Comparing:",E[D],"with",F),E[D]===F});return console.log("Single value branch"),!this.contains(D)}dump(){return console.log(this.items),this}duplicates(){const D=[],F={},E=(w)=>{if(Array.isArray(w)||typeof w==="object")return JSON.stringify(w);return w};if(Array.isArray(this.items))this.items.forEach((w,$)=>{const C=E(w);if(!D.includes(C))D.push(C);else F[$]=w});else if(typeof this.items==="object")Object.keys(this.items).forEach((w)=>{const $=E(this.items[w]);if(!D.includes($))D.push($);else F[w]=this.items[w]});return new this.constructor(F)}each(D){let F=!1;if(Array.isArray(this.items)){const{length:E}=this.items;for(let w=0;w<E&&!F;w+=1)F=D(this.items[w],w,this.items)===!1}else{const E=Object.keys(this.items),{length:w}=E;for(let $=0;$<w&&!F;$+=1){const C=E[$];F=D(this.items[C],C,this.items)===!1}}return this}eachSpread(D){return this.each((F,E)=>{D(...F,E)}),this}every(D){return bF(this.items).every(D)}except(D){const F={...this.items};return(Array.isArray(D)?D:[D]).forEach((w)=>delete F[w]),new hD(F)}filter(D){if(console.log("Filter method called with callback:",D),console.log("Current items:",this.items),typeof D!=="function"){console.log("No callback provided, removing falsy values");const E=this.items.filter((w)=>{return console.log("Filtering item:",w),Boolean(w)});return console.log("Filtered items:",E),new hD(E)}const F=this.items.filter((E,w)=>{return console.log("Filtering item:",E,"at index:",w),D(E,w)});return console.log("Filtered items:",F),new hD(F)}first(D,F){if(W0(D)){const E=Object.keys(this.items);for(let w=0;w<E.length;w+=1){const $=E[w],C=this.items[$];if(D(C,$))return C}if(W0(F))return F();return F}if(Array.isArray(this.items)&&this.items.length||Object.keys(this.items).length){if(Array.isArray(this.items))return this.items[0];const E=Object.keys(this.items)[0];return this.items[E]}if(W0(F))return F();return F}firstOrFail(D){const F=this.items.find(D||(()=>!0));if(F===void 0)throw new Error("Item not found.");return F}firstWhere(D,F,E){return this.where(D,F,E).first()||null}flatMap(D){return this.map(D).collapse()}flatten(D=Number.POSITIVE_INFINITY){const F=(E,w)=>{if(!Array.isArray(E)&&typeof E!=="object")return[E];return w>0?Object.values(E).reduce(($,C)=>$.concat(Array.isArray(C)||typeof C==="object"?F(C,w-1):C),[]):Array.isArray(E)?[...E]:[E]};return new hD(F(this.items,D))}flip(){const D={};if(Array.isArray(this.items))this.items.forEach((F,E)=>{D[F]=E});else Object.entries(this.items).forEach(([F,E])=>{D[E]=F});return new this.constructor(D)}forPage(D,F){let E={};if(Array.isArray(this.items))E=this.items.slice(D*F-F,D*F);else Object.keys(this.items).slice(D*F-F,D*F).forEach((w)=>{E[w]=this.items[w]});return new this.constructor(E)}forget(D){if(Array.isArray(this.items))this.items=this.items.filter((F,E)=>E!==Number.parseInt(D,10));else if(typeof this.items==="object"&&this.items!==null)delete this.items[D];return this}get(D,F=null){if(Array.isArray(this.items))return this.items[D]??F;return this.items[D]??F}groupBy(D){const F={};return this.each((E,w)=>{const $=typeof D==="function"?D(E):E[D];if(!($ in F))F[$]=new hD;F[$].push(E)}),new hD(F)}has(D){if(Array.isArray(this.items))return D in this.items;return D in this.items}implode(D,F){if(F===void 0)return this.items.join(D);return new this.constructor(this.items).pluck(D).all().join(F)}includes(D){if(Array.isArray(this.items))return this.items.includes(D);return Object.values(this.items).includes(D)}intersect(D){let F=D;if(D instanceof this.constructor)F=D.all();const E=this.items.filter((w)=>F.includes(w));return new this.constructor(E)}intersectByKeys(D){let F=Object.keys(D);if(D instanceof this.constructor)F=Object.keys(D.all());const E={};return Object.keys(this.items).forEach((w)=>{if(F.includes(w))E[w]=this.items[w]}),new this.constructor(E)}isEmpty(){return this.count()===0}isNotEmpty(){return!this.isEmpty()}join(D,F){const E=this.values();if(F===void 0)return E.implode(D);const w=E.count();if(w===0)return"";if(w===1)return E.last();const $=E.pop();return E.implode(D)+F+$}keyBy(D){const F={};if(W0(D))this.items.forEach((E)=>{F[D(E)]=E});else this.items.forEach((E)=>{const w=J6(E,D);F[w||""]=E});return new this.constructor(F)}keys(){return new hD(Object.keys(this.items))}last(D,F){let{items:E}=this;if(W0(D))E=this.filter(D).all();if(Array.isArray(E)&&!E.length||!Object.keys(E).length){if(W0(F))return F();return F}if(Array.isArray(E))return E[E.length-1];const w=Object.keys(E);return E[w[w.length-1]]}macro(D,F){this.constructor.prototype[D]=F}make(D=[]){return new this.constructor(D)}map(D){if(Array.isArray(this.items))return new this.constructor(this.items.map(D));const F={};return Object.keys(this.items).forEach((E)=>{F[E]=D(this.items[E],Number(E))}),new this.constructor(F)}mapSpread(D){return this.map((F,E)=>D(...F,E))}mapToDictionary(D){const F={};return this.items.forEach((E,w)=>{const[$,C]=D(E,w);if(F[$]===void 0)F[$]=[C];else F[$].push(C)}),new this.constructor(F)}mapInto(D){return this.map((F,E)=>new D(F,E))}mapToGroups(D){const F={};return this.items.forEach((E,w)=>{const[$,C]=D(E,w);if(F[$]===void 0)F[$]=[C];else F[$].push(C)}),new this.constructor(F)}mapWithKeys(D){const F={};if(Array.isArray(this.items))this.items.forEach((E,w)=>{const[$,C]=D(E,w);F[$]=C});else Object.keys(this.items).forEach((E)=>{const[w,$]=D(this.items[E],Number(E));F[w]=$});return new this.constructor(F)}max(D){if(typeof D==="string"){const F=this.items.filter((E)=>E[D]!==void 0);return Math.max(...F.map((E)=>E[D]))}return Math.max(...this.items)}median(D){const{length:F}=this.items;if(D===void 0){if(F%2===0)return(this.items[F/2-1]+this.items[F/2])/2;return this.items[Math.floor(F/2)]}if(F%2===0)return(this.items[F/2-1][D]+this.items[F/2][D])/2;return this.items[Math.floor(F/2)][D]}merge(D){const F={...this.items,...D};return new hD(F)}mergeRecursive(D){const F=(E,w)=>{const $={};return Object.keys({...E,...w}).forEach((f)=>{if(E[f]===void 0&&w[f]!==void 0)$[f]=w[f];else if(E[f]!==void 0&&w[f]===void 0)$[f]=E[f];else if(E[f]!==void 0&&w[f]!==void 0)if(E[f]===w[f])$[f]=E[f];else if(!Array.isArray(E[f])&&typeof E[f]==="object"&&!Array.isArray(w[f])&&typeof w[f]==="object")$[f]=F(E[f],w[f]);else $[f]=[].concat(E[f],w[f])}),$};if(!D)return this;if(D.constructor.name==="Collection")return new this.constructor(F(this.items,D.all()));return new this.constructor(F(this.items,D))}min(D){if(D!==void 0){const F=this.items.filter((E)=>E[D]!==void 0);return Math.min(...F.map((E)=>E[D]))}return Math.min(...this.items)}mode(D){const F=[];let E=1;if(!this.items.length)return null;return this.items.forEach((w)=>{const $=F.filter((C)=>{if(D!==void 0)return C.key===w[D];return C.key===w});if(!$.length)if(D!==void 0)F.push({key:w[D],count:1});else F.push({key:w,count:1});else{$[0].count+=1;const{count:C}=$[0];if(C>E)E=C}}),F.filter((w)=>w.count===E).map((w)=>w.key)}nth(D,F=0){const w=bF(this.items).slice(F).filter(($,C)=>C%D===0);return new this.constructor(w)}only(D){const F={};return D.forEach((E)=>{if(E in this.items)F[E]=this.items[E]}),new hD(F)}pad(D,F){const E=Math.abs(D),w=this.count();if(E<=w)return this;let $=E-w;const C=DA(this.items),f=Array.isArray(this.items),B=D<0;for(let h=0;h<$;){if(!f)if(C[h]!==void 0)$+=1;else C[h]=F;else if(B)C.unshift(F);else C.push(F);h+=1}return new this.constructor(C)}partition(D){let F;if(Array.isArray(this.items))F=[new this.constructor([]),new this.constructor([])],this.items.forEach((E)=>{if(D(E)===!0)F[0].push(E);else F[1].push(E)});else F=[new this.constructor({}),new this.constructor({})],Object.keys(this.items).forEach((E)=>{const w=this.items[E];if(D(w)===!0)F[0].put(E,w);else F[1].put(E,w)});return new this.constructor(F)}pipe(D){return D(this)}pluck(D,F){if(D.includes("*")){const E=j4D(this.items),w=[];if(F!==void 0){const B=new RegExp(`0.${F}`,"g"),h=`0.${F}`.split(".").length;Object.keys(E).forEach((U)=>{const I=U.match(B);if(I){const A=I[0];if(A.split(".").length===h)w.push(E[A])}})}const $=[],C=new RegExp(`0.${D}`,"g"),f=`0.${D}`.split(".").length;if(Object.keys(E).forEach((B)=>{const h=B.match(C);if(h){const U=h[0];if(U.split(".").length===f)$.push(E[U])}}),F!==void 0){const B={};return this.items.forEach((h,U)=>{B[w[U]||""]=$}),new this.constructor(B)}return new this.constructor([$])}if(F!==void 0){const E={};return this.items.forEach((w)=>{if(J6(w,D)!==void 0)E[w[F]||""]=J6(w,D);else E[w[F]||""]=null}),new this.constructor(E)}return this.map((E)=>{if(J6(E,D)!==void 0)return J6(E,D);return null})}pop(D=1){if(this.isEmpty())return null;if(e1(this.items)){if(D===1)return this.items.pop();return new this.constructor(this.items.splice(-D))}if(K1(this.items)){const F=Object.keys(this.items);if(D===1){const $=F[F.length-1],C=this.items[$];return s7(this.items,$),C}const E=F.slice(-D),w=E.reduce(($,C)=>{return $[C]=this.items[C],$},{});return s7(this.items,E),new this.constructor(w)}return null}prepend(D,F){if(F!==void 0)return this.put(F,D);return this.items.unshift(D),this}pull(D,F=null){if(Array.isArray(this.items)){const w=Number(D);if(Number.isNaN(w))return F;const $=this.items[w];return this.items.splice(w,1),$??F}const E=this.items[D];return delete this.items[D],E??F}push(...D){return this.items=[...this.items,...D],this}put(D,F){return this.items[D]=F,this}random(D=null){const F=bF(this.items),E=new this.constructor(F).shuffle();if(D!==Number.parseInt(D,10))return E.first();return E.take(D)}reduce(D,F){let E=null;if(F!==void 0)E=F;if(Array.isArray(this.items))this.items.forEach((w)=>{E=D(E,w)});else Object.keys(this.items).forEach((w)=>{E=D(E,this.items[w],w)});return E}reject(D){return new this.constructor(this.items).filter((F)=>!D(F))}replace(D){if(!D)return this;if(Array.isArray(D)){const E=this.items.map((w,$)=>D[$]||w);return new this.constructor(E)}if(D.constructor.name==="Collection"){const E={...this.items,...D.all()};return new this.constructor(E)}const F={...this.items,...D};return new this.constructor(F)}replaceRecursive(D){const F=(E,w)=>{const $={...E};return Object.keys({...E,...w}).forEach((f)=>{if(!Array.isArray(w[f])&&typeof w[f]==="object")$[f]=F(E[f],w[f]);else if(E[f]===void 0&&w[f]!==void 0)if(typeof E[f]==="object")$[f]={...w[f]};else $[f]=w[f];else if(E[f]!==void 0&&w[f]===void 0)if(typeof E[f]==="object")$[f]={...E[f]};else $[f]=E[f];else if(E[f]!==void 0&&w[f]!==void 0)if(typeof w[f]==="object")$[f]={...w[f]};else $[f]=w[f]}),$};if(!D)return this;if(!Array.isArray(D)&&typeof D!=="object")return new this.constructor(F(this.items,[D]));if(D.constructor.name==="Collection")return new this.constructor(F(this.items,D.all()));return new this.constructor(F(this.items,D))}reverse(){const D=[].concat(this.items).reverse();return new this.constructor(D)}search(D,F){let E;const w=($,C)=>{if(W0(D))return D(this.items[C],C);if(F)return this.items[C]===D;return this.items[C]==D};if(e1(this.items))E=this.items.findIndex(w);else if(K1(this.items))E=Object.keys(this.items).find(($)=>w(this.items[$],$));if(E===void 0||E<0)return!1;return E}shift(D=1){if(this.isEmpty())return null;if(e1(this.items)){if(D===1)return this.items.shift();return new this.constructor(this.items.splice(0,D))}if(K1(this.items)){if(D===1){const $=Object.keys(this.items)[0],C=this.items[$];return delete this.items[$],C}const E=Object.keys(this.items).slice(0,D),w=E.reduce(($,C)=>{return $[C]=this.items[C],$},{});return s7(this.items,E),new this.constructor(w)}return null}shuffle(){const D=bF(this.items);let F,E,w;for(w=D.length;w;w-=1)F=Math.floor(Math.random()*w),E=D[w-1],D[w-1]=D[F],D[F]=E;return this.items=D,this}skip(D){if(K1(this.items))return new this.constructor(Object.keys(this.items).reduce((F,E,w)=>{if(w+1>D)F[E]=this.items[E];return F},{}));return new this.constructor(this.items.slice(D))}skipUntil(D){let F=null,E,w=($)=>$===D;if(W0(D))w=D;if(e1(this.items))E=this.items.filter(($)=>{if(F!==!0)F=w($);return F});if(K1(this.items))E=Object.keys(this.items).reduce(($,C)=>{if(F!==!0)F=w(this.items[C]);if(F!==!1)$[C]=this.items[C];return $},{});return new this.constructor(E)}skipWhile(D){let F=null,E,w=($)=>$===D;if(W0(D))w=D;if(e1(this.items))E=this.items.filter(($)=>{if(F!==!0)F=!w($);return F});if(K1(this.items))E=Object.keys(this.items).reduce(($,C)=>{if(F!==!0)F=!w(this.items[C]);if(F!==!1)$[C]=this.items[C];return $},{});return new this.constructor(E)}slice(D,F){let E=this.items.slice(D);if(F!==void 0)E=E.slice(0,F);return new this.constructor(E)}sole(){if(this.items.length!==1)throw new Error("Collection does not contain exactly one item.");return this.items[0]}some(D){return this.items.some((F)=>F.hasOwnProperty(D))}sort(D){const F=[].concat(this.items);if(D===void 0)if(this.every((E)=>typeof E==="number"))F.sort((E,w)=>E-w);else F.sort();else F.sort(D);return new this.constructor(F)}sortDesc(){return this.sort().reverse()}sortBy(D){const F=[].concat(this.items),E=(w)=>{if(W0(D))return D(w);return J6(w,D)};return F.sort((w,$)=>{const C=E(w),f=E($);if(C===null||C===void 0)return 1;if(f===null||f===void 0)return-1;if(C<f)return-1;if(C>f)return 1;return 0}),new this.constructor(F)}sortByDesc(D){return this.sortBy(D).reverse()}sortKeys(){const D={};return Object.keys(this.items).sort().forEach((F)=>{D[F]=this.items[F]}),new this.constructor(D)}sortKeysDesc(){const D={};return Object.keys(this.items).sort().reverse().forEach((F)=>{D[F]=this.items[F]}),new this.constructor(D)}splice(D,F,E){const w=this.slice(D,F);if(this.items=this.diff(w.all()).all(),Array.isArray(E))for(let $=0,{length:C}=E;$<C;$+=1)this.items.splice(D+$,0,E[$]);return w}split(D){const F=this.toArray(),E=[],w=Math.ceil(F.length/D);for(let $=0;$<F.length;$+=w)E.push(F.slice($,$+w));return new hD(E)}sum(D){const F=bF(this.items);let E=0;if(D===void 0)for(let w=0,{length:$}=F;w<$;w+=1)E+=Number.parseFloat(F[w]);else if(W0(D))for(let w=0,{length:$}=F;w<$;w+=1)E+=Number.parseFloat(D(F[w]));else for(let w=0,{length:$}=F;w<$;w+=1)E+=Number.parseFloat(F[w][D]);return Number.parseFloat(E.toPrecision(12))}take(D){if(!Array.isArray(this.items)&&typeof this.items==="object"){const F=Object.keys(this.items);let E;if(D<0)E=F.slice(D);else E=F.slice(0,D);const w={};return F.forEach(($)=>{if(E.includes($))w[$]=this.items[$]}),new this.constructor(w)}if(D<0)return new this.constructor(this.items.slice(D));return new this.constructor(this.items.slice(0,D))}takeUntil(D){let F=null,E,w=($)=>$===D;if(W0(D))w=D;if(e1(this.items))E=this.items.filter(($)=>{if(F!==!1)F=!w($);return F});if(K1(this.items))E=Object.keys(this.items).reduce(($,C)=>{if(F!==!1)F=!w(this.items[C]);if(F!==!1)$[C]=this.items[C];return $},{});return new this.constructor(E)}takeWhile(D){let F=null,E,w=($)=>$===D;if(W0(D))w=D;if(e1(this.items))E=this.items.filter(($)=>{if(F!==!1)F=w($);return F});if(K1(this.items))E=Object.keys(this.items).reduce(($,C)=>{if(F!==!1)F=w(this.items[C]);if(F!==!1)$[C]=this.items[C];return $},{});return new this.constructor(E)}tap(D){return D(this),this}times(D,F){for(let E=1;E<=D;E+=1)this.items.push(F(E));return this}toArray(){return Array.isArray(this.items)?this.items:Object.values(this.items)}toJson(){return JSON.stringify(this.items)}transform(D){if(Array.isArray(this.items))this.items=this.items.map(D);else{const F={};Object.keys(this.items).forEach((E)=>{F[E]=D(this.items[E],E)}),this.items=F}return this}undot(){if(Array.isArray(this.items))return this;let D={};return Object.keys(this.items).forEach((F)=>{if(F.includes(".")){const E=D;F.split(".").reduce((w,$,C,f)=>{if(!w[$])w[$]={};if(C===f.length-1)w[$]=this.items[F];return w[$]},E),D={...D,...E}}else D[F]=this.items[F]}),new this.constructor(D)}unless(D,F,E){if(!D)return F(this);if(E)return E();return}unlessEmpty(D){if(!this.isEmpty())D(this);return this}unlessNotEmpty(D){if(this.isEmpty())D(this);return this}union(D){const F=JSON.parse(JSON.stringify(this.items));return Object.keys(D).forEach((E)=>{if(this.items[E]===void 0)F[E]=D[E]}),new this.constructor(F)}unique(){const D=Array.from(new Set(this.items));return new this.constructor(D)}unwrap(){return this.items}values(){return new hD(Object.values(this.items))}when(D,F,E){if(D)F(this,D);else if(E)E();return this}whenEmpty(D,F){if(Array.isArray(this.items)&&!this.items.length)return D(this);if(!Object.keys(this.items).length)return D(this);if(F!==void 0){if(Array.isArray(this.items)&&this.items.length)return F(this);if(Object.keys(this.items).length)return F(this)}return this}whenNotEmpty(D,F){if(Array.isArray(this.items)&&this.items.length)return D(this);if(Object.keys(this.items).length)return D(this);if(F!==void 0){if(Array.isArray(this.items)&&!this.items.length)return F(this);if(!Object.keys(this.items).length)return F(this)}return this}where(D,F,E){if(arguments.length===1)return new hD(this.items.filter(($)=>$[D]!==void 0));if(arguments.length===2)E=F,F="===";const w=($,C,f,B)=>{const h=$[C];switch(B){case"===":return h===f;case"!==":return h!==f;case"<":return h<f;case"<=":return h<=f;case">":return h>f;case">=":return h>=f;default:return h==f}};return new hD(this.items.filter(($)=>w($,D,E,F)))}whereBetween(D,F){return this.filter((E)=>{const w=typeof E==="object"?E[D]:E;return w>=F[0]&&w<=F[1]})}whereIn(D,F){return this.filter((E)=>{const w=typeof E==="object"?E[D]:E;return F.includes(w)})}whereNotBetween(D,F){return this.filter((E)=>{const w=typeof E==="object"?E[D]:E;return w<F[0]||w>F[1]})}whereNotIn(D,F){const E=this.items.filter((w)=>{const $=D.split(".");let C=w;for(let f of $){if(C[f]===void 0)return!0;C=C[f]}return!F.includes(C)});return new hD(E)}getNestedValue(D,F){return F.split(".").reduce((w,$)=>w&&w[$]!==void 0?w[$]:null,D)}whereInstanceOf(D){return this.filter((F)=>F instanceof D)}whereNotNull(D){return this.where(D,"!==",null)}whereNull(D){return this.where(D,"===",null)}static wrap(D){if(D instanceof hD)return D;return new hD(Array.isArray(D)?D:[D])}static unwrap(D){if(D instanceof hD)return D.all();return D}wrap(D){if(D instanceof hD)return D;if(typeof D==="object")return new hD(D);return new hD([D])}zip(...D){const F=D.map((w)=>this.constructor.wrap(w).all()),E=this.items.map((w,$)=>{const C=[w];return F.forEach((f)=>{C.push(f[$])}),new this.constructor(C)});return new this.constructor(E)}}var j4D=function D(F){const E={};return F.forEach((w,$)=>{function C(f,B){if(K1(f))Object.keys(f).forEach((h)=>{C(f[h],`${B}.${h}`)});else if(e1(f))f.forEach((h,U)=>{C(h,`${B}.${U}`)});E[B]=f}C(w,$)}),E};hE();var krD=vc(["The best way to get started is to quit talking and begin doing.","The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.","Don\u2019t let yesterday take up too much of today.","You learn more from failure than from success. Don\u2019t let it stop you. Failure builds character.","It\u2019s not whether you get knocked down, it\u2019s whether you get up.","If you are working on something that you really care about, you don\u2019t have to be pushed. The vision pulls you.","People who are crazy enough to think they can change the world, are the ones who do.","Failure will never overtake me if my determination to succeed is strong enough.","Entrepreneurs are great at dealing with uncertainty and also very good at minimizing risk. That\u2019s the classic entrepreneur.","We may encounter many defeats but we must not be defeated.","Knowing is not enough; we must apply. Wishing is not enough; we must do.","Imagine your life is perfect in every respect; what would it look like?","We generate fears while we sit. We overcome them by action.","Whether you think you can or think you can\u2019t, you\u2019re right.","Security is mostly a superstition. Life is either a daring adventure or nothing."]);var Dg=L(ec(),1);async function F_D(){c4D.env.AWS_REGION="us-east-1";const D=await K2()(),F=RU.models;if(!F)throw new Error("No AI models found. Please set ./config/ai.ts values.");for(let E of F)try{d1.info(`Requesting access to model ${E}`);const w={host:"bedrock.us-east-1.amazonaws.com",method:"POST",path:"/foundation-model-entitlement",headers:{"Content-Type":"application/json"},body:JSON.stringify({modelId:E}),service:"bedrock",region:"us-east-1"},$=Dg.default.sign(w,D),C=Object.fromEntries(Object.entries($.headers||{}).map(([h,U])=>[h,String(U)])),B=await(await fetch(`https://${$.host}${$.path}`,{method:$.method,headers:C,body:$.body})).json();d1.info(`Response for model ${E}:`,B)}catch(w){d1.error(`Error requesting access to model ${E}:`,w)}}export{KqD as summarize,F_D as requestModelAccess,DjD as listFoundationModels,JqD as invokeModelWithResponseStream,XqD as invokeModel,eOD as getModelCustomizationJob,tOD as createModelCustomizationJob,o3 as client,SqD as ask,ZF as InvokeModelCommand};
|
|
207
|
+
|
|
208
|
+
//# debugId=4B8270026C2094EC64756E2164756E21
|
|
13
209
|
//# sourceMappingURL=index.js.map
|