dynamic-mui 2.0.25 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/XmlShapeDeserializer-3yQdm0b0.mjs +237 -0
  2. package/dist/XmlShapeDeserializer-XKJAoqLc.js +1 -0
  3. package/dist/ai/client.d.ts +2 -0
  4. package/dist/ai/index.d.ts +4 -0
  5. package/dist/ai/mapping.d.ts +14 -0
  6. package/dist/ai/react/AIFill.d.ts +25 -0
  7. package/dist/ai/react/AIForm.d.ts +29 -0
  8. package/dist/ai/react/AIFormGenerator.d.ts +20 -0
  9. package/dist/ai/react/AISchemaReview.d.ts +18 -0
  10. package/dist/ai/react/AITextAssist.d.ts +35 -0
  11. package/dist/ai/react/AIVisionImport.d.ts +21 -0
  12. package/dist/ai/react/index.d.ts +6 -0
  13. package/dist/ai/types.d.ts +107 -0
  14. package/dist/components/FormGenerator.d.ts +14 -1
  15. package/dist/components/controls/AddressField/addressfield.d.ts +2 -0
  16. package/dist/components/controls/Alert/alert.d.ts +3 -0
  17. package/dist/components/controls/Button/button.d.ts +3 -0
  18. package/dist/components/controls/CascadeSelect/cascadeselect.d.ts +2 -0
  19. package/dist/components/controls/ChipSelect/chipselect.d.ts +3 -0
  20. package/dist/components/controls/ColorPicker/colorpicker.d.ts +3 -0
  21. package/dist/components/controls/Computed/computed.d.ts +7 -0
  22. package/dist/components/controls/ConsentField/consentfield.d.ts +3 -0
  23. package/dist/components/controls/CurrencyField/currencyfield.d.ts +2 -0
  24. package/dist/components/controls/DateRangePicker/daterangepicker.d.ts +3 -0
  25. package/dist/components/controls/FileUpload/fileupload.d.ts +3 -0
  26. package/dist/components/controls/FormWizard/formwizard.d.ts +2 -0
  27. package/dist/components/controls/GeoField/geofield.d.ts +6 -0
  28. package/dist/components/controls/KeyValueField/keyvaluefield.d.ts +2 -0
  29. package/dist/components/controls/MarkdownEditor/markdowneditor.d.ts +3 -0
  30. package/dist/components/controls/MatrixField/matrixfield.d.ts +3 -0
  31. package/dist/components/controls/NumberStepper/numberstepper.d.ts +2 -0
  32. package/dist/components/controls/OtpField/otpfield.d.ts +2 -0
  33. package/dist/components/controls/PasswordField/passwordfield.d.ts +2 -0
  34. package/dist/components/controls/PhoneField/phonefield.d.ts +2 -0
  35. package/dist/components/controls/Rating/rating.d.ts +3 -0
  36. package/dist/components/controls/Slider/slider.d.ts +3 -0
  37. package/dist/components/controls/SummaryField/summaryfield.d.ts +7 -0
  38. package/dist/components/controls/TagsInput/tagsinput.d.ts +3 -0
  39. package/dist/components/controls/ToggleButtons/togglebuttons.d.ts +3 -0
  40. package/dist/components/controls/index.d.ts +50 -0
  41. package/dist/date-utils-CFUUt6NL.js +4 -0
  42. package/dist/date-utils-pGzaKb0p.mjs +477 -0
  43. package/dist/dynamic-mui.cjs.js +469 -1
  44. package/dist/dynamic-mui.es.js +102548 -7
  45. package/dist/index-BW8_rRff.js +7 -0
  46. package/dist/index-BXFVK_GX.js +1 -0
  47. package/dist/index-CVqLvm8B.js +1 -0
  48. package/dist/index-Cr6Wp_S-.mjs +3141 -0
  49. package/dist/{index-Cu1h31y8.mjs → index-DA0XouZs.mjs} +16 -16
  50. package/dist/index-DKS5Sz9e.js +14 -0
  51. package/dist/index-DcWfyXJp.mjs +92 -0
  52. package/dist/index-MllWgTJ5.mjs +9372 -0
  53. package/dist/index.browser-BSu11T_q.mjs +363 -0
  54. package/dist/index.browser-By7-GABP.js +4 -0
  55. package/dist/index.d.ts +1 -0
  56. package/dist/loadCognitoIdentity-DtYTy-DW.js +1 -0
  57. package/dist/loadCognitoIdentity-DzdR91GB.mjs +872 -0
  58. package/dist/loadSts-Cic6UToN.mjs +593 -0
  59. package/dist/loadSts-csbFP6zX.js +1 -0
  60. package/dist/noAuth-B8ui2kBg.mjs +71 -0
  61. package/dist/noAuth-JPA2o4dt.js +1 -0
  62. package/dist/playground/AIContext.d.ts +18 -0
  63. package/dist/playground/AIPanel.d.ts +10 -0
  64. package/dist/types.d.ts +81 -10
  65. package/dist/util/helper.d.ts +2 -30
  66. package/dist/util/premiumStyles.d.ts +27 -0
  67. package/dist/util/rules.d.ts +35 -0
  68. package/package.json +2 -2
  69. package/dist/index-Bd7ELVvM.mjs +0 -102295
  70. package/dist/index-DIaEVD8W.js +0 -465
  71. package/dist/index-DzzNuBCt.js +0 -1
  72. package/dist/loadCognitoIdentity-5jZEsafg.js +0 -1
  73. package/dist/loadCognitoIdentity-C-Upg8iV.mjs +0 -935
@@ -0,0 +1,363 @@
1
+ import { H as v, s as O, p as P, F as R, n as N } from "./date-utils-pGzaKb0p.mjs";
2
+ class A extends Error {
3
+ name = "ProviderError";
4
+ tryNextLink;
5
+ constructor(t, o = !0) {
6
+ let n, r = !0;
7
+ typeof o == "boolean" ? (n = void 0, r = o) : o != null && typeof o == "object" && (n = o.logger, r = o.tryNextLink ?? !0), super(t), this.tryNextLink = r, Object.setPrototypeOf(this, A.prototype), n?.debug?.(`@smithy/property-provider ${r ? "->" : "(!)"} ${t}`);
8
+ }
9
+ static from(t, o = !0) {
10
+ return Object.assign(new this(t.message, o), t);
11
+ }
12
+ }
13
+ class c extends A {
14
+ name = "CredentialsProviderError";
15
+ constructor(t, o = !0) {
16
+ super(t, o), Object.setPrototypeOf(this, c.prototype);
17
+ }
18
+ }
19
+ function T(e) {
20
+ return Promise.all(Object.keys(e).reduce((t, o) => {
21
+ const n = e[o];
22
+ return typeof n == "string" ? t.push([o, n]) : t.push(n().then((r) => [o, r])), t;
23
+ }, [])).then((t) => t.reduce((o, [n, r]) => (o[n] = r, o), {}));
24
+ }
25
+ function k(e) {
26
+ return async (t) => {
27
+ e.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
28
+ const { GetCredentialsForIdentityCommand: o, CognitoIdentityClient: n } = await import("./loadCognitoIdentity-DzdR91GB.mjs"), r = (u) => e.clientConfig?.[u] ?? e.parentClientConfig?.[u] ?? t?.callerClientConfig?.[u], { Credentials: { AccessKeyId: s = E(e.logger), Expiration: i, SecretKey: a = x(e.logger), SessionToken: d } = K(e.logger) } = await (e.client ?? new n(Object.assign({}, e.clientConfig ?? {}, {
29
+ region: r("region"),
30
+ profile: r("profile"),
31
+ userAgentAppId: r("userAgentAppId")
32
+ }))).send(new o({
33
+ CustomRoleArn: e.customRoleArn,
34
+ IdentityId: e.identityId,
35
+ Logins: e.logins ? await T(e.logins) : void 0
36
+ }));
37
+ return {
38
+ identityId: e.identityId,
39
+ accessKeyId: s,
40
+ secretAccessKey: a,
41
+ sessionToken: d,
42
+ expiration: i
43
+ };
44
+ };
45
+ }
46
+ function E(e) {
47
+ throw new c("Response from Amazon Cognito contained no access key ID", { logger: e });
48
+ }
49
+ function K(e) {
50
+ throw new c("Response from Amazon Cognito contained no credentials", { logger: e });
51
+ }
52
+ function x(e) {
53
+ throw new c("Response from Amazon Cognito contained no secret key", { logger: e });
54
+ }
55
+ const I = "IdentityIds";
56
+ class H {
57
+ dbName;
58
+ constructor(t = "aws:cognito-identity-ids") {
59
+ this.dbName = t;
60
+ }
61
+ getItem(t) {
62
+ return this.withObjectStore("readonly", (o) => {
63
+ const n = o.get(t);
64
+ return new Promise((r) => {
65
+ n.onerror = () => r(null), n.onsuccess = () => r(n.result ? n.result.value : null);
66
+ });
67
+ }).catch(() => null);
68
+ }
69
+ removeItem(t) {
70
+ return this.withObjectStore("readwrite", (o) => {
71
+ const n = o.delete(t);
72
+ return new Promise((r, s) => {
73
+ n.onerror = () => s(n.error), n.onsuccess = () => r();
74
+ });
75
+ });
76
+ }
77
+ setItem(t, o) {
78
+ return this.withObjectStore("readwrite", (n) => {
79
+ const r = n.put({ id: t, value: o });
80
+ return new Promise((s, i) => {
81
+ r.onerror = () => i(r.error), r.onsuccess = () => s();
82
+ });
83
+ });
84
+ }
85
+ getDb() {
86
+ const t = self.indexedDB.open(this.dbName, 1);
87
+ return new Promise((o, n) => {
88
+ t.onsuccess = () => {
89
+ o(t.result);
90
+ }, t.onerror = () => {
91
+ n(t.error);
92
+ }, t.onblocked = () => {
93
+ n(new Error("Unable to access DB"));
94
+ }, t.onupgradeneeded = () => {
95
+ const r = t.result;
96
+ r.onerror = () => {
97
+ n(new Error("Failed to create object store"));
98
+ }, r.createObjectStore(I, { keyPath: "id" });
99
+ };
100
+ });
101
+ }
102
+ withObjectStore(t, o) {
103
+ return this.getDb().then((n) => {
104
+ const r = n.transaction(I, t);
105
+ return r.oncomplete = () => n.close(), new Promise((s, i) => {
106
+ r.onerror = () => i(r.error), s(o(r.objectStore(I)));
107
+ }).catch((s) => {
108
+ throw n.close(), s;
109
+ });
110
+ });
111
+ }
112
+ }
113
+ class j {
114
+ store;
115
+ constructor(t = {}) {
116
+ this.store = t;
117
+ }
118
+ getItem(t) {
119
+ return t in this.store ? this.store[t] : null;
120
+ }
121
+ removeItem(t) {
122
+ delete this.store[t];
123
+ }
124
+ setItem(t, o) {
125
+ this.store[t] = o;
126
+ }
127
+ }
128
+ const q = new j();
129
+ function D() {
130
+ return typeof self == "object" && self.indexedDB ? new H() : typeof window == "object" && window.localStorage ? window.localStorage : q;
131
+ }
132
+ function $({ accountId: e, cache: t = D(), client: o, clientConfig: n, customRoleArn: r, identityPoolId: s, logins: i, userIdentifier: a = !i || Object.keys(i).length === 0 ? "ANONYMOUS" : void 0, logger: d, parentClientConfig: u }) {
133
+ d?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
134
+ const f = a ? `aws:cognito-identity-credentials:${s}:${a}` : void 0;
135
+ let l = async (g) => {
136
+ const { GetIdCommand: m, CognitoIdentityClient: y } = await import("./loadCognitoIdentity-DzdR91GB.mjs"), w = (h) => n?.[h] ?? u?.[h] ?? g?.callerClientConfig?.[h], C = o ?? new y(Object.assign({}, n ?? {}, {
137
+ region: w("region"),
138
+ profile: w("profile"),
139
+ userAgentAppId: w("userAgentAppId")
140
+ }));
141
+ let p = f && await t.getItem(f);
142
+ if (!p) {
143
+ const { IdentityId: h = L(d) } = await C.send(new m({
144
+ AccountId: e,
145
+ IdentityPoolId: s,
146
+ Logins: i ? await T(i) : void 0
147
+ }));
148
+ p = h, f && Promise.resolve(t.setItem(f, p)).catch(() => {
149
+ });
150
+ }
151
+ return l = k({
152
+ client: C,
153
+ customRoleArn: r,
154
+ logins: i,
155
+ identityId: p
156
+ }), l(g);
157
+ };
158
+ return (g) => l(g).catch(async (m) => {
159
+ throw f && Promise.resolve(t.removeItem(f)).catch(() => {
160
+ }), m;
161
+ });
162
+ }
163
+ function L(e) {
164
+ throw new c("Response from Amazon Cognito contained no identity ID", { logger: e });
165
+ }
166
+ const Q = (e) => k({
167
+ ...e
168
+ }), V = (e) => $({
169
+ ...e
170
+ }), M = "169.254.170.2", _ = "169.254.170.23", W = "[fd00:ec2::23]", z = (e, t) => {
171
+ if (e.protocol !== "https:" && !(e.hostname === M || e.hostname === _ || e.hostname === W)) {
172
+ if (e.hostname.includes("[")) {
173
+ if (e.hostname === "[::1]" || e.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]")
174
+ return;
175
+ } else {
176
+ if (e.hostname === "localhost")
177
+ return;
178
+ const o = e.hostname.split("."), n = (r) => {
179
+ const s = parseInt(r, 10);
180
+ return 0 <= s && s <= 255;
181
+ };
182
+ if (o[0] === "127" && n(o[1]) && n(o[2]) && n(o[3]) && o.length === 4)
183
+ return;
184
+ }
185
+ throw new c(`URL not accepted. It must either be HTTPS or match one of the following:
186
+ - loopback CIDR 127.0.0.0/8 or [::1/128]
187
+ - ECS container host 169.254.170.2
188
+ - EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger: t });
189
+ }
190
+ };
191
+ function U(e) {
192
+ return new v({
193
+ protocol: e.protocol,
194
+ hostname: e.hostname,
195
+ port: Number(e.port),
196
+ path: e.pathname,
197
+ query: Array.from(e.searchParams.entries()).reduce((t, [o, n]) => (t[o] = n, t), {}),
198
+ fragment: e.hash
199
+ });
200
+ }
201
+ async function F(e, t) {
202
+ const n = await O(e.body).transformToString();
203
+ if (e.statusCode === 200) {
204
+ const r = JSON.parse(n);
205
+ if (typeof r.AccessKeyId != "string" || typeof r.SecretAccessKey != "string" || typeof r.Token != "string" || typeof r.Expiration != "string")
206
+ throw new c("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger: t });
207
+ return {
208
+ accessKeyId: r.AccessKeyId,
209
+ secretAccessKey: r.SecretAccessKey,
210
+ sessionToken: r.Token,
211
+ expiration: P(r.Expiration)
212
+ };
213
+ }
214
+ if (e.statusCode >= 400 && e.statusCode < 500) {
215
+ let r = {};
216
+ try {
217
+ r = JSON.parse(n);
218
+ } catch {
219
+ }
220
+ throw Object.assign(new c(`Server responded with status: ${e.statusCode}`, { logger: t }), {
221
+ Code: r.Code,
222
+ Message: r.Message
223
+ });
224
+ }
225
+ throw new c(`Server responded with status: ${e.statusCode}`, { logger: t });
226
+ }
227
+ const B = (e, t, o) => async () => {
228
+ for (let n = 0; n < t; ++n)
229
+ try {
230
+ return await e();
231
+ } catch {
232
+ await new Promise((s) => setTimeout(s, o));
233
+ }
234
+ return await e();
235
+ }, X = (e = {}) => {
236
+ e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
237
+ let t;
238
+ const o = e.credentialsFullUri;
239
+ if (o)
240
+ t = o;
241
+ else
242
+ throw new c("No HTTP credential provider host provided.", { logger: e.logger });
243
+ const n = new URL(t);
244
+ z(n, e.logger);
245
+ const r = new R();
246
+ return B(async () => {
247
+ const s = U(n);
248
+ e.authorizationToken && (s.headers.Authorization = e.authorizationToken);
249
+ const i = await r.handle(s);
250
+ return F(i.response);
251
+ }, e.maxRetries ?? 3, e.timeout ?? 1e3);
252
+ }, G = "us-east-1", Z = (e, t, o) => {
253
+ let n;
254
+ return async (r = {}) => {
255
+ const { callerClientConfig: s } = r, i = e.clientConfig?.profile ?? s?.profile, a = e.logger ?? s?.logger;
256
+ a?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");
257
+ const d = { ...e.params, RoleSessionName: e.params.RoleSessionName ?? "aws-sdk-js-" + Date.now() };
258
+ if (d?.SerialNumber) {
259
+ if (!e.mfaCodeProvider)
260
+ throw new c("Temporary credential requires multi-factor authentication, but no MFA code callback was provided.", {
261
+ tryNextLink: !1,
262
+ logger: a
263
+ });
264
+ d.TokenCode = await e.mfaCodeProvider(d?.SerialNumber);
265
+ }
266
+ const { AssumeRoleCommand: u, STSClient: f } = await import("./loadSts-Cic6UToN.mjs").then((g) => g.w);
267
+ if (!n) {
268
+ const g = typeof t == "function" ? t() : void 0, m = [
269
+ e.masterCredentials,
270
+ e.clientConfig?.credentials,
271
+ void s?.credentials,
272
+ s?.credentialDefaultProvider?.(),
273
+ g
274
+ ];
275
+ let y = "STS client default credentials";
276
+ if (m[0])
277
+ y = "options.masterCredentials";
278
+ else if (m[1])
279
+ y = "options.clientConfig.credentials";
280
+ else {
281
+ if (m[2])
282
+ throw y = "caller client's credentials", new Error("fromTemporaryCredentials recursion in callerClientConfig.credentials");
283
+ m[3] ? y = "caller client's credentialDefaultProvider" : m[4] && (y = "AWS SDK default credentials");
284
+ }
285
+ const w = [
286
+ e.clientConfig?.region,
287
+ s?.region,
288
+ await o?.({
289
+ profile: i
290
+ }),
291
+ G
292
+ ];
293
+ let C = "default partition's default region";
294
+ w[0] ? C = "options.clientConfig.region" : w[1] ? C = "caller client's region" : w[2] && (C = "file or env region");
295
+ const p = [
296
+ b(e.clientConfig?.requestHandler),
297
+ b(s?.requestHandler)
298
+ ];
299
+ let h = "STS default requestHandler";
300
+ p[0] ? h = "options.clientConfig.requestHandler" : p[1] && (h = "caller client's requestHandler"), a?.debug?.(`@aws-sdk/credential-providers - fromTemporaryCredentials STS client init with ${C}=${await N(S(w))()}, ${y}, ${h}.`), n = new f({
301
+ userAgentAppId: s?.userAgentAppId,
302
+ ...e.clientConfig,
303
+ credentials: S(m),
304
+ logger: a,
305
+ profile: i,
306
+ region: S(w),
307
+ requestHandler: S(p)
308
+ });
309
+ }
310
+ if (e.clientPlugins)
311
+ for (const g of e.clientPlugins)
312
+ n.middlewareStack.use(g);
313
+ const { Credentials: l } = await n.send(new u(d));
314
+ if (!l || !l.AccessKeyId || !l.SecretAccessKey)
315
+ throw new c(`Invalid response from STS.assumeRole call with role ${d.RoleArn}`, {
316
+ logger: a
317
+ });
318
+ return {
319
+ accessKeyId: l.AccessKeyId,
320
+ secretAccessKey: l.SecretAccessKey,
321
+ sessionToken: l.SessionToken,
322
+ expiration: l.Expiration,
323
+ credentialScope: l.CredentialScope
324
+ };
325
+ };
326
+ }, b = (e) => e?.metadata?.handlerProtocol === "h2" ? void 0 : e, S = (e) => {
327
+ for (const t of e)
328
+ if (t !== void 0)
329
+ return t;
330
+ }, J = (e) => async (t) => {
331
+ e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
332
+ const { roleArn: o, roleSessionName: n, webIdentityToken: r, providerId: s, policyArns: i, policy: a, durationSeconds: d } = e;
333
+ let { roleAssumerWithWebIdentity: u } = e;
334
+ if (!u) {
335
+ const { getDefaultRoleAssumerWithWebIdentity: f } = await import("./index-DcWfyXJp.mjs");
336
+ u = f({
337
+ ...e.clientConfig,
338
+ credentialProviderLogger: e.logger,
339
+ parentClientConfig: {
340
+ ...t?.callerClientConfig,
341
+ ...e.parentClientConfig
342
+ }
343
+ }, e.clientPlugins);
344
+ }
345
+ return u({
346
+ RoleArn: o,
347
+ RoleSessionName: n ?? `aws-sdk-js-session-${Date.now()}`,
348
+ WebIdentityToken: r,
349
+ ProviderId: s,
350
+ PolicyArns: i,
351
+ Policy: a,
352
+ DurationSeconds: d
353
+ });
354
+ }, ee = (e) => J({
355
+ ...e
356
+ });
357
+ export {
358
+ Q as fromCognitoIdentity,
359
+ V as fromCognitoIdentityPool,
360
+ X as fromHttp,
361
+ Z as fromTemporaryCredentials,
362
+ ee as fromWebToken
363
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./date-utils-CFUUt6NL.js");class A extends Error{name="ProviderError";tryNextLink;constructor(t,o=!0){let n,r=!0;typeof o=="boolean"?(n=void 0,r=o):o!=null&&typeof o=="object"&&(n=o.logger,r=o.tryNextLink??!0),super(t),this.tryNextLink=r,Object.setPrototypeOf(this,A.prototype),n?.debug?.(`@smithy/property-provider ${r?"->":"(!)"} ${t}`)}static from(t,o=!0){return Object.assign(new this(t.message,o),t)}}class c extends A{name="CredentialsProviderError";constructor(t,o=!0){super(t,o),Object.setPrototypeOf(this,c.prototype)}}function k(e){return Promise.all(Object.keys(e).reduce((t,o)=>{const n=e[o];return typeof n=="string"?t.push([o,n]):t.push(n().then(r=>[o,r])),t},[])).then(t=>t.reduce((o,[n,r])=>(o[n]=r,o),{}))}function v(e){return async t=>{e.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const{GetCredentialsForIdentityCommand:o,CognitoIdentityClient:n}=await Promise.resolve().then(()=>require("./loadCognitoIdentity-DtYTy-DW.js")),r=u=>e.clientConfig?.[u]??e.parentClientConfig?.[u]??t?.callerClientConfig?.[u],{Credentials:{AccessKeyId:s=P(e.logger),Expiration:i,SecretKey:a=R(e.logger),SessionToken:l}=O(e.logger)}=await(e.client??new n(Object.assign({},e.clientConfig??{},{region:r("region"),profile:r("profile"),userAgentAppId:r("userAgentAppId")}))).send(new o({CustomRoleArn:e.customRoleArn,IdentityId:e.identityId,Logins:e.logins?await k(e.logins):void 0}));return{identityId:e.identityId,accessKeyId:s,secretAccessKey:a,sessionToken:l,expiration:i}}}function P(e){throw new c("Response from Amazon Cognito contained no access key ID",{logger:e})}function O(e){throw new c("Response from Amazon Cognito contained no credentials",{logger:e})}function R(e){throw new c("Response from Amazon Cognito contained no secret key",{logger:e})}const b="IdentityIds";class N{dbName;constructor(t="aws:cognito-identity-ids"){this.dbName=t}getItem(t){return this.withObjectStore("readonly",o=>{const n=o.get(t);return new Promise(r=>{n.onerror=()=>r(null),n.onsuccess=()=>r(n.result?n.result.value:null)})}).catch(()=>null)}removeItem(t){return this.withObjectStore("readwrite",o=>{const n=o.delete(t);return new Promise((r,s)=>{n.onerror=()=>s(n.error),n.onsuccess=()=>r()})})}setItem(t,o){return this.withObjectStore("readwrite",n=>{const r=n.put({id:t,value:o});return new Promise((s,i)=>{r.onerror=()=>i(r.error),r.onsuccess=()=>s()})})}getDb(){const t=self.indexedDB.open(this.dbName,1);return new Promise((o,n)=>{t.onsuccess=()=>{o(t.result)},t.onerror=()=>{n(t.error)},t.onblocked=()=>{n(new Error("Unable to access DB"))},t.onupgradeneeded=()=>{const r=t.result;r.onerror=()=>{n(new Error("Failed to create object store"))},r.createObjectStore(b,{keyPath:"id"})}})}withObjectStore(t,o){return this.getDb().then(n=>{const r=n.transaction(b,t);return r.oncomplete=()=>n.close(),new Promise((s,i)=>{r.onerror=()=>i(r.error),s(o(r.objectStore(b)))}).catch(s=>{throw n.close(),s})})}}class E{store;constructor(t={}){this.store=t}getItem(t){return t in this.store?this.store[t]:null}removeItem(t){delete this.store[t]}setItem(t,o){this.store[t]=o}}const K=new E;function q(){return typeof self=="object"&&self.indexedDB?new N:typeof window=="object"&&window.localStorage?window.localStorage:K}function x({accountId:e,cache:t=q(),client:o,clientConfig:n,customRoleArn:r,identityPoolId:s,logins:i,userIdentifier:a=!i||Object.keys(i).length===0?"ANONYMOUS":void 0,logger:l,parentClientConfig:u}){l?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const f=a?`aws:cognito-identity-credentials:${s}:${a}`:void 0;let d=async g=>{const{GetIdCommand:m,CognitoIdentityClient:y}=await Promise.resolve().then(()=>require("./loadCognitoIdentity-DtYTy-DW.js")),h=w=>n?.[w]??u?.[w]??g?.callerClientConfig?.[w],p=o??new y(Object.assign({},n??{},{region:h("region"),profile:h("profile"),userAgentAppId:h("userAgentAppId")}));let C=f&&await t.getItem(f);if(!C){const{IdentityId:w=H(l)}=await p.send(new m({AccountId:e,IdentityPoolId:s,Logins:i?await k(i):void 0}));C=w,f&&Promise.resolve(t.setItem(f,C)).catch(()=>{})}return d=v({client:p,customRoleArn:r,logins:i,identityId:C}),d(g)};return g=>d(g).catch(async m=>{throw f&&Promise.resolve(t.removeItem(f)).catch(()=>{}),m})}function H(e){throw new c("Response from Amazon Cognito contained no identity ID",{logger:e})}const j=e=>v({...e}),D=e=>x({...e}),$="169.254.170.2",M="169.254.170.23",L="[fd00:ec2::23]",W=(e,t)=>{if(e.protocol!=="https:"&&!(e.hostname===$||e.hostname===M||e.hostname===L)){if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;const o=e.hostname.split("."),n=r=>{const s=parseInt(r,10);return 0<=s&&s<=255};if(o[0]==="127"&&n(o[1])&&n(o[2])&&n(o[3])&&o.length===4)return}throw new c(`URL not accepted. It must either be HTTPS or match one of the following:
2
+ - loopback CIDR 127.0.0.0/8 or [::1/128]
3
+ - ECS container host 169.254.170.2
4
+ - EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:t})}};function _(e){return new S.HttpRequest({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((t,[o,n])=>(t[o]=n,t),{}),fragment:e.hash})}async function U(e,t){const n=await S.sdkStreamMixin(e.body).transformToString();if(e.statusCode===200){const r=JSON.parse(n);if(typeof r.AccessKeyId!="string"||typeof r.SecretAccessKey!="string"||typeof r.Token!="string"||typeof r.Expiration!="string")throw new c("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:t});return{accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,sessionToken:r.Token,expiration:S.parseRfc3339DateTime(r.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let r={};try{r=JSON.parse(n)}catch{}throw Object.assign(new c(`Server responded with status: ${e.statusCode}`,{logger:t}),{Code:r.Code,Message:r.Message})}throw new c(`Server responded with status: ${e.statusCode}`,{logger:t})}const z=(e,t,o)=>async()=>{for(let n=0;n<t;++n)try{return await e()}catch{await new Promise(s=>setTimeout(s,o))}return await e()},F=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let t;const o=e.credentialsFullUri;if(o)t=o;else throw new c("No HTTP credential provider host provided.",{logger:e.logger});const n=new URL(t);W(n,e.logger);const r=new S.FetchHttpHandler;return z(async()=>{const s=_(n);e.authorizationToken&&(s.headers.Authorization=e.authorizationToken);const i=await r.handle(s);return U(i.response)},e.maxRetries??3,e.timeout??1e3)},B="us-east-1",G=(e,t,o)=>{let n;return async(r={})=>{const{callerClientConfig:s}=r,i=e.clientConfig?.profile??s?.profile,a=e.logger??s?.logger;a?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");const l={...e.params,RoleSessionName:e.params.RoleSessionName??"aws-sdk-js-"+Date.now()};if(l?.SerialNumber){if(!e.mfaCodeProvider)throw new c("Temporary credential requires multi-factor authentication, but no MFA code callback was provided.",{tryNextLink:!1,logger:a});l.TokenCode=await e.mfaCodeProvider(l?.SerialNumber)}const{AssumeRoleCommand:u,STSClient:f}=await Promise.resolve().then(()=>require("./loadSts-csbFP6zX.js")).then(g=>g.loadSts);if(!n){const g=typeof t=="function"?t():void 0,m=[e.masterCredentials,e.clientConfig?.credentials,void s?.credentials,s?.credentialDefaultProvider?.(),g];let y="STS client default credentials";if(m[0])y="options.masterCredentials";else if(m[1])y="options.clientConfig.credentials";else{if(m[2])throw y="caller client's credentials",new Error("fromTemporaryCredentials recursion in callerClientConfig.credentials");m[3]?y="caller client's credentialDefaultProvider":m[4]&&(y="AWS SDK default credentials")}const h=[e.clientConfig?.region,s?.region,await o?.({profile:i}),B];let p="default partition's default region";h[0]?p="options.clientConfig.region":h[1]?p="caller client's region":h[2]&&(p="file or env region");const C=[T(e.clientConfig?.requestHandler),T(s?.requestHandler)];let w="STS default requestHandler";C[0]?w="options.clientConfig.requestHandler":C[1]&&(w="caller client's requestHandler"),a?.debug?.(`@aws-sdk/credential-providers - fromTemporaryCredentials STS client init with ${p}=${await S.normalizeProvider(I(h))()}, ${y}, ${w}.`),n=new f({userAgentAppId:s?.userAgentAppId,...e.clientConfig,credentials:I(m),logger:a,profile:i,region:I(h),requestHandler:I(C)})}if(e.clientPlugins)for(const g of e.clientPlugins)n.middlewareStack.use(g);const{Credentials:d}=await n.send(new u(l));if(!d||!d.AccessKeyId||!d.SecretAccessKey)throw new c(`Invalid response from STS.assumeRole call with role ${l.RoleArn}`,{logger:a});return{accessKeyId:d.AccessKeyId,secretAccessKey:d.SecretAccessKey,sessionToken:d.SessionToken,expiration:d.Expiration,credentialScope:d.CredentialScope}}},T=e=>e?.metadata?.handlerProtocol==="h2"?void 0:e,I=e=>{for(const t of e)if(t!==void 0)return t},J=e=>async t=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:o,roleSessionName:n,webIdentityToken:r,providerId:s,policyArns:i,policy:a,durationSeconds:l}=e;let{roleAssumerWithWebIdentity:u}=e;if(!u){const{getDefaultRoleAssumerWithWebIdentity:f}=await Promise.resolve().then(()=>require("./index-CVqLvm8B.js"));u=f({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...t?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return u({RoleArn:o,RoleSessionName:n??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:r,ProviderId:s,PolicyArns:i,Policy:a,DurationSeconds:l})},Y=e=>J({...e});exports.fromCognitoIdentity=j;exports.fromCognitoIdentityPool=D;exports.fromHttp=F;exports.fromTemporaryCredentials=G;exports.fromWebToken=Y;
package/dist/index.d.ts CHANGED
@@ -3,3 +3,4 @@ export { default as DynamicComponent } from './components/DynamicComponent';
3
3
  export { default as Controls } from './components/controls';
4
4
  export { default as MuiConfig } from './config/mui';
5
5
  export * from './types';
6
+ export * from './ai';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-DKS5Sz9e.js"),S=require("./date-utils-CFUUt6NL.js"),ne=require("./noAuth-JPA2o4dt.js");function Ee(s,t,e){if(e?.source){const n=e.source;if(typeof t=="number"&&(t>Number.MAX_SAFE_INTEGER||t<Number.MIN_SAFE_INTEGER||n!==String(t)))return n.includes(".")?new i.NumericValue(n,"bigDecimal"):BigInt(n)}return t}const we=(s,t)=>i.collectBody(s,t).then(e=>(t?.utf8Encoder??S.toUtf8)(e)),Ie=(s,t)=>we(s,t).then(e=>{if(e.length)try{return JSON.parse(e)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:e}),n}return{}}),xe=(s,t)=>{const e=(a,o)=>Object.keys(a).find(c=>c.toLowerCase()===o.toLowerCase()),n=a=>{let o=a;return typeof o=="number"&&(o=o.toString()),o.indexOf(",")>=0&&(o=o.split(",")[0]),o.indexOf(":")>=0&&(o=o.split(":")[0]),o.indexOf("#")>=0&&(o=o.split("#")[1]),o},r=e(s.headers,"x-amzn-errortype");if(r!==void 0)return n(s.headers[r]);if(t&&typeof t=="object"){const a=e(t,"code");if(a&&t[a]!==void 0)return n(t[a]);if(t.__type!==void 0)return n(t.__type)}};class be extends i.SerdeContextConfig{settings;constructor(t){super(),this.settings=t}async read(t,e){return this._read(t,typeof e=="string"?JSON.parse(e,Ee):await Ie(e,this.serdeContext))}readObject(t,e){return this._read(t,e)}_read(t,e){const n=e!==null&&typeof e=="object",r=i.NormalizedSchema.of(t);if(n){if(r.isStructSchema()){const o=e,c=r.isUnionSchema(),p={};let l;const{jsonName:d}=this.settings;d&&(l={});let y;c&&(y=new i.UnionSerde(o,p));for(const[g,I]of r.structIterator()){let w=g;d&&(w=I.getMergedTraits().jsonName??w,l[w]=g),c&&y.mark(w),o[w]!=null&&(p[g]=this._read(I,o[w]))}if(c)y.writeUnknown();else if(typeof o.__type=="string")for(const[g,I]of Object.entries(o)){const w=d?l[g]??g:g;w in p||(p[w]=I)}return p}if(Array.isArray(e)&&r.isListSchema()){const o=r.getValueSchema(),c=[],p=!!r.getMergedTraits().sparse;for(const l of e)(p||l!=null)&&c.push(this._read(o,l));return c}if(r.isMapSchema()){const o=r.getValueSchema(),c={},p=!!r.getMergedTraits().sparse;for(const[l,d]of Object.entries(e))(p||d!=null)&&(c[l]=this._read(o,d));return c}}if(r.isBlobSchema()&&typeof e=="string")return S.fromBase64(e);const a=r.getMergedTraits().mediaType;if(r.isStringSchema()&&typeof e=="string"&&a)return a==="application/json"||a.endsWith("+json")?i.LazyJsonString.from(e):e;if(r.isTimestampSchema()&&e!=null)switch(i.determineTimestampFormat(r,this.settings)){case 5:return S.parseRfc3339DateTimeWithOffset(e);case 6:return S.parseRfc7231DateTime(e);case 7:return S.parseEpochTimestamp(e);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",e),new Date(e)}if(r.isBigIntegerSchema()&&(typeof e=="number"||typeof e=="string"))return BigInt(e);if(r.isBigDecimalSchema()&&e!=null){if(e instanceof i.NumericValue)return e;const o=e;return o.type==="bigDecimal"&&"string"in o?new i.NumericValue(o.string,o.type):new i.NumericValue(String(e),"bigDecimal")}if(r.isNumericSchema()&&typeof e=="string"){switch(e){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN}return e}if(r.isDocumentSchema())if(n){const o=Array.isArray(e)?[]:{};for(const[c,p]of Object.entries(e))p instanceof i.NumericValue?o[c]=p:o[c]=this._read(r,p);return o}else return structuredClone(e);return e}}const W="Ν";class Ce{values=new Map;counter=0;stage=0;createReplacer(){if(this.stage===1)throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");return this.stage=1,(t,e)=>{if(e instanceof i.NumericValue){const n=`${W+"nv"+this.counter++}_`+e.string;return this.values.set(`"${n}"`,e.string),n}if(typeof e=="bigint"){const n=e.toString(),r=`${W+"b"+this.counter++}_`+n;return this.values.set(`"${r}"`,n),r}return e}}replaceInJson(t){if(this.stage===0)throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");if(this.stage===2)throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");if(this.stage=2,this.counter===0)return t;for(const[e,n]of this.values)t=t.replace(e,n);return t}}class Pe extends i.SerdeContextConfig{settings;buffer;useReplacer=!1;rootSchema;constructor(t){super(),this.settings=t}write(t,e){this.rootSchema=i.NormalizedSchema.of(t),this.buffer=this._write(this.rootSchema,e)}writeDiscriminatedDocument(t,e){this.write(t,e),typeof this.buffer=="object"&&(this.buffer.__type=i.NormalizedSchema.of(t).getName(!0))}flush(){const{rootSchema:t,useReplacer:e}=this;if(this.rootSchema=void 0,this.useReplacer=!1,t?.isStructSchema()||t?.isDocumentSchema()){if(!e)return JSON.stringify(this.buffer);const n=new Ce;return n.replaceInJson(JSON.stringify(this.buffer,n.createReplacer(),0))}return this.buffer}_write(t,e,n){const r=e!==null&&typeof e=="object",a=i.NormalizedSchema.of(t);if(r){if(a.isStructSchema()){const o=e,c={},{jsonName:p}=this.settings;let l;p&&(l={});for(const[d,y]of a.structIterator()){const g=this._write(y,o[d],a);if(g!==void 0){let I=d;p&&(I=y.getMergedTraits().jsonName??d,l[d]=I),c[I]=g}}if(a.isUnionSchema()&&Object.keys(c).length===0){const{$unknown:d}=o;if(Array.isArray(d)){const[y,g]=d;c[y]=this._write(15,g)}}else if(typeof o.__type=="string")for(const[d,y]of Object.entries(o)){const g=p?l[d]??d:d;g in c||(c[g]=this._write(15,y))}return c}if(Array.isArray(e)&&a.isListSchema()){const o=a.getValueSchema(),c=[],p=!!a.getMergedTraits().sparse;for(const l of e)(p||l!=null)&&c.push(this._write(o,l));return c}if(a.isMapSchema()){const o=a.getValueSchema(),c={},p=!!a.getMergedTraits().sparse;for(const[l,d]of Object.entries(e))(p||d!=null)&&(c[l]=this._write(o,d));return c}if(e instanceof Uint8Array&&(a.isBlobSchema()||a.isDocumentSchema()))return a===this.rootSchema?e:(this.serdeContext?.base64Encoder??S.toBase64)(e);if(e instanceof Date&&(a.isTimestampSchema()||a.isDocumentSchema()))switch(i.determineTimestampFormat(a,this.settings)){case 5:return e.toISOString().replace(".000Z","Z");case 6:return S.dateToUtcString(e);case 7:return e.getTime()/1e3;default:return console.warn("Missing timestamp format, using epoch seconds",e),e.getTime()/1e3}e instanceof i.NumericValue&&(this.useReplacer=!0)}if(!(e===null&&n?.isStructSchema())){if(a.isStringSchema()){if(typeof e>"u"&&a.isIdempotencyToken())return i.v4();const o=a.getMergedTraits().mediaType;return e!=null&&o&&(o==="application/json"||o.endsWith("+json"))?i.LazyJsonString.from(e):e}if(typeof e=="number"&&a.isNumericSchema())return Math.abs(e)===1/0||isNaN(e)?String(e):e;if(typeof e=="string"&&a.isBlobSchema())return a===this.rootSchema?e:(this.serdeContext?.base64Encoder??S.toBase64)(e);if(typeof e=="bigint"&&(this.useReplacer=!0),a.isDocumentSchema())if(r){const o=Array.isArray(e)?[]:{};for(const[c,p]of Object.entries(e))p instanceof i.NumericValue?(this.useReplacer=!0,o[c]=p):o[c]=this._write(a,p);return o}else return structuredClone(e);return e}}}class Re extends i.SerdeContextConfig{settings;constructor(t){super(),this.settings=t}createSerializer(){const t=new Pe(this.settings);return t.setSerdeContext(this.serdeContext),t}createDeserializer(){const t=new be(this.settings);return t.setSerdeContext(this.serdeContext),t}}class Ae extends ne.RpcProtocol{serializer;deserializer;serviceTarget;codec;mixin;awsQueryCompatible;constructor({defaultNamespace:t,serviceTarget:e,awsQueryCompatible:n,jsonCodec:r}){super({defaultNamespace:t}),this.serviceTarget=e,this.codec=r??new Re({timestampFormat:{useTrait:!0,default:7},jsonName:!1}),this.serializer=this.codec.createSerializer(),this.deserializer=this.codec.createDeserializer(),this.awsQueryCompatible=!!n,this.mixin=new i.ProtocolLib(this.awsQueryCompatible)}async serializeRequest(t,e,n){const r=await super.serializeRequest(t,e,n);return r.path.endsWith("/")||(r.path+="/"),Object.assign(r.headers,{"content-type":`application/x-amz-json-${this.getJsonRpcVersion()}`,"x-amz-target":`${this.serviceTarget}.${t.name}`}),this.awsQueryCompatible&&(r.headers["x-amzn-query-mode"]="true"),(i.deref(t.input)==="unit"||!r.body)&&(r.body="{}"),r}getPayloadCodec(){return this.codec}async handleError(t,e,n,r,a){this.awsQueryCompatible&&this.mixin.setQueryCompatError(r,n);const o=xe(n,r)??"Unknown",{errorSchema:c,errorMetadata:p}=await this.mixin.getErrorSchemaOrThrowBaseException(o,this.options.defaultNamespace,n,r,a,this.awsQueryCompatible?this.mixin.findQueryCompatibleError:void 0),l=i.NormalizedSchema.of(c),d=r.message??r.Message??"Unknown",y=i.TypeRegistry.for(c[1]).getErrorCtor(c)??Error,g=new y(d),I={};for(const[w,Se]of l.structIterator())r[w]!=null&&(I[w]=this.codec.createDeserializer().readObject(Se,r[w]));throw this.awsQueryCompatible&&this.mixin.queryCompatOutput(r,I),this.mixin.decorateServiceException(Object.assign(g,p,{$fault:l.getMergedTraits().error,message:d},I),r)}}class _e extends Ae{constructor({defaultNamespace:t,serviceTarget:e,awsQueryCompatible:n,jsonCodec:r}){super({defaultNamespace:t,serviceTarget:e,awsQueryCompatible:n,jsonCodec:r})}getShapeId(){return"aws.protocols#awsJson1_1"}getJsonRpcVersion(){return"1.1"}getDefaultContentType(){return"application/x-amz-json-1.1"}}const ke=async(s,t,e)=>({operation:i.getSmithyContext(t).operation,region:await i.normalizeProvider(s.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function ve(s){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:s.region},propertiesExtractor:(t,e)=>({signingProperties:{config:t,context:e}})}}function O(s){return{schemeId:"smithy.api#noAuth"}}const Te=s=>{const t=[];switch(s.operation){case"GetCredentialsForIdentity":{t.push(O());break}case"GetId":{t.push(O());break}case"GetOpenIdToken":{t.push(O());break}case"UnlinkIdentity":{t.push(O());break}default:t.push(ve(s))}return t},De=s=>{const t=i.resolveAwsSdkSigV4Config(s);return Object.assign(t,{authSchemePreference:i.normalizeProvider(s.authSchemePreference??[])})},Oe=s=>Object.assign(s,{useDualstackEndpoint:s.useDualstackEndpoint??!1,useFipsEndpoint:s.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"}),ae={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Ne="3.980.0",Fe={version:Ne},ce=(s,t=!1)=>{if(t){for(const e of s.split("."))if(!ce(e))return!1;return!0}return!(!i.isValidHostLabel(s)||s.length<3||s.length>63||s!==s.toLowerCase()||i.isIpAddress(s))},K=":",$e="/",Me=s=>{const t=s.split(K);if(t.length<6)return null;const[e,n,r,a,o,...c]=t;if(e!=="arn"||n===""||r===""||c.join(K)==="")return null;const p=c.map(l=>l.split($e)).flat();return{partition:n,service:r,region:a,accountId:o,resourceId:p}},Ue=[{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)"}}}],ze={partitions:Ue};let je=ze;const Ge=s=>{const{partitions:t}=je;for(const n of t){const{regions:r,outputs:a}=n;for(const[o,c]of Object.entries(r))if(o===s)return{...a,...c}}for(const n of t){const{regionRegex:r,outputs:a}=n;if(new RegExp(r).test(s))return{...a}}const e=t.find(n=>n.id==="aws");if(!e)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...e.outputs}},ue={isVirtualHostableS3Bucket:ce,parseArn:Me,partition:Ge};i.customEndpointFunctions.aws=ue;const pe="required",h="fn",m="argv",k="ref",Q=!0,Z="isSet",D="booleanEquals",_="error",C="endpoint",A="tree",N="PartitionResult",F="getAttr",v="stringEquals",X={[pe]:!1,type:"string"},Y={[pe]:!0,default:!1,type:"boolean"},ee={[k]:"Endpoint"},de={[h]:D,[m]:[{[k]:"UseFIPS"},!0]},le={[h]:D,[m]:[{[k]:"UseDualStack"},!0]},f={},T={[k]:"Region"},te={[h]:F,[m]:[{[k]:N},"supportsFIPS"]},fe={[k]:N},se={[h]:D,[m]:[!0,{[h]:F,[m]:[fe,"supportsDualStack"]}]},ie=[de],re=[le],oe=[T],Le={parameters:{Region:X,UseDualStack:Y,UseFIPS:Y,Endpoint:X},rules:[{conditions:[{[h]:Z,[m]:[ee]}],rules:[{conditions:ie,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:_},{conditions:re,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:_},{endpoint:{url:ee,properties:f,headers:f},type:C}],type:A},{conditions:[{[h]:Z,[m]:oe}],rules:[{conditions:[{[h]:"aws.partition",[m]:oe,assign:N}],rules:[{conditions:[de,le],rules:[{conditions:[{[h]:D,[m]:[Q,te]},se],rules:[{conditions:[{[h]:v,[m]:[T,"us-east-1"]}],endpoint:{url:"https://cognito-identity-fips.us-east-1.amazonaws.com",properties:f,headers:f},type:C},{conditions:[{[h]:v,[m]:[T,"us-east-2"]}],endpoint:{url:"https://cognito-identity-fips.us-east-2.amazonaws.com",properties:f,headers:f},type:C},{conditions:[{[h]:v,[m]:[T,"us-west-1"]}],endpoint:{url:"https://cognito-identity-fips.us-west-1.amazonaws.com",properties:f,headers:f},type:C},{conditions:[{[h]:v,[m]:[T,"us-west-2"]}],endpoint:{url:"https://cognito-identity-fips.us-west-2.amazonaws.com",properties:f,headers:f},type:C},{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:f,headers:f},type:C}],type:A},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:_}],type:A},{conditions:ie,rules:[{conditions:[{[h]:D,[m]:[te,Q]}],rules:[{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",properties:f,headers:f},type:C}],type:A},{error:"FIPS is enabled but this partition does not support FIPS",type:_}],type:A},{conditions:re,rules:[{conditions:[se],rules:[{conditions:[{[h]:v,[m]:["aws",{[h]:F,[m]:[fe,"name"]}]}],endpoint:{url:"https://cognito-identity.{Region}.amazonaws.com",properties:f,headers:f},type:C},{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:f,headers:f},type:C}],type:A},{error:"DualStack is enabled but this partition does not support DualStack",type:_}],type:A},{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",properties:f,headers:f},type:C}],type:A}],type:A},{error:"Invalid Configuration: Missing Region",type:_}]},He=Le,Je=new i.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),Be=(s,t={})=>Je.get(s,()=>i.resolveEndpoint(He,{endpointParams:s,logger:t.logger}));i.customEndpointFunctions.aws=ue;const Ve=s=>({apiVersion:"2014-06-30",base64Decoder:s?.base64Decoder??S.fromBase64,base64Encoder:s?.base64Encoder??S.toBase64,disableHostPrefix:s?.disableHostPrefix??!1,endpointProvider:s?.endpointProvider??Be,extensions:s?.extensions??[],httpAuthSchemeProvider:s?.httpAuthSchemeProvider??Te,httpAuthSchemes:s?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:t=>t.getIdentityProvider("aws.auth#sigv4"),signer:new i.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:t=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ne.NoAuthSigner}],logger:s?.logger??new i.NoOpLogger,protocol:s?.protocol??_e,protocolSettings:s?.protocolSettings??{defaultNamespace:"com.amazonaws.cognitoidentity",xmlNamespace:"http://cognito-identity.amazonaws.com/doc/2014-06-30/",version:"2014-06-30",serviceTarget:"AWSCognitoIdentityService"},serviceId:s?.serviceId??"Cognito Identity",urlParser:s?.urlParser??i.parseUrl,utf8Decoder:s?.utf8Decoder??S.fromUtf8,utf8Encoder:s?.utf8Encoder??S.toUtf8}),qe=s=>{const t=i.resolveDefaultsModeConfig(s),e=()=>t().then(i.loadConfigsForDefaultMode),n=Ve(s);return{...n,...s,runtime:"browser",defaultsMode:t,bodyLengthChecker:s?.bodyLengthChecker??i.calculateBodyLength,credentialDefaultProvider:s?.credentialDefaultProvider??(r=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:s?.defaultUserAgentProvider??i.createDefaultUserAgentProvider({serviceId:n.serviceId,clientVersion:Fe.version}),maxAttempts:s?.maxAttempts??i.DEFAULT_MAX_ATTEMPTS,region:s?.region??i.invalidProvider("Region is missing"),requestHandler:S.FetchHttpHandler.create(s?.requestHandler??e),retryMode:s?.retryMode??(async()=>(await e()).retryMode||i.DEFAULT_RETRY_MODE),sha256:s?.sha256??i.Sha256,streamCollector:s?.streamCollector??S.streamCollector,useDualstackEndpoint:s?.useDualstackEndpoint??(()=>Promise.resolve(i.DEFAULT_USE_DUALSTACK_ENDPOINT)),useFipsEndpoint:s?.useFipsEndpoint??(()=>Promise.resolve(i.DEFAULT_USE_FIPS_ENDPOINT))}},We=s=>{const t=s.httpAuthSchemes;let e=s.httpAuthSchemeProvider,n=s.credentials;return{setHttpAuthScheme(r){const a=t.findIndex(o=>o.schemeId===r.schemeId);a===-1?t.push(r):t.splice(a,1,r)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(r){e=r},httpAuthSchemeProvider(){return e},setCredentials(r){n=r},credentials(){return n}}},Ke=s=>({httpAuthSchemes:s.httpAuthSchemes(),httpAuthSchemeProvider:s.httpAuthSchemeProvider(),credentials:s.credentials()}),Qe=(s,t)=>{const e=Object.assign(i.getAwsRegionExtensionConfiguration(s),i.getDefaultExtensionConfiguration(s),i.getHttpHandlerExtensionConfiguration(s),We(s));return t.forEach(n=>n.configure(e)),Object.assign(s,i.resolveAwsRegionExtensionConfiguration(e),i.resolveDefaultRuntimeConfig(e),i.resolveHttpHandlerRuntimeConfig(e),Ke(e))};class Ze extends i.Client{config;constructor(...[t]){const e=qe(t||{});super(e),this.initConfig=e;const n=Oe(e),r=i.resolveUserAgentConfig(n),a=i.resolveRetryConfig(r),o=i.resolveRegionConfig(a),c=i.resolveHostHeaderConfig(o),p=i.resolveEndpointConfig(c),l=De(p),d=Qe(l,t?.extensions||[]);this.config=d,this.middlewareStack.use(i.getSchemaSerdePlugin(this.config)),this.middlewareStack.use(i.getUserAgentPlugin(this.config)),this.middlewareStack.use(i.getRetryPlugin(this.config)),this.middlewareStack.use(i.getContentLengthPlugin(this.config)),this.middlewareStack.use(i.getHostHeaderPlugin(this.config)),this.middlewareStack.use(i.getLoggerPlugin(this.config)),this.middlewareStack.use(i.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(i.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ke,identityProviderConfigProvider:async y=>new i.DefaultIdentityProviderConfig({"aws.auth#sigv4":y.credentials})})),this.middlewareStack.use(i.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class E extends i.ServiceException{constructor(t){super(t),Object.setPrototypeOf(this,E.prototype)}}class $ extends E{name="InternalErrorException";$fault="server";constructor(t){super({name:"InternalErrorException",$fault:"server",...t}),Object.setPrototypeOf(this,$.prototype)}}class M extends E{name="InvalidParameterException";$fault="client";constructor(t){super({name:"InvalidParameterException",$fault:"client",...t}),Object.setPrototypeOf(this,M.prototype)}}class U extends E{name="LimitExceededException";$fault="client";constructor(t){super({name:"LimitExceededException",$fault:"client",...t}),Object.setPrototypeOf(this,U.prototype)}}class z extends E{name="NotAuthorizedException";$fault="client";constructor(t){super({name:"NotAuthorizedException",$fault:"client",...t}),Object.setPrototypeOf(this,z.prototype)}}class j extends E{name="ResourceConflictException";$fault="client";constructor(t){super({name:"ResourceConflictException",$fault:"client",...t}),Object.setPrototypeOf(this,j.prototype)}}class G extends E{name="TooManyRequestsException";$fault="client";constructor(t){super({name:"TooManyRequestsException",$fault:"client",...t}),Object.setPrototypeOf(this,G.prototype)}}class L extends E{name="ResourceNotFoundException";$fault="client";constructor(t){super({name:"ResourceNotFoundException",$fault:"client",...t}),Object.setPrototypeOf(this,L.prototype)}}class H extends E{name="ExternalServiceException";$fault="client";constructor(t){super({name:"ExternalServiceException",$fault:"client",...t}),Object.setPrototypeOf(this,H.prototype)}}class J extends E{name="InvalidIdentityPoolConfigurationException";$fault="client";constructor(t){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...t}),Object.setPrototypeOf(this,J.prototype)}}class B extends E{name="DeveloperUserAlreadyRegisteredException";$fault="client";constructor(t){super({name:"DeveloperUserAlreadyRegisteredException",$fault:"client",...t}),Object.setPrototypeOf(this,B.prototype)}}class V extends E{name="ConcurrentModificationException";$fault="client";constructor(t){super({name:"ConcurrentModificationException",$fault:"client",...t}),Object.setPrototypeOf(this,V.prototype)}}const Xe="AccountId",Ye="AccessKeyId",ge="Credentials",et="ConcurrentModificationException",tt="CustomRoleArn",st="DeveloperUserAlreadyRegisteredException",it="Expiration",rt="ExternalServiceException",ot="GetCredentialsForIdentity",nt="GetCredentialsForIdentityInput",at="GetCredentialsForIdentityResponse",ct="GetId",ut="GetIdInput",pt="GetIdResponse",dt="InternalErrorException",q="IdentityId",lt="InvalidIdentityPoolConfigurationException",ft="InvalidParameterException",gt="IdentityPoolId",ht="IdentityProviderToken",he="Logins",mt="LimitExceededException",yt="LoginsMap",St="NotAuthorizedException",Et="ResourceConflictException",wt="ResourceNotFoundException",It="SecretKey",xt="SecretKeyString",bt="SessionToken",Ct="TooManyRequestsException",P="client",x="error",R="httpError",b="message",Pt="server",me="smithy.ts.sdk.synthetic.com.amazonaws.cognitoidentity",u="com.amazonaws.cognitoidentity";var Rt=[0,u,ht,8,0],At=[0,u,xt,8,0],_t=[-3,u,et,{[x]:P,[R]:400},[b],[0]];i.TypeRegistry.for(u).registerError(_t,V);var kt=[3,u,ge,0,[Ye,It,bt,it],[0,[()=>At,0],0,4]],vt=[-3,u,st,{[x]:P,[R]:400},[b],[0]];i.TypeRegistry.for(u).registerError(vt,B);var Tt=[-3,u,rt,{[x]:P,[R]:400},[b],[0]];i.TypeRegistry.for(u).registerError(Tt,H);var Dt=[3,u,nt,0,[q,he,tt],[0,[()=>ye,0],0],1],Ot=[3,u,at,0,[q,ge],[0,[()=>kt,0]]],Nt=[3,u,ut,0,[gt,Xe,he],[0,0,[()=>ye,0]],1],Ft=[3,u,pt,0,[q],[0]],$t=[-3,u,dt,{[x]:Pt},[b],[0]];i.TypeRegistry.for(u).registerError($t,$);var Mt=[-3,u,lt,{[x]:P,[R]:400},[b],[0]];i.TypeRegistry.for(u).registerError(Mt,J);var Ut=[-3,u,ft,{[x]:P,[R]:400},[b],[0]];i.TypeRegistry.for(u).registerError(Ut,M);var zt=[-3,u,mt,{[x]:P,[R]:400},[b],[0]];i.TypeRegistry.for(u).registerError(zt,U);var jt=[-3,u,St,{[x]:P,[R]:403},[b],[0]];i.TypeRegistry.for(u).registerError(jt,z);var Gt=[-3,u,Et,{[x]:P,[R]:409},[b],[0]];i.TypeRegistry.for(u).registerError(Gt,j);var Lt=[-3,u,wt,{[x]:P,[R]:404},[b],[0]];i.TypeRegistry.for(u).registerError(Lt,L);var Ht=[-3,u,Ct,{[x]:P,[R]:429},[b],[0]];i.TypeRegistry.for(u).registerError(Ht,G);var Jt=[-3,me,"CognitoIdentityServiceException",0,[],[]];i.TypeRegistry.for(me).registerError(Jt,E);var ye=[2,u,yt,0,[0,0],[()=>Rt,0]],Bt=[9,u,ot,0,()=>Dt,()=>Ot],Vt=[9,u,ct,0,()=>Nt,()=>Ft];class qt extends i.Command.classBuilder().ep(ae).m(function(t,e,n,r){return[i.getEndpointPlugin(n,t.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").sc(Bt).build(){}class Wt extends i.Command.classBuilder().ep(ae).m(function(t,e,n,r){return[i.getEndpointPlugin(n,t.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").sc(Vt).build(){}exports.CognitoIdentityClient=Ze;exports.GetCredentialsForIdentityCommand=qt;exports.GetIdCommand=Wt;