PageSourceSearch

https://dappling.network/_next/static/chunks/7815-5aa0213ff3006932.js

js dappling.network collected 2026-10-03 22:45:02 UTC 51,745 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7815],{74345:function(e,t,i){"use strict";i.d(t,{J:function(){return n}});var r=i(76684);class n extends r.sI{constructor(e){super(e),Object.setPrototypeOf(this,n.prototype)}}},99191:function(e,t,i){"use strict";i.d(t,{Aw:function(){return a},Bu:function(){return d},C_:function(){return c},Hl:function(){return s},KC:function(){return p},P$:function(){return u},Pw:function(){return o},Q8:function(){return f},Qk:function(){return b},dG:function(){return m},gH:function(){return r},gh:function(){return l},yA:function(){return y}});var r,n=i(74345);class s extends n.J{constructor(e){super({name:"InternalServerError",$fault:"server",...e}),this.name="InternalServerError",this.$fault="server",Object.setPrototypeOf(this,s.prototype)}}class a extends n.J{constructor(e){super({name:"RequestLimitExceeded",$fault:"client",...e}),this.name="RequestLimitExceeded",this.$fault="client",Object.setPrototypeOf(this,a.prototype)}}class o extends n.J{constructor(e){super({name:"InvalidEndpointException",$fault:"client",...e}),this.name="InvalidEndpointException",this.$fault="client",Object.setPrototypeOf(this,o.prototype),this.Message=e.Message}}class l extends n.J{constructor(e){super({name:"ProvisionedThroughputExceededException",$fault:"client",...e}),this.name="ProvisionedThroughputExceededException",this.$fault="client",Object.setPrototypeOf(this,l.prototype)}}class u extends n.J{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,u.prototype)}}class c extends n.J{constructor(e){super({name:"ItemCollectionSizeLimitExceededException",$fault:"client",...e}),this.name="ItemCollectionSizeLimitExceededException",this.$fault="client",Object.setPrototypeOf(this,c.prototype)}}class d extends n.J{constructor(e){super({name:"TransactionConflictException",$fault:"client",...e}),this.name="TransactionConflictException",this.$fault="client",Object.setPrototypeOf(this,d.prototype)}}class p extends n.J{constructor(e){super({name:"DuplicateItemException",$fault:"client",...e}),this.name="DuplicateItemException",this.$fault="client",Object.setPrototypeOf(this,p.prototype)}}class m extends n.J{constructor(e){super({name:"IdempotentParameterMismatchException",$fault:"client",...e}),this.name="IdempotentParameterMismatchException",this.$fault="client",Object.setPrototypeOf(this,m.prototype),this.Message=e.Message}}class y extends n.J{constructor(e){super({name:"TransactionInProgressException",$fault:"client",...e}),this.name="TransactionInProgressException",this.$fault="client",Object.setPrototypeOf(this,y.prototype),this.Message=e.Message}}(r||(r={})).visit=(e,t)=>void 0!==e.S?t.S(e.S):void 0!==e.N?t.N(e.N):void 0!==e.B?t.B(e.B):void 0!==e.SS?t.SS(e.SS):void 0!==e.NS?t.NS(e.NS):void 0!==e.BS?t.BS(e.BS):void 0!==e.M?t.M(e.M):void 0!==e.L?t.L(e.L):void 0!==e.NULL?t.NULL(e.NULL):void 0!==e.BOOL?t.BOOL(e.BOOL):t._(e.$unknown[0],e.$unknown[1]);class f extends n.J{constructor(e){super({name:"ConditionalCheckFailedException",$fault:"client",...e}),this.name="ConditionalCheckFailedException",this.$fault="client",Object.setPrototypeOf(this,f.prototype),this.Item=e.Item}}class b extends n.J{constructor(e){super({name:"TransactionCanceledException",$fault:"client",...e}),this.name="TransactionCanceledException",this.$fault="client",Object.setPrototypeOf(this,b.prototype),this.Message=e.Message,this.CancellationReasons=e.CancellationReasons}}},18342:function(e,t,i){"use strict";i.d(t,{W:function(){return n}});var r=i(76684);let n=e=>{if(null!=e)return"object"==typeof e&&"__type"in e&&delete e.__type,(0,r.$I)(e)}},32565:function(e){var t;t=function(){return function(t){if(/number|string|boolean/.test(typeof t))return t;if(t instanceof Date)return new Date(t.getTime());var i=t instanceof Array?[]:{};return function t(i,r){for(var n in i){var s=i[n];if(s instanceof Date){var a=new Date(s.getTime());e(r,n,a)}else if(s instanceof Function){var a=s;e(r,n,a)}else if(s instanceof Array){var a=[],o=e(r,n,a);t(s,o)}else if(s instanceof Object){var a={},o=e(r,n,a);t(s,o)}else{var a=s;
1e(r,n,a)}}}(t,i),i};function e(e,t,i){return e instanceof Array?(e.push(i),e[e.length-1]):e instanceof Object?(e[t]=i,e[t]):void 0}},e.exports=t()},20335:function(e,t,i){"use strict";i.d(t,{Z:function(){return u}});for(var r,n=new Uint8Array(16),s=/^(?:[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,a=[],o=0;o<256;++o)a.push((o+256).toString(16).substr(1));var l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]).toLowerCase();if(!("string"==typeof i&&s.test(i)))throw TypeError("Stringified UUID is invalid");return i},u=function(e,t,i){var s=(e=e||{}).random||(e.rng||function(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(n)})();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){i=i||0;for(var a=0;a<16;++a)t[i+a]=s[a];return t}return l(s)}},42465:function(e,t,i){"use strict";i.d(t,{J:function(){return eF}});var r=i(45050);let n=e=>e[r.zK]||(e[r.zK]={}),s=async e=>{let t=e?.Bucket||"";if("string"==typeof e.Bucket&&(e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),c(t)){if(!0===e.ForcePathStyle)throw Error("Path-style addressing cannot be used with ARN buckets")}else u(t)&&(-1===t.indexOf(".")||String(e.Endpoint).startsWith("http:"))&&t.toLowerCase()===t&&!(t.length<3)||(e.ForcePathStyle=!0);return e.DisableMultiRegionAccessPoints&&(e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0),e},a=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,o=/(\d+\.){3}\d+/,l=/\.\./,u=e=>a.test(e)&&!o.test(e)&&!l.test(e),c=e=>{let[t,i,r,,,n]=e.split(":"),s="arn"===t&&e.split(":").length>=6,a=!!(s&&i&&r&&n);if(s&&!a)throw Error(`Invalid ARN: ${e} was an invalid ARN.`);return a},d=(e,t,i)=>{let r=async()=>{let r=i[e]??i[t];return"function"==typeof r?r():r};return"credentialScope"===e||"CredentialScope"===t?async()=>{let e="function"==typeof i.credentials?await i.credentials():i.credentials;return e?.credentialScope??e?.CredentialScope}:"endpoint"===e||"endpoint"===t?async()=>{let e=await r();if(e&&"object"==typeof e){if("url"in e)return e.url.href;if("hostname"in e){let{protocol:t,hostname:i,port:r,path:n}=e;return`${t}//${i}${r?":"+r:""}${n}`}}return e}:r},p=async e=>void 0,m=e=>{let t;if("string"==typeof e)return m(new URL(e));let{hostname:i,pathname:r,port:n,protocol:s,search:a}=e;return a&&(t=function(e){let t={};if(e=e.replace(/^\?/,""))for(let i of e.split("&")){let[e,r=null]=i.split("=");e=decodeURIComponent(e),r&&(r=decodeURIComponent(r)),e in t?Array.isArray(t[e])?t[e].push(r):t[e]=[t[e],r]:t[e]=r}return t}(a)),{hostname:i,port:n?parseInt(n):void 0,protocol:s,path:r,query:t}},y=e=>"object"==typeof e?"url"in e?m(e.url):e:m(e),f=async(e,t,i,r)=>{if(!i.endpoint){let e=await p(i.serviceId||"");e&&(i.endpoint=()=>Promise.resolve(y(e)))}let n=await b(e,t,i);if("function"!=typeof i.endpointProvider)throw Error("config.endpointProvider is not set.");return i.endpointProvider(n,r)},b=async(e,t,i)=>{let r={},n=t?.getEndpointParameterInstructions?.()||{};for(let[t,s]of Object.entries(n))switch(s.type){case"staticContextParams":r[t]=s.value;break;case"contextParams":r[t]=e[s.name];break;case"clientContextParams":case"builtInParams":r[t]=await d(s.name,t,i)();break;default:throw Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return 0===Object.keys(n).length&&Object.assign(r,i),"s3"===String(i.serviceId).toLowerCase()&&await s(r),r},h=({config:e,instructions:t})=>(i,r)=>async s=>{let a=await f(s.input,{getEndpointParameterInstructions:()=>t},{...e},r);r.endpointV2=a,r.authSchemes=a.properties?.authSchemes;let o=r.authSchemes?.[0];if(o){r.signing_region=o.signingRegion,r.signing_service=o.signingName;let e=n(r),t=e?.selectedHttpAuthScheme?.httpAuthOption;t&&(t.signingProperties=Object.assign(t.signingProperties||{},{signing_region:o.signingRegion,signingRegion:o.signingRegion,signing_service:o.signingName,signingName:o.signingName,signingRegionSet:o.signingRegionSet},o.properties))}return i({...s})},g=(e,t)=>(i,r)=>async r=>{let{response:n}=await i(r);try{let i=await t(n,e);return{response:n,output:i}}catch(e){throw Object.defineProperty(e,"$response",{value:n}),"$metadata"in e||(e.message+="\n  Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.",void 0!==e.$responseBodyText&&e.$response&&(e.$response.body=e.$responseBodyText)),e}},v=(e,t)=>
1(i,r)=>async n=>{let s=r.endpointV2?.url&&e.urlParser?async()=>e.urlParser(r.endpointV2.url):e.endpoint;if(!s)throw Error("No valid endpoint provider available.");let a=await t(n.input,{...e,endpoint:s});return i({...n,request:a})},$={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},E={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function O(e,t,i){return{applyToStack:r=>{r.add(g(e,i),$),r.add(v(e,t),E)}}}let N={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:E.name},A=(e,t)=>({applyToStack:i=>{i.addRelativeTo(h({config:e,instructions:t}),N)}});var j=i(76684);let I={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var S=i(68983);class w{constructor(e){"object"==typeof e&&"N"in e?this.value=String(e.N):this.value=String(e);let t="number"==typeof e.valueOf()?e.valueOf():0;if(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||Math.abs(t)===1/0||Number.isNaN(t))throw Error(`NumberValue should not be initialized with an imprecise number=${t}. Use a string instead.`)}static from(e){return new w(e)}toAttributeValue(){return{N:this.toString()}}toBigInt(){return BigInt(this.toString())}toString(){return String(this.value)}valueOf(){return this.toString()}}let C=(e,t)=>{if(void 0===e)throw Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(null===e&&"object"==typeof e)return P();if(Array.isArray(e))return k(e,t);if(e?.constructor?.name==="Set")return T(e,t);if(e?.constructor?.name==="Map")return _(e,t);if(e?.constructor?.name==="Object"||!e.constructor&&"object"==typeof e)return x(e,t);if(B(e))return 0===e.length&&t?.convertEmptyValues?P():D(e);else if("boolean"==typeof e||e?.constructor?.name==="Boolean")return{BOOL:e.valueOf()};else if("number"==typeof e||e?.constructor?.name==="Number")return M(e);else if(e instanceof w)return e.toAttributeValue();else if("bigint"==typeof e)return L(e);else if("string"==typeof e||e?.constructor?.name==="String")return 0===e.length&&t?.convertEmptyValues?P():R(e);else if(t?.convertClassInstanceToMap&&"object"==typeof e)return x(e,t);throw Error(`Unsupported type passed: ${e}. Pass options.convertClassInstanceToMap=true to marshall typeof object as map attribute.`)},k=(e,t)=>({L:e.filter(e=>!t?.removeUndefinedValues||t?.removeUndefinedValues&&void 0!==e).map(e=>C(e,t))}),T=(e,t)=>{let i=t?.removeUndefinedValues?new Set([...e].filter(e=>void 0!==e)):e;if(!t?.removeUndefinedValues&&i.has(void 0))throw Error("Pass options.removeUndefinedValues=true to remove undefined values from map/array/set.");if(0===i.size){if(t?.convertEmptyValues)return P();throw Error("Pass a non-empty set, or options.convertEmptyValues=true.")}let r=i.values().next().value;if(r instanceof w)return{NS:Array.from(i).map(e=>e.toString())};if("number"==typeof r)return{NS:Array.from(i).map(M).map(e=>e.N)};if("bigint"==typeof r)return{NS:Array.from(i).map(L).map(e=>e.N)};if("string"==typeof r)return{SS:Array.from(i).map(R).map(e=>e.S)};if(B(r))return{BS:Array.from(i).map(D).map(e=>e.B)};throw Error("Only Number Set (NS), Binary Set (BS) or String Set (SS) are allowed.")},_=(e,t)=>
1({M:(e=>{let i={};for(let[r,n]of e)"function"==typeof n||void 0===n&&t?.removeUndefinedValues||(i[r]=C(n,t));return i})(e)}),x=(e,t)=>({M:(e=>{let i={};for(let r in e){let n=e[r];"function"==typeof n||void 0===n&&t?.removeUndefinedValues||(i[r]=C(n,t))}return i})(e)}),P=()=>({NULL:!0}),D=e=>({B:e}),R=e=>({S:e.toString()}),L=e=>({N:e.toString()}),U=e=>{throw Error(`${e} ${"function"==typeof BigInt?"Use BigInt.":"Pass string value instead."} `)},M=e=>{if([Number.NaN,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY].map(e=>e.toString()).includes(e.toString()))throw Error(`Special numeric value ${e.toString()} is not allowed`);return e>Number.MAX_SAFE_INTEGER?U(`Number ${e.toString()} is greater than Number.MAX_SAFE_INTEGER.`):e<Number.MIN_SAFE_INTEGER&&U(`Number ${e.toString()} is lesser than Number.MIN_SAFE_INTEGER.`),{N:e.toString()}},B=e=>!!e?.constructor&&["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(e.constructor.name),K=(e,t)=>{for(let[i,r]of Object.entries(e))if(void 0!==r)switch(i){case"NULL":return null;case"BOOL":return!!r;case"N":return V(r,t);case"B":return q(r);case"S":return F(r);case"L":return z(r,t);case"M":return W(r,t);case"NS":return new Set(r.map(e=>V(e,t)));case"BS":return new Set(r.map(q));case"SS":return new Set(r.map(F));default:throw Error(`Unsupported type passed: ${i}`)}throw Error(`No value defined: ${JSON.stringify(e)}`)},V=(e,t)=>{if(t?.wrapNumbers)return w.from(e);let i=Number(e),r=[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY];if((i>Number.MAX_SAFE_INTEGER||i<Number.MIN_SAFE_INTEGER)&&!r.includes(i)){if("function"==typeof BigInt)try{return BigInt(e)}catch(t){throw Error(`${e} can't be converted to BigInt. Set options.wrapNumbers to get string value.`)}else throw Error(`${e} is outside SAFE_INTEGER bounds. Set options.wrapNumbers to get string value.`)}return i},F=e=>e,q=e=>e,z=(e,t)=>e.map(e=>K(e,t)),W=(e,t)=>Object.entries(e).reduce((e,[i,r])=>(e[i]=K(r,t),e),{}),G=(e,t)=>t?.convertWithoutMapWrapper?K(e,t):K({M:e},t),J={},X=[],Y=(e,t,i)=>{if(void 0!==e){if(null==i)return t(e);{let r=Object.keys(i),n=1===r.length&&"*"===r[0],s=r.length>=1&&!n,a=0===r.length;if(s)return Z(e,t,i);if(a)return H(e,t,null);if(n)return Object.entries(e??{}).reduce((e,[r,n])=>(e[r]=Y(n,t,i["*"]),e),Array.isArray(e)?[]:{})}}},Z=(e,t,i)=>{let r;for(let[n,s]of(r=Array.isArray(e)?[...e]:{...e},Object.entries(i))){let i=Y(e[n],t,s);void 0!==i&&(r[n]=i)}return r},H=(e,t,i)=>Array.isArray(e)?e.map(e=>Y(e,t,i)):Object.entries(e).reduce((e,[r,n])=>{let s=Y(n,t,i);return void 0!==s&&(e[r]=s),e},{}),Q=(e,t,i)=>{let r=e;return i?.convertClassInstanceToMap&&(r=function e(t,i=0){if(i>1e3)throw Error("Recursive copy depth exceeded 1000. Please set options.convertClassInstanceToMap to false and manually remove functions from your data object.");if("object"!=typeof t&&"function"!=typeof t)return t;{if(Array.isArray(t))return t.filter(e=>"function"!=typeof e).map(t=>e(t,i+1));if(null===t)return null;let r={};for(let[n,s]of Object.entries(t))"function"!=typeof s&&(r[n]=e(s,i+1));return r}}(e)),Z(r,e=>(function(e,t){let i=C(e,t),[r,n]=Object.entries(i)[0];switch(r){case"M":case"L":return t?.convertTopLevelContainer?i:n;default:return i}})(e,i),t)},ee=(e,t,i)=>Z(e,e=>G(e,i),t);class et extends j.mY{addMarshallingMiddleware(e){let{marshallOptions:t={},unmarshallOptions:i={}}=e.translateConfig||{};t.convertTopLevelContainer=t.convertTopLevelContainer??!0,i.convertWithoutMapWrapper=i.convertWithoutMapWrapper??!0,this.clientCommand.middlewareStack.addRelativeTo((e,i)=>async r=>{r.input=Q(this.input,this.inputKeyNodes,t),i.dynamoDbDocumentClientOptions=i.dynamoDbDocumentClientOptions||et.defaultLogFilterOverrides;let n=r.input;return i.dynamoDbDocumentClientOptions.overrideInputFilterSensitiveLog=()=>i.inputFilterSensitiveLog?.(n),e(r)},{name:"DocumentMarshall",relation:"before",toMiddleware:"serializerMiddleware",override:!0}),this.clientCommand.middlewareStack.addRelativeTo((e,t)=>async r=>{let n=await e(r),s=n.output;return t.dynamoDbDocumentClientOptions=t.dynamoDbDocumentClientOptions||et.defaultLogFilterOverrides,t.dynamoDbDocumentClientOptions.overrideOutputFilterSensitiveLog=()=>t.outputFilterSensitiveLog?.(s),n.output=ee(n.output,this.outputKeyNodes,i),n},{name:"DocumentUnmarshall",relation:"before",toMiddleware:"deserializerMiddleware",override:!0})}}et.defaultLogFilterOverrides={overrideInputFilterSensitiveLog(...e){},overrideOutputFilterSensitiveLog(...e){}};class ei extends j.mY.classBuilder().ep({...I}).m(function(e,t,i,r){return[O(i,this.serialize,this.deserialize),A(i,e.getEndpointParameterInstru
1ctions())]}).s("DynamoDB_20120810","DeleteItem",{}).n("DynamoDBClient","DeleteItemCommand").f(void 0,void 0).ser(S.Zm).de(S.QZ).build(){}class er extends et{constructor(e){super(),this.input=e,this.inputKeyNodes={Key:J,Expected:{"*":{Value:null,AttributeValueList:X}},ExpressionAttributeValues:J},this.outputKeyNodes={Attributes:J,ItemCollectionMetrics:{ItemCollectionKey:J}},this.clientCommand=new ei(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(e,t,i){this.addMarshallingMiddleware(t);let r=e.concat(this.middlewareStack),n=this.clientCommand.resolveMiddleware(r,t,i);return async()=>n(this.clientCommand)}}class en extends j.mY.classBuilder().ep({...I}).m(function(e,t,i,r){return[O(i,this.serialize,this.deserialize),A(i,e.getEndpointParameterInstructions())]}).s("DynamoDB_20120810","GetItem",{}).n("DynamoDBClient","GetItemCommand").f(void 0,void 0).ser(S.Nk).de(S.Qb).build(){}class es extends et{constructor(e){super(),this.input=e,this.inputKeyNodes={Key:J},this.outputKeyNodes={Item:J},this.clientCommand=new en(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(e,t,i){this.addMarshallingMiddleware(t);let r=e.concat(this.middlewareStack),n=this.clientCommand.resolveMiddleware(r,t,i);return async()=>n(this.clientCommand)}}class ea extends j.mY.classBuilder().ep({...I}).m(function(e,t,i,r){return[O(i,this.serialize,this.deserialize),A(i,e.getEndpointParameterInstructions())]}).s("DynamoDB_20120810","PutItem",{}).n("DynamoDBClient","PutItemCommand").f(void 0,void 0).ser(S.IQ).de(S.E6).build(){}class eo extends et{constructor(e){super(),this.input=e,this.inputKeyNodes={Item:J,Expected:{"*":{Value:null,AttributeValueList:X}},ExpressionAttributeValues:J},this.outputKeyNodes={Attributes:J,ItemCollectionMetrics:{ItemCollectionKey:J}},this.clientCommand=new ea(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(e,t,i){this.addMarshallingMiddleware(t);let r=e.concat(this.middlewareStack),n=this.clientCommand.resolveMiddleware(r,t,i);return async()=>n(this.clientCommand)}}class el extends j.mY.classBuilder().ep({...I}).m(function(e,t,i,r){return[O(i,this.serialize,this.deserialize),A(i,e.getEndpointParameterInstructions())]}).s("DynamoDB_20120810","UpdateItem",{}).n("DynamoDBClient","UpdateItemCommand").f(void 0,void 0).ser(S.h1).de(S.er).build(){}class eu extends et{constructor(e){super(),this.input=e,this.inputKeyNodes={Key:J,AttributeUpdates:{"*":{Value:null}},Expected:{"*":{Value:null,AttributeValueList:X}},ExpressionAttributeValues:J},this.outputKeyNodes={Attributes:J,ItemCollectionMetrics:{ItemCollectionKey:J}},this.clientCommand=new el(this.input),this.middlewareStack=this.clientCommand.middlewareStack}resolveMiddleware(e,t,i){this.addMarshallingMiddleware(t);let r=e.concat(this.middlewareStack),n=this.clientCommand.resolveMiddleware(r,t,i);return async()=>n(this.clientCommand)}}var ec=i(32565);let ed=["string","boolean","number","bigint","list","map","binary","set"],ep=e=>ed.includes(e),em=e=>"boolean"==typeof e?e:!["false","0","no"].includes(String(e).toLowerCase())&&!!e,ey=e=>G({valueToUnmarshall:{N:e.toString()}},{wrapNumbers:!0}).valueToUnmarshall.value,ef=e=>null!=e,eb=e=>void 0===e||"object"==typeof e&&0===Object.keys(e).length,eh=e=>{throw Error(e)},eg=e=>{eh(`Invalid or missing type for '${e}'. Valid types are '${ed.slice(0,-1).join("', '")}', and '${ed.slice(-1)}'.`)},ev=(e,t,i)=>(t=e.transform?e.transform(t,i):t,e.prefix||e.suffix?`${e.prefix||""}${t}${e.suffix||""}`:t);function e$(e){var t;return null===e&&"object"==typeof e?"null":void 0!==e&&null!=(t=e)&&t.constructor&&["ArrayBuffer","Blob","Buffer","DataView","File","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"].includes(t.constructor.name)?"Binary":void 0!==e&&e.constructor?e.constructor.name.toLowerCase():void 0!==e&&"object"==typeof e?"Object":"undefined"}function eE(e){if(e.length<=1)return!0;let t=e$(e[0]);return e.slice(1).every(e=>e$(e)===t)}var eO=(e,t,i)=>{Object.keys(t).forEach(r=>{switch(r){case"type":case"default":break;case"dependsOn":"string"==typeof t[r]||Array.isArray(t[r])||eh("'depen
1dsOn' must be the string name of an attribute or alias");break;case"transform":case"format":"function"!=typeof t[r]&&eh(`'${r}' must be a function`);break;case"coerce":case"onUpdate":case"hidden":case"save":"boolean"!=typeof t[r]&&eh(`'${r}' must be a boolean`);break;case"required":"boolean"!=typeof t[r]&&"always"!==t[r]&&eh("'required' must be a boolean or set to 'always'");break;case"alias":case"map":("string"!=typeof t[r]||e!==t[r]&&i.fields.includes((t[r]||"").trim())||0===(t[r]||"").trim().length)&&eh(`'${r}' must be a unique string`);break;case"setType":"set"!==t.type&&eh("'setType' is only valid for type 'set'"),["string","number","bigint","binary"].includes(t[r]||"")||eh("Invalid 'setType', must be 'string', 'number', 'bigint', or 'binary'");break;case"delimiter":("string"!=typeof t[r]||0===(t[r]||"").trim().length)&&eh("'delimiter' must be a 'string'"),t[r]=(t[r]||"").trim();break;case"prefix":case"suffix":t.type&&"string"!==t.type&&eh(`'${r}' can only be used on 'string' types`),("string"!=typeof t[r]||0===(t[r]||"").trim().length)&&eh(`'${r}' must be a 'string'`);break;case"partitionKey":case"sortKey":if((t.map||t.alias)&&eh(`Attributes with a ${r} cannot have a 'map' or 'alias' associated`),"boolean"==typeof t[r]||"string"==typeof t[r]||Array.isArray(t[r])){let n=Array.isArray(t[r])?t[r]:[t[r]];for(let t in n)if("boolean"==typeof n[t])i.keys[r]&&eh(`'${i.keys[r]}' has already been declared as the ${r}`),n[t]&&(i.keys[r]=e),i.keys.partitionKey&&i.keys.partitionKey===i.keys.sortKey&&eh(`'${e}' attribute cannot be both the partitionKey and sortKey`);else if("string"==typeof n[t]){let s=n[t];i.keys[s]||(i.keys[s]={}),i.keys[s][r]&&eh(`'${i.keys[s][r]}' has already been declared as the ${r} for the ${s} index`),i.keys[s][r]=e,i.keys[s].partitionKey===i.keys[s].sortKey&&eh(`'${e}' attribute cannot be both the partitionKey and sortKey for the ${s} index`)}else eh(`Index assignments for '${e}' must be string or boolean values`)}else eh(`'${r}' must be a boolean, string, or array`);break;default:eh(`'${r}' is not a valid property type`)}}),t.alias&&t.map&&eh(`'${e}' cannot contain both an alias and a map`),t.type||(t.type="string"),["string","boolean","number","bigint"].includes(t.type)&&void 0===t.coerce&&(t.coerce=!0),void 0!==t.default&&(i.defaults[e]=t.default),!0===t.required&&(i.required[t.map||e]=!1),"always"===t.required&&(i.required[t.map||e]=!0);let{map:r,alias:n,...s}=t;return Object.assign({[e]:t},n?{[n]:Object.assign({},s,{map:e})}:{},r?{[r]:Object.assign({},s,{alias:e})}:{})},eN=(e,t,i,r)=>{var n;if(t.length>=2&&t.length<=3){let s=r[t[0]]?t[0]:eh(`'${e}' must reference another field`),a=parseInt(t[1].toString())===t[1]?t[1]:eh(`'${e}' position value must be numeric`),o=t[2]?["string","number","boolean"].includes(t[2].toString())?{type:t[2]}:(null===(n=t[2])||void 0===n?void 0:n.constructor)===Object?t[2]:eh(`'${e}' type must be 'string', 'number', 'boolean' or a configuration object`):{type:"string"};return i.linked[s]||(i.linked[s]=[]),i.linked[s][a]=e,Object.assign({[e]:Object.assign({save:!0},eO(e,o,i)[e],{link:s,pos:a})},o.alias?{[o.alias]:Object.assign({},o,{map:e})}:{})}eh("Composite key configurations must have 2 or 3 items")},eA=(e,t)=>{let i=Object.keys(e).reduce((i,r)=>{let n=e[r];if("string"==typeof n){if(ep(n))return Object.assign(i,eO(r,{type:n},t));eg(r)}if(Array.isArray(n))return Object.assign(i,eN(r,e[r],t,e));let s=e[r];return s.type=s.type||"string",ed.includes(s.type)||eg(r),Object.assign(i,eO(r,s,t))},{});return t.keys.partitionKey||eh("Entity requires a partitionKey attribute"),{keys:t.keys,attributes:i}},ej=function(e){let{name:t,timestamps:i,created:r,createdAlias:n,modified:s,modifiedAlias:a,typeAlias:o,typeHidden:l,attributes:u,autoExecute:c,autoParse:d,table:p,...m}=e;Object.keys(m).length>0&&eh(`Invalid Entity configuration options: ${Object.keys(m).join(", ")}`),t="string"==typeof t&&t.trim().length>0?t.trim():eh("'name' must be defined"),i="boolean"!=typeof i||i,r="string"==typeof r&&r.trim().length>0?r.trim():"_ct",n="string"==typeof n&&n.trim().length>0?n.trim():"created",s="string"==typeof s&&s.trim().length>0?s.trim():"_md",a="string"==typeof a&&a.trim().length>0?a.trim():"modified",o="string"==typeof o&&o.trim().length>0?o.trim():"entity",l="boolean"==typeof l&&l,u=(null==u?void 0:u.constructor)===Object?u:eh("Please provide a valid 'attributes' object"),i&&(u[r]={type:"string",alias:n,default:()=>new Date().toISOString()},u[s]={type:"string",alias:a,default:()=>new Date().toISOString(),onUpdate:!0});let y={fields:Object.keys(u),defaults:{},required:{},linked:{},keys:{}},f=eA(u,y);
1return p&&p.DocumentClient&&Object.keys(f.attributes).forEach(e=>{var t,i,r,n;let s=f.attributes[e];(s.type&&"bigint"===s.type||s.setType&&"bigint"===s.setType)&&(null===(n=null===(r=null===(i=null===(t=null==p?void 0:p.DocumentClient)||void 0===t?void 0:t.config)||void 0===i?void 0:i.translateConfig)||void 0===r?void 0:r.unmarshallOptions)||void 0===n?void 0:n.wrapNumbers)!==!0&&eh("Please set `wrapNumbers: true` in your DocumentClient to avoid losing precision with bigint fields")}),{name:t,schema:f,defaults:y.defaults,required:y.required,linked:y.linked,autoExecute:c,autoParse:d,typeHidden:l,_etAlias:o,...p?{table:p}:{}}},eI=()=>(e,t,i)=>{var r,n,s,a;if(!ef(i))return i;switch(e.type){case"string":return"string"==typeof i||e.coerce?String(i):eh(`'${t}' must be of type string`);case"boolean":return"boolean"==typeof i||e.coerce?em(i):eh(`'${t}' must be of type boolean`);case"number":{if("number"==typeof i)return Number.isFinite(i)?i:eh(`'${t}' must be a finite number`);if(!e.coerce)return eh(`'${t}' must be of type number`);let r=Number(i);return"string"==typeof i&&Number.isFinite(r)&&i.length>0?r:eh(`Could not convert '${Array.isArray(i)?`[${i}]`:i}' to a number for '${t}'`)}case"bigint":return ey("bigint"==typeof i||e.coerce?BigInt(i):eh(`'${t}' must be of type bigint`));case"list":return Array.isArray(i)?i:e.coerce?String(i).split(",").map(e=>e.trim()):eh(`'${t}' must be a list (array)`);case"map":return(null==i?void 0:i.constructor)===Object?i:eh(`'${t}' must be a map (object)`);case"set":if(i instanceof Set)return"bigint"===e.setType&&(i=Array.from(i).map(e=>ey(e))),!e.setType||0===i.size||eE([...i])?i:eh(`'${t}' must be a valid set containing only ${e.setType} types`);if(Array.isArray(i)){let o=null===(n=null===(r=e.setType)||void 0===r?void 0:r.toLowerCase)||void 0===n?void 0:n.call(r),l=null===(a=null===(s=e$(i[0]))||void 0===s?void 0:s.toLowerCase)||void 0===a?void 0:a.call(s);return"bigint"===e.setType&&(i=i.map(e=>ey(e))),!e.setType||0===i.length||o===l&&eE(i)?new Set(i):eh(`'${t}' must be a valid set (array) containing only ${null!=o?o:l} types`)}{if(!e.coerce)return eh(`'${t}' must be a valid set (array)`);if(i instanceof Set)return i;let r=String(i).split(",").map(e=>e.trim()),n=e.setType,s=e$(r[0]);return!e.setType||0===r.length||n===s&&eE(r)?new Set(r):eh(`'${t}' must be a valid set (array) of type ${e.setType}`)}default:return i}},eS=()=>(e,t,i,r=!1,n=!0)=>{let s=eI(),a=(t,i)=>{if(e[i].dependsOn)return(Array.isArray(e[i].dependsOn)?e[i].dependsOn:[e[i].dependsOn]).forEach(i=>{if(e[i]){if("function"==typeof t[i]&&(t=a(t,i)),void 0===t[i])throw new ew(`'${i}' is undefined, bailing`)}else eh(`'${i}' is not a valid attribute or alias name`)}),t[i]=t[i](t),t;try{t[i]=t[i](t),e[i].alias&&(t[e[i].alias]=t[i]),e[i].map&&(t[e[i].map]=t[i])}catch(e){}return t},o=Object.keys(i).reduce((t,n)=>Object.assign(t,e[n]?{data:{...t.data,[e[n].map||n]:i[n]},aliases:{...t.aliases,[e[n].alias||n]:i[n]}}:r?{}:"$remove"===n?{data:{...t.data,$remove:i[n]}}:eh(`Field '${n}' does not have a mapping or alias`)),{data:{},aliases:{}}),l={...o.data,...o.aliases},u=Object.keys(l).reduce((t,i)=>{if("function"==typeof l[i])try{l=a(l,i)}catch(t){if(n&&t instanceof ew&&(!0===e[i].partitionKey||!0===e[i].sortKey||e[i].required))throw Error(`Required field '${i}' depends on attribute(s), one or more of which can't be resolved (${e[i].dependsOn})`);delete l[i]}return Object.assign(t,{[i]:l[i]})},{}),c=Object.keys(o.data).reduce((e,t)=>Object.assign(e,{[t]:u[t]}),{});return Object.assign(Object.keys(t).reduce((i,r)=>{let n=e[r]&&e[r].map||r;if(void 0!==c[n])return i;let a=t[r].map(t=>void 0===c[t]?null:ev(e[t],s(e[t],t,c[t]),c)).filter(e=>null!==e);return a.length===t[r].length?Object.assign(i,{[n]:a.join(e[r].delimiter||"#")}):i},{}),c)};class ew extends Error{constructor(e){super(e)}}let eC=(e,t)=>(null===e||(t&&"set"===t.type&&(e="bigint"===t.setType?Array.from(e).map(e=>BigInt(ek(e))):"number"===t.setType?Array.from(e).map(e=>Number(ek(e))):Array.from(e)),t&&"bigint"===t.type&&(e=BigInt(ek(e))),t&&"number"===t.type&&(e=Number(ek(e)))),e),ek=e=>(null==e?void 0:e.value)!==void 0?e.value:e;var eT=()=>(e,t,i,r=[])=>{let n=eI();return Object.keys(i).reduce((s,a)=>{let o=t[a]||e[a]&&e[a].alias&&t[e[a].alias];if(o&&Object.assign(s,o.reduce((t,s,o)=>e[s].save||e[s].hidden||r.length>0&&!r.includes(s)?t:Object.assign(t,{[e[s].alias||s]:n(e[s],s,i[a].replace(RegExp(`^${e_(e[a].prefix)}`),"").replace(RegExp(`${e_(e[a].suffix)}$`),"").split(e[a].delimiter||"#")[o])}),{})),e[a]&&e[a].hidden||r.length>0&&!r.includes(a))return s;i[a]=eC(i[a],e[a]);
1let l=e[a]&&(e[a].prefix||e[a].suffix)?i[a].replace(RegExp(`^${e_(e[a].prefix)}`),"").replace(RegExp(`${e_(e[a].suffix)}$`),""):i[a],u=e[a]&&e[a].format?e[a].format(l,i):l;return Object.assign(s,{[e[a]&&e[a].alias||a]:u})},{})};function e_(e){return e?e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"):""}var ex=()=>(e,t,i,r)=>{i=t[i].map||i,r=t[r]&&t[r].map||r||null;let n=eI(),s=e[i];(null==s||""===s)&&eh(`'${i}'${t[i].alias?` or '${t[i].alias}'`:""} is required`);let a=e[r];return r&&(null==a||""===a)&&eh(`'${r}'${t[r].alias?` or '${t[r].alias}'`:""} is required`),Object.assign({[i]:ev(t[i],n(t[i],i,s),e)},null!==r?{[r]:ev(t[r],n(t[r],r,a),e)}:{})},eP=(e,t)=>{let i=e.split("."),r=i[0].split("[");return r[0]in t?(i[0]=(t[r[0]].map?t[r[0]].map:r[0])+(r.length>1?`[${r.slice(1).join("[")}`:""),i.join(".")):eh(`'${e}' is not a valid attribute within the given entity/table.`)};let eD=["eq","ne","lt","lte","gt","gte"],eR=e=>"bigint"==typeof e?ey(e):e,eL=(e,t,i,r=0,n=0)=>{let s;let a=Array.isArray(e)?e:[e],o="",l={},u={};return a.forEach((e,c)=>{if(Array.isArray(a[c])){let e=eL(a[c],t,i,r,n);s=s||e.logic,o+=`${c>0?` ${e.logic} `:""}(${e.expression})`,l=Object.assign(l,e.names),u=Object.assign(u,e.values),r=e.group}else{let e={...a[c]};r++,i&&!e.entity&&(e.entity=i);let n=eM(e,r,t);o+=`${c>0?` ${n.logic} `:""}${n.clause}`,l=Object.assign(l,n.names),u=Object.assign(u,n.values),s=s||n.logic}}),{logic:s,expression:o,names:l,values:u,group:r}},eU=e=>eh(`You can only supply one filter condition per query. Already using '${e}'`),eM=(e,t,i)=>{let r,n,s;if(!i)throw Error("'table' should be defined");let a="",o={},l={},{attr:u,size:c,negate:d,or:p,eq:m,ne:y,in:f,lt:b,lte:h,gt:g,gte:v,between:$,exists:E,contains:O,beginsWith:N,type:A,entity:j,...I}=e;Object.keys(I).length>0&&eh(`Invalid expression options: ${Object.keys(I).join(", ")}`),void 0===j||"string"==typeof j&&i[j]&&i[j].schema&&i[j].schema.attributes||eh(`'entity' value of '${j}' must be a string and a valid table Entity name`);let S=("string"==typeof u?eP(u,j?i[j].schema.attributes:i.Table.attributes):"string"==typeof c?eP(c,j?i[j].schema.attributes:i.Table.attributes):eh("A string for 'attr' or 'size' is required for condition expressions")).split(".");1===S.length?o[`#attr${t}`]=S[0]:S.forEach((e,i)=>o[`#attr${t}_${i}`]=e);let w=Object.keys(o).join(".");if(void 0!==m&&(n=m,s="eq",r="="),void 0!==y&&(n=n?eU(s):y,s="ne",r="<>"),f&&(n=n?eU(s):f,s="in",r="IN"),void 0!==b&&(n=n?eU(s):b,s="lt",r="<"),void 0!==h&&(n=n?eU(s):h,s="lte",r="<="),void 0!==g&&(n=n?eU(s):g,s="gt",r=">"),void 0!==v&&(n=n?eU(s):v,s="gte",r=">="),$&&(n=n?eU(s):$,s="between",r="BETWEEN"),void 0!==E&&(n=n?eU(s):E,s="exists",r="EXISTS"),O&&(n=n?eU(s):O,s="contains",r="CONTAINS"),N&&(n=n?eU(s):N,s="beginsWith",r="BEGINS_WITH"),A&&(n=n?eU(s):A,s="type",r="ATTRIBUTE_TYPE"),r&&s){if("BETWEEN"===r)Array.isArray(n)&&2===n.length?(l[`:attr${t}_0`]=eR(n[0]),l[`:attr${t}_1`]=eR(n[1]),a=`${c?`size(${w})`:w} between :attr${t}_0 and :attr${t}_1`):eh("'between' conditions require an array with two values.");else if("IN"===r)u||eh("'in' conditions require an 'attr'."),Array.isArray(n)?a=`${w} IN (${n.map((e,i)=>(l[`:attr${t}_${i}`]=eR(e),`:attr${t}_${i}`)).join(",")})`:eh("'in' conditions require an array.");else if("EXISTS"===r)u||eh("'exists' conditions require an 'attr'."),a=n?`attribute_exists(${w})`:`attribute_not_exists(${w})`;else if(n&&"object"==typeof n){let e=n;eD.includes(s)||eh(`AttrRef is only supported for the following operators: ${eD.join(", ")}.`),"string"==typeof(null==e?void 0:e.attr)&&(null==e?void 0:e.attr)||eh("AttrRef must have an attr field which references another attribute in the same entity."),o[`#attr${t}_ref`]=eP(e.attr,j?i[j].schema.attributes:i.Table.attributes),a=`${w} ${r} #attr${t}_ref`}else l[`:attr${t}`]=eR(n),"BEGINS_WITH"===r?(u||eh("'beginsWith' conditions require an 'attr'."),a=`begins_with(${w},:attr${t})`):"CONTAINS"===r?(u||eh("'contains' conditions require an 'attr'."),a=`contains(${w},:attr${t})`):"ATTRIBUTE_TYPE"===r?(u||eh("'type' conditions require an 'attr'."),a=`attribute_type(${w},:attr${t})`):a=`${c?`size(${w})`:w} ${r} :attr${t}`;d&&(a=`(NOT ${a})`)}else eh("A condition is required");return{logic:p?"OR":"AND",clause:a,names:o,values:l}};var eB=(e,t,i,r=!1)=>{let n=0,s=Array.isArray(e)?e:"string"==typeof e?e.split(",").map(e=>e.trim()):[e];if(!t||!t.Table||0==Object.keys(t.Table.attributes).length)throw Error("Tables must be valid and contain attributes");r&&t.Table.entityField&&s.push(t.Table.entityField);let a={},o=[],l={};for(let e of s)if("string"==typeof e){let r=eP(e,i?t[i].schema.attributes:t.Table.attributes);Object.values(a).includes(r)||(a[`#proj${++n}`]=r,o.push(e))}else if("object"==typeof e)for(let i in e)if(t[i])for(let r of(l[i]||(l[i]=[]),Array.isArray(e[i])?e[i]:"string"==typeof e[i]?String(e[i]).split(",").map(e=>e.trim()):eh("Only arrays or strings are supported"))){"string"!=typeof r&&eh("Entity projections must be string values");let e=eP(r,t[i].schema.attributes);Object.values(a).includes(e)||(a[`#proj${++n}`]=e),l[i].push(e)}else eh(`'${i}' is not a valid entity on this table`);else eh(`'${typeof e}
1' is an invalid type. Projections require strings or arrays`);return{names:a,projections:Object.keys(a).join(","),entities:Object.keys(l).reduce((e,t)=>Object.assign(e,{[t]:[...new Set([...l[t],...o])]}),{}),tableAttrs:o}};let eK=[];class eV{constructor(e){(null==e?void 0:e.constructor)!==Object&&eh("Please provide a valid entity definition");let{table:t,...i}=e,{attributes:r,timestamps:n=!0,createdAlias:s="created",modifiedAlias:a="modified",typeAlias:o="entity",typeHidden:l=!1}=e={...ec(i),...t?{table:t}:{}};this.attributes=r,this.timestamps=n,this.createdAlias=s,this.modifiedAlias=a,this.typeAlias=o,this.typeHidden=l,Object.assign(this,ej(e))}get table(){return this._table}set table(e){this.setTable(e)}get DocumentClient(){var e;return(null===(e=this.table)||void 0===e?void 0:e.DocumentClient)?this.table.DocumentClient:eh("DocumentClient required for this operation")}set autoExecute(e){this._execute="boolean"==typeof e?e:void 0}get autoExecute(){var e;return"boolean"==typeof this._execute?this._execute:"boolean"!=typeof(null===(e=this.table)||void 0===e?void 0:e.autoExecute)||this.table.autoExecute}set autoParse(e){this._parse="boolean"==typeof e?e:void 0}get autoParse(){var e;return"boolean"==typeof this._parse?this._parse:"boolean"!=typeof(null===(e=this.table)||void 0===e?void 0:e.autoParse)||this.table.autoParse}get partitionKey(){return this.schema.keys.partitionKey?this.attribute(this.schema.keys.partitionKey):eh("No partitionKey defined")}get sortKey(){return this.schema.keys.sortKey?this.attribute(this.schema.keys.sortKey):null}attribute(e){return this.schema.attributes[e]&&this.schema.attributes[e].map?this.schema.attributes[e].map:this.schema.attributes[e]?e:eh(`'${e}' does not exist or is an invalid alias`)}parse(e,t=[]){t=t.map(e=>{let t=e.split(".")[0].split("[")[0];return this.schema.attributes[t]&&this.schema.attributes[t].map||t});let{schema:i,linked:r}=this,n=e.Item||e.Items||e;return Array.isArray(n)?n.map(e=>eT()(i.attributes,r,e,t)):eT()(i.attributes,r,n,t)}async get(e,t={},i={}){let r=this.getParams(e,t,i);if(!eq(t.execute,this.autoExecute))return r;let n=await this.DocumentClient.send(new es(r));if(!ez(t.parse,this.autoParse))return n;let{Item:s,...a}=n;return s?{Item:this.parse(s,t.include),...a}:a}getBatch(e){return{Table:this.table,Key:this.getParams(e).Key}}getTransaction(e,t={}){let{attributes:i,...r}=t;return Object.keys(r).length>0&&eh(`Invalid get transaction options: ${Object.keys(r).join(", ")}`),{Entity:this,Get:this.getParams(e,t)}}getParams(e,t={},i={}){let r,n;let{schema:s,defaults:a,linked:o,_table:l}=this,u=eS()(s.attributes,o,Object.assign({},a,e),!0,!1),{consistent:c,capacity:d,attributes:p,...m}=t,y=Object.keys(m).filter(e=>!["execute","parse"].includes(e));if(y.length>0&&eh(`Invalid get options: ${y.join(", ")}`),void 0!==c&&"boolean"!=typeof c&&eh("'consistent' requires a boolean"),void 0===d||"string"==typeof d&&["NONE","TOTAL","INDEXES"].includes(d.toUpperCase())||eh("'capacity' must be one of 'NONE','TOTAL', OR 'INDEXES'"),p){let{names:e,projections:t}=eB(p,this.table,this.name);Object.keys(e).length>0&&(r=e,n=t)}return Object.assign({TableName:l.name,Key:ex()(u,s.attributes,s.keys.partitionKey,s.keys.sortKey)},r?{ExpressionAttributeNames:r}:null,n?{ProjectionExpression:n}:null,c?{ConsistentRead:c}:null,d?{ReturnConsumedCapacity:d.toUpperCase()}:null,"object"==typeof i?i:{})}async delete(e,t={},i={}){let r=this.deleteParams(e,t,i);if(!eq(t.execute,this.autoExecute))return r;let n=await this.DocumentClient.send(new er(r));if(!ez(t.parse,this.autoParse))return n;let{Attributes:s,...a}=n;return s?{Attributes:this.parse(s,t.include),...a}:a}deleteBatch(e){let t=this.deleteParams(e);return{[t.TableName]:{DeleteRequest:{Key:t.Key}}}}deleteTransaction(e,t={},i){let{conditions:r,returnValues:n,...s}=t;Object.keys(s).length>0&&eh(`Invalid delete transaction options: ${Object.keys(s).join(", ")}`);let a=this.deleteParams(e,t,i);if("ReturnValues"in a){let{ReturnValues:e,...t}=a;a=Object.assign({},t,{ReturnValuesOnConditionCheckFailure:e})}return{Delete:a}}deleteParams(e,t={},i={}){let r,n,s;let{schema:a,defaults:o,linked:l,_table:u}=this,c=eS()(a.attributes,l,Object.assign({},o,e),!0),{conditions:d,capacity:p,metrics:m,returnValues:y,...f}=t,b=Object.keys(f).filter(e=>!["execute","parse"].includes(e));if(b.length>0&&eh(`Invalid delete options: ${b.join(", ")}`),void 0===m||"string"==typeof m&&["NONE","SIZE"].includes(m.toUpperCase())||eh("'metrics' must be one of 'NONE' OR 'SIZE'"),void 0===p||"string"==typeof p&&["NONE","TOTAL","INDEXES"].includes(p.toUpperCase())||eh("'capacity' must be one of 'NONE','TOTAL', OR 'INDEXES'"),void 0===y||"string"==typeof y&&["NONE","ALL_OLD"].includes(y.toUpperCase())||eh("'returnValues' must be one of 'NONE' OR 'ALL_OLD'"),d){let{expression:e,names:t,values:i}=eL(d,this.table,this.name);Object.keys(t).length>0&&(r=t,n=i,s=e)}return Object.assign({TableName:u.name,Key:ex()(c,a.attributes,a.keys.partitionKey,a.keys.sortKey)},r?{ExpressionAttributeNames:r}:null,eb(n)?null:{ExpressionAttributeValues:n},s?{ConditionExpression:s}:null,p?{ReturnConsumedCapacity:p.toUpperCase()}:null,m?{ReturnItemCollectionMetrics:m.toUpperCase()}:null,y?{ReturnValues:y.toUpperCase()}:null,"object"==typeof i?i:{})}async update(e,t={},i={}){let r=this.updateParams(e,t,i);if(!eq(t.execute,this.autoExecute))return r;let n=await this.DocumentClient.send(new eu(r));if(!ez(t.parse,this.autoParse))return n;let{Attributes:s,...a}=n;return s?{Attributes:this.parse(s,t.include),...a}:a}updateTransaction(e,t={},i){let{conditions:r,returnValues:n,strictSchemaCheck:s,...a}=t;Object.keys(a).length>0&&eh(`Invalid update transaction options: ${Object.keys(a).join(", ")}`);let o=this.updateParams(e,t,i);if("ReturnValues"in o){let{ReturnValues:e,...t}=o;o=Object.assign({},t,{ReturnValuesOnConditionCheckFailure:e})}return{Update:o}}updateParams(e,t={}
1,{SET:i=[],REMOVE:r=[],ADD:n=[],DELETE:s=[],ExpressionAttributeNames:a={},ExpressionAttributeValues:o={},...l}={}){let u;Array.isArray(i)||eh("SET must be an array"),Array.isArray(r)||eh("REMOVE must be an array"),Array.isArray(n)||eh("ADD must be an array"),Array.isArray(s)||eh("DELETE must be an array"),(null==a?void 0:a.constructor)!==Object&&eh("ExpressionAttributeNames must be an object"),(null==o?void 0:o.constructor)!==Object&&eh("ExpressionAttributeValues must be an object");let{schema:c,defaults:d,required:p,linked:m,_table:y}=this,f=eI(),b=!1===t.strictSchemaCheck,h=eS()(c.attributes,m,Object.assign({},d,e),b),{conditions:g,capacity:v,metrics:$,returnValues:E,strictSchemaCheck:O,...N}=t,A=Object.keys(N).filter(e=>!["execute","parse"].includes(e));if(A.length>0&&eh(`Invalid update options: ${A.join(", ")}`),void 0===$||"string"==typeof $&&["NONE","SIZE"].includes($.toUpperCase())||eh("'metrics' must be one of 'NONE' OR 'SIZE'"),void 0===v||"string"==typeof v&&["NONE","TOTAL","INDEXES"].includes(v.toUpperCase())||eh("'capacity' must be one of 'NONE','TOTAL', OR 'INDEXES'"),void 0===E||"string"==typeof E&&["NONE","ALL_OLD","UPDATED_OLD","ALL_NEW","UPDATED_NEW"].includes(E.toUpperCase())||eh("'returnValues' must be one of 'NONE', 'ALL_OLD', 'UPDATED_OLD', 'ALL_NEW', OR 'UPDATED_NEW'"),g){let{expression:e,names:t,values:i}=eL(g,this.table,this.name);Object.keys(t).length>0&&(a=Object.assign(a,t),o=Object.assign(o,i),u=e)}Object.keys(p).forEach(e=>p[e]&&(void 0===h[e]||null===h[e])&&eh(`'${e}${this.schema.attributes[e].alias?`/${this.schema.attributes[e].alias}`:""}' is a required field`));let j=ex()(h,c.attributes,c.keys.partitionKey,c.keys.sortKey),I={},S={};Object.keys(h).forEach(t=>{var a,o,l,u,d,p,m,y;let b=c.attributes[t];if("$remove"===t){let e=Array.isArray(h[t])?h[t]:[h[t]];for(let t in e){c.attributes[e[t]]||eh(`'${e[t]}' is not a valid attribute and cannot be removed`),(!0===c.attributes[e[t]].partitionKey||!0===c.attributes[e[t]].sortKey)&&eh(`'${e[t]}' is the ${!0===c.attributes[e[t]].partitionKey?"partitionKey":"sortKey"} and cannot be removed`),c.attributes[e[t]].required&&eh(`'${e[t]}' is required and cannot be removed`),void 0!==c.attributes[e[t]].default&&eh(`'${e[t]}' has a default value and cannot be removed`);let i=c.attributes[e[t]].map||e[t];r.push(`#${i}`),I[`#${i}`]=i}}else if(!0!==this._table._removeNulls||null!==h[t]&&""!==String(h[t]).trim()||Array.isArray(h[t])||b.link&&!b.save){if(!0!==b.partitionKey&&!0!==b.sortKey&&(void 0===b.save||!0===b.save)&&(!b.link||b.link&&!0===b.save)){if(["bigint","number","set"].includes(b.type)&&(null===(a=h[t])||void 0===a?void 0:a.$add)!==void 0&&(null===(o=h[t])||void 0===o?void 0:o.$add)!==null)n.push(`#${t} :${t}`),S[`:${t}`]=f(b,t,h[t].$add),I[`#${t}`]=t;else if("set"===b.type&&(null===(l=h[t])||void 0===l?void 0:l.$delete))s.push(`#${t} :${t}`),S[`:${t}`]=f(b,t,h[t].$delete),I[`#${t}`]=t;else if("list"===b.type&&Array.isArray(null===(u=h[t])||void 0===u?void 0:u.$remove))h[t].$remove.forEach(e=>{"number"!=typeof e&&eh(`Remove array for '${t}' must only contain numeric indexes`),r.push(`#${t}[${e}]`)}),I[`#${t}`]=t;else if("list"===b.type&&((null===(d=h[t])||void 0===d?void 0:d.$append)||(null===(p=h[t])||void 0===p?void 0:p.$prepend)))h[t].$append?(i.push(`#${t} = list_append(if_not_exists(#${t}, :_ld) ,:${t})`),S[`:${t}`]=f(b,t,h[t].$append)):(i.push(`#${t} = list_append(:${t}, if_not_exists(#${t}, :_ld))`),S[`:${t}`]=f(b,t,h[t].$prepend)),I[`#${t}`]=t,S[":_ld"]=eK;else if("list"===b.type&&(null===(m=h[t])||void 0===m?void 0:m.constructor)===Object)Object.keys(h[t]).forEach(e=>{String(parseInt(e))!==e&&eh(`Properties must be numeric to update specific list items in '${t}'`),i.push(`#${t}[${e}] = :${t}_${e}`),S[`:${t}_${e}`]=h[t][e]}),I[`#${t}`]=t;else if("map"===b.type&&(null===(y=h[t])||void 0===y?void 0:y.$set))Object.keys(h[t].$set).forEach(e=>{let s=e.split("."),a=[`#${t}`];s.forEach((o,l)=>{let u=`${t}_${s.slice(0,l+1).join("_")}`;if(I[`#${u.replace(/\[(\d+)\]/,"")}`]=o.replace(/\[(\d+)\]/,""),l===s.length-1){let s=h[t].$set[e],o=`${a.join(".")}.#${u}`,l=`${u.replace(/\[(\d+)\]/,"_$1")}`;null==s?r.push(`${o}`):s.$add?(n.push(`${o} :${l}`),S[`:${l}`]=s.$add):s.$append?(i.push(`${o} = list_append(if_not_exists(${o}, :_ld), :${l})`),S[`:${l}`]=s.$append,S[":_ld"]=eK):s.$prepend?(i.push(`${o} = list_append(:${l}, if_not_exists(${o}, :_ld))`),S[`:${l}
1`]=s.$prepend,S[":_ld"]=eK):s.$remove?s.$remove.forEach(e=>{"number"!=typeof e&&eh(`Remove array for '${t}' must only contain numeric indexes`),r.push(`${o}[${e}]`)}):(i.push(`${o} = :${l}`),S[`:${l}`]=s),(null==s?void 0:s.$set)&&Object.keys(s.$set).forEach(e=>{String(parseInt(e))!==e&&eh(`Properties must be numeric to update specific list items in '${t}'`),i.push(`${o}[${e}] = :${l}_${e}`),S[`:${l}_${e}`]=s.$set[e]})}else a.push(`#${u.replace(/\[(\d+)\]/,"")}`)})}),Object.keys(h[t].$set).length>0&&(I[`#${t}`]=t);else{let r=ev(b,f(b,t,h[t]),h);void 0!==r&&(i.push(void 0===b.default||void 0!==e[b.alias||t]||b.onUpdate?`#${t} = :${t}`:`#${t} = if_not_exists(#${t},:${t})`),I[`#${t}`]=t,S[`:${t}`]=r)}}}else c.attributes[t].required&&eh(`'${t}' is required and cannot be removed`),r.push(`#${t}`),I[`#${t}`]=t});let w=((i.length>0?"SET "+i.join(", "):"")+(r.length>0?" REMOVE "+r.join(", "):"")+(n.length>0?" ADD "+n.join(", "):"")+(s.length>0?" DELETE "+s.join(", "):"")).trim();return o=Object.assign(S,o),Object.assign({TableName:y.name,Key:j,UpdateExpression:w,ExpressionAttributeNames:Object.assign(I,a)},"object"==typeof l?l:{},eb(o)?{}:{ExpressionAttributeValues:o},u?{ConditionExpression:u}:{},v?{ReturnConsumedCapacity:v.toUpperCase()}:null,$?{ReturnItemCollectionMetrics:$.toUpperCase()}:null,E?{ReturnValues:E.toUpperCase()}:null)}async put(e,t={},i={}){let r=this.putParams(e,t,i);if(!eq(t.execute,this.autoExecute))return r;let n=await this.DocumentClient.send(new eo(r));if(!ez(t.parse,this.autoParse))return n;let{Attributes:s,...a}=n;return s?{Attributes:this.parse(s,t.include),...a}:n}putBatch(e,t={}){let i=this.putParams(e,t);return{[i.TableName]:{PutRequest:{Item:i.Item}}}}putTransaction(e,t={},i){let{conditions:r,returnValues:n,strictSchemaCheck:s,...a}=t;Object.keys(a).length>0&&eh(`Invalid put transaction options: ${Object.keys(a).join(", ")}`);let o=this.putParams(e,t,i);if("ReturnValues"in o){let{ReturnValues:e,...t}=o;o=Object.assign({},t,{ReturnValuesOnConditionCheckFailure:e})}return{Put:o}}putParams(e,t={},i={}){let r,n,s;let{schema:a,defaults:o,required:l,linked:u,_table:c}=this,d=eI(),p=!1===t.strictSchemaCheck,m=eS()(a.attributes,u,Object.assign({},o,e),p),{conditions:y,capacity:f,metrics:b,returnValues:h,strictSchemaCheck:g,...v}=t,$=Object.keys(v).filter(e=>!["execute","parse"].includes(e));if($.length>0&&eh(`Invalid put options: ${$.join(", ")}`),void 0===b||"string"==typeof b&&["NONE","SIZE"].includes(b.toUpperCase())||eh("'metrics' must be one of 'NONE' OR 'SIZE'"),void 0===f||"string"==typeof f&&["NONE","TOTAL","INDEXES"].includes(f.toUpperCase())||eh("'capacity' must be one of 'NONE','TOTAL', OR 'INDEXES'"),void 0===h||"string"==typeof h&&["NONE","ALL_OLD","UPDATED_OLD","ALL_NEW","UPDATED_NEW"].includes(h.toUpperCase())||eh("'returnValues' must be one of 'NONE', 'ALL_OLD', 'UPDATED_OLD', 'ALL_NEW', or 'UPDATED_NEW'"),y){let{expression:e,names:t,values:i}=eL(y,this.table,this.name);Object.keys(t).length>0&&(r=t,n=i,s=e)}return Object.keys(l).forEach(e=>void 0!==l[e]&&(void 0===m[e]||null===m[e])&&eh(`'${e}${this.schema.attributes[e].alias?`/${this.schema.attributes[e].alias}`:""}' is a required field`)),ex()(m,a.attributes,a.keys.partitionKey,a.keys.sortKey),Object.assign({TableName:c.name,Item:Object.keys(m).reduce((e,t)=>{let i=a.attributes[t],r=m[t];return void 0!==r&&(void 0===i.save||!0===i.save)&&(!i.link||i.link&&!0===i.save)&&(!c._removeNulls||c._removeNulls&&null!==r)?(r=ev(i,r,m),r=
1d(i,t,r),Object.assign(e,{[t]:r})):e},{})},r?{ExpressionAttributeNames:r}:null,eb(n)?null:{ExpressionAttributeValues:n},s?{ConditionExpression:s}:null,f?{ReturnConsumedCapacity:f.toUpperCase()}:null,b?{ReturnItemCollectionMetrics:b.toUpperCase()}:null,h?{ReturnValues:h.toUpperCase()}:null,"object"==typeof i?i:{})}conditionCheck(e,t={}){let{conditions:i,returnValues:r,...n}=t;Object.keys(n).length>0&&eh(`Invalid conditionCheck options: ${Object.keys(n).join(", ")}`);let s=this.deleteParams(e,t);if("ConditionExpression"in s||eh("'conditions' are required in a conditionCheck"),"ReturnValues"in s){let{ReturnValues:e,...t}=s;s=Object.assign({},t,{ReturnValuesOnConditionCheckFailure:e})}return{ConditionCheck:s}}query(e,t={},i={}){if(!this.table)throw Error("Entity table is not defined");return t.entity=this.name,this.table.query(e,t,i)}scan(e={},t={}){if(!this.table)throw Error("Entity table is not defined");return e.entity=this.name,this.table.scan(e,t)}setTable(e){var t,i,r,n,s,a,o;return(null!=e||this._table)&&(null==e?void 0:e.name)!==(null===(t=this===null||void 0===this?void 0:this._table)||void 0===t?void 0:t.name)&&(null==e||(null===(i=null==e?void 0:e.Table)||void 0===i?void 0:i.attributes)||eh(`Entity ${this.name} was assigned an invalid table`),(null===(n=null===(r=this._table)||void 0===r?void 0:r.Table)||void 0===n?void 0:n.entityField)&&(delete this.schema.attributes[this._table.Table.entityField],delete this.defaults[this._table.Table.entityField],delete this.schema.attributes[this._etAlias],delete this.defaults[this._etAlias]),null===(a=null===(s=this._table)||void 0===s?void 0:s.removeEntity)||void 0===a||a.call(s,this),this._table=e,null==e||e.addEntity(this),(null===(o=null==e?void 0:e.Table)||void 0===o?void 0:o.entityField)&&(this.schema.attributes[e.Table.entityField]={type:"string",hidden:this.typeHidden,alias:this._etAlias,default:this.name},this.defaults[e.Table.entityField]=this.name,this.schema.attributes[this._etAlias]={type:"string",map:e.Table.entityField,default:this.name},this.defaults[this._etAlias]=this.name)),this}}var eF=eV;let eq=(e,t)=>!0===e||void 0===e&&t,ez=(e,t)=>!0===e||void 0===e&&t}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.