@spiffcommerce/core 41.0.2 → 41.0.3-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-1Cx7D8FE.cjs → index-B8os5-qQ.cjs} +17 -4
- package/dist/{index-1Cx7D8FE.cjs.map → index-B8os5-qQ.cjs.map} +1 -1
- package/dist/{index-DCCKqjKF.js → index-ChzAiEFj.js} +17 -4
- package/dist/{index-DCCKqjKF.js.map → index-ChzAiEFj.js.map} +1 -1
- package/dist/{index-p1RlkR6Z.cjs → index-DGxxZLUF.cjs} +2 -2
- package/dist/{index-p1RlkR6Z.cjs.map → index-DGxxZLUF.cjs.map} +1 -1
- package/dist/{index-D-9zypZB.js → index-PKEzv8ru.js} +2 -2
- package/dist/{index-D-9zypZB.js.map → index-PKEzv8ru.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -2
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -60,7 +60,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
60
60
|
`),C=EO(y.slice(0,A)),k=C["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(T=y.slice(A),T){if(S=hk(r,T),Object.keys(S).length>1||"data"in S||"incremental"in S||"errors"in S||"payload"in S)if(sO(S)){if(R={},"payload"in S){if(Object.keys(S).length===1&&S.payload===null)return[2];R=me({},S.payload)}"errors"in S&&(R=me(me({},R),{extensions:me(me({},"extensions"in R?R.extensions:null),(G={},G[jd]=S.errors,G))})),e(R)}else e(S);else if(Object.keys(S).length===1&&"hasNext"in S&&!S.hasNext)return[2]}v=o.indexOf(s)}return[3,1];case 3:return[2]}})})}function EO(r){var e={};return r.split(`
|
|
61
61
|
`).forEach(function(t){var n=t.indexOf(":");if(n>-1){var i=t.slice(0,n).trim().toLowerCase(),a=t.slice(n+1).trim();e[i]=a}}),e}function hk(r,e){if(r.status>=300){var t=function(){try{return JSON.parse(e)}catch{return e}};fk(r,t(),"Response not successful: Received status code ".concat(r.status))}try{return JSON.parse(e)}catch(i){var n=i;throw n.name="ServerParseError",n.response=r,n.statusCode=r.status,n.bodyText=e,n}}function kO(r,e){r.result&&r.result.errors&&r.result.data&&e.next(r.result),e.error(r)}function FO(r){return function(e){return e.text().then(function(t){return hk(e,t)}).then(function(t){return!Array.isArray(t)&&!Tw.call(t,"data")&&!Tw.call(t,"errors")&&fk(e,t,"Server response was missing for query '".concat(Array.isArray(r)?r.map(function(n){return n.operationName}):r.operationName,"'.")),t})}}var yy=function(r,e){var t;try{t=JSON.stringify(r)}catch(i){var n=qi(54,e,i.message);throw n.parseError=i,n}return t},TO={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},IO={accept:"*/*","content-type":"application/json"},DO={method:"POST"},PO={http:TO,headers:IO,options:DO},RO=function(r,e){return e(r)};function OO(r,e){for(var t=[],n=2;n<arguments.length;n++)t[n-2]=arguments[n];var i={},a={};t.forEach(function(h){i=me(me(me({},i),h.options),{headers:me(me({},i.headers),h.headers)}),h.credentials&&(i.credentials=h.credentials),a=me(me({},a),h.http)}),i.headers&&(i.headers=BO(i.headers,a.preserveHeaderCase));var s=r.operationName,o=r.extensions,l=r.variables,u=r.query,c={operationName:s,variables:l};return a.includeExtensions&&(c.extensions=o),a.includeQuery&&(c.query=e(u,bl)),{options:i,body:c}}function BO(r,e){if(!e){var t={};return Object.keys(Object(r)).forEach(function(a){t[a.toLowerCase()]=r[a]}),t}var n={};Object.keys(Object(r)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:r[a]}});var i={};return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var MO=function(r,e){var t=r.getContext(),n=t.uri;return n||(typeof e=="function"?e(r):e||"/graphql")};function _O(r,e){var t=[],n=function(h,f){t.push("".concat(h,"=").concat(encodeURIComponent(f)))};if("query"in e&&n("query",e.query),e.operationName&&n("operationName",e.operationName),e.variables){var i=void 0;try{i=yy(e.variables,"Variables map")}catch(h){return{parseError:h}}n("variables",i)}if(e.extensions){var a=void 0;try{a=yy(e.extensions,"Extensions map")}catch(h){return{parseError:h}}n("extensions",a)}var s="",o=r,l=r.indexOf("#");l!==-1&&(s=r.substr(l),o=r.substr(0,l));var u=o.indexOf("?")===-1?"?":"&",c=o+u+t.join("&")+s;return{newURI:c}}var NO=Da(function(){return fetch}),pk=function(r){r===void 0&&(r={});var e=r.uri,t=e===void 0?"/graphql":e,n=r.fetch,i=r.print,a=i===void 0?RO:i,s=r.includeExtensions,o=r.preserveHeaderCase,l=r.useGETForQueries,u=r.includeUnusedVariables,c=u===void 0?!1:u,h=ss(r,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]),f={http:{includeExtensions:s,preserveHeaderCase:o},options:h.fetchOptions,credentials:h.credentials,headers:h.headers};return new La(function(d){var g=MO(d,t),v=d.getContext(),y={};if(v.clientAwareness){var A=v.clientAwareness,C=A.name,k=A.version;C&&(y["apollographql-client-name"]=C),k&&(y["apollographql-client-version"]=k)}var T=me(me({},y),v.headers),S={http:v.http,options:v.fetchOptions,credentials:v.credentials,headers:T};if(md(["client"],d.query)){var R=ak(d.query);if(!R)return c0(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));d.query=R}var B=OO(d,a,PO,f,S),G=B.options,$=B.body;$.variables&&!c&&($.variables=fO($.variables,d.query));var Y;!G.signal&&typeof AbortController<"u"&&(Y=new AbortController,G.signal=Y.signal);var X=function(Oe){return Oe.kind==="OperationDefinition"&&Oe.operation==="mutation"},J=function(Oe){return Oe.kind==="OperationDefinition"&&Oe.operation==="subscription"},Q=J(Hd(d.query)),oe=md(["defer"],d.query);if(l&&!d.query.definitions.some(X)&&(G.method="GET"),oe||Q){G.headers=G.headers||{};var se="multipart/mixed;";Q?se+="boundary=graphql;subscriptionSpec=1.0,application/json":oe&&(se+="deferSpec=20220824,application/json"),G.headers.accept=se}if(G.method==="GET"){var he=_O(g,$),ye=he.newURI,Ue=he.parseError;if(Ue)return c0(Ue);g=ye}else try{G.body=yy($,"Payload")}catch(Oe){return c0(Oe)}return new an(function(Oe){var Te=n||Da(function(){return fetch})||NO,K=Oe.next.bind(Oe);return Te(g,G).then(function(ie){var de;d.setContext({response:ie});var Be=(de=ie.headers)===null||de===void 0?void 0:de.get("content-type");return Be!==null&&/^multipart\/mixed/i.test(Be)?SO(ie,K):FO(d)(ie).then(K)}).then(function(){Y=void 0,Oe.complete()}).catch(function(ie){Y=void 0,kO(ie,Oe)}),function(){Y&&Y.abort()}})})},LO=(function(r){va(e,r);function e(t){t===void 0&&(t={});var n=r.call(this,pk(t).request)||this;return n.options=t,n}return e})(La);const{toString:Iw,hasOwnProperty:UO}=Object.prototype,Dw=Function.prototype.toString,Ay=new Map;function Pn(r,e){try{return by(r,e)}finally{Ay.clear()}}function by(r,e){if(r===e)return!0;const t=Iw.call(r),n=Iw.call(e);if(t!==n)return!1;switch(t){case"[object Array]":if(r.length!==e.length)return!1;case"[object Object]":{if(Rw(r,e))return!0;const i=Pw(r),a=Pw(e),s=i.length;if(s!==a.length)return!1;for(let o=0;o<s;++o)if(!UO.call(e,i[o]))return!1;for(let o=0;o<s;++o){const l=i[o];if(!by(r[l],e[l]))return!1}return!0}case"[object Error]":return r.name===e.name&&r.message===e.message;case"[object Number]":if(r!==r)return e!==e;case"[object Boolean]":case"[object Date]":return+r==+e;case"[object RegExp]":case"[object String]":return r==`${e}`;case"[object Map]":case"[object Set]":{if(r.size!==e.size)return!1;if(Rw(r,e))return!0;const i=r.entries(),a=t==="[object Map]";for(;;){const s=i.next();if(s.done)break;const[o,l]=s.value;if(!e.has(o)||a&&!by(l,e.get(o)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":r=new Uint8Array(r),e=new Uint8Array(e);case"[object DataView]":{let i=r.byteLength;if(i===e.byteLength)for(;i--&&r[i]===e[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=Dw.call(r);return i!==Dw.call(e)?!1:!HO(i,zO)}}return!1}function Pw(r){return Object.keys(r).filter(VO,r)}function VO(r){return this[r]!==void 0}const zO="{ [native code] }";function HO(r,e){const t=r.length-e.length;return t>=0&&r.indexOf(e,t)===t}function Rw(r,e){let t=Ay.get(r);if(t){if(t.has(e))return!0}else Ay.set(r,t=new Set);return t.add(e),!1}function gk(r,e,t,n){var i=e.data,a=ss(e,["data"]),s=t.data,o=ss(t,["data"]);return Pn(a,o)&&Gp(Hd(r).selectionSet,i,s,{fragmentMap:gc(yc(r)),variables:n})}function Gp(r,e,t,n){if(e===t)return!0;var i=new Set;return r.selections.every(function(a){if(i.has(a)||(i.add(a),!zd(a,n.variables))||Ow(a))return!0;if(Co(a)){var s=wo(a),o=e&&e[s],l=t&&t[s],u=a.selectionSet;if(!u)return Pn(o,l);var c=Array.isArray(o),h=Array.isArray(l);if(c!==h)return!1;if(c&&h){var f=o.length;if(l.length!==f)return!1;for(var d=0;d<f;++d)if(!Gp(u,o[d],l[d],n))return!1;return!0}return Gp(u,o,l,n)}else{var g=Rg(a,n.fragmentMap);if(g)return Ow(g)?!0:Gp(g.selectionSet,e,t,n)}})}function Ow(r){return!!r.directives&&r.directives.some(jO)}function jO(r){return r.name.value==="nonreactive"}var mk=Pl?WeakMap:Map,vk=FA?WeakSet:Set,yk=new Ac;function Ak(r,e,t){return yk.withValue(!0,function(){var n=Hf(r,e,t,!1);return n})}function GO(r,e){if(e.has(r))return e.get(r);var t=Array.isArray(r)?[]:Object.create(null);return e.set(r,t),t}function Hf(r,e,t,n,i){var a=t.knownChanged,s=GO(r,t.mutableTargets);if(Array.isArray(r)){for(var o=0,l=Array.from(r.entries());o<l.length;o++){var u=l[o],c=u[0],h=u[1];if(h===null){s[c]=null;continue}var f=Hf(h,e,t,n);a.has(f)&&a.add(s),s[c]=f}return a.has(s)?s:r}for(var d=0,g=e.selections;d<g.length;d++){var v=g[d],y=void 0;if(n&&a.add(s),v.kind===et.FIELD){var A=wo(v),C=v.selectionSet;if(y=s[A]||r[A],y===void 0)continue;if(C&&y!==null){var f=Hf(r[A],C,t,n);a.has(f)&&(y=f)}s[A]=y}if(v.kind===et.INLINE_FRAGMENT&&(!v.typeCondition||t.cache.fragmentMatches(v,r.__typename))&&(y=Hf(r,v.selectionSet,t,n)),v.kind===et.FRAGMENT_SPREAD){var k=v.name.value,T=t.fragmentMap[k]||(t.fragmentMap[k]=t.cache.lookupFragment(k));Mr(T,59,k);var S=JP(v);S!=="mask"&&(y=Hf(r,T.selectionSet,t,S==="migrate"))}a.has(y)&&a.add(s)}return"__typename"in r&&!("__typename"in s)&&(s.__typename=r.__typename),Object.keys(s).length!==Object.keys(r).length&&a.add(s),a.has(s)?s:r}function bk(r,e,t,n){if(!t.fragmentMatches)return r;var i=e.definitions.filter(function(s){return s.kind===et.FRAGMENT_DEFINITION});typeof n>"u"&&(Mr(i.length===1,61,i.length),n=i[0].name.value);var a=i.find(function(s){return s.name.value===n});return Mr(!!a,62,n),r==null||Pn(r,{})?r:Ak(r,a.selectionSet,{operationName:a.name.value,fragmentMap:gc(yc(e)),cache:t,mutableTargets:new mk,knownChanged:new vk})}function $O(r,e,t){var n;if(!t.fragmentMatches)return r;var i=vc(e);return Mr(i,63),r==null?r:Ak(r,i.selectionSet,{operationType:i.operation,operationName:(n=i.name)===null||n===void 0?void 0:n.value,fragmentMap:gc(yc(e)),cache:t,mutableTargets:new mk,knownChanged:new vk})}var qO=(function(){function r(){this.assumeImmutableResults=!1,this.getFragmentDoc=Zu(nR,{max:Us["cache.fragmentQueryDocuments"]||1e3,cache:vd})}return r.prototype.lookupFragment=function(e){return null},r.prototype.batch=function(e){var t=this,n=typeof e.optimistic=="string"?e.optimistic:e.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=e.update(t)},n),i},r.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},r.prototype.transformDocument=function(e){return e},r.prototype.transformForLink=function(e){return e},r.prototype.identify=function(e){},r.prototype.gc=function(){return[]},r.prototype.modify=function(e){return!1},r.prototype.readQuery=function(e,t){var n=this;return t===void 0&&(t=!!e.optimistic),Pi("canonizeResults",function(){return n.read(me(me({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))})},r.prototype.watchFragment=function(e){var t=this,n=e.fragment,i=e.fragmentName,a=e.from,s=e.optimistic,o=s===void 0?!0:s,l=ss(e,["fragment","fragmentName","from","optimistic"]),u=this.getFragmentDoc(n,i),c=typeof a>"u"||typeof a=="string"?a:this.identify(a),h=!!e[Symbol.for("apollo.dataMasking")],f=me(me({},l),{returnPartialData:!0,id:c,query:u,optimistic:o}),d;return new an(function(g){return t.watch(me(me({},f),{immediate:!0,callback:function(v){var y=h?bk(v.result,n,t,i):v.result;if(!(d&&gk(u,{data:d.result},{data:y},e.variables))){var A={data:y,complete:!!v.complete};v.missing&&(A.missing=_g(v.missing.map(function(C){return C.missing}))),d=me(me({},v),{result:y}),g.next(A)}}}))})},r.prototype.readFragment=function(e,t){var n=this;return t===void 0&&(t=!!e.optimistic),Pi("canonizeResults",function(){return n.read(me(me({},e),{query:n.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))})},r.prototype.writeQuery=function(e){var t=e.id,n=e.data,i=ss(e,["id","data"]);return this.write(Object.assign(i,{dataId:t||"ROOT_QUERY",result:n}))},r.prototype.writeFragment=function(e){var t=e.id,n=e.data,i=e.fragment,a=e.fragmentName,s=ss(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(s,{query:this.getFragmentDoc(i,a),dataId:t,result:n}))},r.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var i=Pi("canonizeResults",function(){return n.readQuery(e)}),a=t(i);return a==null?i:(n.writeQuery(me(me({},e),{data:a})),a)}})},r.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var i=Pi("canonizeResults",function(){return n.readFragment(e)}),a=t(i);return a==null?i:(n.writeFragment(me(me({},e),{data:a})),a)}})},r})(),wk=(function(r){va(e,r);function e(t,n,i,a){var s,o=r.call(this,t)||this;if(o.message=t,o.path=n,o.query=i,o.variables=a,Array.isArray(o.path)){o.missing=o.message;for(var l=o.path.length-1;l>=0;--l)o.missing=(s={},s[o.path[l]]=o.missing,s)}else o.missing=o.path;return o.__proto__=e.prototype,o}return e})(Error),mi=Object.prototype.hasOwnProperty;function hf(r){return r==null}function Ck(r,e){var t=r.__typename,n=r.id,i=r._id;if(typeof t=="string"&&(e&&(e.keyObject=hf(n)?hf(i)?void 0:{_id:i}:{id:n}),hf(n)&&!hf(i)&&(n=i),!hf(n)))return"".concat(t,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var xk={dataIdFromObject:Ck,addTypename:!0,resultCaching:!0,canonizeResults:!1};function WO(r){return tc(xk,r)}function Sk(r){var e=r.canonizeResults;return e===void 0?xk.canonizeResults:e}var Ek=/^[_a-z][_0-9a-z]*/i;function rc(r){var e=r.match(Ek);return e?e[0]:r}function wy(r,e,t){return fi(e)?ii(e)?e.every(function(n){return wy(r,n,t)}):r.selections.every(function(n){if(Co(n)&&zd(n,t)){var i=wo(n);return mi.call(e,i)&&(!n.selectionSet||wy(n.selectionSet,e[i],t))}return!0}):!1}function _u(r){return fi(r)&&!Fn(r)&&!ii(r)}function QO(){return new So}function kk(r,e){var t=gc(yc(r));return{fragmentMap:t,lookupFragment:function(n){var i=t[n];return!i&&e&&(i=e.lookup(n)),i||null}}}var $p=Object.create(null),f0=function(){return $p},Bw=Object.create(null),Ad=(function(){function r(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return Fn(i)?n.get(i.__ref,a):i&&i[a]},this.canRead=function(i){return Fn(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return ju(i);if(Fn(i))return i;var s=n.policies.identify(i)[0];if(s){var o=ju(s);return a&&n.merge(s,i),o}}}return r.prototype.toObject=function(){return me({},this.data)},r.prototype.has=function(e){return this.lookup(e,!0)!==void 0},r.prototype.get=function(e,t){if(this.group.depend(e,t),mi.call(this.data,e)){var n=this.data[e];if(n&&mi.call(n,t))return n[t]}if(t==="__typename"&&mi.call(this.policies.rootTypenamesById,e))return this.policies.rootTypenamesById[e];if(this instanceof ao)return this.parent.get(e,t)},r.prototype.lookup=function(e,t){if(t&&this.group.depend(e,"__exists"),mi.call(this.data,e))return this.data[e];if(this instanceof ao)return this.parent.lookup(e,t);if(this.policies.rootTypenamesById[e])return Object.create(null)},r.prototype.merge=function(e,t){var n=this,i;Fn(e)&&(e=e.__ref),Fn(t)&&(t=t.__ref);var a=typeof e=="string"?this.lookup(i=e):e,s=typeof t=="string"?this.lookup(i=t):t;if(s){Mr(typeof i=="string",2);var o=new So(XO).merge(a,s);if(this.data[i]=o,o!==a&&(delete this.refs[i],this.group.caching)){var l=Object.create(null);a||(l.__exists=1),Object.keys(s).forEach(function(u){if(!a||a[u]!==o[u]){l[u]=1;var c=rc(u);c!==u&&!n.policies.hasKeyArgs(o.__typename,c)&&(l[c]=1),o[u]===void 0&&!(n instanceof ao)&&delete o[u]}}),l.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===o.__typename&&delete l.__typename,Object.keys(l).forEach(function(u){return n.group.dirty(i,u)})}}},r.prototype.modify=function(e,t){var n=this,i=this.lookup(e);if(i){var a=Object.create(null),s=!1,o=!0,l={DELETE:$p,INVALIDATE:Bw,isReference:Fn,toReference:this.toReference,canRead:this.canRead,readField:function(u,c){return n.policies.readField(typeof u=="string"?{fieldName:u,from:c||ju(e)}:u,{store:n})}};if(Object.keys(i).forEach(function(u){var c=rc(u),h=i[u];if(h!==void 0){var f=typeof t=="function"?t:t[u]||t[c];if(f){var d=f===f0?$p:f(h,me(me({},l),{fieldName:c,storeFieldName:u,storage:n.getStorage(e,u)}));d===Bw?n.group.dirty(e,u):(d===$p&&(d=void 0),d!==h&&(a[u]=d,s=!0,h=d))}h!==void 0&&(o=!1)}}),s)return this.merge(e,a),o&&(this instanceof ao?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},r.prototype.delete=function(e,t,n){var i,a=this.lookup(e);if(a){var s=this.getFieldValue(a,"__typename"),o=t&&n?this.policies.getStoreFieldName({typename:s,fieldName:t,args:n}):t;return this.modify(e,o?(i={},i[o]=f0,i):f0)}return!1},r.prototype.evict=function(e,t){var n=!1;return e.id&&(mi.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof ao&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},r.prototype.clear=function(){this.replace(null)},r.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){mi.call(e.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(t.__META={extraRootIds:n.sort()}),t},r.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach(function(a){e&&mi.call(e,a)||t.delete(a)}),e){var n=e.__META,i=ss(e,["__META"]);Object.keys(i).forEach(function(a){t.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},r.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},r.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},r.prototype.getRootIdSet=function(e){return e===void 0&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof ao?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},r.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach(function(s){mi.call(n,s)&&(Object.keys(e.findChildRefIds(s)).forEach(t.add,t),delete n[s])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof ao;)a=a.parent;i.forEach(function(s){return a.delete(s)})}return i},r.prototype.findChildRefIds=function(e){if(!mi.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var i=new Set([n]);i.forEach(function(a){Fn(a)&&(t[a.__ref]=!0),fi(a)&&Object.keys(a).forEach(function(s){var o=a[s];fi(o)&&i.add(o)})})}return this.refs[e]},r.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},r})(),Fk=(function(){function r(e,t){t===void 0&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return r.prototype.resetCaching=function(){this.d=this.caching?ek():null,this.keyMaker=new Vs(Pl)},r.prototype.depend=function(e,t){if(this.d){this.d(d0(e,t));var n=rc(t);n!==t&&this.d(d0(e,n)),this.parent&&this.parent.depend(e,t)}},r.prototype.dirty=function(e,t){this.d&&this.d.dirty(d0(e,t),t==="__exists"?"forget":"setDirty")},r})();function d0(r,e){return e+"#"+r}function Mw(r,e){td(r)&&r.group.depend(e,"__exists")}(function(r){var e=(function(t){va(n,t);function n(i){var a=i.policies,s=i.resultCaching,o=s===void 0?!0:s,l=i.seed,u=t.call(this,a,new Fk(o))||this;return u.stump=new YO(u),u.storageTrie=new Vs(Pl),l&&u.replace(l),u}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n})(r);r.Root=e})(Ad||(Ad={}));var ao=(function(r){va(e,r);function e(t,n,i,a){var s=r.call(this,n.policies,a)||this;return s.id=t,s.parent=n,s.replay=i,s.group=a,i(s),s}return e.prototype.addLayer=function(t,n){return new e(t,this,n,this.group)},e.prototype.removeLayer=function(t){var n=this,i=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var s=n.data[a],o=i.lookup(a);o?s?s!==o&&Object.keys(s).forEach(function(l){Pn(s[l],o[l])||n.group.dirty(a,l)}):(n.group.dirty(a,"__exists"),Object.keys(o).forEach(function(l){n.group.dirty(a,l)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return me(me({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return mi.call(this.data,t)?me(me({},n),r.prototype.findChildRefIds.call(this,t)):n},e.prototype.getStorage=function(){for(var t=this.parent;t.parent;)t=t.parent;return t.getStorage.apply(t,arguments)},e})(Ad),YO=(function(r){va(e,r);function e(t){return r.call(this,"EntityStore.Stump",t,function(){},new Fk(t.group.caching,t.group))||this}return e.prototype.removeLayer=function(){return this},e.prototype.merge=function(t,n){return this.parent.merge(t,n)},e})(ao);function XO(r,e,t){var n=r[t],i=e[t];return Pn(n,i)?n:i}function td(r){return!!(r instanceof Ad&&r.group.caching)}var di=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zs(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function JO(r){return fi(r)?ii(r)?r.slice(0):me({__proto__:Object.getPrototypeOf(r)},r):r}var _w=(function(){function r(){this.known=new(FA?WeakSet:Set),this.pool=new Vs(Pl),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return r.prototype.isKnown=function(e){return fi(e)&&this.known.has(e)},r.prototype.pass=function(e){if(fi(e)){var t=JO(e);return this.passes.set(t,e),t}return e},r.prototype.admit=function(e){var t=this;if(fi(e)){var n=this.passes.get(e);if(n)return n;var i=Object.getPrototypeOf(e);switch(i){case Array.prototype:{if(this.known.has(e))return e;var a=e.map(this.admit,this),s=this.pool.lookupArray(a);return s.array||this.known.add(s.array=a),s.array}case null:case Object.prototype:{if(this.known.has(e))return e;var o=Object.getPrototypeOf(e),l=[o],u=this.sortedKeys(e);l.push(u.json);var c=l.length;u.sorted.forEach(function(d){l.push(t.admit(e[d]))});var s=this.pool.lookupArray(l);if(!s.object){var h=s.object=Object.create(o);this.known.add(h),u.sorted.forEach(function(d,g){h[d]=l[c+g]})}return s.object}}}return e},r.prototype.sortedKeys=function(e){var t=Object.keys(e),n=this.pool.lookupArray(t);if(!n.keys){t.sort();var i=JSON.stringify(t);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:t,json:i})}return n.keys},r})();function Nw(r){return[r.selectionSet,r.objectOrReference,r.context,r.context.canonizeResults]}var KO=(function(){function r(e){var t=this;this.knownResults=new(Pl?WeakMap:Map),this.config=tc(e,{addTypename:e.addTypename!==!1,canonizeResults:Sk(e)}),this.canon=e.canon||new _w,this.executeSelectionSet=Zu(function(n){var i,a=n.context.canonizeResults,s=Nw(n);s[3]=!a;var o=(i=t.executeSelectionSet).peek.apply(i,s);return o?a?me(me({},o),{result:t.canon.admit(o.result)}):o:(Mw(n.context.store,n.enclosingRef.__ref),t.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||Us["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:Nw,makeCacheKey:function(n,i,a,s){if(td(a.store))return a.store.makeCacheKey(n,Fn(i)?i.__ref:i,a.varString,s)}}),this.executeSubSelectedArray=Zu(function(n){return Mw(n.context.store,n.enclosingRef.__ref),t.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||Us["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,a=n.array,s=n.context;if(td(s.store))return s.store.makeCacheKey(i,a,s.varString)}})}return r.prototype.resetCanon=function(){this.canon=new _w},r.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,i=e.rootId,a=i===void 0?"ROOT_QUERY":i,s=e.variables,o=e.returnPartialData,l=o===void 0?!0:o,u=e.canonizeResults,c=u===void 0?this.config.canonizeResults:u,h=this.config.cache.policies;s=me(me({},TA(FR(n))),s);var f=ju(a),d=this.executeSelectionSet({selectionSet:Hd(n).selectionSet,objectOrReference:f,enclosingRef:f,context:me({store:t,query:n,policies:h,variables:s,varString:vo(s),canonizeResults:c},kk(n,this.config.fragments))}),g;if(d.missing&&(g=[new wk(ZO(d.missing),d.missing,n,s)],!l))throw g[0];return{result:d.result,complete:!g,missing:g}},r.prototype.isFresh=function(e,t,n,i){if(td(i.store)&&this.knownResults.get(e)===n){var a=this.executeSelectionSet.peek(n,t,i,this.canon.isKnown(e));if(a&&e===a.result)return!0}return!1},r.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,i=e.objectOrReference,a=e.enclosingRef,s=e.context;if(Fn(i)&&!s.policies.rootTypenamesById[i.__ref]&&!s.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var o=s.variables,l=s.policies,u=s.store,c=u.getFieldValue(i,"__typename"),h=[],f,d=new So;this.config.addTypename&&typeof c=="string"&&!l.rootIdsByTypename[c]&&h.push({__typename:c});function g(k,T){var S;return k.missing&&(f=d.merge(f,(S={},S[T]=k.missing,S))),k.result}var v=new Set(n.selections);v.forEach(function(k){var T,S;if(zd(k,o))if(Co(k)){var R=l.readField({fieldName:k.name.value,field:k,variables:s.variables,from:i},s),B=wo(k);R===void 0?ik.added(k)||(f=d.merge(f,(T={},T[B]="Can't find field '".concat(k.name.value,"' on ").concat(Fn(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),T))):ii(R)?R.length>0&&(R=g(t.executeSubSelectedArray({field:k,array:R,enclosingRef:a,context:s}),B)):k.selectionSet?R!=null&&(R=g(t.executeSelectionSet({selectionSet:k.selectionSet,objectOrReference:R,enclosingRef:Fn(R)?R:a,context:s}),B)):s.canonizeResults&&(R=t.canon.pass(R)),R!==void 0&&h.push((S={},S[B]=R,S))}else{var G=Rg(k,s.lookupFragment);if(!G&&k.kind===et.FRAGMENT_SPREAD)throw qi(10,k.name.value);G&&l.fragmentMatches(G,c)&&G.selectionSet.selections.forEach(v.add,v)}});var y=_g(h),A={result:y,missing:f},C=s.canonizeResults?this.canon.admit(A):A;return C.result&&this.knownResults.set(C.result,n),C},r.prototype.execSubSelectedArrayImpl=function(e){var t=this,n=e.field,i=e.array,a=e.enclosingRef,s=e.context,o,l=new So;function u(c,h){var f;return c.missing&&(o=l.merge(o,(f={},f[h]=c.missing,f))),c.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map(function(c,h){return c===null?null:ii(c)?u(t.executeSubSelectedArray({field:n,array:c,enclosingRef:a,context:s}),h):n.selectionSet?u(t.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:c,enclosingRef:Fn(c)?c:a,context:s}),h):c}),{result:s.canonizeResults?this.canon.admit(i):i,missing:o}},r})();function ZO(r){try{JSON.stringify(r,function(e,t){if(typeof t=="string")throw t;return t})}catch(e){return e}}var LA=new Ac,Lw=new WeakMap;function rd(r){var e=Lw.get(r);return e||Lw.set(r,e={vars:new Set,dep:ek()}),e}function Uw(r){rd(r).vars.forEach(function(e){return e.forgetCache(r)})}function e4(r){rd(r).vars.forEach(function(e){return e.attachCache(r)})}function t4(r){var e=new Set,t=new Set,n=function(a){if(arguments.length>0){if(r!==a){r=a,e.forEach(function(l){rd(l).dep.dirty(n),r4(l)});var s=Array.from(t);t.clear(),s.forEach(function(l){return l(r)})}}else{var o=LA.getValue();o&&(i(o),rd(o).dep(n))}return r};n.onNextChange=function(a){return t.add(a),function(){t.delete(a)}};var i=n.attachCache=function(a){return e.add(a),rd(a).vars.add(n),n};return n.forgetCache=function(a){return e.delete(a)},n}function r4(r){r.broadcastWatches&&r.broadcastWatches()}var Vw=Object.create(null);function UA(r){var e=JSON.stringify(r);return Vw[e]||(Vw[e]=Object.create(null))}function zw(r){var e=UA(r);return e.keyFieldsFn||(e.keyFieldsFn=function(t,n){var i=function(s,o){return n.readField(o,s)},a=n.keyObject=VA(r,function(s){var o=$u(n.storeObject,s,i);return o===void 0&&t!==n.storeObject&&mi.call(t,s[0])&&(o=$u(t,s,Ik)),Mr(o!==void 0,5,s.join("."),t),o});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function Hw(r){var e=UA(r);return e.keyArgsFn||(e.keyArgsFn=function(t,n){var i=n.field,a=n.variables,s=n.fieldName,o=VA(r,function(u){var c=u[0],h=c.charAt(0);if(h==="@"){if(i&&us(i.directives)){var f=c.slice(1),d=i.directives.find(function(A){return A.name.value===f}),g=d&&Og(d,a);return g&&$u(g,u.slice(1))}return}if(h==="$"){var v=c.slice(1);if(a&&mi.call(a,v)){var y=u.slice(0);return y[0]=v,$u(a,y)}return}if(t)return $u(t,u)}),l=JSON.stringify(o);return(t||l!=="{}")&&(s+=":"+l),s})}function VA(r,e){var t=new So;return Tk(r).reduce(function(n,i){var a,s=e(i);if(s!==void 0){for(var o=i.length-1;o>=0;--o)s=(a={},a[i[o]]=s,a);n=t.merge(n,s)}return n},Object.create(null))}function Tk(r){var e=UA(r);if(!e.paths){var t=e.paths=[],n=[];r.forEach(function(i,a){ii(i)?(Tk(i).forEach(function(s){return t.push(n.concat(s))}),n.length=0):(n.push(i),ii(r[a+1])||(t.push(n.slice(0)),n.length=0))})}return e.paths}function Ik(r,e){return r[e]}function $u(r,e,t){return t=t||Ik,Dk(e.reduce(function n(i,a){return ii(i)?i.map(function(s){return n(s,a)}):i&&t(i,a)},r))}function Dk(r){return fi(r)?ii(r)?r.map(Dk):VA(Object.keys(r).sort(),function(e){return $u(r,e)}):r}function Cy(r){return r.args!==void 0?r.args:r.field?Og(r.field,r.variables):null}var n4=function(){},jw=function(r,e){return e.fieldName},Gw=function(r,e,t){var n=t.mergeObjects;return n(r,e)},$w=function(r,e){return e},i4=(function(){function r(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=me({dataIdFromObject:Ck},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return r.prototype.identify=function(e,t){var n,i=this,a=t&&(t.typename||((n=t.storeObject)===null||n===void 0?void 0:n.__typename))||e.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];var s=t&&t.storeObject||e,o=me(me({},t),{typename:a,storeObject:s,readField:t&&t.readField||function(){var h=zA(arguments,s);return i.readField(h,{store:i.cache.data,variables:h.variables})}}),l,u=a&&this.getTypePolicy(a),c=u&&u.keyFn||this.config.dataIdFromObject;return yk.withValue(!0,function(){for(;c;){var h=c(me(me({},e),s),o);if(ii(h))c=zw(h);else{l=h;break}}}),l=l?String(l):void 0,o.keyObject?[l,o.keyObject]:[l]},r.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach(function(n){var i=e[n],a=i.queryType,s=i.mutationType,o=i.subscriptionType,l=ss(i,["queryType","mutationType","subscriptionType"]);a&&t.setRootTypename("Query",n),s&&t.setRootTypename("Mutation",n),o&&t.setRootTypename("Subscription",n),mi.call(t.toBeAdded,n)?t.toBeAdded[n].push(l):t.toBeAdded[n]=[l]})},r.prototype.updateTypePolicy=function(e,t,n){var i=this.getTypePolicy(e),a=t.keyFields,s=t.fields;function o(l,u){l.merge=typeof u=="function"?u:u===!0?Gw:u===!1?$w:l.merge}o(i,t.merge),i.keyFn=a===!1?n4:ii(a)?zw(a):typeof a=="function"?a:i.keyFn,s&&Object.keys(s).forEach(function(l){var u=n[l];(!u||u?.typename!==e)&&(u=n[l]={typename:e});var c=s[l];if(typeof c=="function")u.read=c;else{var h=c.keyArgs,f=c.read,d=c.merge;u.keyFn=h===!1?jw:ii(h)?Hw(h):typeof h=="function"?h:u.keyFn,typeof f=="function"&&(u.read=f),o(u,d)}u.read&&u.merge&&(u.keyFn=u.keyFn||jw)})},r.prototype.setRootTypename=function(e,t){t===void 0&&(t=e);var n="ROOT_"+e.toUpperCase(),i=this.rootTypenamesById[n];t!==i&&(Mr(!i||i===e,6,e),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},r.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach(function(n){t.getSupertypeSet(n,!0),e[n].forEach(function(i){t.getSupertypeSet(i,!0).add(n);var a=i.match(Ek);(!a||a[0]!==i)&&t.fuzzySubtypes.set(i,new RegExp(i))})})},r.prototype.getTypePolicy=function(e){var t=this;if(!mi.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(e);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(e,!0),this.fuzzySubtypes.forEach(function(s,o){if(s.test(e)){var l=t.supertypeMap.get(o);l&&l.forEach(function(u){return i.add(u)})}})),i&&i.size&&i.forEach(function(s){var o=t.getTypePolicy(s),l=o.fields,u=ss(o,["fields"]);Object.assign(n,u),Object.assign(n.fields,l)})}var a=this.toBeAdded[e];return a&&a.length&&a.splice(0).forEach(function(s){t.updateTypePolicy(e,s,t.typePolicies[e].fields)}),this.typePolicies[e]},r.prototype.getFieldPolicy=function(e,t){if(e)return this.getTypePolicy(e).fields[t]},r.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},r.prototype.fragmentMatches=function(e,t,n,i){var a=this;if(!e.typeCondition)return!0;if(!t)return!1;var s=e.typeCondition.name.value;if(t===s)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(s))for(var o=this.getSupertypeSet(t,!0),l=[o],u=function(d){var g=a.getSupertypeSet(d,!1);g&&g.size&&l.indexOf(g)<0&&l.push(g)},c=!!(n&&this.fuzzySubtypes.size),h=0;h<l.length;++h){var f=l[h];if(f.has(s))return o.has(s)||o.add(s),!0;f.forEach(u),c&&h===l.length-1&&wy(e.selectionSet,n,i)&&(c=!1,this.fuzzySubtypes.forEach(function(d,g){var v=t.match(d);v&&v[0]===t&&u(g)}))}return!1},r.prototype.hasKeyArgs=function(e,t){var n=this.getFieldPolicy(e,t);return!!(n&&n.keyFn)},r.prototype.getStoreFieldName=function(e){var t=e.typename,n=e.fieldName,i=this.getFieldPolicy(t,n),a,s=i&&i.keyFn;if(s&&t)for(var o={typename:t,fieldName:n,field:e.field||null,variables:e.variables},l=Cy(e);s;){var u=s(l,o);if(ii(u))s=Hw(u);else{a=u||n;break}}return a===void 0&&(a=e.field?SR(e.field,e.variables):j2(n,Cy(e))),a===!1?n:n===rc(a)?a:n+":"+a},r.prototype.readField=function(e,t){var n=e.from;if(n){var i=e.field||e.fieldName;if(i){if(e.typename===void 0){var a=t.store.getFieldValue(n,"__typename");a&&(e.typename=a)}var s=this.getStoreFieldName(e),o=rc(s),l=t.store.getFieldValue(n,s),u=this.getFieldPolicy(e.typename,o),c=u&&u.read;if(c){var h=qw(this,n,e,t,t.store.getStorage(Fn(n)?n.__ref:n,s));return LA.withValue(this.cache,c,[l,h])}return l}}},r.prototype.getReadFunction=function(e,t){var n=this.getFieldPolicy(e,t);return n&&n.read},r.prototype.getMergeFunction=function(e,t,n){var i=this.getFieldPolicy(e,t),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},r.prototype.runMergeFunction=function(e,t,n,i,a){var s=n.field,o=n.typename,l=n.merge;return l===Gw?Pk(i.store)(e,t):l===$w?t:(i.overwrite&&(e=void 0),l(e,t,qw(this,void 0,{typename:o,fieldName:s.name.value,field:s,variables:i.variables},i,a||Object.create(null))))},r})();function qw(r,e,t,n,i){var a=r.getStoreFieldName(t),s=rc(a),o=t.variables||n.variables,l=n.store,u=l.toReference,c=l.canRead;return{args:Cy(t),field:t.field||null,fieldName:s,storeFieldName:a,variables:o,isReference:Fn,toReference:u,storage:i,cache:r.cache,canRead:c,readField:function(){return r.readField(zA(arguments,e,o),n)},mergeObjects:Pk(n.store)}}function zA(r,e,t){var n=r[0],i=r[1],a=r.length,s;return typeof n=="string"?s={fieldName:n,from:a>1?i:e}:(s=me({},n),mi.call(s,"from")||(s.from=e)),s.variables===void 0&&(s.variables=t),s}function Pk(r){return function(t,n){if(ii(t)||ii(n))throw qi(9);if(fi(t)&&fi(n)){var i=r.getFieldValue(t,"__typename"),a=r.getFieldValue(n,"__typename"),s=i&&a&&i!==a;if(s)return n;if(Fn(t)&&_u(n))return r.merge(t.__ref,n),t;if(_u(t)&&Fn(n))return r.merge(t,n.__ref),n;if(_u(t)&&_u(n))return me(me({},t),n)}return n}}function h0(r,e,t){var n="".concat(e).concat(t),i=r.flavors.get(n);return i||r.flavors.set(n,i=r.clientOnly===e&&r.deferred===t?r:me(me({},r),{clientOnly:e,deferred:t})),i}var a4=(function(){function r(e,t,n){this.cache=e,this.reader=t,this.fragments=n}return r.prototype.writeToStore=function(e,t){var n=this,i=t.query,a=t.result,s=t.dataId,o=t.variables,l=t.overwrite,u=vc(i),c=QO();o=me(me({},TA(u)),o);var h=me(me({store:e,written:Object.create(null),merge:function(d,g){return c.merge(d,g)},variables:o,varString:vo(o)},kk(i,this.fragments)),{overwrite:!!l,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),f=this.processSelectionSet({result:a||Object.create(null),dataId:s,selectionSet:u.selectionSet,mergeTree:{map:new Map},context:h});if(!Fn(f))throw qi(12,a);return h.incomingById.forEach(function(d,g){var v=d.storeObject,y=d.mergeTree;d.fieldNodeSet;var A=ju(g);if(y&&y.map.size){var C=n.applyMerges(y,A,v,h);if(Fn(C))return;v=C}e.merge(g,v)}),e.retain(f.__ref),f},r.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,i=e.result,a=e.selectionSet,s=e.context,o=e.mergeTree,l=this.cache.policies,u=Object.create(null),c=n&&l.rootTypenamesById[n]||fy(i,a,s.fragmentMap)||n&&s.store.get(n,"__typename");typeof c=="string"&&(u.__typename=c);var h=function(){var k=zA(arguments,u,s.variables);if(Fn(k.from)){var T=s.incomingById.get(k.from.__ref);if(T){var S=l.readField(me(me({},k),{from:T.storeObject}),s);if(S!==void 0)return S}}return l.readField(k,s)},f=new Set;this.flattenFields(a,i,s,c).forEach(function(k,T){var S,R=wo(T),B=i[R];if(f.add(T),B!==void 0){var G=l.getStoreFieldName({typename:c,fieldName:T.name.value,field:T,variables:k.variables}),$=Ww(o,G),Y=t.processFieldValue(B,T,T.selectionSet?h0(k,!1,!1):k,$),X=void 0;T.selectionSet&&(Fn(Y)||_u(Y))&&(X=h("__typename",Y));var J=l.getMergeFunction(c,T.name.value,X);J?$.info={field:T,typename:c,merge:J}:Qw(o,G),u=k.merge(u,(S={},S[G]=Y,S))}});try{var d=l.identify(i,{typename:c,selectionSet:a,fragmentMap:s.fragmentMap,storeObject:u,readField:h}),g=d[0],v=d[1];n=n||g,v&&(u=s.merge(u,v))}catch(k){if(!n)throw k}if(typeof n=="string"){var y=ju(n),A=s.written[n]||(s.written[n]=[]);if(A.indexOf(a)>=0||(A.push(a),this.reader&&this.reader.isFresh(i,y,a,s)))return y;var C=s.incomingById.get(n);return C?(C.storeObject=s.merge(C.storeObject,u),C.mergeTree=xy(C.mergeTree,o),f.forEach(function(k){return C.fieldNodeSet.add(k)})):s.incomingById.set(n,{storeObject:u,mergeTree:og(o)?void 0:o,fieldNodeSet:f}),y}return u},r.prototype.processFieldValue=function(e,t,n,i){var a=this;return!t.selectionSet||e===null?e:ii(e)?e.map(function(s,o){var l=a.processFieldValue(s,t,n,Ww(i,o));return Qw(i,o),l}):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:i})},r.prototype.flattenFields=function(e,t,n,i){i===void 0&&(i=fy(t,e,n.fragmentMap));var a=new Map,s=this.cache.policies,o=new Vs(!1);return(function l(u,c){var h=o.lookup(u,c.clientOnly,c.deferred);h.visited||(h.visited=!0,u.selections.forEach(function(f){if(zd(f,n.variables)){var d=c.clientOnly,g=c.deferred;if(!(d&&g)&&us(f.directives)&&f.directives.forEach(function(A){var C=A.name.value;if(C==="client"&&(d=!0),C==="defer"){var k=Og(A,n.variables);(!k||k.if!==!1)&&(g=!0)}}),Co(f)){var v=a.get(f);v&&(d=d&&v.clientOnly,g=g&&v.deferred),a.set(f,h0(n,d,g))}else{var y=Rg(f,n.lookupFragment);if(!y&&f.kind===et.FRAGMENT_SPREAD)throw qi(14,f.name.value);y&&s.fragmentMatches(y,i,t,n.variables)&&l(y.selectionSet,h0(n,d,g))}}}))})(e,n),a},r.prototype.applyMerges=function(e,t,n,i,a){var s,o=this;if(e.map.size&&!Fn(n)){var l=!ii(n)&&(Fn(t)||_u(t))?t:void 0,u=n;l&&!a&&(a=[Fn(l)?l.__ref:l]);var c,h=function(f,d){return ii(f)?typeof d=="number"?f[d]:void 0:i.store.getFieldValue(f,String(d))};e.map.forEach(function(f,d){var g=h(l,d),v=h(u,d);if(v!==void 0){a&&a.push(d);var y=o.applyMerges(f,g,v,i,a);y!==v&&(c=c||new Map,c.set(d,y)),a&&Mr(a.pop()===d)}}),c&&(n=ii(u)?u.slice(0):me({},u),c.forEach(function(f,d){n[d]=f}))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,i,a&&(s=i.store).getStorage.apply(s,a)):n},r})(),Rk=[];function Ww(r,e){var t=r.map;return t.has(e)||t.set(e,Rk.pop()||{map:new Map}),t.get(e)}function xy(r,e){if(r===e||!e||og(e))return r;if(!r||og(r))return e;var t=r.info&&e.info?me(me({},r.info),e.info):r.info||e.info,n=r.map.size&&e.map.size,i=n?new Map:r.map.size?r.map:e.map,a={info:t,map:i};if(n){var s=new Set(e.map.keys());r.map.forEach(function(o,l){a.map.set(l,xy(o,e.map.get(l))),s.delete(l)}),s.forEach(function(o){a.map.set(o,xy(e.map.get(o),r.map.get(o)))})}return a}function og(r){return!r||!(r.info||r.map.size)}function Qw(r,e){var t=r.map,n=t.get(e);n&&og(n)&&(Rk.push(n),t.delete(e))}var s4=(function(r){va(e,r);function e(t){t===void 0&&(t={});var n=r.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new tk(ik),n.assumeImmutableResults=!0,n.makeVar=t4,n.txCount=0,n.config=WO(t),n.addTypename=!!n.config.addTypename,n.policies=new i4({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return e.prototype.init=function(){var t=this.data=new Ad.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()},e.prototype.resetResultCache=function(t){var n=this,i=this.storeReader,a=this.config.fragments;this.addTypenameTransform.resetCache(),a?.resetCaches(),this.storeWriter=new a4(this,this.storeReader=new KO({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:Sk(this.config),canon:t?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=Zu(function(s,o){return n.broadcastWatch(s,o)},{max:this.config.resultCacheMaxSize||Us["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(s){var o=s.optimistic?n.optimisticData:n.data;if(td(o)){var l=s.optimistic,u=s.id,c=s.variables;return o.makeCacheKey(s.query,s.callback,vo({optimistic:l,id:u,variables:c}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(s){return s.resetCaching()})},e.prototype.restore=function(t){return this.init(),t&&this.data.replace(t),this},e.prototype.extract=function(t){return t===void 0&&(t=!1),(t?this.optimisticData:this.data).extract()},e.prototype.read=function(t){var n=t.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(me(me({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof wk)return null;throw a}},e.prototype.write=function(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.modify=function(t){if(mi.call(t,"id")&&!t.id)return!1;var n=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(t.id||"ROOT_QUERY",t.fields)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.diff=function(t){return this.storeReader.diffQueryAgainstStore(me(me({},t),{store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(t){var n=this;return this.watches.size||e4(this),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),function(){n.watches.delete(t)&&!n.watches.size&&Uw(n),n.maybeBroadcastWatch.forget(t)}},e.prototype.gc=function(t){vo.reset(),bl.reset();var n=this.optimisticData.gc();return t&&!this.txCount&&(t.resetResultCache?this.resetResultCache(t.resetResultIdentities):t.resetResultIdentities&&this.storeReader.resetCanon()),n},e.prototype.retain=function(t,n){return(n?this.optimisticData:this.data).retain(t)},e.prototype.release=function(t,n){return(n?this.optimisticData:this.data).release(t)},e.prototype.identify=function(t){if(Fn(t))return t.__ref;try{return this.policies.identify(t)[0]}catch{}},e.prototype.evict=function(t){if(!t.id){if(mi.call(t,"id"))return!1;t=me(me({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{!--this.txCount&&t.broadcast!==!1&&this.broadcastWatches()}},e.prototype.reset=function(t){var n=this;return this.init(),vo.reset(),t&&t.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),Uw(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(t){var n=this.optimisticData.removeLayer(t);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},e.prototype.batch=function(t){var n=this,i=t.update,a=t.optimistic,s=a===void 0?!0:a,o=t.removeOptimistic,l=t.onWatchUpdated,u,c=function(f){var d=n,g=d.data,v=d.optimisticData;++n.txCount,f&&(n.data=n.optimisticData=f);try{return u=i(n)}finally{--n.txCount,n.data=g,n.optimisticData=v}},h=new Set;return l&&!this.txCount&&this.broadcastWatches(me(me({},t),{onWatchUpdated:function(f){return h.add(f),!1}})),typeof s=="string"?this.optimisticData=this.optimisticData.addLayer(s,c):s===!1?c(this.data):c(),typeof o=="string"&&(this.optimisticData=this.optimisticData.removeLayer(o)),l&&h.size?(this.broadcastWatches(me(me({},t),{onWatchUpdated:function(f,d){var g=l.call(this,f,d);return g!==!1&&h.delete(f),g}})),h.size&&h.forEach(function(f){return n.maybeBroadcastWatch.dirty(f)})):this.broadcastWatches(t),u},e.prototype.performTransaction=function(t,n){return this.batch({update:t,optimistic:n||n!==null})},e.prototype.transformDocument=function(t){return this.addTypenameToDocument(this.addFragmentsToDocument(t))},e.prototype.fragmentMatches=function(t,n){return this.policies.fragmentMatches(t,n)},e.prototype.lookupFragment=function(t){var n;return((n=this.config.fragments)===null||n===void 0?void 0:n.lookup(t))||null},e.prototype.broadcastWatches=function(t){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,t)})},e.prototype.addFragmentsToDocument=function(t){var n=this.config.fragments;return n?n.transform(t):t},e.prototype.addTypenameToDocument=function(t){return this.addTypename?this.addTypenameTransform.transformDocument(t):t},e.prototype.broadcastWatch=function(t,n){var i=this,a=t.lastDiff,s=Pi("canonizeResults",function(){return i.diff(t)});n&&(t.optimistic&&typeof n.optimistic=="string"&&(s.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,t,s,a)===!1)||(!a||!Pn(a.result,s.result))&&t.callback(t.lastDiff=s,a)},e})(qO),Jr;(function(r){r[r.loading=1]="loading",r[r.setVariables=2]="setVariables",r[r.fetchMore=3]="fetchMore",r[r.refetch=4]="refetch",r[r.poll=6]="poll",r[r.ready=7]="ready",r[r.error=8]="error"})(Jr||(Jr={}));function Nu(r){return r?r<7:!1}var Yw=Object.assign,qp=(function(r){va(e,r);function e(t){var n=t.queryManager,i=t.queryInfo,a=t.options,s=this,o=e.inactiveOnCreation.getValue();s=r.call(this,function(A){s._getOrCreateQuery();try{var C=A._subscription._observer;C&&!C.error&&(C.error=o4)}catch{}var k=!s.observers.size;s.observers.add(A);var T=s.last;return T&&T.error?A.error&&A.error(T.error):T&&T.result&&A.next&&A.next(s.maskResult(T.result)),k&&s.reobserve().catch(function(){}),function(){s.observers.delete(A)&&!s.observers.size&&s.tearDownQuery()}})||this,s.observers=new Set,s.subscriptions=new Set,s.dirty=!1,s._getOrCreateQuery=function(){return o&&(n.queries.set(s.queryId,i),o=!1),s.queryManager.getOrCreateQuery(s.queryId)},s.queryInfo=i,s.queryManager=n,s.waitForOwnResult=p0(a.fetchPolicy),s.isTornDown=!1,s.subscribeToMore=s.subscribeToMore.bind(s),s.maskResult=s.maskResult.bind(s);var l=n.defaultOptions.watchQuery,u=l===void 0?{}:l,c=u.fetchPolicy,h=c===void 0?"cache-first":c,f=a.fetchPolicy,d=f===void 0?h:f,g=a.initialFetchPolicy,v=g===void 0?d==="standby"?h:d:g;s.options=me(me({},a),{initialFetchPolicy:v,fetchPolicy:d}),s.queryId=i.queryId||n.generateQueryId();var y=vc(s.query);return s.queryName=y&&y.name&&y.name.value,s}return Object.defineProperty(e.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),e.prototype.result=function(){var t=this;return new Promise(function(n,i){var a={next:function(o){n(o),t.observers.delete(a),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout(function(){s.unsubscribe()},0)},error:i},s=t.subscribe(a)})},e.prototype.resetDiff=function(){this.queryInfo.resetDiff()},e.prototype.getCurrentFullResult=function(t){var n=this;t===void 0&&(t=!0);var i=Pi("getLastResult",function(){return n.getLastResult(!0)}),a=this.queryInfo.networkStatus||i&&i.networkStatus||Jr.ready,s=me(me({},i),{loading:Nu(a),networkStatus:a}),o=this.options.fetchPolicy,l=o===void 0?"cache-first":o;if(!(p0(l)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var u=this.queryInfo.getDiff();(u.complete||this.options.returnPartialData)&&(s.data=u.result),Pn(s.data,{})&&(s.data=void 0),u.complete?(delete s.partial,u.complete&&s.networkStatus===Jr.loading&&(l==="cache-first"||l==="cache-only")&&(s.networkStatus=Jr.ready,s.loading=!1)):s.partial=!0,s.networkStatus===Jr.ready&&(s.error||s.errors)&&(s.networkStatus=Jr.error)}return t&&this.updateLastResult(s),s},e.prototype.getCurrentResult=function(t){return t===void 0&&(t=!0),this.maskResult(this.getCurrentFullResult(t))},e.prototype.isDifferentFromLastResult=function(t,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query),a=this.queryManager.dataMasking,s=a?i.nonReactiveQuery:this.query,o=a||i.hasNonreactiveDirective?!gk(s,this.last.result,t,this.variables):!Pn(this.last.result,t);return o||n&&!Pn(this.last.variables,n)},e.prototype.getLast=function(t,n){var i=this.last;if(i&&i[t]&&(!n||Pn(i.variables,this.variables)))return i[t]},e.prototype.getLastResult=function(t){return this.getLast("result",t)},e.prototype.getLastError=function(t){return this.getLast("error",t)},e.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},e.prototype.refetch=function(t){var n={pollInterval:0},i=this.options.fetchPolicy;return i==="no-cache"?n.fetchPolicy="no-cache":n.fetchPolicy="network-only",t&&!Pn(this.options.variables,t)&&(n.variables=this.options.variables=me(me({},this.options.variables),t)),this.queryInfo.resetLastWrite(),this.reobserve(n,Jr.refetch)},e.prototype.fetchMore=function(t){var n=this,i=me(me({},t.query?t:me(me(me(me({},this.options),{query:this.options.query}),t),{variables:me(me({},this.options.variables),t.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var a=this.queryManager.generateQueryId();this.lastQuery=t.query?this.transformDocument(this.options.query):i.query;var s=this.queryInfo,o=s.networkStatus;s.networkStatus=Jr.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var l=new Set,u=t?.updateQuery,c=this.options.fetchPolicy!=="no-cache";return c||Mr(u,29),this.queryManager.fetchQuery(a,i,Jr.fetchMore).then(function(h){if(n.queryManager.removeQuery(a),s.networkStatus===Jr.fetchMore&&(s.networkStatus=o),c)n.queryManager.cache.batch({update:function(g){var v=t.updateQuery;v?g.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(y){return v(y,{fetchMoreResult:h.data,variables:i.variables})}):g.writeQuery({query:i.query,variables:i.variables,data:h.data})},onWatchUpdated:function(g){l.add(g.query)}});else{var f=n.getLast("result"),d=u(f.data,{fetchMoreResult:h.data,variables:i.variables});n.reportResult(me(me({},f),{networkStatus:o,loading:Nu(o),data:d}),n.variables)}return n.maskResult(h)}).finally(function(){c&&!l.has(n.query)&&n.reobserveCacheFirst()})},e.prototype.subscribeToMore=function(t){var n=this,i=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables,context:t.context}).subscribe({next:function(a){var s=t.updateQuery;s&&n.updateQuery(function(o,l){return s(o,me({subscriptionData:a},l))})},error:function(a){if(t.onError){t.onError(a);return}}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},e.prototype.setOptions=function(t){return this.reobserve(t)},e.prototype.silentSetOptions=function(t){var n=tc(this.options,t||{});Yw(this.options,n)},e.prototype.setVariables=function(t){var n=this;return Pn(this.variables,t)?this.observers.size?Pi("observableQuery.result",function(){return n.result()}):Promise.resolve():(this.options.variables=t,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:t},Jr.setVariables):Promise.resolve())},e.prototype.updateQuery=function(t){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}),a=i.result,s=i.complete,o=t(a,{variables:this.variables,complete:!!s,previousData:a});o&&(n.cache.writeQuery({query:this.options.query,data:o,variables:this.variables}),n.broadcastQueries())},e.prototype.startPolling=function(t){this.options.pollInterval=t,this.updatePolling()},e.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},e.prototype.applyNextFetchPolicy=function(t,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,s=n.initialFetchPolicy,o=s===void 0?a:s;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:t,options:n,observable:this,initialFetchPolicy:o}):t==="variables-changed"?n.fetchPolicy=o:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},e.prototype.fetch=function(t,n,i){var a=this._getOrCreateQuery();return a.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(a,t,n,i)},e.prototype.updatePolling=function(){var t=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){Mr(a,32);var s=i||(this.pollingInfo={});s.interval=a;var o=function(){var u,c;t.pollingInfo&&(!Nu(t.queryInfo.networkStatus)&&!(!((c=(u=t.options).skipPollAttempt)===null||c===void 0)&&c.call(u))?t.reobserve({fetchPolicy:t.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},Jr.poll).then(l,l):l())},l=function(){var u=t.pollingInfo;u&&(clearTimeout(u.timeout),u.timeout=setTimeout(o,u.interval))};l()}}},e.prototype.updateLastResult=function(t,n){var i=this;n===void 0&&(n=this.variables);var a=Pi("getLastError",function(){return i.getLastError()});return a&&this.last&&!Pn(n,this.last.variables)&&(a=void 0),this.last=me({result:this.queryManager.assumeImmutableResults?t:nO(t),variables:n},a?{error:a}:null)},e.prototype.reobserveAsConcast=function(t,n){var i=this;this.isTornDown=!1;var a=n===Jr.refetch||n===Jr.fetchMore||n===Jr.poll,s=this.options.variables,o=this.options.fetchPolicy,l=tc(this.options,t||{}),u=a?l:Yw(this.options,l),c=this.transformDocument(u.query);this.lastQuery=c,a||(this.updatePolling(),t&&t.variables&&!Pn(t.variables,s)&&u.fetchPolicy!=="standby"&&(u.fetchPolicy===o||typeof u.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",u),n===void 0&&(n=Jr.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=p0(u.fetchPolicy));var h=function(){i.concast===g&&(i.waitForOwnResult=!1)},f=u.variables&&me({},u.variables),d=this.fetch(u,n,c),g=d.concast,v=d.fromLink,y={next:function(A){Pn(i.variables,f)&&(h(),i.reportResult(A,f))},error:function(A){Pn(i.variables,f)&&(dk(A)||(A=new oo({networkError:A})),h(),i.reportError(A,f))}};return!a&&(v||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=g,this.observer=y),g.addObserver(y),g},e.prototype.reobserve=function(t,n){return tO(this.reobserveAsConcast(t,n).promise.then(this.maskResult))},e.prototype.resubscribeAfterError=function(){for(var t=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=this.last;Pi("resetLastResults",function(){return t.resetLastResults()});var s=this.subscribe.apply(this,n);return this.last=a,s},e.prototype.observe=function(){this.reportResult(this.getCurrentFullResult(!1),this.variables)},e.prototype.reportResult=function(t,n){var i=this,a=Pi("getLastError",function(){return i.getLastError()}),s=this.isDifferentFromLastResult(t,n);(a||!t.partial||this.options.returnPartialData)&&this.updateLastResult(t,n),(a||s)&&ed(this.observers,"next",this.maskResult(t))},e.prototype.reportError=function(t,n){var i=this,a=me(me({},Pi("getLastResult",function(){return i.getLastResult()})),{error:t,errors:t.graphQLErrors,networkStatus:Jr.error,loading:!1});this.updateLastResult(a,n),ed(this.observers,"error",this.last.error=t)},e.prototype.hasObservers=function(){return this.observers.size>0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(t){return t.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e.prototype.transformDocument=function(t){return this.queryManager.transform(t)},e.prototype.maskResult=function(t){return t&&"data"in t?me(me({},t),{data:this.queryManager.maskOperation({document:this.query,data:t.data,fetchPolicy:this.options.fetchPolicy,id:this.queryId})}):t},e.prototype.resetNotifications=function(){this.cancelNotifyTimeout(),this.dirty=!1},e.prototype.cancelNotifyTimeout=function(){this.notifyTimeout&&(clearTimeout(this.notifyTimeout),this.notifyTimeout=void 0)},e.prototype.scheduleNotify=function(){var t=this;this.dirty||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return t.notify()},0)))},e.prototype.notify=function(){if(this.cancelNotifyTimeout(),this.dirty&&(this.options.fetchPolicy=="cache-only"||this.options.fetchPolicy=="cache-and-network"||!Nu(this.queryInfo.networkStatus))){var t=this.queryInfo.getDiff();t.fromOptimisticTransaction?this.observe():this.reobserveCacheFirst()}this.dirty=!1},e.prototype.reobserveCacheFirst=function(){var t=this.options,n=t.fetchPolicy,i=t.nextFetchPolicy;return n==="cache-and-network"||n==="network-only"?this.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(a,s){return this.nextFetchPolicy=i,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(a,s):n}}):this.reobserve()},e.inactiveOnCreation=new Ac,e})(an);uk(qp);function o4(r){}function p0(r){return r==="network-only"||r==="no-cache"||r==="standby"}var Lu=new(Pl?WeakMap:Map);function g0(r,e){var t=r[e];typeof t=="function"&&(r[e]=function(){return Lu.set(r,(Lu.get(r)+1)%1e15),t.apply(this,arguments)})}var m0=(function(){function r(e,t){t===void 0&&(t=e.generateQueryId()),this.queryId=t,this.document=null,this.lastRequestId=1,this.stopped=!1,this.observableQuery=null;var n=this.cache=e.cache;Lu.has(n)||(Lu.set(n,0),g0(n,"evict"),g0(n,"modify"),g0(n,"reset"))}return r.prototype.init=function(e){var t=e.networkStatus||Jr.loading;return this.variables&&this.networkStatus!==Jr.loading&&!Pn(this.variables,e.variables)&&(t=Jr.setVariables),Pn(e.variables,this.variables)||(this.lastDiff=void 0,this.cancel()),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},r.prototype.resetDiff=function(){this.lastDiff=void 0},r.prototype.getDiff=function(){var e=this,t=this.getDiffOptions();if(this.lastDiff&&Pn(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var n=this.observableQuery;if(n&&n.options.fetchPolicy==="no-cache")return{complete:!1};var i=Pi("canonizeResults",function(){return e.cache.diff(t)});return this.updateLastDiff(i,t),i},r.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},r.prototype.getDiffOptions=function(e){var t;return e===void 0&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:(t=this.observableQuery)===null||t===void 0?void 0:t.options.canonizeResults}},r.prototype.setDiff=function(e){var t=this,n,i=this.lastDiff&&this.lastDiff.diff;e&&!e.complete&&Pi("getLastError",function(){var a;return(a=t.observableQuery)===null||a===void 0?void 0:a.getLastError()})||(this.updateLastDiff(e),Pn(i&&i.result,e&&e.result)||(n=this.observableQuery)===null||n===void 0||n.scheduleNotify())},r.prototype.setObservableQuery=function(e){e!==this.observableQuery&&(this.observableQuery=e,e&&(e.queryInfo=this))},r.prototype.stop=function(){var e;if(!this.stopped){this.stopped=!0,(e=this.observableQuery)===null||e===void 0||e.resetNotifications(),this.cancel();var t=this.observableQuery;t&&t.stopPolling()}},r.prototype.cancel=function(){var e;(e=this.cancelWatch)===null||e===void 0||e.call(this),this.cancelWatch=void 0},r.prototype.updateWatch=function(e){var t=this;e===void 0&&(e=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=me(me({},this.getDiffOptions(e)),{watcher:this,callback:function(a){return t.setDiff(a)}});(!this.lastWatch||!Pn(i,this.lastWatch))&&(this.cancel(),this.cancelWatch=this.cache.watch(this.lastWatch=i))}},r.prototype.resetLastWrite=function(){this.lastWrite=void 0},r.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Lu.get(this.cache)&&Pn(t,n.variables)&&Pn(e.data,n.result.data))},r.prototype.markResult=function(e,t,n,i){var a=this,s,o=new So,l=us(e.errors)?e.errors.slice(0):[];if((s=this.observableQuery)===null||s===void 0||s.resetNotifications(),"incremental"in e&&us(e.incremental)){var u=ck(this.getDiff().result,e);e.data=u}else if("hasNext"in e&&e.hasNext){var c=this.getDiff();e.data=o.merge(c.result,e.data)}this.graphQLErrors=l,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(Sy(e,n.errorPolicy)?this.cache.performTransaction(function(h){if(a.shouldWrite(e,n.variables))h.writeQuery({query:t,data:e.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:e,variables:n.variables,dmCount:Lu.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){e.data=a.lastDiff.diff.result;return}var f=a.getDiffOptions(n.variables),d=Pi("canonizeResults",function(){return h.diff(f)});!a.stopped&&Pn(a.variables,n.variables)&&a.updateWatch(n.variables),a.updateLastDiff(d,f),d.complete&&(e.data=d.result)}):this.lastWrite=void 0)},r.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Jr.ready},r.prototype.markError=function(e){var t;return this.networkStatus=Jr.error,this.lastWrite=void 0,(t=this.observableQuery)===null||t===void 0||t.resetNotifications(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},r})();function Sy(r,e){e===void 0&&(e="none");var t=e==="ignore"||e==="all",n=!jp(r);return!n&&t&&r.data&&(n=!0),n}var l4=Object.prototype.hasOwnProperty,Xw=Object.create(null),u4=(function(){function r(e){var t=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new H2(Us["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Vs(!1),this.noCacheWarningsByQueryId=new Set;var n=new tk(function(a){return t.cache.transformDocument(a)},{cache:!1});this.cache=e.cache,this.link=e.link,this.defaultOptions=e.defaultOptions,this.queryDeduplication=e.queryDeduplication,this.clientAwareness=e.clientAwareness,this.localState=e.localState,this.ssrMode=e.ssrMode,this.assumeImmutableResults=e.assumeImmutableResults,this.dataMasking=e.dataMasking;var i=e.documentTransform;this.documentTransform=i?n.concat(i).concat(n):n,this.defaultContext=e.defaultContext||Object.create(null),(this.onBroadcast=e.onBroadcast)&&(this.mutationStore=Object.create(null))}return r.prototype.stop=function(){var e=this;this.queries.forEach(function(t,n){e.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(qi(35))},r.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach(function(t){return t(e)}),this.fetchCancelFns.clear()},r.prototype.mutate=function(e){return rs(this,arguments,void 0,function(t){var n,i,a,s,o,l,u,c=t.mutation,h=t.variables,f=t.optimisticResponse,d=t.updateQueries,g=t.refetchQueries,v=g===void 0?[]:g,y=t.awaitRefetchQueries,A=y===void 0?!1:y,C=t.update,k=t.onQueryUpdated,T=t.fetchPolicy,S=T===void 0?((l=this.defaultOptions.mutate)===null||l===void 0?void 0:l.fetchPolicy)||"network-only":T,R=t.errorPolicy,B=R===void 0?((u=this.defaultOptions.mutate)===null||u===void 0?void 0:u.errorPolicy)||"none":R,G=t.keepRootFields,$=t.context;return ns(this,function(Y){switch(Y.label){case 0:return Mr(c,36),Mr(S==="network-only"||S==="no-cache",37),n=this.generateMutationId(),c=this.cache.transformForLink(this.transform(c)),i=this.getDocumentInfo(c).hasClientExports,h=this.getVariables(c,h),i?[4,this.localState.addExportedVariables(c,h,$)]:[3,2];case 1:h=Y.sent(),Y.label=2;case 2:return a=this.mutationStore&&(this.mutationStore[n]={mutation:c,variables:h,loading:!0,error:null}),s=f&&this.markMutationOptimistic(f,{mutationId:n,document:c,variables:h,fetchPolicy:S,errorPolicy:B,context:$,updateQueries:d,update:C,keepRootFields:G}),this.broadcastQueries(),o=this,[2,new Promise(function(X,J){return o0(o.getObservableFromLink(c,me(me({},$),{optimisticResponse:s?f:void 0}),h,{},!1),function(Q){if(jp(Q)&&B==="none")throw new oo({graphQLErrors:gy(Q)});a&&(a.loading=!1,a.error=null);var oe=me({},Q);return typeof v=="function"&&(v=v(oe)),B==="ignore"&&jp(oe)&&delete oe.errors,o.markMutationResult({mutationId:n,result:oe,document:c,variables:h,fetchPolicy:S,errorPolicy:B,context:$,update:C,updateQueries:d,awaitRefetchQueries:A,refetchQueries:v,removeOptimistic:s?n:void 0,onQueryUpdated:k,keepRootFields:G})}).subscribe({next:function(Q){o.broadcastQueries(),(!("hasNext"in Q)||Q.hasNext===!1)&&X(me(me({},Q),{data:o.maskOperation({document:c,data:Q.data,fetchPolicy:S,id:n})}))},error:function(Q){a&&(a.loading=!1,a.error=Q),s&&o.cache.removeOptimistic(n),o.broadcastQueries(),J(Q instanceof oo?Q:new oo({networkError:Q}))}})})]}})})},r.prototype.markMutationResult=function(e,t){var n=this;t===void 0&&(t=this.cache);var i=e.result,a=[],s=e.fetchPolicy==="no-cache";if(!s&&Sy(i,e.errorPolicy)){if(Gu(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}),Gu(i)&&us(i.incremental)){var o=t.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0}),l=void 0;o.result&&(l=ck(o.result,i)),typeof l<"u"&&(i.data=l,a.push({result:l,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}))}var u=e.updateQueries;u&&this.queries.forEach(function(h,f){var d=h.observableQuery,g=d&&d.queryName;if(!(!g||!l4.call(u,g))){var v=u[g],y=n.queries.get(f),A=y.document,C=y.variables,k=t.diff({query:A,variables:C,returnPartialData:!0,optimistic:!1}),T=k.result,S=k.complete;if(S&&T){var R=v(T,{mutationResult:i,queryName:A&&zp(A)||void 0,queryVariables:C});R&&a.push({result:R,dataId:"ROOT_QUERY",query:A,variables:C})}}})}if(a.length>0||(e.refetchQueries||"").length>0||e.update||e.onQueryUpdated||e.removeOptimistic){var c=[];if(this.refetchQueries({updateCache:function(h){s||a.forEach(function(v){return h.write(v)});var f=e.update,d=!aO(i)||Gu(i)&&!i.hasNext;if(f){if(!s){var g=h.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});g.complete&&(i=me(me({},i),{data:g.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}d&&f(h,i,{context:e.context,variables:e.variables})}!s&&!e.keepRootFields&&d&&h.modify({id:"ROOT_MUTATION",fields:function(v,y){var A=y.fieldName,C=y.DELETE;return A==="__typename"?v:C}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach(function(h){return c.push(h)}),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(c).then(function(){return i})}return Promise.resolve(i)},r.prototype.markMutationOptimistic=function(e,t){var n=this,i=typeof e=="function"?e(t.variables,{IGNORE:Xw}):e;return i===Xw?!1:(this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(me(me({},t),{result:{data:i}}),a)}catch{}},t.mutationId),!0)},r.prototype.fetchQuery=function(e,t,n){return this.fetchConcastWithInfo(this.getOrCreateQuery(e),t,n).concast.promise},r.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach(function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}}),e},r.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},r.prototype.transform=function(e){return this.documentTransform.transformDocument(e)},r.prototype.getDocumentInfo=function(e){var t=this.transformCache;if(!t.has(e)){var n={hasClientExports:QP(e),hasForcedResolvers:this.localState.shouldForceResolvers(e),hasNonreactiveDirective:md(["nonreactive"],e),nonReactiveQuery:GR(e),clientQuery:this.localState.clientQuery(e),serverQuery:nk([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"},{name:"unmask"}],e),defaultVars:TA(vc(e)),asQuery:me(me({},e),{definitions:e.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?me(me({},i),{operation:"query"}):i})})};t.set(e,n)}return t.get(e)},r.prototype.getVariables=function(e,t){return me(me({},this.getDocumentInfo(e).defaultVars),t)},r.prototype.watchQuery=function(e){var t=this.transform(e.query);e=me(me({},e),{variables:this.getVariables(t,e.variables)}),typeof e.notifyOnNetworkStatusChange>"u"&&(e.notifyOnNetworkStatusChange=!1);var n=new m0(this),i=new qp({queryManager:this,queryInfo:n,options:e});return i.lastQuery=t,qp.inactiveOnCreation.getValue()||this.queries.set(i.queryId,n),n.init({document:t,observableQuery:i,variables:i.variables}),i},r.prototype.query=function(e,t){var n=this;t===void 0&&(t=this.generateQueryId()),Mr(e.query,38),Mr(e.query.kind==="Document",39),Mr(!e.returnPartialData,40),Mr(!e.pollInterval,41);var i=this.transform(e.query);return this.fetchQuery(t,me(me({},e),{query:i})).then(function(a){return a&&me(me({},a),{data:n.maskOperation({document:i,data:a.data,fetchPolicy:e.fetchPolicy,id:t})})}).finally(function(){return n.stopQuery(t)})},r.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},r.prototype.generateRequestId=function(){return this.requestIdCounter++},r.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},r.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},r.prototype.clearStore=function(e){return e===void 0&&(e={discardWatches:!0}),this.cancelPendingFetches(qi(42)),this.queries.forEach(function(t){t.observableQuery?t.networkStatus=Jr.loading:t.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},r.prototype.getObservableQueries=function(e){var t=this;e===void 0&&(e="active");var n=new Map,i=new Map,a=new Map,s=new Set;return Array.isArray(e)&&e.forEach(function(o){if(typeof o=="string")i.set(o,o),a.set(o,!1);else if(pR(o)){var l=bl(t.transform(o));i.set(l,zp(o)),a.set(l,!1)}else fi(o)&&o.query&&s.add(o)}),this.queries.forEach(function(o,l){var u=o.observableQuery,c=o.document;if(u){if(e==="all"){n.set(l,u);return}var h=u.queryName,f=u.options.fetchPolicy;if(f==="standby"||e==="active"&&!u.hasObservers())return;(e==="active"||h&&a.has(h)||c&&a.has(bl(c)))&&(n.set(l,u),h&&a.set(h,!0),c&&a.set(bl(c),!0))}}),s.size&&s.forEach(function(o){var l=ay("legacyOneTimeQuery"),u=t.getOrCreateQuery(l).init({document:o.query,variables:o.variables}),c=new qp({queryManager:t,queryInfo:u,options:me(me({},o),{fetchPolicy:"network-only"})});Mr(c.queryId===l),u.setObservableQuery(c),n.set(l,c)}),n},r.prototype.reFetchObservableQueries=function(e){var t=this;e===void 0&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach(function(i,a){var s=i.options.fetchPolicy;Pi("resetLastResults",function(){return i.resetLastResults()}),(e||s!=="standby"&&s!=="cache-only")&&n.push(i.refetch()),(t.queries.get(a)||i.queryInfo).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},r.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,i=e.variables,a=e.fetchPolicy,s=e.errorPolicy,o=s===void 0?"none":s,l=e.context,u=l===void 0?{}:l,c=e.extensions,h=c===void 0?{}:c;n=this.transform(n),i=this.getVariables(n,i);var f=function(g){return t.getObservableFromLink(n,u,g,h).map(function(v){a!=="no-cache"&&(Sy(v,o)&&t.cache.write({query:n,result:v.data,dataId:"ROOT_SUBSCRIPTION",variables:g}),t.broadcastQueries());var y=jp(v),A=NA(v);if(y||A){var C={};if(y&&(C.graphQLErrors=v.errors),A&&(C.protocolErrors=v.extensions[jd]),o==="none"||A)throw new oo(C)}return o==="ignore"&&delete v.errors,v})};if(this.getDocumentInfo(n).hasClientExports){var d=this.localState.addExportedVariables(n,i,u).then(f);return new an(function(g){var v=null;return d.then(function(y){return v=y.subscribe(g)},g.error),function(){return v&&v.unsubscribe()}})}return f(i)},r.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},r.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},r.prototype.removeQuery=function(e){var t;this.fetchCancelFns.delete(e),this.queries.has(e)&&((t=this.queries.get(e))===null||t===void 0||t.stop(),this.queries.delete(e))},r.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(e){var t;return(t=e.observableQuery)===null||t===void 0?void 0:t.notify()})},r.prototype.getLocalState=function(){return this.localState},r.prototype.getObservableFromLink=function(e,t,n,i,a){var s=this,o;a===void 0&&(a=(o=t?.queryDeduplication)!==null&&o!==void 0?o:this.queryDeduplication);var l,u=this.getDocumentInfo(e),c=u.serverQuery,h=u.clientQuery;if(c){var f=this,d=f.inFlightLinkObservables,g=f.link,v={query:c,variables:n,operationName:zp(c)||void 0,context:this.prepareContext(me(me({},t),{forceFetch:!a})),extensions:i};if(t=v.context,a){var y=bl(c),A=vo(n),C=d.lookup(y,A);if(l=C.observable,!l){var k=new Ou([vy(g,v)]);l=C.observable=k,k.beforeNext(function T(S,R){S==="next"&&"hasNext"in R&&R.hasNext?k.beforeNext(T):d.remove(y,A)})}}else l=new Ou([vy(g,v)])}else l=new Ou([an.of({data:{}})]),t=this.prepareContext(t);return h&&(l=o0(l,function(T){return s.localState.runResolvers({document:h,remoteResult:T,context:t,variables:n})})),l},r.prototype.getResultsFromLink=function(e,t,n){var i=e.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(n.query);return o0(this.getObservableFromLink(a,n.context,n.variables),function(s){var o=gy(s),l=o.length>0,u=n.errorPolicy;if(i>=e.lastRequestId){if(l&&u==="none")throw e.markError(new oo({graphQLErrors:o}));e.markResult(s,a,n,t),e.markReady()}var c={data:s.data,loading:!1,networkStatus:Jr.ready};return l&&u==="none"&&(c.data=void 0),l&&u!=="ignore"&&(c.errors=o,c.networkStatus=Jr.error),c},function(s){var o=dk(s)?s:new oo({networkError:s});throw i>=e.lastRequestId&&e.markError(o),o})},r.prototype.fetchConcastWithInfo=function(e,t,n,i){var a=this;n===void 0&&(n=Jr.loading),i===void 0&&(i=t.query);var s=this.getVariables(i,t.variables),o=this.defaultOptions.watchQuery,l=t.fetchPolicy,u=l===void 0?o&&o.fetchPolicy||"cache-first":l,c=t.errorPolicy,h=c===void 0?o&&o.errorPolicy||"none":c,f=t.returnPartialData,d=f===void 0?!1:f,g=t.notifyOnNetworkStatusChange,v=g===void 0?!1:g,y=t.context,A=y===void 0?{}:y,C=Object.assign({},t,{query:i,variables:s,fetchPolicy:u,errorPolicy:h,returnPartialData:d,notifyOnNetworkStatusChange:v,context:A}),k=function(G){C.variables=G;var $=a.fetchQueryByPolicy(e,C,n);return C.fetchPolicy!=="standby"&&$.sources.length>0&&e.observableQuery&&e.observableQuery.applyNextFetchPolicy("after-fetch",t),$},T=function(){return a.fetchCancelFns.delete(e.queryId)};this.fetchCancelFns.set(e.queryId,function(G){T(),setTimeout(function(){return S.cancel(G)})});var S,R;if(this.getDocumentInfo(C.query).hasClientExports)S=new Ou(this.localState.addExportedVariables(C.query,C.variables,C.context).then(k).then(function(G){return G.sources})),R=!0;else{var B=k(C.variables);R=B.fromLink,S=new Ou(B.sources)}return S.promise.then(T,T),{concast:S,fromLink:R}},r.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,i=e.include,a=e.optimistic,s=a===void 0?!1:a,o=e.removeOptimistic,l=o===void 0?s?ay("refetchQueries"):void 0:o,u=e.onQueryUpdated,c=new Map;i&&this.getObservableQueries(i).forEach(function(f,d){c.set(d,{oq:f,lastDiff:(t.queries.get(d)||f.queryInfo).getDiff()})});var h=new Map;return n&&this.cache.batch({update:n,optimistic:s&&l||!1,removeOptimistic:l,onWatchUpdated:function(f,d,g){var v=f.watcher instanceof m0&&f.watcher.observableQuery;if(v){if(u){c.delete(v.queryId);var y=u(v,d,g);return y===!0&&(y=v.refetch()),y!==!1&&h.set(v,y),y}u!==null&&c.set(v.queryId,{oq:v,lastDiff:g,diff:d})}}}),c.size&&c.forEach(function(f,d){var g=f.oq,v=f.lastDiff,y=f.diff,A;u&&(y||(y=Pi("canonizeResults",function(){return t.cache.diff(g.queryInfo.getDiffOptions())})),A=u(g,y,v)),(!u||A===!0)&&(A=g.refetch()),A!==!1&&h.set(g,A),d.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(d)}),l&&this.cache.removeOptimistic(l),h},r.prototype.maskOperation=function(e){var t=e.document,n=e.data;return this.dataMasking?$O(n,t,this.cache):n},r.prototype.maskFragment=function(e){var t=e.data,n=e.fragment,i=e.fragmentName;return this.dataMasking?bk(t,n,this.cache,i):t},r.prototype.fetchQueryByPolicy=function(e,t,n){var i=this,a=t.query,s=t.variables,o=t.fetchPolicy,l=t.refetchWritePolicy,u=t.errorPolicy,c=t.returnPartialData,h=t.context,f=t.notifyOnNetworkStatusChange,d=e.networkStatus;e.init({document:a,variables:s,networkStatus:n});var g=function(){return e.getDiff()},v=function(T,S){S===void 0&&(S=e.networkStatus||Jr.loading);var R=T.result,B=function(G){return an.of(me({data:G,loading:Nu(S),networkStatus:S},T.complete?null:{partial:!0}))};return R&&i.getDocumentInfo(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:R},context:h,variables:s,onlyRunForcedResolvers:!0}).then(function(G){return B(G.data||void 0)}):u==="none"&&S===Jr.refetch&&Array.isArray(T.missing)?B(void 0):B(R)},y=o==="no-cache"?0:n===Jr.refetch&&l!=="merge"?1:2,A=function(){return i.getResultsFromLink(e,y,{query:a,variables:s,context:h,fetchPolicy:o,errorPolicy:u})},C=f&&typeof d=="number"&&d!==n&&Nu(n);switch(o){default:case"cache-first":{var k=g();return k.complete?{fromLink:!1,sources:[v(k,e.markReady())]}:c||C?{fromLink:!0,sources:[v(k),A()]}:{fromLink:!0,sources:[A()]}}case"cache-and-network":{var k=g();return k.complete||c||C?{fromLink:!0,sources:[v(k),A()]}:{fromLink:!0,sources:[A()]}}case"cache-only":return{fromLink:!1,sources:[v(g(),e.markReady())]};case"network-only":return C?{fromLink:!0,sources:[v(g()),A()]}:{fromLink:!0,sources:[A()]};case"no-cache":return C?{fromLink:!0,sources:[v(e.getDiff()),A()]}:{fromLink:!0,sources:[A()]};case"standby":return{fromLink:!1,sources:[]}}},r.prototype.getOrCreateQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new m0(this,e)),this.queries.get(e)},r.prototype.prepareContext=function(e){e===void 0&&(e={});var t=this.localState.prepareContext(e);return me(me(me({},this.defaultContext),t),{clientAwareness:this.clientAwareness})},r})(),c4=(function(){function r(e){var t=e.cache,n=e.client,i=e.resolvers,a=e.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=t,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return r.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach(function(n){t.resolvers=vw(t.resolvers,n)}):this.resolvers=vw(this.resolvers,e)},r.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},r.prototype.getResolvers=function(){return this.resolvers||{}},r.prototype.runResolvers=function(e){return rs(this,arguments,void 0,function(t){var n=t.document,i=t.remoteResult,a=t.context,s=t.variables,o=t.onlyRunForcedResolvers,l=o===void 0?!1:o;return ns(this,function(u){return n?[2,this.resolveDocument(n,i.data,a,s,this.fragmentMatcher,l).then(function(c){return me(me({},i),{data:c.result})})]:[2,i]})})},r.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},r.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},r.prototype.clientQuery=function(e){return md(["client"],e)&&this.resolvers?e:null},r.prototype.serverQuery=function(e){return ak(e)},r.prototype.prepareContext=function(e){var t=this.cache;return me(me({},e),{cache:t,getCacheKey:function(n){return t.identify(n)}})},r.prototype.addExportedVariables=function(e){return rs(this,arguments,void 0,function(t,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),ns(this,function(a){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,n)||{},this.prepareContext(i),n).then(function(s){return me(me({},n),s.exportedVariables)})]:[2,me({},n)]})})},r.prototype.shouldForceResolvers=function(e){var t=!1;return Oa(e,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(t=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),t))return kA}}}),t},r.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:jR(e),variables:t,returnPartialData:!0,optimistic:!1}).result},r.prototype.resolveDocument=function(e,t){return rs(this,arguments,void 0,function(n,i,a,s,o,l){var u,c,h,f,d,g,v,y,A,C,k;return a===void 0&&(a={}),s===void 0&&(s={}),o===void 0&&(o=function(){return!0}),l===void 0&&(l=!1),ns(this,function(T){return u=Hd(n),c=yc(n),h=gc(c),f=this.collectSelectionsToResolve(u,h),d=u.operation,g=d?d.charAt(0).toUpperCase()+d.slice(1):"Query",v=this,y=v.cache,A=v.client,C={fragmentMap:h,context:me(me({},a),{cache:y,client:A}),variables:s,fragmentMatcher:o,defaultOperationType:g,exportedVariables:{},selectionsToResolve:f,onlyRunForcedResolvers:l},k=!1,[2,this.resolveSelectionSet(u.selectionSet,k,i,C).then(function(S){return{result:S,exportedVariables:C.exportedVariables}})]})})},r.prototype.resolveSelectionSet=function(e,t,n,i){return rs(this,void 0,void 0,function(){var a,s,o,l,u,c=this;return ns(this,function(h){return a=i.fragmentMap,s=i.context,o=i.variables,l=[n],u=function(f){return rs(c,void 0,void 0,function(){var d,g;return ns(this,function(v){return!t&&!i.selectionsToResolve.has(f)?[2]:zd(f,o)?Co(f)?[2,this.resolveField(f,t,n,i).then(function(y){var A;typeof y<"u"&&l.push((A={},A[wo(f)]=y,A))})]:(kR(f)?d=f:(d=a[f.name.value],Mr(d,21,f.name.value)),d&&d.typeCondition&&(g=d.typeCondition.name.value,i.fragmentMatcher(n,g,s))?[2,this.resolveSelectionSet(d.selectionSet,t,n,i).then(function(y){l.push(y)})]:[2]):[2]})})},[2,Promise.all(e.selections.map(u)).then(function(){return _g(l)})]})})},r.prototype.resolveField=function(e,t,n,i){return rs(this,void 0,void 0,function(){var a,s,o,l,u,c,h,f,d,g=this;return ns(this,function(v){return n?(a=i.variables,s=e.name.value,o=wo(e),l=s!==o,u=n[o]||n[s],c=Promise.resolve(u),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(e))&&(h=n.__typename||i.defaultOperationType,f=this.resolvers&&this.resolvers[h],f&&(d=f[l?s:o],d&&(c=Promise.resolve(LA.withValue(this.cache,d,[n,Og(e,a),i.context,{field:e,fragmentMap:i.fragmentMap}]))))),[2,c.then(function(y){var A,C;if(y===void 0&&(y=u),e.directives&&e.directives.forEach(function(T){T.name.value==="export"&&T.arguments&&T.arguments.forEach(function(S){S.name.value==="as"&&S.value.kind==="StringValue"&&(i.exportedVariables[S.value.value]=y)})}),!e.selectionSet||y==null)return y;var k=(C=(A=e.directives)===null||A===void 0?void 0:A.some(function(T){return T.name.value==="client"}))!==null&&C!==void 0?C:!1;if(Array.isArray(y))return g.resolveSubSelectedArray(e,t||k,y,i);if(e.selectionSet)return g.resolveSelectionSet(e.selectionSet,t||k,y,i)})]):[2,null]})})},r.prototype.resolveSubSelectedArray=function(e,t,n,i){var a=this;return Promise.all(n.map(function(s){if(s===null)return null;if(Array.isArray(s))return a.resolveSubSelectedArray(e,t,s,i);if(e.selectionSet)return a.resolveSelectionSet(e.selectionSet,t,s,i)}))},r.prototype.collectSelectionsToResolve=function(e,t){var n=function(s){return!Array.isArray(s)},i=this.selectionsToResolveCache;function a(s){if(!i.has(s)){var o=new Set;i.set(s,o),Oa(s,{Directive:function(l,u,c,h,f){l.name.value==="client"&&f.forEach(function(d){n(d)&&lw(d)&&o.add(d)})},FragmentSpread:function(l,u,c,h,f){var d=t[l.name.value];Mr(d,22,l.name.value);var g=a(d);g.size>0&&(f.forEach(function(v){n(v)&&lw(v)&&o.add(v)}),o.add(l),g.forEach(function(v){o.add(v)}))}})}return i.get(s)}return a(e)},r})(),f4=(function(){function r(e){var t=this,n,i,a;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!e.cache)throw qi(16);var s=e.uri,o=e.credentials,l=e.headers,u=e.cache,c=e.documentTransform,h=e.ssrMode,f=h===void 0?!1:h,d=e.ssrForceFetchDelay,g=d===void 0?0:d,v=e.connectToDevTools,y=e.queryDeduplication,A=y===void 0?!0:y,C=e.defaultOptions,k=e.defaultContext,T=e.assumeImmutableResults,S=T===void 0?u.assumeImmutableResults:T,R=e.resolvers,B=e.typeDefs,G=e.fragmentMatcher,$=e.clientAwareness,Y=e.name,X=e.version,J=e.devtools,Q=e.dataMasking,oe=e.link;oe||(oe=s?new LO({uri:s,credentials:o,headers:l}):La.empty()),this.link=oe,this.cache=u,this.disableNetworkFetches=f||g>0,this.queryDeduplication=A,this.defaultOptions=C||Object.create(null),this.typeDefs=B,this.devtoolsConfig=me(me({},J),{enabled:(n=J?.enabled)!==null&&n!==void 0?n:v}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=!1),g&&setTimeout(function(){return t.disableNetworkFetches=!1},g),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=wA,this.localState=new c4({cache:u,client:this,resolvers:R,fragmentMatcher:G}),this.queryManager=new u4({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:k,documentTransform:c,queryDeduplication:A,ssrMode:f,dataMasking:!!Q,clientAwareness:{name:(i=$?.name)!==null&&i!==void 0?i:Y,version:(a=$?.version)!==null&&a!==void 0?a:X},localState:this.localState,assumeImmutableResults:S,onBroadcast:this.devtoolsConfig.enabled?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return Object.defineProperty(r.prototype,"prioritizeCacheValues",{get:function(){return this.disableNetworkFetches},set:function(e){this.disableNetworkFetches=e},enumerable:!1,configurable:!0}),r.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var e=window,t=Symbol.for("apollo.devtools");(e[t]=e[t]||[]).push(this),e.__APOLLO_CLIENT__=this}},Object.defineProperty(r.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),r.prototype.stop=function(){this.queryManager.stop()},r.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=l0(this.defaultOptions.watchQuery,e)),this.disableNetworkFetches&&(e.fetchPolicy==="network-only"||e.fetchPolicy==="cache-and-network")&&(e=me(me({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},r.prototype.query=function(e){return this.defaultOptions.query&&(e=l0(this.defaultOptions.query,e)),Mr(e.fetchPolicy!=="cache-and-network",18),this.disableNetworkFetches&&e.fetchPolicy==="network-only"&&(e=me(me({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},r.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=l0(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},r.prototype.subscribe=function(e){var t=this,n=this.queryManager.generateQueryId();return this.queryManager.startGraphQLSubscription(e).map(function(i){return me(me({},i),{data:t.queryManager.maskOperation({document:e.query,data:i.data,fetchPolicy:e.fetchPolicy,id:n})})})},r.prototype.readQuery=function(e,t){return t===void 0&&(t=!1),this.cache.readQuery(e,t)},r.prototype.watchFragment=function(e){var t;return this.cache.watchFragment(me(me({},e),(t={},t[Symbol.for("apollo.dataMasking")]=this.queryManager.dataMasking,t)))},r.prototype.readFragment=function(e,t){return t===void 0&&(t=!1),this.cache.readFragment(e,t)},r.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return e.broadcast!==!1&&this.queryManager.broadcastQueries(),t},r.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},r.prototype.__requestRaw=function(e){return vy(this.link,e)},r.prototype.resetStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(e.resetStoreCallbacks.map(function(t){return t()}))}).then(function(){return e.reFetchObservableQueries()})},r.prototype.clearStore=function(){var e=this;return Promise.resolve().then(function(){return e.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(e.clearStoreCallbacks.map(function(t){return t()}))})},r.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter(function(n){return n!==e})}},r.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},r.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],i=[];t.forEach(function(s,o){n.push(o),i.push(s)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(s){}),a},r.prototype.getObservableQueries=function(e){return e===void 0&&(e="active"),this.queryManager.getObservableQueries(e)},r.prototype.extract=function(e){return this.cache.extract(e)},r.prototype.restore=function(e){return this.cache.restore(e)},r.prototype.addResolvers=function(e){this.localState.addResolvers(e)},r.prototype.setResolvers=function(e){this.localState.setResolvers(e)},r.prototype.getResolvers=function(){return this.localState.getResolvers()},r.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},r.prototype.setLink=function(e){this.link=this.queryManager.link=e},Object.defineProperty(r.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),r})(),Wp=new Map,Ey=new Map,Ok=!0,lg=!1;function Bk(r){return r.replace(/[\s,]+/g," ").trim()}function d4(r){return Bk(r.source.body.substring(r.start,r.end))}function h4(r){var e=new Set,t=[];return r.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=d4(n.loc),s=Ey.get(i);s&&!s.has(a)?Ok&&console.warn("Warning: fragment with name "+i+` already exists.
|
|
62
62
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
63
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):s||Ey.set(i,s=new Set),s.add(a),e.has(a)||(e.add(a),t.push(n))}else t.push(n)}),me(me({},r),{definitions:t})}function p4(r){var e=new Set(r.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var t=r.loc;return t&&(delete t.startToken,delete t.endToken),r}function g4(r){var e=Bk(r);if(!Wp.has(e)){var t=LP(r,{experimentalFragmentVariables:lg,allowLegacyFragmentVariables:lg});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Wp.set(e,p4(h4(t)))}return Wp.get(e)}function ke(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof r=="string"&&(r=[r]);var n=r[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=r[a+1]}),g4(n)}function m4(){Wp.clear(),Ey.clear()}function v4(){Ok=!1}function y4(){lg=!0}function A4(){lg=!1}var pf={gql:ke,resetCaches:m4,disableFragmentWarnings:v4,enableExperimentalFragmentVariables:y4,disableExperimentalFragmentVariables:A4};(function(r){r.gql=pf.gql,r.resetCaches=pf.resetCaches,r.disableFragmentWarnings=pf.disableFragmentWarnings,r.enableExperimentalFragmentVariables=pf.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=pf.disableExperimentalFragmentVariables})(ke||(ke={}));ke.default=ke;var bd=(r=>(r.Data="Data",r.Font="Font",r.Frame="Frame",r.Illustration="Illustration",r.Image="Image",r.Model="Model",r.Material="Material",r.Color="Color",r.QuestionnaireCollateral="QuestionnaireCollateral",r.RequestCollateral="RequestCollateral",r.SignupCollateral="SignupCollateral",r.Video="Video",r.ColorProfile="ColorProfile",r.Environment="Environment",r))(bd||{}),Mk=(r=>(r.AND="AND",r.OR="OR",r))(Mk||{}),jn=(r=>(r.FileUpload="FileUpload",r.Option="Option",r.ColorOption="ColorOption",r.Text="Text",r))(jn||{}),Je=(r=>(r.Information="Information",r.Bulk="Bulk",r.DigitalContent="DigitalContent",r.Finish="Finish",r.Frame="Frame",r.Illustration="Illustration",r.Introduction="Introduction",r.Material="Material",r.Model="Model",r.Module="Module",r.Picture="Picture",r.Photo="Photo",r.ProductOverlay="ProductOverlay",r.Question="Question",r.Shape="Shape",r.SilentIllustration="SilentIllustration",r.Text="Text",r))(Je||{}),_k=(r=>(r.Color="Color",r.Colors="Colors",r.Selection="Selection",r.Selections="Selections",r.Text="Text",r.Upload="Upload",r))(_k||{}),nc=(r=>(r.ThreeD="ThreeD",r.FreeDesign="FreeDesign",r.Print="Print",r))(nc||{}),Zt=(r=>(r.Frame="frame",r.Group="group",r.Image="image",r.Pattern="pattern",r.Illustration="illustration",r.Textbox="textbox",r))(Zt||{}),Nk=(r=>(r.Default="Default",r.FirstTransaction="FirstTransaction",r.OneToOne="OneToOne",r))(Nk||{}),HA=(r=>(r.Pending="Pending",r.Failed="Failed",r.Validated="Validated",r.Overridden="Overridden",r))(HA||{}),Lk=(r=>(r.Hyperlink="Hyperlink",r.Edit="Edit",r.Approve="Approve",r))(Lk||{}),Uk=(r=>(r.Hub="Hub",r.Shopify="Shopify",r))(Uk||{}),Ng=(r=>(r.AdvancedImageManipulation="BackgroundRemover",r.ConversionAccelerator="Conversion Accelerator",r.ProcessBuilder="ProcessBuilder",r))(Ng||{}),Vk=(r=>(r[r.Orbit=0]="Orbit",r[r.Pan=1]="Pan",r))(Vk||{}),jA=(r=>(r.Owner="Owner",r.Approver="Approver",r.Editor="Editor",r.Viewer="Viewer",r))(jA||{}),Rl=(r=>(r.Autosize="Autosize",r.Traditional="Traditional",r))(Rl||{}),gi=(r=>(r[r.North=0]="North",r[r.Northeast=1]="Northeast",r[r.East=2]="East",r[r.Southeast=3]="Southeast",r[r.South=4]="South",r[r.Southwest=5]="Southwest",r[r.West=6]="West",r[r.Northwest=7]="Northwest",r))(gi||{}),zk=(r=>(r.Pixel="px",r.Millimeter="mm",r.Centimeter="cm",r))(zk||{}),nd=(r=>(r.Email="Email",r.FirstName="FirstName",r.LastName="LastName",r.Phone="Phone",r.Apartment="Apartment",r.City="City",r.Country="Country",r.OrganizationName="OrganizationName",r.PostCode="PostCode",r.State="State",r.StreetAddress="StreetAddress",r.Custom="Custom",r))(nd||{});class Hk extends Error{constructor(e){super(e),this.name=this.constructor.name}}class Gd extends Hk{constructor(e){super(`ConfigurationError - ${e}`)}}class wd extends Gd{constructor(e){super(`Option not Configured: ${e.stepTitle}`),this.optionId=e?.optionId||"N/A"}}class Ai extends Gd{constructor(e){super(`Panel not Found: ${e.panelId}`),this.panelId=e?.panelId||"N/A"}}class Eo extends Gd{constructor(e){super(`Asset not found for variant: ${e.name}`),this.variant=e}}class ic extends Gd{constructor(e){super(`Resource not found for asset: ${e.name}`),this.asset=e}}class os extends Gd{constructor(e,t){super(`Workflow Misconfiguration: ${e.stepName} - ${t}`),this.step=e}}class Lg extends Hk{constructor(e){super(`ImplementationError - ${e}`)}}class nn extends Lg{constructor(e){super(`Unhandled Behavior Encountered: ${e}`)}}class wl extends Lg{constructor(e){super(`Parsing Error: ${e}`)}}class co extends Lg{constructor(e){super(`Client Error: ${e}`)}}class Ug extends Lg{constructor(e){super(`Resource Generation Failed: ${e}`)}}class b4{get(e){return localStorage.getItem(e)||void 0}set(e,t){localStorage.setItem(e,t)}remove(e){localStorage.removeItem(e)}getMap(e){const t=this.get(e);if(t)return new Map(JSON.parse(t))}setMap(e,t){const n=JSON.stringify([...t.entries()]);this.set(e,n)}}class Jw{constructor(){this.storage=new Map}get(e){return this.storage.get(e)||void 0}set(e,t){this.storage.set(e,t)}remove(e){this.storage.delete(e)}getMap(e){const t=this.get(e);if(t)return new Map(JSON.parse(t))}setMap(e,t){const n=JSON.stringify([...t.entries()]);this.set(e,n)}}const w4=()=>{try{return localStorage?new b4:new Jw}catch{return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."),new Jw}},xr=w4();function C4(r){return new La(function(e,t){var n=ss(e,[]);return new an(function(i){var a,s=!1;return Promise.resolve(n).then(function(o){return r(o,e.getContext())}).then(e.setContext).then(function(){s||(a=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){s=!0,a&&a.unsubscribe()}})})}function jk(r){return new La(function(e,t){return new an(function(n){var i,a,s;try{i=t(e).subscribe({next:function(o){if(o.errors?s=r({graphQLErrors:o.errors,response:o,operation:e,forward:t}):NA(o)&&(s=r({protocolErrors:o.extensions[jd],response:o,operation:e,forward:t})),s){a=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(o)},error:function(o){if(s=r({operation:e,networkError:o,graphQLErrors:o&&o.result&&o.result.errors||void 0,forward:t}),s){a=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(o)},complete:function(){s||n.complete.bind(n)()}})}catch(o){r({networkError:o,operation:e,forward:t}),n.error(o)}return function(){i&&i.unsubscribe(),a&&i.unsubscribe()}})})}(function(r){va(e,r);function e(t){var n=r.call(this)||this;return n.link=jk(t),n}return e.prototype.request=function(t,n){return this.link.request(t,n)},e})(La);class x4{constructor(){this.defaultServerUrl="https://api.au.spiffcommerce.com",this.defaultServicesApiUrl="https://services.au.spiffcommerce.com",this.defaultHubUrl="https://hub.au.spiffcommerce.com",this.serverUrl=this.defaultServerUrl,this.servicesApiUrl=this.defaultServicesApiUrl,this.hubUrl=this.defaultHubUrl,this.serverUrlCallbacks=[]}getServerUrl(){return this.serverUrl}getServicesApiUrl(){return this.servicesApiUrl}getHubUrl(){return this.hubUrl}setServerUrl(e){this.serverUrl=e,this.serverUrlCallbacks.forEach(t=>t())}setServicesApiUrl(e){this.servicesApiUrl=e}setHubUrl(e){this.hubUrl=e}addServerUrlCallback(e){this.serverUrlCallbacks.push(e)}}const _s=new x4;var eo={},cl={},Xh={exports:{}},br={};var Kw;function S4(){if(Kw)return br;Kw=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),h=Symbol.iterator;function f(K){return K===null||typeof K!="object"?null:(K=h&&K[h]||K["@@iterator"],typeof K=="function"?K:null)}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,v={};function y(K,ie,de){this.props=K,this.context=ie,this.refs=v,this.updater=de||d}y.prototype.isReactComponent={},y.prototype.setState=function(K,ie){if(typeof K!="object"&&typeof K!="function"&&K!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,ie,"setState")},y.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function A(){}A.prototype=y.prototype;function C(K,ie,de){this.props=K,this.context=ie,this.refs=v,this.updater=de||d}var k=C.prototype=new A;k.constructor=C,g(k,y.prototype),k.isPureReactComponent=!0;var T=Array.isArray,S=Object.prototype.hasOwnProperty,R={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function G(K,ie,de){var Be,Ee={},ze=null,Ge=null;if(ie!=null)for(Be in ie.ref!==void 0&&(Ge=ie.ref),ie.key!==void 0&&(ze=""+ie.key),ie)S.call(ie,Be)&&!B.hasOwnProperty(Be)&&(Ee[Be]=ie[Be]);var qe=arguments.length-2;if(qe===1)Ee.children=de;else if(1<qe){for(var $e=Array(qe),bt=0;bt<qe;bt++)$e[bt]=arguments[bt+2];Ee.children=$e}if(K&&K.defaultProps)for(Be in qe=K.defaultProps,qe)Ee[Be]===void 0&&(Ee[Be]=qe[Be]);return{$$typeof:r,type:K,key:ze,ref:Ge,props:Ee,_owner:R.current}}function $(K,ie){return{$$typeof:r,type:K.type,key:ie,ref:K.ref,props:K.props,_owner:K._owner}}function Y(K){return typeof K=="object"&&K!==null&&K.$$typeof===r}function X(K){var ie={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(de){return ie[de]})}var J=/\/+/g;function Q(K,ie){return typeof K=="object"&&K!==null&&K.key!=null?X(""+K.key):ie.toString(36)}function oe(K,ie,de,Be,Ee){var ze=typeof K;(ze==="undefined"||ze==="boolean")&&(K=null);var Ge=!1;if(K===null)Ge=!0;else switch(ze){case"string":case"number":Ge=!0;break;case"object":switch(K.$$typeof){case r:case e:Ge=!0}}if(Ge)return Ge=K,Ee=Ee(Ge),K=Be===""?"."+Q(Ge,0):Be,T(Ee)?(de="",K!=null&&(de=K.replace(J,"$&/")+"/"),oe(Ee,ie,de,"",function(bt){return bt})):Ee!=null&&(Y(Ee)&&(Ee=$(Ee,de+(!Ee.key||Ge&&Ge.key===Ee.key?"":(""+Ee.key).replace(J,"$&/")+"/")+K)),ie.push(Ee)),1;if(Ge=0,Be=Be===""?".":Be+":",T(K))for(var qe=0;qe<K.length;qe++){ze=K[qe];var $e=Be+Q(ze,qe);Ge+=oe(ze,ie,de,$e,Ee)}else if($e=f(K),typeof $e=="function")for(K=$e.call(K),qe=0;!(ze=K.next()).done;)ze=ze.value,$e=Be+Q(ze,qe++),Ge+=oe(ze,ie,de,$e,Ee);else if(ze==="object")throw ie=String(K),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.");return Ge}function se(K,ie,de){if(K==null)return K;var Be=[],Ee=0;return oe(K,Be,"","",function(ze){return ie.call(de,ze,Ee++)}),Be}function he(K){if(K._status===-1){var ie=K._result;ie=ie(),ie.then(function(de){(K._status===0||K._status===-1)&&(K._status=1,K._result=de)},function(de){(K._status===0||K._status===-1)&&(K._status=2,K._result=de)}),K._status===-1&&(K._status=0,K._result=ie)}if(K._status===1)return K._result.default;throw K._result}var ye={current:null},Ue={transition:null},Oe={ReactCurrentDispatcher:ye,ReactCurrentBatchConfig:Ue,ReactCurrentOwner:R};function Te(){throw Error("act(...) is not supported in production builds of React.")}return br.Children={map:se,forEach:function(K,ie,de){se(K,function(){ie.apply(this,arguments)},de)},count:function(K){var ie=0;return se(K,function(){ie++}),ie},toArray:function(K){return se(K,function(ie){return ie})||[]},only:function(K){if(!Y(K))throw Error("React.Children.only expected to receive a single React element child.");return K}},br.Component=y,br.Fragment=t,br.Profiler=i,br.PureComponent=C,br.StrictMode=n,br.Suspense=l,br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Oe,br.act=Te,br.cloneElement=function(K,ie,de){if(K==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+K+".");var Be=g({},K.props),Ee=K.key,ze=K.ref,Ge=K._owner;if(ie!=null){if(ie.ref!==void 0&&(ze=ie.ref,Ge=R.current),ie.key!==void 0&&(Ee=""+ie.key),K.type&&K.type.defaultProps)var qe=K.type.defaultProps;for($e in ie)S.call(ie,$e)&&!B.hasOwnProperty($e)&&(Be[$e]=ie[$e]===void 0&&qe!==void 0?qe[$e]:ie[$e])}var $e=arguments.length-2;if($e===1)Be.children=de;else if(1<$e){qe=Array($e);for(var bt=0;bt<$e;bt++)qe[bt]=arguments[bt+2];Be.children=qe}return{$$typeof:r,type:K.type,key:Ee,ref:ze,props:Be,_owner:Ge}},br.createContext=function(K){return K={$$typeof:s,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},K.Provider={$$typeof:a,_context:K},K.Consumer=K},br.createElement=G,br.createFactory=function(K){var ie=G.bind(null,K);return ie.type=K,ie},br.createRef=function(){return{current:null}},br.forwardRef=function(K){return{$$typeof:o,render:K}},br.isValidElement=Y,br.lazy=function(K){return{$$typeof:c,_payload:{_status:-1,_result:K},_init:he}},br.memo=function(K,ie){return{$$typeof:u,type:K,compare:ie===void 0?null:ie}},br.startTransition=function(K){var ie=Ue.transition;Ue.transition={};try{K()}finally{Ue.transition=ie}},br.unstable_act=Te,br.useCallback=function(K,ie){return ye.current.useCallback(K,ie)},br.useContext=function(K){return ye.current.useContext(K)},br.useDebugValue=function(){},br.useDeferredValue=function(K){return ye.current.useDeferredValue(K)},br.useEffect=function(K,ie){return ye.current.useEffect(K,ie)},br.useId=function(){return ye.current.useId()},br.useImperativeHandle=function(K,ie,de){return ye.current.useImperativeHandle(K,ie,de)},br.useInsertionEffect=function(K,ie){return ye.current.useInsertionEffect(K,ie)},br.useLayoutEffect=function(K,ie){return ye.current.useLayoutEffect(K,ie)},br.useMemo=function(K,ie){return ye.current.useMemo(K,ie)},br.useReducer=function(K,ie,de){return ye.current.useReducer(K,ie,de)},br.useRef=function(K){return ye.current.useRef(K)},br.useState=function(K){return ye.current.useState(K)},br.useSyncExternalStore=function(K,ie,de){return ye.current.useSyncExternalStore(K,ie,de)},br.useTransition=function(){return ye.current.useTransition()},br.version="18.3.1",br}var jf={exports:{}};jf.exports;var Zw;function E4(){return Zw||(Zw=1,(function(r,e){process.env.NODE_ENV!=="production"&&(function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t="18.3.1",n=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),y=Symbol.iterator,A="@@iterator";function C(M){if(M===null||typeof M!="object")return null;var te=y&&M[y]||M[A];return typeof te=="function"?te:null}var k={current:null},T={transition:null},S={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},R={current:null},B={},G=null;function $(M){G=M}B.setExtraStackFrame=function(M){G=M},B.getCurrentStack=null,B.getStackAddendum=function(){var M="";G&&(M+=G);var te=B.getCurrentStack;return te&&(M+=te()||""),M};var Y=!1,X=!1,J=!1,Q=!1,oe=!1,se={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:T,ReactCurrentOwner:R};se.ReactDebugCurrentFrame=B,se.ReactCurrentActQueue=S;function he(M){{for(var te=arguments.length,fe=new Array(te>1?te-1:0),be=1;be<te;be++)fe[be-1]=arguments[be];Ue("warn",M,fe)}}function ye(M){{for(var te=arguments.length,fe=new Array(te>1?te-1:0),be=1;be<te;be++)fe[be-1]=arguments[be];Ue("error",M,fe)}}function Ue(M,te,fe){{var be=se.ReactDebugCurrentFrame,Me=be.getStackAddendum();Me!==""&&(te+="%s",fe=fe.concat([Me]));var Ke=fe.map(function(Xe){return String(Xe)});Ke.unshift("Warning: "+te),Function.prototype.apply.call(console[M],console,Ke)}}var Oe={};function Te(M,te){{var fe=M.constructor,be=fe&&(fe.displayName||fe.name)||"ReactClass",Me=be+"."+te;if(Oe[Me])return;ye("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",te,be),Oe[Me]=!0}}var K={isMounted:function(M){return!1},enqueueForceUpdate:function(M,te,fe){Te(M,"forceUpdate")},enqueueReplaceState:function(M,te,fe,be){Te(M,"replaceState")},enqueueSetState:function(M,te,fe,be){Te(M,"setState")}},ie=Object.assign,de={};Object.freeze(de);function Be(M,te,fe){this.props=M,this.context=te,this.refs=de,this.updater=fe||K}Be.prototype.isReactComponent={},Be.prototype.setState=function(M,te){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,te,"setState")},Be.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};{var Ee={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},ze=function(M,te){Object.defineProperty(Be.prototype,M,{get:function(){he("%s(...) is deprecated in plain JavaScript React classes. %s",te[0],te[1])}})};for(var Ge in Ee)Ee.hasOwnProperty(Ge)&&ze(Ge,Ee[Ge])}function qe(){}qe.prototype=Be.prototype;function $e(M,te,fe){this.props=M,this.context=te,this.refs=de,this.updater=fe||K}var bt=$e.prototype=new qe;bt.constructor=$e,ie(bt,Be.prototype),bt.isPureReactComponent=!0;function rr(){var M={current:null};return Object.seal(M),M}var Pr=Array.isArray;function $t(M){return Pr(M)}function ar(M){{var te=typeof Symbol=="function"&&Symbol.toStringTag,fe=te&&M[Symbol.toStringTag]||M.constructor.name||"Object";return fe}}function St(M){try{return st(M),!1}catch{return!0}}function st(M){return""+M}function Qr(M){if(St(M))return ye("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(M)),st(M)}function Sr(M,te,fe){var be=M.displayName;if(be)return be;var Me=te.displayName||te.name||"";return Me!==""?fe+"("+Me+")":fe}function gr(M){return M.displayName||"Context"}function nr(M){if(M==null)return null;if(typeof M.tag=="number"&&ye("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case a:return"Fragment";case i:return"Portal";case o:return"Profiler";case s:return"StrictMode";case h:return"Suspense";case f:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case u:var te=M;return gr(te)+".Consumer";case l:var fe=M;return gr(fe._context)+".Provider";case c:return Sr(M,M.render,"ForwardRef");case d:var be=M.displayName||null;return be!==null?be:nr(M.type)||"Memo";case g:{var Me=M,Ke=Me._payload,Xe=Me._init;try{return nr(Xe(Ke))}catch{return null}}}return null}var fr=Object.prototype.hasOwnProperty,Yt={key:!0,ref:!0,__self:!0,__source:!0},Xt,mt,wr;wr={};function sn(M){if(fr.call(M,"ref")){var te=Object.getOwnPropertyDescriptor(M,"ref").get;if(te&&te.isReactWarning)return!1}return M.ref!==void 0}function _r(M){if(fr.call(M,"key")){var te=Object.getOwnPropertyDescriptor(M,"key").get;if(te&&te.isReactWarning)return!1}return M.key!==void 0}function ir(M,te){var fe=function(){Xt||(Xt=!0,ye("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",te))};fe.isReactWarning=!0,Object.defineProperty(M,"key",{get:fe,configurable:!0})}function Yr(M,te){var fe=function(){mt||(mt=!0,ye("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",te))};fe.isReactWarning=!0,Object.defineProperty(M,"ref",{get:fe,configurable:!0})}function kr(M){if(typeof M.ref=="string"&&R.current&&M.__self&&R.current.stateNode!==M.__self){var te=nr(R.current.type);wr[te]||(ye('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',te,M.ref),wr[te]=!0)}}var Zr=function(M,te,fe,be,Me,Ke,Xe){var yt={$$typeof:n,type:M,key:te,ref:fe,props:Xe,_owner:Ke};return yt._store={},Object.defineProperty(yt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(yt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.defineProperty(yt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Me}),Object.freeze&&(Object.freeze(yt.props),Object.freeze(yt)),yt};function Vr(M,te,fe){var be,Me={},Ke=null,Xe=null,yt=null,Pt=null;if(te!=null){sn(te)&&(Xe=te.ref,kr(te)),_r(te)&&(Qr(te.key),Ke=""+te.key),yt=te.__self===void 0?null:te.__self,Pt=te.__source===void 0?null:te.__source;for(be in te)fr.call(te,be)&&!Yt.hasOwnProperty(be)&&(Me[be]=te[be])}var pr=arguments.length-2;if(pr===1)Me.children=fe;else if(pr>1){for(var yr=Array(pr),ur=0;ur<pr;ur++)yr[ur]=arguments[ur+2];Object.freeze&&Object.freeze(yr),Me.children=yr}if(M&&M.defaultProps){var Tr=M.defaultProps;for(be in Tr)Me[be]===void 0&&(Me[be]=Tr[be])}if(Ke||Xe){var $r=typeof M=="function"?M.displayName||M.name||"Unknown":M;Ke&&ir(Me,$r),Xe&&Yr(Me,$r)}return Zr(M,Ke,Xe,yt,Pt,R.current,Me)}function pn(M,te){var fe=Zr(M.type,te,M.ref,M._self,M._source,M._owner,M.props);return fe}function gn(M,te,fe){if(M==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var be,Me=ie({},M.props),Ke=M.key,Xe=M.ref,yt=M._self,Pt=M._source,pr=M._owner;if(te!=null){sn(te)&&(Xe=te.ref,pr=R.current),_r(te)&&(Qr(te.key),Ke=""+te.key);var yr;M.type&&M.type.defaultProps&&(yr=M.type.defaultProps);for(be in te)fr.call(te,be)&&!Yt.hasOwnProperty(be)&&(te[be]===void 0&&yr!==void 0?Me[be]=yr[be]:Me[be]=te[be])}var ur=arguments.length-2;if(ur===1)Me.children=fe;else if(ur>1){for(var Tr=Array(ur),$r=0;$r<ur;$r++)Tr[$r]=arguments[$r+2];Me.children=Tr}return Zr(M.type,Ke,Xe,yt,Pt,pr,Me)}function Fr(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}var zr=".",en=":";function Hr(M){var te=/[=:]/g,fe={"=":"=0",":":"=2"},be=M.replace(te,function(Me){return fe[Me]});return"$"+be}var zt=!1,sr=/\/+/g;function Er(M){return M.replace(sr,"$&/")}function tt(M,te){return typeof M=="object"&&M!==null&&M.key!=null?(Qr(M.key),Hr(""+M.key)):te.toString(36)}function Nr(M,te,fe,be,Me){var Ke=typeof M;(Ke==="undefined"||Ke==="boolean")&&(M=null);var Xe=!1;if(M===null)Xe=!0;else switch(Ke){case"string":case"number":Xe=!0;break;case"object":switch(M.$$typeof){case n:case i:Xe=!0}}if(Xe){var yt=M,Pt=Me(yt),pr=be===""?zr+tt(yt,0):be;if($t(Pt)){var yr="";pr!=null&&(yr=Er(pr)+"/"),Nr(Pt,te,yr,"",function(ja){return ja})}else Pt!=null&&(Fr(Pt)&&(Pt.key&&(!yt||yt.key!==Pt.key)&&Qr(Pt.key),Pt=pn(Pt,fe+(Pt.key&&(!yt||yt.key!==Pt.key)?Er(""+Pt.key)+"/":"")+pr)),te.push(Pt));return 1}var ur,Tr,$r=0,yn=be===""?zr:be+en;if($t(M))for(var Xi=0;Xi<M.length;Xi++)ur=M[Xi],Tr=yn+tt(ur,Xi),$r+=Nr(ur,te,fe,Tr,Me);else{var ua=C(M);if(typeof ua=="function"){var Ji=M;ua===Ji.entries&&(zt||he("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),zt=!0);for(var Wn=ua.call(Ji),Ki,pi=0;!(Ki=Wn.next()).done;)ur=Ki.value,Tr=yn+tt(ur,pi++),$r+=Nr(ur,te,fe,Tr,Me)}else if(Ke==="object"){var Ha=String(M);throw new Error("Objects are not valid as a React child (found: "+(Ha==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":Ha)+"). If you meant to render a collection of children, use an array instead.")}}return $r}function Xr(M,te,fe){if(M==null)return M;var be=[],Me=0;return Nr(M,be,"","",function(Ke){return te.call(fe,Ke,Me++)}),be}function Se(M){var te=0;return Xr(M,function(){te++}),te}function P(M,te,fe){Xr(M,function(){te.apply(this,arguments)},fe)}function U(M){return Xr(M,function(te){return te})||[]}function Z(M){if(!Fr(M))throw new Error("React.Children.only expected to receive a single React element child.");return M}function ue(M){var te={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};te.Provider={$$typeof:l,_context:te};var fe=!1,be=!1,Me=!1;{var Ke={$$typeof:u,_context:te};Object.defineProperties(Ke,{Provider:{get:function(){return be||(be=!0,ye("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),te.Provider},set:function(Xe){te.Provider=Xe}},_currentValue:{get:function(){return te._currentValue},set:function(Xe){te._currentValue=Xe}},_currentValue2:{get:function(){return te._currentValue2},set:function(Xe){te._currentValue2=Xe}},_threadCount:{get:function(){return te._threadCount},set:function(Xe){te._threadCount=Xe}},Consumer:{get:function(){return fe||(fe=!0,ye("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),te.Consumer}},displayName:{get:function(){return te.displayName},set:function(Xe){Me||(he("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",Xe),Me=!0)}}}),te.Consumer=Ke}return te._currentRenderer=null,te._currentRenderer2=null,te}var Ie=-1,We=0,wt=1,It=2;function Nt(M){if(M._status===Ie){var te=M._result,fe=te();if(fe.then(function(Ke){if(M._status===We||M._status===Ie){var Xe=M;Xe._status=wt,Xe._result=Ke}},function(Ke){if(M._status===We||M._status===Ie){var Xe=M;Xe._status=It,Xe._result=Ke}}),M._status===Ie){var be=M;be._status=We,be._result=fe}}if(M._status===wt){var Me=M._result;return Me===void 0&&ye(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
63
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):s||Ey.set(i,s=new Set),s.add(a),e.has(a)||(e.add(a),t.push(n))}else t.push(n)}),me(me({},r),{definitions:t})}function p4(r){var e=new Set(r.definitions);e.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&e.add(a)})});var t=r.loc;return t&&(delete t.startToken,delete t.endToken),r}function g4(r){var e=Bk(r);if(!Wp.has(e)){var t=LP(r,{experimentalFragmentVariables:lg,allowLegacyFragmentVariables:lg});if(!t||t.kind!=="Document")throw new Error("Not a valid GraphQL document.");Wp.set(e,p4(h4(t)))}return Wp.get(e)}function ke(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];typeof r=="string"&&(r=[r]);var n=r[0];return e.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=r[a+1]}),g4(n)}function m4(){Wp.clear(),Ey.clear()}function v4(){Ok=!1}function y4(){lg=!0}function A4(){lg=!1}var pf={gql:ke,resetCaches:m4,disableFragmentWarnings:v4,enableExperimentalFragmentVariables:y4,disableExperimentalFragmentVariables:A4};(function(r){r.gql=pf.gql,r.resetCaches=pf.resetCaches,r.disableFragmentWarnings=pf.disableFragmentWarnings,r.enableExperimentalFragmentVariables=pf.enableExperimentalFragmentVariables,r.disableExperimentalFragmentVariables=pf.disableExperimentalFragmentVariables})(ke||(ke={}));ke.default=ke;var bd=(r=>(r.Data="Data",r.Font="Font",r.Frame="Frame",r.Illustration="Illustration",r.Image="Image",r.Model="Model",r.Material="Material",r.Color="Color",r.QuestionnaireCollateral="QuestionnaireCollateral",r.RequestCollateral="RequestCollateral",r.SignupCollateral="SignupCollateral",r.Video="Video",r.ColorProfile="ColorProfile",r.Environment="Environment",r))(bd||{}),Mk=(r=>(r.AND="AND",r.OR="OR",r))(Mk||{}),jn=(r=>(r.FileUpload="FileUpload",r.Option="Option",r.ColorOption="ColorOption",r.Text="Text",r))(jn||{}),Je=(r=>(r.Information="Information",r.Bulk="Bulk",r.DigitalContent="DigitalContent",r.Finish="Finish",r.Frame="Frame",r.Illustration="Illustration",r.Introduction="Introduction",r.Material="Material",r.Model="Model",r.Module="Module",r.Picture="Picture",r.Photo="Photo",r.Product="Product",r.ProductOverlay="ProductOverlay",r.Question="Question",r.Shape="Shape",r.SilentIllustration="SilentIllustration",r.Text="Text",r))(Je||{}),_k=(r=>(r.Color="Color",r.Colors="Colors",r.Selection="Selection",r.Selections="Selections",r.Text="Text",r.Upload="Upload",r))(_k||{}),nc=(r=>(r.ThreeD="ThreeD",r.FreeDesign="FreeDesign",r.Print="Print",r))(nc||{}),Zt=(r=>(r.Frame="frame",r.Group="group",r.Image="image",r.Pattern="pattern",r.Illustration="illustration",r.Textbox="textbox",r))(Zt||{}),Nk=(r=>(r.Default="Default",r.FirstTransaction="FirstTransaction",r.OneToOne="OneToOne",r))(Nk||{}),HA=(r=>(r.Pending="Pending",r.Failed="Failed",r.Validated="Validated",r.Overridden="Overridden",r))(HA||{}),Lk=(r=>(r.Hyperlink="Hyperlink",r.Edit="Edit",r.Approve="Approve",r))(Lk||{}),Uk=(r=>(r.Hub="Hub",r.Shopify="Shopify",r))(Uk||{}),Ng=(r=>(r.AdvancedImageManipulation="BackgroundRemover",r.ConversionAccelerator="Conversion Accelerator",r.ProcessBuilder="ProcessBuilder",r))(Ng||{}),Vk=(r=>(r[r.Orbit=0]="Orbit",r[r.Pan=1]="Pan",r))(Vk||{}),jA=(r=>(r.Owner="Owner",r.Approver="Approver",r.Editor="Editor",r.Viewer="Viewer",r))(jA||{}),Rl=(r=>(r.Autosize="Autosize",r.Traditional="Traditional",r))(Rl||{}),gi=(r=>(r[r.North=0]="North",r[r.Northeast=1]="Northeast",r[r.East=2]="East",r[r.Southeast=3]="Southeast",r[r.South=4]="South",r[r.Southwest=5]="Southwest",r[r.West=6]="West",r[r.Northwest=7]="Northwest",r))(gi||{}),zk=(r=>(r.Pixel="px",r.Millimeter="mm",r.Centimeter="cm",r))(zk||{}),nd=(r=>(r.Email="Email",r.FirstName="FirstName",r.LastName="LastName",r.Phone="Phone",r.Apartment="Apartment",r.City="City",r.Country="Country",r.OrganizationName="OrganizationName",r.PostCode="PostCode",r.State="State",r.StreetAddress="StreetAddress",r.Custom="Custom",r))(nd||{});class Hk extends Error{constructor(e){super(e),this.name=this.constructor.name}}class Gd extends Hk{constructor(e){super(`ConfigurationError - ${e}`)}}class wd extends Gd{constructor(e){super(`Option not Configured: ${e.stepTitle}`),this.optionId=e?.optionId||"N/A"}}class Ai extends Gd{constructor(e){super(`Panel not Found: ${e.panelId}`),this.panelId=e?.panelId||"N/A"}}class Eo extends Gd{constructor(e){super(`Asset not found for variant: ${e.name}`),this.variant=e}}class ic extends Gd{constructor(e){super(`Resource not found for asset: ${e.name}`),this.asset=e}}class os extends Gd{constructor(e,t){super(`Workflow Misconfiguration: ${e.stepName} - ${t}`),this.step=e}}class Lg extends Hk{constructor(e){super(`ImplementationError - ${e}`)}}class nn extends Lg{constructor(e){super(`Unhandled Behavior Encountered: ${e}`)}}class wl extends Lg{constructor(e){super(`Parsing Error: ${e}`)}}class co extends Lg{constructor(e){super(`Client Error: ${e}`)}}class Ug extends Lg{constructor(e){super(`Resource Generation Failed: ${e}`)}}class b4{get(e){return localStorage.getItem(e)||void 0}set(e,t){localStorage.setItem(e,t)}remove(e){localStorage.removeItem(e)}getMap(e){const t=this.get(e);if(t)return new Map(JSON.parse(t))}setMap(e,t){const n=JSON.stringify([...t.entries()]);this.set(e,n)}}class Jw{constructor(){this.storage=new Map}get(e){return this.storage.get(e)||void 0}set(e,t){this.storage.set(e,t)}remove(e){this.storage.delete(e)}getMap(e){const t=this.get(e);if(t)return new Map(JSON.parse(t))}setMap(e,t){const n=JSON.stringify([...t.entries()]);this.set(e,n)}}const w4=()=>{try{return localStorage?new b4:new Jw}catch{return console.warn("Local storage was unavilable due to browser security settings. Using in-memory storage instead."),new Jw}},xr=w4();function C4(r){return new La(function(e,t){var n=ss(e,[]);return new an(function(i){var a,s=!1;return Promise.resolve(n).then(function(o){return r(o,e.getContext())}).then(e.setContext).then(function(){s||(a=t(e).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){s=!0,a&&a.unsubscribe()}})})}function jk(r){return new La(function(e,t){return new an(function(n){var i,a,s;try{i=t(e).subscribe({next:function(o){if(o.errors?s=r({graphQLErrors:o.errors,response:o,operation:e,forward:t}):NA(o)&&(s=r({protocolErrors:o.extensions[jd],response:o,operation:e,forward:t})),s){a=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.next(o)},error:function(o){if(s=r({operation:e,networkError:o,graphQLErrors:o&&o.result&&o.result.errors||void 0,forward:t}),s){a=s.subscribe({next:n.next.bind(n),error:n.error.bind(n),complete:n.complete.bind(n)});return}n.error(o)},complete:function(){s||n.complete.bind(n)()}})}catch(o){r({networkError:o,operation:e,forward:t}),n.error(o)}return function(){i&&i.unsubscribe(),a&&i.unsubscribe()}})})}(function(r){va(e,r);function e(t){var n=r.call(this)||this;return n.link=jk(t),n}return e.prototype.request=function(t,n){return this.link.request(t,n)},e})(La);class x4{constructor(){this.defaultServerUrl="https://api.au.spiffcommerce.com",this.defaultServicesApiUrl="https://services.au.spiffcommerce.com",this.defaultHubUrl="https://hub.au.spiffcommerce.com",this.serverUrl=this.defaultServerUrl,this.servicesApiUrl=this.defaultServicesApiUrl,this.hubUrl=this.defaultHubUrl,this.serverUrlCallbacks=[]}getServerUrl(){return this.serverUrl}getServicesApiUrl(){return this.servicesApiUrl}getHubUrl(){return this.hubUrl}setServerUrl(e){this.serverUrl=e,this.serverUrlCallbacks.forEach(t=>t())}setServicesApiUrl(e){this.servicesApiUrl=e}setHubUrl(e){this.hubUrl=e}addServerUrlCallback(e){this.serverUrlCallbacks.push(e)}}const _s=new x4;var eo={},cl={},Xh={exports:{}},br={};var Kw;function S4(){if(Kw)return br;Kw=1;var r=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),h=Symbol.iterator;function f(K){return K===null||typeof K!="object"?null:(K=h&&K[h]||K["@@iterator"],typeof K=="function"?K:null)}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,v={};function y(K,ie,de){this.props=K,this.context=ie,this.refs=v,this.updater=de||d}y.prototype.isReactComponent={},y.prototype.setState=function(K,ie){if(typeof K!="object"&&typeof K!="function"&&K!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,ie,"setState")},y.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function A(){}A.prototype=y.prototype;function C(K,ie,de){this.props=K,this.context=ie,this.refs=v,this.updater=de||d}var k=C.prototype=new A;k.constructor=C,g(k,y.prototype),k.isPureReactComponent=!0;var T=Array.isArray,S=Object.prototype.hasOwnProperty,R={current:null},B={key:!0,ref:!0,__self:!0,__source:!0};function G(K,ie,de){var Be,Ee={},ze=null,Ge=null;if(ie!=null)for(Be in ie.ref!==void 0&&(Ge=ie.ref),ie.key!==void 0&&(ze=""+ie.key),ie)S.call(ie,Be)&&!B.hasOwnProperty(Be)&&(Ee[Be]=ie[Be]);var qe=arguments.length-2;if(qe===1)Ee.children=de;else if(1<qe){for(var $e=Array(qe),bt=0;bt<qe;bt++)$e[bt]=arguments[bt+2];Ee.children=$e}if(K&&K.defaultProps)for(Be in qe=K.defaultProps,qe)Ee[Be]===void 0&&(Ee[Be]=qe[Be]);return{$$typeof:r,type:K,key:ze,ref:Ge,props:Ee,_owner:R.current}}function $(K,ie){return{$$typeof:r,type:K.type,key:ie,ref:K.ref,props:K.props,_owner:K._owner}}function Y(K){return typeof K=="object"&&K!==null&&K.$$typeof===r}function X(K){var ie={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(de){return ie[de]})}var J=/\/+/g;function Q(K,ie){return typeof K=="object"&&K!==null&&K.key!=null?X(""+K.key):ie.toString(36)}function oe(K,ie,de,Be,Ee){var ze=typeof K;(ze==="undefined"||ze==="boolean")&&(K=null);var Ge=!1;if(K===null)Ge=!0;else switch(ze){case"string":case"number":Ge=!0;break;case"object":switch(K.$$typeof){case r:case e:Ge=!0}}if(Ge)return Ge=K,Ee=Ee(Ge),K=Be===""?"."+Q(Ge,0):Be,T(Ee)?(de="",K!=null&&(de=K.replace(J,"$&/")+"/"),oe(Ee,ie,de,"",function(bt){return bt})):Ee!=null&&(Y(Ee)&&(Ee=$(Ee,de+(!Ee.key||Ge&&Ge.key===Ee.key?"":(""+Ee.key).replace(J,"$&/")+"/")+K)),ie.push(Ee)),1;if(Ge=0,Be=Be===""?".":Be+":",T(K))for(var qe=0;qe<K.length;qe++){ze=K[qe];var $e=Be+Q(ze,qe);Ge+=oe(ze,ie,de,$e,Ee)}else if($e=f(K),typeof $e=="function")for(K=$e.call(K),qe=0;!(ze=K.next()).done;)ze=ze.value,$e=Be+Q(ze,qe++),Ge+=oe(ze,ie,de,$e,Ee);else if(ze==="object")throw ie=String(K),Error("Objects are not valid as a React child (found: "+(ie==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":ie)+"). If you meant to render a collection of children, use an array instead.");return Ge}function se(K,ie,de){if(K==null)return K;var Be=[],Ee=0;return oe(K,Be,"","",function(ze){return ie.call(de,ze,Ee++)}),Be}function he(K){if(K._status===-1){var ie=K._result;ie=ie(),ie.then(function(de){(K._status===0||K._status===-1)&&(K._status=1,K._result=de)},function(de){(K._status===0||K._status===-1)&&(K._status=2,K._result=de)}),K._status===-1&&(K._status=0,K._result=ie)}if(K._status===1)return K._result.default;throw K._result}var ye={current:null},Ue={transition:null},Oe={ReactCurrentDispatcher:ye,ReactCurrentBatchConfig:Ue,ReactCurrentOwner:R};function Te(){throw Error("act(...) is not supported in production builds of React.")}return br.Children={map:se,forEach:function(K,ie,de){se(K,function(){ie.apply(this,arguments)},de)},count:function(K){var ie=0;return se(K,function(){ie++}),ie},toArray:function(K){return se(K,function(ie){return ie})||[]},only:function(K){if(!Y(K))throw Error("React.Children.only expected to receive a single React element child.");return K}},br.Component=y,br.Fragment=t,br.Profiler=i,br.PureComponent=C,br.StrictMode=n,br.Suspense=l,br.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Oe,br.act=Te,br.cloneElement=function(K,ie,de){if(K==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+K+".");var Be=g({},K.props),Ee=K.key,ze=K.ref,Ge=K._owner;if(ie!=null){if(ie.ref!==void 0&&(ze=ie.ref,Ge=R.current),ie.key!==void 0&&(Ee=""+ie.key),K.type&&K.type.defaultProps)var qe=K.type.defaultProps;for($e in ie)S.call(ie,$e)&&!B.hasOwnProperty($e)&&(Be[$e]=ie[$e]===void 0&&qe!==void 0?qe[$e]:ie[$e])}var $e=arguments.length-2;if($e===1)Be.children=de;else if(1<$e){qe=Array($e);for(var bt=0;bt<$e;bt++)qe[bt]=arguments[bt+2];Be.children=qe}return{$$typeof:r,type:K.type,key:Ee,ref:ze,props:Be,_owner:Ge}},br.createContext=function(K){return K={$$typeof:s,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},K.Provider={$$typeof:a,_context:K},K.Consumer=K},br.createElement=G,br.createFactory=function(K){var ie=G.bind(null,K);return ie.type=K,ie},br.createRef=function(){return{current:null}},br.forwardRef=function(K){return{$$typeof:o,render:K}},br.isValidElement=Y,br.lazy=function(K){return{$$typeof:c,_payload:{_status:-1,_result:K},_init:he}},br.memo=function(K,ie){return{$$typeof:u,type:K,compare:ie===void 0?null:ie}},br.startTransition=function(K){var ie=Ue.transition;Ue.transition={};try{K()}finally{Ue.transition=ie}},br.unstable_act=Te,br.useCallback=function(K,ie){return ye.current.useCallback(K,ie)},br.useContext=function(K){return ye.current.useContext(K)},br.useDebugValue=function(){},br.useDeferredValue=function(K){return ye.current.useDeferredValue(K)},br.useEffect=function(K,ie){return ye.current.useEffect(K,ie)},br.useId=function(){return ye.current.useId()},br.useImperativeHandle=function(K,ie,de){return ye.current.useImperativeHandle(K,ie,de)},br.useInsertionEffect=function(K,ie){return ye.current.useInsertionEffect(K,ie)},br.useLayoutEffect=function(K,ie){return ye.current.useLayoutEffect(K,ie)},br.useMemo=function(K,ie){return ye.current.useMemo(K,ie)},br.useReducer=function(K,ie,de){return ye.current.useReducer(K,ie,de)},br.useRef=function(K){return ye.current.useRef(K)},br.useState=function(K){return ye.current.useState(K)},br.useSyncExternalStore=function(K,ie,de){return ye.current.useSyncExternalStore(K,ie,de)},br.useTransition=function(){return ye.current.useTransition()},br.version="18.3.1",br}var jf={exports:{}};jf.exports;var Zw;function E4(){return Zw||(Zw=1,(function(r,e){process.env.NODE_ENV!=="production"&&(function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var t="18.3.1",n=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),y=Symbol.iterator,A="@@iterator";function C(M){if(M===null||typeof M!="object")return null;var te=y&&M[y]||M[A];return typeof te=="function"?te:null}var k={current:null},T={transition:null},S={current:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1},R={current:null},B={},G=null;function $(M){G=M}B.setExtraStackFrame=function(M){G=M},B.getCurrentStack=null,B.getStackAddendum=function(){var M="";G&&(M+=G);var te=B.getCurrentStack;return te&&(M+=te()||""),M};var Y=!1,X=!1,J=!1,Q=!1,oe=!1,se={ReactCurrentDispatcher:k,ReactCurrentBatchConfig:T,ReactCurrentOwner:R};se.ReactDebugCurrentFrame=B,se.ReactCurrentActQueue=S;function he(M){{for(var te=arguments.length,fe=new Array(te>1?te-1:0),be=1;be<te;be++)fe[be-1]=arguments[be];Ue("warn",M,fe)}}function ye(M){{for(var te=arguments.length,fe=new Array(te>1?te-1:0),be=1;be<te;be++)fe[be-1]=arguments[be];Ue("error",M,fe)}}function Ue(M,te,fe){{var be=se.ReactDebugCurrentFrame,Me=be.getStackAddendum();Me!==""&&(te+="%s",fe=fe.concat([Me]));var Ke=fe.map(function(Xe){return String(Xe)});Ke.unshift("Warning: "+te),Function.prototype.apply.call(console[M],console,Ke)}}var Oe={};function Te(M,te){{var fe=M.constructor,be=fe&&(fe.displayName||fe.name)||"ReactClass",Me=be+"."+te;if(Oe[Me])return;ye("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",te,be),Oe[Me]=!0}}var K={isMounted:function(M){return!1},enqueueForceUpdate:function(M,te,fe){Te(M,"forceUpdate")},enqueueReplaceState:function(M,te,fe,be){Te(M,"replaceState")},enqueueSetState:function(M,te,fe,be){Te(M,"setState")}},ie=Object.assign,de={};Object.freeze(de);function Be(M,te,fe){this.props=M,this.context=te,this.refs=de,this.updater=fe||K}Be.prototype.isReactComponent={},Be.prototype.setState=function(M,te){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,te,"setState")},Be.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};{var Ee={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},ze=function(M,te){Object.defineProperty(Be.prototype,M,{get:function(){he("%s(...) is deprecated in plain JavaScript React classes. %s",te[0],te[1])}})};for(var Ge in Ee)Ee.hasOwnProperty(Ge)&&ze(Ge,Ee[Ge])}function qe(){}qe.prototype=Be.prototype;function $e(M,te,fe){this.props=M,this.context=te,this.refs=de,this.updater=fe||K}var bt=$e.prototype=new qe;bt.constructor=$e,ie(bt,Be.prototype),bt.isPureReactComponent=!0;function rr(){var M={current:null};return Object.seal(M),M}var Pr=Array.isArray;function $t(M){return Pr(M)}function ar(M){{var te=typeof Symbol=="function"&&Symbol.toStringTag,fe=te&&M[Symbol.toStringTag]||M.constructor.name||"Object";return fe}}function St(M){try{return st(M),!1}catch{return!0}}function st(M){return""+M}function Qr(M){if(St(M))return ye("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(M)),st(M)}function Sr(M,te,fe){var be=M.displayName;if(be)return be;var Me=te.displayName||te.name||"";return Me!==""?fe+"("+Me+")":fe}function gr(M){return M.displayName||"Context"}function nr(M){if(M==null)return null;if(typeof M.tag=="number"&&ye("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case a:return"Fragment";case i:return"Portal";case o:return"Profiler";case s:return"StrictMode";case h:return"Suspense";case f:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case u:var te=M;return gr(te)+".Consumer";case l:var fe=M;return gr(fe._context)+".Provider";case c:return Sr(M,M.render,"ForwardRef");case d:var be=M.displayName||null;return be!==null?be:nr(M.type)||"Memo";case g:{var Me=M,Ke=Me._payload,Xe=Me._init;try{return nr(Xe(Ke))}catch{return null}}}return null}var fr=Object.prototype.hasOwnProperty,Yt={key:!0,ref:!0,__self:!0,__source:!0},Xt,mt,wr;wr={};function sn(M){if(fr.call(M,"ref")){var te=Object.getOwnPropertyDescriptor(M,"ref").get;if(te&&te.isReactWarning)return!1}return M.ref!==void 0}function _r(M){if(fr.call(M,"key")){var te=Object.getOwnPropertyDescriptor(M,"key").get;if(te&&te.isReactWarning)return!1}return M.key!==void 0}function ir(M,te){var fe=function(){Xt||(Xt=!0,ye("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",te))};fe.isReactWarning=!0,Object.defineProperty(M,"key",{get:fe,configurable:!0})}function Yr(M,te){var fe=function(){mt||(mt=!0,ye("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",te))};fe.isReactWarning=!0,Object.defineProperty(M,"ref",{get:fe,configurable:!0})}function kr(M){if(typeof M.ref=="string"&&R.current&&M.__self&&R.current.stateNode!==M.__self){var te=nr(R.current.type);wr[te]||(ye('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',te,M.ref),wr[te]=!0)}}var Zr=function(M,te,fe,be,Me,Ke,Xe){var yt={$$typeof:n,type:M,key:te,ref:fe,props:Xe,_owner:Ke};return yt._store={},Object.defineProperty(yt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(yt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:be}),Object.defineProperty(yt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Me}),Object.freeze&&(Object.freeze(yt.props),Object.freeze(yt)),yt};function Vr(M,te,fe){var be,Me={},Ke=null,Xe=null,yt=null,Pt=null;if(te!=null){sn(te)&&(Xe=te.ref,kr(te)),_r(te)&&(Qr(te.key),Ke=""+te.key),yt=te.__self===void 0?null:te.__self,Pt=te.__source===void 0?null:te.__source;for(be in te)fr.call(te,be)&&!Yt.hasOwnProperty(be)&&(Me[be]=te[be])}var pr=arguments.length-2;if(pr===1)Me.children=fe;else if(pr>1){for(var yr=Array(pr),ur=0;ur<pr;ur++)yr[ur]=arguments[ur+2];Object.freeze&&Object.freeze(yr),Me.children=yr}if(M&&M.defaultProps){var Tr=M.defaultProps;for(be in Tr)Me[be]===void 0&&(Me[be]=Tr[be])}if(Ke||Xe){var $r=typeof M=="function"?M.displayName||M.name||"Unknown":M;Ke&&ir(Me,$r),Xe&&Yr(Me,$r)}return Zr(M,Ke,Xe,yt,Pt,R.current,Me)}function pn(M,te){var fe=Zr(M.type,te,M.ref,M._self,M._source,M._owner,M.props);return fe}function gn(M,te,fe){if(M==null)throw new Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var be,Me=ie({},M.props),Ke=M.key,Xe=M.ref,yt=M._self,Pt=M._source,pr=M._owner;if(te!=null){sn(te)&&(Xe=te.ref,pr=R.current),_r(te)&&(Qr(te.key),Ke=""+te.key);var yr;M.type&&M.type.defaultProps&&(yr=M.type.defaultProps);for(be in te)fr.call(te,be)&&!Yt.hasOwnProperty(be)&&(te[be]===void 0&&yr!==void 0?Me[be]=yr[be]:Me[be]=te[be])}var ur=arguments.length-2;if(ur===1)Me.children=fe;else if(ur>1){for(var Tr=Array(ur),$r=0;$r<ur;$r++)Tr[$r]=arguments[$r+2];Me.children=Tr}return Zr(M.type,Ke,Xe,yt,Pt,pr,Me)}function Fr(M){return typeof M=="object"&&M!==null&&M.$$typeof===n}var zr=".",en=":";function Hr(M){var te=/[=:]/g,fe={"=":"=0",":":"=2"},be=M.replace(te,function(Me){return fe[Me]});return"$"+be}var zt=!1,sr=/\/+/g;function Er(M){return M.replace(sr,"$&/")}function tt(M,te){return typeof M=="object"&&M!==null&&M.key!=null?(Qr(M.key),Hr(""+M.key)):te.toString(36)}function Nr(M,te,fe,be,Me){var Ke=typeof M;(Ke==="undefined"||Ke==="boolean")&&(M=null);var Xe=!1;if(M===null)Xe=!0;else switch(Ke){case"string":case"number":Xe=!0;break;case"object":switch(M.$$typeof){case n:case i:Xe=!0}}if(Xe){var yt=M,Pt=Me(yt),pr=be===""?zr+tt(yt,0):be;if($t(Pt)){var yr="";pr!=null&&(yr=Er(pr)+"/"),Nr(Pt,te,yr,"",function(ja){return ja})}else Pt!=null&&(Fr(Pt)&&(Pt.key&&(!yt||yt.key!==Pt.key)&&Qr(Pt.key),Pt=pn(Pt,fe+(Pt.key&&(!yt||yt.key!==Pt.key)?Er(""+Pt.key)+"/":"")+pr)),te.push(Pt));return 1}var ur,Tr,$r=0,yn=be===""?zr:be+en;if($t(M))for(var Xi=0;Xi<M.length;Xi++)ur=M[Xi],Tr=yn+tt(ur,Xi),$r+=Nr(ur,te,fe,Tr,Me);else{var ua=C(M);if(typeof ua=="function"){var Ji=M;ua===Ji.entries&&(zt||he("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),zt=!0);for(var Wn=ua.call(Ji),Ki,pi=0;!(Ki=Wn.next()).done;)ur=Ki.value,Tr=yn+tt(ur,pi++),$r+=Nr(ur,te,fe,Tr,Me)}else if(Ke==="object"){var Ha=String(M);throw new Error("Objects are not valid as a React child (found: "+(Ha==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":Ha)+"). If you meant to render a collection of children, use an array instead.")}}return $r}function Xr(M,te,fe){if(M==null)return M;var be=[],Me=0;return Nr(M,be,"","",function(Ke){return te.call(fe,Ke,Me++)}),be}function Se(M){var te=0;return Xr(M,function(){te++}),te}function P(M,te,fe){Xr(M,function(){te.apply(this,arguments)},fe)}function U(M){return Xr(M,function(te){return te})||[]}function Z(M){if(!Fr(M))throw new Error("React.Children.only expected to receive a single React element child.");return M}function ue(M){var te={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};te.Provider={$$typeof:l,_context:te};var fe=!1,be=!1,Me=!1;{var Ke={$$typeof:u,_context:te};Object.defineProperties(Ke,{Provider:{get:function(){return be||(be=!0,ye("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),te.Provider},set:function(Xe){te.Provider=Xe}},_currentValue:{get:function(){return te._currentValue},set:function(Xe){te._currentValue=Xe}},_currentValue2:{get:function(){return te._currentValue2},set:function(Xe){te._currentValue2=Xe}},_threadCount:{get:function(){return te._threadCount},set:function(Xe){te._threadCount=Xe}},Consumer:{get:function(){return fe||(fe=!0,ye("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),te.Consumer}},displayName:{get:function(){return te.displayName},set:function(Xe){Me||(he("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",Xe),Me=!0)}}}),te.Consumer=Ke}return te._currentRenderer=null,te._currentRenderer2=null,te}var Ie=-1,We=0,wt=1,It=2;function Nt(M){if(M._status===Ie){var te=M._result,fe=te();if(fe.then(function(Ke){if(M._status===We||M._status===Ie){var Xe=M;Xe._status=wt,Xe._result=Ke}},function(Ke){if(M._status===We||M._status===Ie){var Xe=M;Xe._status=It,Xe._result=Ke}}),M._status===Ie){var be=M;be._status=We,be._result=fe}}if(M._status===wt){var Me=M._result;return Me===void 0&&ye(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
64
64
|
|
|
65
65
|
Your code should look like:
|
|
66
66
|
const MyComponent = lazy(() => import('./MyComponent'))
|
|
@@ -1263,6 +1263,19 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${P.byteLength}`),P.tiff&&
|
|
|
1263
1263
|
}
|
|
1264
1264
|
overlayType
|
|
1265
1265
|
}
|
|
1266
|
+
... on ProductStepData {
|
|
1267
|
+
baseContents
|
|
1268
|
+
categoryFilterEnabled
|
|
1269
|
+
lockedAddOns {
|
|
1270
|
+
lockedQty
|
|
1271
|
+
variantId
|
|
1272
|
+
}
|
|
1273
|
+
max
|
|
1274
|
+
min
|
|
1275
|
+
pricing
|
|
1276
|
+
searchBarEnabled
|
|
1277
|
+
workflows
|
|
1278
|
+
}
|
|
1266
1279
|
... on QuestionStepData {
|
|
1267
1280
|
advancedEditorAnimation {
|
|
1268
1281
|
x
|
|
@@ -2788,7 +2801,7 @@ Minimum version required to store current data is: `+X+`.
|
|
|
2788
2801
|
`));return t(i)},PV={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:"endpointV2Middleware"},RV=(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t})=>({applyToStack:n=>{n.addRelativeTo(DV(r,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:t}),PV)}}),OV=r=>e=>{throw e},BV=(r,e)=>{},MV=r=>(e,t)=>async n=>{if(!aa.isInstance(n.request))return e(n);const a=Sc(t).selectedHttpAuthScheme;if(!a)throw new Error("No HttpAuthScheme was selected: unable to sign request");const{httpAuthOption:{signingProperties:s={}},identity:o,signer:l}=a,u=await e({...n,request:await l.sign(n.request,o,s)}).catch((l.errorHandler||OV)(s));return(l.successHandler||BV)(u.response,s),u},_V={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:"retryMiddleware"},NV=r=>({applyToStack:e=>{e.addRelativeTo(MV(),_V)}}),ld=r=>{if(typeof r=="function")return r;const e=Promise.resolve(r);return()=>e},OI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",EE=Object.entries(OI).reduce((r,[e,t])=>(r[t]=Number(e),r),{}),LV=OI.split(""),Xu=6,ud=8,UV=63,nm=r=>{let e=r.length/4*3;r.slice(-2)==="=="?e-=2:r.slice(-1)==="="&&e--;const t=new ArrayBuffer(e),n=new DataView(t);for(let i=0;i<r.length;i+=4){let a=0,s=0;for(let u=i,c=i+3;u<=c;u++)if(r[u]!=="="){if(!(r[u]in EE))throw new TypeError(`Invalid character ${r[u]} in base64 string.`);a|=EE[r[u]]<<(c-u)*Xu,s+=Xu}else a>>=Xu;const o=i/4*3;a>>=s%ud;const l=Math.floor(s/ud);for(let u=0;u<l;u++){const c=(l-u-1)*ud;n.setUint8(o+u,(a&255<<c)>>c)}}return new Uint8Array(t)},Dl=r=>new TextEncoder().encode(r),Od=r=>typeof r=="string"?Dl(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r),im=r=>{if(typeof r=="string")return r;if(typeof r!="object"||typeof r.byteOffset!="number"||typeof r.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(r)};function kg(r){let e;typeof r=="string"?e=Dl(r):e=r;const t=typeof e=="object"&&typeof e.length=="number",n=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!t&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let i="";for(let a=0;a<e.length;a+=3){let s=0,o=0;for(let u=a,c=Math.min(a+3,e.length);u<c;u++)s|=e[u]<<(c-u-1)*ud,o+=ud;const l=Math.ceil(o/Xu);s<<=l*Xu-o;for(let u=1;u<=l;u++){const c=(l-u)*Xu;i+=LV[(s&UV<<c)>>c]}i+="==".slice(0,4-l)}return i}class Sl extends Uint8Array{static fromString(e,t="utf-8"){if(typeof e=="string")return t==="base64"?Sl.mutate(nm(e)):Sl.mutate(Dl(e));throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}static mutate(e){return Object.setPrototypeOf(e,Sl.prototype),e}transformToString(e="utf-8"){return e==="base64"?kg(this):im(this)}}const El=r=>encodeURIComponent(r).replace(/[!'()*]/g,VV),VV=r=>`%${r.charCodeAt(0).toString(16).toUpperCase()}`;function zV(r){const e=[];for(let t of Object.keys(r).sort()){const n=r[t];if(t=El(t),Array.isArray(n))for(let i=0,a=n.length;i<a;i++)e.push(`${t}=${El(n[i])}`);else{let i=t;(n||typeof n=="string")&&(i+=`=${El(n)}`),e.push(i)}}return e.join("&")}function kE(r,e){return new Request(r,e)}function HV(r=0){return new Promise((e,t)=>{r&&setTimeout(()=>{const n=new Error(`Request did not complete within ${r} ms`);n.name="TimeoutError",t(n)},r)})}const Nv={supported:void 0};class _1{config;configProvider;static create(e){return typeof e?.handle=="function"?e:new _1(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(t=>t||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),Nv.supported===void 0&&(Nv.supported=typeof Request<"u"&&"keepalive"in kE("https://[::1]"))}destroy(){}async handle(e,{abortSignal:t,requestTimeout:n}={}){this.config||(this.config=await this.configProvider);const i=n??this.config.requestTimeout,a=this.config.keepAlive===!0,s=this.config.credentials;if(t?.aborted){const C=FE(t);return Promise.reject(C)}let o=e.path;const l=zV(e.query||{});l&&(o+=`?${l}`),e.fragment&&(o+=`#${e.fragment}`);let u="";if(e.username!=null||e.password!=null){const C=e.username??"",k=e.password??"";u=`${C}:${k}@`}const{port:c,method:h}=e,f=`${e.protocol}//${u}${e.hostname}${c?`:${c}`:""}${o}`,d=h==="GET"||h==="HEAD"?void 0:e.body,g={body:d,headers:new Headers(e.headers),method:h,credentials:s};this.config?.cache&&(g.cache=this.config.cache),d&&(g.duplex="half"),typeof AbortController<"u"&&(g.signal=t),Nv.supported&&(g.keepalive=a),typeof this.config.requestInit=="function"&&Object.assign(g,this.config.requestInit(e));let v=()=>{};const y=kE(f,g),A=[fetch(y).then(C=>{const k=C.headers,T={};for(const R of k.entries())T[R[0]]=R[1];return C.body!=null?{response:new fc({headers:T,reason:C.statusText,statusCode:C.status,body:C.body})}:C.blob().then(R=>({response:new fc({headers:T,reason:C.statusText,statusCode:C.status,body:R})}))}),HV(i)];return t&&A.push(new Promise((C,k)=>{const T=()=>{const S=FE(t);k(S)};if(typeof t.addEventListener=="function"){const S=t;S.addEventListener("abort",T,{once:!0}),v=()=>S.removeEventListener("abort",T)}else t.onabort=T})),Promise.race(A).finally(v)}updateHttpClientConfig(e,t){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=t,n))}httpHandlerConfigs(){return this.config??{}}}function FE(r){const e=r&&typeof r=="object"&&"reason"in r?r.reason:void 0;if(e){if(e instanceof Error){const i=new Error("Request aborted");return i.name="AbortError",i.cause=e,i}const n=new Error(String(e));return n.name="AbortError",n}const t=new Error("Request aborted");return t.name="AbortError",t}const jV=async r=>typeof Blob=="function"&&r instanceof Blob||r.constructor?.name==="Blob"?Blob.prototype.arrayBuffer!==void 0?new Uint8Array(await r.arrayBuffer()):GV(r):$V(r);async function GV(r){const e=await qV(r),t=nm(e);return new Uint8Array(t)}async function $V(r){const e=[],t=r.getReader();let n=!1,i=0;for(;!n;){const{done:o,value:l}=await t.read();l&&(e.push(l),i+=l.length),n=o}const a=new Uint8Array(i);let s=0;for(const o of e)a.set(o,s),s+=o.length;return a}function qV(r){return new Promise((e,t)=>{const n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return t(new Error("Reader aborted too early"));const i=n.result??"",a=i.indexOf(","),s=a>-1?a+1:i.length;e(i.substring(s))},n.onabort=()=>t(new Error("Read aborted")),n.onerror=()=>t(n.error),n.readAsDataURL(r)})}const BI={},pA={};for(let r=0;r<256;r++){let e=r.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),BI[r]=e,pA[e]=r}function WV(r){if(r.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2){const n=r.slice(t,t+2).toLowerCase();if(n in pA)e[t/2]=pA[n];else throw new Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return e}function kl(r){let e="";for(let t=0;t<r.byteLength;t++)e+=BI[r[t]];return e}const gA=async(r=new Uint8Array,e)=>{if(r instanceof Uint8Array)return Sl.mutate(r);if(!r)return Sl.mutate(new Uint8Array);const t=e.streamCollector(r);return Sl.mutate(await t)},tg=r=>typeof r=="function"?r():r,MI=(r,e,t,n,i)=>({name:e,namespace:r,traits:t,input:n,output:i}),QV=r=>(e,t)=>async n=>{const{response:i}=await e(n),{operationSchema:a}=Sc(t),[,s,o,l,u,c]=a??[];try{const h=await r.protocol.deserializeResponse(MI(s,o,l,u,c),{...r,...t},i);return{response:i,output:h}}catch(h){if(Object.defineProperty(h,"$response",{value:i,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in h)){const f="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";try{h.message+=`
|
|
2789
2802
|
`+f}catch{!t.logger||t.logger?.constructor?.name==="NoOpLogger"?console.warn(f):t.logger?.warn?.(f)}typeof h.$responseBodyText<"u"&&h.$response&&(h.$response.body=h.$responseBodyText);try{if(fc.isInstance(i)){const{headers:d={}}=i,g=Object.entries(d);h.$metadata={httpStatusCode:i.statusCode,requestId:Lv(/^x-[\w-]+-request-?id$/,g),extendedRequestId:Lv(/^x-[\w-]+-id-2$/,g),cfId:Lv(/^x-[\w-]+-cf-id$/,g)}}}catch{}}throw h}},Lv=(r,e)=>(e.find(([t])=>t.match(r))||[void 0,void 0])[1];function YV(r){const e={};if(r=r.replace(/^\?/,""),r)for(const t of r.split("&")){let[n,i=null]=t.split("=");n=decodeURIComponent(n),i&&(i=decodeURIComponent(i)),n in e?Array.isArray(e[n])?e[n].push(i):e[n]=[e[n],i]:e[n]=i}return e}const dc=r=>{if(typeof r=="string")return dc(new URL(r));const{hostname:e,pathname:t,port:n,protocol:i,search:a}=r;let s;return a&&(s=YV(a)),{hostname:e,port:n?parseInt(n):void 0,protocol:i,path:t,query:s}},XV=r=>{if(typeof r=="object"){if("url"in r){const e=dc(r.url);if(r.headers){e.headers={};for(const[t,n]of Object.entries(r.headers))e.headers[t.toLowerCase()]=n.join(", ")}return e}return r}return dc(r)},JV=r=>(e,t)=>async n=>{const{operationSchema:i}=Sc(t),[,a,s,o,l,u]=i??[],c=t.endpointV2?async()=>XV(t.endpointV2):r.endpoint,h=await r.protocol.serializeRequest(MI(a,s,o,l,u),n.input,{...r,...t,endpoint:c});return e({...n,request:h})},KV={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},ZV={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function ez(r){return{applyToStack:e=>{e.add(JV(r),ZV),e.add(QV(r),KV),r.protocol.setSerdeContext(r)}}}const Uv=[];function Jf(r){if(typeof r=="object")return r;if(r=r|0,Uv[r])return Uv[r];const e={};let t=0;for(const n of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])(r>>t++&1)===1&&(e[n]=1);return Uv[r]=e}const Mf={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},Vv=[],zv={};class vi{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=vi.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;const n=[];let i=e,a=e;for(this._isMemberSchema=!1;Hv(i);)n.push(i[1]),i=i[0],a=tg(i),this._isMemberSchema=!0;if(n.length>0){this.memberTraits={};for(let s=n.length-1;s>=0;--s){const o=n[s];Object.assign(this.memberTraits,Jf(o))}}else this.memberTraits=0;if(a instanceof vi){const s=this.memberTraits;Object.assign(this,a),this.memberTraits=Object.assign({},s,a.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=t??a.memberName;return}if(this.schema=tg(a),tz(this.schema)?(this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3]):(this.name=this.memberName??String(a),this.traits=0),this._isMemberSchema&&!t)throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){const t=this.prototype.isPrototypeOf(e);return!t&&typeof e=="object"&&e!==null?e.symbol===this.symbol:t}static of(e){const t=typeof e=="function"||typeof e=="object"&&e!==null;if(typeof e=="number"){if(Vv[e])return Vv[e]}else if(typeof e=="string"){if(zv[e])return zv[e]}else if(t&&e[Mf.ns])return e[Mf.ns];const n=tg(e);if(n instanceof vi)return n;if(Hv(n)){const[a,s]=n;if(a instanceof vi)return Object.assign(a.getMergedTraits(),Jf(s)),a;throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}const i=new vi(n);return t?e[Mf.ns]=i:typeof n=="string"?zv[n]=i:typeof n=="number"?Vv[n]=i:i}getSchema(){const e=this.schema;return Array.isArray(e)&&e[0]===0?e[4]:e}getName(e=!1){const{name:t}=this;return!e&&t&&t.includes("#")?t.split("#")[1]:t||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 e=this.getSchema();if(typeof e!="object")return!1;const t=e[0];return t===3||t===-3||t===4}isUnionSchema(){const e=this.getSchema();return typeof e!="object"?!1:e[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(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return Jf(this.memberTraits)}getOwnTraits(){return Jf(this.traits)}getKeySchema(){const[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);const n=this.getSchema(),i=e?15:n[4]??0;return _f([i,0],"key")}getValueSchema(){const e=this.getSchema(),[t,n,i]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],a=typeof e=="number"?63&e:e&&typeof e=="object"&&(n||i)?e[3+e[0]]:t?15:void 0;if(a!=null)return _f([a,0],n?"value":"member");throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){const t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){const n=t[4].indexOf(e),i=t[5][n];return _f(Hv(i)?i:[i,0],e)}if(this.isDocumentSchema())return _f([15,0],e);throw new Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){const e={};try{for(const[t,n]of this.structIterator())e[t]=n}catch{}return e}getEventStreamMember(){if(this.isStructSchema()){for(const[e,t]of this.structIterator())if(t.isStreaming()&&t.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(),t=e[4].length;let n=e[Mf.it];if(n&&t===n.length){yield*n;return}n=Array(t);for(let i=0;i<t;++i){const a=e[4][i],s=_f([e[5][i],0],a);yield n[i]=[a,s]}e[Mf.it]=n}}function _f(r,e){if(r instanceof vi)return Object.assign(r,{memberName:e,_isMemberSchema:!0});const t=vi;return new t(r,e)}const Hv=r=>Array.isArray(r)&&r.length===2,tz=r=>Array.isArray(r)&&r.length>=5;class ra{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,n=new Map){this.namespace=e,this.schemas=t,this.exceptions=n}static for(e){return ra.registries.has(e)||ra.registries.set(e,new ra(e)),ra.registries.get(e)}copyFrom(e){const{schemas:t,exceptions:n}=this;for(const[i,a]of e.schemas)t.has(i)||t.set(i,a);for(const[i,a]of e.exceptions)n.has(i)||n.set(i,a)}register(e,t){const n=this.normalizeShapeId(e);for(const i of[this,ra.for(n.split("#")[0])])i.schemas.set(n,t)}getSchema(e){const t=this.normalizeShapeId(e);if(!this.schemas.has(t))throw new Error(`@smithy/core/schema - schema not found for ${t}`);return this.schemas.get(t)}registerError(e,t){const n=e,i=n[1];for(const a of[this,ra.for(i)])a.schemas.set(i+"#"+n[2],n),a.exceptions.set(n,t)}getErrorCtor(e){const t=e;return this.exceptions.has(t)?this.exceptions.get(t):ra.for(t[1]).exceptions.get(t)}getBaseException(){for(const e of this.exceptions.keys())if(Array.isArray(e)){const[,t,n]=e,i=t+"#"+n;if(i.startsWith("smithy.ts.sdk.synthetic.")&&i.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 mA=r=>{if(r!=null){if(typeof r=="string"){const e=parseFloat(r);if(!Number.isNaN(e))return String(e)!==String(r)&&cz.warn(uz(`Expected number but observed string: ${r}`)),e}if(typeof r=="number")return r;throw new TypeError(`Expected number, got ${typeof r}: ${r}`)}},rz=Math.ceil(2**127*(2-2**-23)),TE=r=>{const e=mA(r);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>rz)throw new TypeError(`Expected 32-bit float, got ${r}`);return e},nz=r=>{if(r!=null){if(Number.isInteger(r)&&!Number.isNaN(r))return r;throw new TypeError(`Expected integer, got ${typeof r}: ${r}`)}},IE=r=>_I(r,16),DE=r=>_I(r,8),_I=(r,e)=>{const t=nz(r);if(t!==void 0&&iz(t,e)!==t)throw new TypeError(`Expected ${e}-bit integer, got ${r}`);return t},iz=(r,e)=>{switch(e){case 32:return Int32Array.of(r)[0];case 16:return Int16Array.of(r)[0];case 8:return Int8Array.of(r)[0]}},az=r=>mA(typeof r=="string"?am(r):r),sz=r=>TE(typeof r=="string"?am(r):r),oz=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,am=r=>{const e=r.match(oz);if(e===null||e[0].length!==r.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(r)},Fg=r=>IE(typeof r=="string"?am(r):r),lz=r=>DE(typeof r=="string"?am(r):r),uz=r=>String(new TypeError(r).stack||r).split(`
|
|
2790
2803
|
`).slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join(`
|
|
2791
|
-
`),cz={warn:console.warn},fz=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],N1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function dz(r){const e=r.getUTCFullYear(),t=r.getUTCMonth(),n=r.getUTCDay(),i=r.getUTCDate(),a=r.getUTCHours(),s=r.getUTCMinutes(),o=r.getUTCSeconds(),l=i<10?`0${i}`:`${i}`,u=a<10?`0${a}`:`${a}`,c=s<10?`0${s}`:`${s}`,h=o<10?`0${o}`:`${o}`;return`${fz[n]}, ${l} ${N1[t]} ${e} ${u}:${c}:${h} GMT`}const hz=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),pz=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=hz.exec(r);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[t,n,i,a,s,o,l,u,c]=e,h=Fg(Bd(n)),f=bo(i,"month",1,12),d=bo(a,"day",1,31),g=rg(h,f,d,{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u});return c.toUpperCase()!="Z"&&g.setTime(g.getTime()-kz(c)),g},gz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),mz=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),vz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),NI=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=gz.exec(r);if(e){const[t,n,i,a,s,o,l,u]=e;return rg(Fg(Bd(a)),jv(i),bo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u})}if(e=mz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return wz(rg(Az(a),jv(i),bo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u}))}if(e=vz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return rg(Fg(Bd(u)),jv(n),bo(i.trimLeft(),"day",1,31),{hours:a,minutes:s,seconds:o,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},yz=r=>{if(r==null)return;let e;if(typeof r=="number")e=r;else if(typeof r=="string")e=az(r);else if(typeof r=="object"&&r.tag===1)e=r.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},rg=(r,e,t,n)=>{const i=e-1;return xz(r,i,t),new Date(Date.UTC(r,i,t,bo(n.hours,"hour",0,23),bo(n.minutes,"minute",0,59),bo(n.seconds,"seconds",0,60),Ez(n.fractionalMilliseconds)))},Az=r=>{const e=new Date().getUTCFullYear(),t=Math.floor(e/100)*100+Fg(Bd(r));return t<e?t+100:t},bz=50*365*24*60*60*1e3,wz=r=>r.getTime()-new Date().getTime()>bz?new Date(Date.UTC(r.getUTCFullYear()-100,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())):r,jv=r=>{const e=N1.indexOf(r);if(e<0)throw new TypeError(`Invalid month: ${r}`);return e+1},Cz=[31,28,31,30,31,30,31,31,30,31,30,31],xz=(r,e,t)=>{let n=Cz[e];if(e===1&&Sz(r)&&(n=29),t>n)throw new TypeError(`Invalid day for ${N1[e]} in ${r}: ${t}`)},Sz=r=>r%4===0&&(r%100!==0||r%400===0),bo=(r,e,t,n)=>{const i=lz(Bd(r));if(i<t||i>n)throw new TypeError(`${e} must be between ${t} and ${n}, inclusive`);return i},Ez=r=>r==null?0:sz("0."+r)*1e3,kz=r=>{const e=r[0];let t=1;if(e=="+")t=1;else if(e=="-")t=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(r.substring(1,3)),i=Number(r.substring(4,6));return t*(n*60+i)*60*1e3},Bd=r=>{let e=0;for(;e<r.length-1&&r.charAt(e)==="0";)e++;return e===0?r:r.slice(e)},PE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ti=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0")),LI=()=>{if(PE)return PE();const r=new Uint8Array(16);return crypto.getRandomValues(r),r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ti[r[0]]+Ti[r[1]]+Ti[r[2]]+Ti[r[3]]+"-"+Ti[r[4]]+Ti[r[5]]+"-"+Ti[r[6]]+Ti[r[7]]+"-"+Ti[r[8]]+Ti[r[9]]+"-"+Ti[r[10]]+Ti[r[11]]+Ti[r[12]]+Ti[r[13]]+Ti[r[14]]+Ti[r[15]]},mo=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};mo.from=r=>r&&typeof r=="object"&&(r instanceof mo||"deserializeJSON"in r)?r:typeof r=="string"||Object.getPrototypeOf(r)===String.prototype?mo(String(r)):mo(JSON.stringify(r));mo.fromObject=mo.from;const RE=/^-?\d*(\.\d+)?$/;class as{string;type;constructor(e,t){if(this.string=e,this.type=t,!RE.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 t=e;return as.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&RE.test(t.string)}}class Fz{serdeContext;setSerdeContext(e){this.serdeContext=e}}class Tz extends Fz{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=ra.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return aa}getResponseType(){return fc}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,i]of t.url.searchParams.entries())e.query[n]=i;if(t.headers)for(const[n,i]of Object.entries(t.headers))e.headers[n]=i.join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const[n,i]of Object.entries(t.headers))e.headers[n]=i;return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const i=vi.of(t.input),a=Jf(t.traits??{});if(a.endpoint){let s=a.endpoint?.[0];if(typeof s=="string"){const o=[...i.structIterator()].filter(([,l])=>l.getMergedTraits().hostLabel);for(const[l]of o){const u=n[l];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${l} in input must be a string as hostLabel.`);s=s.replace(`{${l}}`,u)}e.hostname=s+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:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e}=await Promise.resolve().then(()=>require("./index-p1RlkR6Z.cjs"));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,t,n,i,a){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Iz extends Tz{async serializeRequest(e,t,n){const i=this.serializer,a={},s={},o=await n.endpoint(),l=vi.of(e?.input),u=l.getSchema();let c;const h=t&&typeof t=="object"?t:{},f=new aa({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:a,headers:s,body:void 0});if(o&&(this.updateServiceEndpoint(f,o),this.setHostPrefix(f,e,h)),h){const d=l.getEventStreamMember();if(d){if(h[d]){const g={};for(const[v,y]of l.structIterator())v!==d&&h[v]&&(i.write(y,h[v]),g[v]=i.flush());c=await this.serializeEventStream({eventStream:h[d],requestSchema:l,initialRequest:g})}}else i.write(u,h),c=i.flush()}return f.headers=Object.assign(f.headers,s),f.query=a,f.body=c,f.method="POST",f}async deserializeResponse(e,t,n){const i=this.deserializer,a=vi.of(e.output),s={};if(n.statusCode>=300){const l=await gA(n.body,t);throw l.byteLength>0&&Object.assign(s,await i.read(15,l)),await this.handleError(e,t,n,s,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const l in n.headers){const u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}const o=a.getEventStreamMember();if(o)s[o]=await this.deserializeEventStream({response:n,responseSchema:a,initialResponseContainer:s});else{const l=await gA(n.body,t);l.byteLength>0&&Object.assign(s,await i.read(a,l))}return s.$metadata=this.deserializeMetadata(n),s}}function UI(r,e){if(e.timestampFormat.useTrait&&r.isTimestampSchema()&&(r.getSchema()===5||r.getSchema()===6||r.getSchema()===7))return r.getSchema();const{httpLabel:t,httpPrefixHeaders:n,httpHeader:i,httpQuery:a}=r.getMergedTraits();return(e.httpBindings?typeof n=="string"||i?6:a||t?5:void 0:void 0)??e.timestampFormat.default}function Dz(r,e,t){r.__smithy_context?r.__smithy_context.features||(r.__smithy_context.features={}):r.__smithy_context={features:{}},r.__smithy_context.features[e]=t}class Pz{authSchemes=new Map;constructor(e){for(const[t,n]of Object.entries(e))n!==void 0&&this.authSchemes.set(t,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}class Rz{async sign(e,t,n){return e}}const Oz=r=>function(t){return VI(t)&&t.expiration.getTime()-Date.now()<r},Bz=3e5,Mz=Oz(Bz),VI=r=>r.expiration!==void 0,_z=(r,e,t)=>{if(r===void 0)return;const n=typeof r!="function"?async()=>Promise.resolve(r):r;let i,a,s,o=!1;const l=async u=>{a||(a=n(u));try{i=await a,s=!0,o=!1}finally{a=void 0}return i};return e===void 0?async u=>((!s||u?.forceRefresh)&&(i=await l(u)),i):async u=>((!s||u?.forceRefresh)&&(i=await l(u)),o?i:t(i)?(e(i)&&await l(u),i):(o=!0,i))},Nz=void 0;function Lz(r){return r===void 0?!0:typeof r=="string"&&r.length<=50}function Uz(r){const e=ld(r.userAgentAppId??Nz),{customUserAgent:t}=r;return Object.assign(r,{customUserAgent:typeof t=="string"?[[t]]:t,userAgentAppId:async()=>{const n=await e();if(!Lz(n)){const i=r.logger?.constructor?.name==="NoOpLogger"||!r.logger?console:r.logger;typeof n!="string"?i?.warn("userAgentAppId must be a string or undefined."):n.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}class Vz{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const i=this.data.keys();let a=0;for(;;){const{value:s,done:o}=i.next();if(this.data.delete(s),o||++a>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(n.length===0)return!1;for(const i of n){const a=String(e[i]??"");if(a.includes("|;"))return!1;t+=a+"|;"}return t}}const zz=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}$"),L1=r=>zz.test(r)||r.startsWith("[")&&r.endsWith("]"),Hz=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),oh=(r,e=!1)=>{if(!e)return Hz.test(r);const t=r.split(".");for(const n of t)if(!oh(n))return!1;return!0},Md={},_d="endpoints";function Po(r){return typeof r!="object"||r==null?r:"ref"in r?`$${Po(r.ref)}`:"fn"in r?`${r.fn}(${(r.argv||[]).map(Po).join(", ")})`:JSON.stringify(r,null,2)}class sa extends Error{constructor(e){super(e),this.name="EndpointError"}}const jz=(r,e)=>r===e,Gz=r=>{const e=r.split("."),t=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new sa(`Path: '${r}' does not end with ']'`);const a=n.slice(i+1,-1);if(Number.isNaN(parseInt(a)))throw new sa(`Invalid array index: '${a}' in path: '${r}'`);i!==0&&t.push(n.slice(0,i)),t.push(a)}else t.push(n)}return t},zI=(r,e)=>Gz(e).reduce((t,n)=>{if(typeof t!="object")throw new sa(`Index '${n}' in '${e}' not found in '${JSON.stringify(r)}'`);return Array.isArray(t)?t[parseInt(n)]:t[n]},r),$z=r=>r!=null,qz=r=>!r,Gv={[Pd.HTTP]:80,[Pd.HTTPS]:443},Wz=r=>{const e=(()=>{try{if(r instanceof URL)return r;if(typeof r=="object"&&"hostname"in r){const{hostname:f,port:d,protocol:g="",path:v="",query:y={}}=r,A=new URL(`${g}//${f}${d?`:${d}`:""}${v}`);return A.search=Object.entries(y).map(([C,k])=>`${C}=${k}`).join("&"),A}return new URL(r)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(r)} as a whatwg URL.`),null;const t=e.href,{host:n,hostname:i,pathname:a,protocol:s,search:o}=e;if(o)return null;const l=s.slice(0,-1);if(!Object.values(Pd).includes(l))return null;const u=L1(i),c=t.includes(`${n}:${Gv[l]}`)||typeof r=="string"&&r.includes(`${n}:${Gv[l]}`),h=`${n}${c?`:${Gv[l]}`:""}`;return{scheme:l,authority:h,path:a,normalizedPath:a.endsWith("/")?a:`${a}/`,isIp:u}},Qz=(r,e)=>r===e,Yz=(r,e,t,n)=>e>=t||r.length<t||/[^\u0000-\u007f]/.test(r)?null:n?r.substring(r.length-t,r.length-e):r.substring(e,t),Xz=r=>encodeURIComponent(r).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Jz={booleanEquals:jz,getAttr:zI,isSet:$z,isValidHostLabel:oh,not:qz,parseURL:Wz,stringEquals:Qz,substring:Yz,uriEncode:Xz},HI=(r,e)=>{const t=[],n={...e.endpointParams,...e.referenceRecord};let i=0;for(;i<r.length;){const a=r.indexOf("{",i);if(a===-1){t.push(r.slice(i));break}t.push(r.slice(i,a));const s=r.indexOf("}",a);if(s===-1){t.push(r.slice(a));break}r[a+1]==="{"&&r[s+1]==="}"&&(t.push(r.slice(a+1,s)),i=s+2);const o=r.substring(a+1,s);if(o.includes("#")){const[l,u]=o.split("#");t.push(zI(n[l],u))}else t.push(n[o]);i=s+1}return t.join("")},Kz=({ref:r},e)=>({...e.endpointParams,...e.referenceRecord})[r],sm=(r,e,t)=>{if(typeof r=="string")return HI(r,t);if(r.fn)return GI.callFunction(r,t);if(r.ref)return Kz(r,t);throw new sa(`'${e}': ${String(r)} is not a string, function or reference.`)},jI=({fn:r,argv:e},t)=>{const n=e.map(a=>["boolean","number"].includes(typeof a)?a:GI.evaluateExpression(a,"arg",t)),i=r.split(".");return i[0]in Md&&i[1]!=null?Md[i[0]][i[1]](...n):Jz[r](...n)},GI={evaluateExpression:sm,callFunction:jI},Zz=({assign:r,...e},t)=>{if(r&&r in t.referenceRecord)throw new sa(`'${r}' is already defined in Reference Record.`);const n=jI(e,t);return t.logger?.debug?.(`${_d} evaluateCondition: ${Po(e)} = ${Po(n)}`),{result:n===""?!0:!!n,...r!=null&&{toAssign:{name:r,value:n}}}},U1=(r=[],e)=>{const t={};for(const n of r){const{result:i,toAssign:a}=Zz(n,{...e,referenceRecord:{...e.referenceRecord,...t}});if(!i)return{result:i};a&&(t[a.name]=a.value,e.logger?.debug?.(`${_d} assign: ${a.name} := ${Po(a.value)}`))}return{result:!0,referenceRecord:t}},eH=(r,e)=>Object.entries(r).reduce((t,[n,i])=>({...t,[n]:i.map(a=>{const s=sm(a,"Header value entry",e);if(typeof s!="string")throw new sa(`Header '${n}' value '${s}' is not a string`);return s})}),{}),$I=(r,e)=>Object.entries(r).reduce((t,[n,i])=>({...t,[n]:WI.getEndpointProperty(i,e)}),{}),qI=(r,e)=>{if(Array.isArray(r))return r.map(t=>qI(t,e));switch(typeof r){case"string":return HI(r,e);case"object":if(r===null)throw new sa(`Unexpected endpoint property: ${r}`);return WI.getEndpointProperties(r,e);case"boolean":return r;default:throw new sa(`Unexpected endpoint property type: ${typeof r}`)}},WI={getEndpointProperty:qI,getEndpointProperties:$I},tH=(r,e)=>{const t=sm(r,"Endpoint URL",e);if(typeof t=="string")try{return new URL(t)}catch(n){throw console.error(`Failed to construct URL with ${t}`,n),n}throw new sa(`Endpoint URL must be a string, got ${typeof t}`)},rH=(r,e)=>{const{conditions:t,endpoint:n}=r,{result:i,referenceRecord:a}=U1(t,e);if(!i)return;const s={...e,referenceRecord:{...e.referenceRecord,...a}},{url:o,properties:l,headers:u}=n;return e.logger?.debug?.(`${_d} Resolving endpoint from template: ${Po(n)}`),{...u!=null&&{headers:eH(u,s)},...l!=null&&{properties:$I(l,s)},url:tH(o,s)}},nH=(r,e)=>{const{conditions:t,error:n}=r,{result:i,referenceRecord:a}=U1(t,e);if(i)throw new sa(sm(n,"Error",{...e,referenceRecord:{...e.referenceRecord,...a}}))},QI=(r,e)=>{for(const t of r)if(t.type==="endpoint"){const n=rH(t,e);if(n)return n}else if(t.type==="error")nH(t,e);else if(t.type==="tree"){const n=YI.evaluateTreeRule(t,e);if(n)return n}else throw new sa(`Unknown endpoint rule: ${t}`);throw new sa("Rules evaluation failed")},iH=(r,e)=>{const{conditions:t,rules:n}=r,{result:i,referenceRecord:a}=U1(t,e);if(i)return YI.evaluateRules(n,{...e,referenceRecord:{...e.referenceRecord,...a}})},YI={evaluateRules:QI,evaluateTreeRule:iH},aH=(r,e)=>{const{endpointParams:t,logger:n}=e,{parameters:i,rules:a}=r;e.logger?.debug?.(`${_d} Initial EndpointParams: ${Po(t)}`);const s=Object.entries(i).filter(([,u])=>u.default!=null).map(([u,c])=>[u,c.default]);if(s.length>0)for(const[u,c]of s)t[u]=t[u]??c;const o=Object.entries(i).filter(([,u])=>u.required).map(([u])=>u);for(const u of o)if(t[u]==null)throw new sa(`Missing required parameter: '${u}'`);const l=QI(a,{endpointParams:t,logger:n,referenceRecord:{}});return e.logger?.debug?.(`${_d} Resolved endpoint: ${Po(l)}`),l},XI=(r,e=!1)=>{if(e){for(const t of r.split("."))if(!XI(t))return!1;return!0}return!(!oh(r)||r.length<3||r.length>63||r!==r.toLowerCase()||L1(r))},OE=":",sH="/",oH=r=>{const e=r.split(OE);if(e.length<6)return null;const[t,n,i,a,s,...o]=e;if(t!=="arn"||n===""||i===""||o.join(OE)==="")return null;const l=o.map(u=>u.split(sH)).flat();return{partition:n,service:i,region:a,accountId:s,resourceId:l}},lH=[{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:"AWS European Sovereign Cloud (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)"}}}],uH={partitions:lH};let cH=uH;const fH=r=>{const{partitions:e}=cH;for(const n of e){const{regions:i,outputs:a}=n;for(const[s,o]of Object.entries(i))if(s===r)return{...a,...o}}for(const n of e){const{regionRegex:i,outputs:a}=n;if(new RegExp(i).test(r))return{...a}}const t=e.find(n=>n.id==="aws");if(!t)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...t.outputs}},dH={isVirtualHostableS3Bucket:XI,parseArn:oH,partition:fH};Md.aws=dH;function hH(r,e,t){return r.$source||(r.$source={}),r.$source[e]=t,r}function Ds(r,e,t){r.__aws_sdk_context?r.__aws_sdk_context.features||(r.__aws_sdk_context.features={}):r.__aws_sdk_context={features:{}},r.__aws_sdk_context.features[e]=t}var Nd;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(Nd||(Nd={}));Nd.STANDARD;const pH=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],gH=["TimeoutError","RequestTimeout","RequestTimeoutException"],mH=[500,502,503,504],vH=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],yH=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],AH=r=>r?.$retryable!==void 0,bH=r=>r.$metadata?.clockSkewCorrected,wH=r=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return r&&r instanceof TypeError?e.has(r.message):!1},JI=r=>r.$metadata?.httpStatusCode===429||pH.includes(r.name)||r.$retryable?.throttling==!0,V1=(r,e=0)=>AH(r)||bH(r)||gH.includes(r.name)||vH.includes(r?.code||"")||yH.includes(r?.code||"")||mH.includes(r.$metadata?.httpStatusCode||0)||wH(r)||r.cause!==void 0&&e<=10&&V1(r.cause,e+1),CH=r=>{if(r.$metadata?.httpStatusCode!==void 0){const e=r.$metadata.httpStatusCode;return 500<=e&&e<=599&&!V1(r)}return!1},xH=/\d{12}\.ddb/;async function SH(r,e,t){if(t.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Ds(r,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const a=await e.retryStrategy();if(typeof a.mode=="string")switch(a.mode){case Nd.ADAPTIVE:Ds(r,"RETRY_MODE_ADAPTIVE","F");break;case Nd.STANDARD:Ds(r,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){const a=r.endpointV2;switch(String(a?.url?.hostname).match(xH)&&Ds(r,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":Ds(r,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Ds(r,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Ds(r,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=r.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const a=i;a.accountId&&Ds(r,"RESOLVED_ACCOUNT_ID","T");for(const[s,o]of Object.entries(a.$source??{}))Ds(r,s,o)}}const BE="user-agent",$v="x-amz-user-agent",ME=" ",qv="/",EH=/[^!$%&'*+\-.^_`|~\w]/g,kH=/[^!$%&'*+\-.^_`|~\w#]/g,_E="-",FH=1024;function TH(r){let e="";for(const t in r){const n=r[t];if(e.length+n.length+1<=FH){e.length?e+=","+n:e+=n;continue}break}return e}const IH=r=>(e,t)=>async n=>{const{request:i}=n;if(!aa.isInstance(i))return e(n);const{headers:a}=i,s=t?.userAgent?.map(_p)||[],o=(await r.defaultUserAgentProvider()).map(_p);await SH(t,r,n);const l=t;o.push(`m/${TH(Object.assign({},t.__smithy_context?.features,l.__aws_sdk_context?.features))}`);const u=r?.customUserAgent?.map(_p)||[],c=await r.userAgentAppId();c&&o.push(_p(["app",`${c}`]));const h=[].concat([...o,...s,...u]).join(ME),f=[...o.filter(d=>d.startsWith("aws-sdk-")),...u].join(ME);return r.runtime!=="browser"?(f&&(a[$v]=a[$v]?`${a[BE]} ${f}`:f),a[BE]=h):a[$v]=h,e({...n,request:i})},_p=r=>{const e=r[0].split(qv).map(s=>s.replace(EH,_E)).join(qv),t=r[1]?.replace(kH,_E),n=e.indexOf(qv),i=e.substring(0,n);let a=e.substring(n+1);return i==="api"&&(a=a.toLowerCase()),[i,a,t].filter(s=>s&&s.length>0).reduce((s,o,l)=>{switch(l){case 0:return o;case 1:return`${s}/${o}`;default:return`${s}#${o}`}},"")},DH={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},PH=r=>({applyToStack:e=>{e.add(IH(r),DH)}}),RH=!1,OH=!1,NE=new Set,BH=(r,e=oh)=>{if(!NE.has(r)&&!e(r))if(r==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${r}" is not a valid hostname component.`);else NE.add(r)},KI=r=>typeof r=="string"&&(r.startsWith("fips-")||r.endsWith("-fips")),MH=r=>KI(r)?["fips-aws-global","aws-fips"].includes(r)?"us-east-1":r.replace(/fips-(dkr-|prod-)?|-fips/,""):r,_H=r=>{const{region:e,useFipsEndpoint:t}=r;if(!e)throw new Error("Region is missing");return Object.assign(r,{region:async()=>{const n=typeof e=="function"?await e():e,i=MH(n);return BH(i),i},useFipsEndpoint:async()=>{const n=typeof e=="string"?e:await e();return KI(n)?!0:typeof t!="function"?Promise.resolve(!!t):t()}})},LE="content-length";function NH(r){return e=>async t=>{const n=t.request;if(aa.isInstance(n)){const{body:i,headers:a}=n;if(i&&Object.keys(a).map(s=>s.toLowerCase()).indexOf(LE)===-1)try{const s=r(i);n.headers={...n.headers,[LE]:String(s)}}catch{}}return e({...t,request:n})}}const LH={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},UH=r=>({applyToStack:e=>{e.add(NH(r.bodyLengthChecker),LH)}}),VH=async r=>{const e=r?.Bucket||"";if(typeof r.Bucket=="string"&&(r.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),$H(e)){if(r.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!GH(e)||e.indexOf(".")!==-1&&!String(r.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(r.ForcePathStyle=!0);return r.DisableMultiRegionAccessPoints&&(r.disableMultiRegionAccessPoints=!0,r.DisableMRAP=!0),r},zH=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,HH=/(\d+\.){3}\d+/,jH=/\.\./,GH=r=>zH.test(r)&&!HH.test(r)&&!jH.test(r),$H=r=>{const[e,t,n,,,i]=r.split(":"),a=e==="arn"&&r.split(":").length>=6,s=!!(a&&t&&n&&i);if(a&&!s)throw new Error(`Invalid ARN: ${r} was an invalid ARN.`);return s},qH=(r,e,t,n=!1)=>{const i=async()=>{let a;return n?a=t.clientContextParams?.[r]??t[r]??t[e]:a=t[r]??t[e],typeof a=="function"?a():a};return r==="credentialScope"||e==="CredentialScope"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.credentialScope??a?.CredentialScope}:r==="accountId"||e==="AccountId"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.accountId??a?.AccountId}:r==="endpoint"||e==="endpoint"?async()=>{if(t.isCustomEndpoint===!1)return;const a=await i();if(a&&typeof a=="object"){if("url"in a)return a.url.href;if("hostname"in a){const{protocol:s,hostname:o,port:l,path:u}=a;return`${s}//${o}${l?":"+l:""}${u}`}}return a}:i},ZI=async r=>{},eD=r=>{if(typeof r=="object"){if("url"in r){const e=dc(r.url);if(r.headers){e.headers={};for(const[t,n]of Object.entries(r.headers))e.headers[t.toLowerCase()]=n.join(", ")}return e}return r}return dc(r)},WH=async(r,e,t,n)=>{if(!t.isCustomEndpoint){let s;t.serviceConfiguredEndpoint?s=await t.serviceConfiguredEndpoint():s=await ZI(t.serviceId),s&&(t.endpoint=()=>Promise.resolve(eD(s)),t.isCustomEndpoint=!0)}const i=await QH(r,e,t);if(typeof t.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const a=t.endpointProvider(i,n);if(t.isCustomEndpoint&&t.endpoint){const s=await t.endpoint();if(s?.headers){a.headers??={};for(const[o,l]of Object.entries(s.headers))a.headers[o]=Array.isArray(l)?l:[l]}}return a},QH=async(r,e,t)=>{const n={},i=e?.getEndpointParameterInstructions?.()||{};for(const[a,s]of Object.entries(i))switch(s.type){case"staticContextParams":n[a]=s.value;break;case"contextParams":n[a]=r[s.name];break;case"clientContextParams":case"builtInParams":n[a]=await qH(s.name,a,t,s.type!=="builtInParams")();break;case"operationContextParams":n[a]=s.get(r);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return Object.keys(i).length===0&&Object.assign(n,t),String(t.serviceId).toLowerCase()==="s3"&&await VH(n),n},YH=({config:r,instructions:e})=>(t,n)=>async i=>{r.isCustomEndpoint&&Dz(n,"ENDPOINT_OVERRIDE","N");const a=await WH(i.input,{getEndpointParameterInstructions(){return e}},{...r},n);n.endpointV2=a,n.authSchemes=a.properties?.authSchemes;const s=n.authSchemes?.[0];if(s){n.signing_region=s.signingRegion,n.signing_service=s.signingName;const l=Sc(n)?.selectedHttpAuthScheme?.httpAuthOption;l&&(l.signingProperties=Object.assign(l.signingProperties||{},{signing_region:s.signingRegion,signingRegion:s.signingRegion,signing_service:s.signingName,signingName:s.signingName,signingRegionSet:s.signingRegionSet},s.properties))}return t({...i})},XH={name:"serializerMiddleware"},JH={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:XH.name},tD=(r,e)=>({applyToStack:t=>{t.addRelativeTo(YH({config:r,instructions:e}),JH)}}),KH=r=>{const e=r.tls??!0,{endpoint:t,useDualstackEndpoint:n,useFipsEndpoint:i}=r,a=t!=null?async()=>eD(await Ls(t)()):void 0,o=Object.assign(r,{endpoint:a,tls:e,isCustomEndpoint:!!t,useDualstackEndpoint:Ls(n??!1),useFipsEndpoint:Ls(i??!1)});let l;return o.serviceConfiguredEndpoint=async()=>(r.serviceId&&!l&&(l=ZI(r.serviceId)),l),o};var hc;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(hc||(hc={}));const cd=3,ZH=hc.STANDARD;class z1{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if(n?.errorType==="THROTTLING"||JI(n?.error??e)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const a=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.availableTokens){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>z1.setTimeoutFn(n,t))}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){const n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}const rD=20*1e3,UE=500,ej=1,tj="amz-sdk-invocation-id",rj="amz-sdk-request";class Ui{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Ui.v2026?50:100}static throttlingDelay(){return Ui.v2026?1e3:500}static cost(){return Ui.v2026?14:5}static throttlingCost(){return Ui.v2026?5:10}static modifiedCostType(){return Ui.v2026?"THROTTLING":"TRANSIENT"}}class nj{x=Ui.delay();computeNextBackoffDelay(e){const i=Math.random()*Math.min(this.x*2**e,rD);return Math.floor(i)}setDelayBase(e){this.x=e}}class VE{delay;count;cost;longPoll;constructor(e,t,n,i){this.delay=e,this.count=t,this.cost=n,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(rD,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}class vA{mode=hc.STANDARD;capacity=UE;retryBackoffStrategy;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>cd,this.baseDelay??=Ui.delay(),this.retryBackoffStrategy??=new nj}async acquireInitialRetryToken(e){return new VE(Ui.delay(),0,void 0,Ui.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),i=this.shouldRetry(e,t,n);if(i||e.isLongPoll?.()){const a=t.errorType;this.retryBackoffStrategy.setDelayBase(a==="THROTTLING"?Ui.throttlingDelay():this.baseDelay);const s=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let o=s;if(t.retryAfterHint instanceof Date&&(o=Math.max(s,Math.min(t.retryAfterHint.getTime()-Date.now(),s+5e3))),i){const l=this.getCapacityCost(a);return this.capacity-=l,new VE(o,e.getRetryCount()+1,l,e.isLongPoll?.()??!1)}else throw Object.assign(new Error("No retry token available"),{$backoff:Ui.v2026?o:0})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(UE,this.capacity+(e.getRetryCost()??ej))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${cd}`),cd}}shouldRetry(e,t,n){return e.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e===Ui.modifiedCostType()?Ui.throttlingCost():Ui.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class ij{mode=hc.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new z1,this.standardRetryStrategy=t?new vA({maxAttempts:typeof e=="number"?e:3,...t}):new vA(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}const aj=r=>r instanceof Error?r:r instanceof Object?Object.assign(new Error,r):typeof r=="string"?new Error(r):new Error(`AWS SDK error wrapper for ${r}`),sj=r=>{const{retryStrategy:e,retryMode:t}=r,n=Ls(r.maxAttempts??cd);let i=e?Promise.resolve(e):void 0;const a=async()=>await Ls(t)()===hc.ADAPTIVE?new ij(n):new vA(n);return Object.assign(r,{maxAttempts:n,retryStrategy:()=>i??=a()})},pl=(r,e)=>{const t=[];if(r&&t.push(r),e)for(const n of e)t.push(n);return t},io=(r,e)=>`${r||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,Tg=()=>{let r=[],e=[],t=!1;const n=new Set,i=h=>h.sort((f,d)=>zE[d.step]-zE[f.step]||HE[d.priority||"normal"]-HE[f.priority||"normal"]),a=h=>{let f=!1;const d=g=>{const v=pl(g.name,g.aliases);if(v.includes(h)){f=!0;for(const y of v)n.delete(y);return!1}return!0};return r=r.filter(d),e=e.filter(d),f},s=h=>{let f=!1;const d=g=>{if(g.middleware===h){f=!0;for(const v of pl(g.name,g.aliases))n.delete(v);return!1}return!0};return r=r.filter(d),e=e.filter(d),f},o=h=>(r.forEach(f=>{h.add(f.middleware,{...f})}),e.forEach(f=>{h.addRelativeTo(f.middleware,{...f})}),h.identifyOnResolve?.(c.identifyOnResolve()),h),l=h=>{const f=[];return h.before.forEach(d=>{d.before.length===0&&d.after.length===0?f.push(d):f.push(...l(d))}),f.push(h),h.after.reverse().forEach(d=>{d.before.length===0&&d.after.length===0?f.push(d):f.push(...l(d))}),f},u=(h=!1)=>{const f=[],d=[],g={};return r.forEach(y=>{const A={...y,before:[],after:[]};for(const C of pl(A.name,A.aliases))g[C]=A;f.push(A)}),e.forEach(y=>{const A={...y,before:[],after:[]};for(const C of pl(A.name,A.aliases))g[C]=A;d.push(A)}),d.forEach(y=>{if(y.toMiddleware){const A=g[y.toMiddleware];if(A===void 0){if(h)return;throw new Error(`${y.toMiddleware} is not found when adding ${io(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}y.relation==="after"&&A.after.push(y),y.relation==="before"&&A.before.push(y)}}),i(f).map(l).reduce((y,A)=>(y.push(...A),y),[])},c={add:(h,f={})=>{const{name:d,override:g,aliases:v}=f,y={step:"initialize",priority:"normal",middleware:h,...f},A=pl(d,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${io(d,v)}'`);for(const C of A){const k=r.findIndex(S=>S.name===C||S.aliases?.some(R=>R===C));if(k===-1)continue;const T=r[k];if(T.step!==y.step||y.priority!==T.priority)throw new Error(`"${io(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${io(d,v)}" middleware with ${y.priority} priority in ${y.step} step.`);r.splice(k,1)}}for(const C of A)n.add(C)}r.push(y)},addRelativeTo:(h,f)=>{const{name:d,override:g,aliases:v}=f,y={middleware:h,...f},A=pl(d,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${io(d,v)}'`);for(const C of A){const k=e.findIndex(S=>S.name===C||S.aliases?.some(R=>R===C));if(k===-1)continue;const T=e[k];if(T.toMiddleware!==y.toMiddleware||T.relation!==y.relation)throw new Error(`"${io(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${io(d,v)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);e.splice(k,1)}}for(const C of A)n.add(C)}e.push(y)},clone:()=>o(Tg()),use:h=>{h.applyToStack(c)},remove:h=>typeof h=="string"?a(h):s(h),removeByTag:h=>{let f=!1;const d=g=>{const{tags:v,name:y,aliases:A}=g;if(v&&v.includes(h)){const C=pl(y,A);for(const k of C)n.delete(k);return f=!0,!1}return!0};return r=r.filter(d),e=e.filter(d),f},concat:h=>{const f=o(Tg());return f.use(h),f.identifyOnResolve(t||f.identifyOnResolve()||(h.identifyOnResolve?.()??!1)),f},applyToStack:o,identify:()=>u(!0).map(h=>{const f=h.step??h.relation+" "+h.toMiddleware;return io(h.name,h.aliases)+" - "+f}),identifyOnResolve(h){return typeof h=="boolean"&&(t=h),t},resolve:(h,f)=>{for(const d of u().map(g=>g.middleware).reverse())h=d(h,f);return t&&console.log(c.identify()),h}};return c},zE={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},HE={high:3,normal:2,low:1};class oj{config;middlewareStack=Tg();initConfig;handlers;constructor(e){this.config=e;const{protocol:t,protocolSettings:n}=e;n&&typeof t=="function"&&(e.protocol=new t(n))}send(e,t,n){const i=typeof t!="function"?t:void 0,a=typeof t=="function"?t:n,s=i===void 0&&this.config.cacheMiddleware===!0;let o;if(s){this.handlers||(this.handlers=new WeakMap);const l=this.handlers;l.has(e.constructor)?o=l.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,i),l.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,i);if(a)o(e).then(l=>a(null,l.output),l=>a(l)).catch(()=>{});else return o(e).then(l=>l.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const Wv="***SensitiveInformation***";function yA(r,e){if(e==null)return e;const t=vi.of(r);if(t.getMergedTraits().sensitive)return Wv;if(t.isListSchema()){if(!!t.getValueSchema().getMergedTraits().sensitive)return Wv}else if(t.isMapSchema()){if(!!t.getKeySchema().getMergedTraits().sensitive||!!t.getValueSchema().getMergedTraits().sensitive)return Wv}else if(t.isStructSchema()&&typeof e=="object"){const n=e,i={};for(const[a,s]of t.structIterator())n[a]!=null&&(i[a]=yA(s,n[a]));return i}return e}class H1{middlewareStack=Tg();schema;static classBuilder(){return new lj}resolveMiddlewareWithContext(e,t,n,{middlewareFn:i,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,smithyContext:u,additionalContext:c,CommandCtor:h}){for(const y of i.bind(this)(h,e,t,n))this.middlewareStack.use(y);const f=e.concat(this.middlewareStack),{logger:d}=t,g={logger:d,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,[hA]:{commandInstance:this,...u},...c},{requestHandler:v}=t;return f.resolve(y=>v.handle(y.request,n||{}),g)}}class lj{_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,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=n=>n,t=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,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 t;return t=class extends H1{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[n]){super(),this.input=n??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,i,a){const s=e._operationSchema,o=s?.[4]??s?.input,l=s?.[5]??s?.output;return this.resolveMiddlewareWithContext(n,i,a,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(s?yA.bind(null,o):u=>u),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(s?yA.bind(null,l):u=>u),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class Hu 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 t=e;return Hu.prototype.isPrototypeOf(t)||!!t.$fault&&!!t.$metadata&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;const t=e;return this===Hu?Hu.isInstance(e):Hu.isInstance(e)?t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e):!1}}const jE=(r,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,i])=>{(r[n]==null||r[n]==="")&&(r[n]=i)});const t=r.message||r.Message||"UnknownError";return r.message=t,delete r.Message,r},uj=r=>{switch(r){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{}}},nD=Object.values(Rd),cj=r=>{const e=[];for(const t in Rd){const n=Rd[t];r[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>r[n]})}for(const[t,n]of Object.entries(r.checksumAlgorithms??{}))e.push({algorithmId:()=>t,checksumConstructor:()=>n});return{addChecksumAlgorithm(t){r.checksumAlgorithms=r.checksumAlgorithms??{};const n=t.algorithmId(),i=t.checksumConstructor();nD.includes(n)?r.checksumAlgorithms[n.toUpperCase()]=i:r.checksumAlgorithms[n]=i,e.push(t)},checksumAlgorithms(){return e}}},fj=r=>{const e={};return r.checksumAlgorithms().forEach(t=>{const n=t.algorithmId();nD.includes(n)&&(e[n]=t.checksumConstructor())}),e},dj=r=>({setRetryStrategy(e){r.retryStrategy=e},retryStrategy(){return r.retryStrategy}}),hj=r=>{const e={};return e.retryStrategy=r.retryStrategy(),e},pj=r=>Object.assign(cj(r),dj(r)),gj=r=>Object.assign(fj(r),hj(r));class iD{trace(){}debug(){}info(){}warn(){}error(){}}const mj=r=>r?.body instanceof ReadableStream;function vj(r,e){if(fc.isInstance(r))for(const t of Object.keys(r.headers)){const n=t.toLowerCase();if(n==="retry-after"){const i=r.headers[t];let a=NaN;if(i.endsWith("GMT"))try{a=(NI(i).getTime()-Date.now())/1e3}catch(s){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(s)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?a=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?a=Number(i):Date.parse(i)>=Date.now()&&(a=(Date.parse(i)-Date.now())/1e3);return isNaN(a)?void 0:new Date(Date.now()+a*1e3)}else if(n==="x-amz-retry-after"){const i=r.headers[t],a=Number(i);if(isNaN(a)){e?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+a)}}}const yj=r=>(e,t)=>async n=>{let i=await r.retryStrategy();const a=await r.maxAttempts();if(Aj(i)){i=i;let s=await i.acquireInitialRetryToken((t.partition_id??"")+(t.__retryLongPoll?":longpoll":"")),o=new Error,l=0,u=0;const{request:c}=n,h=aa.isInstance(c);for(h&&(c.headers[tj]=LI());;)try{h&&(c.headers[rj]=`attempt=${l+1}; max=${a}`);const{response:f,output:d}=await e(n);return i.recordSuccess(s),d.$metadata.attempts=l+1,d.$metadata.totalRetryDelay=u,{response:f,output:d}}catch(f){const d=bj(f,r.logger);if(o=aj(f),h&&mj(c))throw(t.logger instanceof iD?console:t.logger)?.warn("An error was encountered in a non-retryable streaming request."),o;try{s=await i.refreshRetryTokenForRetry(s,d)}catch(v){throw typeof v.$backoff=="number"&&await GE(v.$backoff),o.$metadata||(o.$metadata={}),o.$metadata.attempts=l+1,o.$metadata.totalRetryDelay=u,o}l=s.getRetryCount();const g=s.getRetryDelay();u+=g,await GE(g)}}else return i=i,i?.mode&&(t.userAgent=[...t.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(e,n)},GE=r=>new Promise(e=>setTimeout(e,r)),Aj=r=>typeof r.acquireInitialRetryToken<"u"&&typeof r.refreshRetryTokenForRetry<"u"&&typeof r.recordSuccess<"u",bj=(r,e)=>{const t={error:r,errorType:wj(r)},n=vj(r.$response,e);return n&&(t.retryAfterHint=n),t},wj=r=>JI(r)?"THROTTLING":V1(r)?"TRANSIENT":CH(r)?"SERVER_ERROR":"CLIENT_ERROR",Cj={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},xj=r=>({applyToStack:e=>{e.add(yj(r),Cj)}}),$E=r=>fc.isInstance(r)?r.headers?.date??r.headers?.Date:void 0,aD=r=>new Date(Date.now()+r),Sj=(r,e)=>Math.abs(aD(e).getTime()-r)>=3e5,qE=(r,e)=>{const t=Date.parse(r);return Sj(t,e)?t-Date.now():e},fd=(r,e)=>{if(!e)throw new Error(`Property \`${r}\` is not resolved for AWS SDK SigV4Auth`);return e},Ej=async r=>{const e=fd("context",r.context),t=fd("config",r.config),n=e.endpointV2?.properties?.authSchemes?.[0],a=await fd("signer",t.signer)(n),s=r?.signingRegion,o=r?.signingRegionSet,l=r?.signingName;return{config:t,signer:a,signingRegion:s,signingRegionSet:o,signingName:l}};class kj{async sign(e,t,n){if(!aa.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await Ej(n),{config:a,signer:s}=i;let{signingRegion:o,signingName:l}=i;const u=n.context;if(u?.authSchemes?.length??!1){const[h,f]=u.authSchemes;h?.name==="sigv4a"&&f?.name==="sigv4"&&(o=f?.signingRegion??o,l=f?.signingName??l)}return await s.sign(e,{signingDate:aD(a.systemClockOffset),signingRegion:o,signingService:l})}errorHandler(e){return t=>{const n=t.ServerTime??$E(t.$response);if(n){const i=fd("config",e.config),a=i.systemClockOffset;i.systemClockOffset=qE(n,i.systemClockOffset),i.systemClockOffset!==a&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=$E(e);if(n){const i=fd("config",t.config);i.systemClockOffset=qE(n,i.systemClockOffset)}}}const Fj=(r,e,t)=>{let n,i,a,s=!1;const o=async()=>{i||(i=r());try{n=await i,a=!0,s=!1}finally{i=void 0}return n};return async l=>((!a||l?.forceRefresh)&&(n=await o()),n)},Tj="X-Amz-Algorithm",Ij="X-Amz-Credential",sD="X-Amz-Date",Dj="X-Amz-SignedHeaders",Pj="X-Amz-Expires",oD="X-Amz-Signature",lD="X-Amz-Security-Token",uD="authorization",cD=sD.toLowerCase(),Rj="date",Oj=[uD,cD,Rj],Bj=oD.toLowerCase(),AA="x-amz-content-sha256",Mj=lD.toLowerCase(),_j={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},Nj=/^proxy-/,Lj=/^sec-/,Qv="AWS4-HMAC-SHA256",Uj="AWS4-HMAC-SHA256-PAYLOAD",Vj="UNSIGNED-PAYLOAD",zj=50,fD="aws4_request",Hj=3600*24*7,Np={},Yv=[],Xv=(r,e,t)=>`${r}/${e}/${t}/${fD}`,jj=async(r,e,t,n,i)=>{const a=await WE(r,e.secretAccessKey,e.accessKeyId),s=`${t}:${n}:${i}:${kl(a)}:${e.sessionToken}`;if(s in Np)return Np[s];for(Yv.push(s);Yv.length>zj;)delete Np[Yv.shift()];let o=`AWS4${e.secretAccessKey}`;for(const l of[t,n,i,fD])o=await WE(r,o,l);return Np[s]=o},WE=(r,e,t)=>{const n=new r(e);return n.update(Od(t)),n.digest()},QE=({headers:r},e,t)=>{const n={};for(const i of Object.keys(r).sort()){if(r[i]==null)continue;const a=i.toLowerCase();(a in _j||e?.has(a)||Nj.test(a)||Lj.test(a))&&(!t||t&&!t.has(a))||(n[a]=r[i].trim().replace(/\s+/g," "))}return n},Gj=r=>typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Object.prototype.toString.call(r)==="[object ArrayBuffer]",Jv=async({headers:r,body:e},t)=>{for(const n of Object.keys(r))if(n.toLowerCase()===AA)return r[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||Gj(e)){const n=new t;return n.update(Od(e)),kl(await n.digest())}return Vj};class $j{format(e){const t=[];for(const a of Object.keys(e)){const s=Dl(a);t.push(Uint8Array.from([s.byteLength]),s,this.formatHeaderValue(e[a]))}const n=new Uint8Array(t.reduce((a,s)=>a+s.byteLength,0));let i=0;for(const a of t)n.set(a,i),i+=a.byteLength;return n}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 t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(e.value.bytes,1),i;case"binary":const a=new DataView(new ArrayBuffer(3+e.value.byteLength));a.setUint8(0,6),a.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(a.buffer);return s.set(e.value,3),s;case"string":const o=Dl(e.value),l=new DataView(new ArrayBuffer(3+o.byteLength));l.setUint8(0,7),l.setUint16(1,o.byteLength,!1);const u=new Uint8Array(l.buffer);return u.set(o,3),u;case"timestamp":const c=new Uint8Array(9);return c[0]=8,c.set(j1.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!qj.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(WV(e.value.replace(/\-/g,"")),1),h}}}var YE;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(YE||(YE={}));const qj=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class j1{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 t=new Uint8Array(8);for(let n=7,i=Math.abs(Math.round(e));n>-1&&i>0;n--,i/=256)t[n]=i;return e<0&&XE(t),new j1(t)}valueOf(){const e=this.bytes.slice(0),t=e[0]&128;return t&&XE(e),parseInt(kl(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function XE(r){for(let e=0;e<8;e++)r[e]^=255;for(let e=7;e>-1&&(r[e]++,r[e]===0);e--);}const Wj=(r,e)=>{r=r.toLowerCase();for(const t of Object.keys(e))if(r===t.toLowerCase())return!0;return!1},Qj=(r,e={})=>{const{headers:t,query:n={}}=aa.clone(r);for(const i of Object.keys(t)){const a=i.toLowerCase();(a.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(a)||e.hoistableHeaders?.has(a))&&(n[i]=t[i],delete t[i])}return{...r,headers:t,query:n}},JE=r=>{r=aa.clone(r);for(const e of Object.keys(r.headers))Oj.indexOf(e.toLowerCase())>-1&&delete r.headers[e];return r},Yj=({query:r={}})=>{const e=[],t={};for(const n of Object.keys(r)){if(n.toLowerCase()===Bj)continue;const i=El(n);e.push(i);const a=r[n];typeof a=="string"?t[i]=`${i}=${El(a)}`:Array.isArray(a)&&(t[i]=a.slice(0).reduce((s,o)=>s.concat([`${i}=${El(o)}`]),[]).sort().join("&"))}return e.sort().map(n=>t[n]).filter(n=>n).join("&")},Xj=r=>Jj(r).toISOString().replace(/\.\d{3}Z$/,"Z"),Jj=r=>typeof r=="number"?new Date(r*1e3):typeof r=="string"?Number(r)?new Date(Number(r)*1e3):new Date(r):r;class Kj{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s=!0}){this.service=i,this.sha256=a,this.uriEscapePath=s,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=Ls(n),this.credentialProvider=Ls(t)}createCanonicalRequest(e,t,n){const i=Object.keys(t).sort();return`${e.method}
|
|
2804
|
+
`),cz={warn:console.warn},fz=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],N1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function dz(r){const e=r.getUTCFullYear(),t=r.getUTCMonth(),n=r.getUTCDay(),i=r.getUTCDate(),a=r.getUTCHours(),s=r.getUTCMinutes(),o=r.getUTCSeconds(),l=i<10?`0${i}`:`${i}`,u=a<10?`0${a}`:`${a}`,c=s<10?`0${s}`:`${s}`,h=o<10?`0${o}`:`${o}`;return`${fz[n]}, ${l} ${N1[t]} ${e} ${u}:${c}:${h} GMT`}const hz=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),pz=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const e=hz.exec(r);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");const[t,n,i,a,s,o,l,u,c]=e,h=Fg(Bd(n)),f=bo(i,"month",1,12),d=bo(a,"day",1,31),g=rg(h,f,d,{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u});return c.toUpperCase()!="Z"&&g.setTime(g.getTime()-kz(c)),g},gz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),mz=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),vz=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),NI=r=>{if(r==null)return;if(typeof r!="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let e=gz.exec(r);if(e){const[t,n,i,a,s,o,l,u]=e;return rg(Fg(Bd(a)),jv(i),bo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u})}if(e=mz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return wz(rg(Az(a),jv(i),bo(n,"day",1,31),{hours:s,minutes:o,seconds:l,fractionalMilliseconds:u}))}if(e=vz.exec(r),e){const[t,n,i,a,s,o,l,u]=e;return rg(Fg(Bd(u)),jv(n),bo(i.trimLeft(),"day",1,31),{hours:a,minutes:s,seconds:o,fractionalMilliseconds:l})}throw new TypeError("Invalid RFC-7231 date-time value")},yz=r=>{if(r==null)return;let e;if(typeof r=="number")e=r;else if(typeof r=="string")e=az(r);else if(typeof r=="object"&&r.tag===1)e=r.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},rg=(r,e,t,n)=>{const i=e-1;return xz(r,i,t),new Date(Date.UTC(r,i,t,bo(n.hours,"hour",0,23),bo(n.minutes,"minute",0,59),bo(n.seconds,"seconds",0,60),Ez(n.fractionalMilliseconds)))},Az=r=>{const e=new Date().getUTCFullYear(),t=Math.floor(e/100)*100+Fg(Bd(r));return t<e?t+100:t},bz=50*365*24*60*60*1e3,wz=r=>r.getTime()-new Date().getTime()>bz?new Date(Date.UTC(r.getUTCFullYear()-100,r.getUTCMonth(),r.getUTCDate(),r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds())):r,jv=r=>{const e=N1.indexOf(r);if(e<0)throw new TypeError(`Invalid month: ${r}`);return e+1},Cz=[31,28,31,30,31,30,31,31,30,31,30,31],xz=(r,e,t)=>{let n=Cz[e];if(e===1&&Sz(r)&&(n=29),t>n)throw new TypeError(`Invalid day for ${N1[e]} in ${r}: ${t}`)},Sz=r=>r%4===0&&(r%100!==0||r%400===0),bo=(r,e,t,n)=>{const i=lz(Bd(r));if(i<t||i>n)throw new TypeError(`${e} must be between ${t} and ${n}, inclusive`);return i},Ez=r=>r==null?0:sz("0."+r)*1e3,kz=r=>{const e=r[0];let t=1;if(e=="+")t=1;else if(e=="-")t=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);const n=Number(r.substring(1,3)),i=Number(r.substring(4,6));return t*(n*60+i)*60*1e3},Bd=r=>{let e=0;for(;e<r.length-1&&r.charAt(e)==="0";)e++;return e===0?r:r.slice(e)},PE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ti=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0")),LI=()=>{if(PE)return PE();const r=new Uint8Array(16);return crypto.getRandomValues(r),r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ti[r[0]]+Ti[r[1]]+Ti[r[2]]+Ti[r[3]]+"-"+Ti[r[4]]+Ti[r[5]]+"-"+Ti[r[6]]+Ti[r[7]]+"-"+Ti[r[8]]+Ti[r[9]]+"-"+Ti[r[10]]+Ti[r[11]]+Ti[r[12]]+Ti[r[13]]+Ti[r[14]]+Ti[r[15]]},mo=function(e){return Object.assign(new String(e),{deserializeJSON(){return JSON.parse(String(e))},toString(){return String(e)},toJSON(){return String(e)}})};mo.from=r=>r&&typeof r=="object"&&(r instanceof mo||"deserializeJSON"in r)?r:typeof r=="string"||Object.getPrototypeOf(r)===String.prototype?mo(String(r)):mo(JSON.stringify(r));mo.fromObject=mo.from;const RE=/^-?\d*(\.\d+)?$/;class as{string;type;constructor(e,t){if(this.string=e,this.type=t,!RE.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 t=e;return as.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&RE.test(t.string)}}class Fz{serdeContext;setSerdeContext(e){this.serdeContext=e}}class Tz extends Fz{options;compositeErrorRegistry;constructor(e){super(),this.options=e,this.compositeErrorRegistry=ra.for(e.defaultNamespace);for(const t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return aa}getResponseType(){return fc}setSerdeContext(e){this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec()&&this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,e.query||(e.query={});for(const[n,i]of t.url.searchParams.entries())e.query[n]=i;if(t.headers)for(const[n,i]of Object.entries(t.headers))e.headers[n]=i.join(", ");return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(const[n,i]of Object.entries(t.headers))e.headers[n]=i;return e}}setHostPrefix(e,t,n){if(this.serdeContext?.disableHostPrefix)return;const i=vi.of(t.input),a=Jf(t.traits??{});if(a.endpoint){let s=a.endpoint?.[0];if(typeof s=="string"){const o=[...i.structIterator()].filter(([,l])=>l.getMergedTraits().hostLabel);for(const[l]of o){const u=n[l];if(typeof u!="string")throw new Error(`@smithy/core/schema - ${l} in input must be a string as hostLabel.`);s=s.replace(`{${l}}`,u)}e.hostname=s+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:t,initialRequest:n}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:n})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:n})}async loadEventStreamCapability(){const{EventStreamSerde:e}=await Promise.resolve().then(()=>require("./index-DGxxZLUF.cjs"));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,t,n,i,a){return[]}getEventStreamMarshaller(){const e=this.serdeContext;if(!e.eventStreamMarshaller)throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class Iz extends Tz{async serializeRequest(e,t,n){const i=this.serializer,a={},s={},o=await n.endpoint(),l=vi.of(e?.input),u=l.getSchema();let c;const h=t&&typeof t=="object"?t:{},f=new aa({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:a,headers:s,body:void 0});if(o&&(this.updateServiceEndpoint(f,o),this.setHostPrefix(f,e,h)),h){const d=l.getEventStreamMember();if(d){if(h[d]){const g={};for(const[v,y]of l.structIterator())v!==d&&h[v]&&(i.write(y,h[v]),g[v]=i.flush());c=await this.serializeEventStream({eventStream:h[d],requestSchema:l,initialRequest:g})}}else i.write(u,h),c=i.flush()}return f.headers=Object.assign(f.headers,s),f.query=a,f.body=c,f.method="POST",f}async deserializeResponse(e,t,n){const i=this.deserializer,a=vi.of(e.output),s={};if(n.statusCode>=300){const l=await gA(n.body,t);throw l.byteLength>0&&Object.assign(s,await i.read(15,l)),await this.handleError(e,t,n,s,this.deserializeMetadata(n)),new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(const l in n.headers){const u=n.headers[l];delete n.headers[l],n.headers[l.toLowerCase()]=u}const o=a.getEventStreamMember();if(o)s[o]=await this.deserializeEventStream({response:n,responseSchema:a,initialResponseContainer:s});else{const l=await gA(n.body,t);l.byteLength>0&&Object.assign(s,await i.read(a,l))}return s.$metadata=this.deserializeMetadata(n),s}}function UI(r,e){if(e.timestampFormat.useTrait&&r.isTimestampSchema()&&(r.getSchema()===5||r.getSchema()===6||r.getSchema()===7))return r.getSchema();const{httpLabel:t,httpPrefixHeaders:n,httpHeader:i,httpQuery:a}=r.getMergedTraits();return(e.httpBindings?typeof n=="string"||i?6:a||t?5:void 0:void 0)??e.timestampFormat.default}function Dz(r,e,t){r.__smithy_context?r.__smithy_context.features||(r.__smithy_context.features={}):r.__smithy_context={features:{}},r.__smithy_context.features[e]=t}class Pz{authSchemes=new Map;constructor(e){for(const[t,n]of Object.entries(e))n!==void 0&&this.authSchemes.set(t,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}class Rz{async sign(e,t,n){return e}}const Oz=r=>function(t){return VI(t)&&t.expiration.getTime()-Date.now()<r},Bz=3e5,Mz=Oz(Bz),VI=r=>r.expiration!==void 0,_z=(r,e,t)=>{if(r===void 0)return;const n=typeof r!="function"?async()=>Promise.resolve(r):r;let i,a,s,o=!1;const l=async u=>{a||(a=n(u));try{i=await a,s=!0,o=!1}finally{a=void 0}return i};return e===void 0?async u=>((!s||u?.forceRefresh)&&(i=await l(u)),i):async u=>((!s||u?.forceRefresh)&&(i=await l(u)),o?i:t(i)?(e(i)&&await l(u),i):(o=!0,i))},Nz=void 0;function Lz(r){return r===void 0?!0:typeof r=="string"&&r.length<=50}function Uz(r){const e=ld(r.userAgentAppId??Nz),{customUserAgent:t}=r;return Object.assign(r,{customUserAgent:typeof t=="string"?[[t]]:t,userAgentAppId:async()=>{const n=await e();if(!Lz(n)){const i=r.logger?.constructor?.name==="NoOpLogger"||!r.logger?console:r.logger;typeof n!="string"?i?.warn("userAgentAppId must be a string or undefined."):n.length>50&&i?.warn("The provided userAgentAppId exceeds the maximum length of 50 characters.")}return n}})}class Vz{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){this.capacity=e??50,t&&(this.parameters=t)}get(e,t){const n=this.hash(e);if(n===!1)return t();if(!this.data.has(n)){if(this.data.size>this.capacity+10){const i=this.data.keys();let a=0;for(;;){const{value:s,done:o}=i.next();if(this.data.delete(s),o||++a>10)break}}this.data.set(n,t())}return this.data.get(n)}size(){return this.data.size}hash(e){let t="";const{parameters:n}=this;if(n.length===0)return!1;for(const i of n){const a=String(e[i]??"");if(a.includes("|;"))return!1;t+=a+"|;"}return t}}const zz=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}$"),L1=r=>zz.test(r)||r.startsWith("[")&&r.endsWith("]"),Hz=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),oh=(r,e=!1)=>{if(!e)return Hz.test(r);const t=r.split(".");for(const n of t)if(!oh(n))return!1;return!0},Md={},_d="endpoints";function Po(r){return typeof r!="object"||r==null?r:"ref"in r?`$${Po(r.ref)}`:"fn"in r?`${r.fn}(${(r.argv||[]).map(Po).join(", ")})`:JSON.stringify(r,null,2)}class sa extends Error{constructor(e){super(e),this.name="EndpointError"}}const jz=(r,e)=>r===e,Gz=r=>{const e=r.split("."),t=[];for(const n of e){const i=n.indexOf("[");if(i!==-1){if(n.indexOf("]")!==n.length-1)throw new sa(`Path: '${r}' does not end with ']'`);const a=n.slice(i+1,-1);if(Number.isNaN(parseInt(a)))throw new sa(`Invalid array index: '${a}' in path: '${r}'`);i!==0&&t.push(n.slice(0,i)),t.push(a)}else t.push(n)}return t},zI=(r,e)=>Gz(e).reduce((t,n)=>{if(typeof t!="object")throw new sa(`Index '${n}' in '${e}' not found in '${JSON.stringify(r)}'`);return Array.isArray(t)?t[parseInt(n)]:t[n]},r),$z=r=>r!=null,qz=r=>!r,Gv={[Pd.HTTP]:80,[Pd.HTTPS]:443},Wz=r=>{const e=(()=>{try{if(r instanceof URL)return r;if(typeof r=="object"&&"hostname"in r){const{hostname:f,port:d,protocol:g="",path:v="",query:y={}}=r,A=new URL(`${g}//${f}${d?`:${d}`:""}${v}`);return A.search=Object.entries(y).map(([C,k])=>`${C}=${k}`).join("&"),A}return new URL(r)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(r)} as a whatwg URL.`),null;const t=e.href,{host:n,hostname:i,pathname:a,protocol:s,search:o}=e;if(o)return null;const l=s.slice(0,-1);if(!Object.values(Pd).includes(l))return null;const u=L1(i),c=t.includes(`${n}:${Gv[l]}`)||typeof r=="string"&&r.includes(`${n}:${Gv[l]}`),h=`${n}${c?`:${Gv[l]}`:""}`;return{scheme:l,authority:h,path:a,normalizedPath:a.endsWith("/")?a:`${a}/`,isIp:u}},Qz=(r,e)=>r===e,Yz=(r,e,t,n)=>e>=t||r.length<t||/[^\u0000-\u007f]/.test(r)?null:n?r.substring(r.length-t,r.length-e):r.substring(e,t),Xz=r=>encodeURIComponent(r).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Jz={booleanEquals:jz,getAttr:zI,isSet:$z,isValidHostLabel:oh,not:qz,parseURL:Wz,stringEquals:Qz,substring:Yz,uriEncode:Xz},HI=(r,e)=>{const t=[],n={...e.endpointParams,...e.referenceRecord};let i=0;for(;i<r.length;){const a=r.indexOf("{",i);if(a===-1){t.push(r.slice(i));break}t.push(r.slice(i,a));const s=r.indexOf("}",a);if(s===-1){t.push(r.slice(a));break}r[a+1]==="{"&&r[s+1]==="}"&&(t.push(r.slice(a+1,s)),i=s+2);const o=r.substring(a+1,s);if(o.includes("#")){const[l,u]=o.split("#");t.push(zI(n[l],u))}else t.push(n[o]);i=s+1}return t.join("")},Kz=({ref:r},e)=>({...e.endpointParams,...e.referenceRecord})[r],sm=(r,e,t)=>{if(typeof r=="string")return HI(r,t);if(r.fn)return GI.callFunction(r,t);if(r.ref)return Kz(r,t);throw new sa(`'${e}': ${String(r)} is not a string, function or reference.`)},jI=({fn:r,argv:e},t)=>{const n=e.map(a=>["boolean","number"].includes(typeof a)?a:GI.evaluateExpression(a,"arg",t)),i=r.split(".");return i[0]in Md&&i[1]!=null?Md[i[0]][i[1]](...n):Jz[r](...n)},GI={evaluateExpression:sm,callFunction:jI},Zz=({assign:r,...e},t)=>{if(r&&r in t.referenceRecord)throw new sa(`'${r}' is already defined in Reference Record.`);const n=jI(e,t);return t.logger?.debug?.(`${_d} evaluateCondition: ${Po(e)} = ${Po(n)}`),{result:n===""?!0:!!n,...r!=null&&{toAssign:{name:r,value:n}}}},U1=(r=[],e)=>{const t={};for(const n of r){const{result:i,toAssign:a}=Zz(n,{...e,referenceRecord:{...e.referenceRecord,...t}});if(!i)return{result:i};a&&(t[a.name]=a.value,e.logger?.debug?.(`${_d} assign: ${a.name} := ${Po(a.value)}`))}return{result:!0,referenceRecord:t}},eH=(r,e)=>Object.entries(r).reduce((t,[n,i])=>({...t,[n]:i.map(a=>{const s=sm(a,"Header value entry",e);if(typeof s!="string")throw new sa(`Header '${n}' value '${s}' is not a string`);return s})}),{}),$I=(r,e)=>Object.entries(r).reduce((t,[n,i])=>({...t,[n]:WI.getEndpointProperty(i,e)}),{}),qI=(r,e)=>{if(Array.isArray(r))return r.map(t=>qI(t,e));switch(typeof r){case"string":return HI(r,e);case"object":if(r===null)throw new sa(`Unexpected endpoint property: ${r}`);return WI.getEndpointProperties(r,e);case"boolean":return r;default:throw new sa(`Unexpected endpoint property type: ${typeof r}`)}},WI={getEndpointProperty:qI,getEndpointProperties:$I},tH=(r,e)=>{const t=sm(r,"Endpoint URL",e);if(typeof t=="string")try{return new URL(t)}catch(n){throw console.error(`Failed to construct URL with ${t}`,n),n}throw new sa(`Endpoint URL must be a string, got ${typeof t}`)},rH=(r,e)=>{const{conditions:t,endpoint:n}=r,{result:i,referenceRecord:a}=U1(t,e);if(!i)return;const s={...e,referenceRecord:{...e.referenceRecord,...a}},{url:o,properties:l,headers:u}=n;return e.logger?.debug?.(`${_d} Resolving endpoint from template: ${Po(n)}`),{...u!=null&&{headers:eH(u,s)},...l!=null&&{properties:$I(l,s)},url:tH(o,s)}},nH=(r,e)=>{const{conditions:t,error:n}=r,{result:i,referenceRecord:a}=U1(t,e);if(i)throw new sa(sm(n,"Error",{...e,referenceRecord:{...e.referenceRecord,...a}}))},QI=(r,e)=>{for(const t of r)if(t.type==="endpoint"){const n=rH(t,e);if(n)return n}else if(t.type==="error")nH(t,e);else if(t.type==="tree"){const n=YI.evaluateTreeRule(t,e);if(n)return n}else throw new sa(`Unknown endpoint rule: ${t}`);throw new sa("Rules evaluation failed")},iH=(r,e)=>{const{conditions:t,rules:n}=r,{result:i,referenceRecord:a}=U1(t,e);if(i)return YI.evaluateRules(n,{...e,referenceRecord:{...e.referenceRecord,...a}})},YI={evaluateRules:QI,evaluateTreeRule:iH},aH=(r,e)=>{const{endpointParams:t,logger:n}=e,{parameters:i,rules:a}=r;e.logger?.debug?.(`${_d} Initial EndpointParams: ${Po(t)}`);const s=Object.entries(i).filter(([,u])=>u.default!=null).map(([u,c])=>[u,c.default]);if(s.length>0)for(const[u,c]of s)t[u]=t[u]??c;const o=Object.entries(i).filter(([,u])=>u.required).map(([u])=>u);for(const u of o)if(t[u]==null)throw new sa(`Missing required parameter: '${u}'`);const l=QI(a,{endpointParams:t,logger:n,referenceRecord:{}});return e.logger?.debug?.(`${_d} Resolved endpoint: ${Po(l)}`),l},XI=(r,e=!1)=>{if(e){for(const t of r.split("."))if(!XI(t))return!1;return!0}return!(!oh(r)||r.length<3||r.length>63||r!==r.toLowerCase()||L1(r))},OE=":",sH="/",oH=r=>{const e=r.split(OE);if(e.length<6)return null;const[t,n,i,a,s,...o]=e;if(t!=="arn"||n===""||i===""||o.join(OE)==="")return null;const l=o.map(u=>u.split(sH)).flat();return{partition:n,service:i,region:a,accountId:s,resourceId:l}},lH=[{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:"AWS European Sovereign Cloud (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)"}}}],uH={partitions:lH};let cH=uH;const fH=r=>{const{partitions:e}=cH;for(const n of e){const{regions:i,outputs:a}=n;for(const[s,o]of Object.entries(i))if(s===r)return{...a,...o}}for(const n of e){const{regionRegex:i,outputs:a}=n;if(new RegExp(i).test(r))return{...a}}const t=e.find(n=>n.id==="aws");if(!t)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...t.outputs}},dH={isVirtualHostableS3Bucket:XI,parseArn:oH,partition:fH};Md.aws=dH;function hH(r,e,t){return r.$source||(r.$source={}),r.$source[e]=t,r}function Ds(r,e,t){r.__aws_sdk_context?r.__aws_sdk_context.features||(r.__aws_sdk_context.features={}):r.__aws_sdk_context={features:{}},r.__aws_sdk_context.features[e]=t}var Nd;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(Nd||(Nd={}));Nd.STANDARD;const pH=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],gH=["TimeoutError","RequestTimeout","RequestTimeoutException"],mH=[500,502,503,504],vH=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"],yH=["EHOSTUNREACH","ENETUNREACH","ENOTFOUND"],AH=r=>r?.$retryable!==void 0,bH=r=>r.$metadata?.clockSkewCorrected,wH=r=>{const e=new Set(["Failed to fetch","NetworkError when attempting to fetch resource","The Internet connection appears to be offline","Load failed","Network request failed"]);return r&&r instanceof TypeError?e.has(r.message):!1},JI=r=>r.$metadata?.httpStatusCode===429||pH.includes(r.name)||r.$retryable?.throttling==!0,V1=(r,e=0)=>AH(r)||bH(r)||gH.includes(r.name)||vH.includes(r?.code||"")||yH.includes(r?.code||"")||mH.includes(r.$metadata?.httpStatusCode||0)||wH(r)||r.cause!==void 0&&e<=10&&V1(r.cause,e+1),CH=r=>{if(r.$metadata?.httpStatusCode!==void 0){const e=r.$metadata.httpStatusCode;return 500<=e&&e<=599&&!V1(r)}return!1},xH=/\d{12}\.ddb/;async function SH(r,e,t){if(t.request?.headers?.["smithy-protocol"]==="rpc-v2-cbor"&&Ds(r,"PROTOCOL_RPC_V2_CBOR","M"),typeof e.retryStrategy=="function"){const a=await e.retryStrategy();if(typeof a.mode=="string")switch(a.mode){case Nd.ADAPTIVE:Ds(r,"RETRY_MODE_ADAPTIVE","F");break;case Nd.STANDARD:Ds(r,"RETRY_MODE_STANDARD","E");break}}if(typeof e.accountIdEndpointMode=="function"){const a=r.endpointV2;switch(String(a?.url?.hostname).match(xH)&&Ds(r,"ACCOUNT_ID_ENDPOINT","O"),await e.accountIdEndpointMode?.()){case"disabled":Ds(r,"ACCOUNT_ID_MODE_DISABLED","Q");break;case"preferred":Ds(r,"ACCOUNT_ID_MODE_PREFERRED","P");break;case"required":Ds(r,"ACCOUNT_ID_MODE_REQUIRED","R");break}}const i=r.__smithy_context?.selectedHttpAuthScheme?.identity;if(i?.$source){const a=i;a.accountId&&Ds(r,"RESOLVED_ACCOUNT_ID","T");for(const[s,o]of Object.entries(a.$source??{}))Ds(r,s,o)}}const BE="user-agent",$v="x-amz-user-agent",ME=" ",qv="/",EH=/[^!$%&'*+\-.^_`|~\w]/g,kH=/[^!$%&'*+\-.^_`|~\w#]/g,_E="-",FH=1024;function TH(r){let e="";for(const t in r){const n=r[t];if(e.length+n.length+1<=FH){e.length?e+=","+n:e+=n;continue}break}return e}const IH=r=>(e,t)=>async n=>{const{request:i}=n;if(!aa.isInstance(i))return e(n);const{headers:a}=i,s=t?.userAgent?.map(_p)||[],o=(await r.defaultUserAgentProvider()).map(_p);await SH(t,r,n);const l=t;o.push(`m/${TH(Object.assign({},t.__smithy_context?.features,l.__aws_sdk_context?.features))}`);const u=r?.customUserAgent?.map(_p)||[],c=await r.userAgentAppId();c&&o.push(_p(["app",`${c}`]));const h=[].concat([...o,...s,...u]).join(ME),f=[...o.filter(d=>d.startsWith("aws-sdk-")),...u].join(ME);return r.runtime!=="browser"?(f&&(a[$v]=a[$v]?`${a[BE]} ${f}`:f),a[BE]=h):a[$v]=h,e({...n,request:i})},_p=r=>{const e=r[0].split(qv).map(s=>s.replace(EH,_E)).join(qv),t=r[1]?.replace(kH,_E),n=e.indexOf(qv),i=e.substring(0,n);let a=e.substring(n+1);return i==="api"&&(a=a.toLowerCase()),[i,a,t].filter(s=>s&&s.length>0).reduce((s,o,l)=>{switch(l){case 0:return o;case 1:return`${s}/${o}`;default:return`${s}#${o}`}},"")},DH={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},PH=r=>({applyToStack:e=>{e.add(IH(r),DH)}}),RH=!1,OH=!1,NE=new Set,BH=(r,e=oh)=>{if(!NE.has(r)&&!e(r))if(r==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw new Error(`Region not accepted: region="${r}" is not a valid hostname component.`);else NE.add(r)},KI=r=>typeof r=="string"&&(r.startsWith("fips-")||r.endsWith("-fips")),MH=r=>KI(r)?["fips-aws-global","aws-fips"].includes(r)?"us-east-1":r.replace(/fips-(dkr-|prod-)?|-fips/,""):r,_H=r=>{const{region:e,useFipsEndpoint:t}=r;if(!e)throw new Error("Region is missing");return Object.assign(r,{region:async()=>{const n=typeof e=="function"?await e():e,i=MH(n);return BH(i),i},useFipsEndpoint:async()=>{const n=typeof e=="string"?e:await e();return KI(n)?!0:typeof t!="function"?Promise.resolve(!!t):t()}})},LE="content-length";function NH(r){return e=>async t=>{const n=t.request;if(aa.isInstance(n)){const{body:i,headers:a}=n;if(i&&Object.keys(a).map(s=>s.toLowerCase()).indexOf(LE)===-1)try{const s=r(i);n.headers={...n.headers,[LE]:String(s)}}catch{}}return e({...t,request:n})}}const LH={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},UH=r=>({applyToStack:e=>{e.add(NH(r.bodyLengthChecker),LH)}}),VH=async r=>{const e=r?.Bucket||"";if(typeof r.Bucket=="string"&&(r.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),$H(e)){if(r.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!GH(e)||e.indexOf(".")!==-1&&!String(r.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(r.ForcePathStyle=!0);return r.DisableMultiRegionAccessPoints&&(r.disableMultiRegionAccessPoints=!0,r.DisableMRAP=!0),r},zH=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,HH=/(\d+\.){3}\d+/,jH=/\.\./,GH=r=>zH.test(r)&&!HH.test(r)&&!jH.test(r),$H=r=>{const[e,t,n,,,i]=r.split(":"),a=e==="arn"&&r.split(":").length>=6,s=!!(a&&t&&n&&i);if(a&&!s)throw new Error(`Invalid ARN: ${r} was an invalid ARN.`);return s},qH=(r,e,t,n=!1)=>{const i=async()=>{let a;return n?a=t.clientContextParams?.[r]??t[r]??t[e]:a=t[r]??t[e],typeof a=="function"?a():a};return r==="credentialScope"||e==="CredentialScope"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.credentialScope??a?.CredentialScope}:r==="accountId"||e==="AccountId"?async()=>{const a=typeof t.credentials=="function"?await t.credentials():t.credentials;return a?.accountId??a?.AccountId}:r==="endpoint"||e==="endpoint"?async()=>{if(t.isCustomEndpoint===!1)return;const a=await i();if(a&&typeof a=="object"){if("url"in a)return a.url.href;if("hostname"in a){const{protocol:s,hostname:o,port:l,path:u}=a;return`${s}//${o}${l?":"+l:""}${u}`}}return a}:i},ZI=async r=>{},eD=r=>{if(typeof r=="object"){if("url"in r){const e=dc(r.url);if(r.headers){e.headers={};for(const[t,n]of Object.entries(r.headers))e.headers[t.toLowerCase()]=n.join(", ")}return e}return r}return dc(r)},WH=async(r,e,t,n)=>{if(!t.isCustomEndpoint){let s;t.serviceConfiguredEndpoint?s=await t.serviceConfiguredEndpoint():s=await ZI(t.serviceId),s&&(t.endpoint=()=>Promise.resolve(eD(s)),t.isCustomEndpoint=!0)}const i=await QH(r,e,t);if(typeof t.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");const a=t.endpointProvider(i,n);if(t.isCustomEndpoint&&t.endpoint){const s=await t.endpoint();if(s?.headers){a.headers??={};for(const[o,l]of Object.entries(s.headers))a.headers[o]=Array.isArray(l)?l:[l]}}return a},QH=async(r,e,t)=>{const n={},i=e?.getEndpointParameterInstructions?.()||{};for(const[a,s]of Object.entries(i))switch(s.type){case"staticContextParams":n[a]=s.value;break;case"contextParams":n[a]=r[s.name];break;case"clientContextParams":case"builtInParams":n[a]=await qH(s.name,a,t,s.type!=="builtInParams")();break;case"operationContextParams":n[a]=s.get(r);break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(s))}return Object.keys(i).length===0&&Object.assign(n,t),String(t.serviceId).toLowerCase()==="s3"&&await VH(n),n},YH=({config:r,instructions:e})=>(t,n)=>async i=>{r.isCustomEndpoint&&Dz(n,"ENDPOINT_OVERRIDE","N");const a=await WH(i.input,{getEndpointParameterInstructions(){return e}},{...r},n);n.endpointV2=a,n.authSchemes=a.properties?.authSchemes;const s=n.authSchemes?.[0];if(s){n.signing_region=s.signingRegion,n.signing_service=s.signingName;const l=Sc(n)?.selectedHttpAuthScheme?.httpAuthOption;l&&(l.signingProperties=Object.assign(l.signingProperties||{},{signing_region:s.signingRegion,signingRegion:s.signingRegion,signing_service:s.signingName,signingName:s.signingName,signingRegionSet:s.signingRegionSet},s.properties))}return t({...i})},XH={name:"serializerMiddleware"},JH={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:XH.name},tD=(r,e)=>({applyToStack:t=>{t.addRelativeTo(YH({config:r,instructions:e}),JH)}}),KH=r=>{const e=r.tls??!0,{endpoint:t,useDualstackEndpoint:n,useFipsEndpoint:i}=r,a=t!=null?async()=>eD(await Ls(t)()):void 0,o=Object.assign(r,{endpoint:a,tls:e,isCustomEndpoint:!!t,useDualstackEndpoint:Ls(n??!1),useFipsEndpoint:Ls(i??!1)});let l;return o.serviceConfiguredEndpoint=async()=>(r.serviceId&&!l&&(l=ZI(r.serviceId)),l),o};var hc;(function(r){r.STANDARD="standard",r.ADAPTIVE="adaptive"})(hc||(hc={}));const cd=3,ZH=hc.STANDARD;class z1{static setTimeoutFn=setTimeout;beta;minCapacity;minFillRate;scaleConstant;smooth;enabled=!1;availableTokens=0;lastMaxRate=0;measuredTxRate=0;requestCount=0;fillRate;lastThrottleTime;lastTimestamp=0;lastTxRateBucket;maxCapacity;timeWindow=0;constructor(e){this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8,this.lastThrottleTime=this.getCurrentTimeInSeconds(),this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}async getSendToken(){return this.acquireTokenBucket(1)}updateClientSendingRate(e){let t;this.updateMeasuredRate();const n=e;if(n?.errorType==="THROTTLING"||JI(n?.error??e)){const s=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=s,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),t=this.cubicThrottle(s),this.enableTokenBucket()}else this.calculateTimeWindow(),t=this.cubicSuccess(this.getCurrentTimeInSeconds());const a=Math.min(t,2*this.measuredTxRate);this.updateTokenBucketRate(a)}getCurrentTimeInSeconds(){return Date.now()/1e3}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.availableTokens){const t=(e-this.availableTokens)/this.fillRate*1e3;await new Promise(n=>z1.setTimeoutFn(n,t))}this.availableTokens=this.availableTokens-e}}refillTokenBucket(){const e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}const t=(e-this.lastTimestamp)*this.fillRate;this.availableTokens=Math.min(this.maxCapacity,this.availableTokens+t),this.lastTimestamp=e}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.availableTokens=Math.min(this.availableTokens,this.maxCapacity)}updateMeasuredRate(){const e=this.getCurrentTimeInSeconds(),t=Math.floor(e*2)/2;if(this.requestCount++,t>this.lastTxRateBucket){const n=this.requestCount/(t-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=t}}getPrecise(e){return parseFloat(e.toFixed(8))}}const rD=20*1e3,UE=500,ej=1,tj="amz-sdk-invocation-id",rj="amz-sdk-request";class Ui{static v2026=typeof process<"u"&&process.env?.SMITHY_NEW_RETRIES_2026==="true";static delay(){return Ui.v2026?50:100}static throttlingDelay(){return Ui.v2026?1e3:500}static cost(){return Ui.v2026?14:5}static throttlingCost(){return Ui.v2026?5:10}static modifiedCostType(){return Ui.v2026?"THROTTLING":"TRANSIENT"}}class nj{x=Ui.delay();computeNextBackoffDelay(e){const i=Math.random()*Math.min(this.x*2**e,rD);return Math.floor(i)}setDelayBase(e){this.x=e}}class VE{delay;count;cost;longPoll;constructor(e,t,n,i){this.delay=e,this.count=t,this.cost=n,this.longPoll=i}getRetryCount(){return this.count}getRetryDelay(){return Math.min(rD,this.delay)}getRetryCost(){return this.cost}isLongPoll(){return this.longPoll}}class vA{mode=hc.STANDARD;capacity=UE;retryBackoffStrategy;maxAttemptsProvider;baseDelay;constructor(e){typeof e=="number"?this.maxAttemptsProvider=async()=>e:typeof e=="function"?this.maxAttemptsProvider=e:e&&typeof e=="object"&&(this.maxAttemptsProvider=async()=>e.maxAttempts,this.baseDelay=e.baseDelay,this.retryBackoffStrategy=e.backoff),this.maxAttemptsProvider??=async()=>cd,this.baseDelay??=Ui.delay(),this.retryBackoffStrategy??=new nj}async acquireInitialRetryToken(e){return new VE(Ui.delay(),0,void 0,Ui.v2026&&e.includes(":longpoll"))}async refreshRetryTokenForRetry(e,t){const n=await this.getMaxAttempts(),i=this.shouldRetry(e,t,n);if(i||e.isLongPoll?.()){const a=t.errorType;this.retryBackoffStrategy.setDelayBase(a==="THROTTLING"?Ui.throttlingDelay():this.baseDelay);const s=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount());let o=s;if(t.retryAfterHint instanceof Date&&(o=Math.max(s,Math.min(t.retryAfterHint.getTime()-Date.now(),s+5e3))),i){const l=this.getCapacityCost(a);return this.capacity-=l,new VE(o,e.getRetryCount()+1,l,e.isLongPoll?.()??!1)}else throw Object.assign(new Error("No retry token available"),{$backoff:Ui.v2026?o:0})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.min(UE,this.capacity+(e.getRetryCost()??ej))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${cd}`),cd}}shouldRetry(e,t,n){return e.getRetryCount()+1<n&&this.capacity>=this.getCapacityCost(t.errorType)&&this.isRetryableError(t.errorType)}getCapacityCost(e){return e===Ui.modifiedCostType()?Ui.throttlingCost():Ui.cost()}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}class ij{mode=hc.ADAPTIVE;rateLimiter;standardRetryStrategy;constructor(e,t){const{rateLimiter:n}=t??{};this.rateLimiter=n??new z1,this.standardRetryStrategy=t?new vA({maxAttempts:typeof e=="number"?e:3,...t}):new vA(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,t){return this.rateLimiter.updateClientSendingRate(t),this.standardRetryStrategy.refreshRetryTokenForRetry(e,t)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}const aj=r=>r instanceof Error?r:r instanceof Object?Object.assign(new Error,r):typeof r=="string"?new Error(r):new Error(`AWS SDK error wrapper for ${r}`),sj=r=>{const{retryStrategy:e,retryMode:t}=r,n=Ls(r.maxAttempts??cd);let i=e?Promise.resolve(e):void 0;const a=async()=>await Ls(t)()===hc.ADAPTIVE?new ij(n):new vA(n);return Object.assign(r,{maxAttempts:n,retryStrategy:()=>i??=a()})},pl=(r,e)=>{const t=[];if(r&&t.push(r),e)for(const n of e)t.push(n);return t},io=(r,e)=>`${r||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,Tg=()=>{let r=[],e=[],t=!1;const n=new Set,i=h=>h.sort((f,d)=>zE[d.step]-zE[f.step]||HE[d.priority||"normal"]-HE[f.priority||"normal"]),a=h=>{let f=!1;const d=g=>{const v=pl(g.name,g.aliases);if(v.includes(h)){f=!0;for(const y of v)n.delete(y);return!1}return!0};return r=r.filter(d),e=e.filter(d),f},s=h=>{let f=!1;const d=g=>{if(g.middleware===h){f=!0;for(const v of pl(g.name,g.aliases))n.delete(v);return!1}return!0};return r=r.filter(d),e=e.filter(d),f},o=h=>(r.forEach(f=>{h.add(f.middleware,{...f})}),e.forEach(f=>{h.addRelativeTo(f.middleware,{...f})}),h.identifyOnResolve?.(c.identifyOnResolve()),h),l=h=>{const f=[];return h.before.forEach(d=>{d.before.length===0&&d.after.length===0?f.push(d):f.push(...l(d))}),f.push(h),h.after.reverse().forEach(d=>{d.before.length===0&&d.after.length===0?f.push(d):f.push(...l(d))}),f},u=(h=!1)=>{const f=[],d=[],g={};return r.forEach(y=>{const A={...y,before:[],after:[]};for(const C of pl(A.name,A.aliases))g[C]=A;f.push(A)}),e.forEach(y=>{const A={...y,before:[],after:[]};for(const C of pl(A.name,A.aliases))g[C]=A;d.push(A)}),d.forEach(y=>{if(y.toMiddleware){const A=g[y.toMiddleware];if(A===void 0){if(h)return;throw new Error(`${y.toMiddleware} is not found when adding ${io(y.name,y.aliases)} middleware ${y.relation} ${y.toMiddleware}`)}y.relation==="after"&&A.after.push(y),y.relation==="before"&&A.before.push(y)}}),i(f).map(l).reduce((y,A)=>(y.push(...A),y),[])},c={add:(h,f={})=>{const{name:d,override:g,aliases:v}=f,y={step:"initialize",priority:"normal",middleware:h,...f},A=pl(d,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${io(d,v)}'`);for(const C of A){const k=r.findIndex(S=>S.name===C||S.aliases?.some(R=>R===C));if(k===-1)continue;const T=r[k];if(T.step!==y.step||y.priority!==T.priority)throw new Error(`"${io(T.name,T.aliases)}" middleware with ${T.priority} priority in ${T.step} step cannot be overridden by "${io(d,v)}" middleware with ${y.priority} priority in ${y.step} step.`);r.splice(k,1)}}for(const C of A)n.add(C)}r.push(y)},addRelativeTo:(h,f)=>{const{name:d,override:g,aliases:v}=f,y={middleware:h,...f},A=pl(d,v);if(A.length>0){if(A.some(C=>n.has(C))){if(!g)throw new Error(`Duplicate middleware name '${io(d,v)}'`);for(const C of A){const k=e.findIndex(S=>S.name===C||S.aliases?.some(R=>R===C));if(k===-1)continue;const T=e[k];if(T.toMiddleware!==y.toMiddleware||T.relation!==y.relation)throw new Error(`"${io(T.name,T.aliases)}" middleware ${T.relation} "${T.toMiddleware}" middleware cannot be overridden by "${io(d,v)}" middleware ${y.relation} "${y.toMiddleware}" middleware.`);e.splice(k,1)}}for(const C of A)n.add(C)}e.push(y)},clone:()=>o(Tg()),use:h=>{h.applyToStack(c)},remove:h=>typeof h=="string"?a(h):s(h),removeByTag:h=>{let f=!1;const d=g=>{const{tags:v,name:y,aliases:A}=g;if(v&&v.includes(h)){const C=pl(y,A);for(const k of C)n.delete(k);return f=!0,!1}return!0};return r=r.filter(d),e=e.filter(d),f},concat:h=>{const f=o(Tg());return f.use(h),f.identifyOnResolve(t||f.identifyOnResolve()||(h.identifyOnResolve?.()??!1)),f},applyToStack:o,identify:()=>u(!0).map(h=>{const f=h.step??h.relation+" "+h.toMiddleware;return io(h.name,h.aliases)+" - "+f}),identifyOnResolve(h){return typeof h=="boolean"&&(t=h),t},resolve:(h,f)=>{for(const d of u().map(g=>g.middleware).reverse())h=d(h,f);return t&&console.log(c.identify()),h}};return c},zE={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},HE={high:3,normal:2,low:1};class oj{config;middlewareStack=Tg();initConfig;handlers;constructor(e){this.config=e;const{protocol:t,protocolSettings:n}=e;n&&typeof t=="function"&&(e.protocol=new t(n))}send(e,t,n){const i=typeof t!="function"?t:void 0,a=typeof t=="function"?t:n,s=i===void 0&&this.config.cacheMiddleware===!0;let o;if(s){this.handlers||(this.handlers=new WeakMap);const l=this.handlers;l.has(e.constructor)?o=l.get(e.constructor):(o=e.resolveMiddleware(this.middlewareStack,this.config,i),l.set(e.constructor,o))}else delete this.handlers,o=e.resolveMiddleware(this.middlewareStack,this.config,i);if(a)o(e).then(l=>a(null,l.output),l=>a(l)).catch(()=>{});else return o(e).then(l=>l.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}const Wv="***SensitiveInformation***";function yA(r,e){if(e==null)return e;const t=vi.of(r);if(t.getMergedTraits().sensitive)return Wv;if(t.isListSchema()){if(!!t.getValueSchema().getMergedTraits().sensitive)return Wv}else if(t.isMapSchema()){if(!!t.getKeySchema().getMergedTraits().sensitive||!!t.getValueSchema().getMergedTraits().sensitive)return Wv}else if(t.isStructSchema()&&typeof e=="object"){const n=e,i={};for(const[a,s]of t.structIterator())n[a]!=null&&(i[a]=yA(s,n[a]));return i}return e}class H1{middlewareStack=Tg();schema;static classBuilder(){return new lj}resolveMiddlewareWithContext(e,t,n,{middlewareFn:i,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,smithyContext:u,additionalContext:c,CommandCtor:h}){for(const y of i.bind(this)(h,e,t,n))this.middlewareStack.use(y);const f=e.concat(this.middlewareStack),{logger:d}=t,g={logger:d,clientName:a,commandName:s,inputFilterSensitiveLog:o,outputFilterSensitiveLog:l,[hA]:{commandInstance:this,...u},...c},{requestHandler:v}=t;return f.resolve(y=>v.handle(y.request,n||{}),g)}}class lj{_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,t,n={}){return this._smithyContext={service:e,operation:t,...n},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=n=>n,t=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,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 t;return t=class extends H1{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[n]){super(),this.input=n??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(n,i,a){const s=e._operationSchema,o=s?.[4]??s?.input,l=s?.[5]??s?.output;return this.resolveMiddlewareWithContext(n,i,a,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(s?yA.bind(null,o):u=>u),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(s?yA.bind(null,l):u=>u),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}class Hu 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 t=e;return Hu.prototype.isPrototypeOf(t)||!!t.$fault&&!!t.$metadata&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;const t=e;return this===Hu?Hu.isInstance(e):Hu.isInstance(e)?t.name&&this.name?this.prototype.isPrototypeOf(e)||t.name===this.name:this.prototype.isPrototypeOf(e):!1}}const jE=(r,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,i])=>{(r[n]==null||r[n]==="")&&(r[n]=i)});const t=r.message||r.Message||"UnknownError";return r.message=t,delete r.Message,r},uj=r=>{switch(r){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{}}},nD=Object.values(Rd),cj=r=>{const e=[];for(const t in Rd){const n=Rd[t];r[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>r[n]})}for(const[t,n]of Object.entries(r.checksumAlgorithms??{}))e.push({algorithmId:()=>t,checksumConstructor:()=>n});return{addChecksumAlgorithm(t){r.checksumAlgorithms=r.checksumAlgorithms??{};const n=t.algorithmId(),i=t.checksumConstructor();nD.includes(n)?r.checksumAlgorithms[n.toUpperCase()]=i:r.checksumAlgorithms[n]=i,e.push(t)},checksumAlgorithms(){return e}}},fj=r=>{const e={};return r.checksumAlgorithms().forEach(t=>{const n=t.algorithmId();nD.includes(n)&&(e[n]=t.checksumConstructor())}),e},dj=r=>({setRetryStrategy(e){r.retryStrategy=e},retryStrategy(){return r.retryStrategy}}),hj=r=>{const e={};return e.retryStrategy=r.retryStrategy(),e},pj=r=>Object.assign(cj(r),dj(r)),gj=r=>Object.assign(fj(r),hj(r));class iD{trace(){}debug(){}info(){}warn(){}error(){}}const mj=r=>r?.body instanceof ReadableStream;function vj(r,e){if(fc.isInstance(r))for(const t of Object.keys(r.headers)){const n=t.toLowerCase();if(n==="retry-after"){const i=r.headers[t];let a=NaN;if(i.endsWith("GMT"))try{a=(NI(i).getTime()-Date.now())/1e3}catch(s){e?.trace?.("Failed to parse retry-after header"),e?.trace?.(s)}else i.match(/ GMT, ((\d+)|(\d+\.\d+))$/)?a=Number(i.match(/ GMT, ([\d.]+)$/)?.[1]):i.match(/^((\d+)|(\d+\.\d+))$/)?a=Number(i):Date.parse(i)>=Date.now()&&(a=(Date.parse(i)-Date.now())/1e3);return isNaN(a)?void 0:new Date(Date.now()+a*1e3)}else if(n==="x-amz-retry-after"){const i=r.headers[t],a=Number(i);if(isNaN(a)){e?.trace?.(`Failed to parse x-amz-retry-after=${i}`);return}return new Date(Date.now()+a)}}}const yj=r=>(e,t)=>async n=>{let i=await r.retryStrategy();const a=await r.maxAttempts();if(Aj(i)){i=i;let s=await i.acquireInitialRetryToken((t.partition_id??"")+(t.__retryLongPoll?":longpoll":"")),o=new Error,l=0,u=0;const{request:c}=n,h=aa.isInstance(c);for(h&&(c.headers[tj]=LI());;)try{h&&(c.headers[rj]=`attempt=${l+1}; max=${a}`);const{response:f,output:d}=await e(n);return i.recordSuccess(s),d.$metadata.attempts=l+1,d.$metadata.totalRetryDelay=u,{response:f,output:d}}catch(f){const d=bj(f,r.logger);if(o=aj(f),h&&mj(c))throw(t.logger instanceof iD?console:t.logger)?.warn("An error was encountered in a non-retryable streaming request."),o;try{s=await i.refreshRetryTokenForRetry(s,d)}catch(v){throw typeof v.$backoff=="number"&&await GE(v.$backoff),o.$metadata||(o.$metadata={}),o.$metadata.attempts=l+1,o.$metadata.totalRetryDelay=u,o}l=s.getRetryCount();const g=s.getRetryDelay();u+=g,await GE(g)}}else return i=i,i?.mode&&(t.userAgent=[...t.userAgent||[],["cfg/retry-mode",i.mode]]),i.retry(e,n)},GE=r=>new Promise(e=>setTimeout(e,r)),Aj=r=>typeof r.acquireInitialRetryToken<"u"&&typeof r.refreshRetryTokenForRetry<"u"&&typeof r.recordSuccess<"u",bj=(r,e)=>{const t={error:r,errorType:wj(r)},n=vj(r.$response,e);return n&&(t.retryAfterHint=n),t},wj=r=>JI(r)?"THROTTLING":V1(r)?"TRANSIENT":CH(r)?"SERVER_ERROR":"CLIENT_ERROR",Cj={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},xj=r=>({applyToStack:e=>{e.add(yj(r),Cj)}}),$E=r=>fc.isInstance(r)?r.headers?.date??r.headers?.Date:void 0,aD=r=>new Date(Date.now()+r),Sj=(r,e)=>Math.abs(aD(e).getTime()-r)>=3e5,qE=(r,e)=>{const t=Date.parse(r);return Sj(t,e)?t-Date.now():e},fd=(r,e)=>{if(!e)throw new Error(`Property \`${r}\` is not resolved for AWS SDK SigV4Auth`);return e},Ej=async r=>{const e=fd("context",r.context),t=fd("config",r.config),n=e.endpointV2?.properties?.authSchemes?.[0],a=await fd("signer",t.signer)(n),s=r?.signingRegion,o=r?.signingRegionSet,l=r?.signingName;return{config:t,signer:a,signingRegion:s,signingRegionSet:o,signingName:l}};class kj{async sign(e,t,n){if(!aa.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");const i=await Ej(n),{config:a,signer:s}=i;let{signingRegion:o,signingName:l}=i;const u=n.context;if(u?.authSchemes?.length??!1){const[h,f]=u.authSchemes;h?.name==="sigv4a"&&f?.name==="sigv4"&&(o=f?.signingRegion??o,l=f?.signingName??l)}return await s.sign(e,{signingDate:aD(a.systemClockOffset),signingRegion:o,signingService:l})}errorHandler(e){return t=>{const n=t.ServerTime??$E(t.$response);if(n){const i=fd("config",e.config),a=i.systemClockOffset;i.systemClockOffset=qE(n,i.systemClockOffset),i.systemClockOffset!==a&&t.$metadata&&(t.$metadata.clockSkewCorrected=!0)}throw t}}successHandler(e,t){const n=$E(e);if(n){const i=fd("config",t.config);i.systemClockOffset=qE(n,i.systemClockOffset)}}}const Fj=(r,e,t)=>{let n,i,a,s=!1;const o=async()=>{i||(i=r());try{n=await i,a=!0,s=!1}finally{i=void 0}return n};return async l=>((!a||l?.forceRefresh)&&(n=await o()),n)},Tj="X-Amz-Algorithm",Ij="X-Amz-Credential",sD="X-Amz-Date",Dj="X-Amz-SignedHeaders",Pj="X-Amz-Expires",oD="X-Amz-Signature",lD="X-Amz-Security-Token",uD="authorization",cD=sD.toLowerCase(),Rj="date",Oj=[uD,cD,Rj],Bj=oD.toLowerCase(),AA="x-amz-content-sha256",Mj=lD.toLowerCase(),_j={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},Nj=/^proxy-/,Lj=/^sec-/,Qv="AWS4-HMAC-SHA256",Uj="AWS4-HMAC-SHA256-PAYLOAD",Vj="UNSIGNED-PAYLOAD",zj=50,fD="aws4_request",Hj=3600*24*7,Np={},Yv=[],Xv=(r,e,t)=>`${r}/${e}/${t}/${fD}`,jj=async(r,e,t,n,i)=>{const a=await WE(r,e.secretAccessKey,e.accessKeyId),s=`${t}:${n}:${i}:${kl(a)}:${e.sessionToken}`;if(s in Np)return Np[s];for(Yv.push(s);Yv.length>zj;)delete Np[Yv.shift()];let o=`AWS4${e.secretAccessKey}`;for(const l of[t,n,i,fD])o=await WE(r,o,l);return Np[s]=o},WE=(r,e,t)=>{const n=new r(e);return n.update(Od(t)),n.digest()},QE=({headers:r},e,t)=>{const n={};for(const i of Object.keys(r).sort()){if(r[i]==null)continue;const a=i.toLowerCase();(a in _j||e?.has(a)||Nj.test(a)||Lj.test(a))&&(!t||t&&!t.has(a))||(n[a]=r[i].trim().replace(/\s+/g," "))}return n},Gj=r=>typeof ArrayBuffer=="function"&&r instanceof ArrayBuffer||Object.prototype.toString.call(r)==="[object ArrayBuffer]",Jv=async({headers:r,body:e},t)=>{for(const n of Object.keys(r))if(n.toLowerCase()===AA)return r[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||Gj(e)){const n=new t;return n.update(Od(e)),kl(await n.digest())}return Vj};class $j{format(e){const t=[];for(const a of Object.keys(e)){const s=Dl(a);t.push(Uint8Array.from([s.byteLength]),s,this.formatHeaderValue(e[a]))}const n=new Uint8Array(t.reduce((a,s)=>a+s.byteLength,0));let i=0;for(const a of t)n.set(a,i),i+=a.byteLength;return n}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 t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":const n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":const i=new Uint8Array(9);return i[0]=5,i.set(e.value.bytes,1),i;case"binary":const a=new DataView(new ArrayBuffer(3+e.value.byteLength));a.setUint8(0,6),a.setUint16(1,e.value.byteLength,!1);const s=new Uint8Array(a.buffer);return s.set(e.value,3),s;case"string":const o=Dl(e.value),l=new DataView(new ArrayBuffer(3+o.byteLength));l.setUint8(0,7),l.setUint16(1,o.byteLength,!1);const u=new Uint8Array(l.buffer);return u.set(o,3),u;case"timestamp":const c=new Uint8Array(9);return c[0]=8,c.set(j1.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!qj.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);const h=new Uint8Array(17);return h[0]=9,h.set(WV(e.value.replace(/\-/g,"")),1),h}}}var YE;(function(r){r[r.boolTrue=0]="boolTrue",r[r.boolFalse=1]="boolFalse",r[r.byte=2]="byte",r[r.short=3]="short",r[r.integer=4]="integer",r[r.long=5]="long",r[r.byteArray=6]="byteArray",r[r.string=7]="string",r[r.timestamp=8]="timestamp",r[r.uuid=9]="uuid"})(YE||(YE={}));const qj=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;class j1{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 t=new Uint8Array(8);for(let n=7,i=Math.abs(Math.round(e));n>-1&&i>0;n--,i/=256)t[n]=i;return e<0&&XE(t),new j1(t)}valueOf(){const e=this.bytes.slice(0),t=e[0]&128;return t&&XE(e),parseInt(kl(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function XE(r){for(let e=0;e<8;e++)r[e]^=255;for(let e=7;e>-1&&(r[e]++,r[e]===0);e--);}const Wj=(r,e)=>{r=r.toLowerCase();for(const t of Object.keys(e))if(r===t.toLowerCase())return!0;return!1},Qj=(r,e={})=>{const{headers:t,query:n={}}=aa.clone(r);for(const i of Object.keys(t)){const a=i.toLowerCase();(a.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(a)||e.hoistableHeaders?.has(a))&&(n[i]=t[i],delete t[i])}return{...r,headers:t,query:n}},JE=r=>{r=aa.clone(r);for(const e of Object.keys(r.headers))Oj.indexOf(e.toLowerCase())>-1&&delete r.headers[e];return r},Yj=({query:r={}})=>{const e=[],t={};for(const n of Object.keys(r)){if(n.toLowerCase()===Bj)continue;const i=El(n);e.push(i);const a=r[n];typeof a=="string"?t[i]=`${i}=${El(a)}`:Array.isArray(a)&&(t[i]=a.slice(0).reduce((s,o)=>s.concat([`${i}=${El(o)}`]),[]).sort().join("&"))}return e.sort().map(n=>t[n]).filter(n=>n).join("&")},Xj=r=>Jj(r).toISOString().replace(/\.\d{3}Z$/,"Z"),Jj=r=>typeof r=="number"?new Date(r*1e3):typeof r=="string"?Number(r)?new Date(Number(r)*1e3):new Date(r):r;class Kj{service;regionProvider;credentialProvider;sha256;uriEscapePath;applyChecksum;constructor({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s=!0}){this.service=i,this.sha256=a,this.uriEscapePath=s,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=Ls(n),this.credentialProvider=Ls(t)}createCanonicalRequest(e,t,n){const i=Object.keys(t).sort();return`${e.method}
|
|
2792
2805
|
${this.getCanonicalPath(e)}
|
|
2793
2806
|
${Yj(e)}
|
|
2794
2807
|
${i.map(a=>`${a}:${t[a]}`).join(`
|
|
@@ -2800,7 +2813,7 @@ ${e}
|
|
|
2800
2813
|
${t}
|
|
2801
2814
|
${kl(s)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){const t=[];for(const a of e.split("/"))a?.length!==0&&a!=="."&&(a===".."?t.pop():t.push(a));const n=`${e?.startsWith("/")?"/":""}${t.join("/")}${t.length>0&&e?.endsWith("/")?"/":""}`;return El(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){const t=Xj(e).replace(/[\-:]/g,"");return{longDate:t,shortDate:t.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}}class KE extends Kj{headerFormatter=new $j;constructor({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s=!0}){super({applyChecksum:e,credentials:t,region:n,service:i,sha256:a,uriEscapePath:s})}async presign(e,t={}){const{signingDate:n=new Date,expiresIn:i=3600,unsignableHeaders:a,unhoistableHeaders:s,signableHeaders:o,hoistableHeaders:l,signingRegion:u,signingService:c}=t,h=await this.credentialProvider();this.validateResolvedCredentials(h);const f=u??await this.regionProvider(),{longDate:d,shortDate:g}=this.formatDate(n);if(i>Hj)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");const v=Xv(g,f,c??this.service),y=Qj(JE(e),{unhoistableHeaders:s,hoistableHeaders:l});h.sessionToken&&(y.query[lD]=h.sessionToken),y.query[Tj]=Qv,y.query[Ij]=`${h.accessKeyId}/${v}`,y.query[sD]=d,y.query[Pj]=i.toString(10);const A=QE(y,a,o);return y.query[Dj]=this.getCanonicalHeaderList(A),y.query[oD]=await this.getSignature(d,v,this.getSigningKey(h,f,g,c),this.createCanonicalRequest(y,A,await Jv(e,this.sha256))),y}async sign(e,t){return typeof e=="string"?this.signString(e,t):e.headers&&e.payload?this.signEvent(e,t):e.message?this.signMessage(e,t):this.signRequest(e,t)}async signEvent({headers:e,payload:t},{signingDate:n=new Date,priorSignature:i,signingRegion:a,signingService:s}){const o=a??await this.regionProvider(),{shortDate:l,longDate:u}=this.formatDate(n),c=Xv(l,o,s??this.service),h=await Jv({headers:{},body:t},this.sha256),f=new this.sha256;f.update(e);const d=kl(await f.digest()),g=[Uj,u,c,i,d,h].join(`
|
|
2802
2815
|
`);return this.signString(g,{signingDate:n,signingRegion:o,signingService:s})}async signMessage(e,{signingDate:t=new Date,signingRegion:n,signingService:i}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:t,signingRegion:n,signingService:i,priorSignature:e.priorSignature}).then(s=>({message:e.message,signature:s}))}async signString(e,{signingDate:t=new Date,signingRegion:n,signingService:i}={}){const a=await this.credentialProvider();this.validateResolvedCredentials(a);const s=n??await this.regionProvider(),{shortDate:o}=this.formatDate(t),l=new this.sha256(await this.getSigningKey(a,s,o,i));return l.update(Od(e)),kl(await l.digest())}async signRequest(e,{signingDate:t=new Date,signableHeaders:n,unsignableHeaders:i,signingRegion:a,signingService:s}={}){const o=await this.credentialProvider();this.validateResolvedCredentials(o);const l=a??await this.regionProvider(),u=JE(e),{longDate:c,shortDate:h}=this.formatDate(t),f=Xv(h,l,s??this.service);u.headers[cD]=c,o.sessionToken&&(u.headers[Mj]=o.sessionToken);const d=await Jv(u,this.sha256);!Wj(AA,u.headers)&&this.applyChecksum&&(u.headers[AA]=d);const g=QE(u,i,n),v=await this.getSignature(c,f,this.getSigningKey(o,l,h,s),this.createCanonicalRequest(u,g,d));return u.headers[uD]=`${Qv} Credential=${o.accessKeyId}/${f}, SignedHeaders=${this.getCanonicalHeaderList(g)}, Signature=${v}`,u}async getSignature(e,t,n,i){const a=await this.createStringToSign(e,t,i,Qv),s=new this.sha256(await n);return s.update(Od(a)),kl(await s.digest())}getSigningKey(e,t,n,i){return jj(this.sha256,e,n,t,i||this.service)}}const Zj=r=>{let e=r.credentials,t=!!r.credentials,n;Object.defineProperty(r,"credentials",{set(u){u&&u!==e&&u!==n&&(t=!0),e=u;const c=eG(r,{credentials:e,credentialDefaultProvider:r.credentialDefaultProvider}),h=tG(r,c);if(t&&!h.attributed){const f=typeof e=="object"&&e!==null;n=async d=>{const v=await h(d);return f&&(!v.$source||Object.keys(v.$source).length===0)?hH(v,"CREDENTIALS_CODE","e"):v},n.memoized=h.memoized,n.configBound=h.configBound,n.attributed=!0}else n=h},get(){return n},enumerable:!0,configurable:!0}),r.credentials=e;const{signingEscapePath:i=!0,systemClockOffset:a=r.systemClockOffset||0,sha256:s}=r;let o;return r.signer?o=ld(r.signer):r.regionInfoProvider?o=()=>ld(r.region)().then(async u=>[await r.regionInfoProvider(u,{useFipsEndpoint:await r.useFipsEndpoint(),useDualstackEndpoint:await r.useDualstackEndpoint()})||{},u]).then(([u,c])=>{const{signingRegion:h,signingService:f}=u;r.signingRegion=r.signingRegion||h||c,r.signingName=r.signingName||f||r.serviceId;const d={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:i},g=r.signerConstructor||KE;return new g(d)}):o=async u=>{u=Object.assign({},{name:"sigv4",signingName:r.signingName||r.defaultSigningName,signingRegion:await ld(r.region)(),properties:{}},u);const c=u.signingRegion,h=u.signingName;r.signingRegion=r.signingRegion||c,r.signingName=r.signingName||h||r.serviceId;const f={...r,credentials:r.credentials,region:r.signingRegion,service:r.signingName,sha256:s,uriEscapePath:i},d=r.signerConstructor||KE;return new d(f)},Object.assign(r,{systemClockOffset:a,signingEscapePath:i,signer:o})};function eG(r,{credentials:e,credentialDefaultProvider:t}){let n;return e?e?.memoized?n=e:n=_z(e,Mz,VI):t?n=ld(t(Object.assign({},r,{parentClientConfig:r}))):n=async()=>{throw new Error("@aws-sdk/core::resolveAwsSdkSigV4Config - `credentials` not provided and no credentialDefaultProvider was configured.")},n.memoized=!0,n}function tG(r,e){if(e.configBound)return e;const t=async n=>e({...n,callerClientConfig:r});return t.memoized=e.memoized,t.configBound=!0,t}const rG=async(r,e,t)=>({operation:Sc(e).operation,region:await Ls(r.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function nG(r){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-idp",region:r.region},propertiesExtractor:(e,t)=>({signingProperties:{config:e,context:t}})}}function Ur(r){return{schemeId:"smithy.api#noAuth"}}const iG=r=>{const e=[];switch(r.operation){case"AssociateSoftwareToken":{e.push(Ur());break}case"ChangePassword":{e.push(Ur());break}case"CompleteWebAuthnRegistration":{e.push(Ur());break}case"ConfirmDevice":{e.push(Ur());break}case"ConfirmForgotPassword":{e.push(Ur());break}case"ConfirmSignUp":{e.push(Ur());break}case"DeleteUser":{e.push(Ur());break}case"DeleteUserAttributes":{e.push(Ur());break}case"DeleteWebAuthnCredential":{e.push(Ur());break}case"ForgetDevice":{e.push(Ur());break}case"ForgotPassword":{e.push(Ur());break}case"GetDevice":{e.push(Ur());break}case"GetTokensFromRefreshToken":{e.push(Ur());break}case"GetUser":{e.push(Ur());break}case"GetUserAttributeVerificationCode":{e.push(Ur());break}case"GetUserAuthFactors":{e.push(Ur());break}case"GlobalSignOut":{e.push(Ur());break}case"InitiateAuth":{e.push(Ur());break}case"ListDevices":{e.push(Ur());break}case"ListWebAuthnCredentials":{e.push(Ur());break}case"ResendConfirmationCode":{e.push(Ur());break}case"RespondToAuthChallenge":{e.push(Ur());break}case"RevokeToken":{e.push(Ur());break}case"SetUserMFAPreference":{e.push(Ur());break}case"SetUserSettings":{e.push(Ur());break}case"SignUp":{e.push(Ur());break}case"StartWebAuthnRegistration":{e.push(Ur());break}case"UpdateAuthEventFeedback":{e.push(Ur());break}case"UpdateDeviceStatus":{e.push(Ur());break}case"UpdateUserAttributes":{e.push(Ur());break}case"VerifySoftwareToken":{e.push(Ur());break}case"VerifyUserAttribute":{e.push(Ur());break}default:e.push(nG(r))}return e},aG=r=>{const e=Zj(r);return Object.assign(e,{authSchemePreference:Ls(r.authSchemePreference??[])})},sG=r=>Object.assign(r,{useDualstackEndpoint:r.useDualstackEndpoint??!1,useFipsEndpoint:r.useFipsEndpoint??!1,defaultSigningName:"cognito-idp"}),dD={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},oG="3.1026.0",lG={version:oG},uG=r=>new TextEncoder().encode(r);var cG=typeof Buffer<"u"&&Buffer.from?function(r){return Buffer.from(r,"utf8")}:uG;function Ld(r){return r instanceof Uint8Array?r:typeof r=="string"?cG(r):ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(r)}function bA(r){return typeof r=="string"?r.length===0:r.byteLength===0}var hD={name:"SHA-256"},ZE={name:"HMAC",hash:hD},fG=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85]);const dG={};function ng(){return typeof window<"u"?window:typeof self<"u"?self:dG}var hG=(function(){function r(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return r.prototype.update=function(e){if(!bA(e)){var t=Ld(e),n=new Uint8Array(this.toHash.byteLength+t.byteLength);n.set(this.toHash,0),n.set(t,this.toHash.byteLength),this.toHash=n}},r.prototype.digest=function(){var e=this;return this.key?this.key.then(function(t){return ng().crypto.subtle.sign(ZE,t,e.toHash).then(function(n){return new Uint8Array(n)})}):bA(this.toHash)?Promise.resolve(fG):Promise.resolve().then(function(){return ng().crypto.subtle.digest(hD,e.toHash)}).then(function(t){return Promise.resolve(new Uint8Array(t))})},r.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(t,n){ng().crypto.subtle.importKey("raw",Ld(e.secret),ZE,!1,["sign"]).then(t,n)}),this.key.catch(function(){}))},r})(),ma=64,pG=32,gG=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),mG=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],vG=Math.pow(2,53)-1,ig=(function(){function r(){this.state=Int32Array.from(mG),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return r.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>vG)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,this.bufferLength===ma&&(this.hashBuffer(),this.bufferLength=0)},r.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%ma>=ma-8){for(var i=this.bufferLength;i<ma;i++)t.setUint8(i,0);this.hashBuffer(),this.bufferLength=0}for(var i=this.bufferLength;i<ma-8;i++)t.setUint8(i,0);t.setUint32(ma-8,Math.floor(e/4294967296),!0),t.setUint32(ma-4,e),this.hashBuffer(),this.finished=!0}for(var a=new Uint8Array(pG),i=0;i<8;i++)a[i*4]=this.state[i]>>>24&255,a[i*4+1]=this.state[i]>>>16&255,a[i*4+2]=this.state[i]>>>8&255,a[i*4+3]=this.state[i]>>>0&255;return a},r.prototype.hashBuffer=function(){for(var e=this,t=e.buffer,n=e.state,i=n[0],a=n[1],s=n[2],o=n[3],l=n[4],u=n[5],c=n[6],h=n[7],f=0;f<ma;f++){if(f<16)this.temp[f]=(t[f*4]&255)<<24|(t[f*4+1]&255)<<16|(t[f*4+2]&255)<<8|t[f*4+3]&255;else{var d=this.temp[f-2],g=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10;d=this.temp[f-15];var v=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3;this.temp[f]=(g+this.temp[f-7]|0)+(v+this.temp[f-16]|0)}var y=(((l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7))+(l&u^~l&c)|0)+(h+(gG[f]+this.temp[f]|0)|0)|0,A=((i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10))+(i&a^i&s^a&s)|0;h=c,c=u,u=l,l=o+y|0,o=s,s=a,a=i,i=y+A|0}n[0]+=i,n[1]+=a,n[2]+=s,n[3]+=o,n[4]+=l,n[5]+=u,n[6]+=c,n[7]+=h},r})(),yG=(function(){function r(e){this.secret=e,this.hash=new ig,this.reset()}return r.prototype.update=function(e){if(!(bA(e)||this.error))try{this.hash.update(Ld(e))}catch(t){this.error=t}},r.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},r.prototype.digest=function(){return rs(this,void 0,void 0,function(){return ns(this,function(e){return[2,this.digestSync()]})})},r.prototype.reset=function(){if(this.hash=new ig,this.secret){this.outer=new ig;var e=AG(this.secret),t=new Uint8Array(ma);t.set(e);for(var n=0;n<ma;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(var n=0;n<e.byteLength;n++)e[n]=0}},r})();function AG(r){var e=Ld(r);if(e.byteLength>ma){var t=new ig;t.update(e),e=t.digest()}var n=new Uint8Array(ma);return n.set(e),n}var bG=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"];function wG(r){if(CG(r)&&typeof r.crypto.subtle=="object"){var e=r.crypto.subtle;return xG(e)}return!1}function CG(r){if(typeof r=="object"&&typeof r.crypto=="object"){var e=r.crypto.getRandomValues;return typeof e=="function"}return!1}function xG(r){return r&&bG.every(function(e){return typeof r[e]=="function"})}var SG=(function(){function r(e){wG(ng())?this.hash=new hG(e):this.hash=new yG(e)}return r.prototype.update=function(e,t){this.hash.update(Ld(e))},r.prototype.digest=function(){return this.hash.digest()},r.prototype.reset=function(){this.hash.reset()},r})();const EG=({serviceId:r,clientVersion:e})=>async t=>{const n=typeof window<"u"?window.navigator:void 0,i=n?.userAgent??"",a=n?.userAgentData?.platform??e2.os(i)??"other",s=void 0,o=n?.userAgentData?.brands??[],l=o[o.length-1],u=l?.brand??e2.browser(i)??"unknown",c=l?.version??"unknown",h=[["aws-sdk-js",e],["ua","2.1"],[`os/${a}`,s],["lang/js"],["md/browser",`${u}_${c}`]];r&&h.push([`api/${r}`,e]);const f=await t?.userAgentAppId?.();return f&&h.push([`app/${f}`]),h},e2={os(r){if(/iPhone|iPad|iPod/.test(r))return"iOS";if(/Macintosh|Mac OS X/.test(r))return"macOS";if(/Windows NT/.test(r))return"Windows";if(/Android/.test(r))return"Android";if(/Linux/.test(r))return"Linux"},browser(r){if(/EdgiOS|EdgA|Edg\//.test(r))return"Microsoft Edge";if(/Firefox\//.test(r))return"Firefox";if(/Chrome\//.test(r))return"Chrome";if(/Safari\//.test(r))return"Safari"}},kG=r=>()=>Promise.reject(r),t2=typeof TextEncoder=="function"?new TextEncoder:null,FG=r=>{if(typeof r=="string"){if(t2)return t2.encode(r).byteLength;let e=r.length;for(let t=e-1;t>=0;t--){const n=r.charCodeAt(t);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&t--}return e}else{if(typeof r.byteLength=="number")return r.byteLength;if(typeof r.size=="number")return r.size}throw new Error(`Body Length computation failed for ${r}`)},TG=["in-region","cross-region","mobile","standard","legacy"],IG=({defaultsMode:r}={})=>Fj(async()=>{const e=typeof r=="function"?await r():r;switch(e?.toLowerCase()){case"auto":return Promise.resolve(DG()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${TG.join(", ")}, got ${e}`)}}),DG=()=>{const r=window?.navigator;if(r?.connection){const{effectiveType:e,rtt:t,downlink:n}=r?.connection;if(typeof e=="string"&&e!=="4g"||Number(t)>100||Number(n)<10)return!0}return r?.userAgentData?.mobile||typeof r?.maxTouchPoints=="number"&&r?.maxTouchPoints>1};class PG{queryCompat;errorRegistry;constructor(e=!1){this.queryCompat=e}resolveRestContentType(e,t){const n=t.getMemberSchemas(),i=Object.values(n).find(a=>!!a.getMergedTraits().httpPayload);if(i){const a=i.getMergedTraits().mediaType;return a||(i.isStringSchema()?"text/plain":i.isBlobSchema()?"application/octet-stream":e)}else if(!t.isUnitSchema()&&Object.values(n).find(s=>{const{httpQuery:o,httpQueryParams:l,httpHeader:u,httpLabel:c,httpPrefixHeaders:h}=s.getMergedTraits();return!o&&!l&&!u&&!c&&h===void 0}))return e}async getErrorSchemaOrThrowBaseException(e,t,n,i,a,s){let o=e;e.includes("#")&&([,o]=e.split("#"));const l={$metadata:a,$fault:n.statusCode<500?"client":"server"};if(!this.errorRegistry)throw new Error("@aws-sdk/core/protocols - error handler not initialized.");try{return{errorSchema:s?.(this.errorRegistry,o)??this.errorRegistry.getSchema(e),errorMetadata:l}}catch{i.message=i.message??i.Message??"UnknownError";const c=this.errorRegistry,h=c.getBaseException();if(h){const g=c.getErrorCtor(h)??Error;throw this.decorateServiceException(Object.assign(new g({name:o}),l),i)}const f=i,d=f?.message??f?.Message??f?.Error?.Message??f?.Error?.message;throw this.decorateServiceException(Object.assign(new Error(d),{name:o},l),i)}}compose(e,t,n){let i=n;t.includes("#")&&([i]=t.split("#"));const a=ra.for(i),s=ra.for("smithy.ts.sdk.synthetic."+n);e.copyFrom(a),e.copyFrom(s),this.errorRegistry=e}decorateServiceException(e,t={}){if(this.queryCompat){const n=e.Message??t.Message,i=jE(e,t);n&&(i.message=n),i.Error={...i.Error,Type:i.Error?.Type,Code:i.Error?.Code,Message:i.Error?.message??i.Error?.Message??n};const a=i.$metadata.requestId;return a&&(i.RequestId=a),i}return jE(e,t)}setQueryCompatError(e,t){const n=t.headers?.["x-amzn-query-error"];if(e!==void 0&&n!=null){const[i,a]=n.split(";"),s=Object.entries(e),o={Code:i,Type:a};Object.assign(e,o);for(const[l,u]of s)o[l==="message"?"Message":l]=u;delete o.__type,e.Error=o}}queryCompatOutput(e,t){e.Error&&(t.Error=e.Error),e.Type&&(t.Type=e.Type),e.Code&&(t.Code=e.Code)}findQueryCompatibleError(e,t){try{return e.getSchema(t)}catch{return e.find(i=>vi.of(i).getMergedTraits().awsQueryError?.[0]===t)}}}class G1{serdeContext;setSerdeContext(e){this.serdeContext=e}}class RG{from;to;keys;constructor(e,t){this.from=e,this.to=t,this.keys=new Set(Object.keys(this.from).filter(n=>n!=="__type"))}mark(e){this.keys.delete(e)}hasUnknown(){return this.keys.size===1&&Object.keys(this.to).length===0}writeUnknown(){if(this.hasUnknown()){const e=this.keys.values().next().value,t=this.from[e];this.to.$unknown=[e,t]}}}function OG(r,e,t){if(t?.source){const n=t.source;if(typeof e=="number"&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER||n!==String(e)))return n.includes(".")?new as(n,"bigDecimal"):BigInt(n)}return e}const BG=(r,e)=>gA(r,e).then(t=>(e?.utf8Encoder??im)(t)),MG=(r,e)=>BG(r,e).then(t=>{if(t.length)try{return JSON.parse(t)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:t}),n}return{}}),_G=(r,e)=>{const t=(a,s)=>Object.keys(a).find(o=>o.toLowerCase()===s.toLowerCase()),n=a=>{let s=a;return typeof s=="number"&&(s=s.toString()),s.indexOf(",")>=0&&(s=s.split(",")[0]),s.indexOf(":")>=0&&(s=s.split(":")[0]),s.indexOf("#")>=0&&(s=s.split("#")[1]),s},i=t(r.headers,"x-amzn-errortype");if(i!==void 0)return n(r.headers[i]);if(e&&typeof e=="object"){const a=t(e,"code");if(a&&e[a]!==void 0)return n(e[a]);if(e.__type!==void 0)return n(e.__type)}};class NG extends G1{settings;constructor(e){super(),this.settings=e}async read(e,t){return this._read(e,typeof t=="string"?JSON.parse(t,OG):await MG(t,this.serdeContext))}readObject(e,t){return this._read(e,t)}_read(e,t){const n=t!==null&&typeof t=="object",i=vi.of(e);if(n){if(i.isStructSchema()){const s=t,o=i.isUnionSchema(),l={};let u;const{jsonName:c}=this.settings;c&&(u={});let h;o&&(h=new RG(s,l));for(const[f,d]of i.structIterator()){let g=f;c&&(g=d.getMergedTraits().jsonName??g,u[g]=f),o&&h.mark(g),s[g]!=null&&(l[f]=this._read(d,s[g]))}if(o)h.writeUnknown();else if(typeof s.__type=="string")for(const[f,d]of Object.entries(s)){const g=c?u[f]??f:f;g in l||(l[g]=d)}return l}if(Array.isArray(t)&&i.isListSchema()){const s=i.getValueSchema(),o=[];for(const l of t)o.push(this._read(s,l));return o}if(i.isMapSchema()){const s=i.getValueSchema(),o={};for(const[l,u]of Object.entries(t))o[l]=this._read(s,u);return o}}if(i.isBlobSchema()&&typeof t=="string")return nm(t);const a=i.getMergedTraits().mediaType;if(i.isStringSchema()&&typeof t=="string"&&a)return a==="application/json"||a.endsWith("+json")?mo.from(t):t;if(i.isTimestampSchema()&&t!=null)switch(UI(i,this.settings)){case 5:return pz(t);case 6:return NI(t);case 7:return yz(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(i.isBigIntegerSchema()&&(typeof t=="number"||typeof t=="string"))return BigInt(t);if(i.isBigDecimalSchema()&&t!=null){if(t instanceof as)return t;const s=t;return s.type==="bigDecimal"&&"string"in s?new as(s.string,s.type):new as(String(t),"bigDecimal")}if(i.isNumericSchema()&&typeof t=="string"){switch(t){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return t}if(i.isDocumentSchema())if(n){const s=Array.isArray(t)?[]:{};for(const[o,l]of Object.entries(t))l instanceof as?s[o]=l:s[o]=this._read(i,l);return s}else return structuredClone(t);return t}}const r2="Ν";class LG{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,(e,t)=>{if(t instanceof as){const n=`${r2+"nv"+this.counter++}_`+t.string;return this.values.set(`"${n}"`,t.string),n}if(typeof t=="bigint"){const n=t.toString(),i=`${r2+"b"+this.counter++}_`+n;return this.values.set(`"${i}"`,n),i}return t}}replaceInJson(e){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 e;for(const[t,n]of this.values)e=e.replace(t,n);return e}}class UG extends G1{settings;buffer;useReplacer=!1;rootSchema;constructor(e){super(),this.settings=e}write(e,t){this.rootSchema=vi.of(e),this.buffer=this._write(this.rootSchema,t)}writeDiscriminatedDocument(e,t){this.write(e,t),typeof this.buffer=="object"&&(this.buffer.__type=vi.of(e).getName(!0))}flush(){const{rootSchema:e,useReplacer:t}=this;if(this.rootSchema=void 0,this.useReplacer=!1,e?.isStructSchema()||e?.isDocumentSchema()){if(!t)return JSON.stringify(this.buffer);const n=new LG;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}_write(e,t,n){const i=t!==null&&typeof t=="object",a=vi.of(e);if(i){if(a.isStructSchema()){const s=t,o={},{jsonName:l}=this.settings;let u;l&&(u={});for(const[c,h]of a.structIterator()){const f=this._write(h,s[c],a);if(f!==void 0){let d=c;l&&(d=h.getMergedTraits().jsonName??c,u[c]=d),o[d]=f}}if(a.isUnionSchema()&&Object.keys(o).length===0){const{$unknown:c}=s;if(Array.isArray(c)){const[h,f]=c;o[h]=this._write(15,f)}}else if(typeof s.__type=="string")for(const[c,h]of Object.entries(s)){const f=l?u[c]??c:c;f in o||(o[f]=this._write(15,h))}return o}if(Array.isArray(t)&&a.isListSchema()){const s=a.getValueSchema(),o=[],l=!!a.getMergedTraits().sparse;for(const u of t)(l||u!=null)&&o.push(this._write(s,u));return o}if(a.isMapSchema()){const s=a.getValueSchema(),o={},l=!!a.getMergedTraits().sparse;for(const[u,c]of Object.entries(t))(l||c!=null)&&(o[u]=this._write(s,c));return o}if(t instanceof Uint8Array&&(a.isBlobSchema()||a.isDocumentSchema()))return a===this.rootSchema?t:(this.serdeContext?.base64Encoder??kg)(t);if(t instanceof Date&&(a.isTimestampSchema()||a.isDocumentSchema()))switch(UI(a,this.settings)){case 5:return t.toISOString().replace(".000Z","Z");case 6:return dz(t);case 7:return t.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",t),t.getTime()/1e3}t instanceof as&&(this.useReplacer=!0)}if(!(t===null&&n?.isStructSchema())){if(a.isStringSchema()){if(typeof t>"u"&&a.isIdempotencyToken())return LI();const s=a.getMergedTraits().mediaType;return t!=null&&s&&(s==="application/json"||s.endsWith("+json"))?mo.from(t):t}if(typeof t=="number"&&a.isNumericSchema())return Math.abs(t)===1/0||isNaN(t)?String(t):t;if(typeof t=="string"&&a.isBlobSchema())return a===this.rootSchema?t:(this.serdeContext?.base64Encoder??kg)(t);if(typeof t=="bigint"&&(this.useReplacer=!0),a.isDocumentSchema())if(i){const s=Array.isArray(t)?[]:{};for(const[o,l]of Object.entries(t))l instanceof as?(this.useReplacer=!0,s[o]=l):s[o]=this._write(a,l);return s}else return structuredClone(t);return t}}}class VG extends G1{settings;constructor(e){super(),this.settings=e}createSerializer(){const e=new UG(this.settings);return e.setSerdeContext(this.serdeContext),e}createDeserializer(){const e=new NG(this.settings);return e.setSerdeContext(this.serdeContext),e}}class zG extends Iz{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t}),this.serviceTarget=n,this.codec=a??new VG({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!i,this.mixin=new PG(this.awsQueryCompatible)}async serializeRequest(e,t,n){const i=await super.serializeRequest(e,t,n);return i.path.endsWith("/")||(i.path+="/"),Object.assign(i.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${e.name}`}),this.awsQueryCompatible&&(i.headers["x-amzn-query-mode"]="true"),(tg(e.input)==="unit"||!i.body)&&(i.body="{}"),i}getPayloadCodec(){return this.codec}async handleError(e,t,n,i,a){this.awsQueryCompatible&&this.mixin.setQueryCompatError(i,n);const s=_G(n,i)??"Unknown";this.mixin.compose(this.compositeErrorRegistry,s,this.options.defaultNamespace);const{errorSchema:o,errorMetadata:l}=await this.mixin.getErrorSchemaOrThrowBaseException(s,this.options.defaultNamespace,n,i,a,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),u=vi.of(o),c=i.message??i.Message??"UnknownError",h=this.compositeErrorRegistry.getErrorCtor(o)??Error,f=new h(c),d={};for(const[g,v]of u.structIterator())i[g]!=null&&(d[g]=this.codec.createDeserializer().readObject(v,i[g]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(i,d),this.mixin.decorateServiceException(Object.assign(f,l,{$fault:u.getMergedTraits().error,message:c},d),i)}}class HG extends zG{constructor({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a}){super({defaultNamespace:e,errorTypeRegistries:t,serviceTarget:n,awsQueryCompatible:i,jsonCodec:a})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const pD=(r,e=!1)=>{if(e){for(const t of r.split("."))if(!pD(t))return!1;return!0}return!(!oh(r)||r.length<3||r.length>63||r!==r.toLowerCase()||L1(r))},n2=":",jG="/",GG=r=>{const e=r.split(n2);if(e.length<6)return null;const[t,n,i,a,s,...o]=e;if(t!=="arn"||n===""||i===""||o.join(n2)==="")return null;const l=o.map(u=>u.split(jG)).flat();return{partition:n,service:i,region:a,accountId:s,resourceId:l}},$G=[{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:"AWS European Sovereign Cloud (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)"}}}],qG={partitions:$G};let WG=qG;const QG=r=>{const{partitions:e}=WG;for(const n of e){const{regions:i,outputs:a}=n;for(const[s,o]of Object.entries(i))if(s===r)return{...a,...o}}for(const n of e){const{regionRegex:i,outputs:a}=n;if(new RegExp(i).test(r))return{...a}}const t=e.find(n=>n.id==="aws");if(!t)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...t.outputs}},gD={isVirtualHostableS3Bucket:pD,parseArn:GG,partition:QG};Md.aws=gD;const mD="required",Ii="fn",Di="argv",Ec="ref",i2=!0,a2="isSet",Ud="booleanEquals",Pu="error",Ka="endpoint",Ps="tree",$1="PartitionResult",q1="getAttr",Nf="stringEquals",s2={[mD]:!1,type:"string"},o2={[mD]:!0,default:!1,type:"boolean"},l2={[Ec]:"Endpoint"},vD={[Ii]:Ud,[Di]:[{[Ec]:"UseFIPS"},!0]},yD={[Ii]:Ud,[Di]:[{[Ec]:"UseDualStack"},!0]},ti={},Kf={[Ec]:"Region"},u2={[Ii]:q1,[Di]:[{[Ec]:$1},"supportsFIPS"]},AD={[Ec]:$1},c2={[Ii]:Ud,[Di]:[!0,{[Ii]:q1,[Di]:[AD,"supportsDualStack"]}]},f2=[vD],d2=[yD],h2=[Kf],YG={parameters:{Region:s2,UseDualStack:o2,UseFIPS:o2,Endpoint:s2},rules:[{conditions:[{[Ii]:a2,[Di]:[l2]}],rules:[{conditions:f2,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:Pu},{conditions:d2,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:Pu},{endpoint:{url:l2,properties:ti,headers:ti},type:Ka}],type:Ps},{conditions:[{[Ii]:a2,[Di]:h2}],rules:[{conditions:[{[Ii]:"aws.partition",[Di]:h2,assign:$1}],rules:[{conditions:[vD,yD],rules:[{conditions:[{[Ii]:Ud,[Di]:[i2,u2]},c2],rules:[{conditions:[{[Ii]:Nf,[Di]:[Kf,"us-east-1"]}],endpoint:{url:"https://cognito-idp-fips.us-east-1.amazonaws.com",properties:ti,headers:ti},type:Ka},{conditions:[{[Ii]:Nf,[Di]:[Kf,"us-east-2"]}],endpoint:{url:"https://cognito-idp-fips.us-east-2.amazonaws.com",properties:ti,headers:ti},type:Ka},{conditions:[{[Ii]:Nf,[Di]:[Kf,"us-west-1"]}],endpoint:{url:"https://cognito-idp-fips.us-west-1.amazonaws.com",properties:ti,headers:ti},type:Ka},{conditions:[{[Ii]:Nf,[Di]:[Kf,"us-west-2"]}],endpoint:{url:"https://cognito-idp-fips.us-west-2.amazonaws.com",properties:ti,headers:ti},type:Ka},{endpoint:{url:"https://cognito-idp-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ti,headers:ti},type:Ka}],type:Ps},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:Pu}],type:Ps},{conditions:f2,rules:[{conditions:[{[Ii]:Ud,[Di]:[u2,i2]}],rules:[{endpoint:{url:"https://cognito-idp-fips.{Region}.{PartitionResult#dnsSuffix}",properties:ti,headers:ti},type:Ka}],type:Ps},{error:"FIPS is enabled but this partition does not support FIPS",type:Pu}],type:Ps},{conditions:d2,rules:[{conditions:[c2],rules:[{conditions:[{[Ii]:Nf,[Di]:["aws",{[Ii]:q1,[Di]:[AD,"name"]}]}],endpoint:{url:"https://cognito-idp.{Region}.amazonaws.com",properties:ti,headers:ti},type:Ka},{endpoint:{url:"https://cognito-idp.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:ti,headers:ti},type:Ka}],type:Ps},{error:"DualStack is enabled but this partition does not support DualStack",type:Pu}],type:Ps},{endpoint:{url:"https://cognito-idp.{Region}.{PartitionResult#dnsSuffix}",properties:ti,headers:ti},type:Ka}],type:Ps}],type:Ps},{error:"Invalid Configuration: Missing Region",type:Pu}]},XG=YG,JG=new Vz({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),KG=(r,e={})=>JG.get(r,()=>aH(XG,{endpointParams:r,logger:e.logger}));Md.aws=gD;class xt extends Hu{constructor(e){super(e),Object.setPrototypeOf(this,xt.prototype)}}class W1 extends xt{name="AccessDeniedException";$fault="client";constructor(e){super({name:"AccessDeniedException",$fault:"client",...e}),Object.setPrototypeOf(this,W1.prototype)}}class Q1 extends xt{name="InternalErrorException";$fault="server";constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),Object.setPrototypeOf(this,Q1.prototype)}}class Y1 extends xt{name="InvalidParameterException";$fault="client";reasonCode;constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),Object.setPrototypeOf(this,Y1.prototype),this.reasonCode=e.reasonCode}}class X1 extends xt{name="NotAuthorizedException";$fault="client";constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,X1.prototype)}}class J1 extends xt{name="ResourceNotFoundException";$fault="client";constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,J1.prototype)}}class K1 extends xt{name="TooManyRequestsException";$fault="client";constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),Object.setPrototypeOf(this,K1.prototype)}}class Z1 extends xt{name="UserImportInProgressException";$fault="client";constructor(e){super({name:"UserImportInProgressException",$fault:"client",...e}),Object.setPrototypeOf(this,Z1.prototype)}}class eb extends xt{name="InternalServerException";$fault="server";constructor(e){super({name:"InternalServerException",$fault:"server",...e}),Object.setPrototypeOf(this,eb.prototype)}}class tb extends xt{name="LimitExceededException";$fault="client";constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),Object.setPrototypeOf(this,tb.prototype)}}class rb extends xt{name="UserNotFoundException";$fault="client";constructor(e){super({name:"UserNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,rb.prototype)}}class nb extends xt{name="InvalidLambdaResponseException";$fault="client";constructor(e){super({name:"InvalidLambdaResponseException",$fault:"client",...e}),Object.setPrototypeOf(this,nb.prototype)}}class ib extends xt{name="TooManyFailedAttemptsException";$fault="client";constructor(e){super({name:"TooManyFailedAttemptsException",$fault:"client",...e}),Object.setPrototypeOf(this,ib.prototype)}}class ab extends xt{name="UnexpectedLambdaException";$fault="client";constructor(e){super({name:"UnexpectedLambdaException",$fault:"client",...e}),Object.setPrototypeOf(this,ab.prototype)}}class sb extends xt{name="UserLambdaValidationException";$fault="client";constructor(e){super({name:"UserLambdaValidationException",$fault:"client",...e}),Object.setPrototypeOf(this,sb.prototype)}}class ob extends xt{name="CodeDeliveryFailureException";$fault="client";constructor(e){super({name:"CodeDeliveryFailureException",$fault:"client",...e}),Object.setPrototypeOf(this,ob.prototype)}}class lb extends xt{name="InvalidPasswordException";$fault="client";constructor(e){super({name:"InvalidPasswordException",$fault:"client",...e}),Object.setPrototypeOf(this,lb.prototype)}}class ub extends xt{name="InvalidSmsRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidSmsRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,ub.prototype)}}class cb extends xt{name="InvalidSmsRoleTrustRelationshipException";$fault="client";constructor(e){super({name:"InvalidSmsRoleTrustRelationshipException",$fault:"client",...e}),Object.setPrototypeOf(this,cb.prototype)}}class fb extends xt{name="PreconditionNotMetException";$fault="client";constructor(e){super({name:"PreconditionNotMetException",$fault:"client",...e}),Object.setPrototypeOf(this,fb.prototype)}}class db extends xt{name="UnsupportedUserStateException";$fault="client";constructor(e){super({name:"UnsupportedUserStateException",$fault:"client",...e}),Object.setPrototypeOf(this,db.prototype)}}class hb extends xt{name="UsernameExistsException";$fault="client";constructor(e){super({name:"UsernameExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,hb.prototype)}}class pb extends xt{name="AliasExistsException";$fault="client";constructor(e){super({name:"AliasExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,pb.prototype)}}class gb extends xt{name="InvalidUserPoolConfigurationException";$fault="client";constructor(e){super({name:"InvalidUserPoolConfigurationException",$fault:"client",...e}),Object.setPrototypeOf(this,gb.prototype)}}class mb extends xt{name="InvalidEmailRoleAccessPolicyException";$fault="client";constructor(e){super({name:"InvalidEmailRoleAccessPolicyException",$fault:"client",...e}),Object.setPrototypeOf(this,mb.prototype)}}class vb extends xt{name="MFAMethodNotFoundException";$fault="client";constructor(e){super({name:"MFAMethodNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,vb.prototype)}}class yb extends xt{name="PasswordResetRequiredException";$fault="client";constructor(e){super({name:"PasswordResetRequiredException",$fault:"client",...e}),Object.setPrototypeOf(this,yb.prototype)}}class Ab extends xt{name="UnsupportedOperationException";$fault="client";constructor(e){super({name:"UnsupportedOperationException",$fault:"client",...e}),Object.setPrototypeOf(this,Ab.prototype)}}class bb extends xt{name="UserNotConfirmedException";$fault="client";constructor(e){super({name:"UserNotConfirmedException",$fault:"client",...e}),Object.setPrototypeOf(this,bb.prototype)}}class wb extends xt{name="UserPoolAddOnNotEnabledException";$fault="client";constructor(e){super({name:"UserPoolAddOnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,wb.prototype)}}class Cb extends xt{name="CodeMismatchException";$fault="client";constructor(e){super({name:"CodeMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Cb.prototype)}}class xb extends xt{name="ExpiredCodeException";$fault="client";constructor(e){super({name:"ExpiredCodeException",$fault:"client",...e}),Object.setPrototypeOf(this,xb.prototype)}}class Sb extends xt{name="PasswordHistoryPolicyViolationException";$fault="client";constructor(e){super({name:"PasswordHistoryPolicyViolationException",$fault:"client",...e}),Object.setPrototypeOf(this,Sb.prototype)}}class Eb extends xt{name="SoftwareTokenMFANotFoundException";$fault="client";constructor(e){super({name:"SoftwareTokenMFANotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Eb.prototype)}}class kb extends xt{name="ConcurrentModificationException";$fault="client";constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),Object.setPrototypeOf(this,kb.prototype)}}class Fb extends xt{name="ForbiddenException";$fault="client";constructor(e){super({name:"ForbiddenException",$fault:"client",...e}),Object.setPrototypeOf(this,Fb.prototype)}}class Tb extends xt{name="WebAuthnChallengeNotFoundException";$fault="client";constructor(e){super({name:"WebAuthnChallengeNotFoundException",$fault:"client",...e}),Object.setPrototypeOf(this,Tb.prototype)}}class Ib extends xt{name="WebAuthnClientMismatchException";$fault="client";constructor(e){super({name:"WebAuthnClientMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Ib.prototype)}}class Db extends xt{name="WebAuthnCredentialNotSupportedException";$fault="client";constructor(e){super({name:"WebAuthnCredentialNotSupportedException",$fault:"client",...e}),Object.setPrototypeOf(this,Db.prototype)}}class Pb extends xt{name="WebAuthnNotEnabledException";$fault="client";constructor(e){super({name:"WebAuthnNotEnabledException",$fault:"client",...e}),Object.setPrototypeOf(this,Pb.prototype)}}class Rb extends xt{name="WebAuthnOriginNotAllowedException";$fault="client";constructor(e){super({name:"WebAuthnOriginNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,Rb.prototype)}}class Ob extends xt{name="WebAuthnRelyingPartyMismatchException";$fault="client";constructor(e){super({name:"WebAuthnRelyingPartyMismatchException",$fault:"client",...e}),Object.setPrototypeOf(this,Ob.prototype)}}class Bb extends xt{name="DeviceKeyExistsException";$fault="client";constructor(e){super({name:"DeviceKeyExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Bb.prototype)}}class Mb extends xt{name="GroupExistsException";$fault="client";constructor(e){super({name:"GroupExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Mb.prototype)}}class _b extends xt{name="DuplicateProviderException";$fault="client";constructor(e){super({name:"DuplicateProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,_b.prototype)}}class Nb extends xt{name="ManagedLoginBrandingExistsException";$fault="client";constructor(e){super({name:"ManagedLoginBrandingExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Nb.prototype)}}class Lb extends xt{name="TermsExistsException";$fault="client";constructor(e){super({name:"TermsExistsException",$fault:"client",...e}),Object.setPrototypeOf(this,Lb.prototype)}}class Ub extends xt{name="FeatureUnavailableInTierException";$fault="client";constructor(e){super({name:"FeatureUnavailableInTierException",$fault:"client",...e}),Object.setPrototypeOf(this,Ub.prototype)}}class Vb extends xt{name="TierChangeNotAllowedException";$fault="client";constructor(e){super({name:"TierChangeNotAllowedException",$fault:"client",...e}),Object.setPrototypeOf(this,Vb.prototype)}}class zb extends xt{name="UserPoolTaggingException";$fault="client";constructor(e){super({name:"UserPoolTaggingException",$fault:"client",...e}),Object.setPrototypeOf(this,zb.prototype)}}class Hb extends xt{name="InvalidOAuthFlowException";$fault="client";constructor(e){super({name:"InvalidOAuthFlowException",$fault:"client",...e}),Object.setPrototypeOf(this,Hb.prototype)}}class jb extends xt{name="ScopeDoesNotExistException";$fault="client";constructor(e){super({name:"ScopeDoesNotExistException",$fault:"client",...e}),Object.setPrototypeOf(this,jb.prototype)}}class Gb extends xt{name="UnsupportedIdentityProviderException";$fault="client";constructor(e){super({name:"UnsupportedIdentityProviderException",$fault:"client",...e}),Object.setPrototypeOf(this,Gb.prototype)}}class $b extends xt{name="RefreshTokenReuseException";$fault="client";constructor(e){super({name:"RefreshTokenReuseException",$fault:"client",...e}),Object.setPrototypeOf(this,$b.prototype)}}class qb extends xt{name="UnauthorizedException";$fault="client";constructor(e){super({name:"UnauthorizedException",$fault:"client",...e}),Object.setPrototypeOf(this,qb.prototype)}}class Wb extends xt{name="UnsupportedTokenTypeException";$fault="client";constructor(e){super({name:"UnsupportedTokenTypeException",$fault:"client",...e}),Object.setPrototypeOf(this,Wb.prototype)}}class Qb extends xt{name="WebAuthnConfigurationMissingException";$fault="client";constructor(e){super({name:"WebAuthnConfigurationMissingException",$fault:"client",...e}),Object.setPrototypeOf(this,Qb.prototype)}}class Yb extends xt{name="EnableSoftwareTokenMFAException";$fault="client";constructor(e){super({name:"EnableSoftwareTokenMFAException",$fault:"client",...e}),Object.setPrototypeOf(this,Yb.prototype)}}const ZG="AvailableChallenges",e$="AccessDeniedException",t$="AliasExistsException",r$="AnalyticsEndpointId",n$="AuthFlow",bD="AnalyticsMetadata",i$="AnalyticsMetadataType",a$="AuthParameters",s$="AuthParametersType",wD="AuthenticationResult",o$="AuthenticationResultType",l$="AccessToken",u$="CodeDeliveryFailureException",CD="ClientId",c$="ClientIdType",xD="ClientMetadata",f$="CodeMismatchException",d$="ConcurrentModificationException",Xb="ChallengeName",SD="ChallengeParameters",h$="ChallengeResponses",p$="ChallengeResponsesType",g$="DeviceGroupKey",m$="DeviceKey",v$="DeviceKeyExistsException",y$="DuplicateProviderException",A$="ExpiredCodeException",b$="EncodedData",w$="ExpiresIn",C$="EnableSoftwareTokenMFAException",x$="ForbiddenException",S$="FeatureUnavailableInTierException",E$="GroupExistsException",k$="IpAddress",F$="InitiateAuthRequest",T$="InitiateAuthResponse",I$="InitiateAuth",D$="InternalErrorException",P$="InvalidEmailRoleAccessPolicyException",R$="InvalidLambdaResponseException",O$="InvalidOAuthFlowException",B$="InvalidParameterException",M$="InvalidPasswordException",_$="InternalServerException",N$="InvalidSmsRoleAccessPolicyException",L$="InvalidSmsRoleTrustRelationshipException",U$="IdToken",V$="InvalidUserPoolConfigurationException",z$="LimitExceededException",H$="MFAMethodNotFoundException",j$="ManagedLoginBrandingExistsException",G$="NotAuthorizedException",$$="NewDeviceMetadata",q$="NewDeviceMetadataType",W$="PasswordHistoryPolicyViolationException",Q$="PreconditionNotMetException",Y$="PasswordResetRequiredException",X$="ResourceNotFoundException",J$="RefreshToken",K$="RespondToAuthChallenge",Z$="RespondToAuthChallengeRequest",eq="RespondToAuthChallengeResponse",tq="RefreshTokenReuseException",om="Session",rq="ScopeDoesNotExistException",nq="SessionType",iq="SoftwareTokenMFANotFoundException",aq="TierChangeNotAllowedException",sq="TermsExistsException",oq="TooManyFailedAttemptsException",lq="TooManyRequestsException",uq="TokenModelType",cq="TokenType",fq="UserContextDataType",ED="UserContextData",dq="UnauthorizedException",hq="UsernameExistsException",pq="UserImportInProgressException",gq="UnsupportedIdentityProviderException",mq="UnexpectedLambdaException",vq="UserLambdaValidationException",yq="UserNotConfirmedException",Aq="UserNotFoundException",bq="UnsupportedOperationException",wq="UserPoolAddOnNotEnabledException",Cq="UserPoolTaggingException",xq="UnsupportedTokenTypeException",Sq="UnsupportedUserStateException",Eq="WebAuthnClientMismatchException",kq="WebAuthnConfigurationMissingException",Fq="WebAuthnChallengeNotFoundException",Tq="WebAuthnCredentialNotSupportedException",Iq="WebAuthnNotEnabledException",Dq="WebAuthnOriginNotAllowedException",Pq="WebAuthnRelyingPartyMismatchException",Ot="client",Ft="error",Bt="httpError",Tt="message",Rq="reasonCode",kD="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentityprovider",FD="server",at="com.amazonaws.cognitoidentityprovider",TD=ra.for(kD);var Oq=[-3,kD,"CognitoIdentityProviderServiceException",0,[],[]];TD.registerError(Oq,xt);const kt=ra.for(at);var Bq=[-3,at,e$,{[Ft]:Ot,[Bt]:403},[Tt],[0]];kt.registerError(Bq,W1);var Mq=[-3,at,t$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Mq,pb);var _q=[-3,at,u$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(_q,ob);var Nq=[-3,at,f$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Nq,Cb);var Lq=[-3,at,d$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Lq,kb);var Uq=[-3,at,v$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Uq,Bb);var Vq=[-3,at,y$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Vq,_b);var zq=[-3,at,C$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(zq,Yb);var Hq=[-3,at,A$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Hq,xb);var jq=[-3,at,S$,{[Ft]:Ot,[Bt]:403},[Tt],[0]];kt.registerError(jq,Ub);var Gq=[-3,at,x$,{[Ft]:Ot,[Bt]:403},[Tt],[0]];kt.registerError(Gq,Fb);var $q=[-3,at,E$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError($q,Mb);var qq=[-3,at,D$,{[Ft]:FD},[Tt],[0]];kt.registerError(qq,Q1);var Wq=[-3,at,_$,{[Ft]:FD},[Tt],[0]];kt.registerError(Wq,eb);var Qq=[-3,at,P$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Qq,mb);var Yq=[-3,at,R$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Yq,nb);var Xq=[-3,at,O$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Xq,Hb);var Jq=[-3,at,B$,{[Ft]:Ot,[Bt]:400},[Tt,Rq],[0,0]];kt.registerError(Jq,Y1);var Kq=[-3,at,M$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Kq,lb);var Zq=[-3,at,N$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(Zq,ub);var eW=[-3,at,L$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(eW,cb);var tW=[-3,at,V$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(tW,gb);var rW=[-3,at,z$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(rW,tb);var nW=[-3,at,j$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(nW,Nb);var iW=[-3,at,H$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(iW,vb);var aW=[-3,at,G$,{[Ft]:Ot,[Bt]:403},[Tt],[0]];kt.registerError(aW,X1);var sW=[-3,at,W$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(sW,Sb);var oW=[-3,at,Y$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(oW,yb);var lW=[-3,at,Q$,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(lW,fb);var uW=[-3,at,tq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(uW,$b);var cW=[-3,at,X$,{[Ft]:Ot,[Bt]:404},[Tt],[0]];kt.registerError(cW,J1);var fW=[-3,at,rq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(fW,jb);var dW=[-3,at,iq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(dW,Eb);var hW=[-3,at,sq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(hW,Lb);var pW=[-3,at,aq,{[Ft]:Ot,[Bt]:403},[Tt],[0]];kt.registerError(pW,Vb);var gW=[-3,at,oq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(gW,ib);var mW=[-3,at,lq,{[Ft]:Ot,[Bt]:429},[Tt],[0]];kt.registerError(mW,K1);var vW=[-3,at,dq,{[Ft]:Ot,[Bt]:401},[Tt],[0]];kt.registerError(vW,qb);var yW=[-3,at,mq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(yW,ab);var AW=[-3,at,gq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(AW,Gb);var bW=[-3,at,bq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(bW,Ab);var wW=[-3,at,xq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(wW,Wb);var CW=[-3,at,Sq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(CW,db);var xW=[-3,at,pq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(xW,Z1);var SW=[-3,at,vq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(SW,sb);var EW=[-3,at,hq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(EW,hb);var kW=[-3,at,yq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(kW,bb);var FW=[-3,at,Aq,{[Ft]:Ot,[Bt]:404},[Tt],[0]];kt.registerError(FW,rb);var TW=[-3,at,wq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(TW,wb);var IW=[-3,at,Cq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(IW,zb);var DW=[-3,at,Fq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(DW,Tb);var PW=[-3,at,Eq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(PW,Ib);var RW=[-3,at,kq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(RW,Qb);var OW=[-3,at,Tq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(OW,Db);var BW=[-3,at,Iq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(BW,Pb);var MW=[-3,at,Dq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(MW,Rb);var _W=[-3,at,Pq,{[Ft]:Ot,[Bt]:400},[Tt],[0]];kt.registerError(_W,Ob);const NW=[TD,kt];var ID=[0,at,c$,8,0],lm=[0,at,nq,8,0],Kv=[0,at,uq,8,0],DD=[3,at,i$,0,[r$],[0]],PD=[3,at,o$,0,[l$,w$,cq,J$,U$,$$],[[()=>Kv,0],1,0,[()=>Kv,0],[()=>Kv,0],()=>VW]],LW=[3,at,F$,0,[n$,CD,a$,xD,bD,ED,om],[0,[()=>ID,0],[()=>jW,0],128,()=>DD,[()=>RD,0],[()=>lm,0]],2],UW=[3,at,T$,0,[Xb,om,SD,wD,ZG],[0,[()=>lm,0],128,[()=>PD,0],64]],VW=[3,at,q$,0,[m$,g$],[0,0]],zW=[3,at,Z$,0,[CD,Xb,om,h$,bD,ED,xD],[[()=>ID,0],0,[()=>lm,0],[()=>GW,0],()=>DD,[()=>RD,0],128],2],HW=[3,at,eq,0,[Xb,om,SD,wD],[0,[()=>lm,0],128,[()=>PD,0]]],RD=[3,at,fq,8,[k$,b$],[0,0]],jW=[2,at,s$,8,0,0],GW=[2,at,p$,8,0,0],$W=[9,at,I$,0,()=>LW,()=>UW],qW=[9,at,K$,0,()=>zW,()=>HW];const WW=r=>({apiVersion:"2016-04-18",base64Decoder:r?.base64Decoder??nm,base64Encoder:r?.base64Encoder??kg,disableHostPrefix:r?.disableHostPrefix??!1,endpointProvider:r?.endpointProvider??KG,extensions:r?.extensions??[],httpAuthSchemeProvider:r?.httpAuthSchemeProvider??iG,httpAuthSchemes:r?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new kj},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Rz}],logger:r?.logger??new iD,protocol:r?.protocol??HG,protocolSettings:r?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentityprovider",errorTypeRegistries:NW,xmlNamespace:"http://cognito-idp.amazonaws.com/doc/2016-04-18/",version:"2016-04-18",serviceTarget:"AWSCognitoIdentityProviderService"},serviceId:r?.serviceId??"Cognito Identity Provider",urlParser:r?.urlParser??dc,utf8Decoder:r?.utf8Decoder??Dl,utf8Encoder:r?.utf8Encoder??im}),QW=r=>{const e=IG(r),t=()=>e().then(uj),n=WW(r);return{...n,...r,runtime:"browser",defaultsMode:e,bodyLengthChecker:r?.bodyLengthChecker??FG,credentialDefaultProvider:r?.credentialDefaultProvider??(i=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:r?.defaultUserAgentProvider??EG({serviceId:n.serviceId,clientVersion:lG.version}),maxAttempts:r?.maxAttempts??cd,region:r?.region??kG("Region is missing"),requestHandler:_1.create(r?.requestHandler??t),retryMode:r?.retryMode??(async()=>(await t()).retryMode||ZH),sha256:r?.sha256??SG,streamCollector:r?.streamCollector??jV,useDualstackEndpoint:r?.useDualstackEndpoint??(()=>Promise.resolve(RH)),useFipsEndpoint:r?.useFipsEndpoint??(()=>Promise.resolve(OH))}},YW=r=>({setRegion(e){r.region=e},region(){return r.region}}),XW=r=>({region:r.region()}),JW=r=>{const e=r.httpAuthSchemes;let t=r.httpAuthSchemeProvider,n=r.credentials;return{setHttpAuthScheme(i){const a=e.findIndex(s=>s.schemeId===i.schemeId);a===-1?e.push(i):e.splice(a,1,i)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(i){t=i},httpAuthSchemeProvider(){return t},setCredentials(i){n=i},credentials(){return n}}},KW=r=>({httpAuthSchemes:r.httpAuthSchemes(),httpAuthSchemeProvider:r.httpAuthSchemeProvider(),credentials:r.credentials()}),ZW=(r,e)=>{const t=Object.assign(YW(r),pj(r),mV(r),JW(r));return e.forEach(n=>n.configure(t)),Object.assign(r,XW(t),gj(t),vV(t),KW(t))};class eQ extends oj{config;constructor(...[e]){const t=QW(e||{});super(t),this.initConfig=t;const n=sG(t),i=Uz(n),a=sj(i),s=_H(a),o=s,l=KH(o),u=aG(l),c=ZW(u,e?.extensions||[]);this.config=c,this.middlewareStack.use(ez(this.config)),this.middlewareStack.use(PH(this.config)),this.middlewareStack.use(xj(this.config)),this.middlewareStack.use(UH(this.config)),this.middlewareStack.use(wV(this.config)),this.middlewareStack.use(SV(this.config)),this.middlewareStack.use(FV(this.config)),this.middlewareStack.use(RV(this.config,{httpAuthSchemeParametersProvider:rG,identityProviderConfigProvider:async h=>new Pz({"aws.auth#sigv4":h.credentials})})),this.middlewareStack.use(NV(this.config))}destroy(){super.destroy()}}class p2 extends H1.classBuilder().ep(dD).m(function(e,t,n,i){return[tD(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","InitiateAuth",{}).n("CognitoIdentityProviderClient","InitiateAuthCommand").sc($W).build(){}class tQ extends H1.classBuilder().ep(dD).m(function(e,t,n,i){return[tD(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityProviderService","RespondToAuthChallenge",{}).n("CognitoIdentityProviderClient","RespondToAuthChallengeCommand").sc(qW).build(){}class rQ{init(e,t,n){this.cognitoClient=new eQ({region:t}),this.spiffRegion=e,this.userPoolClientId=n}async generateCode(e){const t=await this.cognitoClient?.send(new p2({AuthFlow:"CUSTOM_AUTH",ClientId:this.userPoolClientId,AuthParameters:{USERNAME:e}}));t?.ChallengeName==="CUSTOM_CHALLENGE"&&(this.challengeSession=t.Session)}async verifyCode(e,t,n){const i=await this.cognitoClient?.send(new tQ({ClientId:this.userPoolClientId,ChallengeName:"CUSTOM_CHALLENGE",Session:this.challengeSession,ChallengeResponses:{USERNAME:e,ANSWER:t},ClientMetadata:{partnerId:n,environment:(this.spiffRegion||"").toLowerCase()}}));return i?.ChallengeName==="CUSTOM_CHALLENGE"&&(this.challengeSession=i.Session),i}async refreshTokens(){const e=localStorage.getItem("cognito-tokens");if(!e)throw new Error("Failed to find existing tokens.");const t=JSON.parse(e);return await this.cognitoClient?.send(new p2({AuthFlow:"REFRESH_TOKEN_AUTH",ClientId:this.userPoolClientId,AuthParameters:{REFRESH_TOKEN:t.RefreshToken||""}}))}}const Lf=new rQ;var nQ={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},iQ={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function dd(r){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?dd=function(e){return typeof e}:dd=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dd(r)}function g2(r){return aQ(r)||sQ(r)||oQ(r)||lQ()}function aQ(r){if(Array.isArray(r))return r}function sQ(r){if(typeof Symbol<"u"&&Symbol.iterator in Object(r))return Array.from(r)}function oQ(r,e){if(r){if(typeof r=="string")return m2(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m2(r,e)}}function m2(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function lQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2803
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var uQ={normalizePrecision:function(e){var t=e.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return e.map(function(n){return n.getPrecision()!==t?n.convertPrecision(t):n})},minimum:function(e){var t=g2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.lessThan(s)?a:s}),a},maximum:function(e){var t=g2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.greaterThan(s)?a:s}),a}};function OD(r){return!isNaN(parseInt(r))&&isFinite(r)}function cQ(r){return OD(r)&&r<=100&&r>=0}function fQ(r){return r.length>0&&r.every(function(e){return e>=0})&&r.some(function(e){return e>0})}function v2(r){return r%2===0}function y2(r){return OD(r)&&!Number.isInteger(r)}function dQ(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=r.toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}function Uf(r){return Math.abs(r)%1===.5}function hQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(t,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?t(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",r,!0),pQ(i,e.headers),i.send()})}function pQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var t in e)r.setRequestHeader(t,e[t]);return r}function Zf(r){return typeof r>"u"}function BD(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(r).forEach(function(n){if(dd(n[1])==="object"){var i=BD(n[1]);Object.entries(i).forEach(function(a){t[n[0]+e+a[0]]=a[1]})}else t[n[0]]=n[1]}),t}function gQ(r){return!!r&&(dd(r)==="object"||typeof r=="function")&&typeof r.then=="function"}function MD(){var r=function(n,i){var a=function(l){return Math.pow(10,dQ(l))},s=Math.max(a(n),a(i));return Math.round(n*s)*Math.round(i*s)/(s*s)},e={HALF_ODD:function(n){var i=Math.round(n);return Uf(n)&&v2(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return Uf(n)?v2(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return Uf(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return Uf(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return Uf(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return y2(n)||y2(i)?r(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return e[i](n)}}}var mQ=MD();function vQ(r){var e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(r);return{getMatches:function(){return e!==null?e.slice(1).filter(function(n){return!Zf(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Zf(this.getMatches().find(n))?0:this.getMatches()[mQ.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Zf(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Zf(this.getMatches().find(function(n){return n===","}))}}}function yQ(r){var e=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var s in a)i=i.replace("{{".concat(s,"}}"),a[s]);return i},t=function(i,a){return hQ(e(r.endpoint,{from:i,to:a}),{headers:r.headers})};return{getExchangeRate:function(i,a){return(gQ(r.endpoint)?r.endpoint:t(i,a)).then(function(s){return BD(s)[e(r.propertyPath,{from:i,to:a})]})}}}function Vd(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!r)throw new t(e)}function AQ(r){Vd(cQ(r),"You must provide a numeric value between 0 and 100.",RangeError)}function bQ(r){Vd(fQ(r),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function Zv(r){Vd(Number.isInteger(r),"You must provide an integer.",TypeError)}var kn=MD(),wQ=function r(e){var t=Object.assign({},{amount:r.defaultAmount,currency:r.defaultCurrency,precision:r.defaultPrecision},e),n=t.amount,i=t.currency,a=t.precision;Zv(n),Zv(a);var s=r.globalLocale,o=r.globalFormat,l=r.globalRoundingMode,u=r.globalFormatRoundingMode,c=Object.assign({},r.globalExchangeRatesApi),h=function(g){var v=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},g),Object.assign({},{locale:this.locale},g));return Object.assign(r({amount:v.amount,currency:v.currency,precision:v.precision}),{locale:v.locale})},f=function(g){Vd(this.hasSameCurrency(g),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(g){return h.call(this,{locale:g})},getPrecision:function(){return a},convertPrecision:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;Zv(g);var y=this.getPrecision(),A=g>y,C=A?kn.multiply:kn.divide,k=A?[g,y]:[y,g],T=Math.pow(10,kn.subtract.apply(kn,k));return h.call(this,{amount:kn.round(C(this.getAmount(),T),v),precision:g})},add:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return h.call(this,{amount:kn.add(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},subtract:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return h.call(this,{amount:kn.subtract(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},multiply:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return h.call(this,{amount:kn.round(kn.multiply(this.getAmount(),g),v)})},divide:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return h.call(this,{amount:kn.round(kn.divide(this.getAmount(),g),v)})},percentage:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return AQ(g),this.multiply(kn.divide(g,100),v)},allocate:function(g){var v=this;bQ(g);for(var y=g.reduce(function(T,S){return kn.add(T,S)}),A=this.getAmount(),C=g.map(function(T){var S=Math.floor(kn.divide(kn.multiply(v.getAmount(),T),y));return A=kn.subtract(A,S),h.call(v,{amount:S})}),k=0;A>0;)g[k]>0&&(C[k]=C[k].add(h.call(this,{amount:1})),A=kn.subtract(A,1)),k+=1;return C},convert:function(g){var v=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=y.endpoint,C=A===void 0?c.endpoint:A,k=y.propertyPath,T=k===void 0?c.propertyPath||"rates.{{to}}":k,S=y.headers,R=S===void 0?c.headers:S,B=y.roundingMode,G=B===void 0?l:B,$=Object.assign({},{endpoint:C,propertyPath:T,headers:R,roundingMode:G});return yQ($).getExchangeRate(this.getCurrency(),g).then(function(Y){return Vd(!Zf(Y),'No rate was found for the destination currency "'.concat(g,'".'),TypeError),h.call(v,{amount:kn.round(kn.multiply(v.getAmount(),parseFloat(Y)),$.roundingMode),currency:g})})},equalsTo:function(g){return this.hasSameAmount(g)&&this.hasSameCurrency(g)},lessThan:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<v[1].getAmount()},lessThanOrEqual:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<=v[1].getAmount()},greaterThan:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>v[1].getAmount()},greaterThanOrEqual:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>=v[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(g){return this.getCurrency()===g.getCurrency()},hasSameAmount:function(g){var v=r.normalizePrecision([this,g]);return v[0].getAmount()===v[1].getAmount()},toFormat:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=vQ(g);return this.toRoundedUnit(y.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return kn.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,g);return kn.divide(kn.round(kn.multiply(this.toUnit(),y),v),y)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},CQ=Object.assign(wQ,nQ,iQ,uQ),Za={},ey,A2;function xQ(){if(A2)return ey;A2=1;function r(t){return t}function e(t,a,s){for(var a=a||r,s=s||t,o=0,l=t.length;o<l;o+=1)if(a.call(s,t[o],o))return t[o]}return ey=e,ey}var ty={exports:{}},b2;function SQ(){if(b2)return ty.exports;b2=1;var r=ty.exports=function(e,t){if(typeof e=="function"||t)return r.by(e,t);for(var n={object:[],function:[],string:{},number:{},boolean:{},undefined:{}},i=[],a=0;a<e.length;a++){var s=e[a],o=s==="__proto__"?n.objects:n[typeof s]||n.objects;Array.isArray(o)?o.indexOf(s)<0&&(o.push(s),i.push(s)):Object.hasOwnProperty.call(o,s)||(o[s]=!0,i.push(s))}return i};return r.by=function(e,t){if(typeof e=="function"){var n=t;t=e,e=n}for(var i=[],a=0;a<e.length;a++){for(var s=e[a],o=!1,l=0;l<i.length;l++){var u=i[l];if(t.call(i,s,u)){o=!0;break}}o||i.push(s)}return i},ty.exports}var ry,w2;function EQ(){return w2||(w2=1,ry=[{code:"AED",number:"784",digits:2,currency:"UAE Dirham",countries:["United Arab Emirates (The)"]},{code:"AFN",number:"971",digits:2,currency:"Afghani",countries:["Afghanistan"]},{code:"ALL",number:"008",digits:2,currency:"Lek",countries:["Albania"]},{code:"AMD",number:"051",digits:2,currency:"Armenian Dram",countries:["Armenia"]},{code:"ANG",number:"532",digits:2,currency:"Netherlands Antillean Guilder",countries:["Curaçao","Sint Maarten (Dutch Part)"]},{code:"AOA",number:"973",digits:2,currency:"Kwanza",countries:["Angola"]},{code:"ARS",number:"032",digits:2,currency:"Argentine Peso",countries:["Argentina"]},{code:"AUD",number:"036",digits:2,currency:"Australian Dollar",countries:["Australia","Christmas Island","Cocos (Keeling) Islands (The)","Heard Island and Mcdonald Islands","Kiribati","Nauru","Norfolk Island","Tuvalu"]},{code:"AWG",number:"533",digits:2,currency:"Aruban Florin",countries:["Aruba"]},{code:"AZN",number:"944",digits:2,currency:"Azerbaijan Manat",countries:["Azerbaijan"]},{code:"BAM",number:"977",digits:2,currency:"Convertible Mark",countries:["Bosnia and Herzegovina"]},{code:"BBD",number:"052",digits:2,currency:"Barbados Dollar",countries:["Barbados"]},{code:"BDT",number:"050",digits:2,currency:"Taka",countries:["Bangladesh"]},{code:"BGN",number:"975",digits:2,currency:"Bulgarian Lev",countries:["Bulgaria"]},{code:"BHD",number:"048",digits:3,currency:"Bahraini Dinar",countries:["Bahrain"]},{code:"BIF",number:"108",digits:0,currency:"Burundi Franc",countries:["Burundi"]},{code:"BMD",number:"060",digits:2,currency:"Bermudian Dollar",countries:["Bermuda"]},{code:"BND",number:"096",digits:2,currency:"Brunei Dollar",countries:["Brunei Darussalam"]},{code:"BOB",number:"068",digits:2,currency:"Boliviano",countries:["Bolivia (Plurinational State Of)"]},{code:"BOV",number:"984",digits:2,currency:"Mvdol",countries:["Bolivia (Plurinational State Of)"]},{code:"BRL",number:"986",digits:2,currency:"Brazilian Real",countries:["Brazil"]},{code:"BSD",number:"044",digits:2,currency:"Bahamian Dollar",countries:["Bahamas (The)"]},{code:"BTN",number:"064",digits:2,currency:"Ngultrum",countries:["Bhutan"]},{code:"BWP",number:"072",digits:2,currency:"Pula",countries:["Botswana"]},{code:"BYN",number:"933",digits:2,currency:"Belarusian Ruble",countries:["Belarus"]},{code:"BZD",number:"084",digits:2,currency:"Belize Dollar",countries:["Belize"]},{code:"CAD",number:"124",digits:2,currency:"Canadian Dollar",countries:["Canada"]},{code:"CDF",number:"976",digits:2,currency:"Congolese Franc",countries:["Congo (The Democratic Republic of The)"]},{code:"CHE",number:"947",digits:2,currency:"WIR Euro",countries:["Switzerland"]},{code:"CHF",number:"756",digits:2,currency:"Swiss Franc",countries:["Liechtenstein","Switzerland"]},{code:"CHW",number:"948",digits:2,currency:"WIR Franc",countries:["Switzerland"]},{code:"CLF",number:"990",digits:4,currency:"Unidad de Fomento",countries:["Chile"]},{code:"CLP",number:"152",digits:0,currency:"Chilean Peso",countries:["Chile"]},{code:"CNY",number:"156",digits:2,currency:"Yuan Renminbi",countries:["China"]},{code:"COP",number:"170",digits:2,currency:"Colombian Peso",countries:["Colombia"]},{code:"COU",number:"970",digits:2,currency:"Unidad de Valor Real",countries:["Colombia"]},{code:"CRC",number:"188",digits:2,currency:"Costa Rican Colon",countries:["Costa Rica"]},{code:"CUC",number:"931",digits:2,currency:"Peso Convertible",countries:["Cuba"]},{code:"CUP",number:"192",digits:2,currency:"Cuban Peso",countries:["Cuba"]},{code:"CVE",number:"132",digits:2,currency:"Cabo Verde Escudo",countries:["Cabo Verde"]},{code:"CZK",number:"203",digits:2,currency:"Czech Koruna",countries:["Czechia"]},{code:"DJF",number:"262",digits:0,currency:"Djibouti Franc",countries:["Djibouti"]},{code:"DKK",number:"208",digits:2,currency:"Danish Krone",countries:["Denmark","Faroe Islands (The)","Greenland"]},{code:"DOP",number:"214",digits:2,currency:"Dominican Peso",countries:["Dominican Republic (The)"]},{code:"DZD",number:"012",digits:2,currency:"Algerian Dinar",countries:["Algeria"]},{code:"EGP",number:"818",digits:2,currency:"Egyptian Pound",countries:["Egypt"]},{code:"ERN",number:"232",digits:2,currency:"Nakfa",countries:["Eritrea"]},{code:"ETB",number:"230",digits:2,currency:"Ethiopian Birr",countries:["Ethiopia"]},{code:"EUR",number:"978",digits:2,currency:"Euro",countries:["Åland Islands","Andorra","Austria","Belgium","Croatia","Cyprus","Estonia","European Union","Finland","France","French Guiana","French Southern Territories (The)","Germany","Greece","Guadeloupe","Holy See (The)","Ireland","Italy","Latvia","Lithuania","Luxembourg","Malta","Martinique","Mayotte","Monaco","Montenegro","Netherlands (The)","Portugal","Réunion","Saint Barthélemy","Saint Martin (French Part)","Saint Pierre and Miquelon","San Marino","Slovakia","Slovenia","Spain"]},{code:"FJD",number:"242",digits:2,currency:"Fiji Dollar",countries:["Fiji"]},{code:"FKP",number:"238",digits:2,currency:"Falkland Islands Pound",countries:["Falkland Islands (The) [Malvinas]"]},{code:"GBP",number:"826",digits:2,currency:"Pound Sterling",countries:["Guernsey","Isle of Man","Jersey","United Kingdom of Great Britain and Northern Ireland (The)"]},{code:"GEL",number:"981",digits:2,currency:"Lari",countries:["Georgia"]},{code:"GHS",number:"936",digits:2,currency:"Ghana Cedi",countries:["Ghana"]},{code:"GIP",number:"292",digits:2,currency:"Gibraltar Pound",countries:["Gibraltar"]},{code:"GMD",number:"270",digits:2,currency:"Dalasi",countries:["Gambia (The)"]},{code:"GNF",number:"324",digits:0,currency:"Guinean Franc",countries:["Guinea"]},{code:"GTQ",number:"320",digits:2,currency:"Quetzal",countries:["Guatemala"]},{code:"GYD",number:"328",digits:2,currency:"Guyana Dollar",countries:["Guyana"]},{code:"HKD",number:"344",digits:2,currency:"Hong Kong Dollar",countries:["Hong Kong"]},{code:"HNL",number:"340",digits:2,currency:"Lempira",countries:["Honduras"]},{code:"HTG",number:"332",digits:2,currency:"Gourde",countries:["Haiti"]},{code:"HUF",number:"348",digits:2,currency:"Forint",countries:["Hungary"]},{code:"IDR",number:"360",digits:2,currency:"Rupiah",countries:["Indonesia"]},{code:"ILS",number:"376",digits:2,currency:"New Israeli Sheqel",countries:["Israel"]},{code:"INR",number:"356",digits:2,currency:"Indian Rupee",countries:["Bhutan","India"]},{code:"IQD",number:"368",digits:3,currency:"Iraqi Dinar",countries:["Iraq"]},{code:"IRR",number:"364",digits:2,currency:"Iranian Rial",countries:["Iran (Islamic Republic Of)"]},{code:"ISK",number:"352",digits:0,currency:"Iceland Krona",countries:["Iceland"]},{code:"JMD",number:"388",digits:2,currency:"Jamaican Dollar",countries:["Jamaica"]},{code:"JOD",number:"400",digits:3,currency:"Jordanian Dinar",countries:["Jordan"]},{code:"JPY",number:"392",digits:0,currency:"Yen",countries:["Japan"]},{code:"KES",number:"404",digits:2,currency:"Kenyan Shilling",countries:["Kenya"]},{code:"KGS",number:"417",digits:2,currency:"Som",countries:["Kyrgyzstan"]},{code:"KHR",number:"116",digits:2,currency:"Riel",countries:["Cambodia"]},{code:"KMF",number:"174",digits:0,currency:"Comorian Franc ",countries:["Comoros (The)"]},{code:"KPW",number:"408",digits:2,currency:"North Korean Won",countries:["Korea (The Democratic People’s Republic Of)"]},{code:"KRW",number:"410",digits:0,currency:"Won",countries:["Korea (The Republic Of)"]},{code:"KWD",number:"414",digits:3,currency:"Kuwaiti Dinar",countries:["Kuwait"]},{code:"KYD",number:"136",digits:2,currency:"Cayman Islands Dollar",countries:["Cayman Islands (The)"]},{code:"KZT",number:"398",digits:2,currency:"Tenge",countries:["Kazakhstan"]},{code:"LAK",number:"418",digits:2,currency:"Lao Kip",countries:["Lao People’s Democratic Republic (The)"]},{code:"LBP",number:"422",digits:2,currency:"Lebanese Pound",countries:["Lebanon"]},{code:"LKR",number:"144",digits:2,currency:"Sri Lanka Rupee",countries:["Sri Lanka"]},{code:"LRD",number:"430",digits:2,currency:"Liberian Dollar",countries:["Liberia"]},{code:"LSL",number:"426",digits:2,currency:"Loti",countries:["Lesotho"]},{code:"LYD",number:"434",digits:3,currency:"Libyan Dinar",countries:["Libya"]},{code:"MAD",number:"504",digits:2,currency:"Moroccan Dirham",countries:["Morocco","Western Sahara"]},{code:"MDL",number:"498",digits:2,currency:"Moldovan Leu",countries:["Moldova (The Republic Of)"]},{code:"MGA",number:"969",digits:2,currency:"Malagasy Ariary",countries:["Madagascar"]},{code:"MKD",number:"807",digits:2,currency:"Denar",countries:["North Macedonia"]},{code:"MMK",number:"104",digits:2,currency:"Kyat",countries:["Myanmar"]},{code:"MNT",number:"496",digits:2,currency:"Tugrik",countries:["Mongolia"]},{code:"MOP",number:"446",digits:2,currency:"Pataca",countries:["Macao"]},{code:"MRU",number:"929",digits:2,currency:"Ouguiya",countries:["Mauritania"]},{code:"MUR",number:"480",digits:2,currency:"Mauritius Rupee",countries:["Mauritius"]},{code:"MVR",number:"462",digits:2,currency:"Rufiyaa",countries:["Maldives"]},{code:"MWK",number:"454",digits:2,currency:"Malawi Kwacha",countries:["Malawi"]},{code:"MXN",number:"484",digits:2,currency:"Mexican Peso",countries:["Mexico"]},{code:"MXV",number:"979",digits:2,currency:"Mexican Unidad de Inversion (UDI)",countries:["Mexico"]},{code:"MYR",number:"458",digits:2,currency:"Malaysian Ringgit",countries:["Malaysia"]},{code:"MZN",number:"943",digits:2,currency:"Mozambique Metical",countries:["Mozambique"]},{code:"NAD",number:"516",digits:2,currency:"Namibia Dollar",countries:["Namibia"]},{code:"NGN",number:"566",digits:2,currency:"Naira",countries:["Nigeria"]},{code:"NIO",number:"558",digits:2,currency:"Cordoba Oro",countries:["Nicaragua"]},{code:"NOK",number:"578",digits:2,currency:"Norwegian Krone",countries:["Bouvet Island","Norway","Svalbard and Jan Mayen"]},{code:"NPR",number:"524",digits:2,currency:"Nepalese Rupee",countries:["Nepal"]},{code:"NZD",number:"554",digits:2,currency:"New Zealand Dollar",countries:["Cook Islands (The)","New Zealand","Niue","Pitcairn","Tokelau"]},{code:"OMR",number:"512",digits:3,currency:"Rial Omani",countries:["Oman"]},{code:"PAB",number:"590",digits:2,currency:"Balboa",countries:["Panama"]},{code:"PEN",number:"604",digits:2,currency:"Sol",countries:["Peru"]},{code:"PGK",number:"598",digits:2,currency:"Kina",countries:["Papua New Guinea"]},{code:"PHP",number:"608",digits:2,currency:"Philippine Peso",countries:["Philippines (The)"]},{code:"PKR",number:"586",digits:2,currency:"Pakistan Rupee",countries:["Pakistan"]},{code:"PLN",number:"985",digits:2,currency:"Zloty",countries:["Poland"]},{code:"PYG",number:"600",digits:0,currency:"Guarani",countries:["Paraguay"]},{code:"QAR",number:"634",digits:2,currency:"Qatari Rial",countries:["Qatar"]},{code:"RON",number:"946",digits:2,currency:"Romanian Leu",countries:["Romania"]},{code:"RSD",number:"941",digits:2,currency:"Serbian Dinar",countries:["Serbia"]},{code:"RUB",number:"643",digits:2,currency:"Russian Ruble",countries:["Russian Federation (The)"]},{code:"RWF",number:"646",digits:0,currency:"Rwanda Franc",countries:["Rwanda"]},{code:"SAR",number:"682",digits:2,currency:"Saudi Riyal",countries:["Saudi Arabia"]},{code:"SBD",number:"090",digits:2,currency:"Solomon Islands Dollar",countries:["Solomon Islands"]},{code:"SCR",number:"690",digits:2,currency:"Seychelles Rupee",countries:["Seychelles"]},{code:"SDG",number:"938",digits:2,currency:"Sudanese Pound",countries:["Sudan (The)"]},{code:"SEK",number:"752",digits:2,currency:"Swedish Krona",countries:["Sweden"]},{code:"SGD",number:"702",digits:2,currency:"Singapore Dollar",countries:["Singapore"]},{code:"SHP",number:"654",digits:2,currency:"Saint Helena Pound",countries:["Saint Helena, Ascension and Tristan Da Cunha"]},{code:"SLE",number:"925",digits:2,currency:"Leone",countries:["Sierra Leone"]},{code:"SOS",number:"706",digits:2,currency:"Somali Shilling",countries:["Somalia"]},{code:"SRD",number:"968",digits:2,currency:"Surinam Dollar",countries:["Suriname"]},{code:"SSP",number:"728",digits:2,currency:"South Sudanese Pound",countries:["South Sudan"]},{code:"STN",number:"930",digits:2,currency:"Dobra",countries:["Sao Tome and Principe"]},{code:"SVC",number:"222",digits:2,currency:"El Salvador Colon",countries:["El Salvador"]},{code:"SYP",number:"760",digits:2,currency:"Syrian Pound",countries:["Syrian Arab Republic"]},{code:"SZL",number:"748",digits:2,currency:"Lilangeni",countries:["Eswatini"]},{code:"THB",number:"764",digits:2,currency:"Baht",countries:["Thailand"]},{code:"TJS",number:"972",digits:2,currency:"Somoni",countries:["Tajikistan"]},{code:"TMT",number:"934",digits:2,currency:"Turkmenistan New Manat",countries:["Turkmenistan"]},{code:"TND",number:"788",digits:3,currency:"Tunisian Dinar",countries:["Tunisia"]},{code:"TOP",number:"776",digits:2,currency:"Pa’anga",countries:["Tonga"]},{code:"TRY",number:"949",digits:2,currency:"Turkish Lira",countries:["Türki̇ye"]},{code:"TTD",number:"780",digits:2,currency:"Trinidad and Tobago Dollar",countries:["Trinidad and Tobago"]},{code:"TWD",number:"901",digits:2,currency:"New Taiwan Dollar",countries:["Taiwan (Province of China)"]},{code:"TZS",number:"834",digits:2,currency:"Tanzanian Shilling",countries:["Tanzania, United Republic Of"]},{code:"UAH",number:"980",digits:2,currency:"Hryvnia",countries:["Ukraine"]},{code:"UGX",number:"800",digits:0,currency:"Uganda Shilling",countries:["Uganda"]},{code:"USD",number:"840",digits:2,currency:"US Dollar",countries:["American Samoa","Bonaire, Sint Eustatius and Saba","British Indian Ocean Territory (The)","Ecuador","El Salvador","Guam","Haiti","Marshall Islands (The)","Micronesia (Federated States Of)","Northern Mariana Islands (The)","Palau","Panama","Puerto Rico","Timor-Leste","Turks and Caicos Islands (The)","United States Minor Outlying Islands (The)","United States of America (The)","Virgin Islands (British)","Virgin Islands (u.s.)"]},{code:"USN",number:"997",digits:2,currency:"US Dollar (Next day)",countries:["United States of America (The)"]},{code:"UYI",number:"940",digits:0,currency:"Uruguay Peso en Unidades Indexadas (UI)",countries:["Uruguay"]},{code:"UYU",number:"858",digits:2,currency:"Peso Uruguayo",countries:["Uruguay"]},{code:"UYW",number:"927",digits:4,currency:"Unidad Previsional",countries:["Uruguay"]},{code:"UZS",number:"860",digits:2,currency:"Uzbekistan Sum",countries:["Uzbekistan"]},{code:"VED",number:"926",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VES",number:"928",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VND",number:"704",digits:0,currency:"Dong",countries:["Viet Nam"]},{code:"VUV",number:"548",digits:0,currency:"Vatu",countries:["Vanuatu"]},{code:"WST",number:"882",digits:2,currency:"Tala",countries:["Samoa"]},{code:"XAF",number:"950",digits:0,currency:"CFA Franc BEAC",countries:["Cameroon","Central African Republic (The)","Chad","Congo (The)","Equatorial Guinea","Gabon"]},{code:"XAG",number:"961",digits:0,currency:"Silver",countries:["Zz11_silver"]},{code:"XAU",number:"959",digits:0,currency:"Gold",countries:["Zz08_gold"]},{code:"XBA",number:"955",digits:0,currency:"Bond Markets Unit European Composite Unit (EURCO)",countries:["Zz01_bond Markets Unit European_eurco"]},{code:"XBB",number:"956",digits:0,currency:"Bond Markets Unit European Monetary Unit (E.M.U.-6)",countries:["Zz02_bond Markets Unit European_emu-6"]},{code:"XBC",number:"957",digits:0,currency:"Bond Markets Unit European Unit of Account 9 (E.U.A.-9)",countries:["Zz03_bond Markets Unit European_eua-9"]},{code:"XBD",number:"958",digits:0,currency:"Bond Markets Unit European Unit of Account 17 (E.U.A.-17)",countries:["Zz04_bond Markets Unit European_eua-17"]},{code:"XCD",number:"951",digits:2,currency:"East Caribbean Dollar",countries:["Anguilla","Antigua and Barbuda","Dominica","Grenada","Montserrat","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines"]},{code:"XDR",number:"960",digits:0,currency:"SDR (Special Drawing Right)",countries:["International Monetary Fund (Imf) "]},{code:"XOF",number:"952",digits:0,currency:"CFA Franc BCEAO",countries:["Benin","Burkina Faso","Côte D'ivoire","Guinea-Bissau","Mali","Niger (The)","Senegal","Togo"]},{code:"XPD",number:"964",digits:0,currency:"Palladium",countries:["Zz09_palladium"]},{code:"XPF",number:"953",digits:0,currency:"CFP Franc",countries:["French Polynesia","New Caledonia","Wallis and Futuna"]},{code:"XPT",number:"962",digits:0,currency:"Platinum",countries:["Zz10_platinum"]},{code:"XSU",number:"994",digits:0,currency:"Sucre",countries:['Sistema Unitario De Compensacion Regional De Pagos "Sucre"']},{code:"XTS",number:"963",digits:0,currency:"Codes specifically reserved for testing purposes",countries:["Zz06_testing_code"]},{code:"XUA",number:"965",digits:0,currency:"ADB Unit of Account",countries:["Member Countries of the African Development Bank Group"]},{code:"XXX",number:"999",digits:0,currency:"The codes assigned for transactions where no currency is involved",countries:["Zz07_no_currency"]},{code:"YER",number:"886",digits:2,currency:"Yemeni Rial",countries:["Yemen"]},{code:"ZAR",number:"710",digits:2,currency:"Rand",countries:["Lesotho","Namibia","South Africa"]},{code:"ZMW",number:"967",digits:2,currency:"Zambian Kwacha",countries:["Zambia"]},{code:"ZWG",number:"924",digits:2,currency:"Zimbabwe Gold",countries:["Zimbabwe"]}]),ry}var ny,C2;function kQ(){return C2||(C2=1,ny="2024-06-25"),ny}var x2;function FQ(){if(x2)return Za;x2=1;var r=xQ(),e=SQ(),t=EQ(),n=kQ(),i=function(c){return c=c.toUpperCase(),r(t,function(h){return h.code===c})},a=function(c){return c=c.toLowerCase(),t.filter(function(h){return(h.countries.map(function(f){return f.toLowerCase()})||[]).indexOf(c)>-1})},s=function(c){return r(t,function(h){return h.number===String(c)})},o=function(){return t.map(function(c){return c.code})},l=function(){var c=t.map(function(h){return h.number});return c.filter(function(h){if(h)return h})},u=function(){var c=t.filter(function(h){return h.countries}).map(function(h){return h.countries});return e(Array.prototype.concat.apply([],c))};return Za.code=i,Za.country=a,Za.number=s,Za.codes=o,Za.numbers=l,Za.countries=u,Za.publishDate=n,Za.data=t,Za}var S2=FQ();class _D{formatCurrencyForDisplay(e,t){const n={amount:t||0,currency:e,precision:this.getPrecisionForCurrency(e)};return CQ(n).toFormat(this.getSpecialFormat(e))}getPrecisionForCurrency(e){const t=e,n=S2.code(t);return n?n.digits:2}getSpecialFormat(e){const t=e;if(S2.code(t)?.code==="CLP")return"USD0,0"}}const E2=new _D;class ND{constructor(e,t,n,i){this.presentmentCurrency=void 0,this.presentmentCurrency=i,this.partnerCurrency=n,this.rateFrom=e,this.rateTo=t}code(){return this.presentmentCurrency?this.presentmentCurrency:this.partnerCurrency}conversionRequired(){return this.presentmentCurrency!==void 0&&this.code()!==this.partnerCurrency}getConvertedSubunits(e){return this.conversionRequired()?Math.ceil(this.subunits(this.units(e,this.partnerCurrency)/this.rateFrom*this.rateTo,this.code())):e}units(e,t){return e/Math.pow(10,E2.getPrecisionForCurrency(t))}subunits(e,t){return e*Math.pow(10,E2.getPrecisionForCurrency(t))}}const TQ=async(r,e)=>{const t=await je.getShadowGraphqlClient().query({query:W3(e?.assets?.metadata||!1),errorPolicy:"all",variables:{ids:r}});if(t.error)throw t.error;if(t.errors)throw t.errors.forEach(i=>console.error(i)),new Error("Unable to read workflows. Consult GraphQL errors.");if(t.data.workflows===void 0||t.data.workflows.length!==r.length)throw new Error(`Unable to read workflows: ${t.errors??"Length mismatch in response"}`);const n=yo(t.data.workflows);return n.forEach(i=>{i.finalizeStepConfig||(i.finalizeStepConfig={}),i.finalizeStepConfig.termsMarkdown=i.finalizeStepConfig.termsMarkdown||i.partner.termsMarkdown}),n},IQ=async(r,e)=>{const n=(await e).find(i=>i.id===r);if(!n)throw new Error(`Workflow not found: ${r}`);return n},Jb=async(r,e)=>{const t=r.map(o=>Sd.get({id:o,options:e})),n=r.filter((o,l)=>t[l]===void 0);if(n.length===0)return Promise.all(t);const i=TQ(n,e),a=n.map(o=>Sd.set({id:o,options:e},IQ(o,i))),s=t.filter(o=>o!==void 0);return await Promise.all(s.concat(a))},LD=async(r,e)=>(await Jb([r],e))[0],DQ=async r=>{const e=await je.getShadowGraphqlClient().query({query:yF,variables:{ids:r},errorPolicy:"all",fetchPolicy:"no-cache"});return e.errors&&console.error(e.errors),e.data.integrationProducts||[]};class PQ{constructor(e){this.activeIntegration=void 0,this.updateTransactionState=async t=>{try{return je.getShadowGraphqlClient().mutate({...t,mutation:R3})}catch(n){throw console.error(n),new co("Critical - Unable to synchronize workflow state with server.")}},this.options=e,this.options.applicationKey&&X4(this.options.applicationKey),console.debug("------------------------"),console.debug("Spiff Commerce Core SDK"),console.debug("Version: 41.0.1"),console.debug(`Application Key Provided: ${!!this.options.applicationKey}`),console.debug("------------------------")}configure(e){_s.setHubUrl(e.hubUrl),_s.setServerUrl(e.serverUrl),_s.setServicesApiUrl(e.servicesApiUrl),this.marketplaceThemeInstallId=e.marketplaceThemeInstallId,this.marketplaceThemeInstallConfigurationId=e.marketplaceThemeInstallConfigurationId,this.userPoolClientId=e.userPoolClientId,this.userPoolRegion=e.userPoolRegion,this.spiffRegion=e.spiffRegion,e.bearerAuthenticationToken&&Xk(e.bearerAuthenticationToken),this.options.applicationKey&&this.getIntegration(),this.spiffRegion&&this.userPoolRegion&&this.userPoolClientId&&Lf.init(this.spiffRegion,this.userPoolRegion,this.userPoolClientId)}getAssetManager(){return Ln}async getBetaEnabled(){return this.options.enableBetaFeatures?!0:(await this.getIntegration()).partner.beta===!0}getFlowService(){if(!J4())throw new Error("Application key required to use Flow Service.");return new DI}async getCurrencyContext(e){const n=(await this.getIntegration()).partner.currencyCode,a=await je.getShadowGraphqlClient().query({query:Z3,errorPolicy:"all",fetchPolicy:"cache-first",variables:{from:n,to:e}}),{rateFrom:s,rateTo:o}=a.data.currencyConversion;return new ND(s,o,n,e)}async getIntegration(){if(this.activeIntegration)return this.activeIntegration;if(!this.options.applicationKey)throw new Error("Cannot get current Integration without specifying an Application Key.");return this.activeIntegration=UD(this.options.applicationKey),this.activeIntegration}async canUseAddon(e){try{return(await this.getIntegration()).partner.activeAddons?.includes(e)??!1}catch(t){return console.error(t),!1}}clearCustomer(){this.customer=void 0}clearCustomerForTransaction(e){const t=xr.getMap("transactionCustomerIds");t?.has(e)&&(t.delete(e),xr.setMap("transactionCustomerIds",t))}async customerHasBundleTemplates(e){const i=(await je.getShadowGraphqlClient().query({query:_v,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;return i.id?i.hasBundleTemplates??!1:!1}getStakeholderTypeForTransaction(e){const t=this.customer?.stakeholders?.find(n=>n.transaction?.id===e);if(t)return t.type}async getOrCreateCustomer(e){this.customer=void 0;const t=je.getShadowGraphqlClient(),i=(await t.query({query:_v,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;if(!i.id){const o=(await t.mutate({mutation:fV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{details:{emailAddress:e}}})).data?.customerCreate;if(!o)throw new Error("Unable to create customer.");return this.storeCustomer(o),this.customer=o,{customer:o,isAuthenticated:!1}}this.storeCustomer(i);const a=await this.reloadLoggedInCustomer();return{customer:this.customer||i,isAuthenticated:a}}getCustomer(){return this.customer}async reloadLoggedInCustomer(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens"),n=localStorage.getItem("cognito-email");if(!e||!t||!n)return!1;const i=JSON.parse(t),a=new Date().getTime()/1e3;if(!i.ExpiresIn||i.ExpiresIn<a-parseInt(e)){const u=await Lf.refreshTokens();if(u?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),i.AccessToken=u.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(i));else return this.logOut(),console.error("Failed to refresh tokens."),!1}const s=localStorage.getItem("customer-login-token");s&&y0(s);const l=(await je.getShadowGraphqlClient().query({query:_v,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:n}})).data.customer;return l.id?(this.customer=l,!0):(console.error("Failed to get customer."),!1)}async generateVerificationCode(e){await je.getShadowGraphqlClient().mutate({mutation:dV,variables:{emailAddress:e}}),await Lf.generateCode(e)}async verifyCode(e,t){const n=(await this.getIntegration()).partner.id||"",i=await Lf.verifyCode(e,t,n);if(i?.AuthenticationResult){localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),localStorage.setItem("cognito-tokens",JSON.stringify(i.AuthenticationResult)),localStorage.setItem("cognito-email",e);const s=(await je.getShadowGraphqlClient().mutate({mutation:hV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e,verificationCode:t}})).data?.customerVerifyCode;if(!s?.id)throw new Error("Failed to get customer.");return this.customer=s,s.loginToken&&(localStorage.setItem("customer-login-token",s.loginToken),y0(s.loginToken)),!0}else throw new Error}async logOut(){localStorage.removeItem("last-refreshed-cognito-tokens"),localStorage.removeItem("cognito-tokens"),localStorage.removeItem("cognito-email"),localStorage.removeItem("customer-login-token"),y0(""),this.clearCustomer()}async loggedInBearerToken(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens");if(!e||!t)throw new Error("No token data in storage.");const n=JSON.parse(t),i=new Date().getTime()/1e3,a=!n?.AccessToken||xg(n.AccessToken);if(!n.ExpiresIn||n.ExpiresIn<i-parseInt(e)||a){const s=await Lf.refreshTokens();if(s?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),n.AccessToken=s.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(n));else throw this.logOut(),new Error("Failed to refresh tokens.")}if(!n.AccessToken)throw new Error("No bearer token in storage.");return n.AccessToken}async getCustomerMetafields(){if(!this.customer?.id)throw new Error("Customer must be logged in before calling this function.");return(await je.getShadowGraphqlClient().query({query:pV,variables:{id:this.customer.id}})).data.metafields}async getNewBundle(e,t,n){const a=(await je.getShadowGraphqlClient().mutate({mutation:ZU(n?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{collectionId:e,initialMetadata:t?Object.entries(t).map((u,c)=>({key:u[0],value:u[1]})):void 0,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},fetchPolicy:"no-cache"})).data?.bundleCreate;if(!a?.id)throw new Error("Unable to create bundle");const s=xr.getMap("bundlePartnerIds")||new Map;s.set(a.id,a.partner.id),xr.setMap("bundlePartnerIds",s);const o=xr.getMap("bundleOwnerIds")||new Map;o.set(a.id,a.bundleOwnerId),xr.setMap("bundleOwnerIds",o);const l=new SE(this,a,void 0,void 0,a.bundleOwnerId,{eagerFetchProducts:n?.graphql?.productCollection?.eagerFetchProducts});return await l.getInitializationPromise(),l}async getExistingBundle(e,t,n,i,a){const o=xr.getMap("bundleOwnerIds")?.get(e),l={};try{const g=await this.loggedInBearerToken();l.Authorization=`Bearer ${g}`}catch{const y=Object.entries(localStorage).find(([C,k])=>C.startsWith("CognitoIdentityServiceProvider")&&C.endsWith("idToken"))?.[0]||"",A=localStorage.getItem(y);A&&!xg(A)&&(l.Authorization=`Bearer ${A}`)}const u={bundleOwnerId:o,...l,...i?.graphql?.additionalHeaders},c=await je.getShadowGraphqlClient().query({query:QU(i?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{id:e},fetchPolicy:"no-cache",context:{headers:u}});if(!c.data?.bundles||c.data?.bundles.length===0||!c.data?.bundles[0])throw new Error(`Unable to find bundle: ${e}`);const h=c.data?.bundles[0],f=xr.getMap("bundlePartnerIds")||new Map;f.set(h.id,h.partner.id),xr.setMap("bundlePartnerIds",f);const d=new SE(this,h,t,n,o,{additionalHeaders:i?.graphql?.additionalHeaders,eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts,existingGlobalPropertyState:c.data.globalPropertyState,readonly:i?.readonly},a);return await d.getInitializationPromise(),d}async duplicateBundle(e,t,n,i){const s={...await zD(e),...i?.graphql?.additionalHeaders},l=(await je.getShadowGraphqlClient().mutate({mutation:e9(),variables:{id:e,template:t,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,duplicateTransactions:n},context:{headers:s},fetchPolicy:"no-cache"})).data?.bundleDuplicate;if(!l?.id)throw new Error("Unable to duplicate bundle");const u=xr.getMap("bundlePartnerIds")||new Map;u.set(l.id,l.partner.id),xr.setMap("bundlePartnerIds",u);const c=xr.getMap("bundleOwnerIds")||new Map;return c.set(l.id,l.bundleOwnerId),xr.setMap("bundleOwnerIds",c),async()=>await this.getExistingBundle(l.id,void 0,void 0,{graphql:{productCollection:{eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts||!1}}})}async getBundlesForCustomer(e){if(!this.customer?.id)throw new Error("Customer not authenticated.");const{includeMetadata:t,...n}=e;return(await je.getShadowGraphqlClient().query({query:f9(t??!1),variables:{...n,id:this.customer.id},fetchPolicy:"no-cache"})).data.customerBundlesFeed}async getBundleStakeholders(){if(!this.customer)throw new Error("Customer not authenticated.");const e=await je.getShadowGraphqlClient().query({query:YU,variables:{id:this.customer.id},fetchPolicy:"no-cache"});if(!e.data?.customers||e.data.customers.length===0)throw new Error("Unable to find customer.");const n=e.data.customers[0].bundleStakeholders||[],i=xr.getMap("bundlePartnerIds")||new Map;return n.forEach(a=>{a.bundle?.id&&a.bundle.partner?.id&&i.set(a.bundle.id,a.bundle.partner.id)}),xr.setMap("bundlePartnerIds",i),n}async getWorkflowExperience(e,t){if(!e)throw new Error("getWorkflowExperience has been called without an options object! This is not supported.");const n=await this.getWorkflowExperiences([e],e.graphql),i=n[0],a=i.getWorkflow();return t&&!a&&console.error("No workflow instantiated when trying to create preview service."),t&&a&&await i.getWorkflowManager().injectIntoPreviewService(t(a)),n[0]}async getWorkflowExperiences(e,t,n,i){if(e.length===0)throw new co("No options provided!");const a=e.map((Y,X)=>({option:Y,index:X})),s=a.filter(Y=>Y.option.type==="transaction"),o=a.filter(Y=>Y.option.type==="integration"||Y.option.type==="external"||Y.option.type==="blank"),l=50,u=uA(s,l),c=uA(o,l);let h=0;const f=je.getShadowGraphqlClient(),d=async Y=>{if(Y.length===0)return[];const X=Y.map(oe=>oe.option.transactionId),J=await f.query({query:P3,variables:{ids:X},errorPolicy:"all",fetchPolicy:"no-cache"}),Q=J.data.transactions;if(h=h+Q.length,i&&i(h,s.length),Q.length!==Y.length){const oe=J.errors?.[0]?.message||"Unknown error";throw new co(`Not all transactions were found: ${oe}`)}return!this.activeIntegration&&Q[0].integrationProduct?.integration&&(this.activeIntegration=Promise.resolve(Q[0].integrationProduct.integration)),Q.map((oe,se)=>({transaction:oe,workflowId:oe.workflowId,readOnly:Y.find(he=>he.option.transactionId===oe.id)?.option.readOnly??!1,index:Y[se].index}))},g=async Y=>{if(Y.length===0)return[];const X=await f.mutate({mutation:D3,variables:{inputs:Y.map(Q=>({integrationProductId:Q.option.type==="integration"?Q.option.integrationProductId:void 0,externalIntegrationId:Q.option.type==="external"?Q.option.externalIntegrationId:void 0,externalProductId:Q.option.type==="external"?Q.option.externalProductId:void 0,workflowId:Q.option.workflowId,designName:Q.option.designName,claim:!0,quantity:Q.option.quantity,recipient:Q.option.recipient})),marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},errorPolicy:"all",fetchPolicy:"no-cache"}),J=X.data?.transactionCreateMany;if(!J||J.length===0){const Q=X.errors?.[0]?.message||"Unknown error";throw new co(`Failed to create transactions: ${Q}`)}return h=h+J.length,i&&i(h,s.length),J.map((Q,oe)=>({transaction:Q,workflowId:Q.workflowId,readOnly:!1,index:Y[oe].index}))},v=(await Promise.all([...u.map(d),...c.map(g)])).flat(),y=[...new Set(v.map(Y=>Y.transaction.integrationProductId))].filter(Y=>Y!==void 0),A=[...new Set(v.map(Y=>Y.workflowId))].filter(Y=>Y!==void 0),[C,k]=await Promise.all([(async()=>y.length>0?await DQ(y):[])(),(async()=>A.length>0?await Jb(A,t):[])()]),T=new Map(C.map(Y=>[Y.id,Y])),S=new Map(k.map(Y=>[Y.id,Y])),R=v.map(async Y=>{const{transaction:X,workflowId:J,readOnly:Q,index:oe}=Y,se=J?S.get(J):void 0,he=e[oe];if(X.integrationProductId){const K=T.get(X.integrationProductId);X.integrationProduct=K,X.product=K?.product,X.integrationProduct||console.error("failed to find transaction's product")}const ye=xr.getMap("transactionOwnerIds")||new Map;!ye.get(X.id)&&X.transactionOwnerId&&(ye.set(X.id,X.transactionOwnerId),xr.setMap("transactionOwnerIds",ye));const Ue=ye.get(X.id)||void 0,Oe=new gV({onMutate:()=>({context:{transactionOwnerId:Ue,bundleOwnerId:t?.bundleOwnerId}}),onQuery:()=>({context:{transactionOwnerId:Ue,bundleOwnerId:t?.bundleOwnerId}})}),Te={workflow:se,transaction:X,singleVariantsRenderable:he?.workflowConfiguration?.singleVariantsRenderable,stateMutationFunc:Q?async()=>{throw new nn("State mutation is forbidden in read only mode!")}:async K=>this.updateTransactionState({...K,context:{transactionOwnerId:Ue,bundleOwnerId:t?.bundleOwnerId}}),graphQlClient:()=>Oe,readOnly:Q,isReloadedTransaction:he.type==="transaction"};if(he.type==="transaction"&&X.workflowState){const K=JSON.parse(X.workflowState);await iA(K),Te.reloadedState=K}else if(!Q&&he.workflowState){const K=JSON.parse(he.workflowState);await iA(K),Te.reloadedState=K}return Te.delayWorkflowStateSync=!0,{experienceOptions:Te,index:oe,options:he}}),G=(await Promise.all(R)).sort((Y,X)=>Y.index-X.index);let $=[];for(const Y of G){const{experienceOptions:X,options:J}=Y,Q=new SI(this,X);await Q.getWorkflowManager().getInitializationPromise(),n&&n(),J.type!=="transaction"&&this.customer&&await Q.attachCustomerDetails({email:this.customer.emailAddress}),$=[...$,Q],Q.getWorkflowManager().setWorkflowStateSyncEnabled(!0)}return $}storeCustomer(e){const t=xr.getMap("partnerCustomerIds")||new Map;t.set(e.partner.id,e.id),xr.setMap("partnerCustomerIds",t)}async getIntegrationProductById(e,t){const a=(await je.getShadowGraphqlClient().query({query:U3(t),variables:{ids:[e]},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProducts;if(!a||a.length===0||!a[0]?.id)throw new Error("Integration product not found.");return new dA(a[0])}async getIntegrationProductFromExternalIds(e,t,n){const s=(await je.getShadowGraphqlClient().query({query:V3(n),variables:{externalProductId:t,externalIntegrationId:e},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProductFromExternalIds;if(!s?.id)throw new Error("Integration product not found.");return new dA(s)}async getIntegrationProduct(e){return e.type==="integration"?this.getIntegrationProductById(e.integrationProductId):this.getIntegrationProductFromExternalIds(e.externalIntegrationId,e.externalProductId)}async getShareActionsForTransaction(e){const n=(xr.getMap("transactionOwnerIds")||new Map).get(e)||void 0,i=await je.getShadowGraphqlClient().query({query:N3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e},context:{transactionOwnerId:n}});if(!i.data.transactions||i.data.transactions.length!==1)throw new Error(`Failed to fetch share actions for transaction: ${e}`);return i.data.transactions[0].transactionShareActions}async placeOrder(e){const t=await je.getShadowGraphqlClient().mutate({mutation:K3,variables:{orderItems:e}});if(t.errors)throw new Error(t.errors[0].message);if(!t.data)throw new Error("Failed to create order: No order data in response.");return{id:t.data.orderCreate.id,internalId:t.data.orderCreate.internalId}}}const UD=async(r,e)=>(await je.getShadowGraphqlClient().query({query:Y3,errorPolicy:"all",fetchPolicy:"no-cache",context:{headers:{"x-application-key":r},skipIntegrationCheck:!0},variables:{themeConfigurationId:e}})).data.currentIntegration,RQ=async r=>{const t=await je.getShadowGraphqlClient().query({query:_3,errorPolicy:"all",fetchPolicy:"network-only",variables:{id:r}});if(t.data.transactions.length!==0)return t.data.transactions[0]},OQ=async(r,e)=>(await je.getShadowGraphqlClient().query({query:Q3,errorPolicy:"all",variables:{themeConfigurationId:r,themeInstallId:e}})).data?.marketplaceThemeInstallConfiguration,BQ=async r=>(await je.getShadowGraphqlClient().query({query:J3,errorPolicy:"all",variables:{id:r}})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration,MQ=async r=>(await je.getShadowGraphqlClient().query({query:X3,errorPolicy:"all",variables:{id:r}})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration;async function VD(){const r={};try{const e=await this.loggedInBearerToken();r.Authorization=`Bearer ${e}`}catch{const n=Object.entries(localStorage).find(([a,s])=>a.startsWith("CognitoIdentityServiceProvider")&&a.endsWith("idToken"))?.[0]||"",i=localStorage.getItem(n);i&&!xg(i)&&(r.Authorization=`Bearer ${i}`)}return r}async function zD(r){const t=xr.getMap("bundleOwnerIds")?.get(r),n=await VD();return{bundleOwnerId:t,...n}}async function _Q(r){const t=xr.getMap("transactionOwnerIds")?.get(r),n=await VD();return{transactionOwnerId:t,...n}}const NQ=async r=>{const e=await zD(r),t=await je.getShadowGraphqlClient().mutate({mutation:b9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:r},context:{headers:e}});if(t.data?.bundleDelete!==r)throw new Error(`Failed to delete bundle: ${t.errors}`)},LQ=async r=>{const e=await _Q(r),t=await je.getShadowGraphqlClient().mutate({mutation:w9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{ids:[r]},context:{headers:e}});if(!t.data?.transactions||t.data.transactions.length!==1||t.data.transactions[0].id!==r)throw new Error(`Failed to find transaction to read bundle id: ${JSON.stringify(t.errors)}`);return t.data.transactions[0].bundle?.id};function HD(r,e,t,n){const i=t.width*r.zoom,a=t.height*r.zoom;if(n){const s=Math.max(e.width/t.width,e.height/t.height),o=Math.max(s,r.zoom),l=t.width*o,u=t.height*o;return{...r,x:Lp(r.x,e.width-l,0),y:Lp(r.y,e.height-u,0),zoom:o}}return{...r,x:Lp(r.x,-i,e.width),y:Lp(r.y,-a,e.height)}}function Lp(r,e,t){return Math.min(Math.max(r,e),t)}class jD{constructor(e,t){this.minZoomScale=[.03],this.maxZoomScale=[20],this._debouncedUpdateFrameOffsets=xI(this.updateFrameOffsets,200),this.targetElements=[],this.onFrameDataChangeListeners=[],this.onZoomChangeListeners=[],this.onRotationChangeListeners=[],this.forceImageCover=e,this.initialZoom=t,this.thresholdSettings={useThreshold:!1,invertThreshold:!1,threshold:128,thresholdSaturation:.5}}connectWorkflowManager(e,t){t&&e.addStepSpecificStorageCallback(async n=>{if(n){const i=n;if(i.currentFrameSources){let a=!1;for(let s=0;s<i.currentFrameSources.length;s++){const o=i.currentFrameSources[s],l=await ah(o),u=this.frameData?this.frameData[s]:void 0;Ed(l,u)||(this.frameData||(this.frameData=new Array(i.currentFrameSources.length)),this.frameData[s]=l,a=!0)}a&&(this.onFrameDataChangeListeners.forEach(s=>s(this.frameData)),this.frameData&&this.imageData&&(this.recalculateOffsets(this.imageData),this.updateOffsets(this.offsets),this.recalculateZoomLimits(this.imageData,this.frameData)))}}},t),this.workflowManager=e,this.stepName=t}setTargetElements(e){this.targetElements=e}getFrameData(){return this.frameData}setFrameData(e){if(!e){this.frameData=void 0;return}e.forEach((t,n)=>{const i=Vu.get(t);i&&(this.frameData||(this.frameData=new Array(e.length)),this.frameData[n]=i)})}getImageData(){return this.imageData}getImageSrc(){if(this.imageData){if(this.imageData.svg){const e=Gg(this.imageData.svg,this.imageData.colors||{},!1);return Hg(e)}return this.imageData.src}}getOffsets(){return this.offsets}setOffsets(e){this.offsets=e}setZoom(e,t,n,i){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const a=this.frameData.map((s,o)=>{const l=(t[o]-this.offsets[o].x)/this.offsets[o].zoom,u=(n[o]-this.offsets[o].y)/this.offsets[o].zoom,c=t[o]-l*e[o],h=n[o]-u*e[o];return{x:c,y:h,zoom:this.imageData.width*e[o]/this.imageData.width,rotation:this.offsets[o].rotation}});this.updateOffsets(a,i),this.onZoomChangeListeners.forEach(s=>s(e))}}setRotation(e,t){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const n=this.frameData.map((i,a)=>({...this.offsets[a],rotation:e[a]}));this.updateOffsets(n,t),this.onRotationChangeListeners.forEach(i=>i(e))}}setPatternData(e,t=!0){this.imageData=e,e&&this.frameData&&((t||!this.offsets)&&this.recalculateOffsets(e,t),this.updateOffsets(this.offsets,void 0,!0)),this.imageData&&this.frameData&&this.recalculateZoomLimits(this.imageData,this.frameData)}updateOffsets(e,t,n){const i=this.imageData;if(!i||!this.frameData)return;if(this.frameData.length!==e.length)throw new nn("Frame data and offsets are not the same length. This is a bug. Please report it.");if(!this.offsets.some((s,o)=>!(e[o].x===s.x&&e[o].y===s.y&&e[o].zoom===s.zoom&&e[o].rotation===s.rotation))&&!n){t&&t();return}(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((s,o)=>{this.offsets[o]=HD(e[o],s,this.imageData,this.forceImageCover)}),this._debouncedUpdateFrameOffsets(this.offsets,i,this.frameData,this.thresholdSettings,t)}getThresholdSettings(){return this.thresholdSettings}setThresholdSettings(e){this.thresholdSettings=e,this.imageData&&this.frameData&&this._debouncedUpdateFrameOffsets(this.offsets,this.imageData,this.frameData,e)}onFrameDataChanged(e){e(this.frameData),this.onFrameDataChangeListeners.push(e)}onZoom(e){this.onZoomChangeListeners.push(e)}onRotation(e){this.onRotationChangeListeners.push(e)}updateFrameOffsets(e,t,n,i,a){if(!n||n.length===0||n.some(l=>!l))throw new nn("Frame data not set. This is a bug");if(!this.workflowManager)throw new nn("No workflow manager set, cannot update offsets.");const s=this.workflowManager.getRegionElements(this.stepName||""),o=this.workflowManager.getCommandDispatcher();this.targetElements.forEach((l,u)=>{let c=s.find(h=>h.id===l)?.regionIndex??u;c>=e.length&&(c=u);try{o(new On([new AL(l,t,e[c]),new bL(l,i.useThreshold,i.invertThreshold,i.threshold,i.thresholdSaturation)]))}catch{}}),this.stepName&&this.workflowManager.updateStorage(this.stepName,{frameOffsetsList:e}),a&&a()}recalculateZoomLimits(e,t){(this.minZoomScale.length!==t.length||this.maxZoomScale.length!==t.length)&&(this.minZoomScale=new Array(t.length),this.maxZoomScale=new Array(t.length)),t.forEach((n,i)=>{const a=Math.max(n.width/e.width,n.height/e.height);this.forceImageCover?(this.minZoomScale[i]=a,this.maxZoomScale[i]=a*2.5):(this.minZoomScale[i]=a/10,this.maxZoomScale[i]=a*2.5)})}recalculateOffsets(e,t=!0){this.frameData&&((!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((n,i)=>{const a=t?0:this.offsets[i]?.rotation||0;this.offsets[i]={...b1(e,n,this.initialZoom&&!this.forceImageCover?{scale:this.initialZoom}:void 0,this.forceImageCover),rotation:a}}),this._debouncedUpdateFrameOffsets(this.offsets,e,this.frameData,this.thresholdSettings))}}class UQ{traversableScenes(){throw new Error("Method not implemented.")}updateRecipient(e,t,n,i,a,s,o,l,u,c,h,f,d,g,v,y,A){throw new Error("Method not implemented.")}approveTransaction(e){throw new Error("Method not implemented.")}rejectTransaction(e){throw new Error("Method not implemented.")}getClient(){return this.client??{}}getWorkflowExperience(){return{}}setClient(e){this.client=e}getInitializationPromise(){return Promise.resolve()}isInitialized(){return!0}getInformationResults(){return[]}async reset(){}updateStateWithServer(e){}async outstandingRequestsPromise(){}async updateStateWithServerImmediate(e){}addPoller(e){}addConfirmCallback(e){}addEditedCallback(e){}addElementsCallback(e){}addInformationResultCallback(e){}addInitCallback(e){}addMakingAdjustmentsCallback(e){}addMandatoryCallback(e){}addMetadataCallback(e){}addSelectionCallback(e){}addStepSpecificStorageCallback(e,t){}addStorageCallback(e){}getCommandDispatcher(){return e=>{}}getLayouts(){return[]}getLayoutPreviewService(){return{getAll:()=>new Map}}getPreviewService(){}getModelContainer(){}getRegionElements(e){return[]}getSerializedStep(e,t){}getStepSpecificServices(e){}getTransaction(){return{id:""}}getTransactionCustomer(){}setTransactionCustomer(){}setTransactionCustomerDetails(){}getInitialOptionIds(){return new Promise(()=>new Set)}getWorkflow(){return{id:"",name:"",panels:[],steps:[],showModelOnFinishStep:!1,allowProofDownload:!1,introduction:"",stepGroups:[]}}markStepsAsInitialised(e){}markUpdateCompleted(e){}markUpdatePending(){return"123"}getWorkflowSelections(){return{}}getStepSelections(){return{}}setCurrentAdjustingStepId(e){}setEditedStatus(e,t){}setInformationResults(e){}setMandatoryFulfilled(e,t){}async setSelectionsAndElements(e,t,n){}toggleDesignConfirmed(){}updateMetadata(e,t){}async updateStorage(e,t){}injectIntoPreviewService(e){return Promise.resolve()}ejectFromPreviewService(){}setWorkflowStateSyncEnabled(e){}async updateTransactionShareActions(){}addValidationCallback(e){}setStepError(e,t,n){}getStepErrors(e){}getValidationErrors(){return{steps:new Map}}async updateTransactionStakeholders(){}getStepTags(e){return[]}}var GD=(r=>(r.SelectFrame="SelectFrame",r.SelectImage="SelectImage",r.Position="Position",r))(GD||{}),$D=(r=>(r.Original="original",r.BackgroundRemoved="backgroundRemoved",r.Optimized="optimized",r))($D||{});class qD extends Wi{constructor(e,t,n){super(e,t,n);const i=t.data;this.frameService=new jD(i.forceImageCover,i.initialZoomLevel),this.frameService.connectWorkflowManager(e,t.stepName)}selectVariant(e){const t=this.manager.getRegionElements(this.step.stepName);return uo.selectVariant(this.step,e.getResource(),t,this.manager,n=>this.setUpdateState(n))}onFrameDataChanged(e){this.frameService&&this.frameService.onFrameDataChanged(t=>{t&&e(t)})}async selectImage(e,t=!0,n=!0){await uo.selectImage(this.step,e,this.manager,n),t&&this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,enhancedAssetKey:void 0,useOriginalAsset:void 0}})}async canUseAdvancedImageManipulation(){return this.manager.getClient().canUseAddon(Ng.AdvancedImageManipulation)}async canRemoveBackground(){return await this.canUseAdvancedImageManipulation()&&this.hasOriginalImageSelection()&&!!this.frameService?.getImageData()?.src&&!this.frameService?.getImageData()?.svg}async removeBackgroundFromImageSelection(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Background Remover. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImageSelection();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=await Ln.removeBackgroundFromAsset(t);e&&await uo.selectImage(this.step,n,this.manager,!1);const i=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...i,backgroundRemovedAssetKey:n.key,useOriginalAsset:!e}}),n}async vectorize(e,t=void 0){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to vectorize the image.");const i=await Ln.vectorizeAsset(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...a,vectorizedAssetKey:i.key,useOriginalAsset:!1}}),i}async enhanceWithAI(e,t){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to enhance the image with AI.");const i=await Ln.enhanceWithAI(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:a.originalAssetKey,backgroundRemovedAssetKey:a.backgroundRemovedAssetKey,vectorizedAssetKey:a.vectorizedAssetKey,enhancedAssetKey:i.key,useOriginalAsset:!1}}),i}async getBackgroundRemovedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getVectorizedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getEnhancedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}hasOriginalImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.originalAssetKey}hasBackgroundRemovedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey}hasVectorizedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey}hasEnhancedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey}async changeColors(e){await uo.changeColors(this.step,this.manager,e)}getImageData(){if(this.frameService)return this.frameService.getImageData()}async getColorOption(){return await ft.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?uo.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}async getOriginalImageColors(){const e=this.getImageData();return e?.svg?(await Ba(e.svg)).colors:void 0}async mergeColors(e,t,n){const i=this.frameService.getImageData();if(!i?.svg||!i.colors)throw new Error("Cannot merge colors on non-SVG image or image without color information");const{svg:a,colors:s}=dF(i.svg,i.colors,e,t,n);this.frameService.setPatternData({...i,svg:a,colors:s},!1),this.manager.updateStorage(this.step.stepName,{colors:s})}async unmergeColors(e,t,n,i){const a=this.frameService.getImageData();if(!a?.svg||!a.colors)throw new Error("Cannot unmerge colors on non-SVG image or image without color information");this.frameService.setPatternData({...a,svg:i,colors:n},!1),this.manager.updateStorage(this.step.stepName,{colors:n})}getShouldVectorize(){return this.step.data.shouldVectorize??!1}getVectorizeMaxColors(){return this.step.data.vectorizeMaxColors}getMinimumPixelThresholdForOptimization(){return this.step.data.vectorizationMinimumPixelThreshold}getMaxAllowedColors(){return this.step.data.maxColors}getUniqueColorCount(){return uo.getUniqueColorCount(this.step,this.manager)}getCurrentFrameStep(e,t,n,i){return i&&i.length>1&&e===void 0?"SelectFrame":t||n||this.getImageData()?"Position":"SelectImage"}getFrameService(){return this.frameService}hasOverlayImageKey(){return this.step.data.overlayImageKey}hasOverlayImageUrl(){return this.step.data.overlayImageUrl}getWhitelistedExtensions(){return[...this.step.data.whitelistedExtensions,...this.step.data.whitelistedExtensions.includes(".jpg")?[".jpeg"]:[]]}async getOriginalImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.originalAssetKey;if(e)return Ln.getLocalOrFromServer(e)}getCurrentImageState(){const e=this.getFrameStepStorage()?.framePatternData;return e?e.vectorizedAssetKey&&!e.useOriginalAsset?"optimized":e.useOriginalAsset!==!1?"original":"backgroundRemoved":"original"}async setImageState(e){const t=this.getFrameStepStorage()?.framePatternData||{};let n,i;switch(e){case"original":if(n=await this.getOriginalImageSelection(),!n)throw new Error("No original image available");i=!0;break;case"backgroundRemoved":if(n=await this.getBackgroundRemovedImageSelection(),!n)throw new Error("No background-removed image available. Call removeBackgroundFromImageSelection first.");i=!1;break;case"optimized":if(n=await this.getVectorizedImageSelection(),!n)throw new Error("No optimized image available. Call vectorize first.");i=!1;break}await this.selectImage(n,!1,!0),this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:i}})}getUseOriginalImageSelection(){return this.getFrameStepStorage()?.framePatternData?.useOriginalAsset??!1}async setUseOriginalImageSelection(e){const t=this.getFrameStepStorage()?.framePatternData||{};if(t.useOriginalAsset===e)return;const n=await this.getOriginalImageSelection();if(!n)throw new Error("You must provide an image selection before calling setUseOriginalImageSelection");if(e)await this.selectImage(n,!1,!1);else{const i=await this.getBackgroundRemovedImageSelection();if(!i)throw new Error("You must call removeBackgroundFromImageSelection before attempting to apply the image.");await this.selectImage(i,!1,!1)}this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:e}})}getFrameStepStorage(){return this.manager.getStepStorage(this.step.stepName)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}const VQ=ke`
|
|
2816
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var uQ={normalizePrecision:function(e){var t=e.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return e.map(function(n){return n.getPrecision()!==t?n.convertPrecision(t):n})},minimum:function(e){var t=g2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.lessThan(s)?a:s}),a},maximum:function(e){var t=g2(e),n=t[0],i=t.slice(1),a=n;return i.forEach(function(s){a=a.greaterThan(s)?a:s}),a}};function OD(r){return!isNaN(parseInt(r))&&isFinite(r)}function cQ(r){return OD(r)&&r<=100&&r>=0}function fQ(r){return r.length>0&&r.every(function(e){return e>=0})&&r.some(function(e){return e>0})}function v2(r){return r%2===0}function y2(r){return OD(r)&&!Number.isInteger(r)}function dQ(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=r.toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}function Uf(r){return Math.abs(r)%1===.5}function hQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(t,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?t(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",r,!0),pQ(i,e.headers),i.send()})}function pQ(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var t in e)r.setRequestHeader(t,e[t]);return r}function Zf(r){return typeof r>"u"}function BD(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",t={};return Object.entries(r).forEach(function(n){if(dd(n[1])==="object"){var i=BD(n[1]);Object.entries(i).forEach(function(a){t[n[0]+e+a[0]]=a[1]})}else t[n[0]]=n[1]}),t}function gQ(r){return!!r&&(dd(r)==="object"||typeof r=="function")&&typeof r.then=="function"}function MD(){var r=function(n,i){var a=function(l){return Math.pow(10,dQ(l))},s=Math.max(a(n),a(i));return Math.round(n*s)*Math.round(i*s)/(s*s)},e={HALF_ODD:function(n){var i=Math.round(n);return Uf(n)&&v2(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return Uf(n)?v2(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return Uf(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return Uf(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return Uf(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return y2(n)||y2(i)?r(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return e[i](n)}}}var mQ=MD();function vQ(r){var e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(r);return{getMatches:function(){return e!==null?e.slice(1).filter(function(n){return!Zf(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Zf(this.getMatches().find(n))?0:this.getMatches()[mQ.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Zf(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Zf(this.getMatches().find(function(n){return n===","}))}}}function yQ(r){var e=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var s in a)i=i.replace("{{".concat(s,"}}"),a[s]);return i},t=function(i,a){return hQ(e(r.endpoint,{from:i,to:a}),{headers:r.headers})};return{getExchangeRate:function(i,a){return(gQ(r.endpoint)?r.endpoint:t(i,a)).then(function(s){return BD(s)[e(r.propertyPath,{from:i,to:a})]})}}}function Vd(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!r)throw new t(e)}function AQ(r){Vd(cQ(r),"You must provide a numeric value between 0 and 100.",RangeError)}function bQ(r){Vd(fQ(r),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function Zv(r){Vd(Number.isInteger(r),"You must provide an integer.",TypeError)}var kn=MD(),wQ=function r(e){var t=Object.assign({},{amount:r.defaultAmount,currency:r.defaultCurrency,precision:r.defaultPrecision},e),n=t.amount,i=t.currency,a=t.precision;Zv(n),Zv(a);var s=r.globalLocale,o=r.globalFormat,l=r.globalRoundingMode,u=r.globalFormatRoundingMode,c=Object.assign({},r.globalExchangeRatesApi),h=function(g){var v=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},g),Object.assign({},{locale:this.locale},g));return Object.assign(r({amount:v.amount,currency:v.currency,precision:v.precision}),{locale:v.locale})},f=function(g){Vd(this.hasSameCurrency(g),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||s},setLocale:function(g){return h.call(this,{locale:g})},getPrecision:function(){return a},convertPrecision:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;Zv(g);var y=this.getPrecision(),A=g>y,C=A?kn.multiply:kn.divide,k=A?[g,y]:[y,g],T=Math.pow(10,kn.subtract.apply(kn,k));return h.call(this,{amount:kn.round(C(this.getAmount(),T),v),precision:g})},add:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return h.call(this,{amount:kn.add(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},subtract:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return h.call(this,{amount:kn.subtract(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},multiply:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return h.call(this,{amount:kn.round(kn.multiply(this.getAmount(),g),v)})},divide:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return h.call(this,{amount:kn.round(kn.divide(this.getAmount(),g),v)})},percentage:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return AQ(g),this.multiply(kn.divide(g,100),v)},allocate:function(g){var v=this;bQ(g);for(var y=g.reduce(function(T,S){return kn.add(T,S)}),A=this.getAmount(),C=g.map(function(T){var S=Math.floor(kn.divide(kn.multiply(v.getAmount(),T),y));return A=kn.subtract(A,S),h.call(v,{amount:S})}),k=0;A>0;)g[k]>0&&(C[k]=C[k].add(h.call(this,{amount:1})),A=kn.subtract(A,1)),k+=1;return C},convert:function(g){var v=this,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=y.endpoint,C=A===void 0?c.endpoint:A,k=y.propertyPath,T=k===void 0?c.propertyPath||"rates.{{to}}":k,S=y.headers,R=S===void 0?c.headers:S,B=y.roundingMode,G=B===void 0?l:B,$=Object.assign({},{endpoint:C,propertyPath:T,headers:R,roundingMode:G});return yQ($).getExchangeRate(this.getCurrency(),g).then(function(Y){return Vd(!Zf(Y),'No rate was found for the destination currency "'.concat(g,'".'),TypeError),h.call(v,{amount:kn.round(kn.multiply(v.getAmount(),parseFloat(Y)),$.roundingMode),currency:g})})},equalsTo:function(g){return this.hasSameAmount(g)&&this.hasSameCurrency(g)},lessThan:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<v[1].getAmount()},lessThanOrEqual:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()<=v[1].getAmount()},greaterThan:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>v[1].getAmount()},greaterThanOrEqual:function(g){f.call(this,g);var v=r.normalizePrecision([this,g]);return v[0].getAmount()>=v[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return kn.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(g){return this.getCurrency()===g.getCurrency()},hasSameAmount:function(g){var v=r.normalizePrecision([this,g]);return v[0].getAmount()===v[1].getAmount()},toFormat:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=vQ(g);return this.toRoundedUnit(y.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:y.getCurrencyDisplay(),useGrouping:y.getUseGrouping(),minimumFractionDigits:y.getMinimumFractionDigits(),style:y.getStyle(),currency:this.getCurrency()})},toUnit:function(){return kn.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(g){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u,y=Math.pow(10,g);return kn.divide(kn.round(kn.multiply(this.toUnit(),y),v),y)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},CQ=Object.assign(wQ,nQ,iQ,uQ),Za={},ey,A2;function xQ(){if(A2)return ey;A2=1;function r(t){return t}function e(t,a,s){for(var a=a||r,s=s||t,o=0,l=t.length;o<l;o+=1)if(a.call(s,t[o],o))return t[o]}return ey=e,ey}var ty={exports:{}},b2;function SQ(){if(b2)return ty.exports;b2=1;var r=ty.exports=function(e,t){if(typeof e=="function"||t)return r.by(e,t);for(var n={object:[],function:[],string:{},number:{},boolean:{},undefined:{}},i=[],a=0;a<e.length;a++){var s=e[a],o=s==="__proto__"?n.objects:n[typeof s]||n.objects;Array.isArray(o)?o.indexOf(s)<0&&(o.push(s),i.push(s)):Object.hasOwnProperty.call(o,s)||(o[s]=!0,i.push(s))}return i};return r.by=function(e,t){if(typeof e=="function"){var n=t;t=e,e=n}for(var i=[],a=0;a<e.length;a++){for(var s=e[a],o=!1,l=0;l<i.length;l++){var u=i[l];if(t.call(i,s,u)){o=!0;break}}o||i.push(s)}return i},ty.exports}var ry,w2;function EQ(){return w2||(w2=1,ry=[{code:"AED",number:"784",digits:2,currency:"UAE Dirham",countries:["United Arab Emirates (The)"]},{code:"AFN",number:"971",digits:2,currency:"Afghani",countries:["Afghanistan"]},{code:"ALL",number:"008",digits:2,currency:"Lek",countries:["Albania"]},{code:"AMD",number:"051",digits:2,currency:"Armenian Dram",countries:["Armenia"]},{code:"ANG",number:"532",digits:2,currency:"Netherlands Antillean Guilder",countries:["Curaçao","Sint Maarten (Dutch Part)"]},{code:"AOA",number:"973",digits:2,currency:"Kwanza",countries:["Angola"]},{code:"ARS",number:"032",digits:2,currency:"Argentine Peso",countries:["Argentina"]},{code:"AUD",number:"036",digits:2,currency:"Australian Dollar",countries:["Australia","Christmas Island","Cocos (Keeling) Islands (The)","Heard Island and Mcdonald Islands","Kiribati","Nauru","Norfolk Island","Tuvalu"]},{code:"AWG",number:"533",digits:2,currency:"Aruban Florin",countries:["Aruba"]},{code:"AZN",number:"944",digits:2,currency:"Azerbaijan Manat",countries:["Azerbaijan"]},{code:"BAM",number:"977",digits:2,currency:"Convertible Mark",countries:["Bosnia and Herzegovina"]},{code:"BBD",number:"052",digits:2,currency:"Barbados Dollar",countries:["Barbados"]},{code:"BDT",number:"050",digits:2,currency:"Taka",countries:["Bangladesh"]},{code:"BGN",number:"975",digits:2,currency:"Bulgarian Lev",countries:["Bulgaria"]},{code:"BHD",number:"048",digits:3,currency:"Bahraini Dinar",countries:["Bahrain"]},{code:"BIF",number:"108",digits:0,currency:"Burundi Franc",countries:["Burundi"]},{code:"BMD",number:"060",digits:2,currency:"Bermudian Dollar",countries:["Bermuda"]},{code:"BND",number:"096",digits:2,currency:"Brunei Dollar",countries:["Brunei Darussalam"]},{code:"BOB",number:"068",digits:2,currency:"Boliviano",countries:["Bolivia (Plurinational State Of)"]},{code:"BOV",number:"984",digits:2,currency:"Mvdol",countries:["Bolivia (Plurinational State Of)"]},{code:"BRL",number:"986",digits:2,currency:"Brazilian Real",countries:["Brazil"]},{code:"BSD",number:"044",digits:2,currency:"Bahamian Dollar",countries:["Bahamas (The)"]},{code:"BTN",number:"064",digits:2,currency:"Ngultrum",countries:["Bhutan"]},{code:"BWP",number:"072",digits:2,currency:"Pula",countries:["Botswana"]},{code:"BYN",number:"933",digits:2,currency:"Belarusian Ruble",countries:["Belarus"]},{code:"BZD",number:"084",digits:2,currency:"Belize Dollar",countries:["Belize"]},{code:"CAD",number:"124",digits:2,currency:"Canadian Dollar",countries:["Canada"]},{code:"CDF",number:"976",digits:2,currency:"Congolese Franc",countries:["Congo (The Democratic Republic of The)"]},{code:"CHE",number:"947",digits:2,currency:"WIR Euro",countries:["Switzerland"]},{code:"CHF",number:"756",digits:2,currency:"Swiss Franc",countries:["Liechtenstein","Switzerland"]},{code:"CHW",number:"948",digits:2,currency:"WIR Franc",countries:["Switzerland"]},{code:"CLF",number:"990",digits:4,currency:"Unidad de Fomento",countries:["Chile"]},{code:"CLP",number:"152",digits:0,currency:"Chilean Peso",countries:["Chile"]},{code:"CNY",number:"156",digits:2,currency:"Yuan Renminbi",countries:["China"]},{code:"COP",number:"170",digits:2,currency:"Colombian Peso",countries:["Colombia"]},{code:"COU",number:"970",digits:2,currency:"Unidad de Valor Real",countries:["Colombia"]},{code:"CRC",number:"188",digits:2,currency:"Costa Rican Colon",countries:["Costa Rica"]},{code:"CUC",number:"931",digits:2,currency:"Peso Convertible",countries:["Cuba"]},{code:"CUP",number:"192",digits:2,currency:"Cuban Peso",countries:["Cuba"]},{code:"CVE",number:"132",digits:2,currency:"Cabo Verde Escudo",countries:["Cabo Verde"]},{code:"CZK",number:"203",digits:2,currency:"Czech Koruna",countries:["Czechia"]},{code:"DJF",number:"262",digits:0,currency:"Djibouti Franc",countries:["Djibouti"]},{code:"DKK",number:"208",digits:2,currency:"Danish Krone",countries:["Denmark","Faroe Islands (The)","Greenland"]},{code:"DOP",number:"214",digits:2,currency:"Dominican Peso",countries:["Dominican Republic (The)"]},{code:"DZD",number:"012",digits:2,currency:"Algerian Dinar",countries:["Algeria"]},{code:"EGP",number:"818",digits:2,currency:"Egyptian Pound",countries:["Egypt"]},{code:"ERN",number:"232",digits:2,currency:"Nakfa",countries:["Eritrea"]},{code:"ETB",number:"230",digits:2,currency:"Ethiopian Birr",countries:["Ethiopia"]},{code:"EUR",number:"978",digits:2,currency:"Euro",countries:["Åland Islands","Andorra","Austria","Belgium","Croatia","Cyprus","Estonia","European Union","Finland","France","French Guiana","French Southern Territories (The)","Germany","Greece","Guadeloupe","Holy See (The)","Ireland","Italy","Latvia","Lithuania","Luxembourg","Malta","Martinique","Mayotte","Monaco","Montenegro","Netherlands (The)","Portugal","Réunion","Saint Barthélemy","Saint Martin (French Part)","Saint Pierre and Miquelon","San Marino","Slovakia","Slovenia","Spain"]},{code:"FJD",number:"242",digits:2,currency:"Fiji Dollar",countries:["Fiji"]},{code:"FKP",number:"238",digits:2,currency:"Falkland Islands Pound",countries:["Falkland Islands (The) [Malvinas]"]},{code:"GBP",number:"826",digits:2,currency:"Pound Sterling",countries:["Guernsey","Isle of Man","Jersey","United Kingdom of Great Britain and Northern Ireland (The)"]},{code:"GEL",number:"981",digits:2,currency:"Lari",countries:["Georgia"]},{code:"GHS",number:"936",digits:2,currency:"Ghana Cedi",countries:["Ghana"]},{code:"GIP",number:"292",digits:2,currency:"Gibraltar Pound",countries:["Gibraltar"]},{code:"GMD",number:"270",digits:2,currency:"Dalasi",countries:["Gambia (The)"]},{code:"GNF",number:"324",digits:0,currency:"Guinean Franc",countries:["Guinea"]},{code:"GTQ",number:"320",digits:2,currency:"Quetzal",countries:["Guatemala"]},{code:"GYD",number:"328",digits:2,currency:"Guyana Dollar",countries:["Guyana"]},{code:"HKD",number:"344",digits:2,currency:"Hong Kong Dollar",countries:["Hong Kong"]},{code:"HNL",number:"340",digits:2,currency:"Lempira",countries:["Honduras"]},{code:"HTG",number:"332",digits:2,currency:"Gourde",countries:["Haiti"]},{code:"HUF",number:"348",digits:2,currency:"Forint",countries:["Hungary"]},{code:"IDR",number:"360",digits:2,currency:"Rupiah",countries:["Indonesia"]},{code:"ILS",number:"376",digits:2,currency:"New Israeli Sheqel",countries:["Israel"]},{code:"INR",number:"356",digits:2,currency:"Indian Rupee",countries:["Bhutan","India"]},{code:"IQD",number:"368",digits:3,currency:"Iraqi Dinar",countries:["Iraq"]},{code:"IRR",number:"364",digits:2,currency:"Iranian Rial",countries:["Iran (Islamic Republic Of)"]},{code:"ISK",number:"352",digits:0,currency:"Iceland Krona",countries:["Iceland"]},{code:"JMD",number:"388",digits:2,currency:"Jamaican Dollar",countries:["Jamaica"]},{code:"JOD",number:"400",digits:3,currency:"Jordanian Dinar",countries:["Jordan"]},{code:"JPY",number:"392",digits:0,currency:"Yen",countries:["Japan"]},{code:"KES",number:"404",digits:2,currency:"Kenyan Shilling",countries:["Kenya"]},{code:"KGS",number:"417",digits:2,currency:"Som",countries:["Kyrgyzstan"]},{code:"KHR",number:"116",digits:2,currency:"Riel",countries:["Cambodia"]},{code:"KMF",number:"174",digits:0,currency:"Comorian Franc ",countries:["Comoros (The)"]},{code:"KPW",number:"408",digits:2,currency:"North Korean Won",countries:["Korea (The Democratic People’s Republic Of)"]},{code:"KRW",number:"410",digits:0,currency:"Won",countries:["Korea (The Republic Of)"]},{code:"KWD",number:"414",digits:3,currency:"Kuwaiti Dinar",countries:["Kuwait"]},{code:"KYD",number:"136",digits:2,currency:"Cayman Islands Dollar",countries:["Cayman Islands (The)"]},{code:"KZT",number:"398",digits:2,currency:"Tenge",countries:["Kazakhstan"]},{code:"LAK",number:"418",digits:2,currency:"Lao Kip",countries:["Lao People’s Democratic Republic (The)"]},{code:"LBP",number:"422",digits:2,currency:"Lebanese Pound",countries:["Lebanon"]},{code:"LKR",number:"144",digits:2,currency:"Sri Lanka Rupee",countries:["Sri Lanka"]},{code:"LRD",number:"430",digits:2,currency:"Liberian Dollar",countries:["Liberia"]},{code:"LSL",number:"426",digits:2,currency:"Loti",countries:["Lesotho"]},{code:"LYD",number:"434",digits:3,currency:"Libyan Dinar",countries:["Libya"]},{code:"MAD",number:"504",digits:2,currency:"Moroccan Dirham",countries:["Morocco","Western Sahara"]},{code:"MDL",number:"498",digits:2,currency:"Moldovan Leu",countries:["Moldova (The Republic Of)"]},{code:"MGA",number:"969",digits:2,currency:"Malagasy Ariary",countries:["Madagascar"]},{code:"MKD",number:"807",digits:2,currency:"Denar",countries:["North Macedonia"]},{code:"MMK",number:"104",digits:2,currency:"Kyat",countries:["Myanmar"]},{code:"MNT",number:"496",digits:2,currency:"Tugrik",countries:["Mongolia"]},{code:"MOP",number:"446",digits:2,currency:"Pataca",countries:["Macao"]},{code:"MRU",number:"929",digits:2,currency:"Ouguiya",countries:["Mauritania"]},{code:"MUR",number:"480",digits:2,currency:"Mauritius Rupee",countries:["Mauritius"]},{code:"MVR",number:"462",digits:2,currency:"Rufiyaa",countries:["Maldives"]},{code:"MWK",number:"454",digits:2,currency:"Malawi Kwacha",countries:["Malawi"]},{code:"MXN",number:"484",digits:2,currency:"Mexican Peso",countries:["Mexico"]},{code:"MXV",number:"979",digits:2,currency:"Mexican Unidad de Inversion (UDI)",countries:["Mexico"]},{code:"MYR",number:"458",digits:2,currency:"Malaysian Ringgit",countries:["Malaysia"]},{code:"MZN",number:"943",digits:2,currency:"Mozambique Metical",countries:["Mozambique"]},{code:"NAD",number:"516",digits:2,currency:"Namibia Dollar",countries:["Namibia"]},{code:"NGN",number:"566",digits:2,currency:"Naira",countries:["Nigeria"]},{code:"NIO",number:"558",digits:2,currency:"Cordoba Oro",countries:["Nicaragua"]},{code:"NOK",number:"578",digits:2,currency:"Norwegian Krone",countries:["Bouvet Island","Norway","Svalbard and Jan Mayen"]},{code:"NPR",number:"524",digits:2,currency:"Nepalese Rupee",countries:["Nepal"]},{code:"NZD",number:"554",digits:2,currency:"New Zealand Dollar",countries:["Cook Islands (The)","New Zealand","Niue","Pitcairn","Tokelau"]},{code:"OMR",number:"512",digits:3,currency:"Rial Omani",countries:["Oman"]},{code:"PAB",number:"590",digits:2,currency:"Balboa",countries:["Panama"]},{code:"PEN",number:"604",digits:2,currency:"Sol",countries:["Peru"]},{code:"PGK",number:"598",digits:2,currency:"Kina",countries:["Papua New Guinea"]},{code:"PHP",number:"608",digits:2,currency:"Philippine Peso",countries:["Philippines (The)"]},{code:"PKR",number:"586",digits:2,currency:"Pakistan Rupee",countries:["Pakistan"]},{code:"PLN",number:"985",digits:2,currency:"Zloty",countries:["Poland"]},{code:"PYG",number:"600",digits:0,currency:"Guarani",countries:["Paraguay"]},{code:"QAR",number:"634",digits:2,currency:"Qatari Rial",countries:["Qatar"]},{code:"RON",number:"946",digits:2,currency:"Romanian Leu",countries:["Romania"]},{code:"RSD",number:"941",digits:2,currency:"Serbian Dinar",countries:["Serbia"]},{code:"RUB",number:"643",digits:2,currency:"Russian Ruble",countries:["Russian Federation (The)"]},{code:"RWF",number:"646",digits:0,currency:"Rwanda Franc",countries:["Rwanda"]},{code:"SAR",number:"682",digits:2,currency:"Saudi Riyal",countries:["Saudi Arabia"]},{code:"SBD",number:"090",digits:2,currency:"Solomon Islands Dollar",countries:["Solomon Islands"]},{code:"SCR",number:"690",digits:2,currency:"Seychelles Rupee",countries:["Seychelles"]},{code:"SDG",number:"938",digits:2,currency:"Sudanese Pound",countries:["Sudan (The)"]},{code:"SEK",number:"752",digits:2,currency:"Swedish Krona",countries:["Sweden"]},{code:"SGD",number:"702",digits:2,currency:"Singapore Dollar",countries:["Singapore"]},{code:"SHP",number:"654",digits:2,currency:"Saint Helena Pound",countries:["Saint Helena, Ascension and Tristan Da Cunha"]},{code:"SLE",number:"925",digits:2,currency:"Leone",countries:["Sierra Leone"]},{code:"SOS",number:"706",digits:2,currency:"Somali Shilling",countries:["Somalia"]},{code:"SRD",number:"968",digits:2,currency:"Surinam Dollar",countries:["Suriname"]},{code:"SSP",number:"728",digits:2,currency:"South Sudanese Pound",countries:["South Sudan"]},{code:"STN",number:"930",digits:2,currency:"Dobra",countries:["Sao Tome and Principe"]},{code:"SVC",number:"222",digits:2,currency:"El Salvador Colon",countries:["El Salvador"]},{code:"SYP",number:"760",digits:2,currency:"Syrian Pound",countries:["Syrian Arab Republic"]},{code:"SZL",number:"748",digits:2,currency:"Lilangeni",countries:["Eswatini"]},{code:"THB",number:"764",digits:2,currency:"Baht",countries:["Thailand"]},{code:"TJS",number:"972",digits:2,currency:"Somoni",countries:["Tajikistan"]},{code:"TMT",number:"934",digits:2,currency:"Turkmenistan New Manat",countries:["Turkmenistan"]},{code:"TND",number:"788",digits:3,currency:"Tunisian Dinar",countries:["Tunisia"]},{code:"TOP",number:"776",digits:2,currency:"Pa’anga",countries:["Tonga"]},{code:"TRY",number:"949",digits:2,currency:"Turkish Lira",countries:["Türki̇ye"]},{code:"TTD",number:"780",digits:2,currency:"Trinidad and Tobago Dollar",countries:["Trinidad and Tobago"]},{code:"TWD",number:"901",digits:2,currency:"New Taiwan Dollar",countries:["Taiwan (Province of China)"]},{code:"TZS",number:"834",digits:2,currency:"Tanzanian Shilling",countries:["Tanzania, United Republic Of"]},{code:"UAH",number:"980",digits:2,currency:"Hryvnia",countries:["Ukraine"]},{code:"UGX",number:"800",digits:0,currency:"Uganda Shilling",countries:["Uganda"]},{code:"USD",number:"840",digits:2,currency:"US Dollar",countries:["American Samoa","Bonaire, Sint Eustatius and Saba","British Indian Ocean Territory (The)","Ecuador","El Salvador","Guam","Haiti","Marshall Islands (The)","Micronesia (Federated States Of)","Northern Mariana Islands (The)","Palau","Panama","Puerto Rico","Timor-Leste","Turks and Caicos Islands (The)","United States Minor Outlying Islands (The)","United States of America (The)","Virgin Islands (British)","Virgin Islands (u.s.)"]},{code:"USN",number:"997",digits:2,currency:"US Dollar (Next day)",countries:["United States of America (The)"]},{code:"UYI",number:"940",digits:0,currency:"Uruguay Peso en Unidades Indexadas (UI)",countries:["Uruguay"]},{code:"UYU",number:"858",digits:2,currency:"Peso Uruguayo",countries:["Uruguay"]},{code:"UYW",number:"927",digits:4,currency:"Unidad Previsional",countries:["Uruguay"]},{code:"UZS",number:"860",digits:2,currency:"Uzbekistan Sum",countries:["Uzbekistan"]},{code:"VED",number:"926",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VES",number:"928",digits:2,currency:"Bolívar Soberano",countries:["Venezuela (Bolivarian Republic Of)"]},{code:"VND",number:"704",digits:0,currency:"Dong",countries:["Viet Nam"]},{code:"VUV",number:"548",digits:0,currency:"Vatu",countries:["Vanuatu"]},{code:"WST",number:"882",digits:2,currency:"Tala",countries:["Samoa"]},{code:"XAF",number:"950",digits:0,currency:"CFA Franc BEAC",countries:["Cameroon","Central African Republic (The)","Chad","Congo (The)","Equatorial Guinea","Gabon"]},{code:"XAG",number:"961",digits:0,currency:"Silver",countries:["Zz11_silver"]},{code:"XAU",number:"959",digits:0,currency:"Gold",countries:["Zz08_gold"]},{code:"XBA",number:"955",digits:0,currency:"Bond Markets Unit European Composite Unit (EURCO)",countries:["Zz01_bond Markets Unit European_eurco"]},{code:"XBB",number:"956",digits:0,currency:"Bond Markets Unit European Monetary Unit (E.M.U.-6)",countries:["Zz02_bond Markets Unit European_emu-6"]},{code:"XBC",number:"957",digits:0,currency:"Bond Markets Unit European Unit of Account 9 (E.U.A.-9)",countries:["Zz03_bond Markets Unit European_eua-9"]},{code:"XBD",number:"958",digits:0,currency:"Bond Markets Unit European Unit of Account 17 (E.U.A.-17)",countries:["Zz04_bond Markets Unit European_eua-17"]},{code:"XCD",number:"951",digits:2,currency:"East Caribbean Dollar",countries:["Anguilla","Antigua and Barbuda","Dominica","Grenada","Montserrat","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines"]},{code:"XDR",number:"960",digits:0,currency:"SDR (Special Drawing Right)",countries:["International Monetary Fund (Imf) "]},{code:"XOF",number:"952",digits:0,currency:"CFA Franc BCEAO",countries:["Benin","Burkina Faso","Côte D'ivoire","Guinea-Bissau","Mali","Niger (The)","Senegal","Togo"]},{code:"XPD",number:"964",digits:0,currency:"Palladium",countries:["Zz09_palladium"]},{code:"XPF",number:"953",digits:0,currency:"CFP Franc",countries:["French Polynesia","New Caledonia","Wallis and Futuna"]},{code:"XPT",number:"962",digits:0,currency:"Platinum",countries:["Zz10_platinum"]},{code:"XSU",number:"994",digits:0,currency:"Sucre",countries:['Sistema Unitario De Compensacion Regional De Pagos "Sucre"']},{code:"XTS",number:"963",digits:0,currency:"Codes specifically reserved for testing purposes",countries:["Zz06_testing_code"]},{code:"XUA",number:"965",digits:0,currency:"ADB Unit of Account",countries:["Member Countries of the African Development Bank Group"]},{code:"XXX",number:"999",digits:0,currency:"The codes assigned for transactions where no currency is involved",countries:["Zz07_no_currency"]},{code:"YER",number:"886",digits:2,currency:"Yemeni Rial",countries:["Yemen"]},{code:"ZAR",number:"710",digits:2,currency:"Rand",countries:["Lesotho","Namibia","South Africa"]},{code:"ZMW",number:"967",digits:2,currency:"Zambian Kwacha",countries:["Zambia"]},{code:"ZWG",number:"924",digits:2,currency:"Zimbabwe Gold",countries:["Zimbabwe"]}]),ry}var ny,C2;function kQ(){return C2||(C2=1,ny="2024-06-25"),ny}var x2;function FQ(){if(x2)return Za;x2=1;var r=xQ(),e=SQ(),t=EQ(),n=kQ(),i=function(c){return c=c.toUpperCase(),r(t,function(h){return h.code===c})},a=function(c){return c=c.toLowerCase(),t.filter(function(h){return(h.countries.map(function(f){return f.toLowerCase()})||[]).indexOf(c)>-1})},s=function(c){return r(t,function(h){return h.number===String(c)})},o=function(){return t.map(function(c){return c.code})},l=function(){var c=t.map(function(h){return h.number});return c.filter(function(h){if(h)return h})},u=function(){var c=t.filter(function(h){return h.countries}).map(function(h){return h.countries});return e(Array.prototype.concat.apply([],c))};return Za.code=i,Za.country=a,Za.number=s,Za.codes=o,Za.numbers=l,Za.countries=u,Za.publishDate=n,Za.data=t,Za}var S2=FQ();class _D{formatCurrencyForDisplay(e,t){const n={amount:t||0,currency:e,precision:this.getPrecisionForCurrency(e)};return CQ(n).toFormat(this.getSpecialFormat(e))}getPrecisionForCurrency(e){const t=e,n=S2.code(t);return n?n.digits:2}getSpecialFormat(e){const t=e;if(S2.code(t)?.code==="CLP")return"USD0,0"}}const E2=new _D;class ND{constructor(e,t,n,i){this.presentmentCurrency=void 0,this.presentmentCurrency=i,this.partnerCurrency=n,this.rateFrom=e,this.rateTo=t}code(){return this.presentmentCurrency?this.presentmentCurrency:this.partnerCurrency}conversionRequired(){return this.presentmentCurrency!==void 0&&this.code()!==this.partnerCurrency}getConvertedSubunits(e){return this.conversionRequired()?Math.ceil(this.subunits(this.units(e,this.partnerCurrency)/this.rateFrom*this.rateTo,this.code())):e}units(e,t){return e/Math.pow(10,E2.getPrecisionForCurrency(t))}subunits(e,t){return e*Math.pow(10,E2.getPrecisionForCurrency(t))}}const TQ=async(r,e)=>{const t=await je.getShadowGraphqlClient().query({query:W3(e?.assets?.metadata||!1),errorPolicy:"all",variables:{ids:r}});if(t.error)throw t.error;if(t.errors)throw t.errors.forEach(i=>console.error(i)),new Error("Unable to read workflows. Consult GraphQL errors.");if(t.data.workflows===void 0||t.data.workflows.length!==r.length)throw new Error(`Unable to read workflows: ${t.errors??"Length mismatch in response"}`);const n=yo(t.data.workflows);return n.forEach(i=>{i.finalizeStepConfig||(i.finalizeStepConfig={}),i.finalizeStepConfig.termsMarkdown=i.finalizeStepConfig.termsMarkdown||i.partner.termsMarkdown}),n},IQ=async(r,e)=>{const n=(await e).find(i=>i.id===r);if(!n)throw new Error(`Workflow not found: ${r}`);return n},Jb=async(r,e)=>{const t=r.map(o=>Sd.get({id:o,options:e})),n=r.filter((o,l)=>t[l]===void 0);if(n.length===0)return Promise.all(t);const i=TQ(n,e),a=n.map(o=>Sd.set({id:o,options:e},IQ(o,i))),s=t.filter(o=>o!==void 0);return await Promise.all(s.concat(a))},LD=async(r,e)=>(await Jb([r],e))[0],DQ=async r=>{const e=await je.getShadowGraphqlClient().query({query:yF,variables:{ids:r},errorPolicy:"all",fetchPolicy:"no-cache"});return e.errors&&console.error(e.errors),e.data.integrationProducts||[]};class PQ{constructor(e){this.activeIntegration=void 0,this.updateTransactionState=async t=>{try{return je.getShadowGraphqlClient().mutate({...t,mutation:R3})}catch(n){throw console.error(n),new co("Critical - Unable to synchronize workflow state with server.")}},this.options=e,this.options.applicationKey&&X4(this.options.applicationKey),console.debug("------------------------"),console.debug("Spiff Commerce Core SDK"),console.debug("Version: 41.0.3-alpha.0"),console.debug(`Application Key Provided: ${!!this.options.applicationKey}`),console.debug("------------------------")}configure(e){_s.setHubUrl(e.hubUrl),_s.setServerUrl(e.serverUrl),_s.setServicesApiUrl(e.servicesApiUrl),this.marketplaceThemeInstallId=e.marketplaceThemeInstallId,this.marketplaceThemeInstallConfigurationId=e.marketplaceThemeInstallConfigurationId,this.userPoolClientId=e.userPoolClientId,this.userPoolRegion=e.userPoolRegion,this.spiffRegion=e.spiffRegion,e.bearerAuthenticationToken&&Xk(e.bearerAuthenticationToken),this.options.applicationKey&&this.getIntegration(),this.spiffRegion&&this.userPoolRegion&&this.userPoolClientId&&Lf.init(this.spiffRegion,this.userPoolRegion,this.userPoolClientId)}getAssetManager(){return Ln}async getBetaEnabled(){return this.options.enableBetaFeatures?!0:(await this.getIntegration()).partner.beta===!0}getFlowService(){if(!J4())throw new Error("Application key required to use Flow Service.");return new DI}async getCurrencyContext(e){const n=(await this.getIntegration()).partner.currencyCode,a=await je.getShadowGraphqlClient().query({query:Z3,errorPolicy:"all",fetchPolicy:"cache-first",variables:{from:n,to:e}}),{rateFrom:s,rateTo:o}=a.data.currencyConversion;return new ND(s,o,n,e)}async getIntegration(){if(this.activeIntegration)return this.activeIntegration;if(!this.options.applicationKey)throw new Error("Cannot get current Integration without specifying an Application Key.");return this.activeIntegration=UD(this.options.applicationKey),this.activeIntegration}async canUseAddon(e){try{return(await this.getIntegration()).partner.activeAddons?.includes(e)??!1}catch(t){return console.error(t),!1}}clearCustomer(){this.customer=void 0}clearCustomerForTransaction(e){const t=xr.getMap("transactionCustomerIds");t?.has(e)&&(t.delete(e),xr.setMap("transactionCustomerIds",t))}async customerHasBundleTemplates(e){const i=(await je.getShadowGraphqlClient().query({query:_v,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;return i.id?i.hasBundleTemplates??!1:!1}getStakeholderTypeForTransaction(e){const t=this.customer?.stakeholders?.find(n=>n.transaction?.id===e);if(t)return t.type}async getOrCreateCustomer(e){this.customer=void 0;const t=je.getShadowGraphqlClient(),i=(await t.query({query:_v,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e}})).data.customer;if(!i.id){const o=(await t.mutate({mutation:fV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{details:{emailAddress:e}}})).data?.customerCreate;if(!o)throw new Error("Unable to create customer.");return this.storeCustomer(o),this.customer=o,{customer:o,isAuthenticated:!1}}this.storeCustomer(i);const a=await this.reloadLoggedInCustomer();return{customer:this.customer||i,isAuthenticated:a}}getCustomer(){return this.customer}async reloadLoggedInCustomer(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens"),n=localStorage.getItem("cognito-email");if(!e||!t||!n)return!1;const i=JSON.parse(t),a=new Date().getTime()/1e3;if(!i.ExpiresIn||i.ExpiresIn<a-parseInt(e)){const u=await Lf.refreshTokens();if(u?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),i.AccessToken=u.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(i));else return this.logOut(),console.error("Failed to refresh tokens."),!1}const s=localStorage.getItem("customer-login-token");s&&y0(s);const l=(await je.getShadowGraphqlClient().query({query:_v,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:n}})).data.customer;return l.id?(this.customer=l,!0):(console.error("Failed to get customer."),!1)}async generateVerificationCode(e){await je.getShadowGraphqlClient().mutate({mutation:dV,variables:{emailAddress:e}}),await Lf.generateCode(e)}async verifyCode(e,t){const n=(await this.getIntegration()).partner.id||"",i=await Lf.verifyCode(e,t,n);if(i?.AuthenticationResult){localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),localStorage.setItem("cognito-tokens",JSON.stringify(i.AuthenticationResult)),localStorage.setItem("cognito-email",e);const s=(await je.getShadowGraphqlClient().mutate({mutation:hV,errorPolicy:"all",fetchPolicy:"no-cache",variables:{emailAddress:e,verificationCode:t}})).data?.customerVerifyCode;if(!s?.id)throw new Error("Failed to get customer.");return this.customer=s,s.loginToken&&(localStorage.setItem("customer-login-token",s.loginToken),y0(s.loginToken)),!0}else throw new Error}async logOut(){localStorage.removeItem("last-refreshed-cognito-tokens"),localStorage.removeItem("cognito-tokens"),localStorage.removeItem("cognito-email"),localStorage.removeItem("customer-login-token"),y0(""),this.clearCustomer()}async loggedInBearerToken(){const e=localStorage.getItem("last-refreshed-cognito-tokens"),t=localStorage.getItem("cognito-tokens");if(!e||!t)throw new Error("No token data in storage.");const n=JSON.parse(t),i=new Date().getTime()/1e3,a=!n?.AccessToken||xg(n.AccessToken);if(!n.ExpiresIn||n.ExpiresIn<i-parseInt(e)||a){const s=await Lf.refreshTokens();if(s?.AuthenticationResult)localStorage.setItem("last-refreshed-cognito-tokens",`${new Date().getTime()/1e3}`),n.AccessToken=s.AuthenticationResult.AccessToken,localStorage.setItem("cognito-tokens",JSON.stringify(n));else throw this.logOut(),new Error("Failed to refresh tokens.")}if(!n.AccessToken)throw new Error("No bearer token in storage.");return n.AccessToken}async getCustomerMetafields(){if(!this.customer?.id)throw new Error("Customer must be logged in before calling this function.");return(await je.getShadowGraphqlClient().query({query:pV,variables:{id:this.customer.id}})).data.metafields}async getNewBundle(e,t,n){const a=(await je.getShadowGraphqlClient().mutate({mutation:ZU(n?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{collectionId:e,initialMetadata:t?Object.entries(t).map((u,c)=>({key:u[0],value:u[1]})):void 0,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},fetchPolicy:"no-cache"})).data?.bundleCreate;if(!a?.id)throw new Error("Unable to create bundle");const s=xr.getMap("bundlePartnerIds")||new Map;s.set(a.id,a.partner.id),xr.setMap("bundlePartnerIds",s);const o=xr.getMap("bundleOwnerIds")||new Map;o.set(a.id,a.bundleOwnerId),xr.setMap("bundleOwnerIds",o);const l=new SE(this,a,void 0,void 0,a.bundleOwnerId,{eagerFetchProducts:n?.graphql?.productCollection?.eagerFetchProducts});return await l.getInitializationPromise(),l}async getExistingBundle(e,t,n,i,a){const o=xr.getMap("bundleOwnerIds")?.get(e),l={};try{const g=await this.loggedInBearerToken();l.Authorization=`Bearer ${g}`}catch{const y=Object.entries(localStorage).find(([C,k])=>C.startsWith("CognitoIdentityServiceProvider")&&C.endsWith("idToken"))?.[0]||"",A=localStorage.getItem(y);A&&!xg(A)&&(l.Authorization=`Bearer ${A}`)}const u={bundleOwnerId:o,...l,...i?.graphql?.additionalHeaders},c=await je.getShadowGraphqlClient().query({query:QU(i?.graphql?.productCollection?.eagerFetchProducts||!1),variables:{id:e},fetchPolicy:"no-cache",context:{headers:u}});if(!c.data?.bundles||c.data?.bundles.length===0||!c.data?.bundles[0])throw new Error(`Unable to find bundle: ${e}`);const h=c.data?.bundles[0],f=xr.getMap("bundlePartnerIds")||new Map;f.set(h.id,h.partner.id),xr.setMap("bundlePartnerIds",f);const d=new SE(this,h,t,n,o,{additionalHeaders:i?.graphql?.additionalHeaders,eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts,existingGlobalPropertyState:c.data.globalPropertyState,readonly:i?.readonly},a);return await d.getInitializationPromise(),d}async duplicateBundle(e,t,n,i){const s={...await zD(e),...i?.graphql?.additionalHeaders},l=(await je.getShadowGraphqlClient().mutate({mutation:e9(),variables:{id:e,template:t,marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId,duplicateTransactions:n},context:{headers:s},fetchPolicy:"no-cache"})).data?.bundleDuplicate;if(!l?.id)throw new Error("Unable to duplicate bundle");const u=xr.getMap("bundlePartnerIds")||new Map;u.set(l.id,l.partner.id),xr.setMap("bundlePartnerIds",u);const c=xr.getMap("bundleOwnerIds")||new Map;return c.set(l.id,l.bundleOwnerId),xr.setMap("bundleOwnerIds",c),async()=>await this.getExistingBundle(l.id,void 0,void 0,{graphql:{productCollection:{eagerFetchProducts:i?.graphql?.productCollection?.eagerFetchProducts||!1}}})}async getBundlesForCustomer(e){if(!this.customer?.id)throw new Error("Customer not authenticated.");const{includeMetadata:t,...n}=e;return(await je.getShadowGraphqlClient().query({query:f9(t??!1),variables:{...n,id:this.customer.id},fetchPolicy:"no-cache"})).data.customerBundlesFeed}async getBundleStakeholders(){if(!this.customer)throw new Error("Customer not authenticated.");const e=await je.getShadowGraphqlClient().query({query:YU,variables:{id:this.customer.id},fetchPolicy:"no-cache"});if(!e.data?.customers||e.data.customers.length===0)throw new Error("Unable to find customer.");const n=e.data.customers[0].bundleStakeholders||[],i=xr.getMap("bundlePartnerIds")||new Map;return n.forEach(a=>{a.bundle?.id&&a.bundle.partner?.id&&i.set(a.bundle.id,a.bundle.partner.id)}),xr.setMap("bundlePartnerIds",i),n}async getWorkflowExperience(e,t){if(!e)throw new Error("getWorkflowExperience has been called without an options object! This is not supported.");const n=await this.getWorkflowExperiences([e],e.graphql),i=n[0],a=i.getWorkflow();return t&&!a&&console.error("No workflow instantiated when trying to create preview service."),t&&a&&await i.getWorkflowManager().injectIntoPreviewService(t(a)),n[0]}async getWorkflowExperiences(e,t,n,i){if(e.length===0)throw new co("No options provided!");const a=e.map((Y,X)=>({option:Y,index:X})),s=a.filter(Y=>Y.option.type==="transaction"),o=a.filter(Y=>Y.option.type==="integration"||Y.option.type==="external"||Y.option.type==="blank"),l=50,u=uA(s,l),c=uA(o,l);let h=0;const f=je.getShadowGraphqlClient(),d=async Y=>{if(Y.length===0)return[];const X=Y.map(oe=>oe.option.transactionId),J=await f.query({query:P3,variables:{ids:X},errorPolicy:"all",fetchPolicy:"no-cache"}),Q=J.data.transactions;if(h=h+Q.length,i&&i(h,s.length),Q.length!==Y.length){const oe=J.errors?.[0]?.message||"Unknown error";throw new co(`Not all transactions were found: ${oe}`)}return!this.activeIntegration&&Q[0].integrationProduct?.integration&&(this.activeIntegration=Promise.resolve(Q[0].integrationProduct.integration)),Q.map((oe,se)=>({transaction:oe,workflowId:oe.workflowId,readOnly:Y.find(he=>he.option.transactionId===oe.id)?.option.readOnly??!1,index:Y[se].index}))},g=async Y=>{if(Y.length===0)return[];const X=await f.mutate({mutation:D3,variables:{inputs:Y.map(Q=>({integrationProductId:Q.option.type==="integration"?Q.option.integrationProductId:void 0,externalIntegrationId:Q.option.type==="external"?Q.option.externalIntegrationId:void 0,externalProductId:Q.option.type==="external"?Q.option.externalProductId:void 0,workflowId:Q.option.workflowId,designName:Q.option.designName,claim:!0,quantity:Q.option.quantity,recipient:Q.option.recipient})),marketplaceThemeInstallId:this.marketplaceThemeInstallId,marketplaceThemeInstallConfigurationId:this.marketplaceThemeInstallConfigurationId},errorPolicy:"all",fetchPolicy:"no-cache"}),J=X.data?.transactionCreateMany;if(!J||J.length===0){const Q=X.errors?.[0]?.message||"Unknown error";throw new co(`Failed to create transactions: ${Q}`)}return h=h+J.length,i&&i(h,s.length),J.map((Q,oe)=>({transaction:Q,workflowId:Q.workflowId,readOnly:!1,index:Y[oe].index}))},v=(await Promise.all([...u.map(d),...c.map(g)])).flat(),y=[...new Set(v.map(Y=>Y.transaction.integrationProductId))].filter(Y=>Y!==void 0),A=[...new Set(v.map(Y=>Y.workflowId))].filter(Y=>Y!==void 0),[C,k]=await Promise.all([(async()=>y.length>0?await DQ(y):[])(),(async()=>A.length>0?await Jb(A,t):[])()]),T=new Map(C.map(Y=>[Y.id,Y])),S=new Map(k.map(Y=>[Y.id,Y])),R=v.map(async Y=>{const{transaction:X,workflowId:J,readOnly:Q,index:oe}=Y,se=J?S.get(J):void 0,he=e[oe];if(X.integrationProductId){const K=T.get(X.integrationProductId);X.integrationProduct=K,X.product=K?.product,X.integrationProduct||console.error("failed to find transaction's product")}const ye=xr.getMap("transactionOwnerIds")||new Map;!ye.get(X.id)&&X.transactionOwnerId&&(ye.set(X.id,X.transactionOwnerId),xr.setMap("transactionOwnerIds",ye));const Ue=ye.get(X.id)||void 0,Oe=new gV({onMutate:()=>({context:{transactionOwnerId:Ue,bundleOwnerId:t?.bundleOwnerId}}),onQuery:()=>({context:{transactionOwnerId:Ue,bundleOwnerId:t?.bundleOwnerId}})}),Te={workflow:se,transaction:X,singleVariantsRenderable:he?.workflowConfiguration?.singleVariantsRenderable,stateMutationFunc:Q?async()=>{throw new nn("State mutation is forbidden in read only mode!")}:async K=>this.updateTransactionState({...K,context:{transactionOwnerId:Ue,bundleOwnerId:t?.bundleOwnerId}}),graphQlClient:()=>Oe,readOnly:Q,isReloadedTransaction:he.type==="transaction"};if(he.type==="transaction"&&X.workflowState){const K=JSON.parse(X.workflowState);await iA(K),Te.reloadedState=K}else if(!Q&&he.workflowState){const K=JSON.parse(he.workflowState);await iA(K),Te.reloadedState=K}return Te.delayWorkflowStateSync=!0,{experienceOptions:Te,index:oe,options:he}}),G=(await Promise.all(R)).sort((Y,X)=>Y.index-X.index);let $=[];for(const Y of G){const{experienceOptions:X,options:J}=Y,Q=new SI(this,X);await Q.getWorkflowManager().getInitializationPromise(),n&&n(),J.type!=="transaction"&&this.customer&&await Q.attachCustomerDetails({email:this.customer.emailAddress}),$=[...$,Q],Q.getWorkflowManager().setWorkflowStateSyncEnabled(!0)}return $}storeCustomer(e){const t=xr.getMap("partnerCustomerIds")||new Map;t.set(e.partner.id,e.id),xr.setMap("partnerCustomerIds",t)}async getIntegrationProductById(e,t){const a=(await je.getShadowGraphqlClient().query({query:U3(t),variables:{ids:[e]},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProducts;if(!a||a.length===0||!a[0]?.id)throw new Error("Integration product not found.");return new dA(a[0])}async getIntegrationProductFromExternalIds(e,t,n){const s=(await je.getShadowGraphqlClient().query({query:V3(n),variables:{externalProductId:t,externalIntegrationId:e},fetchPolicy:"no-cache",errorPolicy:"all"})).data?.integrationProductFromExternalIds;if(!s?.id)throw new Error("Integration product not found.");return new dA(s)}async getIntegrationProduct(e){return e.type==="integration"?this.getIntegrationProductById(e.integrationProductId):this.getIntegrationProductFromExternalIds(e.externalIntegrationId,e.externalProductId)}async getShareActionsForTransaction(e){const n=(xr.getMap("transactionOwnerIds")||new Map).get(e)||void 0,i=await je.getShadowGraphqlClient().query({query:N3,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:e},context:{transactionOwnerId:n}});if(!i.data.transactions||i.data.transactions.length!==1)throw new Error(`Failed to fetch share actions for transaction: ${e}`);return i.data.transactions[0].transactionShareActions}async placeOrder(e){const t=await je.getShadowGraphqlClient().mutate({mutation:K3,variables:{orderItems:e}});if(t.errors)throw new Error(t.errors[0].message);if(!t.data)throw new Error("Failed to create order: No order data in response.");return{id:t.data.orderCreate.id,internalId:t.data.orderCreate.internalId}}}const UD=async(r,e)=>(await je.getShadowGraphqlClient().query({query:Y3,errorPolicy:"all",fetchPolicy:"no-cache",context:{headers:{"x-application-key":r},skipIntegrationCheck:!0},variables:{themeConfigurationId:e}})).data.currentIntegration,RQ=async r=>{const t=await je.getShadowGraphqlClient().query({query:_3,errorPolicy:"all",fetchPolicy:"network-only",variables:{id:r}});if(t.data.transactions.length!==0)return t.data.transactions[0]},OQ=async(r,e)=>(await je.getShadowGraphqlClient().query({query:Q3,errorPolicy:"all",variables:{themeConfigurationId:r,themeInstallId:e}})).data?.marketplaceThemeInstallConfiguration,BQ=async r=>(await je.getShadowGraphqlClient().query({query:J3,errorPolicy:"all",variables:{id:r}})).data?.bundles?.[0]?.marketplaceThemeInstallConfiguration,MQ=async r=>(await je.getShadowGraphqlClient().query({query:X3,errorPolicy:"all",variables:{id:r}})).data?.transactions?.[0]?.marketplaceThemeInstallConfiguration;async function VD(){const r={};try{const e=await this.loggedInBearerToken();r.Authorization=`Bearer ${e}`}catch{const n=Object.entries(localStorage).find(([a,s])=>a.startsWith("CognitoIdentityServiceProvider")&&a.endsWith("idToken"))?.[0]||"",i=localStorage.getItem(n);i&&!xg(i)&&(r.Authorization=`Bearer ${i}`)}return r}async function zD(r){const t=xr.getMap("bundleOwnerIds")?.get(r),n=await VD();return{bundleOwnerId:t,...n}}async function _Q(r){const t=xr.getMap("transactionOwnerIds")?.get(r),n=await VD();return{transactionOwnerId:t,...n}}const NQ=async r=>{const e=await zD(r),t=await je.getShadowGraphqlClient().mutate({mutation:b9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{id:r},context:{headers:e}});if(t.data?.bundleDelete!==r)throw new Error(`Failed to delete bundle: ${t.errors}`)},LQ=async r=>{const e=await _Q(r),t=await je.getShadowGraphqlClient().mutate({mutation:w9,errorPolicy:"all",fetchPolicy:"no-cache",variables:{ids:[r]},context:{headers:e}});if(!t.data?.transactions||t.data.transactions.length!==1||t.data.transactions[0].id!==r)throw new Error(`Failed to find transaction to read bundle id: ${JSON.stringify(t.errors)}`);return t.data.transactions[0].bundle?.id};function HD(r,e,t,n){const i=t.width*r.zoom,a=t.height*r.zoom;if(n){const s=Math.max(e.width/t.width,e.height/t.height),o=Math.max(s,r.zoom),l=t.width*o,u=t.height*o;return{...r,x:Lp(r.x,e.width-l,0),y:Lp(r.y,e.height-u,0),zoom:o}}return{...r,x:Lp(r.x,-i,e.width),y:Lp(r.y,-a,e.height)}}function Lp(r,e,t){return Math.min(Math.max(r,e),t)}class jD{constructor(e,t){this.minZoomScale=[.03],this.maxZoomScale=[20],this._debouncedUpdateFrameOffsets=xI(this.updateFrameOffsets,200),this.targetElements=[],this.onFrameDataChangeListeners=[],this.onZoomChangeListeners=[],this.onRotationChangeListeners=[],this.forceImageCover=e,this.initialZoom=t,this.thresholdSettings={useThreshold:!1,invertThreshold:!1,threshold:128,thresholdSaturation:.5}}connectWorkflowManager(e,t){t&&e.addStepSpecificStorageCallback(async n=>{if(n){const i=n;if(i.currentFrameSources){let a=!1;for(let s=0;s<i.currentFrameSources.length;s++){const o=i.currentFrameSources[s],l=await ah(o),u=this.frameData?this.frameData[s]:void 0;Ed(l,u)||(this.frameData||(this.frameData=new Array(i.currentFrameSources.length)),this.frameData[s]=l,a=!0)}a&&(this.onFrameDataChangeListeners.forEach(s=>s(this.frameData)),this.frameData&&this.imageData&&(this.recalculateOffsets(this.imageData),this.updateOffsets(this.offsets),this.recalculateZoomLimits(this.imageData,this.frameData)))}}},t),this.workflowManager=e,this.stepName=t}setTargetElements(e){this.targetElements=e}getFrameData(){return this.frameData}setFrameData(e){if(!e){this.frameData=void 0;return}e.forEach((t,n)=>{const i=Vu.get(t);i&&(this.frameData||(this.frameData=new Array(e.length)),this.frameData[n]=i)})}getImageData(){return this.imageData}getImageSrc(){if(this.imageData){if(this.imageData.svg){const e=Gg(this.imageData.svg,this.imageData.colors||{},!1);return Hg(e)}return this.imageData.src}}getOffsets(){return this.offsets}setOffsets(e){this.offsets=e}setZoom(e,t,n,i){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const a=this.frameData.map((s,o)=>{const l=(t[o]-this.offsets[o].x)/this.offsets[o].zoom,u=(n[o]-this.offsets[o].y)/this.offsets[o].zoom,c=t[o]-l*e[o],h=n[o]-u*e[o];return{x:c,y:h,zoom:this.imageData.width*e[o]/this.imageData.width,rotation:this.offsets[o].rotation}});this.updateOffsets(a,i),this.onZoomChangeListeners.forEach(s=>s(e))}}setRotation(e,t){if(this.imageData&&this.offsets&&this.frameData){(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length));const n=this.frameData.map((i,a)=>({...this.offsets[a],rotation:e[a]}));this.updateOffsets(n,t),this.onRotationChangeListeners.forEach(i=>i(e))}}setPatternData(e,t=!0){this.imageData=e,e&&this.frameData&&((t||!this.offsets)&&this.recalculateOffsets(e,t),this.updateOffsets(this.offsets,void 0,!0)),this.imageData&&this.frameData&&this.recalculateZoomLimits(this.imageData,this.frameData)}updateOffsets(e,t,n){const i=this.imageData;if(!i||!this.frameData)return;if(this.frameData.length!==e.length)throw new nn("Frame data and offsets are not the same length. This is a bug. Please report it.");if(!this.offsets.some((s,o)=>!(e[o].x===s.x&&e[o].y===s.y&&e[o].zoom===s.zoom&&e[o].rotation===s.rotation))&&!n){t&&t();return}(!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((s,o)=>{this.offsets[o]=HD(e[o],s,this.imageData,this.forceImageCover)}),this._debouncedUpdateFrameOffsets(this.offsets,i,this.frameData,this.thresholdSettings,t)}getThresholdSettings(){return this.thresholdSettings}setThresholdSettings(e){this.thresholdSettings=e,this.imageData&&this.frameData&&this._debouncedUpdateFrameOffsets(this.offsets,this.imageData,this.frameData,e)}onFrameDataChanged(e){e(this.frameData),this.onFrameDataChangeListeners.push(e)}onZoom(e){this.onZoomChangeListeners.push(e)}onRotation(e){this.onRotationChangeListeners.push(e)}updateFrameOffsets(e,t,n,i,a){if(!n||n.length===0||n.some(l=>!l))throw new nn("Frame data not set. This is a bug");if(!this.workflowManager)throw new nn("No workflow manager set, cannot update offsets.");const s=this.workflowManager.getRegionElements(this.stepName||""),o=this.workflowManager.getCommandDispatcher();this.targetElements.forEach((l,u)=>{let c=s.find(h=>h.id===l)?.regionIndex??u;c>=e.length&&(c=u);try{o(new On([new AL(l,t,e[c]),new bL(l,i.useThreshold,i.invertThreshold,i.threshold,i.thresholdSaturation)]))}catch{}}),this.stepName&&this.workflowManager.updateStorage(this.stepName,{frameOffsetsList:e}),a&&a()}recalculateZoomLimits(e,t){(this.minZoomScale.length!==t.length||this.maxZoomScale.length!==t.length)&&(this.minZoomScale=new Array(t.length),this.maxZoomScale=new Array(t.length)),t.forEach((n,i)=>{const a=Math.max(n.width/e.width,n.height/e.height);this.forceImageCover?(this.minZoomScale[i]=a,this.maxZoomScale[i]=a*2.5):(this.minZoomScale[i]=a/10,this.maxZoomScale[i]=a*2.5)})}recalculateOffsets(e,t=!0){this.frameData&&((!this.offsets||this.offsets.length!==this.frameData.length)&&(this.offsets=new Array(this.frameData.length)),this.frameData.forEach((n,i)=>{const a=t?0:this.offsets[i]?.rotation||0;this.offsets[i]={...b1(e,n,this.initialZoom&&!this.forceImageCover?{scale:this.initialZoom}:void 0,this.forceImageCover),rotation:a}}),this._debouncedUpdateFrameOffsets(this.offsets,e,this.frameData,this.thresholdSettings))}}class UQ{traversableScenes(){throw new Error("Method not implemented.")}updateRecipient(e,t,n,i,a,s,o,l,u,c,h,f,d,g,v,y,A){throw new Error("Method not implemented.")}approveTransaction(e){throw new Error("Method not implemented.")}rejectTransaction(e){throw new Error("Method not implemented.")}getClient(){return this.client??{}}getWorkflowExperience(){return{}}setClient(e){this.client=e}getInitializationPromise(){return Promise.resolve()}isInitialized(){return!0}getInformationResults(){return[]}async reset(){}updateStateWithServer(e){}async outstandingRequestsPromise(){}async updateStateWithServerImmediate(e){}addPoller(e){}addConfirmCallback(e){}addEditedCallback(e){}addElementsCallback(e){}addInformationResultCallback(e){}addInitCallback(e){}addMakingAdjustmentsCallback(e){}addMandatoryCallback(e){}addMetadataCallback(e){}addSelectionCallback(e){}addStepSpecificStorageCallback(e,t){}addStorageCallback(e){}getCommandDispatcher(){return e=>{}}getLayouts(){return[]}getLayoutPreviewService(){return{getAll:()=>new Map}}getPreviewService(){}getModelContainer(){}getRegionElements(e){return[]}getSerializedStep(e,t){}getStepSpecificServices(e){}getTransaction(){return{id:""}}getTransactionCustomer(){}setTransactionCustomer(){}setTransactionCustomerDetails(){}getInitialOptionIds(){return new Promise(()=>new Set)}getWorkflow(){return{id:"",name:"",panels:[],steps:[],showModelOnFinishStep:!1,allowProofDownload:!1,introduction:"",stepGroups:[]}}markStepsAsInitialised(e){}markUpdateCompleted(e){}markUpdatePending(){return"123"}getWorkflowSelections(){return{}}getStepSelections(){return{}}setCurrentAdjustingStepId(e){}setEditedStatus(e,t){}setInformationResults(e){}setMandatoryFulfilled(e,t){}async setSelectionsAndElements(e,t,n){}toggleDesignConfirmed(){}updateMetadata(e,t){}async updateStorage(e,t){}injectIntoPreviewService(e){return Promise.resolve()}ejectFromPreviewService(){}setWorkflowStateSyncEnabled(e){}async updateTransactionShareActions(){}addValidationCallback(e){}setStepError(e,t,n){}getStepErrors(e){}getValidationErrors(){return{steps:new Map}}async updateTransactionStakeholders(){}getStepTags(e){return[]}}var GD=(r=>(r.SelectFrame="SelectFrame",r.SelectImage="SelectImage",r.Position="Position",r))(GD||{}),$D=(r=>(r.Original="original",r.BackgroundRemoved="backgroundRemoved",r.Optimized="optimized",r))($D||{});class qD extends Wi{constructor(e,t,n){super(e,t,n);const i=t.data;this.frameService=new jD(i.forceImageCover,i.initialZoomLevel),this.frameService.connectWorkflowManager(e,t.stepName)}selectVariant(e){const t=this.manager.getRegionElements(this.step.stepName);return uo.selectVariant(this.step,e.getResource(),t,this.manager,n=>this.setUpdateState(n))}onFrameDataChanged(e){this.frameService&&this.frameService.onFrameDataChanged(t=>{t&&e(t)})}async selectImage(e,t=!0,n=!0){await uo.selectImage(this.step,e,this.manager,n),t&&this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:e.key,backgroundRemovedAssetKey:void 0,vectorizedAssetKey:void 0,enhancedAssetKey:void 0,useOriginalAsset:void 0}})}async canUseAdvancedImageManipulation(){return this.manager.getClient().canUseAddon(Ng.AdvancedImageManipulation)}async canRemoveBackground(){return await this.canUseAdvancedImageManipulation()&&this.hasOriginalImageSelection()&&!!this.frameService?.getImageData()?.src&&!this.frameService?.getImageData()?.svg}async removeBackgroundFromImageSelection(e=!0){if(!await this.canUseAdvancedImageManipulation())throw new Error("The current Integration does not have access to the Background Remover. Please call canUseAdvancedImageManipulation to ensure you disable this feature when appropriate.");const t=await this.getOriginalImageSelection();if(!t)throw new Error("You must supply an image selection before attempting to remove the background.");const n=await Ln.removeBackgroundFromAsset(t);e&&await uo.selectImage(this.step,n,this.manager,!1);const i=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...i,backgroundRemovedAssetKey:n.key,useOriginalAsset:!e}}),n}async vectorize(e,t=void 0){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to vectorize the image.");const i=await Ln.vectorizeAsset(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{...a,vectorizedAssetKey:i.key,useOriginalAsset:!1}}),i}async enhanceWithAI(e,t){const n=e??await this.getOriginalImageSelection();if(!n)throw new Error("You must supply an image selection before attempting to enhance the image with AI.");const i=await Ln.enhanceWithAI(n,t);await this.selectImage(i,!1);const a=this.getFrameStepStorage()?.framePatternData||{};return this.manager.updateStorage(this.step.stepName,{framePatternData:{originalAssetKey:a.originalAssetKey,backgroundRemovedAssetKey:a.backgroundRemovedAssetKey,vectorizedAssetKey:a.vectorizedAssetKey,enhancedAssetKey:i.key,useOriginalAsset:!1}}),i}async getBackgroundRemovedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getVectorizedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}async getEnhancedImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey;if(e)return Ln.getLocalOrFromServer(e)}hasOriginalImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.originalAssetKey}hasBackgroundRemovedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.backgroundRemovedAssetKey}hasVectorizedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.vectorizedAssetKey}hasEnhancedImageSelection(){return!!this.getFrameStepStorage()?.framePatternData?.enhancedAssetKey}async changeColors(e){await uo.changeColors(this.step,this.manager,e)}getImageData(){if(this.frameService)return this.frameService.getImageData()}async getColorOption(){return await ft.ensureFullOption(this.step.data.colorOption)}getAvailableColors(){return this.step.data.colorPickerEnabled?uo.availableColors(this.step,this.manager):Promise.resolve([])}isColorPickerEnabled(){return this.step.data.colorPickerEnabled??!1}async getOriginalImageColors(){const e=this.getImageData();return e?.svg?(await Ba(e.svg)).colors:void 0}async mergeColors(e,t,n){const i=this.frameService.getImageData();if(!i?.svg||!i.colors)throw new Error("Cannot merge colors on non-SVG image or image without color information");const{svg:a,colors:s}=dF(i.svg,i.colors,e,t,n);this.frameService.setPatternData({...i,svg:a,colors:s},!1),this.manager.updateStorage(this.step.stepName,{colors:s})}async unmergeColors(e,t,n,i){const a=this.frameService.getImageData();if(!a?.svg||!a.colors)throw new Error("Cannot unmerge colors on non-SVG image or image without color information");this.frameService.setPatternData({...a,svg:i,colors:n},!1),this.manager.updateStorage(this.step.stepName,{colors:n})}getShouldVectorize(){return this.step.data.shouldVectorize??!1}getVectorizeMaxColors(){return this.step.data.vectorizeMaxColors}getMinimumPixelThresholdForOptimization(){return this.step.data.vectorizationMinimumPixelThreshold}getMaxAllowedColors(){return this.step.data.maxColors}getUniqueColorCount(){return uo.getUniqueColorCount(this.step,this.manager)}getCurrentFrameStep(e,t,n,i){return i&&i.length>1&&e===void 0?"SelectFrame":t||n||this.getImageData()?"Position":"SelectImage"}getFrameService(){return this.frameService}hasOverlayImageKey(){return this.step.data.overlayImageKey}hasOverlayImageUrl(){return this.step.data.overlayImageUrl}getWhitelistedExtensions(){return[...this.step.data.whitelistedExtensions,...this.step.data.whitelistedExtensions.includes(".jpg")?[".jpeg"]:[]]}async getOriginalImageSelection(){const e=this.getFrameStepStorage()?.framePatternData?.originalAssetKey;if(e)return Ln.getLocalOrFromServer(e)}getCurrentImageState(){const e=this.getFrameStepStorage()?.framePatternData;return e?e.vectorizedAssetKey&&!e.useOriginalAsset?"optimized":e.useOriginalAsset!==!1?"original":"backgroundRemoved":"original"}async setImageState(e){const t=this.getFrameStepStorage()?.framePatternData||{};let n,i;switch(e){case"original":if(n=await this.getOriginalImageSelection(),!n)throw new Error("No original image available");i=!0;break;case"backgroundRemoved":if(n=await this.getBackgroundRemovedImageSelection(),!n)throw new Error("No background-removed image available. Call removeBackgroundFromImageSelection first.");i=!1;break;case"optimized":if(n=await this.getVectorizedImageSelection(),!n)throw new Error("No optimized image available. Call vectorize first.");i=!1;break}await this.selectImage(n,!1,!0),this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:i}})}getUseOriginalImageSelection(){return this.getFrameStepStorage()?.framePatternData?.useOriginalAsset??!1}async setUseOriginalImageSelection(e){const t=this.getFrameStepStorage()?.framePatternData||{};if(t.useOriginalAsset===e)return;const n=await this.getOriginalImageSelection();if(!n)throw new Error("You must provide an image selection before calling setUseOriginalImageSelection");if(e)await this.selectImage(n,!1,!1);else{const i=await this.getBackgroundRemovedImageSelection();if(!i)throw new Error("You must call removeBackgroundFromImageSelection before attempting to apply the image.");await this.selectImage(i,!1,!1)}this.manager.updateStorage(this.step.stepName,{framePatternData:{...t,useOriginalAsset:e}})}getFrameStepStorage(){return this.manager.getStepStorage(this.step.stepName)}isVariantCategoriesEnabled(){return this.step.data.enableVariantCategories??!1}}const VQ=ke`
|
|
2804
2817
|
query GetLoggedInCustomer($email: String!) {
|
|
2805
2818
|
customer(emailAddress: $email) {
|
|
2806
2819
|
id
|
|
@@ -3003,4 +3016,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3003
3016
|
}
|
|
3004
3017
|
}
|
|
3005
3018
|
`,mY=async r=>(await je.getShadowGraphqlClient().query({query:gY,variables:{ids:r}})).data.integrationProducts;exports.AddonHandle=Ng;exports.AddressValidationJobStatus=YD;exports.AddressValidationResultConfirmationLevel=QD;exports.AddressValidationStatus=HA;exports.ArrayInput=cV;exports.AspectType=jn;exports.AssetNotFoundError=Eo;exports.AssetType=bd;exports.BringForwardCommand=EL;exports.BringToBackCommand=SL;exports.BringToFrontCommand=xL;exports.BundleDesignCreationCartAddMode=Nk;exports.CanvasCommand=Tn;exports.CollectionProduct=Yf;exports.ColorOptionGlobalPropertyHandle=cA;exports.CommandContext=$T;exports.ConversionDataType=nd;exports.CreateElementCommand=ai;exports.CreateLayoutCommand=x1;exports.CurrencyContext=ND;exports.CurrencyService=_D;exports.DeleteElementCommand=Nl;exports.DigitalContentStepHandle=bI;exports.FileUploadGlobalPropertyHandle=EI;exports.FlowExecutionNodeResult=Xf;exports.FlowExecutionResult=PI;exports.FlowService=DI;exports.FontAlignmentCommand=JT;exports.FontColorCommand=YT;exports.FontSizeCommand=XT;exports.FontSourceCommand=aA;exports.FrameService=jD;exports.FrameStep=GD;exports.FrameStepHandle=qD;exports.GlobalPropertyHandle=rm;exports.GroupCommand=On;exports.IllustrationStepHandle=dI;exports.ImageState=$D;exports.InformationMessageType=sh;exports.InformationStepHandle=AI;exports.IntegrationProduct=dA;exports.IntegrationType=Uk;exports.LayoutElementFactory=gL;exports.LayoutElementType=Zt;exports.LayoutNotFoundError=Ai;exports.LayoutRenderingPurpose=nc;exports.MaterialStepHandle=hI;exports.MisconfigurationError=os;exports.MockWorkflowManager=UQ;exports.ModelStepHandle=pI;exports.ModuleStepHandle=wI;exports.MoveCommand=mL;exports.ObjectInput=M1;exports.ObjectInputType=RI;exports.OptionGlobalPropertyHandle=R1;exports.OptionNotFoundError=wd;exports.ParseError=wl;exports.PictureStepHandle=gI;exports.ProductCameraRig=Vk;exports.ProductCollection=O1;exports.ProductCollectionProductSortKey=II;exports.ProductWorkflow=Yu;exports.PromiseQueue=Xg;exports.QuestionStepHandle=mI;exports.QueueablePromise=Yg;exports.ResizeCommand=yL;exports.ResourceNotFoundError=ic;exports.RotateCommand=vL;exports.ScaleAxis=gi;exports.SendBackwardsCommand=kL;exports.ShapeStepHandle=vI;exports.ShareActionType=Lk;exports.SpiffCommerceClient=PQ;exports.StakeholderType=jA;exports.StepAspectType=_k;exports.StepHandle=Wi;exports.StepType=Je;exports.TextAlgorithm=Rl;exports.TextChangeCommand=KT;exports.TextGlobalPropertyHandle=kI;exports.TextInput=uV;exports.TextStepHandle=yI;exports.UnhandledBehaviorError=nn;exports.UnitOfMeasurement=zk;exports.UpdateImageSourceCommand=wL;exports.Variant=Pa;exports.WorkflowExperienceEventType=Sg;exports.WorkflowExperienceImpl=SI;exports.amtChannelsForAspect=FI;exports.assetConfigurationDeleteMutation=rM;exports.assetConfigurationUpdateMutation=tM;exports.assetConfigurationsQuery=eM;exports.assetService=Ln;exports.browserColorToHex=lF;exports.bundleEmailMutation=C9;exports.cmPerPixel=W_;exports.currentDirection=G_;exports.dataUrlFromExternalUrl=L4;exports.deleteBundle=NQ;exports.designService=eg;exports.determineCorrectFontSizeAndLines=od;exports.digitalContentStepService=E1;exports.domParser=cs;exports.duplicateBundle=XQ;exports.duplicateTransaction=JQ;exports.fetchAsString=ia;exports.findAngle=N_;exports.findElement=Un;exports.findPmsColors=a3;exports.frameDataCache=Vu;exports.frameStepService=uo;exports.fromUtf8=Dl;exports.generate=Ar;exports.generateCommands=uI;exports.generateSVGWithUnknownColors=Ba;exports.generateStateFromDesignInputSteps=HU;exports.getAddressValidationJobs=fY;exports.getAssetsForProductImagesQuery=nM;exports.getAttributesFromArrayBuffer=Wd;exports.getAxisAlignedBoundingBox=__;exports.getBoundedOffsets=HD;exports.getBundleIdForTransaction=LQ;exports.getBundleThemeConfiguration=BQ;exports.getCustomer=KQ;exports.getCustomerBundles=ZQ;exports.getElementVertices=$_;exports.getFrameData=ah;exports.getGlobalPropertyStateForBundle=qU;exports.getIntegration=UD;exports.getIntegrationProducts=mY;exports.getNEPoint=H_;exports.getNWPoint=z_;exports.getOrderedTransactions=rY;exports.getOverrideThemeConfiguration=OQ;exports.getPointOfRotation=V_;exports.getProductCollections=nV;exports.getSEPoint=j_;exports.getSvgElement=Zg;exports.getTemplateBundles=iY;exports.getTemplateTransactions=nY;exports.getTransaction=RQ;exports.getTransactionThemeConfiguration=MQ;exports.getTransactionsForBundle=eY;exports.getTransformedAssetURL=$g;exports.getTrueCoordinates=U_;exports.getUnorderedTransactions=tY;exports.getValidationJobsForWorkflowExperiences=cY;exports.getWorkflow=LD;exports.getWorkflows=Jb;exports.graphQlManager=je;exports.illustrationStepService=sd;exports.isCloseToValue=L_;exports.loadFont=_l;exports.matchHexToPms=r3;exports.materialStepService=k1;exports.mergeColorClasses=dF;exports.metafieldManager=Eg;exports.mmPerPixel=q_;exports.modelStepService=F1;exports.modifySVGColors=Gg;exports.moduleStepService=T1;exports.nameBundle=QQ;exports.nameTransaction=YQ;exports.optionService=ft;exports.outlineFontsInSvg=S7;exports.overrideWorkflowExperienceRecipientAddress=pY;exports.patternImageDataCache=Bs;exports.persistenceService=xr;exports.pictureStepService=I1;exports.pmsToRgb=t3;exports.promiseCache=Sd;exports.questionStepService=D1;exports.registerFetchImplementation=O4;exports.registerWindowImplementation=R4;exports.rehydrateSerializedLayout=iA;exports.rgbToPms=oF;exports.rotateAroundPoint=Wf;exports.sanitizeSvgTree=jg;exports.setBearerAuthenticationToken=Xk;exports.setCanvasModule=$A;exports.shapeStepService=zu;exports.shortenUrl=iI;exports.spiffCoreConfiguration=_s;exports.stepAspectValuesToDesignInputSteps=zU;exports.svgColorValueToDefinition=Vy;exports.svgStringDimensions=C1;exports.svgToDataUrl=Hg;exports.textStepService=ui;exports.toUtf8=im;exports.toast=sI;exports.validateWorkflowExperienceRecipient=dY;exports.validateWorkflowExperienceRecipients=hY;exports.xmlSerializer=Ro;
|
|
3006
|
-
//# sourceMappingURL=index-
|
|
3019
|
+
//# sourceMappingURL=index-B8os5-qQ.cjs.map
|