@stacksjs/ai 0.64.6 → 0.65.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.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
- ${Sn(e)}
4
- ${n.map((t)=>`${t}:${r[t]}`).join("\n")}
5
-
6
- ${n.join(";")}
7
- ${s}`}async createStringToSign(e,r,s){const n=new this.sha256;n.update(ce(s));const t=await n.digest();return`${Wr}
8
- ${e}
9
- ${r}
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
- //# debugId=14B05121FC4835FE64756E2164756E21
1
+ // @bun
2
+ var zg=Object.create;var{getPrototypeOf:Tg,defineProperty:l7,getOwnPropertyNames:Kg}=Object;var Sg=Object.prototype.hasOwnProperty;var Q=(D,F,E)=>{E=D!=null?zg(Tg(D)):{};const w=F||!D||!D.__esModule?l7(E,"default",{value:D,enumerable:!0}):E;for(let $ of Kg(D))if(!Sg.call(w,$))l7(w,$,{get:()=>D[$],enumerable:!0});return w};var X=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var r0=(D,F)=>{for(var E in F)l7(D,E,{get:F[E],enumerable:!0,configurable:!0,set:(w)=>F[E]=()=>w})};var M=(D,F)=>()=>(D&&(F=D(D=0)),F);var O2=(D)=>{let F=D.httpHandler;return{setHttpHandler(E){F=E},httpHandler(){return F},updateHttpClientConfig(E,w){F.updateHttpClientConfig(E,w)},httpHandlerConfigs(){return F.httpHandlerConfigs()}}},j2=(D)=>{return{httpHandler:D.httpHandler()}};var FA=()=>{};var W0=X((C7D,AA)=>{var{defineProperty:NE,getOwnPropertyDescriptor:Qg,getOwnPropertyNames:Hg}=Object,Lg=Object.prototype.hasOwnProperty,qE=(D,F)=>NE(D,"name",{value:F,configurable:!0}),Rg=(D,F)=>{for(var E in F)NE(D,E,{get:F[E],enumerable:!0})},Vg=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Hg(F))if(!Lg.call(D,$)&&$!==E)NE(D,$,{get:()=>F[$],enumerable:!(w=Qg(F,$))||w.enumerable})}return D},Ng=(D)=>Vg(NE({},"__esModule",{value:!0}),D),EA={};Rg(EA,{AlgorithmId:()=>CA,EndpointURLScheme:()=>fA,FieldPosition:()=>BA,HttpApiKeyAuthLocation:()=>$A,HttpAuthLocation:()=>wA,IniSectionType:()=>hA,RequestHandlerProtocol:()=>UA,SMITHY_CONTEXT_KEY:()=>yg,getDefaultClientConfiguration:()=>jg,resolveDefaultRuntimeConfig:()=>Pg});AA.exports=Ng(EA);var wA=((D)=>{return D.HEADER="header",D.QUERY="query",D})(wA||{}),$A=((D)=>{return D.HEADER="header",D.QUERY="query",D})($A||{}),fA=((D)=>{return D.HTTP="http",D.HTTPS="https",D})(fA||{}),CA=((D)=>{return D.MD5="md5",D.CRC32="crc32",D.CRC32C="crc32c",D.SHA1="sha1",D.SHA256="sha256",D})(CA||{}),qg=qE((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"),Og=qE((D)=>{const F={};return D.checksumAlgorithms().forEach((E)=>{F[E.algorithmId()]=E.checksumConstructor()}),F},"resolveChecksumRuntimeConfig"),jg=qE((D)=>{return{...qg(D)}},"getDefaultClientConfiguration"),Pg=qE((D)=>{return{...Og(D)}},"resolveDefaultRuntimeConfig"),BA=((D)=>{return D[D.HEADER=0]="HEADER",D[D.TRAILER=1]="TRAILER",D})(BA||{}),yg="__smithy_context",hA=((D)=>{return D.PROFILE="profile",D.SSO_SESSION="sso-session",D.SERVICES="services",D})(hA||{}),UA=((D)=>{return D.HTTP_0_9="http/0.9",D.HTTP_1_0="http/1.0",D.TDS_8_0="tds/8.0",D})(UA||{})});var kg;var IA=M(()=>{kg=Q(W0(),1)});var GA=()=>{};function bg(D){return Object.keys(D).reduce((F,E)=>{const w=D[E];return{...F,[E]:Array.isArray(w)?[...w]:w}},{})}class gD{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 gD({...D,headers:{...D.headers}});if(F.query)F.query=bg(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 gD.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 MA=()=>{};var dD=M(()=>{FA();IA();GA();MA()});function P2(D){return D}var xg=(D)=>(F)=>async(E)=>{if(!gD.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)},cg,y2=(D)=>({applyToStack:(F)=>{F.add(xg(D),cg)}});var z6=M(()=>{dD();cg={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0}});var gg=()=>(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,...G}=w.output;return f?.info?.({clientName:$,commandName:C,input:I(E.input),output:A(G),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}},rg,k2=(D)=>({applyToStack:(F)=>{F.add(gg(),rg)}});var YA=M(()=>{rg={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0}});var T6=M(()=>{YA()});var ZA="X-Amzn-Trace-Id",_g="AWS_LAMBDA_FUNCTION_NAME",sg="_X_AMZN_TRACE_ID",ug=(D)=>(F)=>async(E)=>{const{request:w}=E;if(!gD.isInstance(w)||D.runtime!=="node"||w.headers.hasOwnProperty(ZA))return F(E);const $=process.env[_g],C=process.env[sg],f=(B)=>typeof B==="string"&&B.length>0;if(f($)&&f(C))w.headers[ZA]=C;return F({...E,request:w})},dg,b2=(D)=>({applyToStack:(F)=>{F.add(ug(D),dg)}});var K6=M(()=>{dD();dg={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"}});var kF=X((N7D,zA)=>{var{defineProperty:OE,getOwnPropertyDescriptor:vg,getOwnPropertyNames:mg}=Object,ng=Object.prototype.hasOwnProperty,WA=(D,F)=>OE(D,"name",{value:F,configurable:!0}),lg=(D,F)=>{for(var E in F)OE(D,E,{get:F[E],enumerable:!0})},ig=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of mg(F))if(!ng.call(D,$)&&$!==E)OE(D,$,{get:()=>F[$],enumerable:!(w=vg(F,$))||w.enumerable})}return D},pg=(D)=>ig(OE({},"__esModule",{value:!0}),D),JA={};lg(JA,{getSmithyContext:()=>ag,normalizeProvider:()=>og});zA.exports=pg(JA);var XA=W0(),ag=WA((D)=>D[XA.SMITHY_CONTEXT_KEY]||(D[XA.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),og=WA((D)=>{if(typeof D==="function")return D;const F=Promise.resolve(D);return()=>F},"normalizeProvider")});var i7=X((q7D,HA)=>{var{defineProperty:jE,getOwnPropertyDescriptor:tg,getOwnPropertyNames:eg}=Object,Dr=Object.prototype.hasOwnProperty,d8=(D,F)=>jE(D,"name",{value:F,configurable:!0}),Fr=(D,F)=>{for(var E in F)jE(D,E,{get:F[E],enumerable:!0})},Er=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of eg(F))if(!Dr.call(D,$)&&$!==E)jE(D,$,{get:()=>F[$],enumerable:!(w=tg(F,$))||w.enumerable})}return D},wr=(D)=>Er(jE({},"__esModule",{value:!0}),D),TA={};Fr(TA,{CredentialsProviderError:()=>$r,ProviderError:()=>PE,TokenProviderError:()=>fr,chain:()=>Cr,fromStatic:()=>Br,memoize:()=>hr});HA.exports=wr(TA);var KA=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)}};d8(KA,"ProviderError");var PE=KA,SA=class D extends PE{constructor(F,E=!0){super(F,E);this.name="CredentialsProviderError",Object.setPrototypeOf(this,D.prototype)}};d8(SA,"CredentialsProviderError");var $r=SA,QA=class D extends PE{constructor(F,E=!0){super(F,E);this.name="TokenProviderError",Object.setPrototypeOf(this,D.prototype)}};d8(QA,"TokenProviderError");var fr=QA,Cr=d8((...D)=>async()=>{if(D.length===0)throw new PE("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"),Br=d8((D)=>()=>Promise.resolve(D),"fromStatic"),hr=d8((D,F,E)=>{let w,$,C,f=!1;const B=d8(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=X((LA)=>{Object.defineProperty(LA,"__esModule",{value:!0});LA.getHomeDir=void 0;var Ur=import.meta.require("os"),Ar=import.meta.require("path"),p7={},Ir=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},Gr=()=>{const{HOME:D,USERPROFILE:F,HOMEPATH:E,HOMEDRIVE:w=`C:${Ar.sep}`}=process.env;if(D)return D;if(F)return F;if(E)return`${w}${E}`;const $=Ir();if(!p7[$])p7[$]=Ur.homedir();return p7[$]};LA.getHomeDir=Gr});var a7=X((VA)=>{Object.defineProperty(VA,"__esModule",{value:!0});VA.getSSOTokenFilepath=void 0;var Mr=import.meta.require("crypto"),Yr=import.meta.require("path"),Zr=S6(),Xr=(D)=>{const E=Mr.createHash("sha1").update(D).digest("hex");return Yr.join(Zr.getHomeDir(),".aws","sso","cache",`${E}.json`)};VA.getSSOTokenFilepath=Xr});var jA=X((qA)=>{Object.defineProperty(qA,"__esModule",{value:!0});qA.getSSOTokenFromFile=void 0;var Wr=import.meta.require("fs"),Jr=a7(),{readFile:zr}=Wr.promises,Tr=async(D)=>{const F=Jr.getSSOTokenFilepath(D),E=await zr(F,"utf8");return JSON.parse(E)};qA.getSSOTokenFromFile=Tr});var t7=X((PA)=>{Object.defineProperty(PA,"__esModule",{value:!0});PA.slurpFile=void 0;var Kr=import.meta.require("fs"),{readFile:Sr}=Kr.promises,o7={},Qr=(D,F)=>{if(!o7[D]||(F===null||F===void 0?void 0:F.ignoreCache))o7[D]=Sr(D,"utf8");return o7[D]};PA.slurpFile=Qr});var Ef=X((k7D,xF)=>{var{defineProperty:bE,getOwnPropertyDescriptor:Hr,getOwnPropertyNames:Lr}=Object,Rr=Object.prototype.hasOwnProperty,_0=(D,F)=>bE(D,"name",{value:F,configurable:!0}),Vr=(D,F)=>{for(var E in F)bE(D,E,{get:F[E],enumerable:!0})},e7=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Lr(F))if(!Rr.call(D,$)&&$!==E)bE(D,$,{get:()=>F[$],enumerable:!(w=Hr(F,$))||w.enumerable})}return D},Ff=(D,F,E)=>(e7(D,F,"default"),E&&e7(E,F,"default")),Nr=(D)=>e7(bE({},"__esModule",{value:!0}),D),bF={};Vr(bF,{CONFIG_PREFIX_SEPARATOR:()=>v8,DEFAULT_PROFILE:()=>cA,ENV_PROFILE:()=>xA,getProfileName:()=>qr,loadSharedConfigFiles:()=>rA,loadSsoSessionData:()=>ur,parseKnownFiles:()=>vr});xF.exports=Nr(bF);Ff(bF,S6(),xF.exports);var xA="AWS_PROFILE",cA="default",qr=_0((D)=>D.profile||process.env[xA]||cA,"getProfileName");Ff(bF,a7(),xF.exports);Ff(bF,jA(),xF.exports);var yE=W0(),Or=_0((D)=>Object.entries(D).filter(([F])=>{const E=F.indexOf(v8);if(E===-1)return!1;return Object.values(yE.IniSectionType).includes(F.substring(0,E))}).reduce((F,[E,w])=>{const $=E.indexOf(v8),C=E.substring(0,$)===yE.IniSectionType.PROFILE?E.substring($+1):E;return F[C]=w,F},{...D.default&&{default:D.default}}),"getConfigData"),kE=import.meta.require("path"),jr=S6(),Pr="AWS_CONFIG_FILE",gA=_0(()=>process.env[Pr]||kE.join(jr.getHomeDir(),".aws","config"),"getConfigFilepath"),yr=S6(),kr="AWS_SHARED_CREDENTIALS_FILE",br=_0(()=>process.env[kr]||kE.join(yr.getHomeDir(),".aws","credentials"),"getCredentialsFilepath"),xr=S6(),cr=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,gr=["__proto__","profile __proto__"],Df=_0((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=cr.exec(B);if(h){const[,U,,I]=h;if(Object.values(yE.IniSectionType).includes(U))E=[U,I].join(v8)}else E=B;if(gr.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(v8):h;F[E][I]=U}}}}return F},"parseIni"),kA=t7(),bA=_0(()=>({}),"swallowError"),v8=".",rA=_0(async(D={})=>{const{filepath:F=br(),configFilepath:E=gA()}=D,w=xr.getHomeDir();let C=F;if(F.startsWith("~/"))C=kE.join(w,F.slice(2));let f=E;if(E.startsWith("~/"))f=kE.join(w,E.slice(2));const B=await Promise.all([kA.slurpFile(f,{ignoreCache:D.ignoreCache}).then(Df).then(Or).catch(bA),kA.slurpFile(C,{ignoreCache:D.ignoreCache}).then(Df).catch(bA)]);return{configFile:B[0],credentialsFile:B[1]}},"loadSharedConfigFiles"),rr=_0((D)=>Object.entries(D).filter(([F])=>F.startsWith(yE.IniSectionType.SSO_SESSION+v8)).reduce((F,[E,w])=>({...F,[E.substring(E.indexOf(v8)+1)]:w}),{}),"getSsoSessionData"),_r=t7(),sr=_0(()=>({}),"swallowError"),ur=_0(async(D={})=>_r.slurpFile(D.configFilepath??gA()).then(Df).then(rr).catch(sr),"loadSsoSessionData"),dr=_0((...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"),vr=_0(async(D)=>{const F=await rA(D);return dr(F.configFile,F.credentialsFile)},"parseKnownFiles")});var dA=X((b7D,uA)=>{function wf(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:xE,getOwnPropertyDescriptor:mr,getOwnPropertyNames:nr}=Object,lr=Object.prototype.hasOwnProperty,Q6=(D,F)=>xE(D,"name",{value:F,configurable:!0}),ir=(D,F)=>{for(var E in F)xE(D,E,{get:F[E],enumerable:!0})},pr=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of nr(F))if(!lr.call(D,$)&&$!==E)xE(D,$,{get:()=>F[$],enumerable:!(w=mr(F,$))||w.enumerable})}return D},ar=(D)=>pr(xE({},"__esModule",{value:!0}),D),sA={};ir(sA,{loadConfig:()=>F_});uA.exports=ar(sA);var cF=i7();Q6(wf,"getSelectorName");var or=Q6((D,F)=>async()=>{try{const E=D(process.env);if(E===void 0)throw new Error;return E}catch(E){throw new cF.CredentialsProviderError(E.message||`Not found in ENV: ${wf(D.toString())}`,{logger:F})}},"fromEnv"),_A=Ef(),tr=Q6((D,{preferredFile:F="config",...E}={})=>async()=>{const w=_A.getProfileName(E),{configFile:$,credentialsFile:C}=await _A.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 cF.CredentialsProviderError(U.message||`Not found in config files w/ profile [${w}]: ${wf(D.toString())}`,{logger:E.logger})}},"fromSharedConfigFiles"),er=Q6((D)=>typeof D==="function","isFunction"),D_=Q6((D)=>er(D)?async()=>await D():cF.fromStatic(D),"fromStatic"),F_=Q6(({environmentVariableSelector:D,configFileSelector:F,default:E},w={})=>cF.memoize(cF.chain(or(D),tr(F,w),D_(E))),"loadConfig")});var pA=X((lA)=>{Object.defineProperty(lA,"__esModule",{value:!0});lA.getEndpointUrlConfig=void 0;var vA=Ef(),mA="AWS_ENDPOINT_URL",nA="endpoint_url",E_=(D)=>({environmentVariableSelector:(F)=>{const E=D.split(" ").map((C)=>C.toUpperCase()),w=F[[mA,...E].join("_")];if(w)return w;const $=F[mA];if($)return $;return},configFileSelector:(F,E)=>{if(E&&F.services){const $=E[["services",F.services].join(vA.CONFIG_PREFIX_SEPARATOR)];if($){const C=D.split(" ").map((B)=>B.toLowerCase()),f=$[[C.join("_"),nA].join(vA.CONFIG_PREFIX_SEPARATOR)];if(f)return f}}const w=F[nA];if(w)return w;return},default:void 0});lA.getEndpointUrlConfig=E_});var $f=X((aA)=>{Object.defineProperty(aA,"__esModule",{value:!0});aA.getEndpointFromConfig=void 0;var w_=dA(),$_=pA(),f_=async(D)=>w_.loadConfig($_.getEndpointUrlConfig(D!==null&&D!==void 0?D:""))();aA.getEndpointFromConfig=f_});var FI=X((g7D,DI)=>{function eA(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:cE,getOwnPropertyDescriptor:C_,getOwnPropertyNames:B_}=Object,h_=Object.prototype.hasOwnProperty,U_=(D,F)=>cE(D,"name",{value:F,configurable:!0}),A_=(D,F)=>{for(var E in F)cE(D,E,{get:F[E],enumerable:!0})},I_=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of B_(F))if(!h_.call(D,$)&&$!==E)cE(D,$,{get:()=>F[$],enumerable:!(w=C_(F,$))||w.enumerable})}return D},G_=(D)=>I_(cE({},"__esModule",{value:!0}),D),tA={};A_(tA,{parseQueryString:()=>eA});DI.exports=G_(tA);U_(eA,"parseQueryString")});var fI=X((r7D,$I)=>{var{defineProperty:gE,getOwnPropertyDescriptor:M_,getOwnPropertyNames:Y_}=Object,Z_=Object.prototype.hasOwnProperty,X_=(D,F)=>gE(D,"name",{value:F,configurable:!0}),W_=(D,F)=>{for(var E in F)gE(D,E,{get:F[E],enumerable:!0})},J_=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Y_(F))if(!Z_.call(D,$)&&$!==E)gE(D,$,{get:()=>F[$],enumerable:!(w=M_(F,$))||w.enumerable})}return D},z_=(D)=>J_(gE({},"__esModule",{value:!0}),D),EI={};W_(EI,{parseUrl:()=>wI});$I.exports=z_(EI);var T_=FI(),wI=X_((D)=>{if(typeof D==="string")return wI(new URL(D));const{hostname:F,pathname:E,port:w,protocol:$,search:C}=D;let f;if(C)f=T_.parseQueryString(C);return{hostname:F,port:w?parseInt(w):void 0,protocol:$,path:E,query:f}},"parseUrl")});var YD=X((_7D,GI)=>{function II(D,F,E){return{applyToStack:(w)=>{w.add(BI(D,E),UI),w.add(hI(D,F),AI)}}}var{defineProperty:rE,getOwnPropertyDescriptor:K_,getOwnPropertyNames:S_}=Object,Q_=Object.prototype.hasOwnProperty,ff=(D,F)=>rE(D,"name",{value:F,configurable:!0}),H_=(D,F)=>{for(var E in F)rE(D,E,{get:F[E],enumerable:!0})},L_=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of S_(F))if(!Q_.call(D,$)&&$!==E)rE(D,$,{get:()=>F[$],enumerable:!(w=K_(F,$))||w.enumerable})}return D},R_=(D)=>L_(rE({},"__esModule",{value:!0}),D),CI={};H_(CI,{deserializerMiddleware:()=>BI,deserializerMiddlewareOption:()=>UI,getSerdePlugin:()=>II,serializerMiddleware:()=>hI,serializerMiddlewareOption:()=>AI});GI.exports=R_(CI);var BI=ff((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"),hI=ff((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"),UI={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},AI={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};ff(II,"getSerdePlugin")});var TI=X((s7D,zI)=>{var{defineProperty:sE,getOwnPropertyDescriptor:V_,getOwnPropertyNames:N_}=Object,q_=Object.prototype.hasOwnProperty,h2=(D,F)=>sE(D,"name",{value:F,configurable:!0}),O_=(D,F)=>{for(var E in F)sE(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)sE(D,$,{get:()=>F[$],enumerable:!(w=V_(F,$))||w.enumerable})}return D},P_=(D)=>j_(sE({},"__esModule",{value:!0}),D),YI={};O_(YI,{endpointMiddleware:()=>WI,endpointMiddlewareOptions:()=>JI,getEndpointFromInstructions:()=>ZI,getEndpointPlugin:()=>u_,resolveEndpointConfig:()=>v_,resolveParams:()=>XI,toEndpointV1:()=>Cf});zI.exports=P_(YI);var y_=h2(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(g_(F)){if(D.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!c_(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"),k_=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,b_=/(\d+\.){3}\d+/,x_=/\.\./,c_=h2((D)=>k_.test(D)&&!b_.test(D)&&!x_.test(D),"isDnsCompatibleBucketName"),g_=h2((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"),r_=h2((D,F,E)=>{const w=h2(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"),__=$f(),MI=fI(),Cf=h2((D)=>{if(typeof D==="object"){if("url"in D)return MI.parseUrl(D.url);return D}return MI.parseUrl(D)},"toEndpointV1"),ZI=h2(async(D,F,E,w)=>{if(!E.endpoint){let f;if(E.serviceConfiguredEndpoint)f=await E.serviceConfiguredEndpoint();else f=await __.getEndpointFromConfig(E.serviceId);if(f)E.endpoint=()=>Promise.resolve(Cf(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=h2(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 r_(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 y_($);return $},"resolveParams"),_E=kF(),WI=h2(({config:D,instructions:F})=>{return(E,w)=>async($)=>{var C,f,B;const h=await ZI($.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=_E.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"),s_=YD(),JI={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:s_.serializerMiddlewareOption.name},u_=h2((D,F)=>({applyToStack:(E)=>{E.addRelativeTo(WI({config:D,instructions:F}),JI)}}),"getEndpointPlugin"),d_=$f(),v_=h2((D)=>{const F=D.tls??!0,{endpoint:E}=D,w=E!=null?async()=>Cf(await _E.normalizeProvider(E)()):void 0,C={...D,endpoint:w,tls:F,isCustomEndpoint:!!E,useDualstackEndpoint:_E.normalizeProvider(D.useDualstackEndpoint??!1),useFipsEndpoint:_E.normalizeProvider(D.useFipsEndpoint??!1)};let f=void 0;return C.serviceConfiguredEndpoint=async()=>{if(D.serviceId&&!f)f=d_.getEndpointFromConfig(D.serviceId);return f},C},"resolveEndpointConfig")});var H1=X((u7D,qI)=>{function RI(D){return Object.keys(D).reduce((F,E)=>{const w=D[E];return{...F,[E]:Array.isArray(w)?[...w]:w}},{})}function NI(D){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(D)}var{defineProperty:uE,getOwnPropertyDescriptor:m_,getOwnPropertyNames:n_}=Object,l_=Object.prototype.hasOwnProperty,w8=(D,F)=>uE(D,"name",{value:F,configurable:!0}),i_=(D,F)=>{for(var E in F)uE(D,E,{get:F[E],enumerable:!0})},p_=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of n_(F))if(!l_.call(D,$)&&$!==E)uE(D,$,{get:()=>F[$],enumerable:!(w=m_(F,$))||w.enumerable})}return D},a_=(D)=>p_(uE({},"__esModule",{value:!0}),D),KI={};i_(KI,{Field:()=>e_,Fields:()=>Ds,HttpRequest:()=>Fs,HttpResponse:()=>Es,IHttpRequest:()=>SI.HttpRequest,getHttpHandlerExtensionConfiguration:()=>o_,isValidHostname:()=>NI,resolveHttpHandlerRuntimeConfig:()=>t_});qI.exports=a_(KI);var o_=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"),t_=w8((D)=>{return{httpHandler:D.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),SI=W0(),QI=class D{constructor({name:F,kind:E=SI.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(QI,"Field");var e_=QI,HI=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(HI,"Fields");var Ds=HI,LI=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=RI(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(LI,"HttpRequest");var Fs=LI;w8(RI,"cloneQuery");var VI=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(VI,"HttpResponse");var Es=VI;w8(NI,"isValidHostname")});var Bf=X((OI)=>{function $s(D){return D&&D.__esModule?D:{default:D}}function fs(){if(dE>vE.length-16)ws.default.randomFillSync(vE),dE=0;return vE.slice(dE,dE+=16)}Object.defineProperty(OI,"__esModule",{value:!0});OI.default=fs;var ws=$s(import.meta.require("crypto")),vE=new Uint8Array(256),dE=vE.length});var yI=X((jI)=>{Object.defineProperty(jI,"__esModule",{value:!0});jI.default=void 0;var Bs=/^(?:[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;jI.default=Bs});var gF=X((kI)=>{function Us(D){return D&&D.__esModule?D:{default:D}}function As(D){return typeof D==="string"&&hs.default.test(D)}Object.defineProperty(kI,"__esModule",{value:!0});kI.default=void 0;var hs=Us(yI()),Is=As;kI.default=Is});var rF=X((cI)=>{function Ms(D){return D&&D.__esModule?D:{default:D}}function xI(D,F=0){return pD[D[F+0]]+pD[D[F+1]]+pD[D[F+2]]+pD[D[F+3]]+"-"+pD[D[F+4]]+pD[D[F+5]]+"-"+pD[D[F+6]]+pD[D[F+7]]+"-"+pD[D[F+8]]+pD[D[F+9]]+"-"+pD[D[F+10]]+pD[D[F+11]]+pD[D[F+12]]+pD[D[F+13]]+pD[D[F+14]]+pD[D[F+15]]}function Ys(D,F=0){const E=xI(D,F);if(!Gs.default(E))throw TypeError("Stringified UUID is invalid");return E}Object.defineProperty(cI,"__esModule",{value:!0});cI.default=void 0;cI.unsafeStringify=xI;var Gs=Ms(gF()),pD=[];for(let D=0;D<256;++D)pD.push((D+256).toString(16).slice(1));var Zs=Ys;cI.default=Zs});var uI=X((_I)=>{function zs(D){return D&&D.__esModule?D:{default:D}}function Ts(D,F,E){let w=F&&E||0;const $=F||new Array(16);D=D||{};let C=D.node||rI,f=D.clockseq!==void 0?D.clockseq:hf;if(C==null||f==null){const Y=D.random||(D.rng||Ws.default)();if(C==null)C=rI=[Y[0]|1,Y[1],Y[2],Y[3],Y[4],Y[5]];if(f==null)f=hf=(Y[6]<<8|Y[7])&16383}let B=D.msecs!==void 0?D.msecs:Date.now(),h=D.nsecs!==void 0?D.nsecs:Af+1;const U=B-Uf+(h-Af)/1e4;if(U<0&&D.clockseq===void 0)f=f+1&16383;if((U<0||B>Uf)&&D.nsecs===void 0)h=0;if(h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Uf=B,Af=h,hf=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||Js.unsafeStringify($)}Object.defineProperty(_I,"__esModule",{value:!0});_I.default=void 0;var Ws=zs(Bf()),Js=rF(),rI,hf,Uf=0,Af=0,Ks=Ts;_I.default=Ks});var If=X((dI)=>{function Qs(D){return D&&D.__esModule?D:{default:D}}function Hs(D){if(!Ss.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(dI,"__esModule",{value:!0});dI.default=void 0;var Ss=Qs(gF()),Ls=Hs;dI.default=Ls});var Gf=X((lI)=>{function Ns(D){return D&&D.__esModule?D:{default:D}}function qs(D){D=unescape(encodeURIComponent(D));const F=[];for(let E=0;E<D.length;++E)F.push(D.charCodeAt(E));return F}function Os(D,F,E){function w($,C,f,B){var h;if(typeof $==="string")$=qs($);if(typeof C==="string")C=Vs.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 Rs.unsafeStringify(U)}try{w.name=D}catch($){}return w.DNS=mI,w.URL=nI,w}Object.defineProperty(lI,"__esModule",{value:!0});lI.URL=lI.DNS=void 0;lI.default=Os;var Rs=rF(),Vs=Ns(If()),mI="6ba7b810-9dad-11d1-80b4-00c04fd430c8";lI.DNS=mI;var nI="6ba7b811-9dad-11d1-80b4-00c04fd430c8";lI.URL=nI});var oI=X((pI)=>{function ks(D){return D&&D.__esModule?D:{default:D}}function bs(D){if(Array.isArray(D))D=Buffer.from(D);else if(typeof D==="string")D=Buffer.from(D,"utf8");return ys.default.createHash("md5").update(D).digest()}Object.defineProperty(pI,"__esModule",{value:!0});pI.default=void 0;var ys=ks(import.meta.require("crypto")),xs=bs;pI.default=xs});var FG=X((eI)=>{function tI(D){return D&&D.__esModule?D:{default:D}}Object.defineProperty(eI,"__esModule",{value:!0});eI.default=void 0;var cs=tI(Gf()),gs=tI(oI()),rs=cs.default("v3",48,gs.default),_s=rs;eI.default=_s});var $G=X((EG)=>{function us(D){return D&&D.__esModule?D:{default:D}}Object.defineProperty(EG,"__esModule",{value:!0});EG.default=void 0;var ss=us(import.meta.require("crypto")),ds={randomUUID:ss.default.randomUUID};EG.default=ds});var UG=X((BG)=>{function CG(D){return D&&D.__esModule?D:{default:D}}function ns(D,F,E){if(fG.default.randomUUID&&!F&&!D)return fG.default.randomUUID();D=D||{};const w=D.random||(D.rng||vs.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 ms.unsafeStringify(w)}Object.defineProperty(BG,"__esModule",{value:!0});BG.default=void 0;var fG=CG($G()),vs=CG(Bf()),ms=rF(),ls=ns;BG.default=ls});var GG=X((AG)=>{function ps(D){return D&&D.__esModule?D:{default:D}}function as(D){if(Array.isArray(D))D=Buffer.from(D);else if(typeof D==="string")D=Buffer.from(D,"utf8");return is.default.createHash("sha1").update(D).digest()}Object.defineProperty(AG,"__esModule",{value:!0});AG.default=void 0;var is=ps(import.meta.require("crypto")),os=as;AG.default=os});var XG=X((YG)=>{function MG(D){return D&&D.__esModule?D:{default:D}}Object.defineProperty(YG,"__esModule",{value:!0});YG.default=void 0;var ts=MG(Gf()),es=MG(GG()),Du=ts.default("v5",80,es.default),Fu=Du;YG.default=Fu});var zG=X((WG)=>{Object.defineProperty(WG,"__esModule",{value:!0});WG.default=void 0;var Eu="00000000-0000-0000-0000-000000000000";WG.default=Eu});var SG=X((TG)=>{function $u(D){return D&&D.__esModule?D:{default:D}}function fu(D){if(!wu.default(D))throw TypeError("Invalid UUID");return parseInt(D.slice(14,15),16)}Object.defineProperty(TG,"__esModule",{value:!0});TG.default=void 0;var wu=$u(gF()),Cu=fu;TG.default=Cu});var Mf=X((U2)=>{function L1(D){return D&&D.__esModule?D:{default:D}}Object.defineProperty(U2,"__esModule",{value:!0});Object.defineProperty(U2,"NIL",{enumerable:!0,get:function(){return Iu.default}});Object.defineProperty(U2,"parse",{enumerable:!0,get:function(){return Zu.default}});Object.defineProperty(U2,"stringify",{enumerable:!0,get:function(){return Yu.default}});Object.defineProperty(U2,"v1",{enumerable:!0,get:function(){return Bu.default}});Object.defineProperty(U2,"v3",{enumerable:!0,get:function(){return hu.default}});Object.defineProperty(U2,"v4",{enumerable:!0,get:function(){return Uu.default}});Object.defineProperty(U2,"v5",{enumerable:!0,get:function(){return Au.default}});Object.defineProperty(U2,"validate",{enumerable:!0,get:function(){return Mu.default}});Object.defineProperty(U2,"version",{enumerable:!0,get:function(){return Gu.default}});var Bu=L1(uI()),hu=L1(FG()),Uu=L1(UG()),Au=L1(XG()),Iu=L1(zG()),Gu=L1(SG()),Mu=L1(gF()),Yu=L1(rF()),Zu=L1(If())});var Yf=X((ffD,RG)=>{var{defineProperty:mE,getOwnPropertyDescriptor:Xu,getOwnPropertyNames:Wu}=Object,Ju=Object.prototype.hasOwnProperty,H6=(D,F)=>mE(D,"name",{value:F,configurable:!0}),zu=(D,F)=>{for(var E in F)mE(D,E,{get:F[E],enumerable:!0})},Tu=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Wu(F))if(!Ju.call(D,$)&&$!==E)mE(D,$,{get:()=>F[$],enumerable:!(w=Xu(F,$))||w.enumerable})}return D},Ku=(D)=>Tu(mE({},"__esModule",{value:!0}),D),QG={};zu(QG,{isClockSkewCorrectedError:()=>HG,isClockSkewError:()=>Nu,isRetryableByTrait:()=>Vu,isServerError:()=>Ou,isThrottlingError:()=>qu,isTransientError:()=>LG});RG.exports=Ku(QG);var Su=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch"],Qu=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],Hu=["TimeoutError","RequestTimeout","RequestTimeoutException"],Lu=[500,502,503,504],Ru=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],Vu=H6((D)=>D.$retryable!==void 0,"isRetryableByTrait"),Nu=H6((D)=>Su.includes(D.name),"isClockSkewError"),HG=H6((D)=>{var F;return(F=D.$metadata)==null?void 0:F.clockSkewCorrected},"isClockSkewCorrectedError"),qu=H6((D)=>{var F,E;return((F=D.$metadata)==null?void 0:F.httpStatusCode)===429||Qu.includes(D.name)||((E=D.$retryable)==null?void 0:E.throttling)==!0},"isThrottlingError"),LG=H6((D)=>{var F;return HG(D)||Hu.includes(D.name)||Ru.includes((D==null?void 0:D.code)||"")||Lu.includes(((F=D.$metadata)==null?void 0:F.httpStatusCode)||0)},"isTransientError"),Ou=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&&!LG(D))return!0;return!1}return!1},"isServerError")});var _G=X((CfD,rG)=>{var{defineProperty:nE,getOwnPropertyDescriptor:ju,getOwnPropertyNames:Pu}=Object,yu=Object.prototype.hasOwnProperty,A2=(D,F)=>nE(D,"name",{value:F,configurable:!0}),ku=(D,F)=>{for(var E in F)nE(D,E,{get:F[E],enumerable:!0})},bu=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Pu(F))if(!yu.call(D,$)&&$!==E)nE(D,$,{get:()=>F[$],enumerable:!(w=ju(F,$))||w.enumerable})}return D},xu=(D)=>bu(nE({},"__esModule",{value:!0}),D),NG={};ku(NG,{AdaptiveRetryStrategy:()=>uu,ConfiguredRetryStrategy:()=>du,DEFAULT_MAX_ATTEMPTS:()=>Zf,DEFAULT_RETRY_DELAY_BASE:()=>_F,DEFAULT_RETRY_MODE:()=>cu,DefaultRateLimiter:()=>jG,INITIAL_RETRY_TOKENS:()=>Xf,INVOCATION_ID_HEADER:()=>ru,MAXIMUM_RETRY_DELAY:()=>Wf,NO_RETRY_INCREMENT:()=>bG,REQUEST_HEADER:()=>_u,RETRY_COST:()=>yG,RETRY_MODES:()=>qG,StandardRetryStrategy:()=>Jf,THROTTLING_RETRY_DELAY_BASE:()=>PG,TIMEOUT_RETRY_COST:()=>kG});rG.exports=xu(NG);var qG=((D)=>{return D.STANDARD="standard",D.ADAPTIVE="adaptive",D})(qG||{}),Zf=3,cu="standard",gu=Yf(),OG=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(),gu.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))}};A2(OG,"DefaultRateLimiter");var jG=OG,_F=100,Wf=20000,PG=500,Xf=500,yG=5,kG=10,bG=1,ru="amz-sdk-invocation-id",_u="amz-sdk-request",su=A2(()=>{let D=_F;return{computeNextBackoffDelay:A2((w)=>{return Math.floor(Math.min(Wf,Math.random()*2**w*D))},"computeNextBackoffDelay"),setDelayBase:A2((w)=>{D=w},"setDelayBase")}},"getDefaultRetryBackoffStrategy"),VG=A2(({retryDelay:D,retryCount:F,retryCost:E})=>{return{getRetryCount:A2(()=>F,"getRetryCount"),getRetryDelay:A2(()=>Math.min(Wf,D),"getRetryDelay"),getRetryCost:A2(()=>E,"getRetryCost")}},"createDefaultRetryToken"),xG=class D{constructor(F){this.maxAttempts=F,this.mode="standard",this.capacity=Xf,this.retryBackoffStrategy=su(),this.maxAttemptsProvider=typeof F==="function"?F:async()=>F}async acquireInitialRetryToken(F){return VG({retryDelay:_F,retryCount:0})}async refreshRetryTokenForRetry(F,E){const w=await this.getMaxAttempts();if(this.shouldRetry(F,E,w)){const $=E.errorType;this.retryBackoffStrategy.setDelayBase($==="THROTTLING"?PG:_F);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,VG({retryDelay:f,retryCount:F.getRetryCount()+1,retryCost:B})}throw new Error("No retry token available")}recordSuccess(F){this.capacity=Math.max(Xf,this.capacity+(F.getRetryCost()??bG))}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 ${Zf}`),Zf}}shouldRetry(F,E,w){return F.getRetryCount()+1<w&&this.capacity>=this.getCapacityCost(E.errorType)&&this.isRetryableError(E.errorType)}getCapacityCost(F){return F==="TRANSIENT"?kG:yG}isRetryableError(F){return F==="THROTTLING"||F==="TRANSIENT"}};A2(xG,"StandardRetryStrategy");var Jf=xG,cG=class D{constructor(F,E){this.maxAttemptsProvider=F,this.mode="adaptive";const{rateLimiter:w}=E??{};this.rateLimiter=w??new jG,this.standardRetryStrategy=new Jf(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)}};A2(cG,"AdaptiveRetryStrategy");var uu=cG,gG=class D extends Jf{constructor(F,E=_F){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}};A2(gG,"ConfiguredRetryStrategy");var du=gG});var mG=X((BfD,vG)=>{var{defineProperty:lE,getOwnPropertyDescriptor:vu,getOwnPropertyNames:mu}=Object,nu=Object.prototype.hasOwnProperty,s0=(D,F)=>lE(D,"name",{value:F,configurable:!0}),lu=(D,F)=>{for(var E in F)lE(D,E,{get:F[E],enumerable:!0})},iu=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of mu(F))if(!nu.call(D,$)&&$!==E)lE(D,$,{get:()=>F[$],enumerable:!(w=vu(F,$))||w.enumerable})}return D},pu=(D)=>iu(lE({},"__esModule",{value:!0}),D),dG={};lu(dG,{constructStack:()=>zf});vG.exports=pu(dG);var m8=s0((D,F)=>{const E=[];if(D)E.push(D);if(F)for(let w of F)E.push(w);return E},"getAllAliases"),$8=s0((D,F)=>{return`${D||"anonymous"}${F&&F.length>0?` (a.k.a. ${F.join(",")})`:""}`},"getMiddlewareNameWithAliases"),zf=s0(()=>{let D=[],F=[],E=!1;const w=new Set,$=s0((A)=>A.sort((Y,G)=>sG[G.step]-sG[Y.step]||uG[G.priority||"normal"]-uG[Y.priority||"normal"]),"sort"),C=s0((A)=>{let Y=!1;const G=s0((Z)=>{const z=m8(Z.name,Z.aliases);if(z.includes(A)){Y=!0;for(let W of z)w.delete(W);return!1}return!0},"filterCb");return D=D.filter(G),F=F.filter(G),Y},"removeByName"),f=s0((A)=>{let Y=!1;const G=s0((Z)=>{if(Z.middleware===A){Y=!0;for(let z of m8(Z.name,Z.aliases))w.delete(z);return!1}return!0},"filterCb");return D=D.filter(G),F=F.filter(G),Y},"removeByReference"),B=s0((A)=>{var Y;return D.forEach((G)=>{A.add(G.middleware,{...G})}),F.forEach((G)=>{A.addRelativeTo(G.middleware,{...G})}),(Y=A.identifyOnResolve)==null||Y.call(A,I.identifyOnResolve()),A},"cloneTo"),h=s0((A)=>{const Y=[];return A.before.forEach((G)=>{if(G.before.length===0&&G.after.length===0)Y.push(G);else Y.push(...h(G))}),Y.push(A),A.after.reverse().forEach((G)=>{if(G.before.length===0&&G.after.length===0)Y.push(G);else Y.push(...h(G))}),Y},"expandRelativeMiddlewareList"),U=s0((A=!1)=>{const Y=[],G=[],Z={};return D.forEach((W)=>{const J={...W,before:[],after:[]};for(let K of m8(J.name,J.aliases))Z[K]=J;Y.push(J)}),F.forEach((W)=>{const J={...W,before:[],after:[]};for(let K of m8(J.name,J.aliases))Z[K]=J;G.push(J)}),G.forEach((W)=>{if(W.toMiddleware){const J=Z[W.toMiddleware];if(J===void 0){if(A)return;throw new Error(`${W.toMiddleware} is not found when adding ${$8(W.name,W.aliases)} middleware ${W.relation} ${W.toMiddleware}`)}if(W.relation==="after")J.after.push(W);if(W.relation==="before")J.before.push(W)}}),$(Y).map(h).reduce((W,J)=>{return W.push(...J),W},[])},"getMiddlewareList"),I={add:(A,Y={})=>{const{name:G,override:Z,aliases:z}=Y,W={step:"initialize",priority:"normal",middleware:A,...Y},J=m8(G,z);if(J.length>0){if(J.some((K)=>w.has(K))){if(!Z)throw new Error(`Duplicate middleware name '${$8(G,z)}'`);for(let K of J){const L=D.findIndex((m)=>{var DD;return m.name===K||((DD=m.aliases)==null?void 0:DD.some((wD)=>wD===K))});if(L===-1)continue;const V=D[L];if(V.step!==W.step||W.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(G,z)}" middleware with ${W.priority} priority in ${W.step} step.`);D.splice(L,1)}}for(let K of J)w.add(K)}D.push(W)},addRelativeTo:(A,Y)=>{const{name:G,override:Z,aliases:z}=Y,W={middleware:A,...Y},J=m8(G,z);if(J.length>0){if(J.some((K)=>w.has(K))){if(!Z)throw new Error(`Duplicate middleware name '${$8(G,z)}'`);for(let K of J){const L=F.findIndex((m)=>{var DD;return m.name===K||((DD=m.aliases)==null?void 0:DD.some((wD)=>wD===K))});if(L===-1)continue;const V=F[L];if(V.toMiddleware!==W.toMiddleware||V.relation!==W.relation)throw new Error(`"${$8(V.name,V.aliases)}" middleware ${V.relation} "${V.toMiddleware}" middleware cannot be overridden by "${$8(G,z)}" middleware ${W.relation} "${W.toMiddleware}" middleware.`);F.splice(L,1)}}for(let K of J)w.add(K)}F.push(W)},clone:()=>B(zf()),use:(A)=>{A.applyToStack(I)},remove:(A)=>{if(typeof A==="string")return C(A);else return f(A)},removeByTag:(A)=>{let Y=!1;const G=s0((Z)=>{const{tags:z,name:W,aliases:J}=Z;if(z&&z.includes(A)){const K=m8(W,J);for(let L of K)w.delete(L);return Y=!0,!1}return!0},"filterCb");return D=D.filter(G),F=F.filter(G),Y},concat:(A)=>{var Y;const G=B(zf());return G.use(A),G.identifyOnResolve(E||G.identifyOnResolve()||(((Y=A.identifyOnResolve)==null?void 0:Y.call(A))??!1)),G},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 G of U().map((Z)=>Z.middleware).reverse())A=G(A,Y);if(E)console.log(I.identify());return A}};return I},"constructStack"),sG={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},uG={high:3,normal:2,low:1}});var Tf=X((hfD,lG)=>{var{defineProperty:iE,getOwnPropertyDescriptor:au,getOwnPropertyNames:ou}=Object,tu=Object.prototype.hasOwnProperty,eu=(D,F)=>iE(D,"name",{value:F,configurable:!0}),Dd=(D,F)=>{for(var E in F)iE(D,E,{get:F[E],enumerable:!0})},Fd=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of ou(F))if(!tu.call(D,$)&&$!==E)iE(D,$,{get:()=>F[$],enumerable:!(w=au(F,$))||w.enumerable})}return D},Ed=(D)=>Fd(iE({},"__esModule",{value:!0}),D),nG={};Dd(nG,{isArrayBuffer:()=>wd});lG.exports=Ed(nG);var wd=eu((D)=>typeof ArrayBuffer==="function"&&D instanceof ArrayBuffer||Object.prototype.toString.call(D)==="[object ArrayBuffer]","isArrayBuffer")});var sF=X((UfD,aG)=>{var{defineProperty:pE,getOwnPropertyDescriptor:$d,getOwnPropertyNames:fd}=Object,Cd=Object.prototype.hasOwnProperty,iG=(D,F)=>pE(D,"name",{value:F,configurable:!0}),Bd=(D,F)=>{for(var E in F)pE(D,E,{get:F[E],enumerable:!0})},hd=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of fd(F))if(!Cd.call(D,$)&&$!==E)pE(D,$,{get:()=>F[$],enumerable:!(w=$d(F,$))||w.enumerable})}return D},Ud=(D)=>hd(pE({},"__esModule",{value:!0}),D),pG={};Bd(pG,{fromArrayBuffer:()=>Id,fromString:()=>Gd});aG.exports=Ud(pG);var Ad=Tf(),Kf=import.meta.require("buffer"),Id=iG((D,F=0,E=D.byteLength-F)=>{if(!Ad.isArrayBuffer(D))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof D} (${D})`);return Kf.Buffer.from(D,F,E)},"fromArrayBuffer"),Gd=iG((D,F)=>{if(typeof D!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof D} (${D})`);return F?Kf.Buffer.from(D,F):Kf.Buffer.from(D)},"fromString")});var eG=X((oG)=>{Object.defineProperty(oG,"__esModule",{value:!0});oG.fromBase64=void 0;var Md=sF(),Yd=/^[A-Za-z0-9+/]*={0,2}$/,Zd=(D)=>{if(D.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!Yd.exec(D))throw new TypeError("Invalid base64 string.");const F=Md.fromString(D,"base64");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength)};oG.fromBase64=Zd});var f8=X((IfD,wM)=>{var{defineProperty:aE,getOwnPropertyDescriptor:Xd,getOwnPropertyNames:Wd}=Object,Jd=Object.prototype.hasOwnProperty,Sf=(D,F)=>aE(D,"name",{value:F,configurable:!0}),zd=(D,F)=>{for(var E in F)aE(D,E,{get:F[E],enumerable:!0})},Td=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Wd(F))if(!Jd.call(D,$)&&$!==E)aE(D,$,{get:()=>F[$],enumerable:!(w=Xd(F,$))||w.enumerable})}return D},Kd=(D)=>Td(aE({},"__esModule",{value:!0}),D),DM={};zd(DM,{fromUtf8:()=>EM,toUint8Array:()=>Sd,toUtf8:()=>Qd});wM.exports=Kd(DM);var FM=sF(),EM=Sf((D)=>{const F=FM.fromString(D,"utf8");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),Sd=Sf((D)=>{if(typeof D==="string")return EM(D);if(ArrayBuffer.isView(D))return new Uint8Array(D.buffer,D.byteOffset,D.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(D)},"toUint8Array"),Qd=Sf((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 FM.fromArrayBuffer(D.buffer,D.byteOffset,D.byteLength).toString("utf8")},"toUtf8")});var CM=X(($M)=>{Object.defineProperty($M,"__esModule",{value:!0});$M.toBase64=void 0;var Hd=sF(),Ld=f8(),Rd=(D)=>{let F;if(typeof D==="string")F=Ld.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 Hd.fromArrayBuffer(F.buffer,F.byteOffset,F.byteLength).toString("base64")};$M.toBase64=Rd});var tE=X((MfD,oE)=>{var{defineProperty:BM,getOwnPropertyDescriptor:Vd,getOwnPropertyNames:Nd}=Object,qd=Object.prototype.hasOwnProperty,Qf=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Nd(F))if(!qd.call(D,$)&&$!==E)BM(D,$,{get:()=>F[$],enumerable:!(w=Vd(F,$))||w.enumerable})}return D},hM=(D,F,E)=>(Qf(D,F,"default"),E&&Qf(E,F,"default")),Od=(D)=>Qf(BM({},"__esModule",{value:!0}),D),Hf={};oE.exports=Od(Hf);hM(Hf,eG(),oE.exports);hM(Hf,CM(),oE.exports)});var IM=X((UM)=>{Object.defineProperty(UM,"__esModule",{value:!0});UM.getAwsChunkedEncodingStream=void 0;var jd=import.meta.require("stream"),Pd=(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 jd.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};UM.getAwsChunkedEncodingStream=Pd});var Rf=X((ZfD,YM)=>{var{defineProperty:eE,getOwnPropertyDescriptor:yd,getOwnPropertyNames:kd}=Object,bd=Object.prototype.hasOwnProperty,Lf=(D,F)=>eE(D,"name",{value:F,configurable:!0}),xd=(D,F)=>{for(var E in F)eE(D,E,{get:F[E],enumerable:!0})},cd=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of kd(F))if(!bd.call(D,$)&&$!==E)eE(D,$,{get:()=>F[$],enumerable:!(w=yd(F,$))||w.enumerable})}return D},gd=(D)=>cd(eE({},"__esModule",{value:!0}),D),GM={};xd(GM,{escapeUri:()=>MM,escapeUriPath:()=>_d});YM.exports=gd(GM);var MM=Lf((D)=>encodeURIComponent(D).replace(/[!'()*]/g,rd),"escapeUri"),rd=Lf((D)=>`%${D.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),_d=Lf((D)=>D.split("/").map(MM).join("/"),"escapeUriPath")});var Nf=X((XfD,WM)=>{function XM(D){const F=[];for(let E of Object.keys(D).sort()){const w=D[E];if(E=Vf.escapeUri(E),Array.isArray(w))for(let $=0,C=w.length;$<C;$++)F.push(`${E}=${Vf.escapeUri(w[$])}`);else{let $=E;if(w||typeof w==="string")$+=`=${Vf.escapeUri(w)}`;F.push($)}}return F.join("&")}var{defineProperty:Dw,getOwnPropertyDescriptor:sd,getOwnPropertyNames:ud}=Object,dd=Object.prototype.hasOwnProperty,vd=(D,F)=>Dw(D,"name",{value:F,configurable:!0}),md=(D,F)=>{for(var E in F)Dw(D,E,{get:F[E],enumerable:!0})},nd=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of ud(F))if(!dd.call(D,$)&&$!==E)Dw(D,$,{get:()=>F[$],enumerable:!(w=sd(F,$))||w.enumerable})}return D},ld=(D)=>nd(Dw({},"__esModule",{value:!0}),D),ZM={};md(ZM,{buildQueryString:()=>XM});WM.exports=ld(ZM);var Vf=Rf();vd(XM,"buildQueryString")});var xM=X((WfD,bM)=>{async function jf(D,F,E=TM){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(TM,E)))}),new Promise((B)=>{D.on("continue",()=>{clearTimeout(C),B()}),D.on("error",()=>{f=!0,clearTimeout(C),B()})})]);if(!f)NM(D,F.body)}function NM(D,F){if(F instanceof VM.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 kM(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:id,defineProperty:uF,getOwnPropertyDescriptor:pd,getOwnPropertyNames:ad,getPrototypeOf:od}=Object,td=Object.prototype.hasOwnProperty,AD=(D,F)=>uF(D,"name",{value:F,configurable:!0}),ed=(D,F)=>{for(var E in F)uF(D,E,{get:F[E],enumerable:!0})},SM=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of ad(F))if(!td.call(D,$)&&$!==E)uF(D,$,{get:()=>F[$],enumerable:!(w=pd(F,$))||w.enumerable})}return D},Dv=(D,F,E)=>(E=D!=null?id(od(D)):{},SM(F||!D||!D.__esModule?uF(E,"default",{value:D,enumerable:!0}):E,D)),Fv=(D)=>SM(uF({},"__esModule",{value:!0}),D),QM={};ed(QM,{DEFAULT_REQUEST_TIMEOUT:()=>Bv,NodeHttp2Handler:()=>Gv,NodeHttpHandler:()=>hv,streamCollector:()=>Yv});bM.exports=Fv(QM);var HM=H1(),LM=Nf(),qf=import.meta.require("http"),Of=import.meta.require("https"),Ev=["ECONNRESET","EPIPE","ETIMEDOUT"],RM=AD((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"),JM=1000,wv=AD((D,F,E=0)=>{if(!E)return-1;const w=AD(($)=>{const C=setTimeout(()=>{D.destroy(),F(Object.assign(new Error(`Socket timed out without establishing a connection within ${E} ms`),{name:"TimeoutError"}))},E-$),f=AD((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,JM),JM)},"setConnectionTimeout"),$v=3000,fv=AD((D,{keepAlive:F,keepAliveMsecs:E},w=$v)=>{if(F!==!0)return-1;const $=AD(()=>{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"),zM=3000,Cv=AD((D,F,E=0)=>{const w=AD(($)=>{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:zM),zM)},"setSocketTimeout"),VM=import.meta.require("stream"),TM=1000;AD(jf,"writeRequestBody");AD(NM,"writeBody");var Bv=0,qM=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,G=((C=h[A])==null?void 0:C.length)??0;if(Y>=U&&G>=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 ${G} 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 qf.Agent||typeof(C==null?void 0:C.destroy)==="function")return C;return new qf.Agent({keepAlive:!0,maxSockets:50,...C})})(),httpsAgent:(()=>{if(f instanceof Of.Agent||typeof(f==null?void 0:f.destroy)==="function")return f;return new Of.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=AD(async(L)=>{await C,f.forEach(clearTimeout),w(L)},"resolve"),h=AD(async(L)=>{await C,f.forEach(clearTimeout),$(L)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(E==null?void 0:E.aborted){const L=new Error("Request aborted");L.name="AbortError",h(L);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=LM.buildQueryString(F.query||{});let Y=void 0;if(F.username!=null||F.password!=null){const L=F.username??"",V=F.password??"";Y=`${L}:${V}`}let G=F.path;if(A)G+=`?${A}`;if(F.fragment)G+=`#${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:G,port:F.port,agent:I,auth:Y},J=(U?Of.request:qf.request)(z,(L)=>{const V=new HM.HttpResponse({statusCode:L.statusCode||-1,reason:L.statusMessage,headers:RM(L.headers),body:L});B({response:V})});if(J.on("error",(L)=>{if(Ev.includes(L.code))h(Object.assign(L,{name:"TimeoutError"}));else h(L)}),E){const L=AD(()=>{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",L,{once:!0}),J.once("close",()=>V.removeEventListener("abort",L))}else E.onabort=L}f.push(wv(J,h,this.config.connectionTimeout)),f.push(Cv(J,h,this.config.requestTimeout));const K=z.agent;if(typeof K==="object"&&"keepAlive"in K)f.push(fv(J,{keepAlive:K.keepAlive,keepAliveMsecs:K.keepAliveMsecs}));C=jf(J,F,this.config.requestTimeout).catch((L)=>{return f.forEach(clearTimeout),$(L)})})}updateHttpClientConfig(F,E){this.config=void 0,this.configProvider=this.configProvider.then((w)=>{return{...w,[F]:E}})}httpHandlerConfigs(){return this.config??{}}};AD(qM,"NodeHttpHandler");var hv=qM,KM=import.meta.require("http2"),Uv=Dv(import.meta.require("http2")),OM=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()}}};AD(OM,"NodeHttp2ConnectionPool");var Av=OM,jM=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=Uv.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=AD(()=>{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 Av;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()}};AD(jM,"NodeHttp2ConnectionManager");var Iv=jM,PM=class D{constructor(F){this.metadata={handlerProtocol:"h2"},this.connectionManager=new Iv({}),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=AD(async(b)=>{await U,C(b)},"resolve"),A=AD(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:G,port:Z,protocol:z,query:W}=F;let J="";if(F.username!=null||F.password!=null){const b=F.username??"",hD=F.password??"";J=`${b}:${hD}@`}const K=`${z}//${J}${Y}${Z?`:${Z}`:""}`,L={destination:new URL(K)},V=this.connectionManager.lease(L,{requestTimeout:(B=this.config)==null?void 0:B.sessionTimeout,disableConcurrentStreams:$||!1}),m=AD((b)=>{if($)this.destroySession(V);h=!0,A(b)},"rejectWithDestroy"),DD=LM.buildQueryString(W||{});let wD=F.path;if(DD)wD+=`?${DD}`;if(F.fragment)wD+=`#${F.fragment}`;const t=V.request({...F.headers,[KM.constants.HTTP2_HEADER_PATH]:wD,[KM.constants.HTTP2_HEADER_METHOD]:G});if(V.ref(),t.on("response",(b)=>{const hD=new HM.HttpResponse({statusCode:b[":status"]||-1,headers:RM(b),body:t});if(h=!0,I({response:hD}),$)V.close(),this.connectionManager.deleteSession(K,V)}),w)t.setTimeout(w,()=>{t.close();const b=new Error(`Stream timed out because of no activity for ${w} ms`);b.name="TimeoutError",m(b)});if(E){const b=AD(()=>{t.close();const hD=new Error("Request aborted");hD.name="AbortError",m(hD)},"onAbort");if(typeof E.addEventListener==="function"){const hD=E;hD.addEventListener("abort",b,{once:!0}),t.once("close",()=>hD.removeEventListener("abort",b))}else E.onabort=b}t.on("frameError",(b,hD,tD)=>{m(new Error(`Frame type id ${b} in stream id ${tD} has failed with code ${hD}.`))}),t.on("error",m),t.on("aborted",()=>{m(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${t.rstCode}.`))}),t.on("close",()=>{if(V.unref(),$)V.destroy();if(!h)m(new Error("Unexpected error: http2 request did not get a response"))}),U=jf(t,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()}};AD(PM,"NodeHttp2Handler");var Gv=PM,yM=class D extends VM.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(F,E,w){this.bufferedBytes.push(F),w()}};AD(yM,"Collector");var Mv=yM,Yv=AD((D)=>{if(Zv(D))return kM(D);return new Promise((F,E)=>{const w=new Mv;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"),Zv=AD((D)=>typeof ReadableStream==="function"&&D instanceof ReadableStream,"isReadableStreamInstance");AD(kM,"collectReadableStream")});var mM=X((JfD,vM)=>{function rM(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 sM(D){const F=await dM(D),E=Hv.fromBase64(F);return new Uint8Array(E)}async function uM(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 dM(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:Ew,getOwnPropertyDescriptor:Xv,getOwnPropertyNames:Wv}=Object,Jv=Object.prototype.hasOwnProperty,R1=(D,F)=>Ew(D,"name",{value:F,configurable:!0}),zv=(D,F)=>{for(var E in F)Ew(D,E,{get:F[E],enumerable:!0})},Tv=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Wv(F))if(!Jv.call(D,$)&&$!==E)Ew(D,$,{get:()=>F[$],enumerable:!(w=Xv(F,$))||w.enumerable})}return D},Kv=(D)=>Tv(Ew({},"__esModule",{value:!0}),D),gM={};zv(gM,{FetchHttpHandler:()=>Qv,keepAliveSupport:()=>Fw,streamCollector:()=>Lv});vM.exports=Kv(gM);var cM=H1(),Sv=Nf();R1(rM,"requestTimeout");var Fw={supported:void 0},_M=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(Fw.supported===void 0)Fw.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=Sv.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??"",L=F.password??"";U=`${K}:${L}@`}const{port:I,method:A}=F,Y=`${F.protocol}//${U}${F.hostname}${I?`:${I}`:""}${B}`,G=A==="GET"||A==="HEAD"?void 0:F.body,Z={body:G,headers:new Headers(F.headers),method:A,credentials:f};if((w=this.config)==null?void 0:w.cache)Z.cache=this.config.cache;if(G)Z.duplex="half";if(typeof AbortController!=="undefined")Z.signal=E;if(Fw.supported)Z.keepalive=C;if(typeof this.config.requestInit==="function")Object.assign(Z,this.config.requestInit(F));let z=R1(()=>{},"removeSignalEventListener");const W=new Request(Y,Z),J=[fetch(W).then((K)=>{const L=K.headers,V={};for(let DD of L.entries())V[DD[0]]=DD[1];if(K.body==null)return K.blob().then((DD)=>({response:new cM.HttpResponse({headers:V,reason:K.statusText,statusCode:K.status,body:DD})}));return{response:new cM.HttpResponse({headers:V,reason:K.statusText,statusCode:K.status,body:K.body})}}),rM($)];if(E)J.push(new Promise((K,L)=>{const V=R1(()=>{const m=new Error("Request aborted");m.name="AbortError",L(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(_M,"FetchHttpHandler");var Qv=_M,Hv=tE(),Lv=R1((D)=>{if(typeof Blob==="function"&&D instanceof Blob)return sM(D);return uM(D)},"streamCollector");R1(sM,"collectBlob");R1(uM,"collectStream");R1(dM,"readToBase64")});var yf=X((zfD,oM)=>{function pM(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 Pf)F[E/2]=Pf[w];else throw new Error(`Cannot decode unrecognized sequence ${w} as hexadecimal`)}return F}function aM(D){let F="";for(let E=0;E<D.byteLength;E++)F+=iM[D[E]];return F}var{defineProperty:ww,getOwnPropertyDescriptor:Rv,getOwnPropertyNames:Vv}=Object,Nv=Object.prototype.hasOwnProperty,nM=(D,F)=>ww(D,"name",{value:F,configurable:!0}),qv=(D,F)=>{for(var E in F)ww(D,E,{get:F[E],enumerable:!0})},Ov=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Vv(F))if(!Nv.call(D,$)&&$!==E)ww(D,$,{get:()=>F[$],enumerable:!(w=Rv(F,$))||w.enumerable})}return D},jv=(D)=>Ov(ww({},"__esModule",{value:!0}),D),lM={};qv(lM,{fromHex:()=>pM,toHex:()=>aM});oM.exports=jv(lM);var iM={},Pf={};for(let D=0;D<256;D++){let F=D.toString(16).toLowerCase();if(F.length===1)F=`0${F}`;iM[D]=F,Pf[F]=D}nM(pM,"fromHex");nM(aM,"toHex")});var dF=X((tM)=>{Object.defineProperty(tM,"__esModule",{value:!0});tM.isReadableStream=void 0;var Pv=(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)};tM.isReadableStream=Pv});var fY=X((wY)=>{Object.defineProperty(wY,"__esModule",{value:!0});wY.sdkStreamMixin=void 0;var yv=mM(),kv=tE(),bv=yf(),xv=f8(),DY=dF(),FY="The stream has already been transformed.",cv=(D)=>{var F,E;if(!EY(D)&&!DY.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(FY);return w=!0,await yv.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 kv.toBase64(B);else if(f==="hex")return bv.toHex(B);else if(f===void 0||f==="utf8"||f==="utf-8")return xv.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(FY);if(w=!0,EY(D))return C(D);else if(DY.isReadableStream(D))return D;else throw new Error(`Cannot transform payload to web stream, got ${D}`)}})};wY.sdkStreamMixin=cv;var EY=(D)=>typeof Blob==="function"&&D instanceof Blob});var UY=X((BY)=>{Object.defineProperty(BY,"__esModule",{value:!0});BY.sdkStreamMixin=void 0;var gv=xM(),rv=sF(),kf=import.meta.require("stream"),_v=import.meta.require("util"),sv=fY(),CY="The stream has already been transformed.",uv=(D)=>{var F,E;if(!(D instanceof kf.Readable))try{return sv.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(CY);return w=!0,await gv.streamCollector(D)};return Object.assign(D,{transformToByteArray:$,transformToString:async(C)=>{const f=await $();if(C===void 0||Buffer.isEncoding(C))return rv.fromArrayBuffer(f.buffer,f.byteOffset,f.byteLength).toString(C);else return new _v.TextDecoder(C).decode(f)},transformToWebStream:()=>{if(w)throw new Error(CY);if(D.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof kf.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,kf.Readable.toWeb(D)}})};BY.sdkStreamMixin=uv});var GY=X((AY)=>{async function dv(D){if(typeof D.stream==="function")D=D.stream();return D.tee()}Object.defineProperty(AY,"__esModule",{value:!0});AY.splitStream=void 0;AY.splitStream=dv});var XY=X((YY)=>{async function nv(D){if(mv.isReadableStream(D))return vv.splitStream(D);const F=new MY.PassThrough,E=new MY.PassThrough;return D.pipe(F),D.pipe(E),[F,E]}Object.defineProperty(YY,"__esModule",{value:!0});YY.splitStream=void 0;var MY=import.meta.require("stream"),vv=GY(),mv=dF();YY.splitStream=nv});var zY=X((WY)=>{async function lv(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(WY,"__esModule",{value:!0});WY.headStream=void 0;WY.headStream=lv});var QY=X((KY)=>{Object.defineProperty(KY,"__esModule",{value:!0});KY.headStream=void 0;var iv=import.meta.require("stream"),pv=zY(),av=dF(),ov=(D,F)=>{if(av.isReadableStream(D))return pv.headStream(D,F);return new Promise((E,w)=>{const $=new TY;$.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)})})};KY.headStream=ov;class TY extends iv.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 qY=X((VfD,l8)=>{function RY(D,F="utf-8"){if(F==="base64")return HY.toBase64(D);return LY.toUtf8(D)}function VY(D,F){if(F==="base64")return xf.mutate(HY.fromBase64(D));return xf.mutate(LY.fromUtf8(D))}var{defineProperty:$w,getOwnPropertyDescriptor:tv,getOwnPropertyNames:ev}=Object,Dm=Object.prototype.hasOwnProperty,cf=(D,F)=>$w(D,"name",{value:F,configurable:!0}),Fm=(D,F)=>{for(var E in F)$w(D,E,{get:F[E],enumerable:!0})},bf=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of ev(F))if(!Dm.call(D,$)&&$!==E)$w(D,$,{get:()=>F[$],enumerable:!(w=tv(F,$))||w.enumerable})}return D},vF=(D,F,E)=>(bf(D,F,"default"),E&&bf(E,F,"default")),Em=(D)=>bf($w({},"__esModule",{value:!0}),D),n8={};Fm(n8,{Uint8ArrayBlobAdapter:()=>xf});l8.exports=Em(n8);var HY=tE(),LY=f8();cf(RY,"transformToString");cf(VY,"transformFromString");var NY=class D extends Uint8Array{static fromString(F,E="utf-8"){switch(typeof F){case"string":return VY(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 RY(this,F)}};cf(NY,"Uint8ArrayBlobAdapter");var xf=NY;vF(n8,IM(),l8.exports);vF(n8,UY(),l8.exports);vF(n8,XY(),l8.exports);vF(n8,QY(),l8.exports);vF(n8,dF(),l8.exports)});var N6=X((NfD,eY)=>{function uY(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`${qm[w]}, ${h} ${pf[E]} ${F} ${U}:${I}:${A} GMT`}function Bw(D){return encodeURIComponent(D).replace(/[!'()*]/g,function(F){return"%"+F.charCodeAt(0).toString(16).toUpperCase()})}function af(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,An(w,$,C);else C=F;for(let f of Object.keys(C)){if(!Array.isArray(C[f])){w[f]=C[f];continue}aY(w,null,C,f)}return w}function oY(D){if(D.includes(",")||D.includes('"'))D=`"${D.replace(/"/g,'\\"')}"`;return D}function tY(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:hw,getOwnPropertyDescriptor:wm,getOwnPropertyNames:$m}=Object,fm=Object.prototype.hasOwnProperty,R=(D,F)=>hw(D,"name",{value:F,configurable:!0}),Cm=(D,F)=>{for(var E in F)hw(D,E,{get:F[E],enumerable:!0})},Bm=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of $m(F))if(!fm.call(D,$)&&$!==E)hw(D,$,{get:()=>F[$],enumerable:!(w=wm(F,$))||w.enumerable})}return D},hm=(D)=>Bm(hw({},"__esModule",{value:!0}),D),jY={};Cm(jY,{Client:()=>Um,Command:()=>bY,LazyJsonString:()=>Cn,NoOpLogger:()=>Bn,SENSITIVE_STRING:()=>Gm,ServiceException:()=>lm,StringWrapper:()=>pF,_json:()=>vf,collectBody:()=>Am,convertMap:()=>hn,createAggregatedClient:()=>Mm,dateToUtcString:()=>uY,decorateServiceException:()=>vY,emitWarningIfUnsupportedVersion:()=>om,expectBoolean:()=>Zm,expectByte:()=>df,expectFloat32:()=>fw,expectInt:()=>Wm,expectInt32:()=>sf,expectLong:()=>lF,expectNonNull:()=>zm,expectNumber:()=>nF,expectObject:()=>cY,expectShort:()=>uf,expectString:()=>Tm,expectUnion:()=>Km,extendedEncodeURIComponent:()=>Bw,getArrayIfSingleItem:()=>$n,getDefaultClientConfiguration:()=>En,getDefaultExtensionConfiguration:()=>nY,getValueFromTextNode:()=>lY,handleFloat:()=>Hm,isSerializableHeaderValue:()=>fn,limitedParseDouble:()=>lf,limitedParseFloat:()=>Lm,limitedParseFloat32:()=>Rm,loadConfigsForDefaultMode:()=>am,logger:()=>iF,map:()=>af,parseBoolean:()=>Ym,parseEpochTimestamp:()=>gm,parseRfc3339DateTime:()=>jm,parseRfc3339DateTimeWithOffset:()=>ym,parseRfc7231DateTime:()=>cm,quoteHeader:()=>oY,resolveDefaultRuntimeConfig:()=>wn,resolvedPath:()=>Mn,serializeDateTime:()=>Zn,serializeFloat:()=>Yn,splitEvery:()=>tY,splitHeader:()=>Xn,strictParseByte:()=>sY,strictParseDouble:()=>nf,strictParseFloat:()=>Sm,strictParseFloat32:()=>gY,strictParseInt:()=>Vm,strictParseInt32:()=>Nm,strictParseLong:()=>_Y,strictParseShort:()=>L6,take:()=>Un,throwDefaultError:()=>mY,withBaseException:()=>im});eY.exports=hm(jY);var PY=mG(),yY=class D{constructor(F){this.config=F,this.middlewareStack=PY.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(yY,"Client");var Um=yY,gf=qY(),Am=R(async(D=new Uint8Array,F)=>{if(D instanceof Uint8Array)return gf.Uint8ArrayBlobAdapter.mutate(D);if(!D)return gf.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const E=F.streamCollector(D);return gf.Uint8ArrayBlobAdapter.mutate(await E)},"collectBody"),_f=W0(),kY=class D{constructor(){this.middlewareStack=PY.constructStack()}static classBuilder(){return new Im}resolveMiddlewareWithContext(F,E,w,{middlewareFn:$,clientName:C,commandName:f,inputFilterSensitiveLog:B,outputFilterSensitiveLog:h,smithyContext:U,additionalContext:I,CommandCtor:A}){for(let W of $.bind(this)(A,F,E,w))this.middlewareStack.use(W);const Y=F.concat(this.middlewareStack),{logger:G}=E,Z={logger:G,clientName:C,commandName:f,inputFilterSensitiveLog:B,outputFilterSensitiveLog:h,[_f.SMITHY_CONTEXT_KEY]:{commandInstance:this,...U},...I},{requestHandler:z}=E;return Y.resolve((W)=>z.handle(W.request,w||{}),Z)}};R(kY,"Command");var bY=kY,xY=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 bY{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(xY,"ClassBuilder");var Im=xY,Gm="***SensitiveInformation***",Mm=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"),Ym=R((D)=>{switch(D){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${D}"`)}},"parseBoolean"),Zm=R((D)=>{if(D===null||D===void 0)return;if(typeof D==="number"){if(D===0||D===1)iF.warn(Cw(`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")iF.warn(Cw(`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"),nF=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))iF.warn(Cw(`Expected number but observed string: ${D}`));return F}}if(typeof D==="number")return D;throw new TypeError(`Expected number, got ${typeof D}: ${D}`)},"expectNumber"),Xm=Math.ceil(340282346638528860000000000000000000000),fw=R((D)=>{const F=nF(D);if(F!==void 0&&!Number.isNaN(F)&&F!==1/0&&F!==-1/0){if(Math.abs(F)>Xm)throw new TypeError(`Expected 32-bit float, got ${D}`)}return F},"expectFloat32"),lF=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"),Wm=lF,sf=R((D)=>mf(D,32),"expectInt32"),uf=R((D)=>mf(D,16),"expectShort"),df=R((D)=>mf(D,8),"expectByte"),mf=R((D,F)=>{const E=lF(D);if(E!==void 0&&Jm(E,F)!==E)throw new TypeError(`Expected ${F}-bit integer, got ${D}`);return E},"expectSizedInt"),Jm=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"),zm=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"),cY=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"),Tm=R((D)=>{if(D===null||D===void 0)return;if(typeof D==="string")return D;if(["boolean","number","bigint"].includes(typeof D))return iF.warn(Cw(`Expected string, got ${typeof D}: ${D}`)),String(D);throw new TypeError(`Expected string, got ${typeof D}: ${D}`)},"expectString"),Km=R((D)=>{if(D===null||D===void 0)return;const F=cY(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"),nf=R((D)=>{if(typeof D=="string")return nF(V6(D));return nF(D)},"strictParseDouble"),Sm=nf,gY=R((D)=>{if(typeof D=="string")return fw(V6(D));return fw(D)},"strictParseFloat32"),Qm=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,V6=R((D)=>{const F=D.match(Qm);if(F===null||F[0].length!==D.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(D)},"parseNumber"),lf=R((D)=>{if(typeof D=="string")return rY(D);return nF(D)},"limitedParseDouble"),Hm=lf,Lm=lf,Rm=R((D)=>{if(typeof D=="string")return rY(D);return fw(D)},"limitedParseFloat32"),rY=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"),_Y=R((D)=>{if(typeof D==="string")return lF(V6(D));return lF(D)},"strictParseLong"),Vm=_Y,Nm=R((D)=>{if(typeof D==="string")return sf(V6(D));return sf(D)},"strictParseInt32"),L6=R((D)=>{if(typeof D==="string")return uf(V6(D));return uf(D)},"strictParseShort"),sY=R((D)=>{if(typeof D==="string")return df(V6(D));return df(D)},"strictParseByte"),Cw=R((D)=>{return String(new TypeError(D).stack||D).split("\n").slice(0,5).filter((F)=>!F.includes("stackTraceWarning")).join("\n")},"stackTraceWarning"),iF={warn:console.warn},qm=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],pf=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];R(uY,"dateToUtcString");var Om=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),jm=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=Om.exec(D);if(!F)throw new TypeError("Invalid RFC-3339 date-time value");const[E,w,$,C,f,B,h,U]=F,I=L6(R6(w)),A=x2($,"month",1,12),Y=x2(C,"day",1,31);return mF(I,A,Y,{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U})},"parseRfc3339DateTime"),Pm=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),ym=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=Pm.exec(D);if(!F)throw new TypeError("Invalid RFC-3339 date-time value");const[E,w,$,C,f,B,h,U,I]=F,A=L6(R6(w)),Y=x2($,"month",1,12),G=x2(C,"day",1,31),Z=mF(A,Y,G,{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U});if(I.toUpperCase()!="Z")Z.setTime(Z.getTime()-nm(I));return Z},"parseRfc3339DateTimeWithOffset"),km=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$/),bm=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$/),xm=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})$/),cm=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=km.exec(D);if(F){const[E,w,$,C,f,B,h,U]=F;return mF(L6(R6(C)),rf($),x2(w,"day",1,31),{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U})}if(F=bm.exec(D),F){const[E,w,$,C,f,B,h,U]=F;return sm(mF(rm(C),rf($),x2(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 mF(L6(R6(U)),rf(w),x2($.trimLeft(),"day",1,31),{hours:C,minutes:f,seconds:B,fractionalMilliseconds:h})}throw new TypeError("Invalid RFC-7231 date-time value")},"parseRfc7231DateTime"),gm=R((D)=>{if(D===null||D===void 0)return;let F;if(typeof D==="number")F=D;else if(typeof D==="string")F=nf(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"),mF=R((D,F,E,w)=>{const $=F-1;return dm(D,$,E),new Date(Date.UTC(D,$,E,x2(w.hours,"hour",0,23),x2(w.minutes,"minute",0,59),x2(w.seconds,"seconds",0,60),mm(w.fractionalMilliseconds)))},"buildDate"),rm=R((D)=>{const F=new Date().getUTCFullYear(),E=Math.floor(F/100)*100+L6(R6(D));if(E<F)return E+100;return E},"parseTwoDigitYear"),_m=1576800000000,sm=R((D)=>{if(D.getTime()-new Date().getTime()>_m)return new Date(Date.UTC(D.getUTCFullYear()-100,D.getUTCMonth(),D.getUTCDate(),D.getUTCHours(),D.getUTCMinutes(),D.getUTCSeconds(),D.getUTCMilliseconds()));return D},"adjustRfc850Year"),rf=R((D)=>{const F=pf.indexOf(D);if(F<0)throw new TypeError(`Invalid month: ${D}`);return F+1},"parseMonthByShortName"),um=[31,28,31,30,31,30,31,31,30,31,30,31],dm=R((D,F,E)=>{let w=um[F];if(F===1&&vm(D))w=29;if(E>w)throw new TypeError(`Invalid day for ${pf[F]} in ${D}: ${E}`)},"validateDayOfMonth"),vm=R((D)=>{return D%4===0&&(D%100!==0||D%400===0)},"isLeapYear"),x2=R((D,F,E,w)=>{const $=sY(R6(D));if($<E||$>w)throw new TypeError(`${F} must be between ${E} and ${w}, inclusive`);return $},"parseDateValue"),mm=R((D)=>{if(D===null||D===void 0)return 0;return gY("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"),R6=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"),dY=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(dY,"ServiceException");var lm=dY,vY=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"),mY=R(({output:D,parsedBody:F,exceptionCtor:E,errorCode:w})=>{const $=pm(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 vY(f,F)},"throwDefaultError"),im=R((D)=>{return({output:F,parsedBody:E,errorCode:w})=>{mY({output:F,parsedBody:E,exceptionCtor:D,errorCode:w})}},"withBaseException"),pm=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"),am=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"),OY=!1,om=R((D)=>{if(D&&!OY&&parseInt(D.substring(1,D.indexOf(".")))<16)OY=!0},"emitWarningIfUnsupportedVersion");R(Bw,"extendedEncodeURIComponent");var tm=R((D)=>{const F=[];for(let E in _f.AlgorithmId){const w=_f.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"),em=R((D)=>{const F={};return D.checksumAlgorithms().forEach((E)=>{F[E.algorithmId()]=E.checksumConstructor()}),F},"resolveChecksumRuntimeConfig"),Dn=R((D)=>{let F=D.retryStrategy;return{setRetryStrategy(E){F=E},retryStrategy(){return F}}},"getRetryConfiguration"),Fn=R((D)=>{const F={};return F.retryStrategy=D.retryStrategy(),F},"resolveRetryRuntimeConfig"),nY=R((D)=>{return{...tm(D),...Dn(D)}},"getDefaultExtensionConfiguration"),En=nY,wn=R((D)=>{return{...em(D),...Fn(D)}},"resolveDefaultRuntimeConfig"),$n=R((D)=>Array.isArray(D)?D:[D],"getArrayIfSingleItem"),lY=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]=lY(D[E]);return D},"getValueFromTextNode"),fn=R((D)=>{return D!=null},"isSerializableHeaderValue"),pF=R(function(){const D=Object.getPrototypeOf(this).constructor,E=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(E,D.prototype),E},"StringWrapper");pF.prototype=Object.create(String.prototype,{constructor:{value:pF,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(pF,String);var iY=class D extends pF{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(iY,"LazyJsonString");var Cn=iY,pY=class D{trace(){}debug(){}info(){}warn(){}error(){}};R(pY,"NoOpLogger");var Bn=pY;R(af,"map");var hn=R((D)=>{const F={};for(let[E,w]of Object.entries(D||{}))F[E]=[,w];return F},"convertMap"),Un=R((D,F)=>{const E={};for(let w in F)aY(E,D,F,w);return E},"take"),An=R((D,F,E)=>{return af(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"),aY=R((D,F,E,w)=>{if(F!==null){let f=E[w];if(typeof f==="function")f=[,f];const[B=In,h=Gn,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"),In=R((D)=>D!=null,"nonNullish"),Gn=R((D)=>D,"pass");R(oY,"quoteHeader");var Mn=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)=>Bw(B)).join("/"):Bw(f))}else throw new Error("No value provided for input HTTP label: "+E+".");return D},"resolvedPath"),Yn=R((D)=>{if(D!==D)return"NaN";switch(D){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return D}},"serializeFloat"),Zn=R((D)=>D.toISOString().replace(".000Z","Z"),"serializeDateTime"),vf=R((D)=>{if(D==null)return{};if(Array.isArray(D))return D.filter((F)=>F!=null).map(vf);if(typeof D==="object"){const F={};for(let E of Object.keys(D)){if(D[E]==null)continue;F[E]=vf(D[E])}return F}return D},"_json");R(tY,"splitEvery");var Xn=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 EZ=X((DZ)=>{Object.defineProperty(DZ,"__esModule",{value:!0});DZ.isStreamingPayload=void 0;var Wn=import.meta.require("stream"),Jn=(D)=>(D===null||D===void 0?void 0:D.body)instanceof Wn.Readable||typeof ReadableStream!=="undefined"&&(D===null||D===void 0?void 0:D.body)instanceof ReadableStream;DZ.isStreamingPayload=Jn});var TZ=X((jfD,zZ)=>{var{defineProperty:Uw,getOwnPropertyDescriptor:zn,getOwnPropertyNames:Tn}=Object,Kn=Object.prototype.hasOwnProperty,bD=(D,F)=>Uw(D,"name",{value:F,configurable:!0}),Sn=(D,F)=>{for(var E in F)Uw(D,E,{get:F[E],enumerable:!0})},Qn=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Tn(F))if(!Kn.call(D,$)&&$!==E)Uw(D,$,{get:()=>F[$],enumerable:!(w=zn(F,$))||w.enumerable})}return D},Hn=(D)=>Qn(Uw({},"__esModule",{value:!0}),D),$Z={};Sn($Z,{AdaptiveRetryStrategy:()=>Vn,CONFIG_MAX_ATTEMPTS:()=>tf,CONFIG_RETRY_MODE:()=>MZ,ENV_MAX_ATTEMPTS:()=>of,ENV_RETRY_MODE:()=>GZ,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:()=>Nn,NODE_RETRY_MODE_CONFIG_OPTIONS:()=>On,StandardRetryStrategy:()=>AZ,defaultDelayDecider:()=>CZ,defaultRetryDecider:()=>BZ,getOmitRetryHeadersPlugin:()=>jn,getRetryAfterHint:()=>JZ,getRetryPlugin:()=>cn,omitRetryHeadersMiddleware:()=>YZ,omitRetryHeadersMiddlewareOptions:()=>ZZ,resolveRetryConfig:()=>qn,retryMiddleware:()=>XZ,retryMiddlewareOptions:()=>WZ});zZ.exports=Hn($Z);var q6=H1(),fZ=Mf(),HD=_G(),Ln=bD((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=bD((A)=>A.name==="TimeoutError"?C:$,"getCapacityAmount"),h=bD((A)=>B(A)<=f,"hasRetryTokens");return Object.freeze({hasRetryTokens:h,retrieveRetryTokens:bD((A)=>{if(!h(A))throw new Error("No retry token available");const Y=B(A);return f-=Y,Y},"retrieveRetryTokens"),releaseRetryTokens:bD((A)=>{f+=A??w,f=Math.min(f,E)},"releaseRetryTokens")})},"getDefaultRetryQuota"),CZ=bD((D,F)=>Math.floor(Math.min(HD.MAXIMUM_RETRY_DELAY,Math.random()*2**F*D)),"defaultDelayDecider"),C8=Yf(),BZ=bD((D)=>{if(!D)return!1;return C8.isRetryableByTrait(D)||C8.isClockSkewError(D)||C8.isThrottlingError(D)||C8.isTransientError(D)},"defaultRetryDecider"),hZ=bD((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"),UZ=class D{constructor(F,E){this.maxAttemptsProvider=F,this.mode=HD.RETRY_MODES.STANDARD,this.retryDecider=(E==null?void 0:E.retryDecider)??BZ,this.delayDecider=(E==null?void 0:E.delayDecider)??CZ,this.retryQuota=(E==null?void 0:E.retryQuota)??Ln(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(q6.HttpRequest.isInstance(h))h.headers[HD.INVOCATION_ID_HEADER]=fZ.v4();while(!0)try{if(q6.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=hZ(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=Rn(I.$response),G=Math.max(Y||0,A);f+=G,await new Promise((Z)=>setTimeout(Z,G));continue}if(!I.$metadata)I.$metadata={};throw I.$metadata.attempts=C,I.$metadata.totalRetryDelay=f,I}}};bD(UZ,"StandardRetryStrategy");var AZ=UZ,Rn=bD((D)=>{if(!q6.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"),IZ=class D extends AZ{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)}})}};bD(IZ,"AdaptiveRetryStrategy");var Vn=IZ,wZ=kF(),of="AWS_MAX_ATTEMPTS",tf="max_attempts",Nn={environmentVariableSelector:(D)=>{const F=D[of];if(!F)return;const E=parseInt(F);if(Number.isNaN(E))throw new Error(`Environment variable ${of} mast be a number, got "${F}"`);return E},configFileSelector:(D)=>{const F=D[tf];if(!F)return;const E=parseInt(F);if(Number.isNaN(E))throw new Error(`Shared config file entry ${tf} mast be a number, got "${F}"`);return E},default:HD.DEFAULT_MAX_ATTEMPTS},qn=bD((D)=>{const{retryStrategy:F}=D,E=wZ.normalizeProvider(D.maxAttempts??HD.DEFAULT_MAX_ATTEMPTS);return{...D,maxAttempts:E,retryStrategy:async()=>{if(F)return F;if(await wZ.normalizeProvider(D.retryMode)()===HD.RETRY_MODES.ADAPTIVE)return new HD.AdaptiveRetryStrategy(E);return new HD.StandardRetryStrategy(E)}}},"resolveRetryConfig"),GZ="AWS_RETRY_MODE",MZ="retry_mode",On={environmentVariableSelector:(D)=>D[GZ],configFileSelector:(D)=>D[MZ],default:HD.DEFAULT_RETRY_MODE},YZ=bD(()=>(D)=>async(F)=>{const{request:E}=F;if(q6.HttpRequest.isInstance(E))delete E.headers[HD.INVOCATION_ID_HEADER],delete E.headers[HD.REQUEST_HEADER];return D(F)},"omitRetryHeadersMiddleware"),ZZ={name:"omitRetryHeadersMiddleware",tags:["RETRY","HEADERS","OMIT_RETRY_HEADERS"],relation:"before",toMiddleware:"awsAuthMiddleware",override:!0},jn=bD((D)=>({applyToStack:(F)=>{F.addRelativeTo(YZ(),ZZ)}}),"getOmitRetryHeadersPlugin"),Pn=N6(),yn=EZ(),XZ=bD((D)=>(F,E)=>async(w)=>{var $;let C=await D.retryStrategy();const f=await D.maxAttempts();if(kn(C)){C=C;let B=await C.acquireInitialRetryToken(E.partition_id),h=new Error,U=0,I=0;const{request:A}=w,Y=q6.HttpRequest.isInstance(A);if(Y)A.headers[HD.INVOCATION_ID_HEADER]=fZ.v4();while(!0)try{if(Y)A.headers[HD.REQUEST_HEADER]=`attempt=${U+1}; max=${f}`;const{response:G,output:Z}=await F(w);return C.recordSuccess(B),Z.$metadata.attempts=U+1,Z.$metadata.totalRetryDelay=I,{response:G,output:Z}}catch(G){const Z=bn(G);if(h=hZ(G),Y&&yn.isStreamingPayload(A))throw($=E.logger instanceof Pn.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(W){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((W)=>setTimeout(W,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"),kn=bD((D)=>typeof D.acquireInitialRetryToken!=="undefined"&&typeof D.refreshRetryTokenForRetry!=="undefined"&&typeof D.recordSuccess!=="undefined","isRetryStrategyV2"),bn=bD((D)=>{const F={error:D,errorType:xn(D)},E=JZ(D.$response);if(E)F.retryAfterHint=E;return F},"getRetryErrorInfo"),xn=bD((D)=>{if(C8.isThrottlingError(D))return"THROTTLING";if(C8.isTransientError(D))return"TRANSIENT";if(C8.isServerError(D))return"SERVER_ERROR";return"CLIENT_ERROR"},"getRetryErrorType"),WZ={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},cn=bD((D)=>({applyToStack:(F)=>{F.add(XZ(D),WZ)}}),"getRetryPlugin"),JZ=bD((D)=>{if(!q6.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 rD=X((PfD,rZ)=>{function QZ(D){const F=new Map;for(let E of D)F.set(E.schemeId,E);return F}function bZ(D,F){return new cZ(D,F)}function gZ(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 hl(F,f.client,B,...h);else throw new Error(`Invalid client, expected instance of ${D.name}`);yield A;const Y=U;U=Ul(A,w),I=!!(U&&(!f.stopOnSameToken||U!==Y))}return},"paginateOperation")}var{defineProperty:Iw,getOwnPropertyDescriptor:gn,getOwnPropertyNames:rn}=Object,_n=Object.prototype.hasOwnProperty,JD=(D,F)=>Iw(D,"name",{value:F,configurable:!0}),sn=(D,F)=>{for(var E in F)Iw(D,E,{get:F[E],enumerable:!0})},un=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of rn(F))if(!_n.call(D,$)&&$!==E)Iw(D,$,{get:()=>F[$],enumerable:!(w=gn(F,$))||w.enumerable})}return D},dn=(D)=>un(Iw({},"__esModule",{value:!0}),D),KZ={};sn(KZ,{DefaultIdentityProviderConfig:()=>en,EXPIRATION_MS:()=>yZ,HttpApiKeyAuthSigner:()=>Dl,HttpBearerAuthSigner:()=>Fl,NoAuthSigner:()=>El,RequestBuilder:()=>cZ,createIsIdentityExpiredFunction:()=>PZ,createPaginator:()=>gZ,doesIdentityRequireRefresh:()=>kZ,getHttpAuthSchemeEndpointRuleSetPlugin:()=>mn,getHttpAuthSchemePlugin:()=>ln,getHttpSigningPlugin:()=>tn,getSmithyContext:()=>fl,httpAuthSchemeEndpointRuleSetMiddlewareOptions:()=>HZ,httpAuthSchemeMiddleware:()=>ef,httpAuthSchemeMiddlewareOptions:()=>LZ,httpSigningMiddleware:()=>RZ,httpSigningMiddlewareOptions:()=>VZ,isIdentityExpired:()=>wl,memoizeIdentityProvider:()=>$l,normalizeProvider:()=>Cl,requestBuilder:()=>bZ});rZ.exports=dn(KZ);var SZ=kF();JD(QZ,"convertHttpAuthSchemesToMap");var ef=JD((D,F)=>(E,w)=>async($)=>{var C;const f=D.httpAuthSchemeProvider(await F.httpAuthSchemeParametersProvider(D,w,$.input)),B=QZ(D.httpAuthSchemes),h=SZ.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:G={},signingProperties:Z={}}=((C=I.propertiesExtractor)==null?void 0:C.call(I,D,w))||{};I.identityProperties=Object.assign(I.identityProperties||{},G),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"),vn=TI(),HZ={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:vn.endpointMiddlewareOptions.name},mn=JD((D,{httpAuthSchemeParametersProvider:F,identityProviderConfigProvider:E})=>({applyToStack:(w)=>{w.addRelativeTo(ef(D,{httpAuthSchemeParametersProvider:F,identityProviderConfigProvider:E}),HZ)}}),"getHttpAuthSchemeEndpointRuleSetPlugin"),nn=YD(),LZ={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:nn.serializerMiddlewareOption.name},ln=JD((D,{httpAuthSchemeParametersProvider:F,identityProviderConfigProvider:E})=>({applyToStack:(w)=>{w.addRelativeTo(ef(D,{httpAuthSchemeParametersProvider:F,identityProviderConfigProvider:E}),LZ)}}),"getHttpAuthSchemePlugin"),Gw=H1(),pn=JD((D)=>(F)=>{throw F},"defaultErrorHandler"),an=JD((D,F)=>{},"defaultSuccessHandler"),RZ=JD((D)=>(F,E)=>async(w)=>{if(!Gw.HttpRequest.isInstance(w.request))return F(w);const C=SZ.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||pn)(f));return(h.successHandler||an)(U.response,f),U},"httpSigningMiddleware"),on=TZ(),VZ={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:on.retryMiddlewareOptions.name},tn=JD((D)=>({applyToStack:(F)=>{F.addRelativeTo(RZ(D),VZ)}}),"getHttpSigningPlugin"),NZ=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(NZ,"DefaultIdentityProviderConfig");var en=NZ,Aw=W0(),qZ=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 $=Gw.HttpRequest.clone(F);if(w.in===Aw.HttpApiKeyAuthLocation.QUERY)$.query[w.name]=E.apiKey;else if(w.in===Aw.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(qZ,"HttpApiKeyAuthSigner");var Dl=qZ,OZ=class D{async sign(F,E,w){const $=Gw.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(OZ,"HttpBearerAuthSigner");var Fl=OZ,jZ=class D{async sign(F,E,w){return F}};JD(jZ,"NoAuthSigner");var El=jZ,PZ=JD((D)=>(F)=>kZ(F)&&F.expiration.getTime()-Date.now()<D,"createIsIdentityExpiredFunction"),yZ=300000,wl=PZ(yZ),kZ=JD((D)=>D.expiration!==void 0,"doesIdentityRequireRefresh"),$l=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"),fl=JD((D)=>D[Aw.SMITHY_CONTEXT_KEY]||(D[Aw.SMITHY_CONTEXT_KEY]={}),"getSmithyContext"),Cl=JD((D)=>{if(typeof D==="function")return D;const F=Promise.resolve(D);return()=>F},"normalizeProvider"),Bl=N6();JD(bZ,"requestBuilder");var xZ=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 Gw.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=Bl.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(xZ,"RequestBuilder");var cZ=xZ,hl=JD(async(D,F,E,...w)=>{return await F.send(new D(E),...w)},"makePagedClientRequest");JD(gZ,"createPaginator");var Ul=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 Al(D){if(D===void 0)return!0;return typeof D==="string"&&D.length<=50}function c2(D){const F=_Z.normalizeProvider(D.userAgentAppId??D9);return{...D,customUserAgent:typeof D.customUserAgent==="string"?[[D.customUserAgent]]:D.customUserAgent,userAgentAppId:async()=>{const E=await F();if(!Al(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 _Z,D9=void 0;var sZ=M(()=>{_Z=Q(rD(),1)});class I2{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 Il,aF=(D)=>Il.test(D)||D.startsWith("[")&&D.endsWith("]");var F9=M(()=>{Il=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 Gl,oF=(D,F=!1)=>{if(!F)return Gl.test(D);const E=D.split(".");for(let w of E)if(!oF(w))return!1;return!0};var E9=M(()=>{Gl=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$")});var f0;var Mw=M(()=>{f0={}});var V1="endpoints";function u0(D){if(typeof D!=="object"||D==null)return D;if("ref"in D)return`\$${u0(D.ref)}`;if("fn"in D)return`${D.fn}(${(D.argv||[]).map(u0).join(", ")})`;return JSON.stringify(D,null,2)}var tF=()=>{};var ZD;var uZ=M(()=>{ZD=class ZD extends Error{constructor(D){super(D);this.name="EndpointError"}}});var dZ=()=>{};var vZ=()=>{};var mZ=()=>{};var nZ=()=>{};var lZ=()=>{};var iZ=()=>{};var d0=M(()=>{uZ();dZ();vZ();mZ();nZ();lZ();iZ()});var pZ=(D,F)=>D===F;var aZ=(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 oZ=M(()=>{d0()});var Yw=(D,F)=>aZ(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 tZ=M(()=>{d0();oZ()});var eZ=(D)=>D!=null;var DX=(D)=>!D;var Zw,w9,FX=(D)=>{const F=(()=>{try{if(D instanceof URL)return D;if(typeof D==="object"&&"hostname"in D){const{hostname:Y,port:G,protocol:Z="",path:z="",query:W={}}=D,J=new URL(`${Z}//${Y}${G?`:${G}`:""}${z}`);return J.search=Object.entries(W).map(([K,L])=>`${K}=${L}`).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(Zw.EndpointURLScheme).includes(h))return null;const U=aF($),I=E.includes(`${w}:${w9[h]}`)||typeof D==="string"&&D.includes(`${w}:${w9[h]}`),A=`${w}${I?`:${w9[h]}`:""}`;return{scheme:h,authority:A,path:C,normalizedPath:C.endsWith("/")?C:`${C}/`,isIp:U}};var EX=M(()=>{Zw=Q(W0(),1);F9();w9={[Zw.EndpointURLScheme.HTTP]:80,[Zw.EndpointURLScheme.HTTPS]:443}});var wX=(D,F)=>D===F;var $X=(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 fX=(D)=>encodeURIComponent(D).replace(/[!*'()]/g,(F)=>`%${F.charCodeAt(0).toString(16).toUpperCase()}`);var $9=M(()=>{tZ();E9();EX()});var CX;var BX=M(()=>{$9();CX={booleanEquals:pZ,getAttr:Yw,isSet:eZ,isValidHostLabel:oF,not:DX,parseURL:FX,stringEquals:wX,substring:$X,uriEncode:fX}});var Xw=(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(Yw(w[h],U))}else E.push(w[B]);$=f+1}return E.join("")};var f9=M(()=>{$9()});var hX=({ref:D},F)=>{return{...F.endpointParams,...F.referenceRecord}[D]};var B8=(D,F,E)=>{if(typeof D==="string")return Xw(D,E);else if(D.fn)return Ww(D,E);else if(D.ref)return hX(D,E);throw new ZD(`'${F}': ${String(D)} is not a string, function or reference.`)};var eF=M(()=>{d0();C9();f9()});var Ww=({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 f0&&$[1]!=null)return f0[$[0]][$[1]](...w);return CX[D](...w)};var C9=M(()=>{Mw();BX();eF()});var UX=({assign:D,...F},E)=>{if(D&&D in E.referenceRecord)throw new ZD(`'${D}' is already defined in Reference Record.`);const w=Ww(F,E);return E.logger?.debug?.(`${V1} evaluateCondition: ${u0(F)} = ${u0(w)}`),{result:w===""?!0:!!w,...D!=null&&{toAssign:{name:D,value:w}}}};var AX=M(()=>{tF();d0();C9()});var O6=(D=[],F)=>{const E={};for(let w of D){const{result:$,toAssign:C}=UX(w,{...F,referenceRecord:{...F.referenceRecord,...E}});if(!$)return{result:$};if(C)E[C.name]=C.value,F.logger?.debug?.(`${V1} assign: ${C.name} := ${u0(C.value)}`)}return{result:!0,referenceRecord:E}};var Jw=M(()=>{tF();AX()});var IX=(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 GX=M(()=>{d0();eF()});var B9=(D,F)=>{if(Array.isArray(D))return D.map((E)=>B9(E,F));switch(typeof D){case"string":return Xw(D,F);case"object":if(D===null)throw new ZD(`Unexpected endpoint property: ${D}`);return zw(D,F);case"boolean":return D;default:throw new ZD(`Unexpected endpoint property type: ${typeof D}`)}};var MX=M(()=>{d0();f9();h9()});var zw=(D,F)=>Object.entries(D).reduce((E,[w,$])=>({...E,[w]:B9($,F)}),{});var h9=M(()=>{MX()});var YX=(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 ZX=M(()=>{d0();eF()});var XX=(D,F)=>{const{conditions:E,endpoint:w}=D,{result:$,referenceRecord:C}=O6(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: ${u0(w)}`),{...U!=null&&{headers:IX(U,f)},...h!=null&&{properties:zw(h,f)},url:YX(B,f)}};var WX=M(()=>{tF();Jw();GX();h9();ZX()});var JX=(D,F)=>{const{conditions:E,error:w}=D,{result:$,referenceRecord:C}=O6(E,F);if(!$)return;throw new ZD(B8(w,"Error",{...F,referenceRecord:{...F.referenceRecord,...C}}))};var zX=M(()=>{d0();Jw();eF()});var TX=(D,F)=>{const{conditions:E,rules:w}=D,{result:$,referenceRecord:C}=O6(E,F);if(!$)return;return Tw(w,{...F,referenceRecord:{...F.referenceRecord,...C}})};var KX=M(()=>{Jw();U9()});var Tw=(D,F)=>{for(let E of D)if(E.type==="endpoint"){const w=XX(E,F);if(w)return w}else if(E.type==="error")JX(E,F);else if(E.type==="tree"){const w=TX(E,F);if(w)return w}else throw new ZD(`Unknown endpoint rule: ${E}`);throw new ZD("Rules evaluation failed")};var U9=M(()=>{d0();WX();zX();KX()});var SX=M(()=>{Mw();U9()});var G2=(D,F)=>{const{endpointParams:E,logger:w}=F,{parameters:$,rules:C}=D;F.logger?.debug?.(`${V1} Initial EndpointParams: ${u0(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=Tw(C,{endpointParams:E,logger:w,referenceRecord:{}});return F.logger?.debug?.(`${V1} Resolved endpoint: ${u0(h)}`),h};var QX=M(()=>{tF();d0();SX()});var M2=M(()=>{F9();E9();Mw();QX();d0()});var A9=M(()=>{M2()});var I9=(D,F=!1)=>{if(F){for(let E of D.split("."))if(!I9(E))return!1;return!0}if(!oF(D))return!1;if(D.length<3||D.length>63)return!1;if(D!==D.toLowerCase())return!1;if(aF(D))return!1;return!0};var HX=M(()=>{M2();A9()});var LX=(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 VX;var RX=M(()=>{VX={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 Yl,Zl="",NX=(D)=>{const{partitions:F}=Yl;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}},qX=()=>Zl;var G9=M(()=>{RX();Yl=VX});var Y2;var OX=M(()=>{M2();HX();G9();Y2={isVirtualHostableS3Bucket:I9,parseArn:LX,partition:NX};f0.aws=Y2});var jX=M(()=>{M2()});var PX=M(()=>{M2()});var yX=()=>{};var kX=()=>{};var bX=()=>{};var xX=()=>{};var cX=()=>{};var gX=M(()=>{PX();yX();kX();bX();xX();cX()});var i8=M(()=>{OX();G9();A9();jX();gX()});var Y9=X((UCD,Qw)=>{var rX,_X,sX,uX,dX,vX,mX,nX,lX,iX,pX,aX,oX,Kw,M9,tX,eX,DW,j6,FW,EW,wW,$W,fW,CW,BW,hW,UW,Sw,AW,IW;(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 Qw==="object"&&typeof UCD==="object")D(E(F,E(UCD)));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]};rX=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)},_X=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 $},sX=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},uX=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},dX=function($,C){return function(f,B){C(f,B,$)}},vX=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",G=!C&&$?B.static?$:$.prototype:null,Z=C||(G?Object.getOwnPropertyDescriptor(G,B.name):{}),z,W=!1;for(var J=f.length-1;J>=0;J--){var K={};for(var L in B)K[L]=L==="access"?{}:B[L];for(var L in B.access)K.access[L]=B.access[L];K.addInitializer=function(m){if(W)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(G)Object.defineProperty(G,B.name,Z);W=!0},mX=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},nX=function($){return typeof $==="symbol"?$:"".concat($)},lX=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})},iX=function($,C){if(typeof Reflect==="object"&&typeof Reflect.metadata==="function")return Reflect.metadata($,C)},pX=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{G(B.next(Z))}catch(z){I(z)}}function Y(Z){try{G(B.throw(Z))}catch(z){I(z)}}function G(Z){Z.done?U(Z.value):h(Z.value).then(A,Y)}G((B=B.apply($,C||[])).next())})},aX=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(G){return function(Z){return Y([G,Z])}}function Y(G){if(B)throw new TypeError("Generator is already executing.");while(I&&(I=0,G[0]&&(f=0)),f)try{if(B=1,h&&(U=G[0]&2?h.return:G[0]?h.throw||((U=h.return)&&U.call(h),0):h.next)&&!(U=U.call(h,G[1])).done)return U;if(h=0,U)G=[G[0]&2,U.value];switch(G[0]){case 0:case 1:U=G;break;case 4:return f.label++,{value:G[1],done:!1};case 5:f.label++,h=G[1],G=[0];continue;case 7:G=f.ops.pop(),f.trys.pop();continue;default:if((U=f.trys,!(U=U.length>0&&U[U.length-1]))&&(G[0]===6||G[0]===2)){f=0;continue}if(G[0]===3&&(!U||G[1]>U[0]&&G[1]<U[3])){f.label=G[1];break}if(G[0]===6&&f.label<U[1]){f.label=U[1],U=G;break}if(U&&f.label<U[2]){f.label=U[2],f.ops.push(G);break}if(U[2])f.ops.pop();f.trys.pop();continue}G=C.call($,f)}catch(Z){G=[6,Z],h=0}finally{B=U=0}if(G[0]&5)throw G[1];return{value:G[0]?G[1]:void 0,done:!0}}},oX=function($,C){for(var f in $)if(f!=="default"&&!Object.prototype.hasOwnProperty.call(C,f))Sw(C,$,f)},Sw=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]},Kw=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.")},M9=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},tX=function(){for(var $=[],C=0;C<arguments.length;C++)$=$.concat(M9(arguments[C]));return $},eX=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},DW=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))},j6=function($){return this instanceof j6?(this.v=$,this):new j6($)},FW=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(L){return new Promise(function(V,m){U.push([J,L,V,m])>1||Y(J,L)})},K)h[J]=K(h[J])}}function Y(J,K){try{G(B[J](K))}catch(L){W(U[0][3],L)}}function G(J){J.value instanceof j6?Promise.resolve(J.value.v).then(Z,z):W(U[0][2],J)}function Z(J){Y("next",J)}function z(J){Y("throw",J)}function W(J,K){if(J(K),U.shift(),U.length)Y(U[0][0],U[0][1])}},EW=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:j6($[h](I)),done:!1}:U?U(I):I}:U}},wW=function($){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var C=$[Symbol.asyncIterator],f;return C?C.call($):($=typeof Kw==="function"?Kw($):$[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(G){U({value:G,done:A})},I)}},$W=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};fW=function($){if($&&$.__esModule)return $;var C={};if($!=null){for(var f in $)if(f!=="default"&&Object.prototype.hasOwnProperty.call($,f))Sw(C,$,f)}return E(C,$),C},CW=function($){return $&&$.__esModule?$:{default:$}},BW=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($)},hW=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},UW=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)},AW=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};IW=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",rX),D("__assign",_X),D("__rest",sX),D("__decorate",uX),D("__param",dX),D("__esDecorate",vX),D("__runInitializers",mX),D("__propKey",nX),D("__setFunctionName",lX),D("__metadata",iX),D("__awaiter",pX),D("__generator",aX),D("__exportStar",oX),D("__createBinding",Sw),D("__values",Kw),D("__read",M9),D("__spread",tX),D("__spreadArrays",eX),D("__spreadArray",DW),D("__await",j6),D("__asyncGenerator",FW),D("__asyncDelegator",EW),D("__asyncValues",wW),D("__makeTemplateObject",$W),D("__importStar",fW),D("__importDefault",CW),D("__classPrivateFieldGet",BW),D("__classPrivateFieldSet",hW),D("__classPrivateFieldIn",UW),D("__addDisposableResource",AW),D("__disposeResources",IW)})});var C0=X((ACD,XW)=>{function YW(D,F,E){if(!D.$source)D.$source={};return D.$source[F]=E,D}function ZW(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:Hw,getOwnPropertyDescriptor:Xl,getOwnPropertyNames:Wl}=Object,Jl=Object.prototype.hasOwnProperty,Z9=(D,F)=>Hw(D,"name",{value:F,configurable:!0}),zl=(D,F)=>{for(var E in F)Hw(D,E,{get:F[E],enumerable:!0})},Tl=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Wl(F))if(!Jl.call(D,$)&&$!==E)Hw(D,$,{get:()=>F[$],enumerable:!(w=Xl(F,$))||w.enumerable})}return D},Kl=(D)=>Tl(Hw({},"__esModule",{value:!0}),D),MW={};zl(MW,{emitWarningIfUnsupportedVersion:()=>Sl,setCredentialFeature:()=>YW,setFeature:()=>ZW});XW.exports=Kl(MW);var GW=!1,Sl=Z9((D)=>{if(D&&!GW&&parseInt(D.substring(1,D.indexOf(".")))<18)GW=!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");Z9(YW,"setCredentialFeature");Z9(ZW,"setFeature")});var xW=X((ICD,bW)=>{function T9(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:Ow,getOwnPropertyDescriptor:Ql,getOwnPropertyNames:Hl}=Object,Ll=Object.prototype.hasOwnProperty,vD=(D,F)=>Ow(D,"name",{value:F,configurable:!0}),Rl=(D,F)=>{for(var E in F)Ow(D,E,{get:F[E],enumerable:!0})},Vl=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Hl(F))if(!Ll.call(D,$)&&$!==E)Ow(D,$,{get:()=>F[$],enumerable:!(w=Ql(F,$))||w.enumerable})}return D},Nl=(D)=>Vl(Ow({},"__esModule",{value:!0}),D),KW={};Rl(KW,{SignatureV4:()=>Di,clearCredentialCache:()=>ml,createScope:()=>Vw,getCanonicalHeaders:()=>z9,getCanonicalQuery:()=>qW,getPayloadHash:()=>qw,getSigningKey:()=>NW,moveHeadersToQuery:()=>yW,prepareRequest:()=>K9});bW.exports=Nl(KW);var WW=kF(),X9=f8(),ql="X-Amz-Algorithm",Ol="X-Amz-Credential",SW="X-Amz-Date",jl="X-Amz-SignedHeaders",Pl="X-Amz-Expires",QW="X-Amz-Signature",HW="X-Amz-Security-Token",LW="authorization",RW=SW.toLowerCase(),yl="date",kl=[LW,RW,yl],bl=QW.toLowerCase(),J9="x-amz-content-sha256",xl=HW.toLowerCase(),cl={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},gl=/^proxy-/,rl=/^sec-/,W9="AWS4-HMAC-SHA256",_l="AWS4-HMAC-SHA256-PAYLOAD",sl="UNSIGNED-PAYLOAD",ul=50,VW="aws4_request",dl=604800,h8=yf(),vl=f8(),P6={},Rw=[],Vw=vD((D,F,E)=>`${D}/${F}/${E}/${VW}`,"createScope"),NW=vD(async(D,F,E,w,$)=>{const C=await JW(D,F.secretAccessKey,F.accessKeyId),f=`${E}:${w}:${$}:${h8.toHex(C)}:${F.sessionToken}`;if(f in P6)return P6[f];Rw.push(f);while(Rw.length>ul)delete P6[Rw.shift()];let B=`AWS4${F.secretAccessKey}`;for(let h of[E,w,$,VW])B=await JW(D,B,h);return P6[f]=B},"getSigningKey"),ml=vD(()=>{Rw.length=0,Object.keys(P6).forEach((D)=>{delete P6[D]})},"clearCredentialCache"),JW=vD((D,F,E)=>{const w=new D(F);return w.update(vl.toUint8Array(E)),w.digest()},"hmac"),z9=vD(({headers:D},F,E)=>{const w={};for(let $ of Object.keys(D).sort()){if(D[$]==null)continue;const C=$.toLowerCase();if(C in cl||(F==null?void 0:F.has(C))||gl.test(C)||rl.test(C)){if(!E||E&&!E.has(C))continue}w[C]=D[$].trim().replace(/\s+/g," ")}return w},"getCanonicalHeaders"),Nw=Rf(),qW=vD(({query:D={}})=>{const F=[],E={};for(let w of Object.keys(D)){if(w.toLowerCase()===bl)continue;const $=Nw.escapeUri(w);F.push($);const C=D[w];if(typeof C==="string")E[$]=`${$}=${Nw.escapeUri(C)}`;else if(Array.isArray(C))E[$]=C.slice(0).reduce((f,B)=>f.concat([`${$}=${Nw.escapeUri(B)}`]),[]).sort().join("&")}return F.sort().map((w)=>E[w]).filter((w)=>w).join("&")},"getCanonicalQuery"),nl=Tf(),ll=f8(),qw=vD(async({headers:D,body:F},E)=>{for(let w of Object.keys(D))if(w.toLowerCase()===J9)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(ll.toUint8Array(F)),h8.toHex(await w.digest())}return sl},"getPayloadHash"),zW=f8(),OW=class D{format(F){const E=[];for(let C of Object.keys(F)){const f=zW.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=zW.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(al.fromNumber(F.value.valueOf()).bytes,1),I;case"uuid":if(!pl.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}}};vD(OW,"HeaderFormatter");var il=OW,pl=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,jW=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)T9(E);return new D(E)}valueOf(){const F=this.bytes.slice(0),E=F[0]&128;if(E)T9(F);return parseInt(h8.toHex(F),16)*(E?-1:1)}toString(){return String(this.valueOf())}};vD(jW,"Int64");var al=jW;vD(T9,"negate");var ol=vD((D,F)=>{D=D.toLowerCase();for(let E of Object.keys(F))if(D===E.toLowerCase())return!0;return!1},"hasHeader"),PW=H1(),yW=vD((D,F={})=>{var E,w;const{headers:$,query:C={}}=PW.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"),K9=vD((D)=>{D=PW.HttpRequest.clone(D);for(let F of Object.keys(D.headers))if(kl.indexOf(F.toLowerCase())>-1)delete D.headers[F];return D},"prepareRequest"),tl=vD((D)=>el(D).toISOString().replace(/\.\d{3}Z$/,"Z"),"iso8601"),el=vD((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"),kW=class D{constructor({applyChecksum:F,credentials:E,region:w,service:$,sha256:C,uriEscapePath:f=!0}){this.headerFormatter=new il,this.service=$,this.sha256=C,this.uriEscapePath=f,this.applyChecksum=typeof F==="boolean"?F:!0,this.regionProvider=WW.normalizeProvider(w),this.credentialProvider=WW.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:G,shortDate:Z}=Lw(w);if($>dl)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const z=Vw(Z,Y,I??this.service),W=yW(K9(F),{unhoistableHeaders:f,hoistableHeaders:h});if(A.sessionToken)W.query[HW]=A.sessionToken;W.query[ql]=W9,W.query[Ol]=`${A.accessKeyId}/${z}`,W.query[SW]=G,W.query[Pl]=$.toString(10);const J=z9(W,C,B);return W.query[jl]=TW(J),W.query[QW]=await this.getSignature(G,z,this.getSigningKey(A,Y,Z,I),this.createCanonicalRequest(W,J,await qw(F,this.sha256))),W}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}=Lw(w),I=Vw(h,B,f??this.service),A=await qw({headers:{},body:E},this.sha256),Y=new this.sha256;Y.update(F);const G=h8.toHex(await Y.digest()),Z=[_l,U,I,$,G,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}=Lw(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=K9(F),{longDate:I,shortDate:A}=Lw(E),Y=Vw(A,h,f??this.service);if(U.headers[RW]=I,B.sessionToken)U.headers[xl]=B.sessionToken;const G=await qw(U,this.sha256);if(!ol(J9,U.headers)&&this.applyChecksum)U.headers[J9]=G;const Z=z9(U,$,w),z=await this.getSignature(I,Y,this.getSigningKey(B,h,A,f),this.createCanonicalRequest(U,Z,G));return U.headers[LW]=`${W9} Credential=${B.accessKeyId}/${Y}, SignedHeaders=${TW(Z)}, Signature=${z}`,U}createCanonicalRequest(F,E,w){const $=Object.keys(E).sort();return`${F.method}
11
+ ${this.getCanonicalPath(F)}
12
+ ${qW(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`${W9}
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 Nw.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 NW(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")}};vD(kW,"SignatureV4");var Di=kW,Lw=vD((D)=>{const F=tl(D).replace(/[\-:]/g,"");return{longDate:F,shortDate:F.slice(0,8)}},"formatDate"),TW=vD((D)=>Object.keys(D).sort().join(";"),"getCanonicalHeaderList")});var nW=X((GCD,mW)=>{var{defineProperty:jw,getOwnPropertyDescriptor:Fi,getOwnPropertyNames:Ei}=Object,wi=Object.prototype.hasOwnProperty,N0=(D,F)=>jw(D,"name",{value:F,configurable:!0}),$i=(D,F)=>{for(var E in F)jw(D,E,{get:F[E],enumerable:!0})},fi=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of Ei(F))if(!wi.call(D,$)&&$!==E)jw(D,$,{get:()=>F[$],enumerable:!(w=Fi(F,$))||w.enumerable})}return D},Ci=(D)=>fi(jw({},"__esModule",{value:!0}),D),sW={};$i(sW,{AWSSDKSigV4Signer:()=>Ai,AwsSdkSigV4ASigner:()=>Gi,AwsSdkSigV4Signer:()=>H9,NODE_SIGV4A_CONFIG_OPTIONS:()=>Zi,resolveAWSSDKSigV4Config:()=>Wi,resolveAwsSdkSigV4AConfig:()=>Yi,resolveAwsSdkSigV4Config:()=>vW,validateSigningProperties:()=>Q9});mW.exports=Ci(sW);var Bi=H1(),hi=H1(),cW=N0((D)=>{var F,E;return hi.HttpResponse.isInstance(D)?((F=D.headers)==null?void 0:F.date)??((E=D.headers)==null?void 0:E.Date):void 0},"getDateHeader"),S9=N0((D)=>new Date(Date.now()+D),"getSkewCorrectedDate"),Ui=N0((D,F)=>Math.abs(S9(F).getTime()-D)>=300000,"isClockSkewed"),gW=N0((D,F)=>{const E=Date.parse(D);if(Ui(E,F))return E-Date.now();return F},"getUpdatedSystemClockOffset"),D3=N0((D,F)=>{if(!F)throw new Error(`Property \`${D}\` is not resolved for AWS SDK SigV4Auth`);return F},"throwSigningPropertyError"),Q9=N0(async(D)=>{var F,E,w;const $=D3("context",D.context),C=D3("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 D3("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"),uW=class D{async sign(F,E,w){var $;if(!Bi.HttpRequest.isInstance(F))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const C=await Q9(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,G]=I.authSchemes;if((Y==null?void 0:Y.name)==="sigv4a"&&(G==null?void 0:G.name)==="sigv4")h=(G==null?void 0:G.signingRegion)??h,U=(G==null?void 0:G.signingName)??U}return await B.sign(F,{signingDate:S9(f.systemClockOffset),signingRegion:h,signingService:U})}errorHandler(F){return(E)=>{const w=E.ServerTime??cW(E.$response);if(w){const $=D3("config",F.config),C=$.systemClockOffset;if($.systemClockOffset=gW(w,$.systemClockOffset),$.systemClockOffset!==C&&E.$metadata)E.$metadata.clockSkewCorrected=!0}throw E}}successHandler(F,E){const w=cW(F);if(w){const $=D3("config",E.config);$.systemClockOffset=gW(w,$.systemClockOffset)}}};N0(uW,"AwsSdkSigV4Signer");var H9=uW,Ai=H9,Ii=H1(),dW=class D extends H9{async sign(F,E,w){var $;if(!Ii.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 Q9(w),A=(await(($=C.sigv4aSigningRegionSet)==null?void 0:$.call(C))??h??[B]).join(",");return await f.sign(F,{signingDate:S9(C.systemClockOffset),signingRegion:A,signingService:U})}};N0(dW,"AwsSdkSigV4ASigner");var Gi=dW,Mi=rD(),rW=i7(),Yi=N0((D)=>{return D.sigv4aSigningRegionSet=Mi.normalizeProvider(D.sigv4aSigningRegionSet),D},"resolveAwsSdkSigV4AConfig"),Zi={environmentVariableSelector(D){if(D.AWS_SIGV4A_SIGNING_REGION_SET)return D.AWS_SIGV4A_SIGNING_REGION_SET.split(",").map((F)=>F.trim());throw new rW.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 rW.ProviderError("sigv4a_signing_region_set not set in profile.",{tryNextLink:!0})},default:void 0},Xi=C0(),p8=rD(),_W=xW(),vW=N0((D)=>{let F=!1,E;if(D.credentials)F=!0,E=p8.memoizeIdentityProvider(D.credentials,p8.isIdentityExpired,p8.doesIdentityRequireRefresh);if(!E)if(D.credentialDefaultProvider)E=p8.normalizeProvider(D.credentialDefaultProvider(Object.assign({},D,{parentClientConfig:D})));else E=N0(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=p8.normalizeProvider(D.signer);else if(D.regionInfoProvider)f=N0(()=>p8.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||_W.SignatureV4)(A)}),"signer");else f=N0(async(B)=>{B=Object.assign({},{name:"sigv4",signingName:D.signingName||D.defaultSigningName,signingRegion:await p8.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||_W.SignatureV4)(I)},"signer");return{...D,systemClockOffset:$,signingEscapePath:w,credentials:F?async()=>E().then((B)=>Xi.setCredentialFeature(B,"CREDENTIALS_CODE","e")):E,signer:f}},"resolveAwsSdkSigV4Config"),Wi=vW});var Pw=X((Si)=>{var Ji=":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",lW="[: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]["+Ji+"]*",zi=new RegExp("^"+lW+"$"),Ti=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},Ki=function(D){const F=zi.exec(D);return!(F===null||typeof F==="undefined")};Si.isExist=function(D){return typeof D!=="undefined"};Si.isEmptyObject=function(D){return Object.keys(D).length===0};Si.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]]}};Si.getValue=function(D){if(Si.isExist(D))return D;else return""};Si.isName=Ki;Si.getAllMatches=Ti;Si.nameRegexp=lW});var R9=X((gi)=>{function pW(D){return D===" "||D==="\t"||D==="\n"||D==="\r"}function aW(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 yD("InvalidXml","XML declaration allowed only at the start of the document.",B0(D,F));else if(D[F]=="?"&&D[F+1]==">"){F++;break}else continue}return F}function oW(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 Pi(D,F){let E="",w="",$=!1;for(;F<D.length;F++){if(D[F]===Oi||D[F]===ji)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 tW(D,F){const E=L9.getAllMatches(D,yi),w={};for(let $=0;$<E.length;$++){if(E[$][1].length===0)return yD("InvalidAttr","Attribute '"+E[$][2]+"' has no space in starting.",F3(E[$]));else if(E[$][3]!==void 0&&E[$][4]===void 0)return yD("InvalidAttr","Attribute '"+E[$][2]+"' is without value.",F3(E[$]));else if(E[$][3]===void 0&&!F.allowBooleanAttributes)return yD("InvalidAttr","boolean attribute '"+E[$][2]+"' is not allowed.",F3(E[$]));const C=E[$][2];if(!xi(C))return yD("InvalidAttr","Attribute '"+C+"' is an invalid name.",F3(E[$]));if(!w.hasOwnProperty(C))w[C]=1;else return yD("InvalidAttr","Attribute '"+C+"' is repeated.",F3(E[$]))}return!0}function ki(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 bi(D,F){if(F++,D[F]===";")return-1;if(D[F]==="#")return F++,ki(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 yD(D,F,E){return{err:{code:D,msg:F,line:E.line||E,col:E.col}}}function xi(D){return L9.isName(D)}function ci(D){return L9.isName(D)}function B0(D,F){const E=D.substring(0,F).split(/\r?\n/);return{line:E.length,col:E[E.length-1].length+1}}function F3(D){return D.startIndex+D[1].length}var L9=Pw(),qi={allowBooleanAttributes:!1,unpairedTags:[]};gi.validate=function(D,F){F=Object.assign({},qi,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=aW(D,C),C.err)return C}else if(D[C]==="<"){let f=C;if(C++,D[C]==="!"){C=oW(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(!ci(h)){let A;if(h.trim().length===0)A="Invalid space after '<'.";else A="Tag '"+h+"' is an invalid name.";return yD("InvalidTag",A,B0(D,C))}const U=Pi(D,C);if(U===!1)return yD("InvalidAttr","Attributes for '"+h+"' have open quote.",B0(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=tW(I,F);if(Y===!0)w=!0;else return yD(Y.err.code,Y.err.msg,B0(D,A+Y.err.line))}else if(B)if(!U.tagClosed)return yD("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",B0(D,C));else if(I.trim().length>0)return yD("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",B0(D,f));else if(E.length===0)return yD("InvalidTag","Closing tag '"+h+"' has not been opened.",B0(D,f));else{const A=E.pop();if(h!==A.tagName){let Y=B0(D,A.tagStartPos);return yD("InvalidTag","Expected closing tag '"+A.tagName+"' (opened in line "+Y.line+", col "+Y.col+") instead of closing tag '"+h+"'.",B0(D,f))}if(E.length==0)$=!0}else{const A=tW(I,F);if(A!==!0)return yD(A.err.code,A.err.msg,B0(D,C-I.length+A.err.line));if($===!0)return yD("InvalidXml","Multiple possible root nodes found.",B0(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=oW(D,C);continue}else if(D[C+1]==="?"){if(C=aW(D,++C),C.err)return C}else break;else if(D[C]==="&"){const A=bi(D,C);if(A==-1)return yD("InvalidChar","char '&' is not expected.",B0(D,C));C=A}else if($===!0&&!pW(D[C]))return yD("InvalidXml","Extra text at the end",B0(D,C));if(D[C]==="<")C--}}else{if(pW(D[C]))continue;return yD("InvalidChar","char '"+D[C]+"' is not expected.",B0(D,C))}if(!w)return yD("InvalidXml","Start tag expected.",1);else if(E.length==1)return yD("InvalidTag","Unclosed tag '"+E[0].tagName+"'.",B0(D,E[0].tagStartPos));else if(E.length>0)return yD("InvalidXml","Invalid '"+JSON.stringify(E.map((C)=>C.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1});return!0};var Oi='"',ji="'",yi=new RegExp('(\\s*)([^\\s=]+)(\\s*=)?(\\s*([\'"])(([\\s\\S])*?)\\5)?',"g")});var DJ=X((si)=>{var eW={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}},_i=function(D){return Object.assign({},eW,D)};si.buildOptions=_i;si.defaultOptions=eW});var wJ=X((XCD,EJ)=>{class FJ{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})}}EJ.exports=FJ});var fJ=X((WCD,$J)=>{function mi(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($&&ii(D,F)){if(F+=7,[entityName,val,F]=ni(D,F+1),val.indexOf("&")===-1)E[ti(entityName)]={regx:RegExp(`&${entityName};`,"g"),val}}else if($&&pi(D,F))F+=8;else if($&&ai(D,F))F+=8;else if($&&oi(D,F))F+=9;else if(li)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 li(D,F){if(D[F+1]==="!"&&D[F+2]==="-"&&D[F+3]==="-")return!0;return!1}function ii(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 pi(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 ai(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 oi(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 ti(D){if(vi.isName(D))return D;else throw new Error(`Invalid entity name ${D}`)}var vi=Pw();$J.exports=mi});var BJ=X((JCD,CJ)=>{function Ep(D,F={}){if(F=Object.assign({},Fp,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&&ei.test(E))return Number.parseInt(E,16);else{const w=Dp.exec(E);if(w){const $=w[1],C=w[2];let f=wp(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 wp(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 ei=/^[-+]?0x[a-fA-F0-9]+$/,Dp=/^([\-\+])?(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 Fp={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};CJ.exports=Ep});var IJ=X((zCD,AJ)=>{function Cp(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 Bp(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 N9(D,this.options.parseTagValue,this.options.numberParseOptions);else if(D.trim()===D)return N9(D,this.options.parseTagValue,this.options.numberParseOptions);else return D}}}function hp(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 Ap(D,F,E){if(!this.options.ignoreAttributes&&typeof D==="string"){const w=hJ.getAllMatches(D,Up),$=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]=N9(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 Gp(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 Yp(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 Zp(D,F,E){const w="*."+E;for(let $ in D){const C=D[$];if(w===C||F===C)return!0}return!1}function Xp(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 a8(D,F,E,w){const $=D.indexOf(F,E);if($===-1)throw new Error(w);else return $+F.length-1}function V9(D,F,E,w=">"){const $=Xp(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 Wp(D,F,E){const w=E;let $=1;for(;E<D.length;E++)if(D[E]==="<")if(D[E+1]==="/"){const C=a8(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=a8(D,"?>",E+1,"StopNode is not closed.");else if(D.substr(E+1,3)==="!--")E=a8(D,"-->",E+3,"StopNode is not closed.");else if(D.substr(E+1,2)==="![")E=a8(D,"]]>",E,"StopNode is not closed.")-2;else{const C=V9(D,E,">");if(C){if((C&&C.tagName)===F&&C.tagExp[C.tagExp.length-1]!=="/")$++;E=C.closeIndex}}}function N9(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 fp(D,E)}else if(hJ.isExist(D))return D;else return""}var hJ=Pw(),E3=wJ(),$p=fJ(),fp=BJ();class UJ{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=Cp,this.parseXml=Ip,this.parseTextData=Bp,this.resolveNameSpace=hp,this.buildAttributesMap=Ap,this.isItStopNode=Zp,this.replaceEntitiesValue=Mp,this.readStopNodeData=Wp,this.saveTextToParentTag=Yp,this.addChild=Gp}}var Up=new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?',"gm"),Ip=function(D){D=D.replace(/\r\n?/g,"\n");const F=new E3("!xml");let E=F,w="",$="";for(let C=0;C<D.length;C++)if(D[C]==="<")if(D[C+1]==="/"){const B=a8(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=V9(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 E3(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=a8(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=$p(D,C);this.docTypeEntities=B.entities,C=B.i}else if(D.substr(C+1,2)==="!["){const B=a8(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=V9(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 G=E;if(G&&this.options.unpairedTags.indexOf(G.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 W=this.readStopNodeData(D,U,Y+1);if(!W)throw new Error(`Unexpected end of ${U}`);C=W.i,Z=W.tagContent}const z=new E3(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 E3(h);if(h!==I&&A)Z[":@"]=this.buildAttributesMap(I,$,h);this.addChild(E,Z,$),$=$.substr(0,$.lastIndexOf("."))}else{const Z=new E3(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},Mp=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};AJ.exports=UJ});var MJ=X((Sp)=>{function Jp(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=zp(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=Kp(U,F);if(f[":@"])Tp(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 zp(D){const F=Object.keys(D);for(let E=0;E<F.length;E++){const w=F[E];if(w!==":@")return w}}function Tp(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 Kp(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}Sp.prettify=Jp});var XJ=X((KCD,ZJ)=>{var{buildOptions:Hp}=DJ(),Lp=IJ(),{prettify:Rp}=MJ(),Vp=R9();class YJ{constructor(D){this.externalEntities={},this.options=Hp(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 $=Vp.validate(D,F);if($!==!0)throw Error(`${$.err.msg}:${$.err.line}:${$.err.col}`)}const E=new Lp(this.options);E.addExternalEntities(this.externalEntities);const w=E.parseXml(D);if(this.options.preserveOrder||w===void 0)return w;else return Rp(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 '&#xD;'");else if(F==="&")throw new Error("An entity with value '&' is not permitted");else this.externalEntities[D]=F}}ZJ.exports=YJ});var KJ=X((SCD,TJ)=>{function Np(D,F){let E="";if(F.format&&F.indentBy.length>0)E="\n";return JJ(D,F,"",E)}function JJ(D,F,E,w){let $="",C=!1;for(let f=0;f<D.length;f++){const B=D[f],h=qp(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(!Op(U,F))Z=F.tagValueProcessor(h,Z),Z=zJ(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=WJ(B[":@"],F),z=h==="?xml"?"":w;let W=B[h][0][F.textNodeName];W=W.length!==0?" "+W:"",$+=z+`<${h}${W}${Z}?>`,C=!0;continue}let I=w;if(I!=="")I+=F.indentBy;const A=WJ(B[":@"],F),Y=w+`<${h}${A}`,G=JJ(B[h],F,U,I);if(F.unpairedTags.indexOf(h)!==-1)if(F.suppressUnpairedNode)$+=Y+">";else $+=Y+"/>";else if((!G||G.length===0)&&F.suppressEmptyNode)$+=Y+"/>";else if(G&&G.endsWith(">"))$+=Y+`>${G}${w}</${h}>`;else{if($+=Y+">",G&&w!==""&&(G.includes("/>")||G.includes("</")))$+=w+F.indentBy+G+w;else $+=G;$+=`</${h}>`}C=!0}return $}function qp(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 WJ(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($=zJ($,F),$===!0&&F.suppressBooleanAttributes)E+=` ${w.substr(F.attributeNamePrefix.length)}`;else E+=` ${w.substr(F.attributeNamePrefix.length)}="${$}"`}return E}function Op(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 zJ(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}TJ.exports=Np});var QJ=X((QCD,SJ)=>{function U8(D){if(this.options=Object.assign({},Pp,D),this.options.ignoreAttributes||this.options.attributesGroupName)this.isAttribute=function(){return!1};else this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=bp;if(this.processTextOrObjNode=yp,this.options.format)this.indentate=kp,this.tagEndChar=">\n",this.newLine="\n";else this.indentate=function(){return""},this.tagEndChar=">",this.newLine=""}function yp(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 kp(D){return this.options.indentBy.repeat(D)}function bp(D){if(D.startsWith(this.options.attributeNamePrefix)&&D!==this.options.textNodeName)return D.substr(this.attrPrefixLen);else return!1}var jp=KJ(),Pp={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:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("\'","g"),val:"&apos;"},{regex:new RegExp("\"","g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};U8.prototype.build=function(D){if(this.options.preserveOrder)return jp(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};SJ.exports=U8});var LJ=X((HCD,HJ)=>{var xp=R9(),cp=XJ(),gp=QJ();HJ.exports={XMLParser:cp,XMLValidator:xp,XMLBuilder:gp}});var jJ=X((LCD,OJ)=>{var{defineProperty:yw,getOwnPropertyDescriptor:rp,getOwnPropertyNames:_p}=Object,sp=Object.prototype.hasOwnProperty,q0=(D,F)=>yw(D,"name",{value:F,configurable:!0}),up=(D,F)=>{for(var E in F)yw(D,E,{get:F[E],enumerable:!0})},dp=(D,F,E,w)=>{if(F&&typeof F==="object"||typeof F==="function"){for(let $ of _p(F))if(!sp.call(D,$)&&$!==E)yw(D,$,{get:()=>F[$],enumerable:!(w=rp(F,$))||w.enumerable})}return D},vp=(D)=>dp(yw({},"__esModule",{value:!0}),D),RJ={};up(RJ,{_toBool:()=>np,_toNum:()=>lp,_toStr:()=>mp,awsExpectUnion:()=>pp,loadRestJsonErrorCode:()=>tp,loadRestXmlErrorCode:()=>Ea,parseJsonBody:()=>NJ,parseJsonErrorBody:()=>op,parseXmlBody:()=>qJ,parseXmlErrorBody:()=>Fa});OJ.exports=vp(RJ);var mp=q0((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=q0((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"),lp=q0((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"),ip=N6(),pp=q0((D)=>{if(D==null)return;if(typeof D==="object"&&"__type"in D)delete D.__type;return ip.expectUnion(D)},"awsExpectUnion"),ap=N6(),VJ=q0((D,F)=>ap.collectBody(D,F).then((E)=>F.utf8Encoder(E)),"collectBodyString"),NJ=q0((D,F)=>VJ(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"),op=q0(async(D,F)=>{const E=await NJ(D,F);return E.message=E.message??E.Message,E},"parseJsonErrorBody"),tp=q0((D,F)=>{const E=q0((C,f)=>Object.keys(C).find((B)=>B.toLowerCase()===f.toLowerCase()),"findKey"),w=q0((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"),ep=N6(),Da=LJ(),qJ=q0((D,F)=>VJ(D,F).then((E)=>{if(E.length){const w=new Da.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 ep.getValueFromTextNode(B)}return{}}),"parseXmlBody"),Fa=q0(async(D,F)=>{const E=await qJ(D,F);if(E.Error)E.Error.message=E.Error.message??E.Error.Message;return E},"parseXmlErrorBody"),Ea=q0((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 jD=X((w3)=>{Object.defineProperty(w3,"__esModule",{value:!0});var q9=Y9();q9.__exportStar(C0(),w3);q9.__exportStar(nW(),w3);q9.__exportStar(jJ(),w3)});async function PJ(D,F,E){const w=E.request;if(typeof F.accountIdEndpointMode==="function")switch(await F.accountIdEndpointMode?.()){case"disabled":y6.setFeature(D,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":y6.setFeature(D,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":y6.setFeature(D,"ACCOUNT_ID_MODE_REQUIRED","R");break}const $=D.__smithy_context?.selectedHttpAuthScheme?.identity;if($?.$source){const C=$;if(C.accountId)y6.setFeature(D,"RESOLVED_ACCOUNT_ID","T");for(let[f,B]of Object.entries(C.$source??{}))y6.setFeature(D,f,B)}}var y6;var yJ=M(()=>{y6=Q(jD(),1)});var O9="user-agent",kw="x-amz-user-agent",j9=" ",bw="/",kJ,bJ,P9="-";var xJ=M(()=>{kJ=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,bJ=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g});function cJ(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 wa=(D)=>(F,E)=>async(w)=>{const{request:$}=w;if(!gD.isInstance($))return F(w);const{headers:C}=$,f=E?.userAgent?.map(xw)||[],B=(await D.defaultUserAgentProvider()).map(xw);await PJ(E,D,w);const h=E;B.push(`m/${cJ(Object.assign({},E.__smithy_context?.features,h.__aws_sdk_context?.features))}`);const U=D?.customUserAgent?.map(xw)||[],I=await D.userAgentAppId();if(I)B.push(xw([`app/${I}`]));const A=qX(),Y=(A?[A]:[]).concat([...B,...f,...U]).join(j9),G=[...B.filter((Z)=>Z.startsWith("aws-sdk-")),...U].join(j9);if(D.runtime!=="browser"){if(G)C[kw]=C[kw]?`${C[O9]} ${G}`:G;C[O9]=Y}else C[kw]=Y;return F({...w,request:$})},xw=(D)=>{const F=D[0].split(bw).map((f)=>f.replace(kJ,P9)).join(bw),E=D[1]?.replace(bJ,P9),w=F.indexOf(bw),$=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}`}},"")},$a,g2=(D)=>({applyToStack:(F)=>{F.add(wa(D),$a)}});var gJ=M(()=>{i8();dD();yJ();xJ();$a={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0}});var o8=M(()=>{sZ();gJ()});var k6=(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 rJ=M(()=>{(function(D){D.ENV="env",D.CONFIG="shared config entry"})(A8||(A8={}))});var y9=M(()=>{rJ()});var fa="AWS_USE_DUALSTACK_ENDPOINT",Ca="use_dualstack_endpoint",r2;var _J=M(()=>{y9();r2={environmentVariableSelector:(D)=>k6(D,fa,A8.ENV),configFileSelector:(D)=>k6(D,Ca,A8.CONFIG),default:!1}});var Ba="AWS_USE_FIPS_ENDPOINT",ha="use_fips_endpoint",_2;var sJ=M(()=>{y9();_2={environmentVariableSelector:(D)=>k6(D,Ba,A8.ENV),configFileSelector:(D)=>k6(D,ha,A8.CONFIG),default:!1}});var k9,v0=(D)=>D[k9.SMITHY_CONTEXT_KEY]||(D[k9.SMITHY_CONTEXT_KEY]={});var uJ=M(()=>{k9=Q(W0(),1)});var _D=(D)=>{if(typeof D==="function")return D;const F=Promise.resolve(D);return()=>F};var Z2=M(()=>{uJ()});var dJ=M(()=>{Z2()});var vJ=M(()=>{Z2()});var mJ=M(()=>{_J();sJ();dJ();vJ()});var m0,s2;var nJ=M(()=>{m0={environmentVariableSelector:(D)=>D.AWS_REGION,configFileSelector:(D)=>D.region,default:()=>{throw new Error("Region is missing")}},s2={preferredFile:"credentials"}});var cw=(D)=>typeof D==="string"&&(D.startsWith("fips-")||D.endsWith("-fips"));var b9=(D)=>cw(D)?["fips-aws-global","aws-fips"].includes(D)?"us-east-1":D.replace(/fips-(dkr-|prod-)?|-fips/,""):D;var lJ=()=>{};var u2=(D)=>{const{region:F,useFipsEndpoint:E}=D;if(!F)throw new Error("Region is missing");return{...D,region:async()=>{if(typeof F==="string")return b9(F);const w=await F();return b9(w)},useFipsEndpoint:async()=>{const w=typeof F==="string"?F:await F();if(cw(w))return!0;return typeof E!=="function"?Promise.resolve(!!E):E()}}};var iJ=M(()=>{lJ()});var pJ=M(()=>{nJ();iJ()});var aJ=()=>{};var oJ=()=>{};var tJ=()=>{};var eJ=M(()=>{aJ();oJ();tJ()});var n0=M(()=>{mJ();pJ();eJ()});function Ua(D){return(F)=>async(E)=>{const w=E.request;if(gD.isInstance(w)){const{body:$,headers:C}=w;if($&&Object.keys(C).map((f)=>f.toLowerCase()).indexOf(Fz)===-1)try{const f=D($);w.headers={...w.headers,[Fz]:String(f)}}catch(f){}}return F({...E,request:w})}}var Fz="content-length",Aa,d2=(D)=>({applyToStack:(F)=>{F.add(Ua(D.bodyLengthChecker),Aa)}});var b6=M(()=>{dD();Aa={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0}});var Ez=async(D)=>{const F=D?.Bucket||"";if(typeof D.Bucket==="string")D.Bucket=F.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(Za(F)){if(D.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else if(!Ya(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},Ia,Ga,Ma,Ya=(D)=>Ia.test(D)&&!Ga.test(D)&&!Ma.test(D),Za=(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 wz=M(()=>{Ia=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,Ga=/(\d+\.){3}\d+/,Ma=/\.\./});var $z=M(()=>{wz()});var fz=(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 l0;var $3=M(()=>{l0=class l0 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,l0.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 Cz=M(()=>{$3();x=class x extends l0{constructor(D,F=!0){super(D,F);this.name="CredentialsProviderError",Object.setPrototypeOf(this,x.prototype)}}});var J0;var Bz=M(()=>{$3();J0=class J0 extends l0{constructor(D,F=!0){super(D,F);this.name="TokenProviderError",Object.setPrototypeOf(this,J0.prototype)}}});var N1=(...D)=>async()=>{if(D.length===0)throw new l0("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 hz=M(()=>{$3()});var Uz=(D)=>()=>Promise.resolve(D);var t8=(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 $D=M(()=>{Cz();$3();Bz();hz()});function gw(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 Az=(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: ${gw(D.toString())}`,{logger:F})}};var Iz=M(()=>{$D()});import{homedir as Xa}from"os";import{sep as Wa}from"path";var x9,Ja=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},I8=()=>{const{HOME:D,USERPROFILE:F,HOMEPATH:E,HOMEDRIVE:w=`C:${Wa}`}=process.env;if(D)return D;if(F)return F;if(E)return`${w}${E}`;const $=Ja();if(!x9[$])x9[$]=Xa();return x9[$]};var x6=M(()=>{x9={}});var Gz="AWS_PROFILE",i0=(D)=>D.profile||process.env.AWS_PROFILE||"default";import{createHash as za}from"crypto";import{join as Ta}from"path";var rw=(D)=>{const E=za("sha1").update(D).digest("hex");return Ta(I8(),".aws","sso","cache",`${E}.json`)};var c9=M(()=>{x6()});import{promises as Ka}from"fs";var Sa,_w=async(D)=>{const F=rw(D),E=await Sa(F,"utf8");return JSON.parse(E)};var Mz=M(()=>{c9();({readFile:Sa}=Ka)});var g9,Yz=(D)=>Object.entries(D).filter(([F])=>{const E=F.indexOf(p0);if(E===-1)return!1;return Object.values(g9.IniSectionType).includes(F.substring(0,E))}).reduce((F,[E,w])=>{const $=E.indexOf(p0),C=E.substring(0,$)===g9.IniSectionType.PROFILE?E.substring($+1):E;return F[C]=w,F},{...D.default&&{default:D.default}});var Zz=M(()=>{g9=Q(W0(),1);c6()});import{join as Qa}from"path";var Ha="AWS_CONFIG_FILE",sw=()=>process.env[Ha]||Qa(I8(),".aws","config");var r9=M(()=>{x6()});import{join as La}from"path";var Ra="AWS_SHARED_CREDENTIALS_FILE",Xz=()=>process.env[Ra]||La(I8(),".aws","credentials");var Wz=M(()=>{x6()});var Jz,Va,Na,f3=(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=Va.exec(B);if(h){const[,U,,I]=h;if(Object.values(Jz.IniSectionType).includes(U))E=[U,I].join(p0)}else E=B;if(Na.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(p0):h;F[E][I]=U}}}}return F};var _9=M(()=>{Jz=Q(W0(),1);c6();Va=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,Na=["__proto__","profile __proto__"]});import{promises as qa}from"fs";var Oa,s9,C3=(D,F)=>{if(!s9[D]||F?.ignoreCache)s9[D]=Oa(D,"utf8");return s9[D]};var u9=M(()=>{({readFile:Oa}=qa),s9={}});import{join as zz}from"path";var Tz=()=>({}),p0=".",uw=async(D={})=>{const{filepath:F=Xz(),configFilepath:E=sw()}=D,w=I8();let C=F;if(F.startsWith("~/"))C=zz(w,F.slice(2));let f=E;if(E.startsWith("~/"))f=zz(w,E.slice(2));const B=await Promise.all([C3(f,{ignoreCache:D.ignoreCache}).then(f3).then(Yz).catch(Tz),C3(C,{ignoreCache:D.ignoreCache}).then(f3).catch(Tz)]);return{configFile:B[0],credentialsFile:B[1]}};var c6=M(()=>{Zz();r9();Wz();x6();_9();u9()});var Kz,Sz=(D)=>Object.entries(D).filter(([F])=>F.startsWith(Kz.IniSectionType.SSO_SESSION+p0)).reduce((F,[E,w])=>({...F,[E.substring(E.indexOf(p0)+1)]:w}),{});var Qz=M(()=>{Kz=Q(W0(),1);c6()});var ja=()=>({}),dw=async(D={})=>C3(D.configFilepath??sw()).then(f3).then(Sz).catch(ja);var Hz=M(()=>{r9();Qz();_9();u9()});var Lz=(...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 G8=async(D)=>{const F=await uw(D);return Lz(F.configFile,F.credentialsFile)};var Rz=M(()=>{c6()});var Vz=()=>{};var X2=M(()=>{x6();c9();Mz();c6();Hz();Rz();Vz()});var Nz=(D,{preferredFile:F="config",...E}={})=>async()=>{const w=i0(E),{configFile:$,credentialsFile:C}=await uw(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}]: ${gw(D.toString())}`,{logger:E.logger})}};var qz=M(()=>{$D();X2()});var Pa=(D)=>typeof D==="function",Oz=(D)=>Pa(D)?async()=>await D():Uz(D);var jz=M(()=>{$D()});var i=({environmentVariableSelector:D,configFileSelector:F,default:E},w={})=>t8(N1(Az(D),Nz(F,w),Oz(E)));var Pz=M(()=>{$D();Iz();qz();jz()});var v2=M(()=>{Pz()});var yz="AWS_ENDPOINT_URL",kz="endpoint_url",bz=(D)=>({environmentVariableSelector:(F)=>{const E=D.split(" ").map((C)=>C.toUpperCase()),w=F[[yz,...E].join("_")];if(w)return w;const $=F[yz];if($)return $;return},configFileSelector:(F,E)=>{if(E&&F.services){const $=E[["services",F.services].join(p0)];if($){const C=D.split(" ").map((B)=>B.toLowerCase()),f=$[[C.join("_"),kz].join(p0)];if(f)return f}}const w=F[kz];if(w)return w;return},default:void 0});var xz=M(()=>{X2()});var vw=async(D)=>i(bz(D??""))();var d9=M(()=>{v2();xz()});function cz(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 eD=(D)=>{if(typeof D==="string")return eD(new URL(D));const{hostname:F,pathname:E,port:w,protocol:$,search:C}=D;let f;if(C)f=cz(C);return{hostname:F,port:w?parseInt(w):void 0,protocol:$,path:E,query:f}};var M8=()=>{};var mw=(D)=>{if(typeof D==="object"){if("url"in D)return eD(D.url);return D}return eD(D)};var nw=M(()=>{M8()});var gz=async(D,F,E,w)=>{if(!E.endpoint){let f;if(E.serviceConfiguredEndpoint)f=await E.serviceConfiguredEndpoint();else f=await vw(E.serviceId);if(f)E.endpoint=()=>Promise.resolve(mw(f))}const $=await ya(D,F,E);if(typeof E.endpointProvider!=="function")throw new Error("config.endpointProvider is not set.");return E.endpointProvider($,w)},ya=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 fz(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 Ez(w);return w};var v9=M(()=>{$z();d9();nw()});var rz=M(()=>{v9();nw()});var _z=({config:D,instructions:F})=>{return(E,w)=>async($)=>{const C=await gz($.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=v0(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 m9=M(()=>{Z2();v9()});var sz,ka,p=(D,F)=>({applyToStack:(E)=>{E.addRelativeTo(_z({config:D,instructions:F}),ka)}});var uz=M(()=>{sz=Q(YD(),1);m9();ka={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:sz.serializerMiddlewareOption.name}});var m2=(D)=>{const F=D.tls??!0,{endpoint:E}=D,w=E!=null?async()=>mw(await _D(E)()):void 0,C={...D,endpoint:w,tls:F,isCustomEndpoint:!!E,useDualstackEndpoint:_D(D.useDualstackEndpoint??!1),useFipsEndpoint:_D(D.useFipsEndpoint??!1)};let f=void 0;return C.serviceConfiguredEndpoint=async()=>{if(D.serviceId&&!f)f=vw(D.serviceId);return f},C};var dz=M(()=>{Z2();d9();nw()});var vz=()=>{};var UD=M(()=>{rz();m9();uz();dz();vz()});var a0,e8=3,o0;var lw=M(()=>{(function(D){D.STANDARD="standard",D.ADAPTIVE="adaptive"})(a0||(a0={}));o0=a0.STANDARD});var mz,nz,lz,iz;var pz=M(()=>{mz=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],nz=["TimeoutError","RequestTimeout","RequestTimeoutException"],lz=[500,502,503,504],iz=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"]});var ba=(D)=>D.$metadata?.clockSkewCorrected,g6=(D)=>D.$metadata?.httpStatusCode===429||mz.includes(D.name)||D.$retryable?.throttling==!0,iw=(D)=>ba(D)||nz.includes(D.name)||iz.includes(D?.code||"")||lz.includes(D.$metadata?.httpStatusCode||0),az=(D)=>{if(D.$metadata?.httpStatusCode!==void 0){const F=D.$metadata.httpStatusCode;if(500<=F&&F<=599&&!iw(D))return!0;return!1}return!1};var B3=M(()=>{pz()});class pw{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(),g6(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 n9=M(()=>{B3()});var D6=100,h3=20000,l9=500,aw=500,i9=5,p9=10,a9=1,ow="amz-sdk-invocation-id",tw="amz-sdk-request";var oz=()=>{let D=D6;return{computeNextBackoffDelay:(w)=>{return Math.floor(Math.min(h3,Math.random()*2**w*D))},setDelayBase:(w)=>{D=w}}};var tz=()=>{};var o9=({retryDelay:D,retryCount:F,retryCost:E})=>{return{getRetryCount:()=>F,getRetryDelay:()=>Math.min(h3,D),getRetryCost:()=>E}};var ez=()=>{};class r6{constructor(D){this.maxAttempts=D,this.mode=a0.STANDARD,this.capacity=aw,this.retryBackoffStrategy=oz(),this.maxAttemptsProvider=typeof D==="function"?D:async()=>D}async acquireInitialRetryToken(D){return o9({retryDelay:D6,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"?l9:D6);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,o9({retryDelay:C,retryCount:D.getRetryCount()+1,retryCost:f})}throw new Error("No retry token available")}recordSuccess(D){this.capacity=Math.max(aw,this.capacity+(D.getRetryCost()??a9))}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 ${e8}`),e8}}shouldRetry(D,F,E){return D.getRetryCount()+1<E&&this.capacity>=this.getCapacityCost(F.errorType)&&this.isRetryableError(F.errorType)}getCapacityCost(D){return D==="TRANSIENT"?p9:i9}isRetryableError(D){return D==="THROTTLING"||D==="TRANSIENT"}}var ew=M(()=>{lw();tz();ez()});class t9{constructor(D,F){this.maxAttemptsProvider=D,this.mode=a0.ADAPTIVE;const{rateLimiter:E}=F??{};this.rateLimiter=E??new pw,this.standardRetryStrategy=new r6(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 DT=M(()=>{lw();n9();ew()});var FT=M(()=>{ew()});var ET=()=>{};var O0=M(()=>{DT();FT();n9();ew();lw();ET()});var n2,_AD,sAD,D$,uAD,dAD,vAD,mAD,nAD,lAD;var e9=M(()=>{n2=Q(Mf(),1),_AD=n2.default.v1,sAD=n2.default.v3,D$=n2.default.v4,uAD=n2.default.v5,dAD=n2.default.NIL,vAD=n2.default.version,mAD=n2.default.validate,nAD=n2.default.stringify,lAD=n2.default.parse});var wT=M(()=>{O0()});var D5=M(()=>{O0()});var F5=M(()=>{B3()});var E5=(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 w5=M(()=>{dD();B3();O0();wT();D5();F5()});var $T=M(()=>{O0();w5()});var fT="AWS_MAX_ATTEMPTS",CT="max_attempts",l2,i2=(D)=>{const{retryStrategy:F}=D,E=_D(D.maxAttempts??e8);return{...D,maxAttempts:E,retryStrategy:async()=>{if(F)return F;if(await _D(D.retryMode)()===a0.ADAPTIVE)return new t9(E);return new r6(E)}}},xa="AWS_RETRY_MODE",ca="retry_mode",p2;var BT=M(()=>{Z2();O0();l2={environmentVariableSelector:(D)=>{const F=D[fT];if(!F)return;const E=parseInt(F);if(Number.isNaN(E))throw new Error(`Environment variable ${fT} mast be a number, got "${F}"`);return E},configFileSelector:(D)=>{const F=D[CT];if(!F)return;const E=parseInt(F);if(Number.isNaN(E))throw new Error(`Shared config file entry ${CT} mast be a number, got "${F}"`);return E},default:e8},p2={environmentVariableSelector:(D)=>D[xa],configFileSelector:(D)=>D[ca],default:o0}});var hT=M(()=>{dD();O0()});var F6=(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(",")})`:""}`},_6=()=>{let D=[],F=[],E=!1;const w=new Set,$=(A)=>A.sort((Y,G)=>UT[G.step]-UT[Y.step]||AT[G.priority||"normal"]-AT[Y.priority||"normal"]),C=(A)=>{let Y=!1;const G=(Z)=>{const z=F6(Z.name,Z.aliases);if(z.includes(A)){Y=!0;for(let W of z)w.delete(W);return!1}return!0};return D=D.filter(G),F=F.filter(G),Y},f=(A)=>{let Y=!1;const G=(Z)=>{if(Z.middleware===A){Y=!0;for(let z of F6(Z.name,Z.aliases))w.delete(z);return!1}return!0};return D=D.filter(G),F=F.filter(G),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((G)=>{if(G.before.length===0&&G.after.length===0)Y.push(G);else Y.push(...h(G))}),Y.push(A),A.after.reverse().forEach((G)=>{if(G.before.length===0&&G.after.length===0)Y.push(G);else Y.push(...h(G))}),Y},U=(A=!1)=>{const Y=[],G=[],Z={};return D.forEach((W)=>{const J={...W,before:[],after:[]};for(let K of F6(J.name,J.aliases))Z[K]=J;Y.push(J)}),F.forEach((W)=>{const J={...W,before:[],after:[]};for(let K of F6(J.name,J.aliases))Z[K]=J;G.push(J)}),G.forEach((W)=>{if(W.toMiddleware){const J=Z[W.toMiddleware];if(J===void 0){if(A)return;throw new Error(`${W.toMiddleware} is not found when adding ${Y8(W.name,W.aliases)} middleware ${W.relation} ${W.toMiddleware}`)}if(W.relation==="after")J.after.push(W);if(W.relation==="before")J.before.push(W)}}),$(Y).map(h).reduce((W,J)=>{return W.push(...J),W},[])},I={add:(A,Y={})=>{const{name:G,override:Z,aliases:z}=Y,W={step:"initialize",priority:"normal",middleware:A,...Y},J=F6(G,z);if(J.length>0){if(J.some((K)=>w.has(K))){if(!Z)throw new Error(`Duplicate middleware name '${Y8(G,z)}'`);for(let K of J){const L=D.findIndex((m)=>m.name===K||m.aliases?.some((DD)=>DD===K));if(L===-1)continue;const V=D[L];if(V.step!==W.step||W.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(G,z)}" middleware with ${W.priority} priority in ${W.step} step.`);D.splice(L,1)}}for(let K of J)w.add(K)}D.push(W)},addRelativeTo:(A,Y)=>{const{name:G,override:Z,aliases:z}=Y,W={middleware:A,...Y},J=F6(G,z);if(J.length>0){if(J.some((K)=>w.has(K))){if(!Z)throw new Error(`Duplicate middleware name '${Y8(G,z)}'`);for(let K of J){const L=F.findIndex((m)=>m.name===K||m.aliases?.some((DD)=>DD===K));if(L===-1)continue;const V=F[L];if(V.toMiddleware!==W.toMiddleware||V.relation!==W.relation)throw new Error(`"${Y8(V.name,V.aliases)}" middleware ${V.relation} "${V.toMiddleware}" middleware cannot be overridden by "${Y8(G,z)}" middleware ${W.relation} "${W.toMiddleware}" middleware.`);F.splice(L,1)}}for(let K of J)w.add(K)}F.push(W)},clone:()=>B(_6()),use:(A)=>{A.applyToStack(I)},remove:(A)=>{if(typeof A==="string")return C(A);else return f(A)},removeByTag:(A)=>{let Y=!1;const G=(Z)=>{const{tags:z,name:W,aliases:J}=Z;if(z&&z.includes(A)){const K=F6(W,J);for(let L of K)w.delete(L);return Y=!0,!1}return!0};return D=D.filter(G),F=F.filter(G),Y},concat:(A)=>{const Y=B(_6());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 G of U().map((Z)=>Z.middleware).reverse())A=G(A,Y);if(E)console.log(I.identify());return A}};return I},UT,AT;var IT=M(()=>{UT={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},AT={high:3,normal:2,low:1}});var $5=M(()=>{IT()});class j0{constructor(D){this.config=D,this.middlewareStack=_6()}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 GT=M(()=>{$5()});var MT=(D)=>typeof ArrayBuffer==="function"&&D instanceof ArrayBuffer||Object.prototype.toString.call(D)==="[object ArrayBuffer]";import{Buffer as f5}from"buffer";var q1=(D,F=0,E=D.byteLength-F)=>{if(!MT(D))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof D} (${D})`);return f5.from(D,F,E)},s6=(D,F)=>{if(typeof D!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof D} (${D})`);return F?f5.from(D,F):f5.from(D)};var E6=()=>{};var ga,z0=(D)=>{if(D.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!ga.exec(D))throw new TypeError("Invalid base64 string.");const F=s6(D,"base64");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength)};var YT=M(()=>{E6();ga=/^[A-Za-z0-9+/]*={0,2}$/});var D0=(D)=>{const F=s6(D,"utf8");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength/Uint8Array.BYTES_PER_ELEMENT)};var C5=M(()=>{E6()});var ZT=(D)=>{if(typeof D==="string")return D0(D);if(ArrayBuffer.isView(D))return new Uint8Array(D.buffer,D.byteOffset,D.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(D)};var XT=M(()=>{C5()});var T0=(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 WT=M(()=>{E6()});var a2=M(()=>{C5();XT();WT()});var K0=(D)=>{let F;if(typeof D==="string")F=D0(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 JT=M(()=>{E6();a2()});var O1=M(()=>{YT();JT()});function zT(D,F="utf-8"){if(F==="base64")return K0(D);return T0(D)}function TT(D,F){if(F==="base64")return j1.mutate(z0(D));return j1.mutate(D0(D))}var KT=M(()=>{O1();a2();B5()});var j1;var B5=M(()=>{KT();j1=class j1 extends Uint8Array{static fromString(D,F="utf-8"){switch(typeof D){case"string":return TT(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 zT(this,D)}}});var ST=()=>{};var U3=(D)=>encodeURIComponent(D).replace(/[!'()*]/g,ra),ra=(D)=>`%${D.charCodeAt(0).toString(16).toUpperCase()}`;var QT=()=>{};var HT=M(()=>{QT()});function F$(D){const F=[];for(let E of Object.keys(D).sort()){const w=D[E];if(E=U3(E),Array.isArray(w))for(let $=0,C=w.length;$<C;$++)F.push(`${E}=${U3(w[$])}`);else{let $=E;if(w||typeof w==="string")$+=`=${U3(w)}`;F.push($)}}return F.join("&")}var E$=M(()=>{HT()});var LT;var RT=M(()=>{LT=["ECONNRESET","EPIPE","ETIMEDOUT"]});var h5=(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 U5=()=>{};var VT=(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 NT=(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 qT=(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 _a}from"stream";async function A5(D,F,E=OT){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(OT,E)))}),new Promise((B)=>{D.on("continue",()=>{clearTimeout(C),B()}),D.on("error",()=>{f=!0,clearTimeout(C),B()})})]);if(!f)sa(D,F.body)}function sa(D,F){if(F instanceof _a){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 OT=1000;var I5=()=>{};import{Agent as jT,request as ua}from"http";import{Agent as PT,request as da}from"https";class h0{static create(D){if(typeof D?.handle==="function")return D;return new h0(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 jT||typeof $?.destroy==="function")return $;return new jT({keepAlive:!0,maxSockets:50,...$})})(),httpsAgent:(()=>{if(C instanceof PT||typeof C?.destroy==="function")return C;return new PT({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=h0.checkSocketUsage(U,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000)));const I=F$(D.query||{});let A=void 0;if(D.username!=null||D.password!=null){const K=D.username??"",L=D.password??"";A=`${K}:${L}`}let Y=D.path;if(I)Y+=`?${I}`;if(D.fragment)Y+=`#${D.fragment}`;let G=D.hostname??"";if(G[0]==="["&&G.endsWith("]"))G=D.hostname.slice(1,-1);else G=D.hostname;const Z={headers:D.headers,host:G,method:D.method,path:Y,port:D.port,agent:U,auth:A},W=(h?da:ua)(Z,(K)=>{const L=new E8({statusCode:K.statusCode||-1,reason:K.statusMessage,headers:h5(K.headers),body:K});f({response:L})});if(W.on("error",(K)=>{if(LT.includes(K.code))B(Object.assign(K,{name:"TimeoutError"}));else B(K)}),F){const K=()=>{W.destroy();const L=new Error("Request aborted");L.name="AbortError",B(L)};if(typeof F.addEventListener==="function"){const L=F;L.addEventListener("abort",K,{once:!0}),W.once("close",()=>L.removeEventListener("abort",K))}else F.onabort=K}C.push(VT(W,B,this.config.connectionTimeout)),C.push(qT(W,B,this.config.requestTimeout));const J=Z.agent;if(typeof J==="object"&&"keepAlive"in J)C.push(NT(W,{keepAlive:J.keepAlive,keepAliveMsecs:J.keepAliveMsecs}));$=A5(W,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 yT=M(()=>{dD();E$();RT();U5();I5()});var kT=()=>{};var bT=M(()=>{kT()});var xT=M(()=>{dD();E$();U5();bT();I5()});import{Writable as va}from"stream";var G5;var cT=M(()=>{G5=class G5 extends va{constructor(){super(...arguments);this.bufferedBytes=[]}_write(D,F,E){this.bufferedBytes.push(D),E()}}});async function na(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 t0=(D)=>{if(ma(D))return na(D);return new Promise((F,E)=>{const w=new G5;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($)})})},ma=(D)=>typeof ReadableStream==="function"&&D instanceof ReadableStream;var gT=M(()=>{cT()});var Z8=M(()=>{yT();xT();gT()});var rT=M(()=>{dD();E$()});async function la(D){const F=await pa(D),E=z0(F);return new Uint8Array(E)}async function ia(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 _T=(D)=>{if(typeof Blob==="function"&&D instanceof Blob)return la(D);return ia(D)};var sT=M(()=>{O1()});var uT=M(()=>{rT();sT()});function vT(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 M5)F[E/2]=M5[w];else throw new Error(`Cannot decode unrecognized sequence ${w} as hexadecimal`)}return F}function o2(D){let F="";for(let E=0;E<D.byteLength;E++)F+=dT[D[E]];return F}var dT,M5;var w$=M(()=>{dT={},M5={};for(let D=0;D<256;D++){let F=D.toString(16).toLowerCase();if(F.length===1)F=`0${F}`;dT[D]=F,M5[F]=D}});var A3=(D)=>typeof ReadableStream==="function"&&(D?.constructor?.name===ReadableStream.name||D instanceof ReadableStream);var mT="The stream has already been transformed.",lT=(D)=>{if(!nT(D)&&!A3(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(mT);return F=!0,await _T(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 K0(C);else if($==="hex")return o2(C);else if($===void 0||$==="utf8"||$==="utf-8")return T0(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(mT);if(F=!0,nT(D))return w(D);else if(A3(D))return D;else throw new Error(`Cannot transform payload to web stream, got ${D}`)}})},nT=(D)=>typeof Blob==="function"&&D instanceof Blob;var iT=M(()=>{uT();O1();w$();a2()});import{Readable as Y5}from"stream";import{TextDecoder as aa}from"util";var pT="The stream has already been transformed.",aT=(D)=>{if(!(D instanceof Y5))try{return lT(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(pT);return F=!0,await t0(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 aa(w).decode($)},transformToWebStream:()=>{if(F)throw new Error(pT);if(D.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Y5.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,Y5.toWeb(D)}})};var oT=M(()=>{Z8();E6();iT()});var tT=()=>{};var eT=()=>{};var Z5=M(()=>{B5();ST();oT();tT();eT()});var w6=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 DK=M(()=>{Z5()});class l{constructor(){this.middlewareStack=_6()}static classBuilder(){return new EK}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,G={logger:Y,clientName:$,commandName:C,inputFilterSensitiveLog:f,outputFilterSensitiveLog:B,[FK.SMITHY_CONTEXT_KEY]:{commandInstance:this,...h},...U},{requestHandler:Z}=F;return A.resolve((z)=>Z.handle(z.request,E||{}),G)}}class EK{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 FK;var wK=M(()=>{$5();FK=Q(W0(),1)});var ED="***SensitiveInformation***";var u6=(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 oa=(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))UK.warn(hK(`Expected number but observed string: ${D}`));return F}}if(typeof D==="number")return D;throw new TypeError(`Expected number, got ${typeof D}: ${D}`)},ta,X5=(D)=>{const F=oa(D);if(F!==void 0&&!Number.isNaN(F)&&F!==1/0&&F!==-1/0){if(Math.abs(F)>ta)throw new TypeError(`Expected 32-bit float, got ${D}`)}return F},$$=(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}`)},W2=(D)=>W5(D,32),$K=(D)=>W5(D,16),fK=(D)=>W5(D,8),W5=(D,F)=>{const E=$$(D);if(E!==void 0&&ea(E,F)!==E)throw new TypeError(`Expected ${F}-bit integer, got ${D}`);return E},ea=(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]}},PD=(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},S0=(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 UK.warn(hK(`Expected string, got ${typeof D}: ${D}`)),String(D);throw new TypeError(`Expected string, got ${typeof D}: ${D}`)},CK=(D)=>{if(typeof D=="string")return X5(f$(D));return X5(D)},Do,f$=(D)=>{const F=D.match(Do);if(F===null||F[0].length!==D.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(D)},J5=(D)=>{if(typeof D=="string")return Fo(D);return X5(D)},Fo=(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}`)}},I3=(D)=>{if(typeof D==="string")return W2(f$(D));return W2(D)},z5=(D)=>{if(typeof D==="string")return $K(f$(D));return $K(D)},BK=(D)=>{if(typeof D==="string")return fK(f$(D));return fK(D)},hK=(D)=>{return String(new TypeError(D).stack||D).split("\n").slice(0,5).filter((F)=>!F.includes("stackTraceWarning")).join("\n")},UK;var T5=M(()=>{ta=Math.ceil(340282346638528860000000000000000000000),Do=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,UK={warn:console.warn}});var Eo,wo,AK=(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=wo.exec(D);if(!F)throw new TypeError("Invalid RFC-3339 date-time value");const[E,w,$,C,f,B,h,U]=F,I=z5(K5(w)),A=$6($,"month",1,12),Y=$6(C,"day",1,31);return IK(I,A,Y,{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U})},$o,d6=(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=$o.exec(D);if(!F)throw new TypeError("Invalid RFC-3339 date-time value");const[E,w,$,C,f,B,h,U,I]=F,A=z5(K5(w)),Y=$6($,"month",1,12),G=$6(C,"day",1,31),Z=IK(A,Y,G,{hours:f,minutes:B,seconds:h,fractionalMilliseconds:U});if(I.toUpperCase()!="Z")Z.setTime(Z.getTime()-Uo(I));return Z},iMD,pMD,aMD,IK=(D,F,E,w)=>{const $=F-1;return Co(D,$,E),new Date(Date.UTC(D,$,E,$6(w.hours,"hour",0,23),$6(w.minutes,"minute",0,59),$6(w.seconds,"seconds",0,60),ho(w.fractionalMilliseconds)))},fo,Co=(D,F,E)=>{let w=fo[F];if(F===1&&Bo(D))w=29;if(E>w)throw new TypeError(`Invalid day for ${Eo[F]} in ${D}: ${E}`)},Bo=(D)=>{return D%4===0&&(D%100!==0||D%400===0)},$6=(D,F,E,w)=>{const $=BK(K5(D));if($<E||$>w)throw new TypeError(`${F} must be between ${E} and ${w}, inclusive`);return $},ho=(D)=>{if(D===null||D===void 0)return 0;return CK("0."+D)*1000},Uo=(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},K5=(D)=>{let F=0;while(F<D.length-1&&D.charAt(F)==="0")F++;if(F===0)return D;return D.slice(F)};var GK=M(()=>{T5();Eo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wo=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),$o=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),iMD=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$/),pMD=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$/),aMD=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})$/),fo=[31,28,31,30,31,30,31,31,30,31,30,31]});var e0,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 S5=M(()=>{e0=class e0 extends Error{constructor(D){super(D.message);Object.setPrototypeOf(this,e0.prototype),this.name=D.name,this.$fault=D.$fault,this.$metadata=D.$metadata}}});var Ao=({output:D,parsedBody:F,exceptionCtor:E,errorCode:w})=>{const $=Io(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})=>{Ao({output:F,parsedBody:E,exceptionCtor:D,errorCode:w})}},Io=(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 MK=M(()=>{S5()});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 YK=!1,D1=(D)=>{if(D&&!YK&&parseInt(D.substring(1,D.indexOf(".")))<16)YK=!0};function C$(D){return encodeURIComponent(D).replace(/[!'()*]/g,function(F){return"%"+F.charCodeAt(0).toString(16).toUpperCase()})}var Q5,ZK=(D)=>{const F=[];for(let E in Q5.AlgorithmId){const w=Q5.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}}},XK=(D)=>{const F={};return D.checksumAlgorithms().forEach((E)=>{F[E.algorithmId()]=E.checksumConstructor()}),F};var WK=M(()=>{Q5=Q(W0(),1)});var JK=(D)=>{let F=D.retryStrategy;return{setRetryStrategy(E){F=E},retryStrategy(){return F}}},zK=(D)=>{const F={};return F.retryStrategy=D.retryStrategy(),F};var F1=(D)=>{return{...ZK(D),...JK(D)}},E1=(D)=>{return{...XK(D),...zK(D)}};var TK=M(()=>{WK()});var KK=M(()=>{TK()});var X8=(D)=>{return D!=null};var H5=function(){const D=Object.getPrototypeOf(this).constructor,E=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(E,D.prototype),E};var SK=M(()=>{H5.prototype=Object.create(String.prototype,{constructor:{value:H5,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(H5,String)});class P0{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,Go(w,$,C);else C=F;for(let f of Object.keys(C)){if(!Array.isArray(C[f])){w[f]=C[f];continue}QK(w,null,C,f)}return w}var c=(D,F)=>{const E={};for(let w in F)QK(E,D,F,w);return E},Go=(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},{}))},QK=(D,F,E,w)=>{if(F!==null){let f=E[w];if(typeof f==="function")f=[,f];const[B=Mo,h=Yo,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}},Mo=(D)=>D!=null,Yo=(D)=>D;var HK=()=>{};var CD=(D)=>{if(D==null)return{};if(Array.isArray(D))return D.filter((F)=>F!=null).map(CD);if(typeof D==="object"){const F={};for(let E of Object.keys(D)){if(D[E]==null)continue;F[E]=CD(D[E])}return F}return D};var y=M(()=>{GT();DK();wK();GK();MK();S5();KK();SK();T5();HK()});import{Readable as Zo}from"stream";var LK=(D)=>D?.body instanceof Zo||typeof ReadableStream!=="undefined"&&D?.body instanceof ReadableStream;var RK=()=>{};var Xo=(D)=>(F,E)=>async(w)=>{let $=await D.retryStrategy();const C=await D.maxAttempts();if(Wo($)){$=$;let f=await $.acquireInitialRetryToken(E.partition_id),B=new Error,h=0,U=0;const{request:I}=w,A=gD.isInstance(I);if(A)I.headers[ow]=D$();while(!0)try{if(A)I.headers[tw]=`attempt=${h+1}; max=${C}`;const{response:Y,output:G}=await F(w);return $.recordSuccess(f),G.$metadata.attempts=h+1,G.$metadata.totalRetryDelay=U,{response:Y,output:G}}catch(Y){const G=Jo(Y);if(B=E5(Y),A&&LK(I))throw(E.logger instanceof P0?console:E.logger)?.warn("An error was encountered in a non-retryable streaming request."),B;try{f=await $.refreshRetryTokenForRetry(f,G)}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)}},Wo=(D)=>typeof D.acquireInitialRetryToken!=="undefined"&&typeof D.refreshRetryTokenForRetry!=="undefined"&&typeof D.recordSuccess!=="undefined",Jo=(D)=>{const F={error:D,errorType:zo(D)},E=Ko(D.$response);if(E)F.retryAfterHint=E;return F},zo=(D)=>{if(g6(D))return"THROTTLING";if(iw(D))return"TRANSIENT";if(az(D))return"SERVER_ERROR";return"CLIENT_ERROR"},To,w1=(D)=>({applyToStack:(F)=>{F.add(Xo(D),To)}}),Ko=(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 VK=M(()=>{dD();B3();y();O0();e9();RK();To={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0}});var J2=M(()=>{$T();w5();BT();D5();hT();F5();VK()});var kK,h$="AWS_ACCESS_KEY_ID",U$="AWS_SECRET_ACCESS_KEY",bK="AWS_SESSION_TOKEN",xK="AWS_CREDENTIAL_EXPIRATION",cK="AWS_CREDENTIAL_SCOPE",gK="AWS_ACCOUNT_ID",L5=(D)=>async()=>{D?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");const F=process.env[h$],E=process.env[U$],w=process.env[bK],$=process.env[xK],C=process.env[cK],f=process.env[gK];if(F&&E){const B={accessKeyId:F,secretAccessKey:E,...w&&{sessionToken:w},...$&&{expiration:new Date($)},...C&&{credentialScope:C},...f&&{accountId:f}};return kK.setCredentialFeature(B,"CREDENTIALS_ENV_VARS","g"),B}throw new x("Unable to find environment variable credentials.",{logger:D?.logger})};var rK=M(()=>{kK=Q(C0(),1);$D()});var _K={};r0(_K,{fromEnv:()=>L5,ENV_SESSION:()=>bK,ENV_SECRET:()=>U$,ENV_KEY:()=>h$,ENV_EXPIRATION:()=>xK,ENV_CREDENTIAL_SCOPE:()=>cK,ENV_ACCOUNT_ID:()=>gK});var R5=M(()=>{rK()});import{Buffer as Ho}from"buffer";import{request as Lo}from"http";function W8(D){return new Promise((F,E)=>{const w=Lo({method:"GET",...D,hostname:D.hostname?.replace(/^\[(.+)\]$/,"$1")});w.on("error",($)=>{E(Object.assign(new l0("Unable to connect to instance metadata service"),$)),w.destroy()}),w.on("timeout",()=>{E(new l0("TimeoutError from instance metadata service")),w.destroy()}),w.on("response",($)=>{const{statusCode:C=400}=$;if(C<200||300<=C)E(Object.assign(new l0("Error response received from instance metadata service"),{statusCode:C})),w.destroy();const f=[];$.on("data",(B)=>{f.push(B)}),$.on("end",()=>{F(Ho.concat(f)),w.destroy()})}),w.end()})}var A$=M(()=>{$D()});var I$=(D)=>Boolean(D)&&typeof D==="object"&&typeof D.AccessKeyId==="string"&&typeof D.SecretAccessKey==="string"&&typeof D.Token==="string"&&typeof D.Expiration==="string",G$=(D)=>({accessKeyId:D.AccessKeyId,secretAccessKey:D.SecretAccessKey,sessionToken:D.Token,expiration:new Date(D.Expiration),...D.AccountId&&{accountId:D.AccountId}});var Ro=1000,Vo=0,G3=({maxRetries:D=0,timeout:F=1000})=>({maxRetries:D,timeout:F});var M3=(D,F)=>{let E=D();for(let w=0;w<F;w++)E=E.catch(D);return E};import{parse as No}from"url";var M$="AWS_CONTAINER_CREDENTIALS_FULL_URI",Y$="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",V5="AWS_CONTAINER_AUTHORIZATION_TOKEN",qo=(D={})=>{const{timeout:F,maxRetries:E}=G3(D);return()=>M3(async()=>{const w=await ko({logger:D.logger}),$=JSON.parse(await Oo(F,w));if(!I$($))throw new x("Invalid response received from instance metadata service.",{logger:D.logger});return G$($)},E)},Oo=async(D,F)=>{if(process.env[V5])F.headers={...F.headers,Authorization:process.env[V5]};return(await W8({...F,timeout:D})).toString()},jo="169.254.170.2",Po,yo,ko=async({logger:D})=>{if(process.env[Y$])return{hostname:jo,path:process.env[Y$]};if(process.env[M$]){const F=No(process.env[M$]);if(!F.hostname||!(F.hostname in Po))throw new x(`${F.hostname} is not a valid container metadata service hostname`,{tryNextLink:!1,logger:D});if(!F.protocol||!(F.protocol in yo))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 ${Y$} or ${M$} environment variable is set`,{tryNextLink:!1,logger:D})};var sK=M(()=>{$D();A$();Po={localhost:!0,"127.0.0.1":!0},yo={"http:":!0,"https:":!0}});var Z$;var uK=M(()=>{$D();Z$=class Z$ extends x{constructor(D,F=!0){super(D,F);this.tryNextLink=F,this.name="InstanceMetadataV1FallbackError",Object.setPrototypeOf(this,Z$.prototype)}}});var f6;var N5=M(()=>{(function(D){D.IPv4="http://169.254.169.254",D.IPv6="http://[fd00:ec2::254]"})(f6||(f6={}))});var dK;var vK=M(()=>{dK={environmentVariableSelector:(D)=>D.AWS_EC2_METADATA_SERVICE_ENDPOINT,configFileSelector:(D)=>D.ec2_metadata_service_endpoint,default:void 0}});var J8;var q5=M(()=>{(function(D){D.IPv4="IPv4",D.IPv6="IPv6"})(J8||(J8={}))});var bo="AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE",xo="ec2_metadata_service_endpoint_mode",mK;var nK=M(()=>{q5();mK={environmentVariableSelector:(D)=>D[bo],configFileSelector:(D)=>D[xo],default:J8.IPv4}});var X$=async()=>eD(await co()||await go()),co=async()=>i(dK)(),go=async()=>{const D=await i(mK)();switch(D){case J8.IPv4:return f6.IPv4;case J8.IPv6:return f6.IPv6;default:throw new Error(`Unsupported endpoint mode: ${D}. Select from ${Object.values(J8)}`)}};var O5=M(()=>{v2();M8();N5();vK();q5();nK()});var j5=(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 lK=(D,F={})=>{const E=F?.logger||console;let w;return async()=>{let $;try{if($=await D(),$.expiration&&$.expiration.getTime()<Date.now())$=j5($,E)}catch(C){if(w)E.warn("Credential renew failed: ",C),$=j5(w,E);else throw C}return w=$,$}};var iK=()=>{};var oK="/latest/meta-data/iam/security-credentials/",ro="/latest/api/token",P5="AWS_EC2_METADATA_V1_DISABLED",pK="ec2_metadata_v1_disabled",aK="x-aws-ec2-metadata-token",_o=(D={})=>lK(so(D),{logger:D.logger}),so=(D={})=>{let F=!1;const{logger:E,profile:w}=D,{timeout:$,maxRetries:C}=G3(D),f=async(B,h)=>{if(F||h.headers?.[aK]==null){let A=!1,Y=!1;const G=await i({environmentVariableSelector:(Z)=>{const z=Z[P5];if(Y=!!z&&z!=="false",z===void 0)throw new x(`${P5} not set in env, checking config file next.`,{logger:D.logger});return Y},configFileSelector:(Z)=>{const z=Z[pK];return A=!!z&&z!=="false",A},default:!1},{profile:w})();if(D.ec2MetadataV1Disabled||G){const Z=[];if(D.ec2MetadataV1Disabled)Z.push("credential provider initialization (runtime option ec2MetadataV1Disabled)");if(A)Z.push(`config file profile (${pK})`);if(Y)Z.push(`process environment variable (${P5})`);throw new Z$(`AWS EC2 Metadata v1 fallback has been blocked by AWS SDK configuration in the following: [${Z.join(", ")}].`)}}const I=(await M3(async()=>{let A;try{A=await vo(h)}catch(Y){if(Y.statusCode===401)F=!1;throw Y}return A},B)).trim();return M3(async()=>{let A;try{A=await mo(I,h,D)}catch(Y){if(Y.statusCode===401)F=!1;throw Y}return A},B)};return async()=>{const B=await X$();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 uo({...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:{[aK]:h},timeout:$})}}},uo=async(D)=>W8({...D,path:ro,method:"PUT",headers:{"x-aws-ec2-metadata-token-ttl-seconds":"21600"}}),vo=async(D)=>(await W8({...D,path:oK})).toString(),mo=async(D,F,E)=>{const w=JSON.parse((await W8({...F,path:oK+D})).toString());if(!I$(w))throw new x("Invalid response received from instance metadata service.",{logger:E.logger});return G$(w)};var tK=M(()=>{v2();$D();uK();A$();O5();iK()});var eK=()=>{};var Y3={};r0(Y3,{providerConfigFromInit:()=>G3,httpRequest:()=>W8,getInstanceMetadataEndpoint:()=>X$,fromInstanceMetadata:()=>_o,fromContainerMetadata:()=>qo,Endpoint:()=>f6,ENV_CMDS_RELATIVE_URI:()=>Y$,ENV_CMDS_FULL_URI:()=>M$,ENV_CMDS_AUTH_TOKEN:()=>V5,DEFAULT_TIMEOUT:()=>Ro,DEFAULT_MAX_RETRIES:()=>Vo});var Z3=M(()=>{sK();tK();eK();A$();O5();N5()});var no="169.254.170.2",lo="169.254.170.23",io="[fd00:ec2::23]",DS=(D,F)=>{if(D.protocol==="https:")return;if(D.hostname===no||D.hostname===lo||D.hostname===io)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 FS=M(()=>{$D()});function ES(D){return new gD({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 wS(D,F){const w=await aT(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:AK($.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 $S=M(()=>{$D();dD();y();Z5()});var fS=(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 po from"fs/promises";var CS,ao="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",oo="http://169.254.170.2",to="AWS_CONTAINER_CREDENTIALS_FULL_URI",eo="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",Dt="AWS_CONTAINER_AUTHORIZATION_TOKEN",BS=(D={})=>{D.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let F;const E=D.awsContainerCredentialsRelativeUri??process.env[ao],w=D.awsContainerCredentialsFullUri??process.env[to],$=D.awsContainerAuthorizationToken??process.env[Dt],C=D.awsContainerAuthorizationTokenFile??process.env[eo],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=`${oo}${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);DS(B,D.logger);const h=new h0({requestTimeout:D.timeout??1000,connectionTimeout:D.timeout??1000});return fS(async()=>{const U=ES(B);if($)U.headers.Authorization=$;else if(C)U.headers.Authorization=(await po.readFile(C)).toString();try{const I=await h.handle(U);return wS(I.response).then((A)=>CS.setCredentialFeature(A,"CREDENTIALS_HTTP","z"))}catch(I){throw new x(String(I),{logger:D.logger})}},D.maxRetries??3,D.timeout??1000)};var hS=M(()=>{CS=Q(C0(),1);Z8();$D();FS();$S()});var y5={};r0(y5,{fromHttp:()=>BS});var k5=M(()=>{hS()});var Ft="AWS_EC2_METADATA_DISABLED",US=async(D)=>{const{ENV_CMDS_FULL_URI:F,ENV_CMDS_RELATIVE_URI:E,fromContainerMetadata:w,fromInstanceMetadata:$}=await Promise.resolve().then(() => (Z3(),Y3));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(() => (k5(),y5));return N1(C(D),w(D))}if(process.env[Ft])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 AS=M(()=>{$D()});var b5=(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 IS=300000,v6="To refresh this SSO session run 'aws sso login' with the corresponding profile.";function Et(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}function x5(D){return{schemeId:"smithy.api#noAuth"}}var GS,MS=async(D,F,E)=>{return{operation:v0(F).operation,region:await _D(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},YS=(D)=>{const F=[];switch(D.operation){case"CreateToken":{F.push(x5(D));break}case"RegisterClient":{F.push(x5(D));break}case"StartDeviceAuthorization":{F.push(x5(D));break}default:F.push(Et(D))}return F},ZS=(D)=>{return{...GS.resolveAwsSdkSigV4Config(D)}};var c5=M(()=>{GS=Q(jD(),1);Z2()});var XS=(D)=>{return{...D,useDualstackEndpoint:D.useDualstackEndpoint??!1,useFipsEndpoint:D.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},z8;var m6=M(()=>{z8={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var JS;var WS=M(()=>{JS={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 g5;var r5=M(()=>{g5={isCrtAvailable:!1}});var zS=()=>{if(g5.isCrtAvailable)return["md/crt-avail"];return null};var TS=M(()=>{r5()});import{platform as $t,release as ft}from"os";import{env as KS,versions as Ct}from"process";var Bt=({serviceId:D,clientVersion:F})=>{return async(E)=>{const w=[["aws-sdk-js",F],["ua","2.1"],[`os/${$t()}`,ft()],["lang/js"],["md/nodejs",`${Ct.node}`]],$=zS();if($)w.push($);if(D)w.push([`api/${D}`,F]);if(KS.AWS_EXECUTION_ENV)w.push([`exec-env/${KS.AWS_EXECUTION_ENV}`]);const C=await E?.userAgentAppId?.();return C?[...w,[`app/${C}`]]:[...w]}},$1;var SS=M(()=>{TS();r5();$1=Bt});var ht="AWS_SDK_UA_APP_ID",Ut="sdk-ua-app-id",f1;var QS=M(()=>{o8();f1={environmentVariableSelector:(D)=>D[ht],configFileSelector:(D)=>D[Ut],default:D9}});var n6=M(()=>{SS();QS()});import{Buffer as At}from"buffer";import{createHash as It,createHmac as Gt}from"crypto";function HS(D,F){if(At.isBuffer(D))return D;if(typeof D==="string")return s6(D,F);if(ArrayBuffer.isView(D))return q1(D.buffer,D.byteOffset,D.byteLength);return q1(D)}class z2{constructor(D,F){this.algorithmIdentifier=D,this.secret=F,this.reset()}update(D,F){this.hash.update(ZT(HS(D,F)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?Gt(this.algorithmIdentifier,HS(this.secret)):It(this.algorithmIdentifier)}}var l6=M(()=>{E6();a2()});import{fstatSync as Mt,lstatSync as Yt}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 Yt(D.path).size;else if(typeof D.fd==="number")return Mt(D.fd).size;throw new Error(`Body Length computation failed for ${D}`)};var LS=()=>{};var i6=M(()=>{LS()});var RS,VS,NS,kS,bS,D2,qS,xS,OS,jS,PS,yS,Zt,cS;var gS=M(()=>{RS={["required"]:!1,type:"String"},VS={["required"]:!0,default:!1,type:"Boolean"},NS={["ref"]:"Endpoint"},kS={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},bS={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},D2={},qS={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},xS={["ref"]:"PartitionResult"},OS={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[xS,"supportsDualStack"]}]},jS=[kS],PS=[bS],yS=[{["ref"]:"Region"}],Zt={version:"1.0",parameters:{Region:RS,UseDualStack:VS,UseFIPS:VS,Endpoint:RS},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[NS]}],rules:[{conditions:jS,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:PS,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:NS,properties:D2,headers:D2},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:yS}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:yS,assign:"PartitionResult"}],rules:[{conditions:[kS,bS],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,qS]},OS],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:D2,headers:D2},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:jS,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[qS,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[xS,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:D2,headers:D2},type:"endpoint"},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:D2,headers:D2},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:PS,rules:[{conditions:[OS],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:D2,headers:D2},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:D2,headers:D2},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},cS=Zt});var Xt,rS=(D,F={})=>{return Xt.get(D,()=>G2(cS,{endpointParams:D,logger:F.logger}))};var _S=M(()=>{i8();M2();gS();Xt=new I2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]});f0.aws=Y2});var sS,uS,dS=(D)=>{return{apiVersion:"2019-06-10",base64Decoder:D?.base64Decoder??z0,base64Encoder:D?.base64Encoder??K0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??rS,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??YS,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new sS.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(F)=>F.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new uS.NoAuthSigner}],logger:D?.logger??new P0,serviceId:D?.serviceId??"SSO OIDC",urlParser:D?.urlParser??eD,utf8Decoder:D?.utf8Decoder??D0,utf8Encoder:D?.utf8Encoder??T0}};var vS=M(()=>{sS=Q(jD(),1),uS=Q(rD(),1);y();M8();O1();a2();c5();_S()});var mS="AWS_EXECUTION_ENV",_5="AWS_REGION",s5="AWS_DEFAULT_REGION",nS="AWS_EC2_METADATA_DISABLED",lS,iS="/latest/meta-data/placement/region";var pS=M(()=>{lS=["in-region","cross-region","mobile","standard","legacy"]});var aS;var oS=M(()=>{aS={environmentVariableSelector:(D)=>{return D.AWS_DEFAULTS_MODE},configFileSelector:(D)=>{return D.defaults_mode},default:"legacy"}});var B1=({region:D=i(m0),defaultsMode:F=i(aS)}={})=>t8(async()=>{const E=typeof F==="function"?await F():F;switch(E?.toLowerCase()){case"auto":return Wt(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 ${lS.join(", ")}, got ${E}`)}}),Wt=async(D)=>{if(D){const F=typeof D==="function"?await D():D,E=await Jt();if(!E)return"standard";if(F===E)return"in-region";else return"cross-region"}return"standard"},Jt=async()=>{if(process.env[mS]&&(process.env[_5]||process.env[s5]))return process.env[_5]??process.env[s5];if(!process.env[nS])try{const{getInstanceMetadataEndpoint:D,httpRequest:F}=await Promise.resolve().then(() => (Z3(),Y3)),E=await D();return(await F({...E,path:iS})).toString()}catch(D){}};var tS=M(()=>{n0();v2();$D();pS();oS()});var p6=M(()=>{tS()});var eS,DQ=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=dS(D);return eS.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,credentialDefaultProvider:D?.credentialDefaultProvider??T2,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:JS.version}),maxAttempts:D?.maxAttempts??i(l2),region:D?.region??i(m0,s2),requestHandler:h0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...p2,default:async()=>(await E()).retryMode||o0}),sha256:D?.sha256??z2.bind(null,"sha256"),streamCollector:D?.streamCollector??t0,useDualstackEndpoint:D?.useDualstackEndpoint??i(r2),useFipsEndpoint:D?.useFipsEndpoint??i(_2),userAgentAppId:D?.userAgentAppId??i(f1)}};var FQ=M(()=>{WS();eS=Q(jD(),1);a6();n6();n0();l6();J2();v2();Z8();i6();O0();vS();y();p6();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 EQ=()=>{};var wQ=()=>{};var $Q=M(()=>{wQ()});var fQ=M(()=>{EQ();$Q()});var o6=M(()=>{fQ()});var CQ=(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}}},BQ=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var W$=(D)=>D,hQ=(D,F)=>{const E={...W$(h1(D)),...W$(F1(D)),...W$(O2(D)),...W$(CQ(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...j2(E),...BQ(E)}};var UQ=M(()=>{o6();dD();y()});var t6,J$;var u5=M(()=>{z6();T6();K6();o8();n0();t6=Q(rD(),1);b6();UD();J2();y();c5();m6();FQ();UQ();J$=class J$ extends j0{constructor(...[D]){const F=DQ(D||{}),E=XS(F),w=c2(E),$=i2(w),C=u2($),f=P2(C),B=m2(f),h=ZS(B),U=hQ(h,D?.extensions||[]);super(U);this.config=U,this.middlewareStack.use(g2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(d2(this.config)),this.middlewareStack.use(y2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(t6.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:MS,identityProviderConfigProvider:async(I)=>new t6.DefaultIdentityProviderConfig({"aws.auth#sigv4":I.credentials})})),this.middlewareStack.use(t6.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}});var kD;var z$=M(()=>{y();kD=class kD extends e0{constructor(D){super(D);Object.setPrototypeOf(this,kD.prototype)}}});var X3,W3,J3,z3,T3,K3,S3,Q3,H3,L3,R3,V3,N3,q3,d5=(D)=>({...D,...D.clientSecret&&{clientSecret:ED},...D.refreshToken&&{refreshToken:ED},...D.codeVerifier&&{codeVerifier:ED}}),v5=(D)=>({...D,...D.accessToken&&{accessToken:ED},...D.refreshToken&&{refreshToken:ED},...D.idToken&&{idToken:ED}}),m5=(D)=>({...D,...D.refreshToken&&{refreshToken:ED},...D.assertion&&{assertion:ED},...D.subjectToken&&{subjectToken:ED},...D.codeVerifier&&{codeVerifier:ED}}),n5=(D)=>({...D,...D.accessToken&&{accessToken:ED},...D.refreshToken&&{refreshToken:ED},...D.idToken&&{idToken:ED}}),l5=(D)=>({...D,...D.clientSecret&&{clientSecret:ED}}),i5=(D)=>({...D,...D.clientSecret&&{clientSecret:ED}});var C6=M(()=>{y();z$();X3=class X3 extends kD{constructor(D){super({name:"AccessDeniedException",$fault:"client",...D});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,X3.prototype),this.error=D.error,this.error_description=D.error_description}};W3=class W3 extends kD{constructor(D){super({name:"AuthorizationPendingException",$fault:"client",...D});this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,W3.prototype),this.error=D.error,this.error_description=D.error_description}};J3=class J3 extends kD{constructor(D){super({name:"ExpiredTokenException",$fault:"client",...D});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,J3.prototype),this.error=D.error,this.error_description=D.error_description}};z3=class z3 extends kD{constructor(D){super({name:"InternalServerException",$fault:"server",...D});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,z3.prototype),this.error=D.error,this.error_description=D.error_description}};T3=class T3 extends kD{constructor(D){super({name:"InvalidClientException",$fault:"client",...D});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,T3.prototype),this.error=D.error,this.error_description=D.error_description}};K3=class K3 extends kD{constructor(D){super({name:"InvalidGrantException",$fault:"client",...D});this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,K3.prototype),this.error=D.error,this.error_description=D.error_description}};S3=class S3 extends kD{constructor(D){super({name:"InvalidRequestException",$fault:"client",...D});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,S3.prototype),this.error=D.error,this.error_description=D.error_description}};Q3=class Q3 extends kD{constructor(D){super({name:"InvalidScopeException",$fault:"client",...D});this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,Q3.prototype),this.error=D.error,this.error_description=D.error_description}};H3=class H3 extends kD{constructor(D){super({name:"SlowDownException",$fault:"client",...D});this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,H3.prototype),this.error=D.error,this.error_description=D.error_description}};L3=class L3 extends kD{constructor(D){super({name:"UnauthorizedClientException",$fault:"client",...D});this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,L3.prototype),this.error=D.error,this.error_description=D.error_description}};R3=class R3 extends kD{constructor(D){super({name:"UnsupportedGrantTypeException",$fault:"client",...D});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,R3.prototype),this.error=D.error,this.error_description=D.error_description}};V3=class V3 extends kD{constructor(D){super({name:"InvalidRequestRegionException",$fault:"client",...D});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,V3.prototype),this.error=D.error,this.error_description=D.error_description,this.endpoint=D.endpoint,this.region=D.region}};N3=class N3 extends kD{constructor(D){super({name:"InvalidClientMetadataException",$fault:"client",...D});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,N3.prototype),this.error=D.error,this.error_description=D.error_description}};q3=class q3 extends kD{constructor(D){super({name:"InvalidRedirectUriException",$fault:"client",...D});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,q3.prototype),this.error=D.error,this.error_description=D.error_description}}});var P1,O3,AQ=async(D,F)=>{const E=O3.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)=>CD(C)})),E.m("POST").h(w).b($),E.build()},IQ=async(D,F)=>{const E=O3.requestBuilder(D,F),w={"content-type":"application/json"};E.bp("/token");const $=k({[bt]:[,"t"]});let C;return C=JSON.stringify(c(D,{assertion:[],clientId:[],code:[],codeVerifier:[],grantType:[],redirectUri:[],refreshToken:[],requestedTokenType:[],scope:(f)=>CD(f),subjectToken:[],subjectTokenType:[]})),E.m("POST").h(w).q($).b(C),E.build()},GQ=async(D,F)=>{const E=O3.requestBuilder(D,F),w={"content-type":"application/json"};E.bp("/client/register");let $;return $=JSON.stringify(c(D,{clientName:[],clientType:[],entitledApplicationArn:[],grantTypes:(C)=>CD(C),issuerUrl:[],redirectUris:(C)=>CD(C),scopes:(C)=>CD(C)})),E.m("POST").h(w).b($),E.build()},MQ=async(D,F)=>{const E=O3.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()},YQ=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return T$(D,F);const E=k({$metadata:mD(D)}),w=PD(S0(await P1.parseJsonBody(D.body,F)),"body"),$=c(w,{accessToken:S,expiresIn:W2,idToken:S,refreshToken:S,tokenType:S});return Object.assign(E,$),E},ZQ=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return T$(D,F);const E=k({$metadata:mD(D)}),w=PD(S0(await P1.parseJsonBody(D.body,F)),"body"),$=c(w,{accessToken:S,expiresIn:W2,idToken:S,issuedTokenType:S,refreshToken:S,scope:CD,tokenType:S});return Object.assign(E,$),E},XQ=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return T$(D,F);const E=k({$metadata:mD(D)}),w=PD(S0(await P1.parseJsonBody(D.body,F)),"body"),$=c(w,{authorizationEndpoint:S,clientId:S,clientIdIssuedAt:$$,clientSecret:S,clientSecretExpiresAt:$$,tokenEndpoint:S});return Object.assign(E,$),E},WQ=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return T$(D,F);const E=k({$metadata:mD(D)}),w=PD(S0(await P1.parseJsonBody(D.body,F)),"body"),$=c(w,{deviceCode:S,expiresIn:W2,interval:W2,userCode:S,verificationUri:S,verificationUriComplete:S});return Object.assign(E,$),E},T$=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 Kt(E,F);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await St(E,F);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Qt(E,F);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Ht(E,F);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Lt(E,F);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await Vt(E,F);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await qt(E,F);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await jt(E,F);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await Pt(E,F);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await yt(E,F);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await kt(E,F);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await Ot(E,F);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await Rt(E,F);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await Nt(E,F);default:const $=E.body;return Tt({output:D,parsedBody:$,errorCode:w})}},Tt,Kt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new X3({$metadata:mD(D),...E});return u(C,D.body)},St=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new W3({$metadata:mD(D),...E});return u(C,D.body)},Qt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new J3({$metadata:mD(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 z3({$metadata:mD(D),...E});return u(C,D.body)},Lt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new T3({$metadata:mD(D),...E});return u(C,D.body)},Rt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new N3({$metadata:mD(D),...E});return u(C,D.body)},Vt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new K3({$metadata:mD(D),...E});return u(C,D.body)},Nt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new q3({$metadata:mD(D),...E});return u(C,D.body)},qt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new S3({$metadata:mD(D),...E});return u(C,D.body)},Ot=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 V3({$metadata:mD(D),...E});return u(C,D.body)},jt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new Q3({$metadata:mD(D),...E});return u(C,D.body)},Pt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new H3({$metadata:mD(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:mD(D),...E});return u(C,D.body)},kt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{error:S,error_description:S});Object.assign(E,$);const C=new R3({$metadata:mD(D),...E});return u(C,D.body)},mD=(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"]}),bt="aws_iam";var j3=M(()=>{P1=Q(jD(),1),O3=Q(rD(),1);y();C6();z$();Tt=t2(kD)});var JQ,K$;var p5=M(()=>{UD();JQ=Q(YD(),1);y();m6();C6();j3();K$=class K$ extends l.classBuilder().ep(z8).m(function(D,F,E,w){return[JQ.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(d5,v5).ser(AQ).de(YQ).build(){}});var zQ,S$;var a5=M(()=>{UD();zQ=Q(YD(),1);y();m6();C6();j3();S$=class S$ extends l.classBuilder().ep(z8).m(function(D,F,E,w){return[zQ.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(m5,n5).ser(IQ).de(ZQ).build(){}});var TQ,Q$;var o5=M(()=>{UD();TQ=Q(YD(),1);y();m6();C6();j3();Q$=class Q$ extends l.classBuilder().ep(z8).m(function(D,F,E,w){return[TQ.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,l5).ser(GQ).de(XQ).build(){}});var KQ,H$;var t5=M(()=>{UD();KQ=Q(YD(),1);y();m6();C6();j3();H$=class H$ extends l.classBuilder().ep(z8).m(function(D,F,E,w){return[KQ.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(i5,void 0).ser(MQ).de(WQ).build(){}});var xt,e5;var SQ=M(()=>{y();p5();a5();o5();t5();u5();xt={CreateTokenCommand:K$,CreateTokenWithIAMCommand:S$,RegisterClientCommand:Q$,StartDeviceAuthorizationCommand:H$};e5=class e5 extends J${};u6(xt,e5)});var QQ=M(()=>{p5();a5();o5();t5()});var HQ=M(()=>{C6()});var DC={};r0(DC,{__Client:()=>j0,UnsupportedGrantTypeException:()=>R3,UnauthorizedClientException:()=>L3,StartDeviceAuthorizationRequestFilterSensitiveLog:()=>i5,StartDeviceAuthorizationCommand:()=>H$,SlowDownException:()=>H3,SSOOIDCServiceException:()=>kD,SSOOIDCClient:()=>J$,SSOOIDC:()=>e5,RegisterClientResponseFilterSensitiveLog:()=>l5,RegisterClientCommand:()=>Q$,InvalidScopeException:()=>Q3,InvalidRequestRegionException:()=>V3,InvalidRequestException:()=>S3,InvalidRedirectUriException:()=>q3,InvalidGrantException:()=>K3,InvalidClientMetadataException:()=>N3,InvalidClientException:()=>T3,InternalServerException:()=>z3,ExpiredTokenException:()=>J3,CreateTokenWithIAMResponseFilterSensitiveLog:()=>n5,CreateTokenWithIAMRequestFilterSensitiveLog:()=>m5,CreateTokenWithIAMCommand:()=>S$,CreateTokenResponseFilterSensitiveLog:()=>v5,CreateTokenRequestFilterSensitiveLog:()=>d5,CreateTokenCommand:()=>K$,AuthorizationPendingException:()=>W3,AccessDeniedException:()=>X3,$Command:()=>l});var FC=M(()=>{u5();SQ();QQ();HQ();z$()});var EC,LQ=async(D)=>{const{SSOOIDCClient:F}=await Promise.resolve().then(() => (FC(),DC));if(EC[D])return EC[D];const E=new F({region:D});return EC[D]=E,E};var RQ=M(()=>{EC={}});var VQ=async(D,F)=>{const{CreateTokenCommand:E}=await Promise.resolve().then(() => (FC(),DC));return(await LQ(F)).send(new E({clientId:D.clientId,clientSecret:D.clientSecret,refreshToken:D.refreshToken,grantType:"refresh_token"}))};var NQ=M(()=>{RQ()});var wC=(D)=>{if(D.expiration&&D.expiration.getTime()<Date.now())throw new J0(`Token is expired. ${v6}`,!1)};var qQ=M(()=>{$D()});var T8=(D,F,E=!1)=>{if(typeof F==="undefined")throw new J0(`Value not present for '${D}' in SSO Token${E?". Cannot refresh":""}. ${v6}`,!1)};var OQ=M(()=>{$D()});import{promises as ct}from"fs";var gt,jQ=(D,F)=>{const E=rw(D),w=JSON.stringify(F,null,2);return gt(E,w)};var PQ=M(()=>{X2();({writeFile:gt}=ct)});var yQ,kQ=(D={})=>async()=>{D.logger?.debug("@aws-sdk/token-providers - fromSso");const F=await G8(D),E=i0(D),w=F[E];if(!w)throw new J0(`Profile '${E}' could not be found in shared credentials file.`,!1);else if(!w.sso_session)throw new J0(`Profile '${E}' is missing required property 'sso_session'.`);const $=w.sso_session,f=(await dw(D))[$];if(!f)throw new J0(`Sso session '${$}' could not be found in shared credentials file.`,!1);for(let G of["sso_start_url","sso_region"])if(!f[G])throw new J0(`Sso session '${$}' is missing required property '${G}'.`,!1);const{sso_start_url:B,sso_region:h}=f;let U;try{U=await _w($)}catch(G){throw new J0(`The SSO session token associated with profile=${E} was not found or is invalid. ${v6}`,!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()>IS)return Y;if(Date.now()-yQ.getTime()<30000)return wC(Y),Y;T8("clientId",U.clientId,!0),T8("clientSecret",U.clientSecret,!0),T8("refreshToken",U.refreshToken,!0);try{yQ.setTime(Date.now());const G=await VQ(U,h);T8("accessToken",G.accessToken),T8("expiresIn",G.expiresIn);const Z=new Date(Date.now()+G.expiresIn*1000);try{await jQ($,{...U,accessToken:G.accessToken,expiresAt:Z.toISOString(),refreshToken:G.refreshToken})}catch(z){}return{token:G.accessToken,expiration:Z}}catch(G){return wC(Y),Y}};var bQ=M(()=>{$D();X2();NQ();qQ();OQ();PQ();yQ=new Date(0)});var xQ=M(()=>{$D()});var cQ=M(()=>{$D()});var gQ=M(()=>{bQ();xQ();cQ()});function rt(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}function L$(D){return{schemeId:"smithy.api#noAuth"}}var rQ,_Q=async(D,F,E)=>{return{operation:v0(F).operation,region:await _D(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},sQ=(D)=>{const F=[];switch(D.operation){case"GetRoleCredentials":{F.push(L$(D));break}case"ListAccountRoles":{F.push(L$(D));break}case"ListAccounts":{F.push(L$(D));break}case"Logout":{F.push(L$(D));break}default:F.push(rt(D))}return F},uQ=(D)=>{return{...rQ.resolveAwsSdkSigV4Config(D)}};var $C=M(()=>{rQ=Q(jD(),1);Z2()});var dQ=(D)=>{return{...D,useDualstackEndpoint:D.useDualstackEndpoint??!1,useFipsEndpoint:D.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},K8;var e6=M(()=>{K8={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var mQ;var vQ=M(()=>{mQ={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 nQ,lQ,iQ,DH,FH,F2,pQ,EH,aQ,oQ,tQ,eQ,st,wH;var $H=M(()=>{nQ={["required"]:!1,type:"String"},lQ={["required"]:!0,default:!1,type:"Boolean"},iQ={["ref"]:"Endpoint"},DH={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},FH={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},F2={},pQ={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},EH={["ref"]:"PartitionResult"},aQ={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[EH,"supportsDualStack"]}]},oQ=[DH],tQ=[FH],eQ=[{["ref"]:"Region"}],st={version:"1.0",parameters:{Region:nQ,UseDualStack:lQ,UseFIPS:lQ,Endpoint:nQ},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[iQ]}],rules:[{conditions:oQ,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:tQ,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:iQ,properties:F2,headers:F2},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:eQ}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:eQ,assign:"PartitionResult"}],rules:[{conditions:[DH,FH],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,pQ]},aQ],rules:[{endpoint:{url:"https://portal.sso-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:oQ,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[pQ,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[EH,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:F2,headers:F2},type:"endpoint"},{endpoint:{url:"https://portal.sso-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:tQ,rules:[{conditions:[aQ],rules:[{endpoint:{url:"https://portal.sso.{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://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:F2,headers:F2},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},wH=st});var ut,fH=(D,F={})=>{return ut.get(D,()=>G2(wH,{endpointParams:D,logger:F.logger}))};var CH=M(()=>{i8();M2();$H();ut=new I2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]});f0.aws=Y2});var BH,hH,UH=(D)=>{return{apiVersion:"2019-06-10",base64Decoder:D?.base64Decoder??z0,base64Encoder:D?.base64Encoder??K0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??fH,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??sQ,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new BH.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(F)=>F.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new hH.NoAuthSigner}],logger:D?.logger??new P0,serviceId:D?.serviceId??"SSO",urlParser:D?.urlParser??eD,utf8Decoder:D?.utf8Decoder??D0,utf8Encoder:D?.utf8Encoder??T0}};var AH=M(()=>{BH=Q(jD(),1),hH=Q(rD(),1);y();M8();O1();a2();$C();CH()});var IH,GH=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=UH(D);return IH.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:mQ.version}),maxAttempts:D?.maxAttempts??i(l2),region:D?.region??i(m0,s2),requestHandler:h0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...p2,default:async()=>(await E()).retryMode||o0}),sha256:D?.sha256??z2.bind(null,"sha256"),streamCollector:D?.streamCollector??t0,useDualstackEndpoint:D?.useDualstackEndpoint??i(r2),useFipsEndpoint:D?.useFipsEndpoint??i(_2),userAgentAppId:D?.userAgentAppId??i(f1)}};var MH=M(()=>{vQ();IH=Q(jD(),1);n6();n0();l6();J2();v2();Z8();i6();O0();AH();y();p6();y()});var YH=(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}}},ZH=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var R$=(D)=>D,XH=(D,F)=>{const E={...R$(h1(D)),...R$(F1(D)),...R$(O2(D)),...R$(YH(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...j2(E),...ZH(E)}};var WH=M(()=>{o6();dD();y()});var DF,y1;var P3=M(()=>{z6();T6();K6();o8();n0();DF=Q(rD(),1);b6();UD();J2();y();$C();e6();MH();WH();y1=class y1 extends j0{constructor(...[D]){const F=GH(D||{}),E=dQ(F),w=c2(E),$=i2(w),C=u2($),f=P2(C),B=m2(f),h=uQ(B),U=XH(h,D?.extensions||[]);super(U);this.config=U,this.middlewareStack.use(g2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(d2(this.config)),this.middlewareStack.use(y2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(DF.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:_Q,identityProviderConfigProvider:async(I)=>new DF.DefaultIdentityProviderConfig({"aws.auth#sigv4":I.credentials})})),this.middlewareStack.use(DF.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}});var k1;var fC=M(()=>{y();k1=class k1 extends e0{constructor(D){super(D);Object.setPrototypeOf(this,k1.prototype)}}});var V$,N$,q$,O$,JH=(D)=>({...D,...D.accessToken&&{accessToken:ED}}),dt=(D)=>({...D,...D.secretAccessKey&&{secretAccessKey:ED},...D.sessionToken&&{sessionToken:ED}}),zH=(D)=>({...D,...D.roleCredentials&&{roleCredentials:dt(D.roleCredentials)}}),TH=(D)=>({...D,...D.accessToken&&{accessToken:ED}}),KH=(D)=>({...D,...D.accessToken&&{accessToken:ED}}),SH=(D)=>({...D,...D.accessToken&&{accessToken:ED}});var B6=M(()=>{y();fC();V$=class V$ extends k1{constructor(D){super({name:"InvalidRequestException",$fault:"client",...D});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,V$.prototype)}};N$=class N$ extends k1{constructor(D){super({name:"ResourceNotFoundException",$fault:"client",...D});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,N$.prototype)}};q$=class q$ extends k1{constructor(D){super({name:"TooManyRequestsException",$fault:"client",...D});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,q$.prototype)}};O$=class O$ extends k1{constructor(D){super({name:"UnauthorizedException",$fault:"client",...D});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,O$.prototype)}}});var S8,y3,QH=async(D,F)=>{const E=y3.requestBuilder(D,F),w=k({},X8,{[y$]:D[P$]});E.bp("/federation/credentials");const $=k({[at]:[,PD(D[pt],"roleName")],[PH]:[,PD(D[jH],"accountId")]});let C;return E.m("GET").h(w).q($).b(C),E.build()},HH=async(D,F)=>{const E=y3.requestBuilder(D,F),w=k({},X8,{[y$]:D[P$]});E.bp("/assignment/roles");const $=k({[xH]:[,D[bH]],[kH]:[()=>D.maxResults!==void 0,()=>D[yH].toString()],[PH]:[,PD(D[jH],"accountId")]});let C;return E.m("GET").h(w).q($).b(C),E.build()},LH=async(D,F)=>{const E=y3.requestBuilder(D,F),w=k({},X8,{[y$]:D[P$]});E.bp("/assignment/accounts");const $=k({[xH]:[,D[bH]],[kH]:[()=>D.maxResults!==void 0,()=>D[yH].toString()]});let C;return E.m("GET").h(w).q($).b(C),E.build()},RH=async(D,F)=>{const E=y3.requestBuilder(D,F),w=k({},X8,{[y$]:D[P$]});E.bp("/logout");let $;return E.m("POST").h(w).b($),E.build()},VH=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return j$(D,F);const E=k({$metadata:Q8(D)}),w=PD(S0(await S8.parseJsonBody(D.body,F)),"body"),$=c(w,{roleCredentials:CD});return Object.assign(E,$),E},NH=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return j$(D,F);const E=k({$metadata:Q8(D)}),w=PD(S0(await S8.parseJsonBody(D.body,F)),"body"),$=c(w,{nextToken:S,roleList:CD});return Object.assign(E,$),E},qH=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return j$(D,F);const E=k({$metadata:Q8(D)}),w=PD(S0(await S8.parseJsonBody(D.body,F)),"body"),$=c(w,{accountList:CD,nextToken:S});return Object.assign(E,$),E},OH=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return j$(D,F);const E=k({$metadata:Q8(D)});return await w6(D.body,F),E},j$=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 mt(E,F);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await nt(E,F);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await lt(E,F);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await it(E,F);default:const $=E.body;return vt({output:D,parsedBody:$,errorCode:w})}},vt,mt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new V$({$metadata:Q8(D),...E});return u(C,D.body)},nt=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new N$({$metadata:Q8(D),...E});return u(C,D.body)},lt=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)},it=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)},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"]}),jH="accountId",P$="accessToken",PH="account_id",yH="maxResults",kH="max_result",bH="nextToken",xH="next_token",pt="roleName",at="role_name",y$="x-amz-sso_bearer_token";var k3=M(()=>{S8=Q(jD(),1),y3=Q(rD(),1);y();B6();fC();vt=t2(k1)});var cH,b3;var CC=M(()=>{UD();cH=Q(YD(),1);y();e6();B6();k3();b3=class b3 extends l.classBuilder().ep(K8).m(function(D,F,E,w){return[cH.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(JH,zH).ser(QH).de(VH).build(){}});var gH,x3;var k$=M(()=>{UD();gH=Q(YD(),1);y();e6();B6();k3();x3=class x3 extends l.classBuilder().ep(K8).m(function(D,F,E,w){return[gH.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("SWBPortalService","ListAccountRoles",{}).n("SSOClient","ListAccountRolesCommand").f(TH,void 0).ser(HH).de(NH).build(){}});var rH,c3;var b$=M(()=>{UD();rH=Q(YD(),1);y();e6();B6();k3();c3=class c3 extends l.classBuilder().ep(K8).m(function(D,F,E,w){return[rH.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("SWBPortalService","ListAccounts",{}).n("SSOClient","ListAccountsCommand").f(KH,void 0).ser(LH).de(qH).build(){}});var _H,BC;var hC=M(()=>{UD();_H=Q(YD(),1);y();e6();B6();k3();BC=class BC extends l.classBuilder().ep(K8).m(function(D,F,E,w){return[_H.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("SWBPortalService","Logout",{}).n("SSOClient","LogoutCommand").f(SH,void 0).ser(RH).de(OH).build(){}});var ot,sH;var uH=M(()=>{y();CC();k$();b$();hC();P3();ot={GetRoleCredentialsCommand:b3,ListAccountRolesCommand:x3,ListAccountsCommand:c3,LogoutCommand:BC};sH=class sH extends y1{};u6(ot,sH)});var dH=M(()=>{CC();k$();b$();hC()});var vH=()=>{};var mH,_KD;var nH=M(()=>{mH=Q(rD(),1);k$();P3();_KD=mH.createPaginator(y1,x3,"nextToken","nextToken","maxResults")});var lH,vKD;var iH=M(()=>{lH=Q(rD(),1);b$();P3();vKD=lH.createPaginator(y1,c3,"nextToken","nextToken","maxResults")});var pH=M(()=>{vH();nH();iH()});var aH=M(()=>{B6()});var oH=M(()=>{P3();uH();dH();pH();aH()});var tH={};r0(tH,{SSOClient:()=>y1,GetRoleCredentialsCommand:()=>b3});var eH=M(()=>{oH()});var UC,g3=!1,AC=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 wD=await kQ({profile:B})();U={accessToken:wD.token,expiresAt:new Date(wD.expiration).toISOString()}}catch(wD){throw new x(wD.message,{tryNextLink:g3,logger:h})}else try{U=await _w(D)}catch(wD){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:g3,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:g3,logger:h});const{accessToken:A}=U,{SSOClient:Y,GetRoleCredentialsCommand:G}=await Promise.resolve().then(() => (eH(),tH)),Z=C||new Y(Object.assign({},f??{},{region:f?.region??w}));let z;try{z=await Z.send(new G({accountId:E,roleName:$,accessToken:A}))}catch(wD){throw new x(wD,{tryNextLink:g3,logger:h})}const{roleCredentials:{accessKeyId:W,secretAccessKey:J,sessionToken:K,expiration:L,credentialScope:V,accountId:m}={}}=z;if(!W||!J||!K||!L)throw new x("SSO returns an invalid temporary credential.",{tryNextLink:g3,logger:h});const DD={accessKeyId:W,secretAccessKey:J,sessionToken:K,expiration:new Date(L),...V&&{credentialScope:V},...m&&{accountId:m}};if(F)UC.setCredentialFeature(DD,"CREDENTIALS_SSO","s");else UC.setCredentialFeature(DD,"CREDENTIALS_SSO_LEGACY","u");return DD};var DL=M(()=>{UC=Q(C0(),1);gQ();$D();X2()});var IC=(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=M(()=>{$D()});var tt=(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=i0(D);if(!F&&!E&&!w&&!$&&!C){const U=(await G8(D))[B];if(!U)throw new x(`Profile ${B} was not found.`,{logger:D.logger});if(!b5(U))throw new x(`Profile ${B} is not configured with SSO credentials.`,{logger:D.logger});if(U?.sso_session){const W=(await dw(D))[U.sso_session],J=` configurations in profile ${B} and sso-session ${U.sso_session}`;if(w&&w!==W.sso_region)throw new x("Conflicting SSO region"+J,{tryNextLink:!1,logger:D.logger});if(F&&F!==W.sso_start_url)throw new x("Conflicting SSO start_url"+J,{tryNextLink:!1,logger:D.logger});U.sso_region=W.sso_region,U.sso_start_url=W.sso_start_url}const{sso_start_url:I,sso_account_id:A,sso_region:Y,sso_role_name:G,sso_session:Z}=IC(U,D.logger);return AC({ssoStartUrl:I,ssoSession:Z,ssoAccountId:A,ssoRegion:Y,ssoRoleName:G,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 AC({ssoStartUrl:F,ssoSession:C,ssoAccountId:E,ssoRegion:w,ssoRoleName:$,ssoClient:f,clientConfig:D.clientConfig,profile:B})};var FL=M(()=>{$D();X2();DL();GC()});var EL=()=>{};var MC={};r0(MC,{validateSsoProfile:()=>IC,isSsoProfile:()=>b5,fromSSO:()=>tt});var YC=M(()=>{FL();EL();GC()});var wL,$L=(D,F,E)=>{const w={EcsContainer:async($)=>{const{fromHttp:C}=await Promise.resolve().then(() => (k5(),y5)),{fromContainerMetadata:f}=await Promise.resolve().then(() => (Z3(),Y3));return E?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),async()=>N1(C($??{}),f($))().then(ZC)},Ec2InstanceMetadata:async($)=>{E?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:C}=await Promise.resolve().then(() => (Z3(),Y3));return async()=>C($)().then(ZC)},Environment:async($)=>{E?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:C}=await Promise.resolve().then(() => (R5(),_K));return async()=>C($)().then(ZC)}};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})},ZC=(D)=>wL.setCredentialFeature(D,"CREDENTIALS_PROFILE_NAMED_PROVIDER","p");var fL=M(()=>{wL=Q(C0(),1);$D()});function et(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}function CL(D){return{schemeId:"smithy.api#noAuth"}}var BL,hL=async(D,F,E)=>{return{operation:v0(F).operation,region:await _D(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},UL=(D)=>{const F=[];switch(D.operation){case"AssumeRoleWithSAML":{F.push(CL(D));break}case"AssumeRoleWithWebIdentity":{F.push(CL(D));break}default:F.push(et(D))}return F},De=(D)=>({...D,stsClientCtor:b1}),AL=(D)=>{const F=De(D);return{...BL.resolveAwsSdkSigV4Config(F)}};var XC=M(()=>{BL=Q(jD(),1);Z2();r3()});var IL=(D)=>{return{...D,useDualstackEndpoint:D.useDualstackEndpoint??!1,useFipsEndpoint:D.useFipsEndpoint??!1,useGlobalEndpoint:D.useGlobalEndpoint??!1,defaultSigningName:"sts"}},F0;var A1=M(()=>{F0={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 ML;var GL=M(()=>{ML={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 YL,WC,QL,ZL,aD,XL,HL,LL,E0,y0,WL,RL,VL,JL,NL,zL,TL,KL,SL,Ee,qL;var OL=M(()=>{YL={["required"]:!1,["type"]:"String"},WC={["required"]:!0,default:!1,["type"]:"Boolean"},QL={["ref"]:"Endpoint"},ZL={["fn"]:"isSet",["argv"]:[{["ref"]:"Region"}]},aD={["ref"]:"Region"},XL={["fn"]:"aws.partition",["argv"]:[aD],assign:"PartitionResult"},HL={["ref"]:"UseFIPS"},LL={["ref"]:"UseDualStack"},E0={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"us-east-1"}]},headers:{}},y0={},WL={conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"aws-global"]}],["endpoint"]:E0,["type"]:"endpoint"},RL={["fn"]:"booleanEquals",["argv"]:[HL,!0]},VL={["fn"]:"booleanEquals",["argv"]:[LL,!0]},JL={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},NL={["ref"]:"PartitionResult"},zL={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[NL,"supportsDualStack"]}]},TL=[{["fn"]:"isSet",["argv"]:[QL]}],KL=[RL],SL=[VL],Ee={version:"1.0",parameters:{Region:YL,UseDualStack:WC,UseFIPS:WC,Endpoint:YL,UseGlobalEndpoint:WC},rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},{["fn"]:"not",["argv"]:TL},ZL,XL,{["fn"]:"booleanEquals",["argv"]:[HL,!1]},{["fn"]:"booleanEquals",["argv"]:[LL,!1]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"ap-northeast-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"ap-south-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"ap-southeast-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"ap-southeast-2"]}],endpoint:E0,["type"]:"endpoint"},WL,{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"ca-central-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"eu-central-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"eu-north-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"eu-west-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"eu-west-2"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"eu-west-3"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"sa-east-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"us-east-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"us-east-2"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"us-west-1"]}],endpoint:E0,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[aD,"us-west-2"]}],endpoint:E0,["type"]:"endpoint"},{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"{Region}"}]},headers:y0},["type"]:"endpoint"}],["type"]:"tree"},{conditions:TL,rules:[{conditions:KL,error:"Invalid Configuration: FIPS and custom endpoint are not supported",["type"]:"error"},{conditions:SL,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",["type"]:"error"},{endpoint:{url:QL,properties:y0,headers:y0},["type"]:"endpoint"}],["type"]:"tree"},{conditions:[ZL],rules:[{conditions:[XL],rules:[{conditions:[RL,VL],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,JL]},zL],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:y0,headers:y0},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",["type"]:"error"}],["type"]:"tree"},{conditions:KL,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[JL,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[NL,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:y0,headers:y0},["type"]:"endpoint"},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:y0,headers:y0},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",["type"]:"error"}],["type"]:"tree"},{conditions:SL,rules:[{conditions:[zL],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:y0,headers:y0},["type"]:"endpoint"}],["type"]:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",["type"]:"error"}],["type"]:"tree"},WL,{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:y0,headers:y0},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Configuration: Missing Region",["type"]:"error"}]},qL=Ee});var we,jL=(D,F={})=>{return we.get(D,()=>G2(qL,{endpointParams:D,logger:F.logger}))};var PL=M(()=>{i8();M2();OL();we=new I2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]});f0.aws=Y2});var yL,kL,bL=(D)=>{return{apiVersion:"2011-06-15",base64Decoder:D?.base64Decoder??z0,base64Encoder:D?.base64Encoder??K0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??jL,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??UL,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new yL.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(F)=>F.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new kL.NoAuthSigner}],logger:D?.logger??new P0,serviceId:D?.serviceId??"STS",urlParser:D?.urlParser??eD,utf8Decoder:D?.utf8Decoder??D0,utf8Encoder:D?.utf8Encoder??T0}};var xL=M(()=>{yL=Q(jD(),1),kL=Q(rD(),1);y();M8();O1();a2();XC();PL()});var x$,cL,gL=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=bL(D);return x$.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,credentialDefaultProvider:D?.credentialDefaultProvider??T2,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:ML.version}),httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:($)=>$.getIdentityProvider("aws.auth#sigv4")||(async(C)=>await T2(C?.__config||{})()),signer:new x$.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:($)=>$.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new cL.NoAuthSigner}],maxAttempts:D?.maxAttempts??i(l2),region:D?.region??i(m0,s2),requestHandler:h0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...p2,default:async()=>(await E()).retryMode||o0}),sha256:D?.sha256??z2.bind(null,"sha256"),streamCollector:D?.streamCollector??t0,useDualstackEndpoint:D?.useDualstackEndpoint??i(r2),useFipsEndpoint:D?.useFipsEndpoint??i(_2),userAgentAppId:D?.userAgentAppId??i(f1)}};var rL=M(()=>{GL();x$=Q(jD(),1);a6();n6();n0();cL=Q(rD(),1);l6();J2();v2();Z8();i6();O0();xL();y();p6();y()});var _L=(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}}},sL=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var c$=(D)=>D,uL=(D,F)=>{const E={...c$(h1(D)),...c$(F1(D)),...c$(O2(D)),...c$(_L(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...j2(E),...sL(E)}};var dL=M(()=>{o6();dD();y()});var FF,b1;var r3=M(()=>{z6();T6();K6();o8();n0();FF=Q(rD(),1);b6();UD();J2();y();XC();A1();rL();dL();b1=class b1 extends j0{constructor(...[D]){const F=gL(D||{}),E=IL(F),w=c2(E),$=i2(w),C=u2($),f=P2(C),B=m2(f),h=AL(B),U=uL(h,D?.extensions||[]);super(U);this.config=U,this.middlewareStack.use(g2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(d2(this.config)),this.middlewareStack.use(y2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(FF.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:hL,identityProviderConfigProvider:async(I)=>new FF.DefaultIdentityProviderConfig({"aws.auth#sigv4":I.credentials})})),this.middlewareStack.use(FF.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}});var U0;var g$=M(()=>{y();U0=class U0 extends e0{constructor(D){super(D);Object.setPrototypeOf(this,U0.prototype)}}});var _3,s3,u3,d3,v3,m3,n3,l3,EF=(D)=>({...D,...D.SecretAccessKey&&{SecretAccessKey:ED}}),JC=(D)=>({...D,...D.Credentials&&{Credentials:EF(D.Credentials)}}),zC=(D)=>({...D,...D.SAMLAssertion&&{SAMLAssertion:ED}}),TC=(D)=>({...D,...D.Credentials&&{Credentials:EF(D.Credentials)}}),KC=(D)=>({...D,...D.WebIdentityToken&&{WebIdentityToken:ED}}),SC=(D)=>({...D,...D.Credentials&&{Credentials:EF(D.Credentials)}}),QC=(D)=>({...D,...D.Credentials&&{Credentials:EF(D.Credentials)}}),HC=(D)=>({...D,...D.Credentials&&{Credentials:EF(D.Credentials)}});var H8=M(()=>{y();g$();_3=class _3 extends U0{constructor(D){super({name:"ExpiredTokenException",$fault:"client",...D});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,_3.prototype)}};s3=class s3 extends U0{constructor(D){super({name:"MalformedPolicyDocumentException",$fault:"client",...D});this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,s3.prototype)}};u3=class u3 extends U0{constructor(D){super({name:"PackedPolicyTooLargeException",$fault:"client",...D});this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,u3.prototype)}};d3=class d3 extends U0{constructor(D){super({name:"RegionDisabledException",$fault:"client",...D});this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,d3.prototype)}};v3=class v3 extends U0{constructor(D){super({name:"IDPRejectedClaimException",$fault:"client",...D});this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,v3.prototype)}};m3=class m3 extends U0{constructor(D){super({name:"InvalidIdentityTokenException",$fault:"client",...D});this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,m3.prototype)}};n3=class n3 extends U0{constructor(D){super({name:"IDPCommunicationErrorException",$fault:"client",...D});this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,n3.prototype)}};l3=class l3 extends U0{constructor(D){super({name:"InvalidAuthorizationMessageException",$fault:"client",...D});this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,l3.prototype)}}});var K2,vL=async(D,F)=>{const E=V8;let w;return w=j8({...Ge(D,F),[q8]:de,[O8]:N8}),R8(F,E,"/",void 0,w)},mL=async(D,F)=>{const E=V8;let w;return w=j8({...Me(D,F),[q8]:ve,[O8]:N8}),R8(F,E,"/",void 0,w)},nL=async(D,F)=>{const E=V8;let w;return w=j8({...Ye(D,F),[q8]:me,[O8]:N8}),R8(F,E,"/",void 0,w)},lL=async(D,F)=>{const E=V8;let w;return w=j8({...Ze(D,F),[q8]:ne,[O8]:N8}),R8(F,E,"/",void 0,w)},iL=async(D,F)=>{const E=V8;let w;return w=j8({...Xe(D,F),[q8]:le,[O8]:N8}),R8(F,E,"/",void 0,w)},pL=async(D,F)=>{const E=V8;let w;return w=j8({...We(D,F),[q8]:ie,[O8]:N8}),R8(F,E,"/",void 0,w)},aL=async(D,F)=>{const E=V8;let w;return w=j8({...Je(D,F),[q8]:pe,[O8]:N8}),R8(F,E,"/",void 0,w)},oL=async(D,F)=>{const E=V8;let w;return w=j8({...ze(D,F),[q8]:ae,[O8]:N8}),R8(F,E,"/",void 0,w)},tL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await K2.parseXmlBody(D.body,F);let w={};return w=Le(E.AssumeRoleResult,F),{$metadata:w0(D),...w}},eL=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await K2.parseXmlBody(D.body,F);let w={};return w=Re(E.AssumeRoleWithSAMLResult,F),{$metadata:w0(D),...w}},DR=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await K2.parseXmlBody(D.body,F);let w={};return w=Ve(E.AssumeRoleWithWebIdentityResult,F),{$metadata:w0(D),...w}},FR=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await K2.parseXmlBody(D.body,F);let w={};return w=Ne(E.DecodeAuthorizationMessageResult,F),{$metadata:w0(D),...w}},ER=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await K2.parseXmlBody(D.body,F);let w={};return w=je(E.GetAccessKeyInfoResult,F),{$metadata:w0(D),...w}},wR=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await K2.parseXmlBody(D.body,F);let w={};return w=Pe(E.GetCallerIdentityResult,F),{$metadata:w0(D),...w}},$R=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await K2.parseXmlBody(D.body,F);let w={};return w=ye(E.GetFederationTokenResult,F),{$metadata:w0(D),...w}},fR=async(D,F)=>{if(D.statusCode>=300)return L8(D,F);const E=await K2.parseXmlBody(D.body,F);let w={};return w=ke(E.GetSessionTokenResult,F),{$metadata:w0(D),...w}},L8=async(D,F)=>{const E={...D,body:await K2.parseXmlErrorBody(D.body,F)},w=oe(D,E.body);switch(w){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await $e(E,F);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await Ue(E,F);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await Ae(E,F);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await Ie(E,F);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await Ce(E,F);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await he(E,F);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await fe(E,F);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await Be(E,F);default:const $=E.body;return ue({output:D,parsedBody:$.Error,errorCode:w})}},$e=async(D,F)=>{const E=D.body,w=qe(E.Error,F),$=new _3({$metadata:w0(D),...w});return u($,E)},fe=async(D,F)=>{const E=D.body,w=be(E.Error,F),$=new n3({$metadata:w0(D),...w});return u($,E)},Ce=async(D,F)=>{const E=D.body,w=xe(E.Error,F),$=new v3({$metadata:w0(D),...w});return u($,E)},Be=async(D,F)=>{const E=D.body,w=ce(E.Error,F),$=new l3({$metadata:w0(D),...w});return u($,E)},he=async(D,F)=>{const E=D.body,w=ge(E.Error,F),$=new m3({$metadata:w0(D),...w});return u($,E)},Ue=async(D,F)=>{const E=D.body,w=re(E.Error,F),$=new s3({$metadata:w0(D),...w});return u($,E)},Ae=async(D,F)=>{const E=D.body,w=_e(E.Error,F),$=new u3({$metadata:w0(D),...w});return u($,E)},Ie=async(D,F)=>{const E=D.body,w=se(E.Error,F),$=new d3({$metadata:w0(D),...w});return u($,E)},Ge=(D,F)=>{const E={};if(D[g1]!=null)E[g1]=D[g1];if(D[CF]!=null)E[CF]=D[CF];if(D[w2]!=null){const w=r$(D[w2],F);if(D[w2]?.length===0)E.PolicyArns=[];Object.entries(w).forEach(([$,C])=>{const f=`PolicyArns.${$}`;E[f]=C})}if(D[E2]!=null)E[E2]=D[E2];if(D[I0]!=null)E[I0]=D[I0];if(D[hF]!=null){const w=CR(D[hF],F);if(D[hF]?.length===0)E.Tags=[];Object.entries(w).forEach(([$,C])=>{const f=`Tags.${$}`;E[f]=C})}if(D[iC]!=null){const w=He(D[iC],F);if(D[iC]?.length===0)E.TransitiveTagKeys=[];Object.entries(w).forEach(([$,C])=>{const f=`TransitiveTagKeys.${$}`;E[f]=C})}if(D[qC]!=null)E[qC]=D[qC];if(D[BF]!=null)E[BF]=D[BF];if(D[UF]!=null)E[UF]=D[UF];if(D[f2]!=null)E[f2]=D[f2];if(D[rC]!=null){const w=Se(D[rC],F);if(D[rC]?.length===0)E.ProvidedContexts=[];Object.entries(w).forEach(([$,C])=>{const f=`ProvidedContexts.${$}`;E[f]=C})}return E},Me=(D,F)=>{const E={};if(D[g1]!=null)E[g1]=D[g1];if(D[cC]!=null)E[cC]=D[cC];if(D[vC]!=null)E[vC]=D[vC];if(D[w2]!=null){const w=r$(D[w2],F);if(D[w2]?.length===0)E.PolicyArns=[];Object.entries(w).forEach(([$,C])=>{const f=`PolicyArns.${$}`;E[f]=C})}if(D[E2]!=null)E[E2]=D[E2];if(D[I0]!=null)E[I0]=D[I0];return E},Ye=(D,F)=>{const E={};if(D[g1]!=null)E[g1]=D[g1];if(D[CF]!=null)E[CF]=D[CF];if(D[oC]!=null)E[oC]=D[oC];if(D[_C]!=null)E[_C]=D[_C];if(D[w2]!=null){const w=r$(D[w2],F);if(D[w2]?.length===0)E.PolicyArns=[];Object.entries(w).forEach(([$,C])=>{const f=`PolicyArns.${$}`;E[f]=C})}if(D[E2]!=null)E[E2]=D[E2];if(D[I0]!=null)E[I0]=D[I0];return E},Ze=(D,F)=>{const E={};if(D[OC]!=null)E[OC]=D[OC];return E},Xe=(D,F)=>{const E={};if(D[wF]!=null)E[wF]=D[wF];return E},We=(D,F)=>{return{}},Je=(D,F)=>{const E={};if(D[bC]!=null)E[bC]=D[bC];if(D[E2]!=null)E[E2]=D[E2];if(D[w2]!=null){const w=r$(D[w2],F);if(D[w2]?.length===0)E.PolicyArns=[];Object.entries(w).forEach(([$,C])=>{const f=`PolicyArns.${$}`;E[f]=C})}if(D[I0]!=null)E[I0]=D[I0];if(D[hF]!=null){const w=CR(D[hF],F);if(D[hF]?.length===0)E.Tags=[];Object.entries(w).forEach(([$,C])=>{const f=`Tags.${$}`;E[f]=C})}return E},ze=(D,F)=>{const E={};if(D[I0]!=null)E[I0]=D[I0];if(D[BF]!=null)E[BF]=D[BF];if(D[UF]!=null)E[UF]=D[UF];return E},r$=(D,F)=>{const E={};let w=1;for(let $ of D){if($===null)continue;const C=Te($,F);Object.entries(C).forEach(([f,B])=>{E[`member.${w}.${f}`]=B}),w++}return E},Te=(D,F)=>{const E={};if(D[tC]!=null)E[tC]=D[tC];return E},Ke=(D,F)=>{const E={};if(D[gC]!=null)E[gC]=D[gC];if(D[RC]!=null)E[RC]=D[RC];return E},Se=(D,F)=>{const E={};let w=1;for(let $ of D){if($===null)continue;const C=Ke($,F);Object.entries(C).forEach(([f,B])=>{E[`member.${w}.${f}`]=B}),w++}return E},Qe=(D,F)=>{const E={};if(D[kC]!=null)E[kC]=D[kC];if(D[aC]!=null)E[aC]=D[aC];return E},He=(D,F)=>{const E={};let w=1;for(let $ of D){if($===null)continue;E[`member.${w}`]=$,w++}return E},CR=(D,F)=>{const E={};let w=1;for(let $ of D){if($===null)continue;const C=Qe($,F);Object.entries(C).forEach(([f,B])=>{E[`member.${w}.${f}`]=B}),w++}return E},eC=(D,F)=>{const E={};if(D[LC]!=null)E[LC]=S(D[LC]);if(D[c1]!=null)E[c1]=S(D[c1]);return E},Le=(D,F)=>{const E={};if(D[A0]!=null)E[A0]=i3(D[A0],F);if(D[x1]!=null)E[x1]=eC(D[x1],F);if(D[$2]!=null)E[$2]=I3(D[$2]);if(D[f2]!=null)E[f2]=S(D[f2]);return E},Re=(D,F)=>{const E={};if(D[A0]!=null)E[A0]=i3(D[A0],F);if(D[x1]!=null)E[x1]=eC(D[x1],F);if(D[$2]!=null)E[$2]=I3(D[$2]);if(D[uC]!=null)E[uC]=S(D[uC]);if(D[nC]!=null)E[nC]=S(D[nC]);if(D[yC]!=null)E[yC]=S(D[yC]);if(D[fF]!=null)E[fF]=S(D[fF]);if(D[xC]!=null)E[xC]=S(D[xC]);if(D[f2]!=null)E[f2]=S(D[f2]);return E},Ve=(D,F)=>{const E={};if(D[A0]!=null)E[A0]=i3(D[A0],F);if(D[mC]!=null)E[mC]=S(D[mC]);if(D[x1]!=null)E[x1]=eC(D[x1],F);if(D[$2]!=null)E[$2]=I3(D[$2]);if(D[sC]!=null)E[sC]=S(D[sC]);if(D[fF]!=null)E[fF]=S(D[fF]);if(D[f2]!=null)E[f2]=S(D[f2]);return E},i3=(D,F)=>{const E={};if(D[wF]!=null)E[wF]=S(D[wF]);if(D[dC]!=null)E[dC]=S(D[dC]);if(D[lC]!=null)E[lC]=S(D[lC]);if(D[NC]!=null)E[NC]=PD(d6(D[NC]));return E},Ne=(D,F)=>{const E={};if(D[VC]!=null)E[VC]=S(D[VC]);return E},qe=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},Oe=(D,F)=>{const E={};if(D[PC]!=null)E[PC]=S(D[PC]);if(D[c1]!=null)E[c1]=S(D[c1]);return E},je=(D,F)=>{const E={};if(D[$F]!=null)E[$F]=S(D[$F]);return E},Pe=(D,F)=>{const E={};if(D[pC]!=null)E[pC]=S(D[pC]);if(D[$F]!=null)E[$F]=S(D[$F]);if(D[c1]!=null)E[c1]=S(D[c1]);return E},ye=(D,F)=>{const E={};if(D[A0]!=null)E[A0]=i3(D[A0],F);if(D[jC]!=null)E[jC]=Oe(D[jC],F);if(D[$2]!=null)E[$2]=I3(D[$2]);return E},ke=(D,F)=>{const E={};if(D[A0]!=null)E[A0]=i3(D[A0],F);return E},be=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},xe=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},ce=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},ge=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},re=(D,F)=>{const E={};if(D[zD]!=null)E[zD]=S(D[zD]);return E},_e=(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},w0=(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"]}),ue,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 gD(U)},V8,N8="2011-06-15",q8="Action",wF="AccessKeyId",de="AssumeRole",LC="AssumedRoleId",x1="AssumedRoleUser",ve="AssumeRoleWithSAML",me="AssumeRoleWithWebIdentity",$F="Account",c1="Arn",fF="Audience",A0="Credentials",RC="ContextAssertion",ne="DecodeAuthorizationMessage",VC="DecodedMessage",I0="DurationSeconds",NC="Expiration",qC="ExternalId",OC="EncodedMessage",jC="FederatedUser",PC="FederatedUserId",le="GetAccessKeyInfo",ie="GetCallerIdentity",pe="GetFederationToken",ae="GetSessionToken",yC="Issuer",kC="Key",bC="Name",xC="NameQualifier",E2="Policy",w2="PolicyArns",cC="PrincipalArn",gC="ProviderArn",rC="ProvidedContexts",_C="ProviderId",$2="PackedPolicySize",sC="Provider",g1="RoleArn",CF="RoleSessionName",uC="Subject",dC="SecretAccessKey",vC="SAMLAssertion",mC="SubjectFromWebIdentityToken",f2="SourceIdentity",BF="SerialNumber",nC="SubjectType",lC="SessionToken",hF="Tags",UF="TokenCode",iC="TransitiveTagKeys",pC="UserId",O8="Version",aC="Value",oC="WebIdentityToken",tC="arn",zD="message",j8=(D)=>Object.entries(D).map(([F,E])=>C$(F)+"="+C$(E)).join("&"),oe=(D,F)=>{if(F.Error?.Code!==void 0)return F.Error.Code;if(D.statusCode==404)return"NotFound"};var r1=M(()=>{K2=Q(jD(),1);dD();y();H8();g$();ue=t2(U0),V8={"content-type":"application/x-www-form-urlencoded"}});var BR,AF;var _$=M(()=>{UD();BR=Q(YD(),1);y();A1();H8();r1();AF=class AF extends l.classBuilder().ep(F0).m(function(D,F,E,w){return[BR.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,JC).ser(vL).de(tL).build(){}});var hR,s$;var DB=M(()=>{UD();hR=Q(YD(),1);y();A1();H8();r1();s$=class s$ extends l.classBuilder().ep(F0).m(function(D,F,E,w){return[hR.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithSAML",{}).n("STSClient","AssumeRoleWithSAMLCommand").f(zC,TC).ser(mL).de(eL).build(){}});var UR,IF;var u$=M(()=>{UD();UR=Q(YD(),1);y();A1();H8();r1();IF=class IF extends l.classBuilder().ep(F0).m(function(D,F,E,w){return[UR.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(KC,SC).ser(nL).de(DR).build(){}});var AR,d$;var FB=M(()=>{UD();AR=Q(YD(),1);y();A1();r1();d$=class d$ extends l.classBuilder().ep(F0).m(function(D,F,E,w){return[AR.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","DecodeAuthorizationMessage",{}).n("STSClient","DecodeAuthorizationMessageCommand").f(void 0,void 0).ser(lL).de(FR).build(){}});var IR,v$;var EB=M(()=>{UD();IR=Q(YD(),1);y();A1();r1();v$=class v$ extends l.classBuilder().ep(F0).m(function(D,F,E,w){return[IR.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetAccessKeyInfo",{}).n("STSClient","GetAccessKeyInfoCommand").f(void 0,void 0).ser(iL).de(ER).build(){}});var GR,m$;var wB=M(()=>{UD();GR=Q(YD(),1);y();A1();r1();m$=class m$ extends l.classBuilder().ep(F0).m(function(D,F,E,w){return[GR.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetCallerIdentity",{}).n("STSClient","GetCallerIdentityCommand").f(void 0,void 0).ser(pL).de(wR).build(){}});var MR,n$;var $B=M(()=>{UD();MR=Q(YD(),1);y();A1();H8();r1();n$=class n$ extends l.classBuilder().ep(F0).m(function(D,F,E,w){return[MR.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetFederationToken",{}).n("STSClient","GetFederationTokenCommand").f(void 0,QC).ser(aL).de($R).build(){}});var YR,l$;var fB=M(()=>{UD();YR=Q(YD(),1);y();A1();H8();r1();l$=class l$ extends l.classBuilder().ep(F0).m(function(D,F,E,w){return[YR.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetSessionToken",{}).n("STSClient","GetSessionTokenCommand").f(void 0,HC).ser(oL).de(fR).build(){}});var te,CB;var ZR=M(()=>{y();_$();DB();u$();FB();EB();wB();$B();fB();r3();te={AssumeRoleCommand:AF,AssumeRoleWithSAMLCommand:s$,AssumeRoleWithWebIdentityCommand:IF,DecodeAuthorizationMessageCommand:d$,GetAccessKeyInfoCommand:v$,GetCallerIdentityCommand:m$,GetFederationTokenCommand:n$,GetSessionTokenCommand:l$};CB=class CB extends b1{};u6(te,CB)});var XR=M(()=>{_$();DB();u$();FB();EB();wB();$B();fB()});var WR=M(()=>{H8()});var i$,JR="us-east-1",zR=(D)=>{if(typeof D?.Arn==="string"){const F=D.Arn.split(":");if(F.length>4&&F[4]!=="")return F[4]}return},TR=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)`,`${JR} (STS default)`),w??$??JR},KR=(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:G}=D,Z=await TR(A,D?.parentClientConfig?.region,G),z=!QR(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 AF(C));if(!f||!f.AccessKeyId||!f.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${C.RoleArn}`);const h=zR(B),U={accessKeyId:f.AccessKeyId,secretAccessKey:f.SecretAccessKey,sessionToken:f.SessionToken,expiration:f.Expiration,...f.CredentialScope&&{credentialScope:f.CredentialScope},...h&&{accountId:h}};return i$.setCredentialFeature(U,"CREDENTIALS_STS_ASSUME_ROLE","i"),U}},SR=(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 TR(U,D?.parentClientConfig?.region,A),G=!QR(I);E=new F({region:Y,requestHandler:G?I:void 0,logger:h})}const{Credentials:$,AssumedRoleUser:C}=await E.send(new IF(w));if(!$||!$.AccessKeyId||!$.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${w.RoleArn}`);const f=zR(C),B={accessKeyId:$.AccessKeyId,secretAccessKey:$.SecretAccessKey,sessionToken:$.SessionToken,expiration:$.Expiration,...$.CredentialScope&&{credentialScope:$.CredentialScope},...f&&{accountId:f}};if(f)i$.setCredentialFeature(B,"RESOLVED_ACCOUNT_ID","T");return i$.setCredentialFeature(B,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),B}},QR=(D)=>{return D?.metadata?.handlerProtocol==="h2"};var HR=M(()=>{i$=Q(C0(),1);_$();u$()});var LR=(D,F)=>{if(!F)return D;else return class E extends D{constructor(w){super(w);for(let $ of F)this.middlewareStack.use($)}}},RR=(D={},F)=>KR(D,LR(b1,F)),VR=(D={},F)=>SR(D,LR(b1,F)),ee=(D)=>(F)=>D({roleAssumer:RR(F),roleAssumerWithWebIdentity:VR(F),...F});var NR=M(()=>{HR();r3()});var BB={};r0(BB,{getDefaultRoleAssumerWithWebIdentity:()=>VR,getDefaultRoleAssumer:()=>RR,decorateDefaultCredentialProvider:()=>ee,__Client:()=>j0,STSServiceException:()=>U0,STSClient:()=>b1,STS:()=>CB,RegionDisabledException:()=>d3,PackedPolicyTooLargeException:()=>u3,MalformedPolicyDocumentException:()=>s3,InvalidIdentityTokenException:()=>m3,InvalidAuthorizationMessageException:()=>l3,IDPRejectedClaimException:()=>v3,IDPCommunicationErrorException:()=>n3,GetSessionTokenResponseFilterSensitiveLog:()=>HC,GetSessionTokenCommand:()=>l$,GetFederationTokenResponseFilterSensitiveLog:()=>QC,GetFederationTokenCommand:()=>n$,GetCallerIdentityCommand:()=>m$,GetAccessKeyInfoCommand:()=>v$,ExpiredTokenException:()=>_3,DecodeAuthorizationMessageCommand:()=>d$,CredentialsFilterSensitiveLog:()=>EF,AssumeRoleWithWebIdentityResponseFilterSensitiveLog:()=>SC,AssumeRoleWithWebIdentityRequestFilterSensitiveLog:()=>KC,AssumeRoleWithWebIdentityCommand:()=>IF,AssumeRoleWithSAMLResponseFilterSensitiveLog:()=>TC,AssumeRoleWithSAMLRequestFilterSensitiveLog:()=>zC,AssumeRoleWithSAMLCommand:()=>s$,AssumeRoleResponseFilterSensitiveLog:()=>JC,AssumeRoleCommand:()=>AF,$Command:()=>l});var hB=M(()=>{r3();ZR();XR();WR();NR();g$()});var UB,OR=(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&&(DDD(D,{profile:F,logger:E})||FDD(D,{profile:F,logger:E}))},DDD=(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},FDD=(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},jR=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(() => (hB(),BB));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 ${i0(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?p$(C,F,E,{...w,[C]:!0},qR(F[C]??{})):(await $L($.credential_source,D,E.logger)(E))();if(qR($))return f.then((B)=>UB.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)=>UB.setCredentialFeature(I,"CREDENTIALS_PROFILE_SOURCE_PROFILE","o"))}},qR=(D)=>{return!D.role_arn&&!!D.credential_source};var PR=M(()=>{UB=Q(C0(),1);$D();X2();fL();AB()});var yR,kR=(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 yR.setCredentialFeature($,"CREDENTIALS_PROCESS","w"),$};var bR=M(()=>{yR=Q(C0(),1)});import{exec as EDD}from"child_process";import{promisify as wDD}from"util";var xR=async(D,F,E)=>{const w=F[D];if(F[D]){const $=w.credential_process;if($!==void 0){const C=wDD(EDD);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 kR(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 cR=M(()=>{$D();bR()});var $DD=(D={})=>async()=>{D.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const F=await G8(D);return xR(i0(D),F,D.logger)};var gR=M(()=>{X2();cR()});var IB={};r0(IB,{fromProcess:()=>$DD});var GB=M(()=>{gR()});var rR,_R=(D)=>Boolean(D)&&typeof D==="object"&&typeof D.credential_process==="string",sR=async(D,F)=>Promise.resolve().then(() => (GB(),IB)).then(({fromProcess:E})=>E({...D,profile:F})().then((w)=>rR.setCredentialFeature(w,"CREDENTIALS_PROFILE_PROCESS","v")));var uR=M(()=>{rR=Q(C0(),1)});var MB,dR=async(D,F,E={})=>{const{fromSSO:w}=await Promise.resolve().then(() => (YC(),MC));return w({profile:D,logger:E.logger})().then(($)=>{if(F.sso_session)return MB.setCredentialFeature($,"CREDENTIALS_PROFILE_SSO","r");else return MB.setCredentialFeature($,"CREDENTIALS_PROFILE_SSO_LEGACY","t")})},vR=(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 mR=M(()=>{MB=Q(C0(),1)});var nR,YB=(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,ZB=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 nR.setCredentialFeature(E,"CREDENTIALS_PROFILE","n")};var lR=M(()=>{nR=Q(C0(),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(() => (hB(),BB));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 fDD}from"fs";var pR,iR="AWS_WEB_IDENTITY_TOKEN_FILE",CDD="AWS_ROLE_ARN",BDD="AWS_ROLE_SESSION_NAME",hDD=(D={})=>async()=>{D.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const F=D?.webIdentityTokenFile??process.env[iR],E=D?.roleArn??process.env[CDD],w=D?.roleSessionName??process.env[BDD];if(!F||!E)throw new x("Web identity configuration not specified",{logger:D.logger});const $=await XB({...D,webIdentityToken:fDD(F,{encoding:"ascii"}),roleArn:E,roleSessionName:w})();if(F===process.env[iR])pR.setCredentialFeature($,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return $};var aR=M(()=>{pR=Q(C0(),1);$D()});var WB={};r0(WB,{fromWebToken:()=>XB,fromTokenFile:()=>hDD});var JB=M(()=>{aR()});var oR,tR=(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,eR=async(D,F)=>Promise.resolve().then(() => (JB(),WB)).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)=>oR.setCredentialFeature(w,"CREDENTIALS_PROFILE_STS_WEB_ID_TOKEN","q")));var DV=M(()=>{oR=Q(C0(),1)});var p$=async(D,F,E,w={},$=!1)=>{const C=F[D];if(Object.keys(w).length>0&&YB(C))return ZB(C,E);if($||OR(C,{profile:D,logger:E.logger}))return jR(D,F,E,w);if(YB(C))return ZB(C,E);if(tR(C))return eR(C,E);if(_R(C))return sR(E,D);if(vR(C))return await dR(D,C,E);throw new x(`Could not resolve credentials using profile: [${D}] in configuration/credentials file(s).`,{logger:E.logger})};var AB=M(()=>{$D();PR();uR();mR();lR();DV()});var UDD=(D={})=>async()=>{D.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const F=await G8(D);return p$(i0(D),F,D)};var FV=M(()=>{X2();AB()});var EV={};r0(EV,{fromIni:()=>UDD});var wV=M(()=>{FV()});var $V=!1,T2=(D={})=>t8(N1(async()=>{if(D.profile??process.env[Gz]){if(process.env[h$]&&process.env[U$]){if(!$V)(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
+ `),$V=!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"),L5(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(() => (YC(),MC));return f(D)()},async()=>{D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromIni");const{fromIni:F}=await Promise.resolve().then(() => (wV(),EV));return F(D)()},async()=>{D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromProcess");const{fromProcess:F}=await Promise.resolve().then(() => (GB(),IB));return F(D)()},async()=>{D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::fromTokenFile");const{fromTokenFile:F}=await Promise.resolve().then(() => (JB(),WB));return F(D)()},async()=>{return D.logger?.debug("@aws-sdk/credential-provider-node - defaultProvider::remoteProvider"),(await US(D))()},async()=>{throw new x("Could not load credentials from any providers",{tryNextLink:!1,logger:D.logger})}),IDD,ADD),ADD=(D)=>D?.expiration!==void 0,IDD=(D)=>D?.expiration!==void 0&&D.expiration.getTime()-Date.now()<300000;var fV=M(()=>{R5();$D();X2();AS()});var a6=M(()=>{fV()});var Aq=X((pB,aB)=>{(function(D,F){if(typeof pB==="object"&&typeof aB==="object")aB.exports=F();else if(typeof define==="function"&&define.amd)define(function(){return F()});else D.pluralize=F()})(pB,function(){var D=[],F=[],E={},w={},$={};function C(G){if(typeof G==="string")return new RegExp("^"+G+"$","i");return G}function f(G,Z){if(G===Z)return Z;if(G===G.toLowerCase())return Z.toLowerCase();if(G===G.toUpperCase())return Z.toUpperCase();if(G[0]===G[0].toUpperCase())return Z.charAt(0).toUpperCase()+Z.substr(1).toLowerCase();return Z.toLowerCase()}function B(G,Z){return G.replace(/\$(\d{1,2})/g,function(z,W){return Z[W]||""})}function h(G,Z){return G.replace(Z[0],function(z,W){var J=B(Z[1],arguments);if(z==="")return f(G[W-1],J);return f(z,J)})}function U(G,Z,z){if(!G.length||E.hasOwnProperty(G))return Z;var W=z.length;while(W--){var J=z[W];if(J[0].test(Z))return h(Z,J)}return Z}function I(G,Z,z){return function(W){var J=W.toLowerCase();if(Z.hasOwnProperty(J))return f(W,J);if(G.hasOwnProperty(J))return f(W,G[J]);return U(J,W,z)}}function A(G,Z,z,W){return function(J){var K=J.toLowerCase();if(Z.hasOwnProperty(K))return!0;if(G.hasOwnProperty(K))return!1;return U(K,K,z)===K}}function Y(G,Z,z){var W=Z===1?Y.singular(G):Y.plural(G);return(z?Z+" ":"")+W}return Y.plural=I($,w,D),Y.isPlural=A($,w,D),Y.singular=I(w,$,F),Y.isSingular=A(w,$,F),Y.addPluralRule=function(G,Z){D.push([C(G),Z])},Y.addSingularRule=function(G,Z){F.push([C(G),Z])},Y.addUncountableRule=function(G){if(typeof G==="string"){E[G.toLowerCase()]=!0;return}Y.addPluralRule(G,"$0"),Y.addSingularRule(G,"$0")},Y.addIrregularRule=function(G,Z){Z=Z.toLowerCase(),G=G.toLowerCase(),$[G]=Z,w[Z]=G},[["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(G){return Y.addIrregularRule(G[0],G[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(G){return Y.addPluralRule(G[0],G[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(G){return Y.addSingularRule(G[0],G[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 Iq=X((oB,tB)=>{(function(D,F,E){if(typeof oB==="object")tB.exports=E(),tB.exports.default=E();else if(typeof define==="function"&&define.amd)define(E);else F[D]=E()})("slugify",oB,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 LD=X((K4,Eh)=>{function Fh(D){return Fh=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},Fh(D)}function O0D(D){var F=typeof D==="string"||D instanceof String;if(!F){var E=Fh(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(K4,"__esModule",{value:!0});K4.default=O0D;Eh.exports=K4.default;Eh.exports.default=K4.default});var Q4=X((S4,$h)=>{function y0D(D){return D&&D.__esModule?D:{default:D}}function wh(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(P0D.default(D),F=String(F),!F)return wh(D,4)||wh(D,6);if(F==="4")return k0D.test(D);if(F==="6")return b0D.test(D);return!1}Object.defineProperty(S4,"__esModule",{value:!0});S4.default=wh;var P0D=y0D(LD()),Mq="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",k8="(".concat(Mq,"[.]){3}").concat(Mq),k0D=new RegExp("^".concat(k8,"$")),xD="(?:[0-9a-fA-F]{1,4})",b0D=new RegExp("^("+"(?:".concat(xD,":){7}(?:").concat(xD,"|:)|")+"(?:".concat(xD,":){6}(?:").concat(k8,"|:").concat(xD,"|:)|")+"(?:".concat(xD,":){5}(?::").concat(k8,"|(:").concat(xD,"){1,2}|:)|")+"(?:".concat(xD,":){4}(?:(:").concat(xD,"){0,1}:").concat(k8,"|(:").concat(xD,"){1,3}|:)|")+"(?:".concat(xD,":){3}(?:(:").concat(xD,"){0,2}:").concat(k8,"|(:").concat(xD,"){1,4}|:)|")+"(?:".concat(xD,":){2}(?:(:").concat(xD,"){0,3}:").concat(k8,"|(:").concat(xD,"){1,5}|:)|")+"(?:".concat(xD,":){1}(?:(:").concat(xD,"){0,4}:").concat(k8,"|(:").concat(xD,"){1,6}|:)|")+"(?::((?::".concat(xD,"){0,5}:").concat(k8,"|(?::").concat(xD,"){1,7}|:))")+")(%[0-9a-zA-Z-.:]{1,})?$");$h.exports=S4.default;$h.exports.default=S4.default});var b8=X((H4,fh)=>{function c0D(){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(H4,"__esModule",{value:!0});H4.default=c0D;fh.exports=H4.default;fh.exports.default=H4.default});var Zq=X((L4,Ch)=>{function Yq(D){return D&&D.__esModule?D:{default:D}}function v0D(D,F){r0D.default(D),F=_0D.default(F,d0D);var E=D.length;if(F.urlSafe)return u0D.test(D);if(E%4!==0||s0D.test(D))return!1;var w=D.indexOf("=");return w===-1||w===E-1||w===E-2&&D[E-1]==="="}Object.defineProperty(L4,"__esModule",{value:!0});L4.default=v0D;var r0D=Yq(LD()),_0D=Yq(b8()),s0D=/[^A-Z0-9+\/=]/i,u0D=/^[A-Z0-9_\-]*$/i,d0D={urlSafe:!1};Ch.exports=L4.default;Ch.exports.default=L4.default});var Wq=X((R4,Bh)=>{function Xq(D){return D&&D.__esModule?D:{default:D}}function i0D(D){n0D.default(D);var F=D.split("."),E=F.length;if(E!==3)return!1;return F.reduce(function(w,$){return w&&l0D.default($,{urlSafe:!0})},!0)}Object.defineProperty(R4,"__esModule",{value:!0});R4.default=i0D;var n0D=Xq(LD()),l0D=Xq(Zq());Bh.exports=R4.default;Bh.exports.default=R4.default});var Uh=X((V4,hh)=>{function Jq(D){return D&&D.__esModule?D:{default:D}}function e0D(D,F){if(a0D.default(D),F=o0D.default(F,t0D),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(V4,"__esModule",{value:!0});V4.default=e0D;var a0D=Jq(LD()),o0D=Jq(b8()),t0D={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};hh.exports=V4.default;hh.exports.default=V4.default});var Sq=X((q4,Ah)=>{function N4(D){return D&&D.__esModule?D:{default:D}}function $2D(D,F){return h2D(D)||B2D(D,F)||C2D(D,F)||f2D()}function f2D(){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 C2D(D,F){if(!D)return;if(typeof D==="string")return Tq(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 Tq(D,F)}function Tq(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 B2D(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 h2D(D){if(Array.isArray(D))return D}function I2D(D){return Object.prototype.toString.call(D)==="[object RegExp]"}function Kq(D,F){for(var E=0;E<F.length;E++){var w=F[E];if(D===w||I2D(w)&&w.test(D))return!0}return!1}function G2D(D,F){if(F2D.default(D),!D||/[\s<>]/.test(D))return!1;if(D.indexOf("mailto:")===0)return!1;if(F=w2D.default(F,U2D),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=$2D(I,2),Y=A[0],G=A[1];if(Y===""&&G==="")return!1}C=h.join("@"),B=null,U=null;var Z=C.match(A2D);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 Kq($,F.host_whitelist);if($===""&&!F.require_host)return!0;if(!zq.default($)&&!E2D.default($,F)&&(!U||!zq.default(U,6)))return!1;if($=$||U,F.host_blacklist&&Kq($,F.host_blacklist))return!1;return!0}Object.defineProperty(q4,"__esModule",{value:!0});q4.default=G2D;var F2D=N4(LD()),E2D=N4(Uh()),zq=N4(Q4()),w2D=N4(b8()),U2D={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},A2D=/^\[([^\]]+)\](?::([0-9]+))?$/;Ah.exports=q4.default;Ah.exports.default=q4.default});var Qq=X((O4,Ih)=>{function Z2D(D){return D&&D.__esModule?D:{default:D}}function W2D(D){return Y2D.default(D),X2D.test(D)}Object.defineProperty(O4,"__esModule",{value:!0});O4.default=W2D;var Y2D=Z2D(LD()),X2D=/^[^\s-_](?!.*?[-_]{2,})[a-z0-9-\\][^\s]*[^-_\s]$/;Ih.exports=O4.default;Ih.exports.default=O4.default});var Rq=X((Hq)=>{function T2D(D){return D&&D.__esModule?D:{default:D}}function K2D(D){var F=D.filter(function(E){return!(E in j4)});if(F.length>0)return!1;return!0}function S2D(D,F){var E=D.replace(/[\s\-]+/gi,"").toUpperCase(),w=E.slice(0,2).toUpperCase(),$=w in j4;if(F.whitelist){if(!K2D(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 $&&j4[w].test(E)}function Q2D(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 H2D(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return z2D.default(D),S2D(D,F)&&Q2D(D)}Object.defineProperty(Hq,"__esModule",{value:!0});Hq.default=H2D;Hq.locales=void 0;var z2D=T2D(LD()),j4={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}$/},_jD=Hq.locales=Object.keys(j4)});var Vq=X((P4,Gh)=>{function V2D(D){return D&&D.__esModule?D:{default:D}}function q2D(D,F){R2D.default(D);var E=N2D[![void 0,null].includes(F)?F:"all"];return!!E&&E.test(D)}Object.defineProperty(P4,"__esModule",{value:!0});P4.default=q2D;var R2D=V2D(LD()),N2D={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=P4.default;Gh.exports.default=P4.default});var Nq=X((y4,Mh)=>{function P2D(D){return D&&D.__esModule?D:{default:D}}function k2D(D){return j2D.default(D),y2D.test(D)}Object.defineProperty(y4,"__esModule",{value:!0});y4.default=k2D;var j2D=P2D(LD()),y2D=/^[\x00-\x7F]+$/;Mh.exports=y4.default;Mh.exports.default=y4.default});var qq=X((k4,Zh)=>{function c2D(D){return D&&D.__esModule?D:{default:D}}function Yh(D){return Yh=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},Yh(D)}function g2D(D,F){x2D.default(D);var E,w;if(Yh(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(k4,"__esModule",{value:!0});k4.default=g2D;var x2D=c2D(LD());Zh.exports=k4.default;Zh.exports.default=k4.default});var jq=X((b4,Wh)=>{function a3(D){return D&&D.__esModule?D:{default:D}}function o2D(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 t2D(D,F){if(_2D.default(D),F=u2D.default(F,d2D),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(!o2D(w))return!1}else if(F.require_display_name)return!1}if(!F.ignore_max_length&&D.length>a2D)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(!n2D.test(U[I]))return!1}if(F.ignore_max_length===!1&&(!Xh.default(B,{max:64})||!Xh.default(C,{max:254})))return!1;if(!s2D.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(!Oq.default(C)){if(!C.startsWith("[")||!C.endsWith("]"))return!1;var A=C.slice(1,-1);if(A.length===0||!Oq.default(A))return!1}}if(B[0]==='"')return B=B.slice(1,B.length-1),F.allow_utf8_local_part?p2D.test(B):l2D.test(B);var Y=F.allow_utf8_local_part?i2D:m2D,G=B.split(".");for(var Z=0;Z<G.length;Z++)if(!Y.test(G[Z]))return!1;if(F.blacklisted_chars){if(B.search(new RegExp("[".concat(F.blacklisted_chars,"]+"),"g"))!==-1)return!1}return!0}Object.defineProperty(b4,"__esModule",{value:!0});b4.default=t2D;var _2D=a3(LD()),Xh=a3(qq()),s2D=a3(Uh()),Oq=a3(Q4()),u2D=a3(b8()),d2D={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,m2D=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,n2D=/^[a-z\d]+$/,l2D=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,i2D=/^[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,a2D=254;Wh.exports=b4.default;Wh.exports.default=b4.default});var d4=X((gq)=>{Object.defineProperty(gq,"__esModule",{value:!0});gq.farsiLocales=gq.englishLocales=gq.dotDecimal=gq.decimal=gq.commaDecimal=gq.bengaliLocales=gq.arabicLocales=gq.alphanumeric=gq.alpha=void 0;var Q0=gq.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]+$/},H0=gq.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=gq.decimal={"en-US":".",ar:"\u066B"},Pq=gq.englishLocales=["AU","GB","HK","IN","NZ","ZA","ZM"];for(x4=0;x4<Pq.length;x4++)o3="en-".concat(Pq[x4]),Q0[o3]=Q0["en-US"],H0[o3]=H0["en-US"],G0[o3]=G0["en-US"];var o3,x4,yq=gq.arabicLocales=["AE","BH","DZ","EG","IQ","JO","KW","LB","LY","MA","QM","QA","SA","SD","SY","TN","YE"];for(c4=0;c4<yq.length;c4++)t3="ar-".concat(yq[c4]),Q0[t3]=Q0.ar,H0[t3]=H0.ar,G0[t3]=G0.ar;var t3,c4,kq=gq.farsiLocales=["IR","AF"];for(r4=0;r4<kq.length;r4++)g4="fa-".concat(kq[r4]),H0[g4]=H0.fa,G0[g4]=G0.ar;var g4,r4,bq=gq.bengaliLocales=["BD","IN"];for(_4=0;_4<bq.length;_4++)e3="bn-".concat(bq[_4]),Q0[e3]=Q0.bn,H0[e3]=H0.bn,G0[e3]=G0["en-US"];var e3,_4,xq=gq.dotDecimal=["ar-EG","ar-LB","ar-LY"],cq=gq.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(s4=0;s4<xq.length;s4++)G0[xq[s4]]=G0["en-US"];var s4;for(u4=0;u4<cq.length;u4++)G0[cq[u4]]=",";var u4;Q0["fr-CA"]=Q0["fr-FR"];H0["fr-CA"]=H0["fr-FR"];Q0["pt-BR"]=Q0["pt-PT"];H0["pt-BR"]=H0["pt-PT"];G0["pt-BR"]=G0["pt-PT"];Q0["pl-Pl"]=Q0["pl-PL"];H0["pl-Pl"]=H0["pl-PL"];G0["pl-Pl"]=G0["pl-PL"];Q0["fa-AF"]=Q0.fa});var uq=X((_q)=>{function U1D(D){return D&&D.__esModule?D:{default:D}}function A1D(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"en-US",E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};h1D.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 Jh.alpha)return Jh.alpha[F].test(w);throw new Error("Invalid locale '".concat(F,"'"))}Object.defineProperty(_q,"__esModule",{value:!0});_q.default=A1D;_q.locales=void 0;var h1D=U1D(LD()),Jh=d4(),djD=_q.locales=Object.keys(Jh.alpha)});var vq=X((v4,zh)=>{function dq(D){return D&&D.__esModule?D:{default:D}}function z1D(D,F){if(G1D.default(D),F=M1D.default(F,J1D),!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 X1D.test(E[0])&&W1D.test(E[1]);return Y1D.test(E[0])&&Z1D.test(E[1])}Object.defineProperty(v4,"__esModule",{value:!0});v4.default=z1D;var G1D=dq(LD()),M1D=dq(b8()),Y1D=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,Z1D=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,X1D=/^(([1-8]?\d)\D+([1-5]?\d|60)\D+([1-5]?\d|60)(\.\d+)?|90\D+0\D+0)\D+[NSns]?$/i,W1D=/^\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,J1D={checkDMS:!1};zh.exports=v4.default;zh.exports.default=v4.default});var nq=X((m4,Th)=>{Object.defineProperty(m4,"__esModule",{value:!0});m4.default=void 0;var K1D=function D(F,E){return F.some(function(w){return E===w})},mjD=m4.default=K1D;Th.exports=m4.default;Th.exports.default=m4.default});var iq=X((n4,Sh)=>{function Kh(D){return D&&D.__esModule?D:{default:D}}function L1D(D){var F=new RegExp("^[-+]?([0-9]+)?(\\".concat(lq.decimal[D.locale],"[0-9]{").concat(D.decimal_digits,"})").concat(D.force_decimal?"":"?","$"));return F}function N1D(D,F){if(Q1D.default(D),F=S1D.default(F,R1D),F.locale in lq.decimal)return!H1D.default(V1D,D.replace(/ /g,""))&&L1D(F).test(D);throw new Error("Invalid locale '".concat(F.locale,"'"))}Object.defineProperty(n4,"__esModule",{value:!0});n4.default=N1D;var S1D=Kh(b8()),Q1D=Kh(LD()),H1D=Kh(nq()),lq=d4(),R1D={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},V1D=["","-","+"];Sh.exports=n4.default;Sh.exports.default=n4.default});var pq=X((l4,Qh)=>{function j1D(D){return D&&D.__esModule?D:{default:D}}function y1D(D){return O1D.default(D),P1D.test(D)}Object.defineProperty(l4,"__esModule",{value:!0});l4.default=y1D;var O1D=j1D(LD()),P1D=/^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$/i;Qh.exports=l4.default;Qh.exports.default=l4.default});var aq=X((i4,Hh)=>{function x1D(D){return D&&D.__esModule?D:{default:D}}function c1D(D){b1D.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(i4,"__esModule",{value:!0});i4.default=c1D;var b1D=x1D(LD());Hh.exports=i4.default;Hh.exports.default=i4.default});var tq=X((p4,Lh)=>{function oq(D){return D&&D.__esModule?D:{default:D}}function u1D(D){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r1D.default(D);var E=F.provider,w=D.replace(/[- ]+/g,"");if(E&&E.toLowerCase()in JF){if(!JF[E.toLowerCase()].test(w))return!1}else if(E&&!(E.toLowerCase()in JF))throw new Error("".concat(E," is not a valid credit card provider."));else if(!s1D.some(function($){return $.test(w)}))return!1;return _1D.default(D)}Object.defineProperty(p4,"__esModule",{value:!0});p4.default=u1D;var r1D=oq(LD()),_1D=oq(aq()),JF={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})?$/},s1D=function(){var D=[];for(var F in JF)if(JF.hasOwnProperty(F))D.push(JF[F]);return D}();Lh.exports=p4.default;Lh.exports.default=p4.default});var FO=X((eq)=>{function m1D(D){return D&&D.__esModule?D:{default:D}}function n1D(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 Rh.alphanumeric)return Rh.alphanumeric[F].test(w);throw new Error("Invalid locale '".concat(F,"'"))}Object.defineProperty(eq,"__esModule",{value:!0});eq.default=n1D;eq.locales=void 0;var v1D=m1D(LD()),Rh=d4(),njD=eq.locales=Object.keys(Rh.alphanumeric)});var wO=X((a4,Vh)=>{function p1D(D){return D&&D.__esModule?D:{default:D}}function a1D(D,F){i1D.default(D);var E=D.replace(/\s/g,"").toUpperCase();return F.toUpperCase()in EO&&EO[F].test(E)}Object.defineProperty(a4,"__esModule",{value:!0});a4.default=a1D;var i1D=p1D(LD()),EO={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}$/};Vh.exports=a4.default;Vh.exports.default=a4.default});var qh=X((fO)=>{function e1D(D){return D&&D.__esModule?D:{default:D}}function D8D(D,F){if(t1D.default(D),F in zF)return zF[F].test(D);else if(F==="any"){for(var E in zF)if(zF.hasOwnProperty(E)){var w=zF[E];if(w.test(D))return!0}return!1}throw new Error("Invalid locale '".concat(F,"'"))}Object.defineProperty(fO,"__esModule",{value:!0});fO.default=D8D;fO.locales=void 0;var t1D=e1D(LD()),$O=/^\d{3}$/,c0=/^\d{4}$/,M0=/^\d{5}$/,Nh=/^\d{6}$/,zF={AD:/^AD\d{3}$/,AT:c0,AU:c0,AZ:/^AZ\d{4}$/,BA:/^([7-8]\d{4}$)/,BE:c0,BG:c0,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:c0,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:M0,DK:c0,DO:M0,DZ:M0,EE:M0,ES:/^(5[0-2]{1}|[0-4]{1}\d{1})\d{3}$/,FI:M0,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:c0,ID:M0,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:$O,IT:M0,JP:/^\d{3}\-\d{4}$/,KE:M0,KR:/^(\d{5}|\d{6})$/,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:c0,LV:/^LV\-\d{4}$/,LK:M0,MG:$O,MX:M0,MT:/^[A-Za-z]{3}\s{0,1}\d{4}$/,MY:M0,NL:/^[1-9]\d{3}\s?(?!sa|sd|ss)[a-z]{2}$/i,NO:c0,NP:/^(10|21|22|32|33|34|44|45|56|57)\d{3}$|^(977)$/i,NZ:c0,PL:/^\d{2}\-\d{3}$/,PR:/^00[679]\d{2}([ -]\d{4})?$/,PT:/^\d{4}\-\d{3}?$/,RO:Nh,RU:Nh,SA:M0,SE:/^[1-9]\d{2}\s?\d{2}$/,SG:Nh,SI:c0,SK:/^\d{3}\s?\d{2}$/,TH:M0,TN:c0,TW:/^\d{3}(\d{2})?$/,UA:M0,US:/^\d{5}(-\d{4})?$/,ZA:c0,ZM:M0},ijD=fO.locales=Object.keys(zF)});var Oh=X((BO)=>{function w8D(D){return D&&D.__esModule?D:{default:D}}function $8D(D,F,E){if(E8D.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(BO,"__esModule",{value:!0});BO.default=$8D;BO.locales=void 0;var E8D=w8D(LD()),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 ajD=BO.locales=Object.keys(TD)});var xh=X((kh,bh)=>{(function(D,F){typeof kh=="object"&&typeof bh!="undefined"?bh.exports=F():typeof define=="function"&&define.amd?define(F):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs=F()})(kh,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",G="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,W={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}},L="en",V={};V[L]=W;var m="$isDayjsObject",DD=function(_){return _ instanceof hD||!(!_||!_[m])},wD=function _(j,N,g){var P;if(!j)return L;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 e=j.name;V[e]=j,P=e}return!g&&P&&(L=P),P||!g&&L},t=function(_,j){if(DD(_))return _.clone();var N=typeof j=="object"?j:{};return N.date=_,N.args=arguments,new hD(N)},b=K;b.l=wD,b.i=DD,b.w=function(_,j){return t(_,{locale:j.$L,utc:j.$u,x:j.$x,$offset:j.$offset})};var hD=function(){function _(N){this.$L=wD(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 e=n[2]-1||0,MD=(n[7]||"0").substring(0,3);return v?new Date(Date.UTC(n[1],e,n[3]||1,n[4]||0,n[5]||0,n[6]||0,MD)):new Date(n[1],e,n[3]||1,n[4]||0,n[5]||0,n[6]||0,MD)}}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()!==G},j.isSame=function(N,g){var P=t(N);return this.startOf(g)<=P&&P<=this.endOf(g)},j.isAfter=function(N,g){return t(N)<this.startOf(g)},j.isBefore=function(N,g){return this.endOf(g)<t(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),e=function(q2,iD){var g0=b.w(P.$u?Date.UTC(P.$y,iD,q2):new Date(P.$y,iD,q2),P);return v?g0:g0.endOf(B)},MD=function(q2,iD){return b.w(P.toDate()[q2].apply(P.toDate("s"),(v?[0,0,0,0]:[23,59,59,999]).slice(iD)),P)},QD=this.$W,uD=this.$M,X0=this.$D,D8="set"+(this.$u?"UTC":"");switch(n){case A:return v?e(1,0):e(31,11);case U:return v?e(1,uD):e(0,uD+1);case h:var S1=this.$locale().weekStart||0,u8=(QD<S1?QD+7:QD)-S1;return e(v?X0-u8:X0+(6-u8),uD);case B:case Y:return MD(D8+"Hours",0);case f:return MD(D8+"Minutes",1);case C:return MD(D8+"Seconds",2);case $:return MD(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":""),e=(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],MD=v===B?this.$D+(g-this.$W):g;if(v===U||v===A){var QD=this.clone().set(Y,1);QD.$d[e](MD),QD.init(),this.$d=QD.set(Y,Math.min(this.$D,QD.daysInMonth())).$d}else e&&this.$d[e](MD);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),e=function(uD){var X0=t(v);return b.w(X0.date(X0.date()+Math.round(uD*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 e(1);if(n===h)return e(7);var MD=(P={},P[C]=F,P[f]=E,P[$]=D,P)[n]||1,QD=this.$d.getTime()+N*MD;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||G;var v=N||"YYYY-MM-DDTHH:mm:ssZ",n=b.z(this),e=this.$H,MD=this.$m,QD=this.$M,uD=P.weekdays,X0=P.months,D8=P.meridiem,S1=function(iD,g0,Q1,F8){return iD&&(iD[g0]||iD(g,v))||Q1[g0].slice(0,F8)},u8=function(iD){return b.s(e%12||12,iD,"0")},q2=D8||function(iD,g0,Q1){var F8=iD<12?"AM":"PM";return Q1?F8.toLowerCase():F8};return v.replace(z,function(iD,g0){return g0||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,uD,2);case"ddd":return S1(P.weekdaysShort,g.$W,uD,3);case"dddd":return uD[g.$W];case"H":return String(e);case"HH":return b.s(e,2,"0");case"h":return u8(1);case"hh":return u8(2);case"a":return q2(e,MD,!0);case"A":return q2(e,MD,!1);case"m":return String(MD);case"mm":return b.s(MD,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}(iD)||n.replace(":","")})},j.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},j.diff=function(N,g,P){var v,n=this,e=b.p(g),MD=t(N),QD=(MD.utcOffset()-this.utcOffset())*F,uD=this-MD,X0=function(){return b.m(n,MD)};switch(e){case A:v=X0()/12;break;case U:v=X0();break;case I:v=X0()/3;break;case h:v=(uD-QD)/604800000;break;case B:v=(uD-QD)/86400000;break;case f:v=uD/E;break;case C:v=uD/F;break;case $:v=uD/D;break;default:v=uD}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=wD(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()},_}(),tD=hD.prototype;return t.prototype=tD,[["$ms",w],["$s",$],["$m",C],["$H",f],["$W",B],["$M",U],["$y",A],["$D",Y]].forEach(function(_){tD[_[1]]=function(j){return this.$g(j,_[0],_[1])}}),t.extend=function(_,j){return _.$i||(_(j,hD,t),_.$i=!0),t},t.locale=wD,t.isDayjs=DD,t.unix=function(_){return t(1000*_)},t.en=V[L],t.Ls=V,t.p={},t})});var yO=X((ch,gh)=>{(function(D,F){typeof ch=="object"&&typeof gh!="undefined"?gh.exports=F():typeof define=="function"&&define.amd?define(F):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs_plugin_isSameOrAfter=F()})(ch,function(){return function(D,F){F.prototype.isSameOrAfter=function(E,w){return this.isSame(E,w)||this.isAfter(E,w)}}})});var kO=X((rh,_h)=>{(function(D,F){typeof rh=="object"&&typeof _h!="undefined"?_h.exports=F():typeof define=="function"&&define.amd?define(F):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs_plugin_isSameOrBefore=F()})(rh,function(){return function(D,F){F.prototype.isSameOrBefore=function(E,w){return this.isSame(E,w)||this.isBefore(E,w)}}})});var bO=X((sh,uh)=>{(function(D,F){typeof sh=="object"&&typeof uh!="undefined"?uh.exports=F():typeof define=="function"&&define.amd?define(F):(D=typeof globalThis!="undefined"?globalThis:D||self).dayjs_plugin_customParseFormat=F()})(sh,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 W=z.match(/([+-]|\d\d)/g),J=60*W[1]+(+W[2]||0);return J===0?0:W[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 W,J=f.meridiem;if(J){for(var K=1;K<=24;K+=1)if(Z.indexOf(J(K,0,z))>-1){W=K>12;break}}else W=Z===(z?"pm":"PM");return W},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,W=Z.match(/\d+/);if(this.day=W[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"),W=(I("monthsShort")||z.map(function(J){return J.slice(0,3)})).indexOf(Z)+1;if(W<1)throw new Error;this.month=W%12||W}],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 G(Z){var z,W;z=Z,W=f&&f.formats;for(var J=(Z=z.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t,b,hD){var tD=hD&&hD.toUpperCase();return b||W[hD]||D[hD]||W[tD].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(_,j,N){return j||N.slice(1)})})).match(F),K=J.length,L=0;L<K;L+=1){var V=J[L],m=Y[V],DD=m&&m[0],wD=m&&m[1];J[L]=wD?{regex:DD,parser:wD}:V.replace(/^\[|\]$/g,"")}return function(t){for(var b={},hD=0,tD=0;hD<K;hD+=1){var _=J[hD];if(typeof _=="string")tD+=_.length;else{var{regex:j,parser:N}=_,g=t.slice(tD),P=j.exec(g)[0];N.call(b,P),t=t.replace(P,"")}}return function(v){var n=v.afternoon;if(n!==void 0){var e=v.hours;n?e<12&&(v.hours+=12):e===12&&(v.hours=0),delete v.afternoon}}(b),b}}return function(Z,z,W){W.p.customParseFormat=!0,Z&&Z.parseTwoDigitYear&&(B=Z.parseTwoDigitYear);var J=z.prototype,K=J.parse;J.parse=function(L){var{date:V,utc:m,args:DD}=L;this.$u=m;var wD=DD[1];if(typeof wD=="string"){var t=DD[2]===!0,b=DD[3]===!0,hD=t||b,tD=DD[2];b&&(tD=DD[2]),f=this.$locale(),!t&&tD&&(f=W.Ls[tD]),this.$d=function(g,P,v,n){try{if(["x","X"].indexOf(P)>-1)return new Date((P==="X"?1000:1)*g);var e=G(P)(g),MD=e.year,QD=e.month,uD=e.day,X0=e.hours,D8=e.minutes,S1=e.seconds,u8=e.milliseconds,q2=e.zone,iD=e.week,g0=new Date,Q1=uD||(MD||QD?1:g0.getDate()),F8=MD||g0.getFullYear(),RE=0;MD&&!QD||(RE=QD>0?QD-1:g0.getMonth());var VE,d7=X0||0,v7=D8||0,m7=S1||0,n7=u8||0;return q2?new Date(Date.UTC(F8,RE,Q1,d7,v7,m7,n7+60*q2.offset*1000)):v?new Date(Date.UTC(F8,RE,Q1,d7,v7,m7,n7)):(VE=new Date(F8,RE,Q1,d7,v7,m7,n7),iD&&(VE=n(VE).week(iD).toDate()),VE)}catch(F7D){return new Date("")}}(V,wD,m,W),this.init(),tD&&tD!==!0&&(this.$L=this.locale(tD).$L),hD&&V!=this.format(wD)&&(this.$d=new Date("")),f={}}else if(wD instanceof Array)for(var _=wD.length,j=1;j<=_;j+=1){DD[1]=wD[j-1];var N=W.apply(this,DD);if(N.isValid()){this.$d=N.$d,this.$L=N.$L,this.init();break}j===_&&(this.$d=new Date(""))}else K.call(this,L)}}})});var xO=X((t4,mh)=>{function J8D(D){return D&&D.__esModule?D:{default:D}}function z8D(D){return W8D.default(D),D.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\//g,"&#x2F;").replace(/\\/g,"&#x5C;").replace(/`/g,"&#96;")}Object.defineProperty(t4,"__esModule",{value:!0});t4.default=z8D;var W8D=J8D(LD());mh.exports=t4.default;mh.exports.default=t4.default});var cO=X((e4,nh)=>{function S8D(D){return D&&D.__esModule?D:{default:D}}function N8D(D){if(D.length>1)return D;return""}function q8D(D,F){F=K8D.default(F,Q8D);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,N8D);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(H8D.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(L8D.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(R8D.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(V8D.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(e4,"__esModule",{value:!0});e4.default=q8D;var K8D=S8D(b8()),Q8D={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},H8D=["icloud.com","me.com"],L8D=["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"],R8D=["rocketmail.com","yahoo.ca","yahoo.co.uk","yahoo.com","yahoo.de","yahoo.fr","yahoo.in","yahoo.it","ymail.com"],V8D=["yandex.ru","yandex.ua","yandex.kz","yandex.com","yandex.by","ya.ru"];nh.exports=e4.default;nh.exports.default=e4.default});function EU(D){return D!==null&&typeof D==="object"}function CU(D,F,E=".",w){if(!EU(F))return CU(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(EU(f)&&EU($[C]))$[C]=CU(f,$[C],(E?`${E}.`:"")+C.toString(),w);else $[C]=f}return $}function cFD(D){return(...F)=>F.reduce((E,w)=>CU(E,w,"",D),{})}function rFD(D){return Object.prototype.toString.call(D)==="[object Object]"}function _FD(D){if(!rFD(D))return!1;if(!D.message&&!D.args)return!1;if(D.stack)return!1;return!0}function $U(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 By(D={}){return new lD(D)}class lD{constructor(D={}){const F=D.types||fU;this.options=gFD({...D,defaults:{...D.defaults},level:$U(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=$U(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 lD({...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(){wU=!0}resumeLogs(){wU=!1;const D=Cy.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(wU){Cy.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:$U(D.level,this.options.types)};if(!E&&F.length===1&&_FD(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 nD,fU,gFD,wU=!1,Cy;var I7=M(()=>{nD={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:nD.fatal},error:{level:nD.error},warn:{level:nD.warn},log:{level:nD.log},info:{level:nD.info},success:{level:nD.success},fail:{level:nD.fail},ready:{level:nD.info},start:{level:nD.info},box:{level:nD.info},debug:{level:nD.debug},trace:{level:nD.trace},verbose:{level:nD.verbose}},gFD=cFD(),Cy=[];lD.prototype.add=lD.prototype.addReporter;lD.prototype.remove=lD.prototype.removeReporter;lD.prototype.clear=lD.prototype.removeReporter;lD.prototype.withScope=lD.prototype.withTag;lD.prototype.mock=lD.prototype.mockTypes;lD.prototype.pause=lD.prototype.pauseLogs;lD.prototype.resume=lD.prototype.resumeLogs});import{formatWithOptions as sFD}from"util";import{sep as uFD}from"path";function hU(D){const F=process.cwd()+uFD;return D.split("\n").splice(1).map((w)=>w.trim().replace("file://","").replace(F,""))}function dFD(D,F){return(F.__write||F.write).call(F,D)}class G7{formatStack(D,F){return" "+hU(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 sFD(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"+[BU(D.tag),D.title&&D.title,...E.split("\n")].filter(Boolean).map((w)=>" > "+w).join("\n")+"\n";return this.filterAndJoin([BU(D.type),BU(D.tag),E])}log(D,F){const E=this.formatLogObj(D,{columns:F.options.stdout.columns||0,...F.options.formatOptions});return dFD(E+"\n",D.level<2?F.options.stderr||process.stderr:F.options.stdout||process.stdout)}}var BU=(D)=>D?`[${D}]`:"";var M7=()=>{};import*as Y7 from"tty";function Gy(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:Gy(f,C,E,w))}function oFD(D,F,E,w,$){return D<0?E+F+w:E+Gy(D,F,w,$)+w}function tFD(D,F,E=D,w=D.length+1){return($)=>$||!($===""||$===void 0)?oFD((""+$).indexOf(F,w),$,D,F,E):""}function a(D,F,E){return tFD(`\x1B[${D}m`,`\x1B[${F}m`,E)}function eFD(D=aFD){return D?hy:Object.fromEntries(Object.keys(hy).map((F)=>[F,String]))}function My(D,F="reset"){return H[D]||H[F]}function Y0(D){return D.replace(new RegExp(D3D,"g"),"")}function UU(D,F={}){const E={...F,style:{...F3D,...F.style}},w=D.split("\n"),$=[],C=My(E.style.borderColor),f={...typeof E.style.borderStyle==="string"?Uy[E.style.borderStyle]||Uy.solid:E.style.borderStyle};if(C)for(let G in f)f[G]=C(f[G]);const B=E.style.padding%2===0?E.style.padding:E.style.padding+1,h=w.length+B,U=Math.max(...w.map((G)=>G.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 G=f.h.repeat(Math.floor((U-Y0(E.title).length)/2)),Z=f.h.repeat(U-Y0(E.title).length-Y0(G).length+B);$.push(`${A}${f.tl}${G}${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 G=0;G<h;G++)if(G<Y||G>=Y+w.length)$.push(`${A}${f.v}${" ".repeat(I)}${f.v}`);else{const Z=w[G-Y],z=" ".repeat(B),W=" ".repeat(U-Y0(Z).length);$.push(`${A}${f.v}${z}${Z}${W}${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,Ay,vFD,mFD,nFD,lFD,Iy,iFD,pFD,aFD,hy,H,D3D,Uy,F3D;var CE=M(()=>{({env:c8={},argv:Ay=[],platform:vFD=""}=typeof process==="undefined"?{}:process),mFD="NO_COLOR"in c8||Ay.includes("--no-color"),nFD="FORCE_COLOR"in c8||Ay.includes("--color"),lFD=vFD==="win32",Iy=c8.TERM==="dumb",iFD=Y7&&Y7.isatty&&Y7.isatty(1)&&c8.TERM&&!Iy,pFD="CI"in c8&&(("GITHUB_ACTIONS"in c8)||("GITLAB_CI"in c8)||("CIRCLECI"in c8)),aFD=!mFD&&(nFD||lFD&&!Iy||iFD||pFD),hy={reset:a(0,0),bold:a(1,22,"\x1B[22m\x1B[1m"),dim:a(2,22,"\x1B[22m\x1B[2m"),italic:a(3,23),underline:a(4,24),inverse:a(7,27),hidden:a(8,28),strikethrough:a(9,29),black:a(30,39),red:a(31,39),green:a(32,39),yellow:a(33,39),blue:a(34,39),magenta:a(35,39),cyan:a(36,39),white:a(37,39),gray:a(90,39),bgBlack:a(40,49),bgRed:a(41,49),bgGreen:a(42,49),bgYellow:a(43,49),bgBlue:a(44,49),bgMagenta:a(45,49),bgCyan:a(46,49),bgWhite:a(47,49),blackBright:a(90,39),redBright:a(91,39),greenBright:a(92,39),yellowBright:a(93,39),blueBright:a(94,39),magentaBright:a(95,39),cyanBright:a(96,39),whiteBright:a(97,39),bgBlackBright:a(100,49),bgRedBright:a(101,49),bgGreenBright:a(102,49),bgYellowBright:a(103,49),bgBlueBright:a(104,49),bgMagentaBright:a(105,49),bgCyanBright:a(106,49),bgWhiteBright:a(107,49)},H=eFD(),D3D=["[\\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("|"),Uy={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"}},F3D={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1}});var Py={};r0(Py,{prompt:()=>r3D});import{stdin as E3D,stdout as w3D}from"process";import Yy from"readline";import{WriteStream as $3D}from"tty";import f3D from"tty";function G3D({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 Ly(D){if(typeof D!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(G3D(),"")}function BE(D,F={}){if(typeof D!="string"||D.length===0||(F={ambiguousIsNarrow:!0,...F},D=Ly(D),D.length===0))return 0;D=D.replace(Z3D()," ");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(Y3D.eastAsianWidth($)){case"F":case"W":w+=2;break;case"A":w+=E;break;default:w+=1}}return w}function J3D(){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=Zy(),SD.color.ansi256=Xy(),SD.color.ansi16m=Wy(),SD.bgColor.ansi=Zy(IU),SD.bgColor.ansi256=Xy(IU),SD.bgColor.ansi16m=Wy(IU),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 Ty(D,F,E){return String(D).normalize().replace(/\r\n/g,`
34
+ `).split(`
35
+ `).map((w)=>H3D(w,F,E)).join(`
36
+ `)}function L3D(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 Z7(D,F){D.isTTY&&D.setRawMode(F)}async function r3D(D,F={}){if(!F.type||F.type==="text")return await b3D({message:D,defaultValue:F.default,placeholder:F.placeholder,initialValue:F.initial});if(F.type==="confirm")return await x3D({message:D,initialValue:F.initial});if(F.type==="select")return await c3D({message:D,options:F.options.map((E)=>typeof E==="string"?{value:E,label:E}:E)});if(F.type==="multiselect")return await g3D({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 hE{constructor({render:D,input:F=E3D,output:E=w3D,...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 $3D(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=Yy.createInterface({input:this.input,output:D,tabSize:2,prompt:"",escapeCodeTimeout:50}),Yy.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),Z7(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((F,E)=>{this.once("submit",()=>{this.output.write(L2.cursor.show),this.output.off("resize",this.render),Z7(this.input,!1),F(this.value)}),this.once("cancel",()=>{this.output.write(L2.cursor.show),this.output.off("resize",this.render),Z7(this.input,!1),F(R3D)})})}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&&Ky.has(F.name)&&this.emit("cursor",Ky.get(F.name)),F?.name&&V3D.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
+ `),Z7(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=Ty(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
40
+ `).length-1;this.output.write(L2.cursor.move(-999,D*-1))}render(){const D=Ty(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if(this.state==="initial")this.output.write(L2.cursor.hide);else{const F=L3D(this._prevFrame,D);if(this.restoreCursor(),F&&F?.length===1){const E=F[0];this.output.write(L2.cursor.move(0,E)),this.output.write(L2.erase.lines(1));const w=D.split(`
41
+ `);this.output.write(w[E]),this._prevFrame=D,this.output.write(L2.cursor.move(0,w.length-E-1));return}else if(F&&F?.length>1){const E=F[0];this.output.write(L2.cursor.move(0,E)),this.output.write(L2.erase.down());const w=D.split(`
42
+ `).slice(E);this.output.write(w.join(`
43
+ `)),this._prevFrame=D;return}this.output.write(L2.erase.down())}this.output.write(D),this.state==="initial"&&(this.state="active"),this._prevFrame=D}}}var MU="\x1B",VD,C3D="\x07",YU,B3D,h3D,L2,JU,U3D,A3D,KD=(D,F,E=D)=>(w)=>{let $=""+w,C=$.indexOf(F,D.length);return~C?D+Qy($,F,E,C)+F:D+$+F},Qy=(D,F,E,w)=>{let $=D.substring(0,w)+E,C=D.substring(w+F.length),f=C.indexOf(F);return~f?$+Qy(C,F,E,f):$+C},Hy=(D=A3D)=>({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}),I3D,AU,ZU,M3D,Y3D,Z3D=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},IU=10,Zy=(D=0)=>(F)=>`\x1B[${F+D}m`,Xy=(D=0)=>(F)=>`\x1B[${38+D};5;${F}m`,Wy=(D=0)=>(F,E,w)=>`\x1B[${38+D};2;${F};${E};${w}m`,SD,X3D,W3D,z3D,X7,T3D=39,zU="\x07",Ry="[",K3D="]",Vy="m",TU,Jy=(D)=>`${X7.values().next().value}${Ry}${D}${Vy}`,zy=(D)=>`${X7.values().next().value}${TU}${D}${zU}`,S3D=(D)=>D.split(" ").map((F)=>BE(F)),GU=(D,F,E)=>{const w=[...F];let $=!1,C=!1,f=BE(Ly(D[D.length-1]));for(let[B,h]of w.entries()){const U=BE(h);if(f+U<=E?D[D.length-1]+=h:(D.push(h),f=0),X7.has(h)&&($=!0,C=w.slice(B+1).join("").startsWith(TU)),$){C?h===zU&&($=!1,C=!1):h===Vy&&($=!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())},Q3D=(D)=>{const F=D.split(" ");let E=F.length;for(;E>0&&!(BE(F[E-1])>0);)E--;return E===F.length?D:F.slice(0,E).join(" ")+F.slice(E).join("")},H3D=(D,F,E={})=>{if(E.trim!==!1&&D.trim()==="")return"";let w="",$,C;const f=S3D(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=BE(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,G=1+Math.floor((f[U]-Y-1)/F);Math.floor((f[U]-1)/F)<G&&B.push(""),GU(B,I,F);continue}if(A+f[U]>F&&A>0&&f[U]>0){if(E.wordWrap===!1&&A<F){GU(B,I,F);continue}B.push("")}if(A+f[U]>F&&E.wordWrap===!1){GU(B,I,F);continue}B[B.length-1]+=I}E.trim!==!1&&(B=B.map((U)=>Q3D(U)));const h=[...B.join(`
44
+ `)];for(let[U,I]of h.entries()){if(w+=I,X7.has(I)){const{groups:Y}=new RegExp(`(?:\\${Ry}(?<code>\\d+)m|\\${TU}(?<uri>.*)${zU})`).exec(h.slice(U).join(""))||{groups:{}};if(Y.code!==void 0){const G=Number.parseFloat(Y.code);$=G===T3D?void 0:G}else Y.uri!==void 0&&(C=Y.uri.length===0?void 0:Y.uri)}const A=z3D.codes.get(Number($));h[U+1]===`
45
+ `?(C&&(w+=zy("")),$&&A&&(w+=Jy(A))):I===`
46
+ `&&($&&A&&(w+=Jy($)),C&&(w+=zy(C)))}return w},R3D,Ky,V3D,Ny,qy,Oy,jy,N3D,v1=(D,F)=>N3D?D:F,q3D,O3D,j3D,P3D,WD="",VF="",XU,WU,y3D,Sy,k3D,W7=(D)=>{switch(D){case"initial":case"active":return H.cyan(q3D);case"cancel":return H.red(O3D);case"error":return H.yellow(j3D);case"submit":return H.green(P3D)}},b3D=(D)=>{return new jy({validate:D.validate,placeholder:D.placeholder,defaultValue:D.defaultValue,initialValue:D.initialValue,render(){const F=`${H.gray(WD)}
47
+ ${W7(this.state)} ${D.message}
48
+ `,E=D.placeholder?H.inverse(D.placeholder[0])+H.dim(D.placeholder.slice(1)):H.inverse(H.hidden("_")),w=this.value?this.valueWithCursor:E;switch(this.state){case"error":return`${F.trim()}
49
+ ${H.yellow(WD)} ${w}
50
+ ${H.yellow(VF)} ${H.yellow(this.error)}
51
+ `;case"submit":return`${F}${H.gray(WD)} ${H.dim(this.value||D.placeholder)}`;case"cancel":return`${F}${H.gray(WD)} ${H.strikethrough(H.dim(this.value??""))}${this.value?.trim()?"\n"+H.gray(WD):""}`;default:return`${F}${H.cyan(WD)} ${w}
52
+ ${H.cyan(VF)}
53
+ `}}}).prompt()},x3D=(D)=>{const F=D.active??"Yes",E=D.inactive??"No";return new Ny({active:F,inactive:E,initialValue:D.initialValue??!0,render(){const w=`${H.gray(WD)}
54
+ ${W7(this.state)} ${D.message}
55
+ `,$=this.value?F:E;switch(this.state){case"submit":return`${w}${H.gray(WD)} ${H.dim($)}`;case"cancel":return`${w}${H.gray(WD)} ${H.strikethrough(H.dim($))}
56
+ ${H.gray(WD)}`;default:return`${w}${H.cyan(WD)} ${this.value?`${H.green(XU)} ${F}`:`${H.dim(WU)} ${H.dim(F)}`} ${H.dim("/")} ${this.value?`${H.dim(WU)} ${H.dim(E)}`:`${H.green(XU)} ${E}`}
57
+ ${H.cyan(VF)}
58
+ `}}}).prompt()},c3D=(D)=>{const F=(E,w)=>{const $=E.label??String(E.value);switch(w){case"active":return`${H.green(XU)} ${$} ${E.hint?H.dim(`(${E.hint})`):""}`;case"selected":return`${H.dim($)}`;case"cancelled":return`${H.strikethrough(H.dim($))}`}return`${H.dim(WU)} ${H.dim($)}`};return new Oy({options:D.options,initialValue:D.initialValue,render(){const E=`${H.gray(WD)}
59
+ ${W7(this.state)} ${D.message}
60
+ `;switch(this.state){case"submit":return`${E}${H.gray(WD)} ${F(this.options[this.cursor],"selected")}`;case"cancel":return`${E}${H.gray(WD)} ${F(this.options[this.cursor],"cancelled")}
61
+ ${H.gray(WD)}`;default:return`${E}${H.cyan(WD)} ${this.options.map((w,$)=>F(w,$===this.cursor?"active":"inactive")).join(`
62
+ ${H.cyan(WD)} `)}
63
+ ${H.cyan(VF)}
64
+ `}}}).prompt()},g3D=(D)=>{const F=(E,w)=>{const $=E.label??String(E.value);switch(w){case"active":return`${H.cyan(y3D)} ${$} ${E.hint?H.dim(`(${E.hint})`):""}`;case"selected":return`${H.green(Sy)} ${H.dim($)}`;case"cancelled":return`${H.strikethrough(H.dim($))}`;case"active-selected":return`${H.green(Sy)} ${$} ${E.hint?H.dim(`(${E.hint})`):""}`;case"submitted":return`${H.dim($)}`}return`${H.dim(k3D)} ${H.dim($)}`};return new qy({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
+ ${H.reset(H.dim(`Press ${H.gray(H.bgWhite(H.inverse(" space ")))} to select, ${H.gray(H.bgWhite(H.inverse(" enter ")))} to submit`))}`},render(){const E=`${H.gray(WD)}
66
+ ${W7(this.state)} ${D.message}
67
+ `;switch(this.state){case"submit":return`${E}${H.gray(WD)} ${this.options.filter(({value:w})=>this.value.includes(w)).map((w)=>F(w,"submitted")).join(H.dim(", "))||H.dim("none")}`;case"cancel":{const w=this.options.filter(({value:$})=>this.value.includes($)).map(($)=>F($,"cancelled")).join(H.dim(", "));return`${E}${H.gray(WD)} ${w.trim()?`${w}
68
+ ${H.gray(WD)}`:""}`}case"error":{const w=this.error.split("\n").map(($,C)=>C===0?`${H.yellow(VF)} ${H.yellow($)}`:` ${$}`).join("\n");return E+H.yellow(WD)+" "+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
+ ${H.yellow(WD)} `)+"\n"+w+"\n"}default:return`${E}${H.cyan(WD)} ${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
+ ${H.cyan(WD)} `)}
71
+ ${H.cyan(VF)}
72
+ `}}}).prompt()};var yy=M(()=>{QU();CE();I7();M7();VD=`${MU}[`,YU={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:`${MU}7`,restore:`${MU}8`},B3D={up:(D=1)=>`${VD}S`.repeat(D),down:(D=1)=>`${VD}T`.repeat(D)},h3D={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?YU.up():"");if(D)F+=YU.left;return F}},L2={cursor:YU,scroll:B3D,erase:h3D,beep:C3D},JU={exports:{}},U3D=f3D,A3D=!(("NO_COLOR"in process.env)||process.argv.includes("--no-color"))&&(("FORCE_COLOR"in process.env)||process.argv.includes("--color")||process.platform==="win32"||U3D.isatty(1)&&process.env.TERM!=="dumb"||("CI"in process.env));JU.exports=Hy();JU.exports.createColors=Hy;I3D=JU.exports,AU=KU(I3D),ZU={},M3D={get exports(){return ZU},set exports(D){ZU=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}})(M3D);Y3D=ZU,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);X3D=Object.keys(SD.color),W3D=Object.keys(SD.bgColor);[...X3D];z3D=J3D(),X7=new Set(["\x1B","\x9B"]),TU=`${K3D}8;;`,R3D=Symbol("clack:cancel"),Ky=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),V3D=new Set(["up","down","left","right","space","enter"]);Ny=class Ny extends hE{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(L2.cursor.move(0,-1)),this.value=F,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};qy=class qy extends hE{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]}};Oy=class Oy extends hE{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}};jy=class jy extends hE{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}${AU.inverse(AU.hidden("_"))}`;else{const F=this.value.slice(0,this.cursor),E=this.value.slice(this.cursor);this.valueWithCursor=`${F}${AU.inverse(E[0])}${E.slice(1)}`}})}get cursor(){return this._cursor}};N3D=SU(),q3D=v1("\u276F",">"),O3D=v1("\u25A0","x"),j3D=v1("\u25B2","x"),P3D=v1("\u2714","\u221A"),XU=v1("\u25CF",">"),WU=v1("\u25CB"," "),y3D=v1("\u25FB","[\u2022]"),Sy=v1("\u25FC","[+]"),k3D=v1("\u25FB","[ ]")});import R2 from"process";function s3D(D){for(let F of _3D){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 AE(D){return D?D!=="false":!1}function m3D({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 l3D(D){if(typeof D!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof D}\``);return D.replace(n3D,"")}function KU(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function o3D(D,F){if(typeof D!=="string"||D.length===0)return 0;if(F={ambiguousIsNarrow:!0,countAnsiEscapeCodes:!1,...F},!F.countAnsiEscapeCodes)D=l3D(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(a3D().test($)){w+=2;continue}switch(p3D.eastAsianWidth($)){case"F":case"W":{w+=2;break}case"A":{w+=E;break}default:w+=1}}return w}function SU(){if(R2.platform!=="win32")return R2.env.TERM!=="linux";return Boolean(R2.env.CI)||Boolean(R2.env.WT_SESSION)||Boolean(R2.env.TERMINUS_SUBLIME)||R2.env.ConEmuTask==="{cmd::Cmder}"||R2.env.TERM_PROGRAM==="Terminus-Sublime"||R2.env.TERM_PROGRAM==="vscode"||R2.env.TERM==="xterm-256color"||R2.env.TERM==="alacritty"||R2.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}function by(D){if(!Intl.Segmenter)return Y0(D).length;return o3D(D)}function J7(D){return D.replace(/`([^`]+)`/gm,(F,E)=>H.cyan(E)).replace(/\s+_([^_]+)_\s+/gm,(F,E)=>` ${H.underline(E)} `)}function FED(D="white"){return H[D]||H.white}function EED(D="bgWhite"){return H[`bg${D[0].toUpperCase()}${D.slice(1)}`]||H.bgWhite}function T7(D={}){let F=wED();if(process.env.CONSOLA_LEVEL)F=Number.parseInt(process.env.CONSOLA_LEVEL)??F;return By({level:F,defaults:{level:F},stdout:process.stdout,stderr:process.stderr,prompt:(...w)=>Promise.resolve().then(() => (yy(),Py)).then(($)=>$.prompt(...w)),reporters:D.reporters||[D.fancy??!(cy||HU)?new ry:new G7],...D})}function wED(){if(v3D)return nD.debug;if(HU)return nD.warn;return nD.info}var _3D,z7,UE,xy,u3D,cy,d3D,v3D,HU,n3D,gy,i3D,p3D,a3D=()=>{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},t3D,e3D,DED,Y1=(D,F)=>DED?D:F,ky,ry,LU;var QU=M(()=>{I7();M7();CE();_3D=[["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"]],z7=typeof process!=="undefined"?process:{},UE=z7.env||{},xy=s3D(UE),u3D=typeof process!=="undefined"&&process.env&&"development"||"";z7.platform;xy.name;cy=AE(UE.CI)||xy.ci!==!1,d3D=AE(z7.stdout&&z7.stdout.isTTY),v3D=AE(UE.DEBUG),HU=u3D==="test"||AE(UE.TEST);AE(UE.MINIMAL);n3D=m3D(),gy={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}})(gy);i3D=gy.exports,p3D=KU(i3D),t3D={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},e3D={0:"red",1:"yellow"},DED=SU(),ky={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:""};ry=class ry extends G7{formatStack(D){return"\n"+hU(D).map((F)=>" "+F.replace(/^at +/,(E)=>H.gray(E)).replace(/\((.+)\)/,(E,w)=>`(${H.cyan(w)})`)).join("\n")}formatType(D,F,E){const w=t3D[D.type]||e3D[D.level]||"gray";if(F)return EED(w)(H.black(` ${D.type.toUpperCase()} `));const $=typeof ky[D.type]==="string"?ky[D.type]:D.icon||D.type;return $?FED(w)($):""}formatLogObj(D,F){const[E,...w]=this.formatArgs(D.args,F).split("\n");if(D.type==="box")return UU(J7(E+(w.length>0?"\n"+w.join("\n"):"")),{title:D.title?J7(D.title):void 0,style:D.style});const $=this.formatDate(D.date,F),C=$&&H.gray($),f=D.badge??D.level<2,B=this.formatType(D,f,F),h=D.tag?H.gray(D.tag):"";let U;const I=this.filterAndJoin([B,J7(E)]),A=this.filterAndJoin(F.columns?[h,C]:[h]),Y=(F.columns||0)-by(I)-by(A)-2;if(U=Y>0&&(F.columns||0)>=80?I+" ".repeat(Y)+A:(A?`${H.gray(`[${A}]`)} `:"")+I,U+=J7(w.length>0?"\n"+w.join("\n"):""),D.type==="trace"){const G=new Error("Trace: "+D.message);U+=this.formatStack(G.stack||"")}return f?"\n"+U+"\n":U}};LU=T7()});var ND=X((IcD,dy)=>{function uy(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 IED(D,F){let E={has:D,keys:F};return E.reset=fD.reset.bind(E),E.bold=fD.bold.bind(E),E.dim=fD.dim.bind(E),E.italic=fD.italic.bind(E),E.underline=fD.underline.bind(E),E.inverse=fD.inverse.bind(E),E.hidden=fD.hidden.bind(E),E.strikethrough=fD.strikethrough.bind(E),E.black=fD.black.bind(E),E.red=fD.red.bind(E),E.green=fD.green.bind(E),E.yellow=fD.yellow.bind(E),E.blue=fD.blue.bind(E),E.magenta=fD.magenta.bind(E),E.cyan=fD.cyan.bind(E),E.white=fD.white.bind(E),E.gray=fD.gray.bind(E),E.grey=fD.grey.bind(E),E.bgBlack=fD.bgBlack.bind(E),E.bgRed=fD.bgRed.bind(E),E.bgGreen=fD.bgGreen.bind(E),E.bgYellow=fD.bgYellow.bind(E),E.bgBlue=fD.bgBlue.bind(E),E.bgMagenta=fD.bgMagenta.bind(E),E.bgCyan=fD.bgCyan.bind(E),E.bgWhite=fD.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:fD.enabled?uy(this.keys,w+""):w+"";return w===void 0?IED([D],[E]):fD.enabled?uy([E],w+""):w+""}}var{FORCE_COLOR:hED,NODE_DISABLE_COLORS:UED,TERM:AED}=process.env,fD={enabled:!UED&&AED!=="dumb"&&hED!=="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)};dy.exports=fD});var my=X((GcD,vy)=>{vy.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 S7=X((McD,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 OD=X((YcD,ly)=>{var qD=`${"\x1B"}[`,VU={to(D,F){if(!F)return`${qD}${D+1}G`;return`${qD}${F+1};${D+1}H`},move(D,F){let E="";if(D<0)E+=`${qD}${-D}D`;else if(D>0)E+=`${qD}${D}C`;if(F<0)E+=`${qD}${-F}A`;else if(F>0)E+=`${qD}${F}B`;return E},up:(D=1)=>`${qD}${D}A`,down:(D=1)=>`${qD}${D}B`,forward:(D=1)=>`${qD}${D}C`,backward:(D=1)=>`${qD}${D}D`,nextLine:(D=1)=>`${qD}E`.repeat(D),prevLine:(D=1)=>`${qD}F`.repeat(D),left:`${qD}G`,hide:`${qD}?25l`,show:`${qD}?25h`,save:`${"\x1B"}7`,restore:`${"\x1B"}8`},GED={up:(D=1)=>`${qD}S`.repeat(D),down:(D=1)=>`${qD}T`.repeat(D)},MED={screen:`${qD}2J`,up:(D=1)=>`${qD}1J`.repeat(D),down:(D=1)=>`${qD}J`.repeat(D),line:`${qD}2K`,lineEnd:`${qD}K`,lineStart:`${qD}1K`,lines(D){let F="";for(let E=0;E<D;E++)F+=this.line+(E<D-1?VU.up():"");if(D)F+=VU.left;return F}};ly.exports={cursor:VU,scroll:GED,erase:MED,beep:"\x07"}});var ty=X((ZcD,oy)=>{function YED(D,F){var E=typeof Symbol!=="undefined"&&D[Symbol.iterator]||D["@@iterator"];if(!E){if(Array.isArray(D)||(E=ZED(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 ZED(D,F){if(!D)return;if(typeof D==="string")return iy(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 iy(D,F)}function iy(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 XED=S7(),ay=OD(),py=ay.erase,WED=ay.cursor,JED=(D)=>[...XED(D)].length;oy.exports=function(D,F){if(!F)return py.line+WED.to(0);let E=0;const w=D.split(/\r?\n/);var $=YED(w),C;try{for($.s();!(C=$.n()).done;){let f=C.value;E+=1+Math.floor(Math.max(JED(f)-1,0)/F)}}catch(f){$.e(f)}finally{$.f()}return py.lines(E)}});var NU=X((XcD,ey)=>{var GE={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},zED={arrowUp:GE.arrowUp,arrowDown:GE.arrowDown,arrowLeft:GE.arrowLeft,arrowRight:GE.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},TED=process.platform==="win32"?zED:GE;ey.exports=TED});var Fk=X((WcD,Dk)=>{var NF=ND(),Z6=NU(),qU=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}`}}),KED=(D)=>qU[D]||qU.default,ME=Object.freeze({aborted:NF.red(Z6.cross),done:NF.green(Z6.tick),exited:NF.yellow(Z6.cross),default:NF.cyan("?")}),SED=(D,F,E)=>F?ME.aborted:E?ME.exited:D?ME.done:ME.default,QED=(D)=>NF.gray(D?Z6.ellipsis:Z6.pointerSmall),HED=(D,F)=>NF.gray(D?F?Z6.pointerSmall:"+":Z6.line);Dk.exports={styles:qU,render:KED,symbols:ME,symbol:SED,delimiter:QED,item:HED}});var wk=X((JcD,Ek)=>{var LED=S7();Ek.exports=function(D,F){let E=String(LED(D)||"").split(/\r?\n/);if(!F)return E.length;return E.map((w)=>Math.ceil(w.length/F)).reduce((w,$)=>w+$)}});var fk=X((zcD,$k)=>{$k.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 Bk=X((TcD,Ck)=>{Ck.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 V2=X((KcD,hk)=>{hk.exports={action:my(),clear:ty(),style:Fk(),strip:S7(),figures:NU(),lines:wk(),wrap:fk(),entriesToDisplay:Bk()}});var n1=X((ScD,Gk)=>{var Uk=import.meta.require("readline"),RED=V2(),VED=RED.action,NED=import.meta.require("events"),Ak=OD(),qED=Ak.beep,OED=Ak.cursor,jED=ND();class Ik extends NED{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=Uk.createInterface({input:this.in,escapeCodeTimeout:50});if(Uk.emitKeypressEvents(this.in,F),this.in.isTTY)this.in.setRawMode(!0);const E=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,w=($,C)=>{let f=VED(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(OED.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(qED)}render(){if(this.onRender(jED),this.firstRender)this.firstRender=!1}}Gk.exports=Ik});var Jk=X((QcD,Wk)=>{function Mk(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 Yk(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){Mk(C,w,$,f,B,"next",h)}function B(h){Mk(C,w,$,f,B,"throw",h)}f(void 0)})}}var Q7=ND(),PED=n1(),Zk=OD(),yED=Zk.erase,YE=Zk.cursor,H7=V2(),OU=H7.style,jU=H7.clear,kED=H7.lines,bED=H7.figures;class Xk extends PED{constructor(D={}){super(D);this.transform=OU.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=jU("",this.out.columns),this.render()}set value(D){if(!D&&this.initial)this.placeholder=!0,this.rendered=Q7.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 Yk(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 Yk(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(YE.down(kED(this.outputError,this.out.columns)-1)+jU(this.outputError,this.out.columns));this.out.write(jU(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[OU.symbol(this.done,this.aborted),Q7.bold(this.msg),OU.delimiter(this.done),this.red?Q7.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":bED.pointerSmall} ${Q7.red().italic(F)}`,"");this.out.write(yED.line+YE.to(0)+this.outputText+YE.save+this.outputError+YE.restore+YE.move(this.cursorOffset,0))}}Wk.exports=Xk});var Qk=X((HcD,Sk)=>{var l1=ND(),xED=n1(),ZE=V2(),zk=ZE.style,Tk=ZE.clear,L7=ZE.figures,cED=ZE.wrap,gED=ZE.entriesToDisplay,rED=OD(),_ED=rED.cursor;class Kk extends xED{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=Tk("",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(_ED.hide);else this.out.write(Tk(this.outputText,this.out.columns));super.render();let D=gED(this.cursor,this.choices.length,this.optionsPerPage),F=D.startIndex,E=D.endIndex;if(this.outputText=[zk.symbol(this.done,this.aborted),l1.bold(this.msg),zk.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=L7.arrowUp;else if(w===E-1&&E<this.choices.length)C=L7.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(L7.pointer)+" ":" ")+C;else if($=this.cursor===w?l1.cyan().underline(B.title):B.title,C=(this.cursor===w?l1.cyan(L7.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"+cED(B.description,{margin:3,width:this.out.columns})}this.outputText+=`${C} ${$}${l1.gray(f)}\n`}}this.out.write(this.outputText)}}Sk.exports=Kk});var Ok=X((LcD,qk)=>{var R7=ND(),sED=n1(),Rk=V2(),Hk=Rk.style,uED=Rk.clear,Vk=OD(),Lk=Vk.cursor,dED=Vk.erase;class Nk extends sED{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(Lk.hide);else this.out.write(uED(this.outputText,this.out.columns));super.render(),this.outputText=[Hk.symbol(this.done,this.aborted),R7.bold(this.msg),Hk.delimiter(this.done),this.value?this.inactive:R7.cyan().underline(this.inactive),R7.gray("/"),this.value?R7.cyan().underline(this.active):this.active].join(" "),this.out.write(dED.line+Lk.to(0)+this.outputText)}}qk.exports=Nk});var Z1=X((RcD,jk)=>{class V7{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 V7)}setTo(D){}prev(){let D=[].concat(this.parts).reverse();const F=D.indexOf(this);return D.find((E,w)=>w>F&&E instanceof V7)}toString(){return String(this.date)}}jk.exports=V7});var kk=X((VcD,yk)=>{var vED=Z1();class Pk 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}}yk.exports=Pk});var ck=X((NcD,xk)=>{var mED=Z1(),nED=(D)=>{return D=D%10,D===1?"st":D===2?"nd":D===3?"rd":"th"};class bk extends mED{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+nED(D):this.token==="d"?F+1:this.token==="ddd"?this.locales.weekdaysShort[F]:this.token==="dddd"?this.locales.weekdays[F]:D}}xk.exports=bk});var _k=X((qcD,rk)=>{var lED=Z1();class gk extends lED{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}}rk.exports=gk});var dk=X((OcD,uk)=>{var iED=Z1();class sk extends iED{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)}}uk.exports=sk});var nk=X((jcD,mk)=>{var pED=Z1();class vk 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}}mk.exports=vk});var pk=X((PcD,ik)=>{var aED=Z1();class lk extends aED{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)}}ik.exports=lk});var tk=X((ycD,ok)=>{var oED=Z1();class ak extends oED{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}}ok.exports=ak});var Fb=X((kcD,Db)=>{var tED=Z1();class ek extends tED{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}}Db.exports=ek});var wb=X((bcD,Eb)=>{Eb.exports={DatePart:Z1(),Meridiem:kk(),Day:ck(),Hours:_k(),Milliseconds:dk(),Minutes:nk(),Month:pk(),Seconds:tk(),Year:Fb()}});var Yb=X((xcD,Mb)=>{function $b(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 fb(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){$b(C,w,$,f,B,"next",h)}function B(h){$b(C,w,$,f,B,"throw",h)}f(void 0)})}}var PU=ND(),eED=n1(),yU=V2(),Cb=yU.style,Bb=yU.clear,DwD=yU.figures,Ib=OD(),FwD=Ib.erase,hb=Ib.cursor,i1=wb(),Ub=i1.DatePart,EwD=i1.Meridiem,wwD=i1.Day,$wD=i1.Hours,fwD=i1.Milliseconds,CwD=i1.Minutes,BwD=i1.Month,hwD=i1.Seconds,UwD=i1.Year,AwD=/\\(.)|"((?:\\["\\]|[^"])+)"|(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,Ab={1:({token:D})=>D.replace(/\\(.)/g,"$1"),2:(D)=>new wwD(D),3:(D)=>new BwD(D),4:(D)=>new UwD(D),5:(D)=>new EwD(D),6:(D)=>new $wD(D),7:(D)=>new CwD(D),8:(D)=>new hwD(D),9:(D)=>new fwD(D)},IwD={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 Gb extends eED{constructor(D={}){super(D);this.msg=D.message,this.cursor=0,this.typed="",this.locales=Object.assign(IwD,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=Bb("",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=AwD.exec(D)){let w=F.shift(),$=F.findIndex((C)=>C!=null);this.parts.push($ in Ab?Ab[$]({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 Ub)),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 fb(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 fb(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 Ub)),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(hb.hide);else this.out.write(Bb(this.outputText,this.out.columns));if(super.render(),this.outputText=[Cb.symbol(this.done,this.aborted),PU.bold(this.msg),Cb.delimiter(!1),this.parts.reduce((D,F,E)=>D.concat(E===this.cursor&&!this.done?PU.cyan().underline(F.toString()):F),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":DwD.pointerSmall} ${PU.red().italic(F)}`,"");this.out.write(FwD.line+hb.to(0)+this.outputText)}}Mb.exports=Gb});var Sb=X((ccD,Kb)=>{function Zb(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 Xb(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){Zb(C,w,$,f,B,"next",h)}function B(h){Zb(C,w,$,f,B,"throw",h)}f(void 0)})}}var N7=ND(),GwD=n1(),zb=OD(),q7=zb.cursor,MwD=zb.erase,O7=V2(),kU=O7.style,YwD=O7.figures,Wb=O7.clear,ZwD=O7.lines,XwD=/[0-9]/,bU=(D)=>D!==void 0,Jb=(D,F)=>{let E=Math.pow(10,F);return Math.round(D*E)/E};class Tb extends GwD{constructor(D={}){super(D);this.transform=kU.render(D.style),this.msg=D.message,this.initial=bU(D.initial)?D.initial:"",this.float=!!D.float,this.round=D.round||2,this.inc=D.increment||1,this.min=bU(D.min)?D.min:-1/0,this.max=bU(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=N7.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${Jb(D,this.round)}`),this._value=Jb(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||XwD.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 Xb(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 Xb(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(q7.down(ZwD(this.outputError,this.out.columns)-1)+Wb(this.outputError,this.out.columns));this.out.write(Wb(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[kU.symbol(this.done,this.aborted),N7.bold(this.msg),kU.delimiter(this.done),!this.done||!this.done&&!this.placeholder?N7[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":YwD.pointerSmall} ${N7.red().italic(F)}`,"");this.out.write(MwD.line+q7.to(0)+this.outputText+q7.save+this.outputError+q7.restore)}}Kb.exports=Tb});var xU=X((gcD,Rb)=>{var X1=ND(),WwD=OD(),JwD=WwD.cursor,zwD=n1(),XE=V2(),Qb=XE.clear,g8=XE.figures,Hb=XE.style,TwD=XE.wrap,KwD=XE.entriesToDisplay;class Lb extends zwD{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=Qb("",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 ${g8.arrowUp}/${g8.arrowDown}: Highlight option\n ${g8.arrowLeft}/${g8.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?X1.green(g8.radioOn):g8.radioOff)+" "+w+" ";let C,f;if(F.disabled)C=D===E?X1.gray().underline(F.title):X1.strikethrough().gray(F.title);else if(C=D===E?X1.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"+TwD(F.description,{margin:$.length,width:this.out.columns})}return $+C+X1.gray(f||"")}paginateOptions(D){if(D.length===0)return X1.red("No matches for this query.");let F=KwD(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)$=g8.arrowUp;else if(f===w-1&&w<D.length)$=g8.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=[X1.gray(this.hint),this.renderInstructions()];if(this.value[this.cursor].disabled)D.push(X1.yellow(this.warn));return D.join(" ")}render(){if(this.closed)return;if(this.firstRender)this.out.write(JwD.hide);super.render();let D=[Hb.symbol(this.done,this.aborted),X1.bold(this.msg),Hb.delimiter(!1),this.renderDoneOrInstructions()].join(" ");if(this.showMinError)D+=X1.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=Qb(D,this.out.columns)}}Rb.exports=Lb});var kb=X((rcD,yb)=>{function Vb(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 SwD(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){Vb(C,w,$,f,B,"next",h)}function B(h){Vb(C,w,$,f,B,"throw",h)}f(void 0)})}}var WE=ND(),QwD=n1(),jb=OD(),HwD=jb.erase,Nb=jb.cursor,JE=V2(),cU=JE.style,qb=JE.clear,gU=JE.figures,LwD=JE.wrap,RwD=JE.entriesToDisplay,Ob=(D,F)=>D[F]&&(D[F].value||D[F].title||D[F]),VwD=(D,F)=>D[F]&&(D[F].title||D[F].value||D[F]),NwD=(D,F)=>{const E=D.findIndex((w)=>w.value===F||w.title===F);return E>-1?E:void 0};class Pb extends QwD{constructor(D={}){super(D);this.msg=D.message,this.suggest=D.suggest,this.choices=D.choices,this.initial=typeof D.initial==="number"?D.initial:NwD(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=cU.render(D.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=qb("",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=Ob(this.suggestions,D);else this.value=this.fallback.value;this.fire()}complete(D){var F=this;return SwD(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:VwD(B,f),value:Ob(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?gU.arrowUp:w?gU.arrowDown:" ",f=F?WE.cyan().underline(D.title):D.title;if(C=(F?WE.cyan(gU.pointer)+" ":" ")+C,D.description){if($=` - ${D.description}`,C.length+f.length+$.length>=this.out.columns||D.description.split(/\r?\n/).length>1)$="\n"+LwD(D.description,{margin:3,width:this.out.columns})}return C+" "+f+WE.gray($||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(Nb.hide);else this.out.write(qb(this.outputText,this.out.columns));super.render();let D=RwD(this.select,this.choices.length,this.limit),F=D.startIndex,E=D.endIndex;if(this.outputText=[cU.symbol(this.done,this.aborted,this.exited),WE.bold(this.msg),cU.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||WE.gray(this.fallback.title))}this.out.write(HwD.line+Nb.to(0)+this.outputText)}}yb.exports=Pb});var rb=X((_cD,gb)=>{var p1=ND(),qwD=OD(),OwD=qwD.cursor,jwD=xU(),rU=V2(),bb=rU.clear,xb=rU.style,qF=rU.figures;class cb extends jwD{constructor(D={}){D.overrideRender=!0;super(D);this.inputValue="",this.clear=bb("",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
+ ${qF.arrowUp}/${qF.arrowDown}: Highlight option
75
+ ${qF.arrowLeft}/${qF.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(qF.radioOn):qF.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(OwD.hide);super.render();let D=[xb.symbol(this.done,this.aborted),p1.bold(this.msg),xb.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=bb(D,this.out.columns)}}gb.exports=cb});var lb=X((scD,nb)=>{var _b=ND(),PwD=n1(),db=V2(),sb=db.style,ywD=db.clear,vb=OD(),kwD=vb.erase,ub=vb.cursor;class mb extends PwD{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(ub.hide);else this.out.write(ywD(this.outputText,this.out.columns));super.render(),this.outputText=[sb.symbol(this.done,this.aborted),_b.bold(this.msg),sb.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:_b.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(kwD.line+ub.to(0)+this.outputText)}}nb.exports=mb});var pb=X((ucD,ib)=>{ib.exports={TextPrompt:Jk(),SelectPrompt:Qk(),TogglePrompt:Ok(),DatePrompt:Yb(),NumberPrompt:Sb(),MultiselectPrompt:xU(),AutocompletePrompt:kb(),AutocompleteMultiselectPrompt:rb(),ConfirmPrompt:lb()}});var ob=X((ab)=>{function W1(D,F,E={}){return new Promise((w,$)=>{const C=new bwD[D](F),f=E.onAbort||j7,B=E.onSubmit||j7,h=E.onExit||j7;C.on("state",F.onState||j7),C.on("submit",(U)=>w(B(U))),C.on("exit",(U)=>w(h(U))),C.on("abort",(U)=>$(f(U)))})}var R0=ab,bwD=pb(),j7=(D)=>D;R0.text=(D)=>W1("TextPrompt",D);R0.password=(D)=>{return D.style="password",R0.text(D)};R0.invisible=(D)=>{return D.style="invisible",R0.text(D)};R0.number=(D)=>W1("NumberPrompt",D);R0.date=(D)=>W1("DatePrompt",D);R0.confirm=(D)=>W1("ConfirmPrompt",D);R0.list=(D)=>{const F=D.separator||",";return W1("TextPrompt",D,{onSubmit:(E)=>E.split(F).map((w)=>w.trim())})};R0.toggle=(D)=>W1("TogglePrompt",D);R0.select=(D)=>W1("SelectPrompt",D);R0.multiselect=(D)=>{D.choices=[].concat(D.choices||[]);const F=(E)=>E.filter((w)=>w.selected).map((w)=>w.value);return W1("MultiselectPrompt",D,{onAbort:F,onSubmit:F})};R0.autocompleteMultiselect=(D)=>{D.choices=[].concat(D.choices||[]);const F=(E)=>E.filter((w)=>w.selected).map((w)=>w.value);return W1("AutocompleteMultiselectPrompt",D,{onAbort:F,onSubmit:F})};var xwD=(D,F)=>Promise.resolve(F.filter((E)=>E.title.slice(0,D.length).toLowerCase()===D.toLowerCase()));R0.autocomplete=(D)=>{return D.suggest=D.suggest||xwD,D.choices=[].concat(D.choices||[]),W1("AutocompletePrompt",D)}});var fx=X((vcD,$x)=>{function tb(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 eb(D){for(var F=1;F<arguments.length;F++){var E=arguments[F]!=null?arguments[F]:{};if(F%2)tb(Object(E),!0).forEach(function(w){cwD(D,w,E[w])});else if(Object.getOwnPropertyDescriptors)Object.defineProperties(D,Object.getOwnPropertyDescriptors(E));else tb(Object(E)).forEach(function(w){Object.defineProperty(D,w,Object.getOwnPropertyDescriptor(E,w))})}return D}function cwD(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 gwD(D,F){var E=typeof Symbol!=="undefined"&&D[Symbol.iterator]||D["@@iterator"];if(!E){if(Array.isArray(D)||(E=rwD(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 rwD(D,F){if(!D)return;if(typeof D==="string")return Dx(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 Dx(D,F)}function Dx(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 Fx(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 Ex(D){return function(){var F=this,E=arguments;return new Promise(function(w,$){var C=D.apply(F,E);function f(h){Fx(C,w,$,f,B,"next",h)}function B(h){Fx(C,w,$,f,B,"throw",h)}f(void 0)})}}function r8(){return sU.apply(this,arguments)}function sU(){return sU=Ex(function*(D=[],{onSubmit:F=wx,onCancel:E=wx}={}){const w={},$=r8._override||{};D=[].concat(D);let C,f,B,h,U,I;const A=function(){var W=Ex(function*(J,K,L=!1){if(!L&&J.validate&&J.validate(K)!==!0)return;return J.format?yield J.format(K,w):K});return function J(K,L){return W.apply(this,arguments)}}();var Y=gwD(D),G;try{for(Y.s();!(G=Y.n()).done;){f=G.value;var Z=f;if(h=Z.name,U=Z.type,typeof U==="function")U=yield U(C,eb({},w),f),f.type=U;if(!U)continue;for(let W in f){if(_wD.includes(W))continue;let J=f[W];f[W]=typeof J==="function"?yield J(C,eb({},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,_U[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=r8._injected?swD(r8._injected,f.initial):yield _U[U](f),w[h]=C=yield A(f,C,!0),B=yield F(f,C,w)}catch(W){B=!(yield E(f,w))}if(B)return w}}catch(W){Y.e(W)}finally{Y.f()}return w}),sU.apply(this,arguments)}function swD(D,F){const E=D.shift();if(E instanceof Error)throw E;return E===void 0?F:E}function uwD(D){r8._injected=(r8._injected||[]).concat(D)}function dwD(D){r8._override=Object.assign({},D)}var _U=ob(),_wD=["suggest","format","onState","validate","onRender","type"],wx=()=>{};$x.exports=Object.assign(r8,{prompt:r8,prompts:_U,inject:uwD,override:dwD})});var Bx=X((mcD,Cx)=>{Cx.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 P7=X((ncD,hx)=>{hx.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 Ix=X((lcD,Ax)=>{var vwD=P7(),{erase:Ux,cursor:mwD}=OD(),nwD=(D)=>[...vwD(D)].length;Ax.exports=function(D,F){if(!F)return Ux.line+mwD.to(0);let E=0;const w=D.split(/\r?\n/);for(let $ of w)E+=1+Math.floor(Math.max(nwD($)-1,0)/F);return Ux.lines(E)}});var uU=X((icD,Gx)=>{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"},lwD={arrowUp:zE.arrowUp,arrowDown:zE.arrowDown,arrowLeft:zE.arrowLeft,arrowRight:zE.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},iwD=process.platform==="win32"?lwD:zE;Gx.exports=iwD});var Yx=X((pcD,Mx)=>{var OF=ND(),X6=uU(),dU=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)=>dU[D]||dU.default,TE=Object.freeze({aborted:OF.red(X6.cross),done:OF.green(X6.tick),exited:OF.yellow(X6.cross),default:OF.cyan("?")}),awD=(D,F,E)=>F?TE.aborted:E?TE.exited:D?TE.done:TE.default,owD=(D)=>OF.gray(D?X6.ellipsis:X6.pointerSmall),twD=(D,F)=>OF.gray(D?F?X6.pointerSmall:"+":X6.line);Mx.exports={styles:dU,render:pwD,symbols:TE,symbol:awD,delimiter:owD,item:twD}});var Xx=X((acD,Zx)=>{var ewD=P7();Zx.exports=function(D,F){let E=String(ewD(D)||"").split(/\r?\n/);if(!F)return E.length;return E.map((w)=>Math.ceil(w.length/F)).reduce((w,$)=>w+$)}});var Jx=X((ocD,Wx)=>{Wx.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 Tx=X((tcD,zx)=>{zx.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=X((ecD,Kx)=>{Kx.exports={action:Bx(),clear:Ix(),style:Yx(),strip:P7(),figures:uU(),lines:Xx(),wrap:Jx(),entriesToDisplay:Tx()}});var a1=X((DgD,Hx)=>{var Sx=import.meta.require("readline"),{action:D$D}=N2(),F$D=import.meta.require("events"),{beep:E$D,cursor:w$D}=OD(),$$D=ND();class Qx extends F$D{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=Sx.createInterface({input:this.in,escapeCodeTimeout:50});if(Sx.emitKeypressEvents(this.in,F),this.in.isTTY)this.in.setRawMode(!0);const E=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,w=($,C)=>{let f=D$D(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(w$D.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(E$D)}render(){if(this.onRender($$D),this.firstRender)this.firstRender=!1}}Hx.exports=Qx});var Vx=X((FgD,Rx)=>{var y7=ND(),f$D=a1(),{erase:C$D,cursor:KE}=OD(),{style:vU,clear:mU,lines:B$D,figures:h$D}=N2();class Lx extends f$D{constructor(D={}){super(D);this.transform=vU.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=mU("",this.out.columns),this.render()}set value(D){if(!D&&this.initial)this.placeholder=!0,this.rendered=y7.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(KE.down(B$D(this.outputError,this.out.columns)-1)+mU(this.outputError,this.out.columns));this.out.write(mU(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[vU.symbol(this.done,this.aborted),y7.bold(this.msg),vU.delimiter(this.done),this.red?y7.red(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":h$D.pointerSmall} ${y7.red().italic(F)}`,"");this.out.write(C$D.line+KE.to(0)+this.outputText+KE.save+this.outputError+KE.restore+KE.move(this.cursorOffset,0))}}Rx.exports=Lx});var Px=X((EgD,jx)=>{var o1=ND(),U$D=a1(),{style:Nx,clear:qx,figures:k7,wrap:A$D,entriesToDisplay:I$D}=N2(),{cursor:G$D}=OD();class Ox extends U$D{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=qx("",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(G$D.hide);else this.out.write(qx(this.outputText,this.out.columns));super.render();let{startIndex:D,endIndex:F}=I$D(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Nx.symbol(this.done,this.aborted),o1.bold(this.msg),Nx.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)$=k7.arrowUp;else if(E===F-1&&F<this.choices.length)$=k7.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(k7.pointer)+" ":" ")+$;else if(w=this.cursor===E?o1.cyan().underline(f.title):f.title,$=(this.cursor===E?o1.cyan(k7.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"+A$D(f.description,{margin:3,width:this.out.columns})}this.outputText+=`${$} ${w}${o1.gray(C)}\n`}}this.out.write(this.outputText)}}jx.exports=Ox});var cx=X((wgD,xx)=>{var b7=ND(),M$D=a1(),{style:yx,clear:Y$D}=N2(),{cursor:kx,erase:Z$D}=OD();class bx extends M$D{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(kx.hide);else this.out.write(Y$D(this.outputText,this.out.columns));super.render(),this.outputText=[yx.symbol(this.done,this.aborted),b7.bold(this.msg),yx.delimiter(this.done),this.value?this.inactive:b7.cyan().underline(this.inactive),b7.gray("/"),this.value?b7.cyan().underline(this.active):this.active].join(" "),this.out.write(Z$D.line+kx.to(0)+this.outputText)}}xx.exports=bx});var J1=X(($gD,gx)=>{class x7{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 x7)}setTo(D){}prev(){let D=[].concat(this.parts).reverse();const F=D.indexOf(this);return D.find((E,w)=>w>F&&E instanceof x7)}toString(){return String(this.date)}}gx.exports=x7});var sx=X((fgD,_x)=>{var X$D=J1();class rx extends X$D{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}}_x.exports=rx});var vx=X((CgD,dx)=>{var W$D=J1(),J$D=(D)=>{return D=D%10,D===1?"st":D===2?"nd":D===3?"rd":"th"};class ux extends W$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+J$D(D):this.token==="d"?F+1:this.token==="ddd"?this.locales.weekdaysShort[F]:this.token==="dddd"?this.locales.weekdays[F]:D}}dx.exports=ux});var lx=X((BgD,nx)=>{var z$D=J1();class mx extends z$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=mx});var ax=X((hgD,px)=>{var T$D=J1();class ix extends T$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)}}px.exports=ix});var ex=X((UgD,tx)=>{var K$D=J1();class ox extends K$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}}tx.exports=ox});var Ec=X((AgD,Fc)=>{var S$D=J1();class Dc extends S$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)}}Fc.exports=Dc});var fc=X((IgD,$c)=>{var Q$D=J1();class wc extends Q$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}}$c.exports=wc});var hc=X((GgD,Bc)=>{var H$D=J1();class Cc extends H$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}}Bc.exports=Cc});var Ac=X((MgD,Uc)=>{Uc.exports={DatePart:J1(),Meridiem:sx(),Day:vx(),Hours:lx(),Milliseconds:ax(),Minutes:ex(),Month:Ec(),Seconds:fc(),Year:hc()}});var Jc=X((YgD,Wc)=>{var nU=ND(),L$D=a1(),{style:Ic,clear:Gc,figures:R$D}=N2(),{erase:V$D,cursor:Mc}=OD(),{DatePart:Yc,Meridiem:N$D,Day:q$D,Hours:O$D,Milliseconds:j$D,Minutes:P$D,Month:y$D,Seconds:k$D,Year:b$D}=Ac(),x$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,Zc={1:({token:D})=>D.replace(/\\(.)/g,"$1"),2:(D)=>new q$D(D),3:(D)=>new y$D(D),4:(D)=>new b$D(D),5:(D)=>new N$D(D),6:(D)=>new O$D(D),7:(D)=>new P$D(D),8:(D)=>new k$D(D),9:(D)=>new j$D(D)},c$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 Xc extends L$D{constructor(D={}){super(D);this.msg=D.message,this.cursor=0,this.typed="",this.locales=Object.assign(c$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=Gc("",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=x$D.exec(D)){let w=F.shift(),$=F.findIndex((C)=>C!=null);this.parts.push($ in Zc?Zc[$]({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 Yc)),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 Yc)),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(Mc.hide);else this.out.write(Gc(this.outputText,this.out.columns));if(super.render(),this.outputText=[Ic.symbol(this.done,this.aborted),nU.bold(this.msg),Ic.delimiter(!1),this.parts.reduce((D,F,E)=>D.concat(E===this.cursor&&!this.done?nU.cyan().underline(F.toString()):F),[]).join("")].join(" "),this.error)this.outputText+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":R$D.pointerSmall} ${nU.red().italic(F)}`,"");this.out.write(V$D.line+Mc.to(0)+this.outputText)}}Wc.exports=Xc});var Qc=X((ZgD,Sc)=>{var c7=ND(),g$D=a1(),{cursor:g7,erase:r$D}=OD(),{style:lU,figures:_$D,clear:zc,lines:s$D}=N2(),u$D=/[0-9]/,iU=(D)=>D!==void 0,Tc=(D,F)=>{let E=Math.pow(10,F);return Math.round(D*E)/E};class Kc extends g$D{constructor(D={}){super(D);this.transform=lU.render(D.style),this.msg=D.message,this.initial=iU(D.initial)?D.initial:"",this.float=!!D.float,this.round=D.round||2,this.inc=D.increment||1,this.min=iU(D.min)?D.min:-1/0,this.max=iU(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=c7.gray(this.transform.render(`${this.initial}`)),this._value="";else this.placeholder=!1,this.rendered=this.transform.render(`${Tc(D,this.round)}`),this._value=Tc(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||u$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(g7.down(s$D(this.outputError,this.out.columns)-1)+zc(this.outputError,this.out.columns));this.out.write(zc(this.outputText,this.out.columns))}if(super.render(),this.outputError="",this.outputText=[lU.symbol(this.done,this.aborted),c7.bold(this.msg),lU.delimiter(this.done),!this.done||!this.done&&!this.placeholder?c7[this.color]().underline(this.rendered):this.rendered].join(" "),this.error)this.outputError+=this.errorMsg.split("\n").reduce((D,F,E)=>D+`\n${E?" ":_$D.pointerSmall} ${c7.red().italic(F)}`,"");this.out.write(r$D.line+g7.to(0)+this.outputText+g7.save+this.outputError+g7.restore)}}Sc.exports=Kc});var pU=X((XgD,Vc)=>{var z1=ND(),{cursor:d$D}=OD(),v$D=a1(),{clear:Hc,figures:_8,style:Lc,wrap:m$D,entriesToDisplay:n$D}=N2();class Rc 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=Hc("",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 ${_8.arrowUp}/${_8.arrowDown}: Highlight option\n ${_8.arrowLeft}/${_8.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(_8.radioOn):_8.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"+m$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}=n$D(this.cursor,D.length,this.optionsPerPage),w,$=[];for(let C=F;C<E;C++){if(C===F&&F>0)w=_8.arrowUp;else if(C===E-1&&E<D.length)w=_8.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(d$D.hide);super.render();let D=[Lc.symbol(this.done,this.aborted),z1.bold(this.msg),Lc.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=Hc(D,this.out.columns)}}Vc.exports=Rc});var yc=X((WgD,Pc)=>{var SE=ND(),l$D=a1(),{erase:i$D,cursor:Nc}=OD(),{style:aU,clear:qc,figures:oU,wrap:p$D,entriesToDisplay:a$D}=N2(),Oc=(D,F)=>D[F]&&(D[F].value||D[F].title||D[F]),o$D=(D,F)=>D[F]&&(D[F].title||D[F].value||D[F]),t$D=(D,F)=>{const E=D.findIndex((w)=>w.value===F||w.title===F);return E>-1?E:void 0};class jc extends l$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:t$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=aU.render(D.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=qc("",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=Oc(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:o$D(f,C),value:Oc(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?oU.arrowUp:w?oU.arrowDown:" ",f=F?SE.cyan().underline(D.title):D.title;if(C=(F?SE.cyan(oU.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+SE.gray($||"")}render(){if(this.closed)return;if(this.firstRender)this.out.write(Nc.hide);else this.out.write(qc(this.outputText,this.out.columns));super.render();let{startIndex:D,endIndex:F}=a$D(this.select,this.choices.length,this.limit);if(this.outputText=[aU.symbol(this.done,this.aborted,this.exited),SE.bold(this.msg),aU.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||SE.gray(this.fallback.title))}this.out.write(i$D.line+Nc.to(0)+this.outputText)}}Pc.exports=jc});var gc=X((JgD,cc)=>{var t1=ND(),{cursor:e$D}=OD(),D4D=pU(),{clear:kc,style:bc,figures:jF}=N2();class xc extends D4D{constructor(D={}){D.overrideRender=!0;super(D);this.inputValue="",this.clear=kc("",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
+ ${jF.arrowUp}/${jF.arrowDown}: Highlight option
82
+ ${jF.arrowLeft}/${jF.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(jF.radioOn):jF.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(e$D.hide);super.render();let D=[bc.symbol(this.done,this.aborted),t1.bold(this.msg),bc.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=kc(D,this.out.columns)}}cc.exports=xc});var vc=X((zgD,dc)=>{var rc=ND(),F4D=a1(),{style:_c,clear:E4D}=N2(),{erase:w4D,cursor:sc}=OD();class uc extends F4D{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(sc.hide);else this.out.write(E4D(this.outputText,this.out.columns));super.render(),this.outputText=[_c.symbol(this.done,this.aborted),rc.bold(this.msg),_c.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:rc.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(w4D.line+sc.to(0)+this.outputText)}}dc.exports=uc});var nc=X((TgD,mc)=>{mc.exports={TextPrompt:Vx(),SelectPrompt:Px(),TogglePrompt:cx(),DatePrompt:Jc(),NumberPrompt:Qc(),MultiselectPrompt:pU(),AutocompletePrompt:yc(),AutocompleteMultiselectPrompt:gc(),ConfirmPrompt:vc()}});var ic=X((lc)=>{function T1(D,F,E={}){return new Promise((w,$)=>{const C=new $4D[D](F),f=E.onAbort||r7,B=E.onSubmit||r7,h=E.onExit||r7;C.on("state",F.onState||r7),C.on("submit",(U)=>w(B(U))),C.on("exit",(U)=>w(h(U))),C.on("abort",(U)=>$(f(U)))})}var V0=lc,$4D=nc(),r7=(D)=>D;V0.text=(D)=>T1("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)=>T1("NumberPrompt",D);V0.date=(D)=>T1("DatePrompt",D);V0.confirm=(D)=>T1("ConfirmPrompt",D);V0.list=(D)=>{const F=D.separator||",";return T1("TextPrompt",D,{onSubmit:(E)=>E.split(F).map((w)=>w.trim())})};V0.toggle=(D)=>T1("TogglePrompt",D);V0.select=(D)=>T1("SelectPrompt",D);V0.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})};V0.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 f4D=(D,F)=>Promise.resolve(F.filter((E)=>E.title.slice(0,D.length).toLowerCase()===D.toLowerCase()));V0.autocomplete=(D)=>{return D.suggest=D.suggest||f4D,D.choices=[].concat(D.choices||[]),T1("AutocompletePrompt",D)}});var oc=X((SgD,ac)=>{async function s8(D=[],{onSubmit:F=pc,onCancel:E=pc}={}){const w={},$=s8._override||{};D=[].concat(D);let C,f,B,h,U,I;const A=async(Y,G,Z=!1)=>{if(!Z&&Y.validate&&Y.validate(G)!==!0)return;return Y.format?await Y.format(G,w):G};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(C4D.includes(Y))continue;let G=f[Y];f[Y]=typeof G==="function"?await G(C,{...w},I):G}if(I=f,typeof f.message!=="string")throw new Error("prompt message is required");if({name:h,type:U}=f,tU[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=s8._injected?B4D(s8._injected,f.initial):await tU[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 B4D(D,F){const E=D.shift();if(E instanceof Error)throw E;return E===void 0?F:E}function h4D(D){s8._injected=(s8._injected||[]).concat(D)}function U4D(D){s8._override=Object.assign({},D)}var tU=ic(),C4D=["suggest","format","onState","validate","onRender","type"],pc=()=>{};ac.exports=Object.assign(s8,{prompt:s8,prompts:tU,inject:h4D,override:U4D})});var ec=X((QgD,tc)=>{function A4D(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}tc.exports=A4D("8.6.0")?fx():oc()});var Ag=X((brD,Ug)=>{function HE(D){this.capacity=D|0,this.map=Object.create(null),this.list=new s7}function s7(){this.firstNode=null,this.lastNode=null}function a4D(D,F){this.key=D,this.val=F,this.prev=null,this.next=null}Ug.exports=function(D){return new HE(D)};HE.prototype.get=function(D){var F=this.map[D];if(F==null)return;return this.used(F),F.val};HE.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 a4D(D,F),this.map[D]=E,this.capacity--}return this.used(E),!0};HE.prototype.used=function(D){this.list.moveToFront(D)};HE.prototype.prune=function(){var D=this.list.pop();if(D!=null)delete this.map[D.key],this.capacity++};s7.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};s7.prototype.pop=function(){var D=this.lastNode;if(D!=null)this.remove(D);return D};s7.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 Wg=X((Xg)=>{function LE(D,F,E){return Yg.createHmac("sha256",D).update(F,"utf8").digest(E)}function DA(D,F){return Yg.createHash("sha256").update(D,"utf8").digest(F)}function Zg(D){return D.replace(/[!'()*]/g,function(F){return"%"+F.charCodeAt(0).toString(16).toUpperCase()})}function u7(D){return Zg(encodeURIComponent(D))}function cD(D,F){if(typeof D==="string")D=o4D.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 Gg=Xg,o4D=import.meta.require("url"),Mg=import.meta.require("querystring"),Yg=import.meta.require("crypto"),t4D=Ag(),Ig=t4D(1000),e4D={authorization:!0,connection:!0,"x-amzn-trace-id":!0,"user-agent":!0,expect:!0,"presigned-expires":!0,range:!0};cD.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};cD.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};cD.prototype.createHost=function(){var D=this.isSingleRegion()?"":"."+this.region,F=this.service==="ses"?"email":this.service;return F+D+".amazonaws.com"};cD.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"]=DA(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}};cD.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};cD.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};cD.prototype.getDate=function(){return this.getDateTime().substr(0,8)};cD.prototype.authHeader=function(){return["AWS4-HMAC-SHA256 Credential="+this.credentials.accessKeyId+"/"+this.credentialString(),"SignedHeaders="+this.signedHeaders(),"Signature="+this.signature()].join(", ")};cD.prototype.signature=function(){var D=this.getDate(),F=[this.credentials.secretAccessKey,D,this.region,this.service].join(),E,w,$,C=Ig.get(F);if(!C)E=LE("AWS4"+this.credentials.secretAccessKey,D),w=LE(E,this.region),$=LE(w,this.service),C=LE($,"aws4_request"),Ig.set(F,C);return LE(C,this.stringToSign(),"hex")};cD.prototype.stringToSign=function(){return["AWS4-HMAC-SHA256",this.getDateTime(),this.credentialString(),DA(this.canonicalString(),"hex")].join("\n")};cD.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"]||DA(this.request.body||"","hex");if(F){var U=Object.keys(F).reduce(function(A,Y){if(!Y)return A;return A[u7(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+"="+u7(U[A]));else U[A].map(u7).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(u7(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")};cD.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]]||e4D[w[0]]==null&&!E[w[0]]}).sort(function(w,$){return w[0]<$[0]?-1:1})};cD.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")};cD.prototype.signedHeaders=function(){if(!this.filteredHeaders)this.filterHeaders();return this.filteredHeaders.map(function(D){return D[0]}).join(";")};cD.prototype.credentialString=function(){return[this.getDate(),this.region,this.service,"aws4_request"].join("/")};cD.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}};cD.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=Mg.parse(D.slice(F+1)),D=D.slice(0,F);this.parsedPath={path:D,query:E}};cD.prototype.formatPath=function(){var D=this.parsedPath.path,F=this.parsedPath.query;if(!F)return D;if(F[""]!=null)delete F[""];return D+"?"+Zg(Mg.stringify(F))};Gg.RequestSigner=cD;Gg.sign=function(D,F){return new cD(D,F).sign()}});import iDD from"process";z6();T6();K6();o8();n0();var MF=Q(rD(),1);var Dz=(D)=>({...D,eventStreamMarshaller:D.eventStreamSerdeProvider(D)});b6();UD();J2();y();var NK=Q(jD(),1);Z2();function So(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}var qK=async(D,F,E)=>{return{operation:v0(F).operation,region:await _D(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},OK=(D)=>{const F=[];switch(D.operation){default:F.push(So(D))}return F},jK=(D)=>{return{...NK.resolveAwsSdkSigV4Config(D)}};var PK=(D)=>{return{...D,useDualstackEndpoint:D.useDualstackEndpoint??!1,useFipsEndpoint:D.useFipsEndpoint??!1,defaultSigningName:"bedrock"}},B$={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var yK={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 bV=Q(jD(),1);a6();n6();n0();var CV=Q(Y9(),1),{__extends:nLD,__assign:lLD,__rest:iLD,__decorate:pLD,__param:aLD,__esDecorate:oLD,__runInitializers:tLD,__propKey:eLD,__setFunctionName:DRD,__metadata:FRD,__awaiter:BV,__generator:hV,__exportStar:ERD,__createBinding:wRD,__values:UV,__read:$RD,__spread:fRD,__spreadArrays:CRD,__spreadArray:BRD,__await:hRD,__asyncGenerator:URD,__asyncDelegator:ARD,__asyncValues:IRD,__makeTemplateObject:GRD,__importStar:MRD,__importDefault:YRD,__classPrivateFieldGet:ZRD,__classPrivateFieldSet:XRD,__classPrivateFieldIn:WRD,__addDisposableResource:JRD,__disposeResources:zRD}=CV.default;import{Buffer as AV}from"buffer";var IV=(D,F)=>{if(typeof D!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof D} (${D})`);return F?AV.from(D,F):AV.from(D)};var zB=(D)=>{const F=IV(D,"utf8");return new Uint8Array(F.buffer,F.byteOffset,F.byteLength/Uint8Array.BYTES_PER_ELEMENT)};function TB(D){if(D instanceof Uint8Array)return D;if(typeof D==="string")return GDD(D);if(ArrayBuffer.isView(D))return new Uint8Array(D.buffer,D.byteOffset,D.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(D)}var GDD=typeof Buffer!=="undefined"&&Buffer.from?function(D){return Buffer.from(D,"utf8")}:zB;function KB(D){if(typeof D==="string")return D.length===0;return D.byteLength===0}function SB(D){return new Uint8Array([(D&4278190080)>>24,(D&16711680)>>16,(D&65280)>>8,D&255])}function QB(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 MDD=function(){function D(){this.crc32=new h6}return D.prototype.update=function(F){if(KB(F))return;this.crc32.update(TB(F))},D.prototype.digest=function(){return BV(this,void 0,void 0,function(){return hV(this,function(F){return[2,SB(this.crc32.digest())]})})},D.prototype.reset=function(){this.crc32=new h6},D}();var h6=function(){function D(){this.checksum=4294967295}return D.prototype.update=function(F){var E,w;try{for(var $=UV(F),C=$.next();!C.done;C=$.next()){var f=C.value;this.checksum=this.checksum>>>8^ZDD[(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 YDD=[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],ZDD=QB(YDD);w$();w$();function GV(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)GV(F);return new GF(F)}valueOf(){const D=this.bytes.slice(0),F=D[0]&128;if(F)GV(D);return parseInt(o2(D),16)*(F?-1:1)}toString(){return String(this.valueOf())}}class HB{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(!HDD.test(D.value))throw new Error(`Invalid UUID received: ${D.value}`);const I=new Uint8Array(17);return I[0]=9,I.set(vT(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:YV,value:!0};break;case 1:F[$]={type:YV,value:!1};break;case 2:F[$]={type:XDD,value:D.getInt8(E++)};break;case 3:F[$]={type:WDD,value:D.getInt16(E,!1)},E+=2;break;case 4:F[$]={type:JDD,value:D.getInt32(E,!1)},E+=4;break;case 5:F[$]={type:zDD,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:TDD,value:new Uint8Array(D.buffer,D.byteOffset+E,C)},E+=C;break;case 7:const f=D.getUint16(E,!1);E+=2,F[$]={type:KDD,value:this.toUtf8(new Uint8Array(D.buffer,D.byteOffset+E,f))},E+=f;break;case 8:F[$]={type:SDD,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:QDD,value:`${o2(B.subarray(0,4))}-${o2(B.subarray(4,6))}-${o2(B.subarray(6,8))}-${o2(B.subarray(8,10))}-${o2(B.subarray(10))}`};break;default:throw new Error("Unrecognized header type tag")}}return F}}var MV;(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"})(MV||(MV={}));var YV="boolean",XDD="byte",WDD="short",JDD="integer",zDD="long",TDD="binary",KDD="string",SDD="timestamp",QDD="uuid",HDD=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;function XV({byteLength:D,byteOffset:F,buffer:E}){if(D<LDD)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(ZV,!1),f=w.getUint32(P8,!1),B=w.getUint32(D-U6,!1),h=new h6().update(new Uint8Array(E,F,P8));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+P8,D-(P8+U6))),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+P8+U6,C),body:new Uint8Array(E,F+P8+U6+C,$-C-(P8+U6+U6))}}var ZV=4,P8=ZV*2,U6=4,LDD=P8+U6*2;class LB{constructor(D,F){this.headerMarshaller=new HB(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 h6;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}=XV(D);return{headers:this.headerMarshaller.parse(F),body:E}}formatHeaders(D){return this.headerMarshaller.format(D)}}class RB{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 VB{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 NB{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 qB{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 WV(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 G=I-A;if(!$)$=new Uint8Array(4);const Z=Math.min(4-E,G);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 JV(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 a${constructor({utf8Encoder:D,utf8Decoder:F}){this.eventStreamCodec=new LB(D,F),this.utfEncoder=D}deserialize(D,F){const E=WV(D);return new NB({messageStream:new RB({inputStream:E,decoder:this.eventStreamCodec}),deserializer:JV(F,this.utfEncoder)})}serialize(D,F){return new VB({messageStream:new qB({inputStream:D,serializer:F}),encoder:this.eventStreamCodec,includeEndFrame:!0})}}import{Readable as RDD}from"stream";async function*zV(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 OB{constructor({utf8Encoder:D,utf8Decoder:F}){this.universalMarshaller=new a$({utf8Decoder:F,utf8Encoder:D})}deserialize(D,F){const E=typeof D[Symbol.asyncIterator]==="function"?D:zV(D);return this.universalMarshaller.deserialize(E,F)}serialize(D,F){return RDD.from(this.universalMarshaller.serialize(D,F))}}var TV=(D)=>new OB(D);l6();J2();v2();Z8();i6();O0();var yV=Q(jD(),1);y();M8();O1();a2();i8();M2();var KV={["required"]:!1,type:"String"},SV={["required"]:!0,default:!1,type:"Boolean"},QV={["ref"]:"Endpoint"},qV={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},OV={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},I1={},HV={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},LV={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsDualStack"]}]},RV=[qV],VV=[OV],NV=[{["ref"]:"Region"}],VDD={version:"1.0",parameters:{Region:KV,UseDualStack:SV,UseFIPS:SV,Endpoint:KV},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[QV]}],rules:[{conditions:RV,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{rules:[{conditions:VV,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:QV,properties:I1,headers:I1},type:"endpoint"}],type:"tree"}],type:"tree"},{rules:[{conditions:[{["fn"]:"isSet",["argv"]:NV}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:NV,assign:"PartitionResult"}],rules:[{conditions:[qV,OV],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,HV]},LV],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:RV,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[HV,!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:VV,rules:[{conditions:[LV],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=VDD;var NDD=new I2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),PV=(D,F={})=>{return NDD.get(D,()=>G2(jV,{endpointParams:D,logger:F.logger}))};f0.aws=Y2;var kV=(D)=>{return{apiVersion:"2023-09-30",base64Decoder:D?.base64Decoder??z0,base64Encoder:D?.base64Encoder??K0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??PV,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??OK,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new yV.AwsSdkSigV4Signer}],logger:D?.logger??new P0,serviceId:D?.serviceId??"Bedrock Runtime",urlParser:D?.urlParser??eD,utf8Decoder:D?.utf8Decoder??D0,utf8Encoder:D?.utf8Encoder??T0}};y();p6();y();var xV=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=kV(D);return bV.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,credentialDefaultProvider:D?.credentialDefaultProvider??T2,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:yK.version}),eventStreamSerdeProvider:D?.eventStreamSerdeProvider??TV,maxAttempts:D?.maxAttempts??i(l2),region:D?.region??i(m0,s2),requestHandler:h0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...p2,default:async()=>(await E()).retryMode||o0}),sha256:D?.sha256??z2.bind(null,"sha256"),streamCollector:D?.streamCollector??t0,useDualstackEndpoint:D?.useDualstackEndpoint??i(r2),useFipsEndpoint:D?.useFipsEndpoint??i(_2),userAgentAppId:D?.userAgentAppId??i(f1)}};o6();dD();y();var cV=(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}}},gV=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var o$=(D)=>D,rV=(D,F)=>{const E={...o$(h1(D)),...o$(F1(D)),...o$(O2(D)),...o$(cV(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...j2(E),...gV(E)}};class jB extends j0{constructor(...[D]){const F=xV(D||{}),E=PK(F),w=c2(E),$=i2(w),C=u2($),f=P2(C),B=m2(f),h=Dz(B),U=jK(h),I=rV(U,D?.extensions||[]);super(I);this.config=I,this.middlewareStack.use(g2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(d2(this.config)),this.middlewareStack.use(y2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(MF.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:qK,identityProviderConfigProvider:async(A)=>new MF.DefaultIdentityProviderConfig({"aws.auth#sigv4":A.credentials})})),this.middlewareStack.use(MF.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}var k0=Q(jD(),1),rB=Q(rD(),1);y();y();class $0 extends e0{constructor(D){super(D);Object.setPrototypeOf(this,$0.prototype)}}y();class t$ extends $0{constructor(D){super({name:"AccessDeniedException",$fault:"client",...D});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,t$.prototype)}}var _V;(function(D){D.visit=(F,E)=>{if(F.text!==void 0)return E.text(F.text);return E._(F.$unknown[0],F.$unknown[1])}})(_V||(_V={}));class e$ extends $0{constructor(D){super({name:"InternalServerException",$fault:"server",...D});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,e$.prototype)}}class D4 extends $0{constructor(D){super({name:"ResourceNotFoundException",$fault:"client",...D});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,D4.prototype)}}class F4 extends $0{constructor(D){super({name:"ServiceQuotaExceededException",$fault:"client",...D});this.name="ServiceQuotaExceededException",this.$fault="client",Object.setPrototypeOf(this,F4.prototype)}}class E4 extends $0{constructor(D){super({name:"ThrottlingException",$fault:"client",...D});this.name="ThrottlingException",this.$fault="client",Object.setPrototypeOf(this,E4.prototype)}}class w4 extends $0{constructor(D){super({name:"ValidationException",$fault:"client",...D});this.name="ValidationException",this.$fault="client",Object.setPrototypeOf(this,w4.prototype)}}var PB;(function(D){D.visit=(F,E)=>{if(F.bytes!==void 0)return E.bytes(F.bytes);return E._(F.$unknown[0],F.$unknown[1])}})(PB||(PB={}));var sV;(function(D){D.visit=(F,E)=>{if(F.text!==void 0)return E.text(F.text);return E._(F.$unknown[0],F.$unknown[1])}})(sV||(sV={}));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 kB;(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])}})(kB||(kB={}));var bB;(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])}})(bB||(bB={}));var uV;(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])}})(uV||(uV={}));var dV;(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])}})(dV||(dV={}));var xB;(function(D){D.visit=(F,E)=>{if(F.json!==void 0)return E.json(F.json);return E._(F.$unknown[0],F.$unknown[1])}})(xB||(xB={}));var cB;(function(D){D.visit=(F,E)=>{if(F.toolSpec!==void 0)return E.toolSpec(F.toolSpec);return E._(F.$unknown[0],F.$unknown[1])}})(cB||(cB={}));var vV;(function(D){D.visit=(F,E)=>{if(F.message!==void 0)return E.message(F.message);return E._(F.$unknown[0],F.$unknown[1])}})(vV||(vV={}));class $4 extends $0{constructor(D){super({name:"ModelErrorException",$fault:"client",...D});this.name="ModelErrorException",this.$fault="client",Object.setPrototypeOf(this,$4.prototype),this.originalStatusCode=D.originalStatusCode,this.resourceName=D.resourceName}}class f4 extends $0{constructor(D){super({name:"ModelNotReadyException",$fault:"client",...D});this.name="ModelNotReadyException",this.$fault="client",this.$retryable={},Object.setPrototypeOf(this,f4.prototype)}}class C4 extends $0{constructor(D){super({name:"ModelTimeoutException",$fault:"client",...D});this.name="ModelTimeoutException",this.$fault="client",Object.setPrototypeOf(this,C4.prototype)}}class B4 extends $0{constructor(D){super({name:"ServiceUnavailableException",$fault:"server",...D});this.name="ServiceUnavailableException",this.$fault="server",Object.setPrototypeOf(this,B4.prototype)}}var mV;(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])}})(mV||(mV={}));var nV;(function(D){D.visit=(F,E)=>{if(F.toolUse!==void 0)return E.toolUse(F.toolUse);return E._(F.$unknown[0],F.$unknown[1])}})(nV||(nV={}));class h4 extends $0{constructor(D){super({name:"ModelStreamErrorException",$fault:"client",...D});this.name="ModelStreamErrorException",this.$fault="client",Object.setPrototypeOf(this,h4.prototype),this.originalStatusCode=D.originalStatusCode,this.originalMessage=D.originalMessage}}var lV;(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])}})(lV||(lV={}));var iV;(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])}})(iV||(iV={}));var pV=(D)=>({...D,...D.body&&{body:ED}}),aV=(D)=>({...D,...D.body&&{body:ED}}),oV=(D)=>({...D,...D.body&&{body:ED}});var tV=(D)=>({...D,...D.body&&{body:"STREAMING_CONTENT"}});var eV=async(D,F)=>{const E=rB.requestBuilder(D,F),w=k({},X8,{[_B]:D[U4]||"application/octet-stream",[gB]:D[gB],[ZN]:D[GN],[MN]:D[AN],[YN]:D[IN]});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()},DN=async(D,F)=>{const E=rB.requestBuilder(D,F),w=k({},X8,{[_B]:D[U4]||"application/octet-stream",[nDD]:D[gB],[ZN]:D[GN],[MN]:D[AN],[YN]:D[IN]});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 FN=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return wN(D,F);const E=k({$metadata:b0(D),[U4]:[,D.headers[_B]]}),w=await w6(D.body,F);return E.body=w,E},EN=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return wN(D,F);const E=k({$metadata:b0(D),[U4]:[,D.headers[lDD]]}),w=D.body;return E.body=cDD(w,F),E},wN=async(D,F)=>{const E={...D,body:await k0.parseJsonErrorBody(D.body,F)},w=k0.loadRestJsonErrorCode(D,E.body);switch(w){case"AccessDeniedException":case"com.amazonaws.bedrockruntime#AccessDeniedException":throw await PDD(E,F);case"InternalServerException":case"com.amazonaws.bedrockruntime#InternalServerException":throw await $N(E,F);case"ResourceNotFoundException":case"com.amazonaws.bedrockruntime#ResourceNotFoundException":throw await bDD(E,F);case"ServiceQuotaExceededException":case"com.amazonaws.bedrockruntime#ServiceQuotaExceededException":throw await xDD(E,F);case"ThrottlingException":case"com.amazonaws.bedrockruntime#ThrottlingException":throw await hN(E,F);case"ValidationException":case"com.amazonaws.bedrockruntime#ValidationException":throw await UN(E,F);case"ModelErrorException":case"com.amazonaws.bedrockruntime#ModelErrorException":throw await yDD(E,F);case"ModelNotReadyException":case"com.amazonaws.bedrockruntime#ModelNotReadyException":throw await kDD(E,F);case"ModelTimeoutException":case"com.amazonaws.bedrockruntime#ModelTimeoutException":throw await CN(E,F);case"ServiceUnavailableException":case"com.amazonaws.bedrockruntime#ServiceUnavailableException":throw await BN(E,F);case"ModelStreamErrorException":case"com.amazonaws.bedrockruntime#ModelStreamErrorException":throw await fN(E,F);default:const $=E.body;return jDD({output:D,parsedBody:$,errorCode:w})}},jDD=t2($0),PDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new t$({$metadata:b0(D),...E});return u(C,D.body)},$N=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new e$({$metadata:b0(D),...E});return u(C,D.body)},yDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S,originalStatusCode:W2,resourceName:S});Object.assign(E,$);const C=new $4({$metadata:b0(D),...E});return u(C,D.body)},kDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new f4({$metadata:b0(D),...E});return u(C,D.body)},fN=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S,originalMessage:S,originalStatusCode:W2});Object.assign(E,$);const C=new h4({$metadata:b0(D),...E});return u(C,D.body)},CN=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new C4({$metadata:b0(D),...E});return u(C,D.body)},bDD=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new D4({$metadata:b0(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 F4({$metadata:b0(D),...E});return u(C,D.body)},BN=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new B4({$metadata:b0(D),...E});return u(C,D.body)},hN=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new E4({$metadata:b0(D),...E});return u(C,D.body)},UN=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new w4({$metadata:b0(D),...E});return u(C,D.body)};var cDD=(D,F)=>{return F.eventStreamMarshaller.deserialize(D,async(E)=>{if(E.chunk!=null)return{chunk:await sDD(E.chunk,F)};if(E.internalServerException!=null)return{internalServerException:await gDD(E.internalServerException,F)};if(E.modelStreamErrorException!=null)return{modelStreamErrorException:await rDD(E.modelStreamErrorException,F)};if(E.validationException!=null)return{validationException:await vDD(E.validationException,F)};if(E.throttlingException!=null)return{throttlingException:await dDD(E.throttlingException,F)};if(E.modelTimeoutException!=null)return{modelTimeoutException:await _DD(E.modelTimeoutException,F)};if(E.serviceUnavailableException!=null)return{serviceUnavailableException:await uDD(E.serviceUnavailableException,F)};return{$unknown:D}})};var gDD=async(D,F)=>{const E={...D,body:await k0.parseJsonBody(D.body,F)};return $N(E,F)};var rDD=async(D,F)=>{const E={...D,body:await k0.parseJsonBody(D.body,F)};return fN(E,F)},_DD=async(D,F)=>{const E={...D,body:await k0.parseJsonBody(D.body,F)};return CN(E,F)},sDD=async(D,F)=>{const E={},w=await k0.parseJsonBody(D.body,F);return Object.assign(E,mDD(w,F)),E},uDD=async(D,F)=>{const E={...D,body:await k0.parseJsonBody(D.body,F)};return BN(E,F)},dDD=async(D,F)=>{const E={...D,body:await k0.parseJsonBody(D.body,F)};return hN(E,F)},vDD=async(D,F)=>{const E={...D,body:await k0.parseJsonBody(D.body,F)};return UN(E,F)};var mDD=(D,F)=>{return c(D,{bytes:F.base64Decoder})};var b0=(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 gB="accept",U4="contentType",_B="content-type",AN="guardrailIdentifier",IN="guardrailVersion",GN="trace",nDD="x-amzn-bedrock-accept",lDD="x-amzn-bedrock-content-type",MN="x-amzn-bedrock-guardrailidentifier",YN="x-amzn-bedrock-guardrailversion",ZN="x-amzn-bedrock-trace";UD();var XN=Q(YD(),1);y();class YF extends l.classBuilder().ep(B$).m(function(D,F,E,w){return[XN.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModel",{}).n("BedrockRuntimeClient","InvokeModelCommand").f(pV,aV).ser(eV).de(FN).build(){}UD();var WN=Q(YD(),1);y();class sB extends l.classBuilder().ep(B$).m(function(D,F,E,w){return[WN.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockFrontendService","InvokeModelWithResponseStream",{eventStream:{output:!0}}).n("BedrockRuntimeClient","InvokeModelWithResponseStreamCommand").f(oV,tV).ser(DN).de(EN).build(){}async function AqD(D){ZF.debug(D);const F=new YF(D),E=await p3.send(F);return ZF.debug("Successfully invoke model"),ZF.debug(E),E}async function IqD(D){ZF.debug(D);const F=new sB(D),E=await p3.send(F);return ZF.debug("Successfully invoke model with response stream"),ZF.debug(E),E}var p3=new jB({region:iDD.env.REGION||"us-east-1"}),ZF=console;async function YqD(D,F={}){const{maxTokenCount:E=512,temperature:w=0,topP:$=0.9}=F,C=new YF({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 p3.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 ZqD(D,F={}){const{maxTokenCount:E=512,temperature:w=0,topP:$=0.9}=F,C=new YF({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 p3.send(C);return JSON.parse(new TextDecoder().decode(f.body)).results[0].outputText}catch(f){throw console.error("Error asking question:",f),f}}import I0D from"process";z6();T6();K6();o8();n0();var WF=Q(rD(),1);b6();UD();J2();y();var JN=Q(jD(),1);Z2();function pDD(D){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"bedrock",region:D.region},propertiesExtractor:(F,E)=>({signingProperties:{config:F,context:E}})}}var zN=async(D,F,E)=>{return{operation:v0(F).operation,region:await _D(D.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},TN=(D)=>{const F=[];switch(D.operation){default:F.push(pDD(D))}return F},KN=(D)=>{return{...JN.resolveAwsSdkSigV4Config(D)}};var SN=(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 QN={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 gN=Q(jD(),1);a6();n6();n0();l6();J2();v2();Z8();i6();O0();var xN=Q(jD(),1);y();M8();O1();a2();i8();M2();var HN={["required"]:!1,type:"String"},LN={["required"]:!0,default:!1,type:"Boolean"},RN={["ref"]:"Endpoint"},PN={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},yN={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},G1={},VN={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},NN={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsDualStack"]}]},qN=[PN],ON=[yN],jN=[{["ref"]:"Region"}],oDD={version:"1.0",parameters:{Region:HN,UseDualStack:LN,UseFIPS:LN,Endpoint:HN},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[RN]}],rules:[{conditions:qN,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{rules:[{conditions:ON,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:RN,properties:G1,headers:G1},type:"endpoint"}],type:"tree"}],type:"tree"},{rules:[{conditions:[{["fn"]:"isSet",["argv"]:jN}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:jN,assign:"PartitionResult"}],rules:[{conditions:[PN,yN],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,VN]},NN],rules:[{rules:[{endpoint:{url:"https://bedrock-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:G1,headers:G1},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:qN,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[VN,!0]}],rules:[{rules:[{endpoint:{url:"https://bedrock-fips.{Region}.{PartitionResult#dnsSuffix}",properties:G1,headers:G1},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:ON,rules:[{conditions:[NN],rules:[{rules:[{endpoint:{url:"https://bedrock.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:G1,headers:G1},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:G1,headers:G1},type:"endpoint"}],type:"tree"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}],type:"tree"}]},kN=oDD;var tDD=new I2({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),bN=(D,F={})=>{return tDD.get(D,()=>G2(kN,{endpointParams:D,logger:F.logger}))};f0.aws=Y2;var cN=(D)=>{return{apiVersion:"2023-04-20",base64Decoder:D?.base64Decoder??z0,base64Encoder:D?.base64Encoder??K0,disableHostPrefix:D?.disableHostPrefix??!1,endpointProvider:D?.endpointProvider??bN,extensions:D?.extensions??[],httpAuthSchemeProvider:D?.httpAuthSchemeProvider??TN,httpAuthSchemes:D?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(F)=>F.getIdentityProvider("aws.auth#sigv4"),signer:new xN.AwsSdkSigV4Signer}],logger:D?.logger??new P0,serviceId:D?.serviceId??"Bedrock",urlParser:D?.urlParser??eD,utf8Decoder:D?.utf8Decoder??D0,utf8Encoder:D?.utf8Encoder??T0}};y();p6();y();var rN=(D)=>{D1(process.version);const F=B1(D),E=()=>F().then(e2),w=cN(D);return gN.emitWarningIfUnsupportedVersion(process.version),{...w,...D,runtime:"node",defaultsMode:F,bodyLengthChecker:D?.bodyLengthChecker??C1,credentialDefaultProvider:D?.credentialDefaultProvider??T2,defaultUserAgentProvider:D?.defaultUserAgentProvider??$1({serviceId:w.serviceId,clientVersion:QN.version}),maxAttempts:D?.maxAttempts??i(l2),region:D?.region??i(m0,s2),requestHandler:h0.create(D?.requestHandler??E),retryMode:D?.retryMode??i({...p2,default:async()=>(await E()).retryMode||o0}),sha256:D?.sha256??z2.bind(null,"sha256"),streamCollector:D?.streamCollector??t0,useDualstackEndpoint:D?.useDualstackEndpoint??i(r2),useFipsEndpoint:D?.useFipsEndpoint??i(_2),userAgentAppId:D?.userAgentAppId??i(f1)}};o6();dD();y();var _N=(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}}},sN=(D)=>{return{httpAuthSchemes:D.httpAuthSchemes(),httpAuthSchemeProvider:D.httpAuthSchemeProvider(),credentials:D.credentials()}};var A4=(D)=>D,uN=(D,F)=>{const E={...A4(h1(D)),...A4(F1(D)),...A4(O2(D)),...A4(_N(D))};return F.forEach((w)=>w.configure(E)),{...D,...U1(E),...E1(E),...j2(E),...sN(E)}};class uB extends j0{constructor(...[D]){const F=rN(D||{}),E=SN(F),w=c2(E),$=i2(w),C=u2($),f=P2(C),B=m2(f),h=KN(B),U=uN(h,D?.extensions||[]);super(U);this.config=U,this.middlewareStack.use(g2(this.config)),this.middlewareStack.use(w1(this.config)),this.middlewareStack.use(d2(this.config)),this.middlewareStack.use(y2(this.config)),this.middlewareStack.use(k2(this.config)),this.middlewareStack.use(b2(this.config)),this.middlewareStack.use(WF.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:zN,identityProviderConfigProvider:async(I)=>new WF.DefaultIdentityProviderConfig({"aws.auth#sigv4":I.credentials})})),this.middlewareStack.use(WF.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}y();y();class x0 extends e0{constructor(D){super(D);Object.setPrototypeOf(this,x0.prototype)}}class I4 extends x0{constructor(D){super({name:"AccessDeniedException",$fault:"client",...D});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,I4.prototype)}}class G4 extends x0{constructor(D){super({name:"ConflictException",$fault:"client",...D});this.name="ConflictException",this.$fault="client",Object.setPrototypeOf(this,G4.prototype)}}class M4 extends x0{constructor(D){super({name:"InternalServerException",$fault:"server",...D});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,M4.prototype)}}class Y4 extends x0{constructor(D){super({name:"ResourceNotFoundException",$fault:"client",...D});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,Y4.prototype)}}class Z4 extends x0{constructor(D){super({name:"ThrottlingException",$fault:"client",...D});this.name="ThrottlingException",this.$fault="client",Object.setPrototypeOf(this,Z4.prototype)}}class X4 extends x0{constructor(D){super({name:"ValidationException",$fault:"client",...D});this.name="ValidationException",this.$fault="client",Object.setPrototypeOf(this,X4.prototype)}}var dN;(function(D){D.visit=(F,E)=>{if(F.s3Uri!==void 0)return E.s3Uri(F.s3Uri);return E._(F.$unknown[0],F.$unknown[1])}})(dN||(dN={}));var vN;(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])}})(vN||(vN={}));var mN;(function(D){D.visit=(F,E)=>{if(F.bedrockModel!==void 0)return E.bedrockModel(F.bedrockModel);return E._(F.$unknown[0],F.$unknown[1])}})(mN||(mN={}));var nN;(function(D){D.visit=(F,E)=>{if(F.models!==void 0)return E.models(F.models);return E._(F.$unknown[0],F.$unknown[1])}})(nN||(nN={}));class W4 extends x0{constructor(D){super({name:"ServiceQuotaExceededException",$fault:"client",...D});this.name="ServiceQuotaExceededException",this.$fault="client",Object.setPrototypeOf(this,W4.prototype)}}class J4 extends x0{constructor(D){super({name:"TooManyTagsException",$fault:"client",...D});this.name="TooManyTagsException",this.$fault="client",Object.setPrototypeOf(this,J4.prototype),this.resourceName=D.resourceName}}var lN;(function(D){D.visit=(F,E)=>{if(F.s3DataSource!==void 0)return E.s3DataSource(F.s3DataSource);return E._(F.$unknown[0],F.$unknown[1])}})(lN||(lN={}));var iN;(function(D){D.visit=(F,E)=>{if(F.s3InputDataConfig!==void 0)return E.s3InputDataConfig(F.s3InputDataConfig);return E._(F.$unknown[0],F.$unknown[1])}})(iN||(iN={}));var pN;(function(D){D.visit=(F,E)=>{if(F.s3OutputDataConfig!==void 0)return E.s3OutputDataConfig(F.s3OutputDataConfig);return E._(F.$unknown[0],F.$unknown[1])}})(pN||(pN={}));var _1=Q(jD(),1),z4=Q(rD(),1);y();e9();var Dq=async(D,F)=>{const E=z4.requestBuilder(D,F),w={"content-type":"application/json"};E.bp("/model-customization-jobs");let $;return $=JSON.stringify(c(D,{baseModelIdentifier:[],clientRequestToken:[!0,(C)=>C??D$()],customModelKmsKeyId:[],customModelName:[],customModelTags:(C)=>CD(C),customizationType:[],hyperParameters:(C)=>CD(C),jobName:[],jobTags:(C)=>CD(C),outputDataConfig:(C)=>CD(C),roleArn:[],trainingDataConfig:(C)=>CD(C),validationDataConfig:(C)=>CD(C),vpcConfig:(C)=>CD(C)})),E.m("POST").h(w).b($),E.build()};var Fq=async(D,F)=>{const E=z4.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 Eq=async(D,F)=>{const E=z4.requestBuilder(D,F),w={};E.bp("/foundation-models");const $=k({[eN]:[,D[eN]],[aN]:[,D[aN]],[tN]:[,D[tN]],[oN]:[,D[oN]]});let C;return E.m("GET").h(w).q($).b(C),E.build()};var wq=async(D,F)=>{if(D.statusCode!==201&&D.statusCode>=300)return dB(D,F);const E=k({$metadata:S2(D)}),w=PD(S0(await _1.parseJsonBody(D.body,F)),"body"),$=c(w,{jobArn:S});return Object.assign(E,$),E};var $q=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return dB(D,F);const E=k({$metadata:S2(D)}),w=PD(S0(await _1.parseJsonBody(D.body,F)),"body"),$=c(w,{baseModelArn:S,clientRequestToken:S,creationTime:(C)=>PD(d6(C)),customizationType:S,endTime:(C)=>PD(d6(C)),failureMessage:S,hyperParameters:CD,jobArn:S,jobName:S,lastModifiedTime:(C)=>PD(d6(C)),outputDataConfig:CD,outputModelArn:S,outputModelKmsKeyArn:S,outputModelName:S,roleArn:S,status:S,trainingDataConfig:CD,trainingMetrics:(C)=>h0D(C,F),validationDataConfig:CD,validationMetrics:(C)=>U0D(C,F),vpcConfig:CD});return Object.assign(E,$),E};var fq=async(D,F)=>{if(D.statusCode!==200&&D.statusCode>=300)return dB(D,F);const E=k({$metadata:S2(D)}),w=PD(S0(await _1.parseJsonBody(D.body,F)),"body"),$=c(w,{modelSummaries:CD});return Object.assign(E,$),E};var dB=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 D0D(E,F);case"ConflictException":case"com.amazonaws.bedrock#ConflictException":throw await F0D(E,F);case"InternalServerException":case"com.amazonaws.bedrock#InternalServerException":throw await E0D(E,F);case"ResourceNotFoundException":case"com.amazonaws.bedrock#ResourceNotFoundException":throw await w0D(E,F);case"ThrottlingException":case"com.amazonaws.bedrock#ThrottlingException":throw await f0D(E,F);case"ValidationException":case"com.amazonaws.bedrock#ValidationException":throw await B0D(E,F);case"ServiceQuotaExceededException":case"com.amazonaws.bedrock#ServiceQuotaExceededException":throw await $0D(E,F);case"TooManyTagsException":case"com.amazonaws.bedrock#TooManyTagsException":throw await C0D(E,F);default:const $=E.body;return eDD({output:D,parsedBody:$,errorCode:w})}},eDD=t2(x0),D0D=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new I4({$metadata:S2(D),...E});return u(C,D.body)},F0D=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new G4({$metadata:S2(D),...E});return u(C,D.body)},E0D=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new M4({$metadata:S2(D),...E});return u(C,D.body)},w0D=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new Y4({$metadata:S2(D),...E});return u(C,D.body)},$0D=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new W4({$metadata:S2(D),...E});return u(C,D.body)},f0D=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new Z4({$metadata:S2(D),...E});return u(C,D.body)},C0D=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S,resourceName:S});Object.assign(E,$);const C=new J4({$metadata:S2(D),...E});return u(C,D.body)},B0D=async(D,F)=>{const E=k({}),w=D.body,$=c(w,{message:S});Object.assign(E,$);const C=new X4({$metadata:S2(D),...E});return u(C,D.body)};var h0D=(D,F)=>{return c(D,{trainingLoss:J5})},U0D=(D,F)=>{return(D||[]).filter((w)=>w!=null).map((w)=>{return A0D(w,F)})},A0D=(D,F)=>{return c(D,{validationLoss:J5})},S2=(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 aN="byCustomizationType",oN="byInferenceType";var tN="byOutputModality",eN="byProvider";UD();var Cq=Q(YD(),1);y();class vB extends l.classBuilder().ep(XF).m(function(D,F,E,w){return[Cq.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockControlPlaneService","CreateModelCustomizationJob",{}).n("BedrockClient","CreateModelCustomizationJobCommand").f(void 0,void 0).ser(Dq).de(wq).build(){}UD();var Bq=Q(YD(),1);y();class mB extends l.classBuilder().ep(XF).m(function(D,F,E,w){return[Bq.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockControlPlaneService","GetModelCustomizationJob",{}).n("BedrockClient","GetModelCustomizationJobCommand").f(void 0,void 0).ser(Fq).de($q).build(){}UD();var hq=Q(YD(),1);y();class nB extends l.classBuilder().ep(XF).m(function(D,F,E,w){return[hq.getSerdePlugin(E,this.serialize,this.deserialize),p(E,D.getEndpointParameterInstructions())]}).s("AmazonBedrockControlPlaneService","ListFoundationModels",{}).n("BedrockClient","ListFoundationModelsCommand").f(void 0,void 0).ser(Eq).de(fq).build(){}async function uOD(D){s1.debug(D);const F=new vB(D),E=await lB.send(F);return s1.debug("Successfully create model customization job"),s1.debug(E),E}async function dOD(D){s1.debug(D);const F=new mB(D),E=await lB.send(F);return s1.debug("Successfully get model customization job"),s1.debug(E),E}async function vOD(D){s1.debug(D);const F=new nB(D),E=await lB.send(F);return s1.debug("Successfully list foundation models"),s1.debug(E),E}var lB=new uB({region:I0D.env.REGION||"us-east-1"}),s1=console;a6();import D7D from"process";var pOD=process.argv,aOD=`${process.platform}-${process.arch} node-${process.version}`;var G0D=new Set([".","!","?"]),fjD=new Set([...G0D,":",'"',"'","\u201D"]);var y8=Q(Aq(),1);var R0D=Q(Iq(),1);function eB(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"},Gq={"":"data"};var q0D=Object.defineProperty,T4=(D,F)=>{for(var E in F)q0D(D,E,{get:F[E],enumerable:!0})};function Dh(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 AO=Q(Q4(),1),IO=Q(Wq(),1),GO=Q(Sq(),1),MO=Q(Qq(),1),YO=Q(Rq(),1),ZO=Q(Vq(),1),XO=Q(Nq(),1),WO=Q(jq(),1),JO=Q(uq(),1),zO=Q(vq(),1),TO=Q(iq(),1),KO=Q(pq(),1),SO=Q(tq(),1),QO=Q(FO(),1),HO=Q(wO(),1),LO=Q(qh(),1),RO=Q(Oh(),1),VO=Q(Oh(),1),NO=Q(qh(),1),DE=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}}},o4={};T4(o4,{E_VALIDATION_ERROR:()=>UO});var jh=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}`}},UO=jh,Ph=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 UO(this.errors)}},C8D=["1",1,"true",!0,"on"],B8D=["0",0,"false",!1],d={exists(D){return D!==null&&D!==void 0},isMissing(D){return!this.exists(D)},isTrue(D){return C8D.includes(D)},isFalse(D){return B8D.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:WO.default.default,isURL:GO.default.default,isAlpha:JO.default.default,isAlphaNumeric:QO.default.default,isIP:AO.default.default,isUUID:ZO.default.default,isAscii:XO.default.default,isCreditCard:SO.default.default,isIBAN:YO.default.default,isJWT:IO.default.default,isLatLong:zO.default.default,isMobilePhone:RO.default.default,isPassportNumber:HO.default.default,isPostalCode:LO.default.default,isSlug:MO.default.default,isDecimal:TO.default.default,mobileLocales:VO.locales,postalCountryCodes:NO.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 KO.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 Dh(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 TF=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 h8D=/[\p{Lu}]/u,U8D=/[\p{Ll}]/u,qO=/^[\p{Lu}](?![\p{Lu}])/gu,PO=/([\p{Alpha}\p{N}_]|$)/u,yh=/[_.\- ]+/,A8D=new RegExp("^"+yh.source),OO=new RegExp(yh.source+PO.source,"gu"),jO=new RegExp("\\d+"+PO.source,"gu"),I8D=(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,$&&h8D.test(U))D=D.slice(0,h)+"-"+D.slice(h),$=!1,f=C,C=!0,h++;else if(C&&f&&U8D.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},G8D=(D,F)=>{return qO.lastIndex=0,D.replaceAll(qO,(E)=>F(E))},M8D=(D,F)=>{return OO.lastIndex=0,jO.lastIndex=0,D.replaceAll(jO,(E,w,$)=>["_","-"].includes(D.charAt($+E.length))?E:F(E)).replaceAll(OO,(E,w)=>F(w))};function oD(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(yh.test(D))return"";return F.pascalCase?w(D):E(D)}if(D!==E(D))D=I8D(D,E,w,F.preserveConsecutiveUppercase);if(D=D.replace(A8D,""),D=F.preserveConsecutiveUppercase?G8D(D,E):E(D),F.pascalCase)D=w(D.charAt(0))+D.slice(1);return M8D(D,w)}var AP=Q(xh(),1),XD=Q(xh(),1),IP=Q(yO(),1),GP=Q(kO(),1),MP=Q(bO(),1);function ph(D){return new YP(D)}var dh=(D,F)=>F.some((E)=>E instanceof RegExp?E.test(D):E===D),Y8D=new Set(["https:","http:","file:"]),Z8D=(D)=>{try{const{protocol:F}=new URL(D);return F.endsWith(":")&&!F.includes(".")&&!Y8D.has(F)}catch{return!1}},X8D=(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,G=""]=A.split("=").map((Z)=>Z.trim());if(Y==="charset"){if(G=G.toLowerCase(),G==="us-ascii")return""}return`${Y}${G?`=${G}`:""}`}).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 vh(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 X8D(D,F);if(Z8D(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,G=$.pathname.slice(B,Y);h+=G.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(dh(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(dh(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(!dh(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 TP=Q(xO(),1),KP=Q(cO(),1);function ah(D){return new M6D(D)}function P8D({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 gO({variableName:D,guardedCodeSnippet:F}){return`if (ensureIsArray(${D})) {
104
+ ${F}
105
+ }`}function D7({variableName:D,bail:F,guardedCodeSnippet:E}){if(!F)return E;return`if (${D}.isValid) {
106
+ ${E}
107
+ }`}function FE({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 y8D(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 k8D({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 y8D([h,U],D?`await ${B}`:`${B}`)}function EE({bail:D,validations:F,variableName:E,dropMissingCheck:w}){return`${F.map(($)=>k8D($,E,D,w)).join("\n")}`}function rO({variableName:D,outputExpression:F,outputValueExpression:E}){return`const ${D}_out = ${E};
116
+ ${F} = ${D}_out;`}function wE({allowNull:D,isOptional:F,variableName:E}){if(F===!1)if(D===!1)return`ensureExists(${E});`;else return`ensureIsDefined(${E});`;return""}function x8D({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 g8D({parseFnRefId:D,variableName:F}){if(D)return`${F}.value = refs['${D}'](${F}.value);`;return""}function _O({variableName:D,conditionalFnRefId:F}){return`else {
120
+ refs['${F}'](${D}.value, ${D});
121
+ }`}function sO({conditional:D,variableName:F,conditionalFnRefId:E,guardedCodeSnippet:w}){return`${D}(refs['${E}'](${F}.value, ${F})) {
122
+ ${w}
123
+ }`}function _8D({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 uO({variableName:D,guardedCodeSnippet:F}){return`if (ensureIsObject(${D})) {
129
+ ${F}
130
+ }`}function dO({variableName:D,outputExpression:F,outputValueExpression:E}){return`const ${D}_out = ${E};
131
+ ${F} = ${D}_out;`}function u8D(D){return`[${D.map((F)=>`"${F}"`).join(", ")}]`}function d8D({variableName:D,fieldsToIgnore:F,allowUnknownProperties:E}){if(!E)return"";const w=u8D(F);return`moveProperties(${D}.value, ${D}_out, ${w});`}function m8D(D){return{parentExpression:D.variableName,parentValueExpression:D.variableName,fieldNameExpression:"''",fieldPathExpression:"''",wildCardPath:"",variableName:`${D.variableName}_item`,valueExpression:"root",outputExpression:D.outputExpression,isArrayMember:!1}}function n8D({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 i8D(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 a8D(){return`if(errorReporter.hasErrors) {
134
+ throw errorReporter.createError();
135
+ }`}function o8D(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 t8D(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 e8D(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 D6D(D){return`const REQUIRED = '${D.required}';
205
+ const NOT_AN_OBJECT = '${D.object}';
206
+ const NOT_AN_ARRAY = '${D.array}';`}function mO(){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 j8D=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=""}},KF=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(P8D({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}))}},b8D=class extends KF{#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(wE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName}));const D=D7({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${rO({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:this.#D.allowUnknownProperties?`copyProperties(${this.field.variableName}.value)`:"[]"})}${this.#w()}`}),F=gO({variableName:this.field.variableName,guardedCodeSnippet:`${EE({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}${FE({allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}},c8D=class extends KF{#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(x8D({variableName:this.field.variableName,startingIndex:0,loopCodeSnippet:D.toString()})),D.flush(),F.toString()}compile(){this.defineField(this.#F),this.#F.writeStatement(wE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName}));const D=D7({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${rO({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"[]"})}${this.#F.newLine}${this.#w()}`}),F=gO({variableName:this.field.variableName,guardedCodeSnippet:`${EE({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}${FE({allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}},r8D=class extends KF{#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(g8D({parseFnRefId:F.schema.parseFnId,variableName:this.field.variableName}));this.#D.compileNode(F.schema,w,this.#w,this.field),D.writeStatement(sO({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(_O({variableName:this.field.variableName,conditionalFnRefId:this.#F.elseConditionalFnRefId}));return D.toString()}compile(){this.defineField(this.#E),this.#E.writeStatement(this.#$())}},s8D=class extends KF{#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(_8D({variableName:this.field.variableName,loopCodeSnippet:F.toString()})),F.flush(),D.toString()}compile(){this.defineField(this.#F),this.#F.writeStatement(wE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName}));const D=D7({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${dO({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"{}"})}${this.#w()}`}),F=uO({variableName:this.field.variableName,guardedCodeSnippet:`${EE({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}${FE({allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,variableName:this.field.variableName,conditional:"else if"})}`)}},v8D=class extends KF{#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(sO({variableName:this.field.variableName,conditional:$===0?"if":"else if",conditionalFnRefId:w.conditionalFnRefId,guardedCodeSnippet:C.toString()}))}),D.elseConditionalFnRefId&&D.conditions.length)F.writeStatement(_O({variableName:this.field.variableName,conditionalFnRefId:D.elseConditionalFnRefId}))}compile(){this.defineField(this.#F),this.#F.writeStatement(wE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName}));const D=D7({variableName:this.field.variableName,bail:this.#D.bail,guardedCodeSnippet:`${dO({variableName:this.field.variableName,outputExpression:this.field.outputExpression,outputValueExpression:"{}"})}${this.#F.newLine}${this.#f()}${this.#F.newLine}${this.#C()}${this.#F.newLine}${d8D({variableName:this.field.variableName,allowUnknownProperties:this.#D.allowUnknownProperties,fieldsToIgnore:this.#D.allowUnknownProperties?this.#w(this.#D):[]})}`}),F=uO({variableName:this.field.variableName,guardedCodeSnippet:`${EE({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!0})}${D}`});this.#F.writeStatement(`${F}${this.#F.newLine}${FE({variableName:this.field.variableName,allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,conditional:"else if"})}`)}},l8D=class extends KF{#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(wE({allowNull:this.#D.allowNull,isOptional:this.#D.isOptional,variableName:this.field.variableName})),this.#F.writeStatement(EE({variableName:this.field.variableName,validations:this.#D.validations,bail:this.#D.bail,dropMissingCheck:!1})),this.#F.writeStatement(`${n8D({variableName:this.field.variableName,outputExpression:this.field.outputExpression,transformFnRefId:this.#D.transformFnId})}${this.#F.newLine}${FE({variableName:this.field.variableName,allowNull:this.#D.allowNull,outputExpression:this.field.outputExpression,transformFnRefId:this.#D.transformFnId,conditional:"else if"})}`)}},F6D=Object.getPrototypeOf(async function(){}).constructor,vO=class{variablesCounter=0;#D;#F;#E=new j8D;constructor(D,F){this.#D=D,this.#F=F||{convertEmptyStringsToNull:!1}}#w(){this.#E.writeStatement(D6D({required:"value is required",object:"value is not a valid object",array:"value is not a valid array",...this.#F.messages})),this.#E.writeStatement(e8D(this.#F)),this.#E.writeStatement("let out;")}#$(){this.#E.writeStatement(a8D()),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 F6D("root","meta","refs","messagesProvider","errorReporter",this.#E.toString())}createFieldFor(D,F){switch(F.type){case"array":return i8D(F);case"root":return m8D(F);case"object":return o8D(D,this.variablesCounter,F);case"tuple":return p8D(D,F);case"record":return t8D(F)}}compileNode(D,F,E,w){switch(D.type){case"literal":return new l8D(D,F,this,E,w).compile();case"array":return new c8D(D,F,this,E,w).compile();case"record":return new s8D(D,F,this,E,w).compile();case"object":return new v8D(D,F,this,E,w).compile();case"tuple":return new b8D(D,F,this,E,w).compile();case"union":return new r8D(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 hP={};T4(hP,{COTYPE:()=>$6D,IS_OF_TYPE:()=>C2,ITYPE:()=>E6D,OTYPE:()=>w6D,PARSE:()=>FD,UNIQUE_NAME:()=>L0,VALIDATION:()=>A6});var L0=Symbol.for("schema_name"),C2=Symbol.for("is_of_type"),FD=Symbol.for("parse"),E6D=Symbol.for("opaque_input_type"),w6D=Symbol.for("opaque_type"),$6D=Symbol.for("camelcase_opaque_type"),A6=Symbol.for("to_validation"),SF=O((D,F,E)=>{const w=F(E);if(!E.isDefined&&w)E.report(q.required,"required",E)},{implicit:!0}),E7=class extends TF{optional(D){return new C6D(this,D)}nullable(){return new f6D(this)}transform(D){return new B6D(D,this)}},f6D=class D extends E7{#D;constructor(F){super();this.#D=F}clone(){return new D(this.#D.clone())}[FD](F,E,w){const $=this.#D[FD](F,E,w);return $.allowNull=!0,$}},C6D=class D extends E7{#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(A6 in F?F[A6]():F),this}requiredWhen(F,E,w){if(typeof F==="function")return this.use(SF(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(SF((C)=>{const f=d.getNestedValue(F,C);return $(f)}))}requiredIfExists(F){const E=Array.isArray(F)?F:[F];return this.use(SF((w)=>{return E.every(($)=>d.exists(d.getNestedValue($,w)))}))}requiredIfAnyExists(F){return this.use(SF((E)=>{return F.some((w)=>d.exists(d.getNestedValue(w,E)))}))}requiredIfMissing(F){const E=Array.isArray(F)?F:[F];return this.use(SF((w)=>{return E.every(($)=>d.isMissing(d.getNestedValue($,w)))}))}requiredIfAnyMissing(F){return this.use(SF((E)=>{return F.some((w)=>d.isMissing(d.getNestedValue(w,E)))}))}clone(){return new D(this.#D.clone(),this.cloneValidations())}[FD](F,E,w){const $=this.#D[FD](F,E,w);return $.isOptional=!0,$.validations=$.validations.concat(this.compileValidations(E)),$}},B6D=class D extends E7{#D;#F;constructor(F,E){super();this.#F=F,this.#D=E}clone(){return new D(this.#F,this.#D.clone())}[FD](F,E,w){const $=this.#D[FD](F,E,w);return $.transformFnId=E.trackTransformer(this.#F),$}},M1=class extends E7{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(A6 in D?D[A6]():D),this}bail(D){return this.options.bail=D,this}[FD](D,F,E){return{type:"literal",fieldName:D,propertyName:E.toCamelCase?oD(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)}}},UP=class D extends M1{constructor(F,E){super(F,E)}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},F7=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})}),QF=class D extends M1{static rules={enum:F7};#D;getChoices(){return this.#D}constructor(F,E,w){super(E,w||[F7({choices:F})]);this.#D=F}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},I6=["YYYY-MM-DD","YYYY-MM-DD HH:mm:ss"];XD.default.extend(MP.default);XD.default.extend(IP.default);XD.default.extend(GP.default);var h6D=O((D,F,E)=>{if(typeof D!=="string"&&typeof D!=="number"){E.report(q.date,"date",E);return}let w=!1,$=F.formats||I6;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)?XD.default(C):XD.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||I6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=XD.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})}),lO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=F.format||I6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=f==="today"?XD.default():f==="tomorrow"?XD.default().add(1,"day"):XD.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})}),iO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=F.format||I6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=f==="today"?XD.default():f==="tomorrow"?XD.default().add(1,"day"):XD.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})}),pO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=F.format||I6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=f==="today"?XD.default():f==="yesterday"?XD.default().subtract(1,"day"):XD.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})}),aO=O((D,F,E)=>{if(!E.meta.$value)return;const w=F.compare||"day",$=F.format||I6,C=E.meta.$value,f=typeof F.expectedValue==="function"?F.expectedValue(E):F.expectedValue,B=f==="today"?XD.default():f==="yesterday"?XD.default().subtract(1,"day"):XD.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})}),oO=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=XD.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})}),tO=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=XD.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})}),eO=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=XD.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})}),Dj=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=XD.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})}),Fj=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=XD.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})}),Ej=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=XD.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})}),wj=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)}),$j=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)}),ih=class D extends M1{static rules={equals:nO,after:lO,afterOrEqual:iO,before:pO,beforeOrEqual:aO,sameAs:oO,notSameAs:tO,afterField:eO,afterOrSameAs:Dj,beforeField:Fj,beforeOrSameAs:Ej,weekend:wj,weekday:$j};[L0]="vine.date";[C2]=(F)=>{if(typeof F!=="string")return!1;return AP.default(F,this.options.formats||I6,!0).isValid()};constructor(F,E){super(F,E||[h6D(F||{})])}equals(F,E){return this.use(nO({expectedValue:F,...E}))}after(F,E){return this.use(lO({expectedValue:F,...E}))}afterOrEqual(F,E){return this.use(iO({expectedValue:F,...E}))}before(F,E){return this.use(pO({expectedValue:F,...E}))}beforeOrEqual(F,E){return this.use(aO({expectedValue:F,...E}))}sameAs(F,E){return this.use(oO({otherField:F,...E}))}notSameAs(F,E){return this.use(tO({otherField:F,...E}))}afterField(F,E){return this.use(eO({otherField:F,...E}))}afterOrSameAs(F,E){return this.use(Dj({otherField:F,...E}))}beforeField(F,E){return this.use(Fj({otherField:F,...E}))}beforeOrSameAs(F,E){return this.use(Ej({otherField:F,...E}))}weekend(){return this.use(wj())}weekday(){return this.use($j())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},YP=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}[FD](F,E,w){return{type:"union",fieldName:F,propertyName:w.toCamelCase?oD(F):F,elseConditionalFnRefId:E.trackConditional(this.#F),conditions:this.#D.map(($)=>$[FD](F,E,w))}}},ZP=class{#D;#F;constructor(D,F){this.#D=F,this.#F=D}[FD](D,F,E){return{conditionalFnRefId:F.trackConditional(this.#F),schema:this.#D[FD](D,F,E)}}};ph.if=function D(F,E){return new ZP(F,E)};ph.else=function D(F){return new ZP(()=>!0,F)};var $E=class extends TF{optional(){return new A6D(this)}nullable(){return new U6D(this)}},U6D=class D extends $E{#D;constructor(F){super();this.#D=F}clone(){return new D(this.#D.clone())}[FD](F,E,w){const $=this.#D[FD](F,E,w);if($.type!=="union")$.allowNull=!0;return $}},A6D=class D extends $E{#D;constructor(F){super();this.#D=F}clone(){return new D(this.#D.clone())}[FD](F,E,w){const $=this.#D[FD](F,E,w);if($.type!=="union")$.isOptional=!0;return $}},fE=class extends $E{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(A6 in D?D[A6]():D),this}bail(D){return this.options.bail=D,this}},XP=class D extends fE{#D;#F=!1;[L0]="vine.array";[C2]=(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}[FD](F,E,w){return{type:"tuple",fieldName:F,propertyName:w.toCamelCase?oD(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)=>$[FD](String(C),E,w))}}},fj=O((D,F,E)=>{if(!E.isValid)return;if(D.length<F.min)E.report(q["array.minLength"],"array.minLength",E,F)}),Cj=O((D,F,E)=>{if(!E.isValid)return;if(D.length>F.max)E.report(q["array.maxLength"],"array.maxLength",E,F)}),Bj=O((D,F,E)=>{if(!E.isValid)return;if(D.length!==F.size)E.report(q["array.fixedLength"],"array.fixedLength",E,F)}),hj=O((D,F,E)=>{if(!E.isValid)return;if(D.length<=0)E.report(q.notEmpty,"notEmpty",E)}),Uj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isDistinct(D,F.fields))E.report(q.distinct,"distinct",E,F)}),Aj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(D.filter((w)=>d.exists(w)&&w!==""),E)}),WP=class D extends fE{static rules={compact:Aj,notEmpty:hj,distinct:Uj,minLength:fj,maxLength:Cj,fixedLength:Bj};#D;[L0]="vine.array";[C2]=(F)=>{return Array.isArray(F)};constructor(F,E,w){super(E,w);this.#D=F}minLength(F){return this.use(fj({min:F}))}maxLength(F){return this.use(Cj({max:F}))}fixedLength(F){return this.use(Bj({size:F}))}notEmpty(){return this.use(hj())}distinct(F){return this.use(Uj({fields:F}))}compact(){return this.use(Aj())}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[FD](F,E,w){return{type:"array",fieldName:F,propertyName:w.toCamelCase?oD(F):F,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[FD]("*",E,w),parseFnId:this.options.parse?E.trackParser(this.options.parse):void 0,validations:this.compileValidations(E)}}},I6D=class D extends $E{#D;[L0]="types.object";[C2]=(F)=>{return F!==null&&typeof F==="object"&&!Array.isArray(F)};constructor(F){super();this.#D=F}clone(){return new D(this.#D.clone())}[FD](F,E,w){return w.toCamelCase=!0,this.#D[FD](F,E,w)}},JP=class D extends fE{#D;#F=[];#E=!1;[L0]="vine.object";[C2]=(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 I6D(this)}[FD](F,E,w){return{type:"object",fieldName:F,propertyName:w.toCamelCase?oD(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[$][FD]($,E,w)}),groups:this.#F.map(($)=>{return $[FD](E,w)})}}},Ij=O((D,F,E)=>{if(!E.isValid)return;if(Object.keys(D).length<F.min)E.report(q["record.minLength"],"record.minLength",E,F)}),Gj=O((D,F,E)=>{if(!E.isValid)return;if(Object.keys(D).length>F.max)E.report(q["record.maxLength"],"record.maxLength",E,F)}),Mj=O((D,F,E)=>{if(!E.isValid)return;if(Object.keys(D).length!==F.size)E.report(q["record.fixedLength"],"record.fixedLength",E,F)}),Yj=O((D,F,E)=>{if(!E.isValid)return;F(Object.keys(D),E)}),zP=class D extends fE{static rules={maxLength:Gj,minLength:Ij,fixedLength:Mj,validateKeys:Yj};#D;[L0]="vine.object";[C2]=(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(Ij({min:F}))}maxLength(F){return this.use(Gj({max:F}))}fixedLength(F){return this.use(Mj({size:F}))}validateKeys(...F){return this.use(Yj(...F))}clone(){return new D(this.#D.clone(),this.cloneOptions(),this.cloneValidations())}[FD](F,E,w){return{type:"record",fieldName:F,propertyName:w.toCamelCase?oD(F):F,bail:this.options.bail,allowNull:this.options.allowNull,isOptional:this.options.isOptional,each:this.#D[FD]("*",E,w),parseFnId:this.options.parse?E.trackParser(this.options.parse):void 0,validations:this.compileValidations(E)}}},Zj=O((D,F,E)=>{if(typeof D!=="string")E.report(q.string,"string",E)}),Xj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isEmail(D,F))E.report(q.email,"email",E)}),Wj=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)}),Jj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isIP(D,F?.version))E.report(q.ipAddress,"ipAddress",E)}),zj=O((D,F,E)=>{if(!E.isValid)return;if(!F.test(D))E.report(q.regex,"regex",E)}),Tj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isHexColor(D))E.report(q.hexCode,"hexCode",E)}),Kj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isURL(D,F))E.report(q.url,"url",E)}),Sj=O(async(D,F,E)=>{if(!E.isValid)return;if(!await d.isActiveURL(D))E.report(q.activeUrl,"activeUrl",E)}),Qj=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)}),Hj=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)}),Lj=O((D,F,E)=>{if(!E.isValid)return;if(D.length<F.min)E.report(q.minLength,"minLength",E,F)}),Rj=O((D,F,E)=>{if(!E.isValid)return;if(D.length>F.max)E.report(q.maxLength,"maxLength",E,F)}),Vj=O((D,F,E)=>{if(!E.isValid)return;if(D.length!==F.size)E.report(q.fixedLength,"fixedLength",E,F)}),Nj=O((D,F,E)=>{if(!E.isValid)return;if(!D.endsWith(F.substring))E.report(q.endsWith,"endsWith",E,F)}),qj=O((D,F,E)=>{if(!E.isValid)return;if(!D.startsWith(F.substring))E.report(q.startsWith,"startsWith",E,F)}),Oj=O((D,F,E)=>{if(!E.isValid)return;if(d.getNestedValue(F.otherField,E)!==D){E.report(q.sameAs,"sameAs",E,F);return}}),jj=O((D,F,E)=>{if(!E.isValid)return;if(d.getNestedValue(F.otherField,E)===D){E.report(q.notSameAs,"notSameAs",E,F);return}}),Pj=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}}),yj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(D.trim(),E)}),kj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(KP.default.default(D,F),E)}),bj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(D.toLocaleUpperCase(F),E)}),xj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(D.toLocaleLowerCase(F),E)}),cj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(oD(D),E)}),gj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(TP.default.default(D),E)}),rj=O((D,F,E)=>{if(!E.isValid)return;E.mutate(vh(D,F),E)}),_j=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}}),sj=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}}),uj=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("/")})}),dj=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})}),vj=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})}),mj=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)}),lj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isIBAN(D))E.report(q.iban,"iban",E)}),ij=O((D,F,E)=>{if(!E.isValid)return;if(!d.isJWT(D))E.report(q.jwt,"jwt",E)}),pj=O((D,F,E)=>{if(!E.isValid)return;if(!d.isLatLong(D))E.report(q.coordinates,"coordinates",E)}),w7=class D extends M1{static rules={in:_j,jwt:ij,url:Kj,iban:lj,uuid:mj,trim:yj,email:Xj,alpha:Qj,ascii:nj,notIn:sj,regex:zj,escape:gj,sameAs:Oj,mobile:Wj,string:Zj,hexCode:Tj,passport:dj,endsWith:Nj,confirmed:Pj,activeUrl:Sj,minLength:Lj,notSameAs:jj,maxLength:Rj,ipAddress:Jj,creditCard:uj,postalCode:vj,startsWith:qj,toUpperCase:bj,toLowerCase:xj,toCamelCase:cj,fixedLength:Vj,coordinates:pj,normalizeUrl:rj,alphaNumeric:Hj,normalizeEmail:kj};[L0]="vine.string";[C2]=(F)=>{return typeof F==="string"};constructor(F,E){super(F,E||[Zj()])}url(...F){return this.use(Kj(...F))}activeUrl(){return this.use(Sj())}email(...F){return this.use(Xj(...F))}mobile(...F){return this.use(Wj(...F))}ipAddress(F){return this.use(Jj(F?{version:F}:void 0))}hexCode(){return this.use(Tj())}regex(F){return this.use(zj(F))}alpha(F){return this.use(Qj(F))}alphaNumeric(F){return this.use(Hj(F))}minLength(F){return this.use(Lj({min:F}))}maxLength(F){return this.use(Rj({max:F}))}fixedLength(F){return this.use(Vj({size:F}))}confirmed(F){return this.use(Pj(F))}trim(){return this.use(yj())}normalizeEmail(F){return this.use(kj(F))}toUpperCase(){return this.use(bj())}toLowerCase(){return this.use(xj())}toCamelCase(){return this.use(cj())}escape(){return this.use(gj())}normalizeUrl(...F){return this.use(rj(...F))}startsWith(F){return this.use(qj({substring:F}))}endsWith(F){return this.use(Nj({substring:F}))}sameAs(F){return this.use(Oj({otherField:F}))}notSameAs(F){return this.use(jj({otherField:F}))}in(F){return this.use(_j({choices:F}))}notIn(F){return this.use(sj({list:F}))}creditCard(...F){return this.use(uj(...F))}passport(...F){return this.use(dj(...F))}postalCode(...F){return this.use(vj(...F))}uuid(...F){return this.use(mj(...F))}ascii(){return this.use(nj())}iban(){return this.use(lj())}jwt(){return this.use(ij())}coordinates(){return this.use(pj())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},aj=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)}),oj=O((D,F,E)=>{if(!E.isValid)return;if(D<F.min)E.report(q.min,"min",E,F)}),tj=O((D,F,E)=>{if(!E.isValid)return;if(D>F.max)E.report(q.max,"max",E,F)}),ej=O((D,F,E)=>{if(!E.isValid)return;if(D<F.min||D>F.max)E.report(q.range,"range",E,F)}),DP=O((D,F,E)=>{if(!E.isValid)return;if(D<0)E.report(q.positive,"positive",E)}),FP=O((D,F,E)=>{if(!E.isValid)return;if(D>=0)E.report(q.negative,"negative",E)}),EP=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("-")})}),wP=O((D,F,E)=>{if(!E.isValid)return;if(!Number.isInteger(D))E.report(q.withoutDecimals,"withoutDecimals",E)}),$P=O((D,F,E)=>{if(!E.isValid)return;if(!F.values.includes(D))E.report(q["number.in"],"in",E,F)}),HF=class D extends M1{static rules={in:$P,max:tj,min:oj,range:ej,number:aj,decimal:EP,negative:FP,positive:DP,withoutDecimals:wP};[L0]="vine.number";[C2]=(F)=>{const E=d.asNumber(F);return!Number.isNaN(E)};constructor(F,E){super(F,E||[aj(F||{})])}min(F){return this.use(oj({min:F}))}max(F){return this.use(tj({max:F}))}range(F){return this.use(ej({min:F[0],max:F[1]}))}positive(){return this.use(DP())}negative(){return this.use(FP())}decimal(F){return this.use(EP({range:Array.isArray(F)?F:[F]}))}withoutDecimals(){return this.use(wP())}clone(){return new D(this.cloneOptions(),this.cloneValidations())}in(F){return this.use($P({values:F}))}},fP=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)}),LF=class D extends M1{static rules={boolean:fP};[L0]="vine.boolean";[C2]=(F)=>{return typeof(this.options.strict===!0?F:d.asBoolean(F))==="boolean"};constructor(F,E){super(F,E||[fP(F||{})])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},CP=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)}),SP=class D extends M1{static rules={equals:CP};#D;constructor(F,E,w){super(E,w||[CP({expectedValue:F})]);this.#D=F}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},G6D=["on","1","yes","true",!0,1],BP=O((D,F,E)=>{if(!G6D.includes(D))E.report(q.accepted,"accepted",E)}),QP=class D extends M1{static rules={accepted:BP};constructor(F,E){super(F,E||[BP()])}clone(){return new D(this.cloneOptions(),this.cloneValidations())}},M6D=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}[FD](F,E){return{type:"group",elseConditionalFnRefId:F.trackConditional(this.#F),conditions:this.#D.map((w)=>w[FD](F,E))}}},HP=class{#D;#F;constructor(D,F){this.#D=F,this.#F=D}[FD](D,F){return{schema:{type:"sub_object",properties:Object.keys(this.#D).map((E)=>{return this.#D[E][FD](E,D,F)}),groups:[]},conditionalFnRefId:D.trackConditional(this.#F)}}};ah.if=function D(F,E){return new HP(F,E)};ah.else=function D(F){return new HP(()=>!0,F)};var Y6D=class D extends M1{static rules={enum:F7};#D;constructor(F,E,w){super(E,w||[F7({choices:Object.values(F)})]);this.#D=F}clone(){return new D(this.#D,this.cloneOptions(),this.cloneValidations())}},Z6D=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}[FD](F,E,w){return{type:"union",fieldName:F,propertyName:w.toCamelCase?oD(F):F,elseConditionalFnRefId:E.trackConditional(this.#F),conditions:this.#D.map(($)=>{return{conditionalFnRefId:E.trackConditional((C,f)=>{return $[C2](C,f)}),schema:$[FD](F,E,w)}})}}},X6D=class extends TF{group=ah;union=ph;string(){return new w7}boolean(D){return new LF(D)}accepted(){return new QP}number(D){return new HF(D)}date(D){return new ih(D)}literal(D){return new SP(D)}object(D){return new JP(D)}array(D){return new WP(D)}tuple(D){return new XP(D)}record(D){return new zP(D)}enum(D){if(Array.isArray(D)||typeof D==="function")return new QF(D);return new Y6D(D)}any(){return new UP}unionOfTypes(D){const F=new Set;return D.forEach((E)=>{if(!E[C2]||!E[L0])throw new Error(`Cannot use "${E.constructor.name}". The schema type is not compatible for use with "vine.unionOfTypes"`);if(F.has(E[L0]))throw new Error(`Cannot use duplicate schema "${E[L0]}". "vine.unionOfTypes" needs distinct schema types only`);F.add(E[L0])}),F.clear(),new Z6D(D)}},W6D={required:q.required,array:q.array,object:q.object},lh=class{#D;messagesProvider;errorReporter;#F(D){const F=mO();return{compilerNode:{type:"root",schema:D[FD]("",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 vO(E,{convertEmptyStringsToNull:F.convertEmptyStringsToNull,messages:W6D}).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 jh)return[E,null];throw E}}toJSON(){const{schema:D,refs:F}=this.#D;return{schema:structuredClone(D),refs:F}}},LP=class extends X6D{messagesProvider=new DE(q,Gq);errorReporter=()=>new Ph;convertEmptyStringsToNull=!1;helpers=d;createRule=O;compile(D){return new lh(D,{convertEmptyStringsToNull:this.convertEmptyStringsToNull,messagesProvider:this.messagesProvider,errorReporter:this.errorReporter})}withMetaData(D){return{compile:(F)=>{return new lh(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)}},J6D=new LP,r=J6D;import{basename as KbD,delimiter as SbD,dirname as Fy,extname as QbD,isAbsolute as HbD,join as LbD,normalize as RbD,parse as VbD,relative as fED,resolve as _y,sep as NbD,toNamespacedPath as qbD}from"path";import sy from"process";import K7 from"process";import{access as HFD,appendFile as eP,mkdir as Dy}from"fs/promises";import{dirname as LFD}from"path";import RFD from"process";var RD={};r0(RD,{ui:()=>SFD,team:()=>KFD,storage:()=>TFD,services:()=>zFD,security:()=>WFD,searchEngine:()=>JFD,queue:()=>XFD,ports:()=>ZFD,payment:()=>YFD,overrides:()=>th,notification:()=>MFD,logging:()=>GFD,localUrl:()=>R6D,library:()=>IFD,hashing:()=>AFD,git:()=>UFD,errors:()=>hFD,email:()=>BFD,docs:()=>CFD,dns:()=>fFD,determineAppEnv:()=>QFD,defineUi:()=>o6D,defineStorage:()=>a6D,defineStacksConfig:()=>V6D,defineSms:()=>p6D,defineServices:()=>i6D,defineSecurity:()=>l6D,defineSearchEngine:()=>n6D,defineQueue:()=>m6D,definePayment:()=>v6D,defineNotification:()=>d6D,defineModel:()=>t6D,defineLibrary:()=>u6D,defineJob:()=>y6D,defineHashing:()=>s6D,defineGit:()=>_6D,defineEvents:()=>e6D,defineEmailConfig:()=>g6D,defineEmail:()=>r6D,defineDns:()=>c6D,defineDependencies:()=>x6D,defineDatabase:()=>b6D,defineCronJob:()=>k6D,defineCli:()=>P6D,defineChat:()=>j6D,defineCdn:()=>O6D,defineCache:()=>q6D,defineApp:()=>N6D,defaults:()=>oh,database:()=>$FD,config:()=>ID,cloud:()=>EFD,cli:()=>wFD,cache:()=>FFD,app:()=>G6,analytics:()=>DFD,ai:()=>eh});var z6D={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:VP(),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:RP("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"}}}},oh=z6D;var NP={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 qP={driver:"fathom",drivers:{googleAnalytics:{trackingId:"UA-XXXXXXXXX-X"},fathom:{siteId:"WOLZMJDL"}}};import S6D from"process";function H6D(){return typeof Bun!=="undefined"?Bun.env:S6D.env}var OP={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 T6D={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"]},K6D=Object.entries(OP).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(T6D.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},{}),ByD=r.object(K6D);var Q6D={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 QF)return D[F];if(E instanceof LF)return!!D[F];if(E instanceof HF)return Number(D[F]);return E}},s=new Proxy(H6D(),Q6D);var jP={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 PP={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 yP={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 f7={firewall:{enabled:!0,countryCodes:["RU","IR"],ipAddresses:[],rateLimitPerMinute:1000,useIpReputationLists:!0,useKnownBadInputsRuleSet:!0,queryString:[],httpHeaders:[]}};var kP={type:"serverless",driver:"aws",firewall:f7.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 bP={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 xP={a:[{name:s.APP_URL||"",address:"10.0.0.1",ttl:300},{name:"www",address:"@",ttl:300}],aaaa:[],cname:[],mx:[],txt:[],nameservers:[]};var cP={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 gP={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 rP={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 _P={driver:"argon2",bcrypt:{rounds:10,cost:4},argon2:{memory:65536,threads:1,time:1}};var sP={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 uP={logsPath:C7("logs/stacks.log"),deploymentsPath:C7("logs/deployments.log")};var dP={default:"email"};var vP={driver:"stripe"};var mP={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 nP={default:"sync",connections:{sync:{driver:"sync"},sqs:{driver:"sqs",key:"",secret:"",prefix:"",suffix:"",queue:"default",region:"us-east-1"}}};var lP={driver:"opensearch"};var iP={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 pP={driver:"s3"};var aP={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 oP={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 L6D={ai:NP,analytics:qP,app:jP,cache:PP,cli:yP,cloud:kP,database:bP,dns:xP,email:cP,errors:gP,git:rP,hashing:_P,library:sP,logging:uP,notification:dP,queue:nP,payment:vP,ports:mP,searchEngine:lP,security:f7,services:iP,storage:pP,team:aP,ui:oP},th=L6D;async function tP(D){if(!D?.port)D={port:3000};return console.log("Creating local tunnel",D.port),"localTunnel"}async function u1(D){return await tP({port:D})}async function R6D({domain:D=RD.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 u1(RD.ports?.frontend||3000);if(E)return`http://localhost:${RD.ports?.frontend}`;break;case"backend":if($)return await u1(RD.ports?.backend||3001);if(E)return`http://localhost:${RD.ports?.backend}`;C=`api.${C}`;break;case"admin":if($)return await u1(RD.ports?.admin||3002);if(E)return`http://localhost:${RD.ports?.admin}`;C=`admin.${C}`;break;case"library":if($)return await u1(RD.ports?.library||3003);if(E)return`http://localhost:${RD.ports?.library}`;C=`libs.${C}`;break;case"email":if($)return await u1(RD.ports?.email||3005);if(E)return`http://localhost:${RD.ports?.email}`;C=`email.${C}`;break;case"desktop":if($)return await u1(RD.ports?.desktop||3004);if(E)return`http://localhost:${RD.ports?.desktop}`;C=`desktop.${C}`;break;case"docs":if($)return await u1(RD.ports?.docs||3006);if(E)return`http://localhost:${RD.ports?.docs}`;C=`docs.${C}`;break;case"inspect":if($)return await u1(RD.ports?.inspect||3007);if(E)return`http://localhost:${RD.ports?.inspect}`;C=`inspect.${C}`;break;default:if(E)return`http://localhost:${RD.ports?.frontend}`}if(w)return`https://${C}`;return`http://${C}`}function V6D(D){return D}function N6D(D){return D}function q6D(D){return D}function O6D(D){return D}function j6D(D){return D}function P6D(D){return D}function y6D(D){return D}function k6D(D){return D}function b6D(D){return D}function x6D(D){return D}function c6D(D){return D}function g6D(D){return D}function r6D(D){return D}function _6D(D){return D}function s6D(D){return D}function u6D(D){return D}function d6D(D){return D}function v6D(D){return D}function m6D(D){return D}function n6D(D){return D}function l6D(D){return D}function i6D(D){return D}function p6D(D){return D}function a6D(D){return D}function o6D(D){return D}function t6D(D){return D}function e6D(D){return D}function QFD(){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 ID={...oh,...th},eh=ID.ai,DFD=ID.analytics,G6=ID.app,FFD=ID.cache,EFD=ID.cloud,wFD=ID.cli,$FD=ID.database,fFD=ID.dns,CFD=ID.docs,BFD=ID.email,hFD=ID.errors,UFD=ID.git,AFD=ID.hashing,IFD=ID.library,GFD=ID.logging,MFD=ID.notification,YFD=ID.payment,ZFD=ID.ports,XFD=ID.queue,WFD=ID.security,JFD=ID.searchEngine,zFD=ID.services,TFD=ID.storage,KFD=ID.team,SFD=ID.ui;function h7(D,F){let E;if(eB(D))E=D;else if(D instanceof Error)E=D.message;else if(F instanceof Error)E=F.message;else E=String(D);return x8(`ERROR: ${Y0(E)}`),FU.handle(D,F)}async function x8(D,F){const E=`[${new Date().toISOString()}] ${D}\n`;try{const w=F?.logFile??RD.logging.logsPath??"storage/logs/stacks.log";try{await HFD(w)}catch{console.log("Creating log file directory...",w),await Dy(LFD(w),{recursive:!0})}await eP(w,E)}catch(w){console.error("Failed to write to log file:",w)}}class FU{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=DU("stacks.log")??DU("errors.log");try{await Dy(Fy(E),{recursive:!0}),await eP(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: ${M6("bunx --bun eslint . --fix")}`||F===`Failed to execute command: ${M6("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)RFD.exit(1)}}function RF(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 Ey(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 qFD(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(G){return new Promise(function(Z,z){C.push([Y,G,Z,z])>1||B(Y,G)})}}function B(Y,G){try{h(w[Y](G))}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,G){if(Y(G),C.shift(),C.length)B(C[0][0],C[0][1])}}function OFD(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 jFD(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 Ey==="function"?Ey(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 H2(D){return new B2(D)}var NFD={withStackTrace:!1},wy=(D,F,E=NFD)=>{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 sD{constructor(D){this._promise=D}static fromSafePromise(D){const F=D.then((E)=>new Q2(E));return new sD(F)}static fromPromise(D,F){const E=D.then((w)=>new Q2(w)).catch((w)=>new B2(F(w)));return new sD(E)}static fromThrowable(D,F){return(...E)=>{return new sD((()=>RF(this,void 0,void 0,function*(){try{return new Q2(yield D(...E))}catch(w){return new B2(F?F(w):w)}}))())}}static combine(D){return kFD(D)}static combineWithAllErrors(D){return bFD(D)}map(D){return new sD(this._promise.then((F)=>RF(this,void 0,void 0,function*(){if(F.isErr())return new B2(F.error);return new Q2(yield D(F.value))})))}andThrough(D){return new sD(this._promise.then((F)=>RF(this,void 0,void 0,function*(){if(F.isErr())return new B2(F.error);const E=yield D(F.value);if(E.isErr())return new B2(E.error);return new Q2(F.value)})))}andTee(D){return new sD(this._promise.then((F)=>RF(this,void 0,void 0,function*(){if(F.isErr())return new B2(F.error);try{yield D(F.value)}catch(E){}return new Q2(F.value)})))}mapErr(D){return new sD(this._promise.then((F)=>RF(this,void 0,void 0,function*(){if(F.isOk())return new Q2(F.value);return new B2(yield D(F.error))})))}andThen(D){return new sD(this._promise.then((F)=>{if(F.isErr())return new B2(F.error);const E=D(F.value);return E instanceof sD?E._promise:E}))}orElse(D){return new sD(this._promise.then((F)=>RF(this,void 0,void 0,function*(){if(F.isErr())return D(F.error);return new Q2(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 qFD(this,arguments,function*D(){return yield Y6(yield Y6(yield*OFD(jFD(yield Y6(this._promise.then((F)=>F.safeUnwrap()))))))})}then(D,F){return this._promise.then(D,F)}}var U7=(D)=>new sD(Promise.resolve(new B2(D))),PFD=sD.fromPromise,yFD=sD.fromSafePromise,gkD=sD.fromThrowable,$y=(D)=>{let F=d1([]);for(let E of D)if(E.isErr()){F=H2(E.error);break}else F.map((w)=>w.push(E.value));return F},kFD=(D)=>sD.fromSafePromise(Promise.all(D)).andThen($y),fy=(D)=>{let F=d1([]);for(let E of D)if(E.isErr()&&F.isErr())F.error.push(E.error);else if(E.isErr()&&F.isOk())F=H2([E.error]);else if(E.isOk()&&F.isOk())F.value.push(E.value);return F},bFD=(D)=>sD.fromSafePromise(Promise.all(D)).andThen(fy),A7;(function(D){function F($,C){return(...f)=>{try{const B=$(...f);return d1(B)}catch(B){return H2(C?C(B):B)}}}D.fromThrowable=F;function E($){return $y($)}D.combine=E;function w($){return fy($)}D.combineWithAllErrors=w})(A7||(A7={}));var d1=(D)=>new Q2(D);class Q2{constructor(D){this.value=D}isOk(){return!0}isErr(){return!this.isOk()}map(D){return d1(D(this.value))}mapErr(D){return d1(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 d1(this.value)}orElse(D){return d1(this.value)}asyncAndThen(D){return D(this.value)}asyncAndThrough(D){return D(this.value).map(()=>this.value)}asyncMap(D){return sD.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 wy("Called `_unsafeUnwrapErr` on an Ok",this,D)}}class B2{constructor(D){this.error=D}isOk(){return!1}isErr(){return!this.isOk()}map(D){return H2(this.error)}mapErr(D){return H2(D(this.error))}andThrough(D){return H2(this.error)}andTee(D){return H2(this.error)}andThen(D){return H2(this.error)}orElse(D){return D(this.error)}asyncAndThen(D){return U7(this.error)}asyncAndThrough(D){return U7(this.error)}asyncMap(D){return U7(this.error)}unwrapOr(D){return D}match(D,F){return F(this.error)}safeUnwrap(){const D=this.error;return function*(){throw yield H2(D),new Error("Do not use this generator out of `safeTry`")}()}_unsafeUnwrap(D){throw wy("Called `_unsafeUnwrap` on an Err",this,D)}_unsafeUnwrapErr(D){return this.error}}var xFD=A7.fromThrowable;QU();I7();M7();CE();function $ED(){const D=/--verbose(?!\s*=\s*false|\s+false)(?:\s+|=true)?(?:$|\s)/,F=RU();if(D.test(F))return 4;return 3}var IE={...T7({level:$ED()}),warning:(D)=>console.warn(D),dump:(...D)=>console.log(...D),dd:(...D)=>{console.log(...D),K7.exit(1)},echo:(D)=>console.log(D)};var m1={info:async(D,F)=>{if(F?.styled===!1)console.log(D);else IE.info(D);await x8(`INFO: ${Y0(D)}`)},success:async(D,F)=>{if(F?.styled===!1)console.log(D);else IE.success(D);await x8(`SUCCESS: ${Y0(D)}`)},warn:async(D,F)=>{if(F?.styled===!1)console.log(D);else IE.warn(D);await x8(`WARN: ${Y0(D)}`)},warning:async(D,F)=>{if(F?.styled===!1)console.log(D);else IE.warn(D);await x8(`WARN: ${Y0(D)}`)},error:async(D,F)=>{h7(D,F)},debug:async(...D)=>{const E=`DEBUG: ${D.map((w)=>typeof w==="object"?JSON.stringify(w,null,2):w).join(" ")}`;if(K7.env.APP_ENV==="production"||K7.env.APP_ENV==="prod")return x8(E);IE.debug(E),await x8(Y0(E))},dump:(...D)=>D.forEach((F)=>console.log(F)),dd:(...D)=>{D.forEach((F)=>console.log(F)),K7.exit(1)},echo:(...D)=>console.log(...D)};function RP(D){return $7(`database/${D||""}`)}function CED(D){return $7(`app/${D||""}`)}function VP(D){return CED(`Commands/${D||""}`)}function DU(D){return C7(`logs/${D||""}`)}function $7(D="",F){let E=sy.cwd();while(E.includes("storage"))E=_y(E,"..");const w=_y(E,D);if(F?.relative)return fED(sy.cwd(),w);return w}function C7(D){return $7(`storage/${D||""}`)}var I4D=Q(ec(),1);import G4D from"process";function eU(D){if(Array.isArray(D))return[...D];return{...D}}function Dg(D){if(Array.isArray(D))return D;return[D]}function _7(D,...F){Dg(F).forEach((E)=>{delete D[E]})}function K1(D){return typeof D==="object"&&!Array.isArray(D)&&D!==null}var e1=(D)=>Array.isArray(D),Z0=(D)=>typeof D==="function";function W6(D,F){try{return F.split(".").reduce((E,w)=>E[w],D)}catch(E){return D}}function PF(D){if(Array.isArray(D))return[...D];if("all"in D&&typeof D.all==="function")return D.all();return Object.values(D)}function Fg(D){return new BD(D)}function Y4D(){let D=-1;return{next:()=>{return D+=1,{value:this.items[D],done:D>=this.items.length}}}}class BD{items;constructor(D=[]){this.items=D}[Symbol.iterator]=Y4D;toJSON(){return this.items}all(){return this.items}average(D){if(D===void 0)return this.sum()/Number(this.items.length);if(Z0(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 BD(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 BD(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=eU(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 BD(F)}crossJoin(...D){function F(E,w,$){let C=$[0];if(C instanceof BD)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)),G4D.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 BD(this.items);const E=this.items.filter((w)=>{return D.findIndex((C)=>{return F(w,C)===0})===-1});return new BD(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 PF(this.items).every(D)}except(D){const F={...this.items};return(Array.isArray(D)?D:[D]).forEach((w)=>delete F[w]),new BD(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 BD(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 BD(F)}first(D,F){if(Z0(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(Z0(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(Z0(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 BD(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 BD;F[$].push(E)}),new BD(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(Z0(D))this.items.forEach((E)=>{F[D(E)]=E});else this.items.forEach((E)=>{const w=W6(E,D);F[w||""]=E});return new this.constructor(F)}keys(){return new BD(Object.keys(this.items))}last(D,F){let{items:E}=this;if(Z0(D))E=this.filter(D).all();if(Array.isArray(E)&&!E.length||!Object.keys(E).length){if(Z0(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 BD(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=PF(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 BD(F)}pad(D,F){const E=Math.abs(D),w=this.count();if(E<=w)return this;let $=E-w;const C=eU(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=M4D(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(W6(w,D)!==void 0)E[w[F]||""]=W6(w,D);else E[w[F]||""]=null}),new this.constructor(E)}return this.map((E)=>{if(W6(E,D)!==void 0)return W6(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 _7(this.items,$),C}const E=F.slice(-D),w=E.reduce(($,C)=>{return $[C]=this.items[C],$},{});return _7(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=PF(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(Z0(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 _7(this.items,E),new this.constructor(w)}return null}shuffle(){const D=PF(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(Z0(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(Z0(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(Z0(D))return D(w);return W6(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 BD(E)}sum(D){const F=PF(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(Z0(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(Z0(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(Z0(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 BD(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 BD(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 BD(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 BD(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 BD)return D;return new BD(Array.isArray(D)?D:[D])}static unwrap(D){if(D instanceof BD)return D.all();return D}wrap(D){if(D instanceof BD)return D;if(typeof D==="object")return new BD(D);return new BD([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 M4D=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};CE();function o(D,F,E=1){const w=`\x1B[${D}m`,$=`\x1B[${F}m`,C=new RegExp(`\\x1b\\[${F}m`,"g");return(f)=>{return Eg.enabled&&Eg.supportLevel>=E?w+(""+f).replace(C,w)+$:""+f}}var J6=!0,yF=typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:{},QE=0;if(yF.process&&yF.process.env&&yF.process.stdout){const{FORCE_COLOR:D,NODE_DISABLE_COLORS:F,NO_COLOR:E,TERM:w,COLORTERM:$}=yF.process.env;if(F||E||D==="0")J6=!1;else if(D==="1"||D==="2"||D==="3")J6=!0;else if(w==="dumb")J6=!1;else if("CI"in yF.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some((C)=>(C in yF.process.env)))J6=!0;else J6=process.stdout.isTTY;if(J6)if(process.platform==="win32")QE=3;else if($&&($==="truecolor"||$==="24bit"))QE=3;else if(w&&(w.endsWith("-256color")||w.endsWith("256")))QE=2;else QE=1}var Eg={enabled:J6,supportLevel:QE},Z4D=o(0,0),wg=o(1,22),$g=o(2,22),M6=o(3,23),X4D=o(4,24),W4D=o(7,27),J4D=o(8,28),z4D=o(9,29),T4D=o(30,39),K4D=o(31,39),fg=o(32,39),S4D=o(33,39),Q4D=o(34,39),H4D=o(35,39),Cg=o(36,39),L4D=o(97,39),Bg=o(90,39),R4D=o(37,39),V4D=o(91,39),N4D=o(92,39),q4D=o(93,39),O4D=o(94,39),j4D=o(95,39),P4D=o(96,39),y4D=o(40,49),k4D=o(41,49),b4D=o(42,49),x4D=o(43,49),c4D=o(44,49),g4D=o(45,49),hg=o(46,49),r4D=o(107,49),_4D=o(100,49),s4D=o(101,49),u4D=o(102,49),d4D=o(103,49),v4D=o(104,49),m4D=o(105,49),n4D=o(106,49),l4D=o(47,49);var tgD=Fg(["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."]);import p4D from"process";function RU(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 RU(p4D.argv.slice(2))}var Jg=Q(Wg(),1);async function srD(){D7D.env.AWS_REGION="us-east-1";const D=await T2()(),F=eh.models;if(!F)throw new Error("No AI models found. Please set ./config/ai.ts values.");for(let E of F)try{m1.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"},$=Jg.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();m1.info(`Response for model ${E}:`,B)}catch(w){m1.error(`Error requesting access to model ${E}:`,w)}}export{YqD as summarize,srD as requestModelAccess,vOD as listFoundationModels,IqD as invokeModelWithResponseStream,AqD as invokeModel,dOD as getModelCustomizationJob,uOD as createModelCustomizationJob,p3 as client,ZqD as ask,YF as InvokeModelCommand};
207
+
208
+ //# debugId=360F628C3B46931B64756E2164756E21
13
209
  //# sourceMappingURL=index.js.map