@agentlang/lstudio 0.3.3 → 0.3.5
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/assets/{AwsJson1_1Protocol-BMEXrEwh.js → AwsJson1_1Protocol-BXIJ4DkX.js} +1 -1
- package/assets/{fs-BtXtXAGk.js → fs-Do7YaMLp.js} +1 -1
- package/assets/{index-CtRwYoaH.js → index-Bv_84CuN.js} +1 -1
- package/assets/{index-lnUXQIZ7.js → index-CPgyIhh1.js} +1 -1
- package/assets/{index-D4z_hbl0-8q9qDX82.js → index-D4z_hbl0-CxJhywsh.js} +1 -1
- package/assets/{index-D-H8jqdo.js → index-DBSmTlNp.js} +1 -1
- package/assets/{index-CMJMJH5D.js → index-DI1IW8Iz.js} +1 -1
- package/assets/{index-BoUtnEBm.js → index-DXbaTsgS.js} +12 -12
- package/assets/{index.browser-DWOcmpbC.js → index.browser-BVdx1GK8.js} +3 -3
- package/assets/{loadCognitoIdentity-Cu2BeqbK.js → loadCognitoIdentity-C2DFn5df.js} +1 -1
- package/assets/{loadSts-CIy_Nnp_.js → loadSts-B3x1qGWU.js} +1 -1
- package/assets/{replService-hwYs6fOd.js → replService-C1_ibN45.js} +1 -1
- package/assets/{util-B1t4ZJjf.js → util-CxZAtT13.js} +1 -1
- package/assets/{winston-1qzyIKCb-DV4n-oz6.js → winston-1qzyIKCb-NUbYViBc.js} +1 -1
- package/assets/{winston-CtxF18qc-DRc0XokP.js → winston-CtxF18qc-CSJQEO1L.js} +1 -1
- package/assets/{winston-Dx5kI_zk.js → winston-DQd-ZvTl.js} +1 -1
- package/assets/{winston-DWoHln0X.js → winston-DnWXlpHO.js} +1 -1
- package/index.html +3 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as h,c as T,S as y,b as p,U as N,d as _,L as w,e as b,f as R,v as E,R as z,P as J,h as M,T as j}from"./index-
|
|
1
|
+
import{N as h,c as T,S as y,b as p,U as N,d as _,L as w,e as b,f as R,v as E,R as z,P as J,h as M,T as j}from"./index-Bv_84CuN.js";import{t as D,a as I,p as k,b as A,c as O,d as S,e as B}from"./normalizeProvider-EC8cbfMc.js";function U(f,t,e){if(e?.source){const i=e.source;if(typeof t=="number"&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||i!==String(t)))return i.includes(".")?new h(i,"bigDecimal"):BigInt(i)}return t}const $=(f,t)=>T(f,t).then(e=>(t?.utf8Encoder??D)(e)),Q=(f,t)=>$(f,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(i){throw i?.name==="SyntaxError"&&Object.defineProperty(i,"$responseBodyText",{value:e}),i}return{}}),V=(f,t)=>{const e=(n,r)=>Object.keys(n).find(o=>o.toLowerCase()===r.toLowerCase()),i=n=>{let r=n;return typeof r=="number"&&(r=r.toString()),r.indexOf(",")>=0&&(r=r.split(",")[0]),r.indexOf(":")>=0&&(r=r.split(":")[0]),r.indexOf("#")>=0&&(r=r.split("#")[1]),r},s=e(f.headers,"x-amzn-errortype");if(s!==void 0)return i(f.headers[s]);if(t&&typeof t=="object"){const n=e(t,"code");if(n&&t[n]!==void 0)return i(t[n]);if(t.__type!==void 0)return i(t.__type)}};class L extends y{settings;constructor(t){super(),this.settings=t}async read(t,e){return this._read(t,typeof e=="string"?JSON.parse(e,U):await Q(e,this.serdeContext))}readObject(t,e){return this._read(t,e)}_read(t,e){const i=e!==null&&typeof e=="object",s=p.of(t);if(i){if(s.isStructSchema()){const r=s.isUnionSchema(),o={};let c;r&&(c=new N(e,o));for(const[a,m]of _(s,e,this.settings.jsonName?"jsonName":!1)){const u=this.settings.jsonName?m.getMergedTraits().jsonName??a:a;r&&c.mark(u),e[u]!=null&&(o[a]=this._read(m,e[u]))}return r&&c.writeUnknown(),o}if(Array.isArray(e)&&s.isListSchema()){const r=s.getValueSchema(),o=[],c=!!s.getMergedTraits().sparse;for(const a of e)(c||a!=null)&&o.push(this._read(r,a));return o}if(s.isMapSchema()){const r=s.getValueSchema(),o={},c=!!s.getMergedTraits().sparse;for(const[a,m]of Object.entries(e))(c||m!=null)&&(o[a]=this._read(r,m));return o}}if(s.isBlobSchema()&&typeof e=="string")return I(e);const n=s.getMergedTraits().mediaType;if(s.isStringSchema()&&typeof e=="string"&&n)return n==="application/json"||n.endsWith("+json")?w.from(e):e;if(s.isTimestampSchema()&&e!=null)switch(b(s,this.settings)){case 5:return O(e);case 6:return A(e);case 7:return k(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}if(s.isBigIntegerSchema()&&(typeof e=="number"||typeof e=="string"))return BigInt(e);if(s.isBigDecimalSchema()&&e!=null){if(e instanceof h)return e;const r=e;return r.type==="bigDecimal"&&"string"in r?new h(r.string,r.type):new h(String(e),"bigDecimal")}if(s.isNumericSchema()&&typeof e=="string"){switch(e){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return e}if(s.isDocumentSchema())if(i){const r=Array.isArray(e)?[]:{};for(const[o,c]of Object.entries(e))c instanceof h?r[o]=c:r[o]=this._read(s,c);return r}else return structuredClone(e);return e}}const l="Ν";class P{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(t,e)=>{if(e instanceof h){const i=`${l+"nv"+this.counter++}_`+e.string;return this.values.set(`"${i}"`,e.string),i}if(typeof e=="bigint"){const i=e.toString(),s=`${l+"b"+this.counter++}_`+i;return this.values.set(`"${s}"`,i),s}return e}}replaceInJson(t){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return t;for(const[e,i]of this.values)t=t.replace(e,i);return t}}class F extends y{settings;buffer;useReplacer=!1;rootSchema;constructor(t){super(),this.settings=t}write(t,e){this.rootSchema=p.of(t),this.buffer=this._write(this.rootSchema,e)}writeDiscriminatedDocument(t,e){this.write(t,e),typeof this.buffer=="object"&&(this.buffer.__type=p.of(t).getName(!0))}flush(){const{rootSchema:t,useReplacer:e}=this;if(this.rootSchema=void 0,this.useReplacer=!1,t?.isStructSchema()||t?.isDocumentSchema()){if(!e)return JSON.stringify(this.buffer);const i=new P;return i.replaceInJson(JSON.stringify(this.buffer,i.createReplacer(),0))}return this.buffer}_write(t,e,i){const s=e!==null&&typeof e=="object",n=p.of(t);if(s){if(n.isStructSchema()){const r={};for(const[o,c]of R(n,e)){const a=this._write(c,e[o],n);if(a!==void 0){const m=c.getMergedTraits().jsonName,u=this.settings.jsonName?m??o:o;r[u]=a}}if(n.isUnionSchema()&&Object.keys(r).length===0){const{$unknown:o}=e;if(Array.isArray(o)){const[c,a]=o;r[c]=this._write(15,a)}}return r}if(Array.isArray(e)&&n.isListSchema()){const r=n.getValueSchema(),o=[],c=!!n.getMergedTraits().sparse;for(const a of e)(c||a!=null)&&o.push(this._write(r,a));return o}if(n.isMapSchema()){const r=n.getValueSchema(),o={},c=!!n.getMergedTraits().sparse;for(const[a,m]of Object.entries(e))(c||m!=null)&&(o[a]=this._write(r,m));return o}if(e instanceof Uint8Array&&(n.isBlobSchema()||n.isDocumentSchema()))return n===this.rootSchema?e:(this.serdeContext?.base64Encoder??S)(e);if(e instanceof Date&&(n.isTimestampSchema()||n.isDocumentSchema()))switch(b(n,this.settings)){case 5:return e.toISOString().replace(".000Z","Z");case 6:return B(e);case 7:return e.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",e),e.getTime()/1e3}e instanceof h&&(this.useReplacer=!0)}if(!(e===null&&i?.isStructSchema())){if(n.isStringSchema()){if(typeof e>"u"&&n.isIdempotencyToken())return E();const r=n.getMergedTraits().mediaType;return e!=null&&r&&(r==="application/json"||r.endsWith("+json"))?w.from(e):e}if(typeof e=="number"&&n.isNumericSchema())return Math.abs(e)===1/0||isNaN(e)?String(e):e;if(typeof e=="string"&&n.isBlobSchema())return n===this.rootSchema?e:(this.serdeContext?.base64Encoder??S)(e);if(typeof e=="bigint"&&(this.useReplacer=!0),n.isDocumentSchema())if(s){const r=Array.isArray(e)?[]:{};for(const[o,c]of Object.entries(e))c instanceof h?(this.useReplacer=!0,r[o]=c):r[o]=this._write(n,c);return r}else return structuredClone(e);return e}}}class q extends y{settings;constructor(t){super(),this.settings=t}createSerializer(){const t=new F(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){const t=new L(this.settings);return t.setSerdeContext(this.serdeContext),t}}class K extends z{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:t,serviceTarget:e,awsQueryCompatible:i,jsonCodec:s}){super({defaultNamespace:t}),this.serviceTarget=e,this.codec=s??new q({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!i,this.mixin=new J(this.awsQueryCompatible)}async serializeRequest(t,e,i){const s=await super.serializeRequest(t,e,i);return s.path.endsWith("/")||(s.path+="/"),Object.assign(s.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${t.name}`}),this.awsQueryCompatible&&(s.headers["x-amzn-query-mode"]="true"),(M(t.input)==="unit"||!s.body)&&(s.body="{}"),s}getPayloadCodec(){return this.codec}async handleError(t,e,i,s,n){this.awsQueryCompatible&&this.mixin.setQueryCompatError(s,i);const r=V(i,s)??"Unknown",{errorSchema:o,errorMetadata:c}=await this.mixin.getErrorSchemaOrThrowBaseException(r,this.options.defaultNamespace,i,s,n,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),a=p.of(o),m=s.message??s.Message??"Unknown",u=j.for(o[1]).getErrorCtor(o)??Error,x=new u(m),d={};for(const[g,C]of a.structIterator())s[g]!=null&&(d[g]=this.codec.createDeserializer().readObject(C,s[g]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(s,d),this.mixin.decorateServiceException(Object.assign(x,c,{$fault:a.getMergedTraits().error,message:m},d),s)}}class Z extends K{constructor({defaultNamespace:t,serviceTarget:e,awsQueryCompatible:i,jsonCodec:s}){super({defaultNamespace:t,serviceTarget:e,awsQueryCompatible:i,jsonCodec:s})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}export{Z as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{E as I}from"./index-BoUtnEBm.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ChvoNxcO.js";import"./preload-helper-BlTxHScW.js";import"./__vite-browser-external-DLjrMatA.js";import"./inherits_browser-nmOknR35-Bp0mvRSL.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";import"./index-DsIu-45t-Bejjlpz4.js";import"./index-DSosZ5sh-Ceejs_jv.js";import"./index-69shuAsh-DF18H7zf.js";import"./index-BJBOx-Z---hbiLl7B.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./_commonjs-dynamic-modules-B7n8ZNar.js";var S=Object.defineProperty,A=(r,e,n)=>e in r?S(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,g=(r,e,n)=>A(r,typeof e!="symbol"?e+"":e,n);function x(r,e){for(var n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&!Array.isArray(o)){for(const t in o)if(t!=="default"&&!(t in r)){const i=Object.getOwnPropertyDescriptor(o,t);i&&Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>o[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function v(r){return{isFile:()=>r.isFile(),isDirectory:()=>r.isDirectory(),isSymbolicLink:()=>r.isSymbolicLink(),size:r.size,mtime:r.mtime}}class j{async readFile(e){return(void 0)(e,"utf8")}async readFileBuffer(e){return(void 0)(e)}async writeFile(e,n){const o=(void 0)(e);return await this.ensureDir(o),(void 0)(e,n)}async exists(e){try{return await(void 0)(e),!0}catch{return!1}}async mkdir(e){try{await(void 0)(e)}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async readdir(e){return(void 0)(e)}async stat(e){const n=await(void 0)(e);return v(n)}async lstat(e){const n=await(void 0)(e);return v(n)}async unlink(e){return(void 0)(e)}async rmdir(e){return(void 0)(e)}async copyFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async moveFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async ensureDir(e){try{await(void 0)(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){return(void 0)(e,{recursive:!0,force:!0})}async readDirectory(e){return(void 0)(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=(void 0)(n,t.path);if(t.type==="directory")await this.ensureDir(i),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}function T(){return new j}function E(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var F,z;function $(){if(z)return F;z=1;function r(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function e(t,i){for(var s="",c=0,u=-1,a=0,f,l=0;l<=t.length;++l){if(l<t.length)f=t.charCodeAt(l);else{if(f===47)break;f=47}if(f===47){if(!(u===l-1||a===1))if(u!==l-1&&a===2){if(s.length<2||c!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",c=0):(s=s.slice(0,d),c=s.length-1-s.lastIndexOf("/")),u=l,a=0;continue}}else if(s.length===2||s.length===1){s="",c=0,u=l,a=0;continue}}i&&(s.length>0?s+="/..":s="..",c=2)}else s.length>0?s+="/"+t.slice(u+1,l):s=t.slice(u+1,l),c=l-u-1;u=l,a=0}else f===46&&a!==-1?++a:a=-1}return s}function n(t,i){var s=i.dir||i.root,c=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+c:s+t+c:c}var o={resolve:function(){for(var t="",i=!1,s,c=arguments.length-1;c>=-1&&!i;c--){var u;c>=0?u=arguments[c]:(s===void 0&&(s=process.cwd()),u=s),r(u),u.length!==0&&(t=u+"/"+t,i=u.charCodeAt(0)===47)}return t=e(t,!i),i?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(r(t),t.length===0)return".";var i=t.charCodeAt(0)===47,s=t.charCodeAt(t.length-1)===47;return t=e(t,!i),t.length===0&&!i&&(t="."),t.length>0&&s&&(t+="/"),i?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,i=0;i<arguments.length;++i){var s=arguments[i];r(s),s.length>0&&(t===void 0?t=s:t+="/"+s)}return t===void 0?".":o.normalize(t)},relative:function(t,i){if(r(t),r(i),t===i||(t=o.resolve(t),i=o.resolve(i),t===i))return"";for(var s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length,u=c-s,a=1;a<i.length&&i.charCodeAt(a)===47;++a);for(var f=i.length,l=f-a,d=u<l?u:l,y=-1,h=0;h<=d;++h){if(h===d){if(l>d){if(i.charCodeAt(a+h)===47)return i.slice(a+h+1);if(h===0)return i.slice(a+h)}else u>d&&(t.charCodeAt(s+h)===47?y=h:h===0&&(y=0));break}var b=t.charCodeAt(s+h),k=i.charCodeAt(a+h);if(b!==k)break;b===47&&(y=h)}var m="";for(h=s+y+1;h<=c;++h)(h===c||t.charCodeAt(h)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+i.slice(a+y):(a+=y,i.charCodeAt(a)===47&&++a,i.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),t.length===0)return".";for(var i=t.charCodeAt(0),s=i===47,c=-1,u=!0,a=t.length-1;a>=1;--a)if(i=t.charCodeAt(a),i===47){if(!u){c=a;break}}else u=!1;return c===-1?s?"/":".":s&&c===1?"//":t.slice(0,c)},basename:function(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');r(t);var s=0,c=-1,u=!0,a;if(i!==void 0&&i.length>0&&i.length<=t.length){if(i.length===t.length&&i===t)return"";var f=i.length-1,l=-1;for(a=t.length-1;a>=0;--a){var d=t.charCodeAt(a);if(d===47){if(!u){s=a+1;break}}else l===-1&&(u=!1,l=a+1),f>=0&&(d===i.charCodeAt(f)?--f===-1&&(c=a):(f=-1,c=l))}return s===c?c=l:c===-1&&(c=t.length),t.slice(s,c)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!u){s=a+1;break}}else c===-1&&(u=!1,c=a+1);return c===-1?"":t.slice(s,c)}},extname:function(t){r(t);for(var i=-1,s=0,c=-1,u=!0,a=0,f=t.length-1;f>=0;--f){var l=t.charCodeAt(f);if(l===47){if(!u){s=f+1;break}continue}c===-1&&(u=!1,c=f+1),l===46?i===-1?i=f:a!==1&&(a=1):i!==-1&&(a=-1)}return i===-1||c===-1||a===0||a===1&&i===c-1&&i===s+1?"":t.slice(i,c)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n("/",t)},parse:function(t){r(t);var i={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;var s=t.charCodeAt(0),c=s===47,u;c?(i.root="/",u=1):u=0;for(var a=-1,f=0,l=-1,d=!0,y=t.length-1,h=0;y>=u;--y){if(s=t.charCodeAt(y),s===47){if(!d){f=y+1;break}continue}l===-1&&(d=!1,l=y+1),s===46?a===-1?a=y:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||l===-1||h===0||h===1&&a===l-1&&a===f+1?l!==-1&&(f===0&&c?i.base=i.name=t.slice(1,l):i.base=i.name=t.slice(f,l)):(f===0&&c?(i.name=t.slice(1,a),i.base=t.slice(1,l)):(i.name=t.slice(f,a),i.base=t.slice(f,l)),i.ext=t.slice(a,l)),f>0?i.dir=t.slice(0,f-1):c&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,F=o,F}var D=$();const O=E(D),L=x({__proto__:null,default:O},[D]);function C(r){if(r&&typeof r=="object"){const e=r,n=typeof e.isFile=="function"?e.isFile():typeof e.isFile=="boolean"?e.isFile:e.type==="file"||!e.type&&!e.isDirectory,o=typeof e.isDirectory=="function"?e.isDirectory():typeof e.isDirectory=="boolean"?e.isDirectory:e.type==="dir"||e.type==="directory",t=typeof e.size=="number"?e.size:0;let i;return e.mtime instanceof Date?i=e.mtime:typeof e.mtime=="number"?i=new Date(e.mtime):typeof e.mtimeMs=="number"?i=new Date(e.mtimeMs):i=new Date,{isFile:()=>n,isDirectory:()=>o,isSymbolicLink:()=>!1,size:t,mtime:i}}return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:0,mtime:new Date}}class P{constructor(){g(this,"fs"),g(this,"initialized",!1),g(this,"path",L)}async initialize(e={}){if(this.initialized)return;const n=e.name||"fs",o=new I(n,{wipe:e.wipe});this.fs=o.promises,this.initialized=!0}ensureInitialized(){if(!this.initialized)throw new Error("LightningFileSystem is not initialized. Call initialize() first.")}async readFile(e){return this.ensureInitialized(),(await this.fs.readFile(e,{encoding:"utf8"})).toString()}async readFileBuffer(e){return this.ensureInitialized(),this.fs.readFile(e)}async writeFile(e,n){this.ensureInitialized();const o=e.substring(0,e.lastIndexOf("/"));return o&&await this.ensureDir(o),this.fs.writeFile(e,n)}async exists(e){this.ensureInitialized();try{return await this.fs.stat(e),!0}catch{return!1}}async mkdir(e,n){this.ensureInitialized();try{return await this.fs.mkdir(e,n)}catch(o){if(o&&typeof o=="object"&&"code"in o&&o.code!=="EEXIST")throw o}}async readdir(e){return this.ensureInitialized(),this.fs.readdir(e)}async stat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async lstat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async unlink(e){return this.ensureInitialized(),this.fs.unlink(e)}async rmdir(e){return this.ensureInitialized(),this.fs.rmdir(e)}async copyFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o);const t=await this.readFileBuffer(e);return this.writeFile(n,t)}async moveFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o),await this.copyFile(e,n),await this.unlink(e)}async ensureDir(e){if(this.ensureInitialized(),!await this.exists(e))try{await this.fs.mkdir(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){if(this.ensureInitialized(),!await this.exists(e))return;if((await this.stat(e)).isFile())return this.unlink(e);const n=await this.readdir(e);for(const o of n){const t=`${e}/${o}`;await this.removeDir(t)}return this.rmdir(e)}async readDirectory(e){return this.ensureInitialized(),this.fs.readdir(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=this.path.join(n,t.path);if(t.type==="directory")await this.mkdir(i,{recursive:!0}),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}async function _(r){const e=new P;return await e.initialize(r),e}function B(){return"http://localhost:4000"}const p=B();function w(r){let e=r.replace(/^\/+/,"");const n=e.split("/");return n.length>1&&(e=n.slice(1).join("/")),e}function R(){return{async readFile(r){const e=w(r),n=await fetch(`${p}/file?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read file ${r}: ${n.statusText}`);const{content:o}=await n.json();return o},async readFileBuffer(r){const e=await this.readFile(r);return Buffer.from(e,"utf-8")},async writeFile(r,e){const n=w(r),o=typeof e=="string"?e:e.toString("utf-8"),t=await fetch(`${p}/file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:o})});if(!t.ok)throw new Error(`Failed to write file ${r}: ${t.statusText}`)},async exists(r){const e=w(r);try{return(await fetch(`${p}/stat?path=${encodeURIComponent(e)}`)).ok}catch{return!1}},async mkdir(r){},async readdir(r){const e=w(r),n=await fetch(`${p}/files?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read directory ${r}: ${n.statusText}`);return(await n.json()).map(o=>o.name)},async stat(r){const e=w(r),n=await fetch(`${p}/stat?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to stat ${r}: ${n.statusText}`);const{type:o,size:t,mtime:i}=await n.json();return{isFile:()=>o==="file",isDirectory:()=>o==="directory",isSymbolicLink:()=>!1,size:t,mtime:new Date(i)}},async lstat(r){return this.stat(r)},async unlink(r){throw new Error("File deletion not supported in CLI mode")},async rmdir(r){throw new Error("Directory deletion not supported in CLI mode")},async copyFile(r,e){const n=await this.readFile(r);await this.writeFile(e,n)},async moveFile(r,e){await this.copyFile(r,e)},async ensureDir(r){},async removeDir(r){throw new Error("Directory deletion not supported in CLI mode")},async readDirectory(r){return this.readdir(r)},async writeFileSystemFromTree(r,e,n){console.debug("writeFileSystemFromTree called - no-op in CLI mode")}}}async function te(r){return typeof window>"u"?T():r!=null&&r.useCliBackend?R():_(r)}export{R as createCliFS,te as createFS,_ as createLightningFS,T as createNodeFS};
|
|
1
|
+
import{E as I}from"./index-DXbaTsgS.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./index-ChvoNxcO.js";import"./preload-helper-BlTxHScW.js";import"./__vite-browser-external-DLjrMatA.js";import"./inherits_browser-nmOknR35-Bp0mvRSL.js";import"./index-6mKfgpcs-DsgiI2lM.js";import"./_commonjsHelpers-B4e78b8K-W3E8ocG7.js";import"./index-DsIu-45t-Bejjlpz4.js";import"./index-DSosZ5sh-Ceejs_jv.js";import"./index-69shuAsh-DF18H7zf.js";import"./index-BJBOx-Z---hbiLl7B.js";import"./index.browser-BHPvGrwi-6Mh8eUw-.js";import"./_commonjs-dynamic-modules-BpilXLfW-DfYEAvWy.js";import"./_commonjs-dynamic-modules-B7n8ZNar.js";var S=Object.defineProperty,A=(r,e,n)=>e in r?S(r,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):r[e]=n,g=(r,e,n)=>A(r,typeof e!="symbol"?e+"":e,n);function x(r,e){for(var n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&&!Array.isArray(o)){for(const t in o)if(t!=="default"&&!(t in r)){const i=Object.getOwnPropertyDescriptor(o,t);i&&Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>o[t]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}function v(r){return{isFile:()=>r.isFile(),isDirectory:()=>r.isDirectory(),isSymbolicLink:()=>r.isSymbolicLink(),size:r.size,mtime:r.mtime}}class j{async readFile(e){return(void 0)(e,"utf8")}async readFileBuffer(e){return(void 0)(e)}async writeFile(e,n){const o=(void 0)(e);return await this.ensureDir(o),(void 0)(e,n)}async exists(e){try{return await(void 0)(e),!0}catch{return!1}}async mkdir(e){try{await(void 0)(e)}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async readdir(e){return(void 0)(e)}async stat(e){const n=await(void 0)(e);return v(n)}async lstat(e){const n=await(void 0)(e);return v(n)}async unlink(e){return(void 0)(e)}async rmdir(e){return(void 0)(e)}async copyFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async moveFile(e,n){const o=(void 0)(n);return await this.ensureDir(o),(void 0)(e,n)}async ensureDir(e){try{await(void 0)(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){return(void 0)(e,{recursive:!0,force:!0})}async readDirectory(e){return(void 0)(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=(void 0)(n,t.path);if(t.type==="directory")await this.ensureDir(i),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}function T(){return new j}function E(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var F,z;function $(){if(z)return F;z=1;function r(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function e(t,i){for(var s="",c=0,u=-1,a=0,f,l=0;l<=t.length;++l){if(l<t.length)f=t.charCodeAt(l);else{if(f===47)break;f=47}if(f===47){if(!(u===l-1||a===1))if(u!==l-1&&a===2){if(s.length<2||c!==2||s.charCodeAt(s.length-1)!==46||s.charCodeAt(s.length-2)!==46){if(s.length>2){var d=s.lastIndexOf("/");if(d!==s.length-1){d===-1?(s="",c=0):(s=s.slice(0,d),c=s.length-1-s.lastIndexOf("/")),u=l,a=0;continue}}else if(s.length===2||s.length===1){s="",c=0,u=l,a=0;continue}}i&&(s.length>0?s+="/..":s="..",c=2)}else s.length>0?s+="/"+t.slice(u+1,l):s=t.slice(u+1,l),c=l-u-1;u=l,a=0}else f===46&&a!==-1?++a:a=-1}return s}function n(t,i){var s=i.dir||i.root,c=i.base||(i.name||"")+(i.ext||"");return s?s===i.root?s+c:s+t+c:c}var o={resolve:function(){for(var t="",i=!1,s,c=arguments.length-1;c>=-1&&!i;c--){var u;c>=0?u=arguments[c]:(s===void 0&&(s=process.cwd()),u=s),r(u),u.length!==0&&(t=u+"/"+t,i=u.charCodeAt(0)===47)}return t=e(t,!i),i?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(r(t),t.length===0)return".";var i=t.charCodeAt(0)===47,s=t.charCodeAt(t.length-1)===47;return t=e(t,!i),t.length===0&&!i&&(t="."),t.length>0&&s&&(t+="/"),i?"/"+t:t},isAbsolute:function(t){return r(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,i=0;i<arguments.length;++i){var s=arguments[i];r(s),s.length>0&&(t===void 0?t=s:t+="/"+s)}return t===void 0?".":o.normalize(t)},relative:function(t,i){if(r(t),r(i),t===i||(t=o.resolve(t),i=o.resolve(i),t===i))return"";for(var s=1;s<t.length&&t.charCodeAt(s)===47;++s);for(var c=t.length,u=c-s,a=1;a<i.length&&i.charCodeAt(a)===47;++a);for(var f=i.length,l=f-a,d=u<l?u:l,y=-1,h=0;h<=d;++h){if(h===d){if(l>d){if(i.charCodeAt(a+h)===47)return i.slice(a+h+1);if(h===0)return i.slice(a+h)}else u>d&&(t.charCodeAt(s+h)===47?y=h:h===0&&(y=0));break}var b=t.charCodeAt(s+h),k=i.charCodeAt(a+h);if(b!==k)break;b===47&&(y=h)}var m="";for(h=s+y+1;h<=c;++h)(h===c||t.charCodeAt(h)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+i.slice(a+y):(a+=y,i.charCodeAt(a)===47&&++a,i.slice(a))},_makeLong:function(t){return t},dirname:function(t){if(r(t),t.length===0)return".";for(var i=t.charCodeAt(0),s=i===47,c=-1,u=!0,a=t.length-1;a>=1;--a)if(i=t.charCodeAt(a),i===47){if(!u){c=a;break}}else u=!1;return c===-1?s?"/":".":s&&c===1?"//":t.slice(0,c)},basename:function(t,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');r(t);var s=0,c=-1,u=!0,a;if(i!==void 0&&i.length>0&&i.length<=t.length){if(i.length===t.length&&i===t)return"";var f=i.length-1,l=-1;for(a=t.length-1;a>=0;--a){var d=t.charCodeAt(a);if(d===47){if(!u){s=a+1;break}}else l===-1&&(u=!1,l=a+1),f>=0&&(d===i.charCodeAt(f)?--f===-1&&(c=a):(f=-1,c=l))}return s===c?c=l:c===-1&&(c=t.length),t.slice(s,c)}else{for(a=t.length-1;a>=0;--a)if(t.charCodeAt(a)===47){if(!u){s=a+1;break}}else c===-1&&(u=!1,c=a+1);return c===-1?"":t.slice(s,c)}},extname:function(t){r(t);for(var i=-1,s=0,c=-1,u=!0,a=0,f=t.length-1;f>=0;--f){var l=t.charCodeAt(f);if(l===47){if(!u){s=f+1;break}continue}c===-1&&(u=!1,c=f+1),l===46?i===-1?i=f:a!==1&&(a=1):i!==-1&&(a=-1)}return i===-1||c===-1||a===0||a===1&&i===c-1&&i===s+1?"":t.slice(i,c)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return n("/",t)},parse:function(t){r(t);var i={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;var s=t.charCodeAt(0),c=s===47,u;c?(i.root="/",u=1):u=0;for(var a=-1,f=0,l=-1,d=!0,y=t.length-1,h=0;y>=u;--y){if(s=t.charCodeAt(y),s===47){if(!d){f=y+1;break}continue}l===-1&&(d=!1,l=y+1),s===46?a===-1?a=y:h!==1&&(h=1):a!==-1&&(h=-1)}return a===-1||l===-1||h===0||h===1&&a===l-1&&a===f+1?l!==-1&&(f===0&&c?i.base=i.name=t.slice(1,l):i.base=i.name=t.slice(f,l)):(f===0&&c?(i.name=t.slice(1,a),i.base=t.slice(1,l)):(i.name=t.slice(f,a),i.base=t.slice(f,l)),i.ext=t.slice(a,l)),f>0?i.dir=t.slice(0,f-1):c&&(i.dir="/"),i},sep:"/",delimiter:":",win32:null,posix:null};return o.posix=o,F=o,F}var D=$();const O=E(D),L=x({__proto__:null,default:O},[D]);function C(r){if(r&&typeof r=="object"){const e=r,n=typeof e.isFile=="function"?e.isFile():typeof e.isFile=="boolean"?e.isFile:e.type==="file"||!e.type&&!e.isDirectory,o=typeof e.isDirectory=="function"?e.isDirectory():typeof e.isDirectory=="boolean"?e.isDirectory:e.type==="dir"||e.type==="directory",t=typeof e.size=="number"?e.size:0;let i;return e.mtime instanceof Date?i=e.mtime:typeof e.mtime=="number"?i=new Date(e.mtime):typeof e.mtimeMs=="number"?i=new Date(e.mtimeMs):i=new Date,{isFile:()=>n,isDirectory:()=>o,isSymbolicLink:()=>!1,size:t,mtime:i}}return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:0,mtime:new Date}}class P{constructor(){g(this,"fs"),g(this,"initialized",!1),g(this,"path",L)}async initialize(e={}){if(this.initialized)return;const n=e.name||"fs",o=new I(n,{wipe:e.wipe});this.fs=o.promises,this.initialized=!0}ensureInitialized(){if(!this.initialized)throw new Error("LightningFileSystem is not initialized. Call initialize() first.")}async readFile(e){return this.ensureInitialized(),(await this.fs.readFile(e,{encoding:"utf8"})).toString()}async readFileBuffer(e){return this.ensureInitialized(),this.fs.readFile(e)}async writeFile(e,n){this.ensureInitialized();const o=e.substring(0,e.lastIndexOf("/"));return o&&await this.ensureDir(o),this.fs.writeFile(e,n)}async exists(e){this.ensureInitialized();try{return await this.fs.stat(e),!0}catch{return!1}}async mkdir(e,n){this.ensureInitialized();try{return await this.fs.mkdir(e,n)}catch(o){if(o&&typeof o=="object"&&"code"in o&&o.code!=="EEXIST")throw o}}async readdir(e){return this.ensureInitialized(),this.fs.readdir(e)}async stat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async lstat(e){this.ensureInitialized();const n=await this.fs.stat(e);return C(n)}async unlink(e){return this.ensureInitialized(),this.fs.unlink(e)}async rmdir(e){return this.ensureInitialized(),this.fs.rmdir(e)}async copyFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o);const t=await this.readFileBuffer(e);return this.writeFile(n,t)}async moveFile(e,n){this.ensureInitialized();const o=n.substring(0,n.lastIndexOf("/"));o&&await this.ensureDir(o),await this.copyFile(e,n),await this.unlink(e)}async ensureDir(e){if(this.ensureInitialized(),!await this.exists(e))try{await this.fs.mkdir(e,{recursive:!0})}catch(n){if(n&&typeof n=="object"&&"code"in n&&n.code!=="EEXIST")throw n}}async removeDir(e){if(this.ensureInitialized(),!await this.exists(e))return;if((await this.stat(e)).isFile())return this.unlink(e);const n=await this.readdir(e);for(const o of n){const t=`${e}/${o}`;await this.removeDir(t)}return this.rmdir(e)}async readDirectory(e){return this.ensureInitialized(),this.fs.readdir(e)}async writeFileSystemFromTree(e,n,o){for(const t of e){const i=this.path.join(n,t.path);if(t.type==="directory")await this.mkdir(i,{recursive:!0}),t.children&&await this.writeFileSystemFromTree(t.children,n,o);else{const s=await o(t.path);await this.writeFile(i,s)}}}}async function _(r){const e=new P;return await e.initialize(r),e}function B(){return"http://localhost:4000"}const p=B();function w(r){let e=r.replace(/^\/+/,"");const n=e.split("/");return n.length>1&&(e=n.slice(1).join("/")),e}function R(){return{async readFile(r){const e=w(r),n=await fetch(`${p}/file?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read file ${r}: ${n.statusText}`);const{content:o}=await n.json();return o},async readFileBuffer(r){const e=await this.readFile(r);return Buffer.from(e,"utf-8")},async writeFile(r,e){const n=w(r),o=typeof e=="string"?e:e.toString("utf-8"),t=await fetch(`${p}/file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:o})});if(!t.ok)throw new Error(`Failed to write file ${r}: ${t.statusText}`)},async exists(r){const e=w(r);try{return(await fetch(`${p}/stat?path=${encodeURIComponent(e)}`)).ok}catch{return!1}},async mkdir(r){},async readdir(r){const e=w(r),n=await fetch(`${p}/files?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to read directory ${r}: ${n.statusText}`);return(await n.json()).map(o=>o.name)},async stat(r){const e=w(r),n=await fetch(`${p}/stat?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Failed to stat ${r}: ${n.statusText}`);const{type:o,size:t,mtime:i}=await n.json();return{isFile:()=>o==="file",isDirectory:()=>o==="directory",isSymbolicLink:()=>!1,size:t,mtime:new Date(i)}},async lstat(r){return this.stat(r)},async unlink(r){throw new Error("File deletion not supported in CLI mode")},async rmdir(r){throw new Error("Directory deletion not supported in CLI mode")},async copyFile(r,e){const n=await this.readFile(r);await this.writeFile(e,n)},async moveFile(r,e){await this.copyFile(r,e)},async ensureDir(r){},async removeDir(r){throw new Error("Directory deletion not supported in CLI mode")},async readDirectory(r){return this.readdir(r)},async writeFileSystemFromTree(r,e,n){console.debug("writeFileSystemFromTree called - no-op in CLI mode")}}}async function te(r){return typeof window>"u"?T():r!=null&&r.useCliBackend?R():_(r)}export{R as createCliFS,te as createFS,_ as createLightningFS,T as createNodeFS};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DjgOAzh3.js","assets/normalizeProvider-EC8cbfMc.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{f as J,a as xt,d as It,t as _t,i as te,H as x,n as z,g as P,j as Ot,k as X}from"./normalizeProvider-EC8cbfMc.js";import{_ as Pt}from"./preload-helper-BlTxHScW.js";import{_ as kt,j as Mt}from"./index-
|
|
2
|
+
import{f as J,a as xt,d as It,t as _t,i as te,H as x,n as z,g as P,j as Ot,k as X}from"./normalizeProvider-EC8cbfMc.js";import{_ as Pt}from"./preload-helper-BlTxHScW.js";import{_ as kt,j as Mt}from"./index-DXbaTsgS.js";const $t=(t,e,r)=>{let s,n,i,a=!1;const c=async()=>{n||(n=t());try{s=await n,i=!0,a=!1}finally{n=void 0}return s};return async o=>((!i||o?.forceRefresh)&&(s=await c()),s)},Nn=t=>({setHttpHandler(e){t.httpHandler=e},httpHandler(){return t.httpHandler},updateHttpClientConfig(e,r){t.httpHandler?.updateHttpClientConfig(e,r)},httpHandlerConfigs(){return t.httpHandler.httpHandlerConfigs()}}),Dn=t=>({httpHandler:t.httpHandler()});var F;(function(t){t.HTTP="http",t.HTTPS="https"})(F||(F={}));var Z;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Z||(Z={}));const ge="__smithy_context",j=t=>typeof t=="string"?J(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),O=(t,e)=>{const r=[];if(t&&r.push(t),e)for(const s of e)r.push(s);return r},I=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,ee=()=>{let t=[],e=[],r=!1;const s=new Set,n=u=>u.sort((l,f)=>Ie[f.step]-Ie[l.step]||_e[f.priority||"normal"]-_e[l.priority||"normal"]),i=u=>{let l=!1;const f=m=>{const g=O(m.name,m.aliases);if(g.includes(u)){l=!0;for(const p of g)s.delete(p);return!1}return!0};return t=t.filter(f),e=e.filter(f),l},a=u=>{let l=!1;const f=m=>{if(m.middleware===u){l=!0;for(const g of O(m.name,m.aliases))s.delete(g);return!1}return!0};return t=t.filter(f),e=e.filter(f),l},c=u=>(t.forEach(l=>{u.add(l.middleware,{...l})}),e.forEach(l=>{u.addRelativeTo(l.middleware,{...l})}),u.identifyOnResolve?.(h.identifyOnResolve()),u),o=u=>{const l=[];return u.before.forEach(f=>{f.before.length===0&&f.after.length===0?l.push(f):l.push(...o(f))}),l.push(u),u.after.reverse().forEach(f=>{f.before.length===0&&f.after.length===0?l.push(f):l.push(...o(f))}),l},d=(u=!1)=>{const l=[],f=[],m={};return t.forEach(p=>{const y={...p,before:[],after:[]};for(const w of O(y.name,y.aliases))m[w]=y;l.push(y)}),e.forEach(p=>{const y={...p,before:[],after:[]};for(const w of O(y.name,y.aliases))m[w]=y;f.push(y)}),f.forEach(p=>{if(p.toMiddleware){const y=m[p.toMiddleware];if(y===void 0){if(u)return;throw new Error(`${p.toMiddleware} is not found when adding ${I(p.name,p.aliases)} middleware ${p.relation} ${p.toMiddleware}`)}p.relation==="after"&&y.after.push(p),p.relation==="before"&&y.before.push(p)}}),n(l).map(o).reduce((p,y)=>(p.push(...y),p),[])},h={add:(u,l={})=>{const{name:f,override:m,aliases:g}=l,p={step:"initialize",priority:"normal",middleware:u,...l},y=O(f,g);if(y.length>0){if(y.some(w=>s.has(w))){if(!m)throw new Error(`Duplicate middleware name '${I(f,g)}'`);for(const w of y){const T=t.findIndex(D=>D.name===w||D.aliases?.some(ne=>ne===w));if(T===-1)continue;const E=t[T];if(E.step!==p.step||p.priority!==E.priority)throw new Error(`"${I(E.name,E.aliases)}" middleware with ${E.priority} priority in ${E.step} step cannot be overridden by "${I(f,g)}" middleware with ${p.priority} priority in ${p.step} step.`);t.splice(T,1)}}for(const w of y)s.add(w)}t.push(p)},addRelativeTo:(u,l)=>{const{name:f,override:m,aliases:g}=l,p={middleware:u,...l},y=O(f,g);if(y.length>0){if(y.some(w=>s.has(w))){if(!m)throw new Error(`Duplicate middleware name '${I(f,g)}'`);for(const w of y){const T=e.findIndex(D=>D.name===w||D.aliases?.some(ne=>ne===w));if(T===-1)continue;const E=e[T];if(E.toMiddleware!==p.toMiddleware||E.relation!==p.relation)throw new Error(`"${I(E.name,E.aliases)}" middleware ${E.relation} "${E.toMiddleware}" middleware cannot be overridden by "${I(f,g)}" middleware ${p.relation} "${p.toMiddleware}" middleware.`);e.splice(T,1)}}for(const w of y)s.add(w)}e.push(p)},clone:()=>c(ee()),use:u=>{u.applyToStack(h)},remove:u=>typeof u=="string"?i(u):a(u),removeByTag:u=>{let l=!1;const f=m=>{const{tags:g,name:p,aliases:y}=m;if(g&&g.includes(u)){const w=O(p,y);for(const T of w)s.delete(T);return l=!0,!1}return!0};return t=t.filter(f),e=e.filter(f),l},concat:u=>{const l=c(ee());return l.use(u),l.identifyOnResolve(r||l.identifyOnResolve()||(u.identifyOnResolve?.()??!1)),l},applyToStack:c,identify:()=>d(!0).map(u=>{const l=u.step??u.relation+" "+u.toMiddleware;return I(u.name,u.aliases)+" - "+l}),identifyOnResolve(u){return typeof u=="boolean"&&(r=u),r},resolve:(u,l)=>{for(const f of d().map(m=>m.middleware).reverse())u=f(u,l);return r&&console.log(h.identify()),u}};return h},Ie={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},_e={high:3,normal:2,low:1};class Un{config;middlewareStack=ee();initConfig;handlers;constructor(e){this.config=e;const{protocol:r,protocolSettings:s}=e;s&&typeof r=="function"&&(e.protocol=new r(s))}send(e,r,s){const n=typeof r!="function"?r:void 0,i=typeof r=="function"?r:s,a=n===void 0&&this.config.cacheMiddleware===!0;let c;if(a){this.handlers||(this.handlers=new WeakMap);const o=this.handlers;o.has(e.constructor)?c=o.get(e.constructor):(c=e.resolveMiddleware(this.middlewareStack,this.config,n),o.set(e.constructor,c))}else delete this.handlers,c=e.resolveMiddleware(this.middlewareStack,this.config,n);if(i)c(e).then(o=>i(null,o.output),o=>i(o)).catch(()=>{});else return c(e).then(o=>o.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}class k extends Uint8Array{static fromString(e,r="utf-8"){if(typeof e=="string")return r==="base64"?k.mutate(xt(e)):k.mutate(J(e));throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,k.prototype),e}transformToString(e="utf-8"){return e==="base64"?It(this):_t(this)}}const Oe=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return k.mutate(t);if(!t)return k.mutate(new Uint8Array);const r=e.streamCollector(t);return k.mutate(await r)},ie=t=>typeof t=="function"?t():t,G=t=>t[ge]||(t[ge]={}),M=t=>{if(typeof t=="function")return t;const e=Promise.resolve(t);return()=>e},Ze=(t,e,r,s,n)=>({name:e,namespace:t,traits:r,input:s,output:n}),Nt=t=>(e,r)=>async s=>{const{response:n}=await e(s),{operationSchema:i}=G(r),[,a,c,o,d,h]=i??[];try{const u=await t.protocol.deserializeResponse(Ze(a,c,o,d,h),{...t,...r},n);return{response:n,output:u}}catch(u){if(Object.defineProperty(u,"$response",{value:n,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in u)){const l="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{u.message+=`
|
|
3
3
|
`+l}catch{!r.logger||r.logger?.constructor?.name==="NoOpLogger"?console.warn(l):r.logger?.warn?.(l)}typeof u.$responseBodyText<"u"&&u.$response&&(u.$response.body=u.$responseBodyText);try{if(te.isInstance(n)){const{headers:f={}}=n,m=Object.entries(f);u.$metadata={httpStatusCode:n.statusCode,requestId:ae(/^x-[\w-]+-request-?id$/,m),extendedRequestId:ae(/^x-[\w-]+-id-2$/,m),cfId:ae(/^x-[\w-]+-cf-id$/,m)}}}catch{}}throw u}},ae=(t,e)=>(e.find(([r])=>r.match(t))||[void 0,void 0])[1],Dt=t=>(e,r)=>async s=>{const{operationSchema:n}=G(r),[,i,a,c,o,d]=n??[],h=r.endpointV2?.url&&t.urlParser?async()=>t.urlParser(r.endpointV2.url):t.endpoint,u=await t.protocol.serializeRequest(Ze(i,a,c,o,d),s.input,{...t,...r,endpoint:h});return e({...s,request:u})},Ut={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Lt={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function Ln(t){return{applyToStack:e=>{e.add(Dt(t),Lt),e.add(Nt(t),Ut),t.protocol.setSerdeContext(t)}}}function L(t){if(typeof t=="object")return t;t=t|0;const e={};let r=0;for(const s of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(t>>r++&1)===1&&(e[s]=1);return e}class b{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=b.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,r){this.ref=e,this.memberName=r;const s=[];let n=e,i=e;for(this._isMemberSchema=!1;oe(n);)s.push(n[1]),n=n[0],i=ie(n),this._isMemberSchema=!0;if(s.length>0){this.memberTraits={};for(let a=s.length-1;a>=0;--a){const c=s[a];Object.assign(this.memberTraits,L(c))}}else this.memberTraits=0;if(i instanceof b){const a=this.memberTraits;Object.assign(this,i),this.memberTraits=Object.assign({},a,i.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=r??i.memberName;return}if(this.schema=ie(i),Ht(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(i),this.traits=0),this._isMemberSchema&&!r)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const r=this.prototype.isPrototypeOf(e);return!r&&typeof e=="object"&&e!==null?e.symbol===this.symbol:r}static of(e){const r=ie(e);if(r instanceof b)return r;if(oe(r)){const[s,n]=r;if(s instanceof b)return Object.assign(s.getMergedTraits(),L(n)),s;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}return new b(r)}getSchema(){const e=this.schema;return e[0]===0?e[4]:e}getName(e=!1){const{name:r}=this;return!e&&r&&r.includes("#")?r.split("#")[1]:r||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){const e=this.getSchema();return typeof e=="number"?e>=64&&e<128:e[0]===1}isMapSchema(){const e=this.getSchema();return typeof e=="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){const r=this.getSchema()[0];return r===3||r===-3||r===4}isUnionSchema(){return this.getSchema()[0]===4}isBlobSchema(){const e=this.getSchema();return e===21||e===42}isTimestampSchema(){const e=this.getSchema();return typeof e=="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){const{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){const e=i=>(i&4)===4||!!i?.idempotencyToken,{normalizedTraits:r,traits:s,memberTraits:n}=this;return e(r)||e(s)||e(n)}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return L(this.memberTraits)}getOwnTraits(){return L(this.traits)}getKeySchema(){const[e,r]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!r)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const s=this.getSchema(),n=e?15:s[4]??0;return U([n,0],"key")}getValueSchema(){const e=this.getSchema(),[r,s,n]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],i=typeof e=="number"?63&e:e&&typeof e=="object"&&(s||n)?e[3+e[0]]:r?15:void 0;if(i!=null)return U([i,0],s?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const r=this.getSchema();if(this.isStructSchema()&&r[4].includes(e)){const s=r[4].indexOf(e),n=r[5][s];return U(oe(n)?n:[n,0],e)}if(this.isDocumentSchema())return U([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[r,s]of this.structIterator())e[r]=s}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(const[e,r]of this.structIterator())if(r.isStreaming()&&r.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");const e=this.getSchema();for(let r=0;r<e[4].length;++r)yield[e[4][r],U([e[5][r],0],e[4][r])]}}function U(t,e){if(t instanceof b)return Object.assign(t,{memberName:e,_isMemberSchema:!0});const r=b;return new r(t,e)}const oe=t=>Array.isArray(t)&&t.length===2,Ht=t=>Array.isArray(t)&&t.length>=5;class C{namespace;schemas;exceptions;static registries=new Map;constructor(e,r=new Map,s=new Map){this.namespace=e,this.schemas=r,this.exceptions=s}static for(e){return C.registries.has(e)||C.registries.set(e,new C(e)),C.registries.get(e)}register(e,r){const s=this.normalizeShapeId(e);C.for(s.split("#")[0]).schemas.set(s,r)}getSchema(e){const r=this.normalizeShapeId(e);if(!this.schemas.has(r))throw new Error(`@smithy/core/schema - schema not found for ${r}`);return this.schemas.get(r)}registerError(e,r){const s=e,n=C.for(s[1]);n.schemas.set(s[1]+"#"+s[2],s),n.exceptions.set(s,r)}getErrorCtor(e){const r=e;return C.for(r[1]).exceptions.get(r)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,r,s]=e,n=r+"#"+s;if(n.startsWith("smithy.ts.sdk.synthetic.")&&n.endsWith("ServiceException"))return e}}find(e){return[...this.schemas.values()].find(e)}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){return e.includes("#")?e:this.namespace+"#"+e}}const Pe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),S=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0")),zt=()=>{if(Pe)return Pe();const t=new Uint8Array(16);return crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128,S[t[0]]+S[t[1]]+S[t[2]]+S[t[3]]+"-"+S[t[4]]+S[t[5]]+"-"+S[t[6]]+S[t[7]]+"-"+S[t[8]]+S[t[9]]+"-"+S[t[10]]+S[t[11]]+S[t[12]]+S[t[13]]+S[t[14]]+S[t[15]]},$=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};$.from=t=>t&&typeof t=="object"&&(t instanceof $||"deserializeJSON"in t)?t:typeof t=="string"||Object.getPrototypeOf(t)===String.prototype?$(String(t)):$(JSON.stringify(t));$.fromObject=$.from;const ke=/^-?\d*(\.\d+)?$/;class et{string;type;constructor(e,r){if(this.string=e,this.type=r,!ke.test(e))throw new Error('@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".')}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!="object")return!1;const r=e;return et.prototype.isPrototypeOf(e)||r.type==="bigDecimal"&&ke.test(r.string)}}class Bt{serdeContext;setSerdeContext(e){this.serdeContext=e}}class Ft extends Bt{options;constructor(e){super(),this.options=e}getRequestType(){return x}getResponseType(){return te}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,r){if("url"in r){e.protocol=r.url.protocol,e.hostname=r.url.hostname,e.port=r.url.port?Number(r.url.port):void 0,e.path=r.url.pathname,e.fragment=r.url.hash||void 0,e.username=r.url.username||void 0,e.password=r.url.password||void 0,e.query||(e.query={});for(const[s,n]of r.url.searchParams.entries())e.query[s]=n;return e}else return e.protocol=r.protocol,e.hostname=r.hostname,e.port=r.port?Number(r.port):void 0,e.path=r.path,e.query={...r.query},e}setHostPrefix(e,r,s){if(this.serdeContext?.disableHostPrefix)return;const n=b.of(r.input),i=L(r.traits??{});if(i.endpoint){let a=i.endpoint?.[0];if(typeof a=="string"){const c=[...n.structIterator()].filter(([,o])=>o.getMergedTraits().hostLabel);for(const[o]of c){const d=s[o];if(typeof d!="string")throw new Error(`@smithy/core/schema - ${o} in input must be a string as hostLabel.`);a=a.replace(`{${o}}`,d)}e.hostname=a+e.hostname}}}deserializeMetadata(e){return{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"]}}async serializeEventStream({eventStream:e,requestSchema:r,initialRequest:s}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:r,initialRequest:s})}async deserializeEventStream({response:e,responseSchema:r,initialResponseContainer:s}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:r,initialResponseContainer:s})}async loadEventStreamCapability(){const{EventStreamSerde:e}=await Pt(async()=>{const{EventStreamSerde:r}=await import("./index-DjgOAzh3.js");return{EventStreamSerde:r}},__vite__mapDeps([0,1]));return new e({marshaller:this.getEventStreamMarshaller(),serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType()})}getDefaultContentType(){throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,r,s,n,i){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Hn extends Ft{async serializeRequest(e,r,s){const n=this.serializer,i={},a={},c=await s.endpoint(),o=b.of(e?.input),d=o.getSchema();let h;const u=new x({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:i,headers:a,body:void 0});c&&(this.updateServiceEndpoint(u,c),this.setHostPrefix(u,e,r));const l={...r};if(r){const f=o.getEventStreamMember();if(f){if(l[f]){const m={};for(const[g,p]of o.structIterator())g!==f&&l[g]&&(n.write(p,l[g]),m[g]=n.flush());h=await this.serializeEventStream({eventStream:l[f],requestSchema:o,initialRequest:m})}}else n.write(d,l),h=n.flush()}return u.headers=a,u.query=i,u.body=h,u.method="POST",u}async deserializeResponse(e,r,s){const n=this.deserializer,i=b.of(e.output),a={};if(s.statusCode>=300){const o=await Oe(s.body,r);throw o.byteLength>0&&Object.assign(a,await n.read(15,o)),await this.handleError(e,r,s,a,this.deserializeMetadata(s)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const o in s.headers){const d=s.headers[o];delete s.headers[o],s.headers[o.toLowerCase()]=d}const c=i.getEventStreamMember();if(c)a[c]=await this.deserializeEventStream({response:s,responseSchema:i,initialResponseContainer:a});else{const o=await Oe(s.body,r);o.byteLength>0&&Object.assign(a,await n.read(i,o))}return a.$metadata=this.deserializeMetadata(s),a}}function zn(t,e){if(e.timestampFormat.useTrait&&t.isTimestampSchema()&&(t.getSchema()===5||t.getSchema()===6||t.getSchema()===7))return t.getSchema();const{httpLabel:r,httpPrefixHeaders:s,httpHeader:n,httpQuery:i}=t.getMergedTraits();return(e.httpBindings?typeof s=="string"||n?6:i||r?5:void 0:void 0)??e.timestampFormat.default}const ce="***SensitiveInformation***";function ye(t,e){if(e==null)return e;const r=b.of(t);if(r.getMergedTraits().sensitive)return ce;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return ce}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return ce}else if(r.isStructSchema()&&typeof e=="object"){const s=e,n={};for(const[i,a]of r.structIterator())s[i]!=null&&(n[i]=ye(a,s[i]));return n}return e}class jt{middlewareStack=ee();schema;static classBuilder(){return new qt}resolveMiddlewareWithContext(e,r,s,{middlewareFn:n,clientName:i,commandName:a,inputFilterSensitiveLog:c,outputFilterSensitiveLog:o,smithyContext:d,additionalContext:h,CommandCtor:u}){for(const p of n.bind(this)(u,e,r,s))this.middlewareStack.use(p);const l=e.concat(this.middlewareStack),{logger:f}=r,m={logger:f,clientName:i,commandName:a,inputFilterSensitiveLog:c,outputFilterSensitiveLog:o,[ge]:{commandInstance:this,...d},...h},{requestHandler:g}=r;return l.resolve(p=>g.handle(p.request,s||{}),m)}}class qt{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;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}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){const e=this;let r;return r=class extends jt{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[s]){super(),this.input=s??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(s,n,i){const a=e._operationSchema,c=a?.[4]??a?.input,o=a?.[5]??a?.output;return this.resolveMiddlewareWithContext(s,n,i,{CommandCtor:r,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(a?ye.bind(null,c):d=>d),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(a?ye.bind(null,o):d=>d),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class H extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message),Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;const r=e;return H.prototype.isPrototypeOf(r)||!!r.$fault&&!!r.$metadata&&(r.$fault==="client"||r.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;const r=e;return this===H?H.isInstance(e):H.isInstance(e)?r.name&&this.name?this.prototype.isPrototypeOf(e)||r.name===this.name:this.prototype.isPrototypeOf(e):!1}}const Me=(t,e={})=>{Object.entries(e).filter(([,s])=>s!==void 0).forEach(([s,n])=>{(t[s]==null||t[s]==="")&&(t[s]=n)});const r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t},Bn=t=>{switch(t){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:3e4};default:return{}}},Vt=t=>{const e=[];for(const r in Z){const s=Z[r];t[s]!==void 0&&e.push({algorithmId:()=>s,checksumConstructor:()=>t[s]})}return{addChecksumAlgorithm(r){e.push(r)},checksumAlgorithms(){return e}}},Gt=t=>{const e={};return t.checksumAlgorithms().forEach(r=>{e[r.algorithmId()]=r.checksumConstructor()}),e},Wt=t=>({setRetryStrategy(e){t.retryStrategy=e},retryStrategy(){return t.retryStrategy}}),Kt=t=>{const e={};return e.retryStrategy=t.retryStrategy(),e},Fn=t=>Object.assign(Vt(t),Wt(t)),jn=t=>Object.assign(Gt(t),Kt(t));class Xt{trace(){}debug(){}info(){}warn(){}error(){}}const Qt=(t,e)=>{if(!e||e.length===0)return t;const r=[];for(const s of e)for(const n of t)n.schemeId.split("#")[1]===s&&r.push(n);for(const s of t)r.find(({schemeId:n})=>n===s.schemeId)||r.push(s);return r};function Yt(t){const e=new Map;for(const r of t)e.set(r.schemeId,r);return e}const Jt=(t,e)=>(r,s)=>async n=>{const i=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,s,n.input)),a=t.authSchemePreference?await t.authSchemePreference():[],c=Qt(i,a),o=Yt(t.httpAuthSchemes),d=G(s),h=[];for(const u of c){const l=o.get(u.schemeId);if(!l){h.push(`HttpAuthScheme \`${u.schemeId}\` was not enabled for this service.`);continue}const f=l.identityProvider(await e.identityProviderConfigProvider(t));if(!f){h.push(`HttpAuthScheme \`${u.schemeId}\` did not have an IdentityProvider configured.`);continue}const{identityProperties:m={},signingProperties:g={}}=u.propertiesExtractor?.(t,s)||{};u.identityProperties=Object.assign(u.identityProperties||{},m),u.signingProperties=Object.assign(u.signingProperties||{},g),d.selectedHttpAuthScheme={httpAuthOption:u,identity:await f(u.identityProperties),signer:l.signer};break}if(!d.selectedHttpAuthScheme)throw new Error(h.join(`
|
|
4
4
|
`));return r(n)},Zt={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},qn=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:s=>{s.addRelativeTo(Jt(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),Zt)}}),er={name:"serializerMiddleware"},tr=t=>e=>{throw e},rr=(t,e)=>{},sr=t=>(e,r)=>async s=>{if(!x.isInstance(s.request))return e(s);const i=G(r).selectedHttpAuthScheme;if(!i)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:a={}},identity:c,signer:o}=i,d=await e({...s,request:await o.sign(s.request,c,a)}).catch((o.errorHandler||tr)(a));return(o.successHandler||rr)(d.response,a),d},nr={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},Vn=t=>({applyToStack:e=>{e.addRelativeTo(sr(),nr)}});function ir(t,e,r){t.__smithy_context?t.__smithy_context.features||(t.__smithy_context.features={}):t.__smithy_context={features:{}},t.__smithy_context.features[e]=r}class Gn{authSchemes=new Map;constructor(e){for(const[r,s]of Object.entries(e))s!==void 0&&this.authSchemes.set(r,s)}getIdentityProvider(e){return this.authSchemes.get(e)}}class Wn{async sign(e,r,s){return e}}const ar=t=>function(r){return tt(r)&&r.expiration.getTime()-Date.now()<t},or=3e5,cr=ar(or),tt=t=>t.expiration!==void 0,ur=(t,e,r)=>{if(t===void 0)return;const s=typeof t!="function"?async()=>Promise.resolve(t):t;let n,i,a,c=!1;const o=async d=>{i||(i=s(d));try{n=await i,a=!0,c=!1}finally{i=void 0}return n};return e===void 0?async d=>((!a||d?.forceRefresh)&&(n=await o(d)),n):async d=>((!a||d?.forceRefresh)&&(n=await o(d)),c?n:r(n)?(e(n)&&await o(d),n):(c=!0,n))};function Kn(t){return t}const dr=t=>e=>async r=>{if(!x.isInstance(r.request))return e(r);const{request:s}=r,{handlerProtocol:n=""}=t.requestHandler.metadata||{};if(n.indexOf("h2")>=0&&!s.headers[":authority"])delete s.headers.host,s.headers[":authority"]=s.hostname+(s.port?":"+s.port:"");else if(!s.headers.host){let i=s.hostname;s.port!=null&&(i+=`:${s.port}`),s.headers.host=i}return e(r)},lr={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Xn=t=>({applyToStack:e=>{e.add(dr(t),lr)}}),fr=()=>(t,e)=>async r=>{try{const s=await t(r),{clientName:n,commandName:i,logger:a,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:o,overrideOutputFilterSensitiveLog:d}=c,h=o??e.inputFilterSensitiveLog,u=d??e.outputFilterSensitiveLog,{$metadata:l,...f}=s.output;return a?.info?.({clientName:n,commandName:i,input:h(r.input),output:u(f),metadata:l}),s}catch(s){const{clientName:n,commandName:i,logger:a,dynamoDbDocumentClientOptions:c={}}=e,{overrideInputFilterSensitiveLog:o}=c,d=o??e.inputFilterSensitiveLog;throw a?.error?.({clientName:n,commandName:i,input:d(r.input),error:s,metadata:s.$metadata}),s}},hr={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},Qn=t=>({applyToStack:e=>{e.add(fr(),hr)}}),pr={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},mr=()=>t=>async e=>t(e),Yn=t=>({applyToStack:e=>{e.add(mr(),pr)}}),gr=void 0;function yr(t){return t===void 0?!0:typeof t=="string"&&t.length<=50}function Jn(t){const e=z(t.userAgentAppId??gr),{customUserAgent:r}=t;return Object.assign(t,{customUserAgent:typeof r=="string"?[[r]]:r,userAgentAppId:async()=>{const s=await e();if(!yr(s)){const n=t.logger?.constructor?.name==="NoOpLogger"||!t.logger?console:t.logger;typeof s!="string"?n?.warn("userAgentAppId must be a string or undefined."):s.length>50&&n?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return s}})}class Zn{capacity;data=new Map;parameters=[];constructor({size:e,params:r}){this.capacity=e??50,r&&(this.parameters=r)}get(e,r){const s=this.hash(e);if(s===!1)return r();if(!this.data.has(s)){if(this.data.size>this.capacity+10){const n=this.data.keys();let i=0;for(;;){const{value:a,done:c}=n.next();if(this.data.delete(a),c||++i>10)break}}this.data.set(s,r())}return this.data.get(s)}size(){return this.data.size}hash(e){let r="";const{parameters:s}=this;if(s.length===0)return!1;for(const n of s){const i=String(e[n]??"");if(i.includes("|;"))return!1;r+=i+"|;"}return r}}const wr=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}$"),rt=t=>wr.test(t)||t.startsWith("[")&&t.endsWith("]"),Sr=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),re=(t,e=!1)=>{if(!e)return Sr.test(t);const r=t.split(".");for(const s of r)if(!re(s))return!1;return!0},we={},q="endpoints";function _(t){return typeof t!="object"||t==null?t:"ref"in t?`$${_(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(_).join(", ")})`:JSON.stringify(t,null,2)}class R extends Error{constructor(e){super(e),this.name="EndpointError"}}const br=(t,e)=>t===e,Er=t=>{const e=t.split("."),r=[];for(const s of e){const n=s.indexOf("[");if(n!==-1){if(s.indexOf("]")!==s.length-1)throw new R(`Path: '${t}' does not end with ']'`);const i=s.slice(n+1,-1);if(Number.isNaN(parseInt(i)))throw new R(`Invalid array index: '${i}' in path: '${t}'`);n!==0&&r.push(s.slice(0,n)),r.push(i)}else r.push(s)}return r},st=(t,e)=>Er(e).reduce((r,s)=>{if(typeof r!="object")throw new R(`Index '${s}' in '${e}' not found in '${JSON.stringify(t)}'`);return Array.isArray(r)?r[parseInt(s)]:r[s]},t),Rr=t=>t!=null,vr=t=>!t,ue={[F.HTTP]:80,[F.HTTPS]:443},Tr=t=>{const e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){const{hostname:l,port:f,protocol:m="",path:g="",query:p={}}=t,y=new URL(`${m}//${l}${f?`:${f}`:""}${g}`);return y.search=Object.entries(p).map(([w,T])=>`${w}=${T}`).join("&"),y}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;const r=e.href,{host:s,hostname:n,pathname:i,protocol:a,search:c}=e;if(c)return null;const o=a.slice(0,-1);if(!Object.values(F).includes(o))return null;const d=rt(n),h=r.includes(`${s}:${ue[o]}`)||typeof t=="string"&&t.includes(`${s}:${ue[o]}`),u=`${s}${h?`:${ue[o]}`:""}`;return{scheme:o,authority:u,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:d}},Ar=(t,e)=>t===e,Cr=(t,e,r,s)=>e>=r||t.length<r?null:s?t.substring(t.length-r,t.length-e):t.substring(e,r),xr=t=>encodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Ir={booleanEquals:br,getAttr:st,isSet:Rr,isValidHostLabel:re,not:vr,parseURL:Tr,stringEquals:Ar,substring:Cr,uriEncode:xr},nt=(t,e)=>{const r=[],s={...e.endpointParams,...e.referenceRecord};let n=0;for(;n<t.length;){const i=t.indexOf("{",n);if(i===-1){r.push(t.slice(n));break}r.push(t.slice(n,i));const a=t.indexOf("}",i);if(a===-1){r.push(t.slice(i));break}t[i+1]==="{"&&t[a+1]==="}"&&(r.push(t.slice(i+1,a)),n=a+2);const c=t.substring(i+1,a);if(c.includes("#")){const[o,d]=c.split("#");r.push(st(s[o],d))}else r.push(s[c]);n=a+1}return r.join("")},_r=({ref:t},e)=>({...e.endpointParams,...e.referenceRecord})[t],se=(t,e,r)=>{if(typeof t=="string")return nt(t,r);if(t.fn)return at.callFunction(t,r);if(t.ref)return _r(t,r);throw new R(`'${e}': ${String(t)} is not a string, function or reference.`)},it=({fn:t,argv:e},r)=>{const s=e.map(i=>["boolean","number"].includes(typeof i)?i:at.evaluateExpression(i,"arg",r)),n=t.split(".");return n[0]in we&&n[1]!=null?we[n[0]][n[1]](...s):Ir[t](...s)},at={evaluateExpression:se,callFunction:it},Or=({assign:t,...e},r)=>{if(t&&t in r.referenceRecord)throw new R(`'${t}' is already defined in Reference Record.`);const s=it(e,r);return r.logger?.debug?.(`${q} evaluateCondition: ${_(e)} = ${_(s)}`),{result:s===""?!0:!!s,...t!=null&&{toAssign:{name:t,value:s}}}},Te=(t=[],e)=>{const r={};for(const s of t){const{result:n,toAssign:i}=Or(s,{...e,referenceRecord:{...e.referenceRecord,...r}});if(!n)return{result:n};i&&(r[i.name]=i.value,e.logger?.debug?.(`${q} assign: ${i.name} := ${_(i.value)}`))}return{result:!0,referenceRecord:r}},Pr=(t,e)=>Object.entries(t).reduce((r,[s,n])=>({...r,[s]:n.map(i=>{const a=se(i,"Header value entry",e);if(typeof a!="string")throw new R(`Header '${s}' value '${a}' is not a string`);return a})}),{}),ot=(t,e)=>Object.entries(t).reduce((r,[s,n])=>({...r,[s]:ut.getEndpointProperty(n,e)}),{}),ct=(t,e)=>{if(Array.isArray(t))return t.map(r=>ct(r,e));switch(typeof t){case"string":return nt(t,e);case"object":if(t===null)throw new R(`Unexpected endpoint property: ${t}`);return ut.getEndpointProperties(t,e);case"boolean":return t;default:throw new R(`Unexpected endpoint property type: ${typeof t}`)}},ut={getEndpointProperty:ct,getEndpointProperties:ot},kr=(t,e)=>{const r=se(t,"Endpoint URL",e);if(typeof r=="string")try{return new URL(r)}catch(s){throw console.error(`Failed to construct URL with ${r}`,s),s}throw new R(`Endpoint URL must be a string, got ${typeof r}`)},Mr=(t,e)=>{const{conditions:r,endpoint:s}=t,{result:n,referenceRecord:i}=Te(r,e);if(!n)return;const a={...e,referenceRecord:{...e.referenceRecord,...i}},{url:c,properties:o,headers:d}=s;return e.logger?.debug?.(`${q} Resolving endpoint from template: ${_(s)}`),{...d!=null&&{headers:Pr(d,a)},...o!=null&&{properties:ot(o,a)},url:kr(c,a)}},$r=(t,e)=>{const{conditions:r,error:s}=t,{result:n,referenceRecord:i}=Te(r,e);if(n)throw new R(se(s,"Error",{...e,referenceRecord:{...e.referenceRecord,...i}}))},dt=(t,e)=>{for(const r of t)if(r.type==="endpoint"){const s=Mr(r,e);if(s)return s}else if(r.type==="error")$r(r,e);else if(r.type==="tree"){const s=lt.evaluateTreeRule(r,e);if(s)return s}else throw new R(`Unknown endpoint rule: ${r}`);throw new R("Rules evaluation failed")},Nr=(t,e)=>{const{conditions:r,rules:s}=t,{result:n,referenceRecord:i}=Te(r,e);if(n)return lt.evaluateRules(s,{...e,referenceRecord:{...e.referenceRecord,...i}})},lt={evaluateRules:dt,evaluateTreeRule:Nr},ei=(t,e)=>{const{endpointParams:r,logger:s}=e,{parameters:n,rules:i}=t;e.logger?.debug?.(`${q} Initial EndpointParams: ${_(r)}`);const a=Object.entries(n).filter(([,d])=>d.default!=null).map(([d,h])=>[d,h.default]);if(a.length>0)for(const[d,h]of a)r[d]=r[d]??h;const c=Object.entries(n).filter(([,d])=>d.required).map(([d])=>d);for(const d of c)if(r[d]==null)throw new R(`Missing required parameter: '${d}'`);const o=dt(i,{endpointParams:r,logger:s,referenceRecord:{}});return e.logger?.debug?.(`${q} Resolved endpoint: ${_(o)}`),o},ft=(t,e=!1)=>{if(e){for(const r of t.split("."))if(!ft(r))return!1;return!0}return!(!re(t)||t.length<3||t.length>63||t!==t.toLowerCase()||rt(t))},$e=":",Dr="/",Ur=t=>{const e=t.split($e);if(e.length<6)return null;const[r,s,n,i,a,...c]=e;if(r!=="arn"||s===""||n===""||c.join($e)==="")return null;const o=c.map(d=>d.split(Dr)).flat();return{partition:s,service:n,region:i,accountId:a,resourceId:o}},Lr=[{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-east-2":{description:"Asia Pacific (Taipei)"},"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)"},"ap-southeast-6":{description:"Asia Pacific (New Zealand)"},"ap-southeast-7":{description:"Asia Pacific (Thailand)"},"aws-global":{description:"aws 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)"},"mx-central-1":{description:"Mexico (Central)"},"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-cn global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-eusc",outputs:{dnsSuffix:"amazonaws.eu",dualStackDnsSuffix:"api.amazonwebservices.eu",implicitGlobalRegion:"eusc-de-east-1",name:"aws-eusc",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eusc\\-(de)\\-\\w+\\-\\d+$",regions:{"eusc-de-east-1":{description:"EU (Germany)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"api.aws.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"aws-iso 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:"api.aws.scloud",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"aws-iso-b global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"},"us-isob-west-1":{description:"US ISOB West"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"api.cloud-aws.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"aws-iso-e-global":{description:"aws-iso-e global region"},"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"api.aws.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{"aws-iso-f-global":{description:"aws-iso-f global region"},"us-isof-east-1":{description:"US ISOF EAST"},"us-isof-south-1":{description:"US ISOF SOUTH"}}},{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-us-gov global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}}],Hr={partitions:Lr};let zr=Hr;const Br=t=>{const{partitions:e}=zr;for(const s of e){const{regions:n,outputs:i}=s;for(const[a,c]of Object.entries(n))if(a===t)return{...i,...c}}for(const s of e){const{regionRegex:n,outputs:i}=s;if(new RegExp(n).test(t))return{...i}}const r=e.find(s=>s.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},Fr={isVirtualHostableS3Bucket:ft,parseArn:Ur,partition:Br};we.aws=Fr;function jr(t){const e={};if(t=t.replace(/^\?/,""),t)for(const r of t.split("&")){let[s,n=null]=r.split("=");s=decodeURIComponent(s),n&&(n=decodeURIComponent(n)),s in e?Array.isArray(e[s])?e[s].push(n):e[s]=[e[s],n]:e[s]=n}return e}const Se=t=>{if(typeof t=="string")return Se(new URL(t));const{hostname:e,pathname:r,port:s,protocol:n,search:i}=t;let a;return i&&(a=jr(i)),{hostname:e,port:s?parseInt(s):void 0,protocol:n,path:r,query:a}};function qr(t,e,r){return t.$source||(t.$source={}),t.$source[e]=r,t}function A(t,e,r){t.__aws_sdk_context?t.__aws_sdk_context.features||(t.__aws_sdk_context.features={}):t.__aws_sdk_context={features:{}},t.__aws_sdk_context.features[e]=r}const Ne=t=>te.isInstance(t)?t.headers?.date??t.headers?.Date:void 0,ht=t=>new Date(Date.now()+t),Vr=(t,e)=>Math.abs(ht(e).getTime()-t)>=3e5,De=(t,e)=>{const r=Date.parse(t);return Vr(r,e)?r-Date.now():e},B=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},Gr=async t=>{const e=B("context",t.context),r=B("config",t.config),s=e.endpointV2?.properties?.authSchemes?.[0],i=await B("signer",r.signer)(s),a=t?.signingRegion,c=t?.signingRegionSet,o=t?.signingName;return{config:r,signer:i,signingRegion:a,signingRegionSet:c,signingName:o}};class ti{async sign(e,r,s){if(!x.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const n=await Gr(s),{config:i,signer:a}=n;let{signingRegion:c,signingName:o}=n;const d=s.context;if(d?.authSchemes?.length??!1){const[u,l]=d.authSchemes;u?.name==="sigv4a"&&l?.name==="sigv4"&&(c=l?.signingRegion??c,o=l?.signingName??o)}return await a.sign(e,{signingDate:ht(i.systemClockOffset),signingRegion:c,signingService:o})}errorHandler(e){return r=>{const s=r.ServerTime??Ne(r.$response);if(s){const n=B("config",e.config),i=n.systemClockOffset;n.systemClockOffset=De(s,n.systemClockOffset),n.systemClockOffset!==i&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(e,r){const s=Ne(e);if(s){const n=B("config",r.config);n.systemClockOffset=De(s,n.systemClockOffset)}}}const Wr="X-Amz-Algorithm",Kr="X-Amz-Credential",pt="X-Amz-Date",Xr="X-Amz-SignedHeaders",Qr="X-Amz-Expires",mt="X-Amz-Signature",gt="X-Amz-Security-Token",yt="authorization",wt=pt.toLowerCase(),Yr="date",Jr=[yt,wt,Yr],Zr=mt.toLowerCase(),be="x-amz-content-sha256",es=gt.toLowerCase(),ts={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},rs=/^proxy-/,ss=/^sec-/,de="AWS4-HMAC-SHA256",ns="AWS4-HMAC-SHA256-PAYLOAD",is="UNSIGNED-PAYLOAD",as=50,St="aws4_request",os=3600*24*7,W={},le=[],fe=(t,e,r)=>`${t}/${e}/${r}/${St}`,cs=async(t,e,r,s,n)=>{const i=await Ue(t,e.secretAccessKey,e.accessKeyId),a=`${r}:${s}:${n}:${P(i)}:${e.sessionToken}`;if(a in W)return W[a];for(le.push(a);le.length>as;)delete W[le.shift()];let c=`AWS4${e.secretAccessKey}`;for(const o of[r,s,n,St])c=await Ue(t,c,o);return W[a]=c},Ue=(t,e,r)=>{const s=new t(e);return s.update(j(r)),s.digest()},Le=({headers:t},e,r)=>{const s={};for(const n of Object.keys(t).sort()){if(t[n]==null)continue;const i=n.toLowerCase();(i in ts||e?.has(i)||rs.test(i)||ss.test(i))&&(!r||r&&!r.has(i))||(s[i]=t[n].trim().replace(/\s+/g," "))}return s},us=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",he=async({headers:t,body:e},r)=>{for(const s of Object.keys(t))if(s.toLowerCase()===be)return t[s];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||us(e)){const s=new r;return s.update(j(e)),P(await s.digest())}return is};class ds{format(e){const r=[];for(const i of Object.keys(e)){const a=J(i);r.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(e[i]))}const s=new Uint8Array(r.reduce((i,a)=>i+a.byteLength,0));let n=0;for(const i of r)s.set(i,n),n+=i.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 i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);const a=new Uint8Array(i.buffer);return a.set(e.value,3),a;case"string":const c=J(e.value),o=new DataView(new ArrayBuffer(3+c.byteLength));o.setUint8(0,7),o.setUint16(1,c.byteLength,!1);const d=new Uint8Array(o.buffer);return d.set(c,3),d;case"timestamp":const h=new Uint8Array(9);return h[0]=8,h.set(Ae.fromNumber(e.value.valueOf()).bytes,1),h;case"uuid":if(!ls.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const u=new Uint8Array(17);return u[0]=9,u.set(Ot(e.value.replace(/\-/g,"")),1),u}}}var He;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(He||(He={}));const ls=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class Ae{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)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;return e<0&&ze(r),new Ae(r)}valueOf(){const e=this.bytes.slice(0),r=e[0]&128;return r&&ze(e),parseInt(P(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}function ze(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}const fs=(t,e)=>{t=t.toLowerCase();for(const r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1},hs=(t,e={})=>{const{headers:r,query:s={}}=x.clone(t);for(const n of Object.keys(r)){const i=n.toLowerCase();(i.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(i)||e.hoistableHeaders?.has(i))&&(s[n]=r[n],delete r[n])}return{...t,headers:r,query:s}},Be=t=>{t=x.clone(t);for(const e of Object.keys(t.headers))Jr.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t},ps=({query:t={}})=>{const e=[],r={};for(const s of Object.keys(t)){if(s.toLowerCase()===Zr)continue;const n=X(s);e.push(n);const i=t[s];typeof i=="string"?r[n]=`${n}=${X(i)}`:Array.isArray(i)&&(r[n]=i.slice(0).reduce((a,c)=>a.concat([`${n}=${X(c)}`]),[]).sort().join("&"))}return e.sort().map(s=>r[s]).filter(s=>s).join("&")},ms=t=>gs(t).toISOString().replace(/\.\d{3}Z$/,"Z"),gs=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t;class ys{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:r,region:s,service:n,sha256:i,uriEscapePath:a=!0}){this.service=n,this.sha256=i,this.uriEscapePath=a,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=M(s),this.credentialProvider=M(r)}createCanonicalRequest(e,r,s){const n=Object.keys(r).sort();return`${e.method}
|
|
5
5
|
${this.getCanonicalPath(e)}
|