@rechargeapps/storefront-client 1.3.0 → 1.3.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/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Script:
|
|
|
14
14
|
</head>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
NPM/Yarn
|
|
17
|
+
NPM/Yarn/Pnpm
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
20
|
npm install @rechargeapps/storefront-client
|
|
@@ -24,6 +24,10 @@ npm install @rechargeapps/storefront-client
|
|
|
24
24
|
yarn add @rechargeapps/storefront-client
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
```bash
|
|
28
|
+
pnpm add @rechargeapps/storefront-client
|
|
29
|
+
```
|
|
30
|
+
|
|
27
31
|
## Docs & examples
|
|
28
32
|
|
|
29
33
|
See our public documentation [here](https://storefront.rechargepayments.com/client/)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sources":["../../../src/utils/request.ts"],"sourcesContent":["import 'isomorphic-fetch';\n\nimport stringify from 'qs/lib/stringify';\n\nimport { Method, RequestHeaders, RequestOptions } from '../types';\nimport { getOptions } from './options';\nimport { RECHARGE_API_URL, RECHARGE_CDN_URL, SHOPIFY_APP_PROXY_URL } from '../constants/api';\nimport { Session } from '../types/session';\nimport { RechargeRequestError } from './error';\n\nfunction stringifyQuery(str: unknown): string {\n return stringify(str, {\n encode: false,\n indices: false,\n arrayFormat: 'comma',\n });\n}\n\nexport async function cdnRequest<T>(method: Method, url: string, requestOptions: RequestOptions = {}): Promise<T> {\n const opts = getOptions();\n return request(method, `${RECHARGE_CDN_URL(opts.environment)}/store/${opts.storeIdentifier}${url}`, requestOptions);\n}\n\nexport async function rechargeApiRequest<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {},\n session: Session\n): Promise<T> {\n const { environment, storeIdentifier, loginRetryFn } = getOptions();\n const token = session.apiToken;\n const rechargeBaseUrl = RECHARGE_API_URL(environment);\n const reqHeaders: RequestHeaders = {\n 'X-Recharge-Access-Token': token,\n 'X-Recharge-Version': '2021-11',\n ...(headers ? headers : {}),\n };\n\n const localQuery = {\n shop_url: storeIdentifier,\n ...(query as any),\n };\n\n try {\n // await to catch any errors\n return await request<T>(method, `${rechargeBaseUrl}${url}`, { id, query: localQuery, data, headers: reqHeaders });\n } catch (error: unknown) {\n if (loginRetryFn && error instanceof RechargeRequestError && error.status === 401) {\n // call loginRetryFn and retry request on 401\n return loginRetryFn().then(session => {\n if (session) {\n return request(method, `${rechargeBaseUrl}${url}`, {\n id,\n query: localQuery,\n data,\n headers: {\n ...reqHeaders,\n 'X-Recharge-Access-Token': session.apiToken,\n },\n });\n }\n throw error;\n });\n }\n throw error;\n }\n}\n\nexport async function shopifyAppProxyRequest<T>(\n method: Method,\n url: string,\n requestOptions: RequestOptions = {}\n): Promise<T> {\n return request(method, `${SHOPIFY_APP_PROXY_URL}${url}`, requestOptions);\n}\n\nexport async function request<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {}\n): Promise<T> {\n let reqUrl = url.trim();\n\n if (id) {\n reqUrl = [reqUrl, `${id}`.trim()].join('/');\n }\n\n if (query) {\n let exQuery;\n [reqUrl, exQuery] = reqUrl.split('?');\n const fullQuery = [exQuery, stringifyQuery(query)].join('&').replace(/^&/, '');\n reqUrl = `${reqUrl}${fullQuery ? `?${fullQuery}` : ''}`;\n }\n\n let reqBody;\n if (data && method !== 'get') {\n reqBody = JSON.stringify(data);\n }\n\n const reqHeaders: RequestHeaders = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-Recharge-App': 'storefront-client',\n ...(headers ? headers : {}),\n };\n\n const response = await fetch(reqUrl, {\n method,\n headers: reqHeaders,\n body: reqBody,\n
|
|
1
|
+
{"version":3,"file":"request.js","sources":["../../../src/utils/request.ts"],"sourcesContent":["import 'isomorphic-fetch';\n\nimport stringify from 'qs/lib/stringify';\n\nimport { Method, RequestHeaders, RequestOptions } from '../types';\nimport { getOptions } from './options';\nimport { RECHARGE_API_URL, RECHARGE_CDN_URL, SHOPIFY_APP_PROXY_URL } from '../constants/api';\nimport { Session } from '../types/session';\nimport { RechargeRequestError } from './error';\n\nfunction stringifyQuery(str: unknown): string {\n return stringify(str, {\n encode: false,\n indices: false,\n arrayFormat: 'comma',\n });\n}\n\nexport async function cdnRequest<T>(method: Method, url: string, requestOptions: RequestOptions = {}): Promise<T> {\n const opts = getOptions();\n return request(method, `${RECHARGE_CDN_URL(opts.environment)}/store/${opts.storeIdentifier}${url}`, requestOptions);\n}\n\nexport async function rechargeApiRequest<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {},\n session: Session\n): Promise<T> {\n const { environment, storeIdentifier, loginRetryFn } = getOptions();\n const token = session.apiToken;\n const rechargeBaseUrl = RECHARGE_API_URL(environment);\n const reqHeaders: RequestHeaders = {\n 'X-Recharge-Access-Token': token,\n 'X-Recharge-Version': '2021-11',\n ...(headers ? headers : {}),\n };\n\n const localQuery = {\n shop_url: storeIdentifier,\n ...(query as any),\n };\n\n try {\n // await to catch any errors\n return await request<T>(method, `${rechargeBaseUrl}${url}`, { id, query: localQuery, data, headers: reqHeaders });\n } catch (error: unknown) {\n if (loginRetryFn && error instanceof RechargeRequestError && error.status === 401) {\n // call loginRetryFn and retry request on 401\n return loginRetryFn().then(session => {\n if (session) {\n return request(method, `${rechargeBaseUrl}${url}`, {\n id,\n query: localQuery,\n data,\n headers: {\n ...reqHeaders,\n 'X-Recharge-Access-Token': session.apiToken,\n },\n });\n }\n throw error;\n });\n }\n throw error;\n }\n}\n\nexport async function shopifyAppProxyRequest<T>(\n method: Method,\n url: string,\n requestOptions: RequestOptions = {}\n): Promise<T> {\n return request(method, `${SHOPIFY_APP_PROXY_URL}${url}`, requestOptions);\n}\n\nexport async function request<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {}\n): Promise<T> {\n let reqUrl = url.trim();\n\n if (id) {\n reqUrl = [reqUrl, `${id}`.trim()].join('/');\n }\n\n if (query) {\n let exQuery;\n [reqUrl, exQuery] = reqUrl.split('?');\n const fullQuery = [exQuery, stringifyQuery(query)].join('&').replace(/^&/, '');\n reqUrl = `${reqUrl}${fullQuery ? `?${fullQuery}` : ''}`;\n }\n\n let reqBody;\n if (data && method !== 'get') {\n reqBody = JSON.stringify(data);\n }\n\n const reqHeaders: RequestHeaders = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-Recharge-App': 'storefront-client',\n ...(headers ? headers : {}),\n };\n\n const response = await fetch(reqUrl, {\n method,\n headers: reqHeaders,\n body: reqBody,\n });\n\n let result;\n try {\n result = await response.json();\n } catch (e) {\n // If we get here, it means we were a no content response.\n }\n\n if (!response.ok) {\n if (result && result.error) {\n throw new RechargeRequestError(result.error, response.status);\n } else if (result && result.errors) {\n throw new RechargeRequestError(JSON.stringify(result.errors), response.status);\n } else {\n throw new RechargeRequestError('A connection error occurred while making the request');\n }\n }\n\n return result as T;\n}\n"],"names":["stringify","getOptions","RECHARGE_CDN_URL","RECHARGE_API_URL","error","RechargeRequestError","SHOPIFY_APP_PROXY_URL"],"mappings":";;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,EAAE,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AACF,IAAI,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,UAAU,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAMlE,SAAS,cAAc,CAAC,GAAG,EAAE;AAC7B,EAAE,OAAOA,6BAAS,CAAC,GAAG,EAAE;AACxB,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,WAAW,EAAE,OAAO;AACxB,GAAG,CAAC,CAAC;AACL,CAAC;AACM,eAAe,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,EAAE,EAAE;AACnE,EAAE,MAAM,IAAI,GAAGC,kBAAU,EAAE,CAAC;AAC5B,EAAE,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,EAAEC,oBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;AACtH,CAAC;AACM,eAAe,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE;AAClG,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,GAAGD,kBAAU,EAAE,CAAC;AACtE,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC;AACjC,EAAE,MAAM,eAAe,GAAGE,oBAAgB,CAAC,WAAW,CAAC,CAAC;AACxD,EAAE,MAAM,UAAU,GAAG,cAAc,CAAC;AACpC,IAAI,yBAAyB,EAAE,KAAK;AACpC,IAAI,oBAAoB,EAAE,SAAS;AACnC,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AAC7B,EAAE,MAAM,UAAU,GAAG,cAAc,CAAC;AACpC,IAAI,QAAQ,EAAE,eAAe;AAC7B,GAAG,EAAE,KAAK,CAAC,CAAC;AACZ,EAAE,IAAI;AACN,IAAI,OAAO,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;AACnH,GAAG,CAAC,OAAOC,OAAK,EAAE;AAClB,IAAI,IAAI,YAAY,IAAIA,OAAK,YAAYC,0BAAoB,IAAID,OAAK,CAAC,MAAM,KAAK,GAAG,EAAE;AACvF,MAAM,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK;AAC/C,QAAQ,IAAI,QAAQ,EAAE;AACtB,UAAU,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;AAC7D,YAAY,EAAE;AACd,YAAY,KAAK,EAAE,UAAU;AAC7B,YAAY,IAAI;AAChB,YAAY,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE;AACnE,cAAc,yBAAyB,EAAE,QAAQ,CAAC,QAAQ;AAC1D,aAAa,CAAC;AACd,WAAW,CAAC,CAAC;AACb,SAAS;AACT,QAAQ,MAAMA,OAAK,CAAC;AACpB,OAAO,CAAC,CAAC;AACT,KAAK;AACL,IAAI,MAAMA,OAAK,CAAC;AAChB,GAAG;AACH,CAAC;AACM,eAAe,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,EAAE,EAAE;AAC/E,EAAE,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,EAAEE,yBAAqB,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;AAC3E,CAAC;AACM,eAAe,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE;AAC9E,EAAE,IAAI,MAAM,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;AAC1B,EAAE,IAAI,EAAE,EAAE;AACV,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChD,GAAG;AACH,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,IAAI,OAAO,CAAC;AAChB,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1C,IAAI,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnF,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5D,GAAG;AACH,EAAE,IAAI,OAAO,CAAC;AACd,EAAE,IAAI,IAAI,IAAI,MAAM,KAAK,KAAK,EAAE;AAChC,IAAI,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACnC,GAAG;AACH,EAAE,MAAM,UAAU,GAAG,cAAc,CAAC;AACpC,IAAI,MAAM,EAAE,kBAAkB;AAC9B,IAAI,cAAc,EAAE,kBAAkB;AACtC,IAAI,gBAAgB,EAAE,mBAAmB;AACzC,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AAC7B,EAAE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE;AACvC,IAAI,MAAM;AACV,IAAI,OAAO,EAAE,UAAU;AACvB,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG,CAAC,CAAC;AACL,EAAE,IAAI,MAAM,CAAC;AACb,EAAE,IAAI;AACN,IAAI,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AACnC,GAAG,CAAC,OAAO,CAAC,EAAE;AACd,GAAG;AACH,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;AACpB,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE;AAChC,MAAM,MAAM,IAAID,0BAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpE,KAAK,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACxC,MAAM,MAAM,IAAIA,0BAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;AACrF,KAAK,MAAM;AACX,MAAM,MAAM,IAAIA,0BAAoB,CAAC,sDAAsD,CAAC,CAAC;AAC7F,KAAK;AACL,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sources":["../../../src/utils/request.ts"],"sourcesContent":["import 'isomorphic-fetch';\n\nimport stringify from 'qs/lib/stringify';\n\nimport { Method, RequestHeaders, RequestOptions } from '../types';\nimport { getOptions } from './options';\nimport { RECHARGE_API_URL, RECHARGE_CDN_URL, SHOPIFY_APP_PROXY_URL } from '../constants/api';\nimport { Session } from '../types/session';\nimport { RechargeRequestError } from './error';\n\nfunction stringifyQuery(str: unknown): string {\n return stringify(str, {\n encode: false,\n indices: false,\n arrayFormat: 'comma',\n });\n}\n\nexport async function cdnRequest<T>(method: Method, url: string, requestOptions: RequestOptions = {}): Promise<T> {\n const opts = getOptions();\n return request(method, `${RECHARGE_CDN_URL(opts.environment)}/store/${opts.storeIdentifier}${url}`, requestOptions);\n}\n\nexport async function rechargeApiRequest<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {},\n session: Session\n): Promise<T> {\n const { environment, storeIdentifier, loginRetryFn } = getOptions();\n const token = session.apiToken;\n const rechargeBaseUrl = RECHARGE_API_URL(environment);\n const reqHeaders: RequestHeaders = {\n 'X-Recharge-Access-Token': token,\n 'X-Recharge-Version': '2021-11',\n ...(headers ? headers : {}),\n };\n\n const localQuery = {\n shop_url: storeIdentifier,\n ...(query as any),\n };\n\n try {\n // await to catch any errors\n return await request<T>(method, `${rechargeBaseUrl}${url}`, { id, query: localQuery, data, headers: reqHeaders });\n } catch (error: unknown) {\n if (loginRetryFn && error instanceof RechargeRequestError && error.status === 401) {\n // call loginRetryFn and retry request on 401\n return loginRetryFn().then(session => {\n if (session) {\n return request(method, `${rechargeBaseUrl}${url}`, {\n id,\n query: localQuery,\n data,\n headers: {\n ...reqHeaders,\n 'X-Recharge-Access-Token': session.apiToken,\n },\n });\n }\n throw error;\n });\n }\n throw error;\n }\n}\n\nexport async function shopifyAppProxyRequest<T>(\n method: Method,\n url: string,\n requestOptions: RequestOptions = {}\n): Promise<T> {\n return request(method, `${SHOPIFY_APP_PROXY_URL}${url}`, requestOptions);\n}\n\nexport async function request<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {}\n): Promise<T> {\n let reqUrl = url.trim();\n\n if (id) {\n reqUrl = [reqUrl, `${id}`.trim()].join('/');\n }\n\n if (query) {\n let exQuery;\n [reqUrl, exQuery] = reqUrl.split('?');\n const fullQuery = [exQuery, stringifyQuery(query)].join('&').replace(/^&/, '');\n reqUrl = `${reqUrl}${fullQuery ? `?${fullQuery}` : ''}`;\n }\n\n let reqBody;\n if (data && method !== 'get') {\n reqBody = JSON.stringify(data);\n }\n\n const reqHeaders: RequestHeaders = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-Recharge-App': 'storefront-client',\n ...(headers ? headers : {}),\n };\n\n const response = await fetch(reqUrl, {\n method,\n headers: reqHeaders,\n body: reqBody,\n
|
|
1
|
+
{"version":3,"file":"request.js","sources":["../../../src/utils/request.ts"],"sourcesContent":["import 'isomorphic-fetch';\n\nimport stringify from 'qs/lib/stringify';\n\nimport { Method, RequestHeaders, RequestOptions } from '../types';\nimport { getOptions } from './options';\nimport { RECHARGE_API_URL, RECHARGE_CDN_URL, SHOPIFY_APP_PROXY_URL } from '../constants/api';\nimport { Session } from '../types/session';\nimport { RechargeRequestError } from './error';\n\nfunction stringifyQuery(str: unknown): string {\n return stringify(str, {\n encode: false,\n indices: false,\n arrayFormat: 'comma',\n });\n}\n\nexport async function cdnRequest<T>(method: Method, url: string, requestOptions: RequestOptions = {}): Promise<T> {\n const opts = getOptions();\n return request(method, `${RECHARGE_CDN_URL(opts.environment)}/store/${opts.storeIdentifier}${url}`, requestOptions);\n}\n\nexport async function rechargeApiRequest<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {},\n session: Session\n): Promise<T> {\n const { environment, storeIdentifier, loginRetryFn } = getOptions();\n const token = session.apiToken;\n const rechargeBaseUrl = RECHARGE_API_URL(environment);\n const reqHeaders: RequestHeaders = {\n 'X-Recharge-Access-Token': token,\n 'X-Recharge-Version': '2021-11',\n ...(headers ? headers : {}),\n };\n\n const localQuery = {\n shop_url: storeIdentifier,\n ...(query as any),\n };\n\n try {\n // await to catch any errors\n return await request<T>(method, `${rechargeBaseUrl}${url}`, { id, query: localQuery, data, headers: reqHeaders });\n } catch (error: unknown) {\n if (loginRetryFn && error instanceof RechargeRequestError && error.status === 401) {\n // call loginRetryFn and retry request on 401\n return loginRetryFn().then(session => {\n if (session) {\n return request(method, `${rechargeBaseUrl}${url}`, {\n id,\n query: localQuery,\n data,\n headers: {\n ...reqHeaders,\n 'X-Recharge-Access-Token': session.apiToken,\n },\n });\n }\n throw error;\n });\n }\n throw error;\n }\n}\n\nexport async function shopifyAppProxyRequest<T>(\n method: Method,\n url: string,\n requestOptions: RequestOptions = {}\n): Promise<T> {\n return request(method, `${SHOPIFY_APP_PROXY_URL}${url}`, requestOptions);\n}\n\nexport async function request<T>(\n method: Method,\n url: string,\n { id, query, data, headers }: RequestOptions = {}\n): Promise<T> {\n let reqUrl = url.trim();\n\n if (id) {\n reqUrl = [reqUrl, `${id}`.trim()].join('/');\n }\n\n if (query) {\n let exQuery;\n [reqUrl, exQuery] = reqUrl.split('?');\n const fullQuery = [exQuery, stringifyQuery(query)].join('&').replace(/^&/, '');\n reqUrl = `${reqUrl}${fullQuery ? `?${fullQuery}` : ''}`;\n }\n\n let reqBody;\n if (data && method !== 'get') {\n reqBody = JSON.stringify(data);\n }\n\n const reqHeaders: RequestHeaders = {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n 'X-Recharge-App': 'storefront-client',\n ...(headers ? headers : {}),\n };\n\n const response = await fetch(reqUrl, {\n method,\n headers: reqHeaders,\n body: reqBody,\n });\n\n let result;\n try {\n result = await response.json();\n } catch (e) {\n // If we get here, it means we were a no content response.\n }\n\n if (!response.ok) {\n if (result && result.error) {\n throw new RechargeRequestError(result.error, response.status);\n } else if (result && result.errors) {\n throw new RechargeRequestError(JSON.stringify(result.errors), response.status);\n } else {\n throw new RechargeRequestError('A connection error occurred while making the request');\n }\n }\n\n return result as T;\n}\n"],"names":[],"mappings":";;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACzC,IAAI,iBAAiB,GAAG,MAAM,CAAC,yBAAyB,CAAC;AACzD,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AAChC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AAClC,MAAM,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACxC,EAAE,IAAI,mBAAmB;AACzB,IAAI,KAAK,IAAI,IAAI,IAAI,mBAAmB,CAAC,CAAC,CAAC,EAAE;AAC7C,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC;AACpC,QAAQ,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAC1C,KAAK;AACL,EAAE,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AACF,IAAI,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,UAAU,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC;AAMlE,SAAS,cAAc,CAAC,GAAG,EAAE;AAC7B,EAAE,OAAO,SAAS,CAAC,GAAG,EAAE;AACxB,IAAI,MAAM,EAAE,KAAK;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,WAAW,EAAE,OAAO;AACxB,GAAG,CAAC,CAAC;AACL,CAAC;AACM,eAAe,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,EAAE,EAAE;AACnE,EAAE,MAAM,IAAI,GAAG,UAAU,EAAE,CAAC;AAC5B,EAAE,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;AACtH,CAAC;AACM,eAAe,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE;AAClG,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,GAAG,UAAU,EAAE,CAAC;AACtE,EAAE,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC;AACjC,EAAE,MAAM,eAAe,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;AACxD,EAAE,MAAM,UAAU,GAAG,cAAc,CAAC;AACpC,IAAI,yBAAyB,EAAE,KAAK;AACpC,IAAI,oBAAoB,EAAE,SAAS;AACnC,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AAC7B,EAAE,MAAM,UAAU,GAAG,cAAc,CAAC;AACpC,IAAI,QAAQ,EAAE,eAAe;AAC7B,GAAG,EAAE,KAAK,CAAC,CAAC;AACZ,EAAE,IAAI;AACN,IAAI,OAAO,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;AACnH,GAAG,CAAC,OAAO,KAAK,EAAE;AAClB,IAAI,IAAI,YAAY,IAAI,KAAK,YAAY,oBAAoB,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE;AACvF,MAAM,OAAO,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK;AAC/C,QAAQ,IAAI,QAAQ,EAAE;AACtB,UAAU,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE;AAC7D,YAAY,EAAE;AACd,YAAY,KAAK,EAAE,UAAU;AAC7B,YAAY,IAAI;AAChB,YAAY,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,EAAE,EAAE,UAAU,CAAC,EAAE;AACnE,cAAc,yBAAyB,EAAE,QAAQ,CAAC,QAAQ;AAC1D,aAAa,CAAC;AACd,WAAW,CAAC,CAAC;AACb,SAAS;AACT,QAAQ,MAAM,KAAK,CAAC;AACpB,OAAO,CAAC,CAAC;AACT,KAAK;AACL,IAAI,MAAM,KAAK,CAAC;AAChB,GAAG;AACH,CAAC;AACM,eAAe,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,cAAc,GAAG,EAAE,EAAE;AAC/E,EAAE,OAAO,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,qBAAqB,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;AAC3E,CAAC;AACM,eAAe,OAAO,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE;AAC9E,EAAE,IAAI,MAAM,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;AAC1B,EAAE,IAAI,EAAE,EAAE;AACV,IAAI,MAAM,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAChD,GAAG;AACH,EAAE,IAAI,KAAK,EAAE;AACb,IAAI,IAAI,OAAO,CAAC;AAChB,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAC1C,IAAI,MAAM,SAAS,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACnF,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAC5D,GAAG;AACH,EAAE,IAAI,OAAO,CAAC;AACd,EAAE,IAAI,IAAI,IAAI,MAAM,KAAK,KAAK,EAAE;AAChC,IAAI,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;AACnC,GAAG;AACH,EAAE,MAAM,UAAU,GAAG,cAAc,CAAC;AACpC,IAAI,MAAM,EAAE,kBAAkB;AAC9B,IAAI,cAAc,EAAE,kBAAkB;AACtC,IAAI,gBAAgB,EAAE,mBAAmB;AACzC,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,EAAE,CAAC,CAAC;AAC7B,EAAE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE;AACvC,IAAI,MAAM;AACV,IAAI,OAAO,EAAE,UAAU;AACvB,IAAI,IAAI,EAAE,OAAO;AACjB,GAAG,CAAC,CAAC;AACL,EAAE,IAAI,MAAM,CAAC;AACb,EAAE,IAAI;AACN,IAAI,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AACnC,GAAG,CAAC,OAAO,CAAC,EAAE;AACd,GAAG;AACH,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;AACpB,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,KAAK,EAAE;AAChC,MAAM,MAAM,IAAI,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpE,KAAK,MAAM,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE;AACxC,MAAM,MAAM,IAAI,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;AACrF,KAAK,MAAM;AACX,MAAM,MAAM,IAAI,oBAAoB,CAAC,sDAAsD,CAAC,CAAC;AAC7F,KAAK;AACL,GAAG;AACH,EAAE,OAAO,MAAM,CAAC;AAChB;;;;"}
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
// recharge-client-1.3.
|
|
2
|
-
(function(
|
|
3
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}Pi.call(_e.prototype);function Y(r,e){if(!(this instanceof Y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new D(e.headers),this.url=e.url||"",this._initBody(r)}Pi.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},Y.error=function(){var r=new Y(null,{status:0,statusText:""});return r.type="error",r};var vf=[301,302,303,307,308];Y.redirect=function(r,e){if(vf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new Y(null,{status:e,headers:{location:r}})};var me=L.DOMException;try{new me}catch{me=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},me.prototype=Object.create(Error.prototype),me.prototype.constructor=me}function Ii(r,e){return new Promise(function(t,n){var i=new _e(r,e);if(i.signal&&i.signal.aborted)return n(new me("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:yf(a.getAllResponseHeaders()||"")};f.url="responseURL"in a?a.responseURL:f.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new Y(c,f))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new me("Aborted","AbortError"))},0)};function s(f){try{return f===""&&L.location.href?L.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(k.blob?a.responseType="blob":k.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof D)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,kt(e.headers[f]))}):i.headers.forEach(function(f,c){a.setRequestHeader(c,f)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Ii.polyfill=!0,L.fetch||(L.fetch=Ii,L.Headers=D,L.Request=_e,L.Response=Y),self.fetch.bind(self);var gf=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Ti=typeof Symbol<"u"&&Symbol,_f=gf,mf=function(){return typeof Ti!="function"||typeof Symbol!="function"||typeof Ti("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_f()},wf="Function.prototype.bind called on incompatible ",Wt=Array.prototype.slice,bf=Object.prototype.toString,$f="[object Function]",Af=function(e){var t=this;if(typeof t!="function"||bf.call(t)!==$f)throw new TypeError(wf+t);for(var n=Wt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Wt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Wt.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},Ef=Af,Vt=Function.prototype.bind||Ef,Of=Vt,Sf=Of.call(Function.call,Object.prototype.hasOwnProperty),T,Fe=SyntaxError,xi=Function,Me=TypeError,Ht=function(r){try{return xi('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var zt=function(){throw new Me},Pf=we?function(){try{return arguments.callee,zt}catch{try{return we(arguments,"callee").get}catch{return zt}}}():zt,De=mf(),pe=Object.getPrototypeOf||function(r){return r.__proto__},Be={},If=typeof Uint8Array>"u"?T:pe(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":De?pe([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":Be,"%AsyncGenerator%":Be,"%AsyncGeneratorFunction%":Be,"%AsyncIteratorPrototype%":Be,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":xi,"%GeneratorFunction%":Be,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De?pe(pe([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De?T:pe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De?T:pe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De?pe(""[Symbol.iterator]()):T,"%Symbol%":De?Symbol:T,"%SyntaxError%":Fe,"%ThrowTypeError%":Pf,"%TypedArray%":If,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet},Tf=function r(e){var t;if(e==="%AsyncFunction%")t=Ht("async function () {}");else if(e==="%GeneratorFunction%")t=Ht("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Ht("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=pe(i.prototype))}return Ne[e]=t,t},Ri={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Je=Vt,xr=Sf,xf=Je.call(Function.call,Array.prototype.concat),Rf=Je.call(Function.apply,Array.prototype.splice),Fi=Je.call(Function.call,String.prototype.replace),Rr=Je.call(Function.call,String.prototype.slice),Ff=Je.call(Function.call,RegExp.prototype.exec),Mf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Df=/\\(\\)?/g,Bf=function(e){var t=Rr(e,0,1),n=Rr(e,-1);if(t==="%"&&n!=="%")throw new Fe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Fe("invalid intrinsic syntax, expected opening `%`");var i=[];return Fi(e,Mf,function(a,o,s,f){i[i.length]=s?Fi(f,Df,"$1"):o||a}),i},Nf=function(e,t){var n=e,i;if(xr(Ri,n)&&(i=Ri[n],n="%"+i[0]+"%"),xr(Ne,n)){var a=Ne[n];if(a===Be&&(a=Tf(n)),typeof a>"u"&&!t)throw new Me("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Fe("intrinsic "+e+" does not exist!")},Xt=function(e,t){if(typeof e!="string"||e.length===0)throw new Me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Me('"allowMissing" argument must be a boolean');if(Ff(/^%?[^%]*%?$/,e)===null)throw new Fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Bf(e),i=n.length>0?n[0]:"",a=Nf("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],Rf(n,xf([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var p=n[l],d=Rr(p,0,1),_=Rr(p,-1);if((d==='"'||d==="'"||d==="`"||_==='"'||_==="'"||_==="`")&&d!==_)throw new Fe("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(f=!0),i+="."+p,o="%"+i+"%",xr(Ne,o))s=Ne[o];else if(s!=null){if(!(p in s)){if(!t)throw new Me("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&l+1>=n.length){var $=we(s,p);u=!!$,u&&"get"in $&&!("originalValue"in $.get)?s=$.get:s=s[p]}else u=xr(s,p),s=s[p];u&&!f&&(Ne[o]=s)}}return s},Mi={exports:{}};(function(r){var e=Vt,t=Xt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var p=a(e,i,arguments);if(o&&s){var d=o(p,"length");d.configurable&&s(p,"length",{value:1+f(0,u.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(Mi);var Di=Xt,Bi=Mi.exports,Uf=Bi(Di("String.prototype.indexOf")),Cf=function(e,t){var n=Di(e,!!t);return typeof n=="function"&&Uf(e,".prototype.")>-1?Bi(n):n},Ue=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},K=[],W=[],Lf=typeof Uint8Array<"u"?Uint8Array:Array,Yt=!1;function Ni(){Yt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)K[e]=r[e],W[r.charCodeAt(e)]=e;W["-".charCodeAt(0)]=62,W["_".charCodeAt(0)]=63}function jf(r){Yt||Ni();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Lf(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=W[r.charCodeAt(e)]<<18|W[r.charCodeAt(e+1)]<<12|W[r.charCodeAt(e+2)]<<6|W[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=W[r.charCodeAt(e)]<<2|W[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=W[r.charCodeAt(e)]<<10|W[r.charCodeAt(e+1)]<<4|W[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function kf(r){return K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}function qf(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(kf(n));return i.join("")}function Ui(r){Yt||Ni();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(qf(r,s,s+o>f?f:s+o));return n===1?(e=r[t-1],i+=K[e>>2],i+=K[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=K[e>>10],i+=K[e>>4&63],i+=K[e<<2&63],i+="="),a.push(i),a.join("")}function Fr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>1,l=-7,u=t?i-1:0,p=t?-1:1,d=r[e+u];for(u+=p,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=a*256+r[e+u],u+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=p,l-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(d?-1:1)*o*Math.pow(2,a-n)}function Ci(r,e,t,n,i,a){var o,s,f,c=a*8-i-1,l=(1<<c)-1,u=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,_=n?1:-1,$=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=p/f:e+=p*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=s&255,d+=_,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+d]=o&255,d+=_,o/=256,c-=8);r[t+d-_]|=$*128}var Gf={}.toString,Li=Array.isArray||function(r){return Gf.call(r)=="[object Array]"};/*!
|
|
1
|
+
// recharge-client-1.3.1.min.js | MIT License | © Recharge Inc.
|
|
2
|
+
(function($e,vr){typeof exports=="object"&&typeof module<"u"?module.exports=vr():typeof define=="function"&&define.amd?define(vr):($e=typeof globalThis<"u"?globalThis:$e||self,$e.recharge=vr())})(this,function(){"use strict";var $e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vr(e){var r=e.default;if(typeof r=="function"){var t=function(){return r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}var Z=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Z<"u"&&Z,ne={searchParams:"URLSearchParams"in Z,iterable:"Symbol"in Z&&"iterator"in Symbol,blob:"FileReader"in Z&&"Blob"in Z&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Z,arrayBuffer:"ArrayBuffer"in Z};function Rs(e){return e&&DataView.prototype.isPrototypeOf(e)}if(ne.arrayBuffer)var Fs=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Cs=ArrayBuffer.isView||function(e){return e&&Fs.indexOf(Object.prototype.toString.call(e))>-1};function mr(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Bt(e){return typeof e!="string"&&(e=String(e)),e}function Pt(e){var r={next:function(){var t=e.shift();return{done:t===void 0,value:t}}};return ne.iterable&&(r[Symbol.iterator]=function(){return r}),r}function W(e){this.map={},e instanceof W?e.forEach(function(r,t){this.append(t,r)},this):Array.isArray(e)?e.forEach(function(r){this.append(r[0],r[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(r){this.append(r,e[r])},this)}W.prototype.append=function(e,r){e=mr(e),r=Bt(r);var t=this.map[e];this.map[e]=t?t+", "+r:r},W.prototype.delete=function(e){delete this.map[mr(e)]},W.prototype.get=function(e){return e=mr(e),this.has(e)?this.map[e]:null},W.prototype.has=function(e){return this.map.hasOwnProperty(mr(e))},W.prototype.set=function(e,r){this.map[mr(e)]=Bt(r)},W.prototype.forEach=function(e,r){for(var t in this.map)this.map.hasOwnProperty(t)&&e.call(r,this.map[t],t,this)},W.prototype.keys=function(){var e=[];return this.forEach(function(r,t){e.push(t)}),Pt(e)},W.prototype.values=function(){var e=[];return this.forEach(function(r){e.push(r)}),Pt(e)},W.prototype.entries=function(){var e=[];return this.forEach(function(r,t){e.push([t,r])}),Pt(e)},ne.iterable&&(W.prototype[Symbol.iterator]=W.prototype.entries);function Rt(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Zn(e){return new Promise(function(r,t){e.onload=function(){r(e.result)},e.onerror=function(){t(e.error)}})}function Us(e){var r=new FileReader,t=Zn(r);return r.readAsArrayBuffer(e),t}function Ds(e){var r=new FileReader,t=Zn(r);return r.readAsText(e),t}function Ns(e){for(var r=new Uint8Array(e),t=new Array(r.length),n=0;n<r.length;n++)t[n]=String.fromCharCode(r[n]);return t.join("")}function ei(e){if(e.slice)return e.slice(0);var r=new Uint8Array(e.byteLength);return r.set(new Uint8Array(e)),r.buffer}function ri(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:ne.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:ne.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:ne.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():ne.arrayBuffer&&ne.blob&&Rs(e)?(this._bodyArrayBuffer=ei(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ne.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||Cs(e))?this._bodyArrayBuffer=ei(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):ne.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},ne.blob&&(this.blob=function(){var e=Rt(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Rt(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(Us)}),this.text=function(){var e=Rt(this);if(e)return e;if(this._bodyBlob)return Ds(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ns(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},ne.formData&&(this.formData=function(){return this.text().then(js)}),this.json=function(){return this.text().then(JSON.parse)},this}var Ms=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ls(e){var r=e.toUpperCase();return Ms.indexOf(r)>-1?r:e}function Le(e,r){if(!(this instanceof Le))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');r=r||{};var t=r.body;if(e instanceof Le){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,r.headers||(this.headers=new W(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!t&&e._bodyInit!=null&&(t=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=r.credentials||this.credentials||"same-origin",(r.headers||!this.headers)&&(this.headers=new W(r.headers)),this.method=Ls(r.method||this.method||"GET"),this.mode=r.mode||this.mode||null,this.signal=r.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(r.cache==="no-store"||r.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var a=/\?/;this.url+=(a.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Le.prototype.clone=function(){return new Le(this,{body:this._bodyInit})};function js(e){var r=new FormData;return e.trim().split("&").forEach(function(t){if(t){var n=t.split("="),a=n.shift().replace(/\+/g," "),s=n.join("=").replace(/\+/g," ");r.append(decodeURIComponent(a),decodeURIComponent(s))}}),r}function ks(e){var r=new W,t=e.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
|
|
3
|
+
`)===0?n.substr(1,n.length):n}).forEach(function(n){var a=n.split(":"),s=a.shift().trim();if(s){var c=a.join(":").trim();r.append(s,c)}}),r}ri.call(Le.prototype);function de(e,r){if(!(this instanceof de))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');r||(r={}),this.type="default",this.status=r.status===void 0?200:r.status,this.ok=this.status>=200&&this.status<300,this.statusText=r.statusText===void 0?"":""+r.statusText,this.headers=new W(r.headers),this.url=r.url||"",this._initBody(e)}ri.call(de.prototype),de.prototype.clone=function(){return new de(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new W(this.headers),url:this.url})},de.error=function(){var e=new de(null,{status:0,statusText:""});return e.type="error",e};var Gs=[301,302,303,307,308];de.redirect=function(e,r){if(Gs.indexOf(r)===-1)throw new RangeError("Invalid status code");return new de(null,{status:r,headers:{location:e}})};var je=Z.DOMException;try{new je}catch{je=function(r,t){this.message=r,this.name=t;var n=Error(r);this.stack=n.stack},je.prototype=Object.create(Error.prototype),je.prototype.constructor=je}function ti(e,r){return new Promise(function(t,n){var a=new Le(e,r);if(a.signal&&a.signal.aborted)return n(new je("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var h={status:s.status,statusText:s.statusText,headers:ks(s.getAllResponseHeaders()||"")};h.url="responseURL"in s?s.responseURL:h.headers.get("X-Request-URL");var v="response"in s?s.response:s.responseText;setTimeout(function(){t(new de(v,h))},0)},s.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.onabort=function(){setTimeout(function(){n(new je("Aborted","AbortError"))},0)};function p(h){try{return h===""&&Z.location.href?Z.location.href:h}catch{return h}}s.open(a.method,p(a.url),!0),a.credentials==="include"?s.withCredentials=!0:a.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(ne.blob?s.responseType="blob":ne.arrayBuffer&&a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(s.responseType="arraybuffer")),r&&typeof r.headers=="object"&&!(r.headers instanceof W)?Object.getOwnPropertyNames(r.headers).forEach(function(h){s.setRequestHeader(h,Bt(r.headers[h]))}):a.headers.forEach(function(h,v){s.setRequestHeader(v,h)}),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){s.readyState===4&&a.signal.removeEventListener("abort",c)}),s.send(typeof a._bodyInit>"u"?null:a._bodyInit)})}ti.polyfill=!0,Z.fetch||(Z.fetch=ti,Z.Headers=W,Z.Request=Le,Z.Response=de),self.fetch.bind(self);var Ws=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;r[t]=a;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var s=Object.getOwnPropertySymbols(r);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(r,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0},ni=typeof Symbol<"u"&&Symbol,qs=Ws,zs=function(){return typeof ni!="function"||typeof Symbol!="function"||typeof ni("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:qs()},ii={foo:{}},Vs=Object,Hs=function(){return{__proto__:ii}.foo===ii.foo&&!({__proto__:null}instanceof Vs)},Ys="Function.prototype.bind called on incompatible ",Ft=Array.prototype.slice,Ks=Object.prototype.toString,Xs="[object Function]",Js=function(r){var t=this;if(typeof t!="function"||Ks.call(t)!==Xs)throw new TypeError(Ys+t);for(var n=Ft.call(arguments,1),a,s=function(){if(this instanceof a){var _=t.apply(this,n.concat(Ft.call(arguments)));return Object(_)===_?_:this}else return t.apply(r,n.concat(Ft.call(arguments)))},c=Math.max(0,t.length-n.length),p=[],h=0;h<c;h++)p.push("$"+h);if(a=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var v=function(){};v.prototype=t.prototype,a.prototype=new v,v.prototype=null}return a},Qs=Js,Ct=Function.prototype.bind||Qs,Zs=Ct,eu=Zs.call(Function.call,Object.prototype.hasOwnProperty),U,Qe=SyntaxError,oi=Function,Ze=TypeError,Ut=function(e){try{return oi('"use strict"; return ('+e+").constructor;")()}catch{}},ke=Object.getOwnPropertyDescriptor;if(ke)try{ke({},"")}catch{ke=null}var Dt=function(){throw new Ze},ru=ke?function(){try{return arguments.callee,Dt}catch{try{return ke(arguments,"callee").get}catch{return Dt}}}():Dt,er=zs(),tu=Hs(),Y=Object.getPrototypeOf||(tu?function(e){return e.__proto__}:null),rr={},nu=typeof Uint8Array>"u"||!Y?U:Y(Uint8Array),Ge={"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":er&&Y?Y([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":rr,"%AsyncGenerator%":rr,"%AsyncGeneratorFunction%":rr,"%AsyncIteratorPrototype%":rr,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":oi,"%GeneratorFunction%":rr,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":er&&Y?Y(Y([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!er||!Y?U:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!er||!Y?U:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":er&&Y?Y(""[Symbol.iterator]()):U,"%Symbol%":er?Symbol:U,"%SyntaxError%":Qe,"%ThrowTypeError%":ru,"%TypedArray%":nu,"%TypeError%":Ze,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet};if(Y)try{null.error}catch(e){var iu=Y(Y(e));Ge["%Error.prototype%"]=iu}var ou=function e(r){var t;if(r==="%AsyncFunction%")t=Ut("async function () {}");else if(r==="%GeneratorFunction%")t=Ut("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=Ut("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&Y&&(t=Y(a.prototype))}return Ge[r]=t,t},ai={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_r=Ct,kr=eu,au=_r.call(Function.call,Array.prototype.concat),su=_r.call(Function.apply,Array.prototype.splice),si=_r.call(Function.call,String.prototype.replace),Gr=_r.call(Function.call,String.prototype.slice),uu=_r.call(Function.call,RegExp.prototype.exec),cu=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fu=/\\(\\)?/g,lu=function(r){var t=Gr(r,0,1),n=Gr(r,-1);if(t==="%"&&n!=="%")throw new Qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Qe("invalid intrinsic syntax, expected opening `%`");var a=[];return si(r,cu,function(s,c,p,h){a[a.length]=p?si(h,fu,"$1"):c||s}),a},pu=function(r,t){var n=r,a;if(kr(ai,n)&&(a=ai[n],n="%"+a[0]+"%"),kr(Ge,n)){var s=Ge[n];if(s===rr&&(s=ou(n)),typeof s>"u"&&!t)throw new Ze("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new Qe("intrinsic "+r+" does not exist!")},Nt=function(r,t){if(typeof r!="string"||r.length===0)throw new Ze("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Ze('"allowMissing" argument must be a boolean');if(uu(/^%?[^%]*%?$/,r)===null)throw new Qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=lu(r),a=n.length>0?n[0]:"",s=pu("%"+a+"%",t),c=s.name,p=s.value,h=!1,v=s.alias;v&&(a=v[0],su(n,au([0,1],v)));for(var _=1,w=!0;_<n.length;_+=1){var b=n[_],d=Gr(b,0,1),E=Gr(b,-1);if((d==='"'||d==="'"||d==="`"||E==='"'||E==="'"||E==="`")&&d!==E)throw new Qe("property names with quotes must have matching quotes");if((b==="constructor"||!w)&&(h=!0),a+="."+b,c="%"+a+"%",kr(Ge,c))p=Ge[c];else if(p!=null){if(!(b in p)){if(!t)throw new Ze("base intrinsic for "+r+" exists, but the property is not available.");return}if(ke&&_+1>=n.length){var x=ke(p,b);w=!!x,w&&"get"in x&&!("originalValue"in x.get)?p=x.get:p=p[b]}else w=kr(p,b),p=p[b];w&&!h&&(Ge[c]=p)}}return p},ui={exports:{}};(function(e){var r=Ct,t=Nt,n=t("%Function.prototype.apply%"),a=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||r.call(a,n),c=t("%Object.getOwnPropertyDescriptor%",!0),p=t("%Object.defineProperty%",!0),h=t("%Math.max%");if(p)try{p({},"a",{value:1})}catch{p=null}e.exports=function(w){var b=s(r,a,arguments);if(c&&p){var d=c(b,"length");d.configurable&&p(b,"length",{value:1+h(0,w.length-(arguments.length-1))})}return b};var v=function(){return s(r,n,arguments)};p?p(e.exports,"apply",{value:v}):e.exports.apply=v})(ui);var ci=Nt,fi=ui.exports,hu=fi(ci("String.prototype.indexOf")),du=function(r,t){var n=ci(r,!!t);return typeof n=="function"&&hu(r,".prototype.")>-1?fi(n):n},tr=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},ye=[],fe=[],yu=typeof Uint8Array<"u"?Uint8Array:Array,Mt=!1;function li(){Mt=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,t=e.length;r<t;++r)ye[r]=e[r],fe[e.charCodeAt(r)]=r;fe["-".charCodeAt(0)]=62,fe["_".charCodeAt(0)]=63}function gu(e){Mt||li();var r,t,n,a,s,c,p=e.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=e[p-2]==="="?2:e[p-1]==="="?1:0,c=new yu(p*3/4-s),n=s>0?p-4:p;var h=0;for(r=0,t=0;r<n;r+=4,t+=3)a=fe[e.charCodeAt(r)]<<18|fe[e.charCodeAt(r+1)]<<12|fe[e.charCodeAt(r+2)]<<6|fe[e.charCodeAt(r+3)],c[h++]=a>>16&255,c[h++]=a>>8&255,c[h++]=a&255;return s===2?(a=fe[e.charCodeAt(r)]<<2|fe[e.charCodeAt(r+1)]>>4,c[h++]=a&255):s===1&&(a=fe[e.charCodeAt(r)]<<10|fe[e.charCodeAt(r+1)]<<4|fe[e.charCodeAt(r+2)]>>2,c[h++]=a>>8&255,c[h++]=a&255),c}function vu(e){return ye[e>>18&63]+ye[e>>12&63]+ye[e>>6&63]+ye[e&63]}function mu(e,r,t){for(var n,a=[],s=r;s<t;s+=3)n=(e[s]<<16)+(e[s+1]<<8)+e[s+2],a.push(vu(n));return a.join("")}function pi(e){Mt||li();for(var r,t=e.length,n=t%3,a="",s=[],c=16383,p=0,h=t-n;p<h;p+=c)s.push(mu(e,p,p+c>h?h:p+c));return n===1?(r=e[t-1],a+=ye[r>>2],a+=ye[r<<4&63],a+="=="):n===2&&(r=(e[t-2]<<8)+e[t-1],a+=ye[r>>10],a+=ye[r>>4&63],a+=ye[r<<2&63],a+="="),s.push(a),s.join("")}function Wr(e,r,t,n,a){var s,c,p=a*8-n-1,h=(1<<p)-1,v=h>>1,_=-7,w=t?a-1:0,b=t?-1:1,d=e[r+w];for(w+=b,s=d&(1<<-_)-1,d>>=-_,_+=p;_>0;s=s*256+e[r+w],w+=b,_-=8);for(c=s&(1<<-_)-1,s>>=-_,_+=n;_>0;c=c*256+e[r+w],w+=b,_-=8);if(s===0)s=1-v;else{if(s===h)return c?NaN:(d?-1:1)*(1/0);c=c+Math.pow(2,n),s=s-v}return(d?-1:1)*c*Math.pow(2,s-n)}function hi(e,r,t,n,a,s){var c,p,h,v=s*8-a-1,_=(1<<v)-1,w=_>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,E=n?1:-1,x=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(p=isNaN(r)?1:0,c=_):(c=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+w>=1?r+=b/h:r+=b*Math.pow(2,1-w),r*h>=2&&(c++,h/=2),c+w>=_?(p=0,c=_):c+w>=1?(p=(r*h-1)*Math.pow(2,a),c=c+w):(p=r*Math.pow(2,w-1)*Math.pow(2,a),c=0));a>=8;e[t+d]=p&255,d+=E,p/=256,a-=8);for(c=c<<a|p,v+=a;v>0;e[t+d]=c&255,d+=E,c/=256,v-=8);e[t+d-E]|=x*128}var _u={}.toString,di=Array.isArray||function(e){return _u.call(e)=="[object Array]"};/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
5
5
|
*
|
|
6
6
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/var Wf=50;y.TYPED_ARRAY_SUPPORT=Ue.TYPED_ARRAY_SUPPORT!==void 0?Ue.TYPED_ARRAY_SUPPORT:!0,Mr();function Mr(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ie(r,e){if(Mr()<e)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=y.prototype):(r===null&&(r=new y(e)),r.length=e),r}function y(r,e,t){if(!y.TYPED_ARRAY_SUPPORT&&!(this instanceof y))return new y(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return Kt(this,r)}return ji(this,r,e,t)}y.poolSize=8192,y._augment=function(r){return r.__proto__=y.prototype,r};function ji(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?zf(r,e,t,n):typeof e=="string"?Hf(r,e,t):Xf(r,e)}y.from=function(r,e,t){return ji(null,r,e,t)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array);function ki(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Vf(r,e,t,n){return ki(e),e<=0?ie(r,e):t!==void 0?typeof n=="string"?ie(r,e).fill(t,n):ie(r,e).fill(t):ie(r,e)}y.alloc=function(r,e,t){return Vf(null,r,e,t)};function Kt(r,e){if(ki(e),r=ie(r,e<0?0:Jt(e)|0),!y.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}y.allocUnsafe=function(r){return Kt(null,r)},y.allocUnsafeSlow=function(r){return Kt(null,r)};function Hf(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!y.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=qi(e,t)|0;r=ie(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function Zt(r,e){var t=e.length<0?0:Jt(e.length)|0;r=ie(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function zf(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),y.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=y.prototype):r=Zt(r,e),r}function Xf(r,e){if(Z(e)){var t=Jt(e.length)|0;return r=ie(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||hc(e.length)?ie(r,0):Zt(r,e);if(e.type==="Buffer"&&Li(e.data))return Zt(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Jt(r){if(r>=Mr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Mr().toString(16)+" bytes");return r|0}y.isBuffer=dc;function Z(r){return!!(r!=null&&r._isBuffer)}y.compare=function(e,t){if(!Z(e)||!Z(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},y.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(e,t){if(!Li(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=y.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!Z(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function qi(r,e){if(Z(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Nr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Zi(r).length;default:if(n)return Nr(r).length;e=(""+e).toLowerCase(),n=!0}}y.byteLength=qi;function Yf(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return ac(this,e,t);case"utf8":case"utf-8":return Hi(this,e,t);case"ascii":return nc(this,e,t);case"latin1":case"binary":return ic(this,e,t);case"base64":return rc(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oc(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}y.prototype._isBuffer=!0;function be(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}y.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)be(this,t,t+1);return this},y.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)be(this,t,t+3),be(this,t+1,t+2);return this},y.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)be(this,t,t+7),be(this,t+1,t+6),be(this,t+2,t+5),be(this,t+3,t+4);return this},y.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Hi(this,0,e):Yf.apply(this,arguments)},y.prototype.equals=function(e){if(!Z(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},y.prototype.inspect=function(){var e="",t=Wf;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},y.prototype.compare=function(e,t,n,i,a){if(!Z(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,s=n-t,f=Math.min(o,s),c=this.slice(i,a),l=e.slice(t,n),u=0;u<f;++u)if(c[u]!==l[u]){o=c[u],s=l[u];break}return o<s?-1:s<o?1:0};function Gi(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=y.from(e,n)),Z(e))return e.length===0?-1:Wi(r,e,t,n,i);if(typeof e=="number")return e=e&255,y.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Wi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Wi(r,e,t,n,i){var a=1,o=r.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,s/=2,t/=2}function f(d,_){return a===1?d[_]:d.readUInt16BE(_*a)}var c;if(i){var l=-1;for(c=t;c<o;c++)if(f(r,c)===f(e,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===s)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+s>o&&(t=o-s),c=t;c>=0;c--){for(var u=!0,p=0;p<s;p++)if(f(r,c+p)!==f(e,p)){u=!1;break}if(u)return c}return-1}y.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},y.prototype.indexOf=function(e,t,n){return Gi(this,e,t,n,!0)},y.prototype.lastIndexOf=function(e,t,n){return Gi(this,e,t,n,!1)};function Kf(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(o*2,2),16);if(isNaN(s))return o;r[t+o]=s}return o}function Zf(r,e,t,n){return Ur(Nr(e,r.length-t),r,t,n)}function Vi(r,e,t,n){return Ur(lc(e),r,t,n)}function Jf(r,e,t,n){return Vi(r,e,t,n)}function Qf(r,e,t,n){return Ur(Zi(e),r,t,n)}function ec(r,e,t,n){return Ur(pc(e,r.length-t),r,t,n)}y.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t;if((n===void 0||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Kf(this,e,t,n);case"utf8":case"utf-8":return Zf(this,e,t,n);case"ascii":return Vi(this,e,t,n);case"latin1":case"binary":return Jf(this,e,t,n);case"base64":return Qf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ec(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rc(r,e,t){return e===0&&t===r.length?Ui(r):Ui(r.slice(e,t))}function Hi(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=t){var f,c,l,u;switch(s){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(u=(a&31)<<6|f&63,u>127&&(o=u));break;case 3:f=r[i+1],c=r[i+2],(f&192)===128&&(c&192)===128&&(u=(a&15)<<12|(f&63)<<6|c&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:f=r[i+1],c=r[i+2],l=r[i+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(u=(a&15)<<18|(f&63)<<12|(c&63)<<6|l&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return tc(n)}var zi=4096;function tc(r){var e=r.length;if(e<=zi)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=zi));return t}function nc(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function ic(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function ac(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",a=e;a<t;++a)i+=cc(r[a]);return i}function oc(r,e,t){for(var n=r.slice(e,t),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}y.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i;if(y.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=y.prototype;else{var a=t-e;i=new y(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function N(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},y.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},y.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},y.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},y.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},y.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},y.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},y.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},y.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=t,a=1,o=this[e+--i];i>0&&(a*=256);)o+=this[e+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},y.prototype.readInt8=function(e,t){return t||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},y.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},y.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},y.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},y.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},y.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),Fr(this,e,!0,23,4)},y.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),Fr(this,e,!1,23,4)},y.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),Fr(this,e,!0,52,8)},y.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),Fr(this,e,!1,52,8)};function q(r,e,t,n,i,a){if(!Z(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}y.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=1,s=0;for(this[t]=e&255;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},y.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=n-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},y.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,255,0),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Dr(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}y.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Dr(this,e,t,!0),t+2},y.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Dr(this,e,t,!1),t+2};function Br(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}y.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Br(this,e,t,!0),t+4},y.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Br(this,e,t,!1),t+4},y.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=0,s=1,f=0;for(this[t]=e&255;++o<n&&(s*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},y.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=n-1,s=1,f=0;for(this[t+o]=e&255;--o>=0&&(s*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},y.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,127,-128),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},y.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Dr(this,e,t,!0),t+2},y.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Dr(this,e,t,!1),t+2},y.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Br(this,e,t,!0),t+4},y.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Br(this,e,t,!1),t+4};function Xi(r,e,t,n,i,a){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Yi(r,e,t,n,i){return i||Xi(r,e,t,4),Ci(r,e,t,n,23,4),t+4}y.prototype.writeFloatLE=function(e,t,n){return Yi(this,e,t,!0,n)},y.prototype.writeFloatBE=function(e,t,n){return Yi(this,e,t,!1,n)};function Ki(r,e,t,n,i){return i||Xi(r,e,t,8),Ci(r,e,t,n,52,8),t+8}y.prototype.writeDoubleLE=function(e,t,n){return Ki(this,e,t,!0,n)},y.prototype.writeDoubleBE=function(e,t,n){return Ki(this,e,t,!1,n)},y.prototype.copy=function(e,t,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n,o;if(this===e&&n<t&&t<i)for(o=a-1;o>=0;--o)e[o+t]=this[o+n];else if(a<1e3||!y.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},y.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var a=e.charCodeAt(0);a<256&&(e=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!y.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var s=Z(e)?e:Nr(new y(e,i).toString()),f=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%f]}return this};var uc=/[^+\/0-9A-Za-z-_]/g;function sc(r){if(r=fc(r).replace(uc,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function fc(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function cc(r){return r<16?"0"+r.toString(16):r.toString(16)}function Nr(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function lc(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function pc(r,e){for(var t,n,i,a=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,i=t%256,a.push(i),a.push(n);return a}function Zi(r){return jf(sc(r))}function Ur(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function hc(r){return r!==r}function dc(r){return r!=null&&(!!r._isBuffer||Ji(r)||yc(r))}function Ji(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function yc(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ji(r.slice(0,0))}function Qi(){throw new Error("setTimeout has not been defined")}function ea(){throw new Error("clearTimeout has not been defined")}var he=Qi,de=ea;typeof Ue.setTimeout=="function"&&(he=setTimeout),typeof Ue.clearTimeout=="function"&&(de=clearTimeout);function ra(r){if(he===setTimeout)return setTimeout(r,0);if((he===Qi||!he)&&setTimeout)return he=setTimeout,setTimeout(r,0);try{return he(r,0)}catch{try{return he.call(null,r,0)}catch{return he.call(this,r,0)}}}function vc(r){if(de===clearTimeout)return clearTimeout(r);if((de===ea||!de)&&clearTimeout)return de=clearTimeout,clearTimeout(r);try{return de(r)}catch{try{return de.call(null,r)}catch{return de.call(this,r)}}}var ae=[],Ce=!1,$e,Cr=-1;function gc(){!Ce||!$e||(Ce=!1,$e.length?ae=$e.concat(ae):Cr=-1,ae.length&&ta())}function ta(){if(!Ce){var r=ra(gc);Ce=!0;for(var e=ae.length;e;){for($e=ae,ae=[];++Cr<e;)$e&&$e[Cr].run();Cr=-1,e=ae.length}$e=null,Ce=!1,vc(r)}}function _c(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ae.push(new na(r,e)),ae.length===1&&!Ce&&ra(ta)}function na(r,e){this.fun=r,this.array=e}na.prototype.run=function(){this.fun.apply(null,this.array)};var mc="browser",wc="browser",bc=!0,$c={},Ac=[],Ec="",Oc={},Sc={},Pc={};function Ae(){}var Ic=Ae,Tc=Ae,xc=Ae,Rc=Ae,Fc=Ae,Mc=Ae,Dc=Ae;function Bc(r){throw new Error("process.binding is not supported")}function Nc(){return"/"}function Uc(r){throw new Error("process.chdir is not supported")}function Cc(){return 0}var Le=Ue.performance||{},Lc=Le.now||Le.mozNow||Le.msNow||Le.oNow||Le.webkitNow||function(){return new Date().getTime()};function jc(r){var e=Lc.call(Le)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var kc=new Date;function qc(){var r=new Date,e=r-kc;return e/1e3}var Lr={nextTick:_c,title:mc,browser:bc,env:$c,argv:Ac,version:Ec,versions:Oc,on:Ic,addListener:Tc,once:xc,off:Rc,removeListener:Fc,removeAllListeners:Mc,emit:Dc,binding:Bc,cwd:Nc,chdir:Uc,umask:Cc,hrtime:jc,platform:wc,release:Sc,config:Pc,uptime:qc},Qt;typeof Object.create=="function"?Qt=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Qt=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var ia=Qt,Gc=/%[sdj%]/g;function jr(r){if(!er(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(J(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(Gc,function(s){if(s==="%%")return"%";if(t>=i)return s;switch(s){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return s}}),o=n[t];t<i;o=n[++t])Qe(o)||!Ee(o)?a+=" "+o:a+=" "+J(o);return a}function en(r,e){if(Q(Ue.process))return function(){return en(r,e).apply(this,arguments)};if(Lr.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Lr.throwDeprecation)throw new Error(e);Lr.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var kr={},rn;function aa(r){if(Q(rn)&&(rn=Lr.env.NODE_DEBUG||""),r=r.toUpperCase(),!kr[r])if(new RegExp("\\b"+r+"\\b","i").test(rn)){var e=0;kr[r]=function(){var t=jr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else kr[r]=function(){};return kr[r]}function J(r,e){var t={seen:[],stylize:Vc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Gr(e)?t.showHidden=e:e&&fn(t,e),Q(t.showHidden)&&(t.showHidden=!1),Q(t.depth)&&(t.depth=2),Q(t.colors)&&(t.colors=!1),Q(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Wc),qr(t,r,t.depth)}J.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},J.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Wc(r,e){var t=J.styles[e];return t?"\x1B["+J.colors[t][0]+"m"+r+"\x1B["+J.colors[t][1]+"m":r}function Vc(r,e){return r}function Hc(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function qr(r,e,t){if(r.customInspect&&e&&nr(e.inspect)&&e.inspect!==J&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return er(n)||(n=qr(r,n,t)),n}var i=zc(r,e);if(i)return i;var a=Object.keys(e),o=Hc(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),tr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return tn(e);if(a.length===0){if(nr(e)){var s=e.name?": "+e.name:"";return r.stylize("[Function"+s+"]","special")}if(rr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Wr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(tr(e))return tn(e)}var f="",c=!1,l=["{","}"];if(an(e)&&(c=!0,l=["[","]"]),nr(e)){var u=e.name?": "+e.name:"";f=" [Function"+u+"]"}if(rr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Wr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),tr(e)&&(f=" "+tn(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return rr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var p;return c?p=Xc(r,e,t,o,a):p=a.map(function(d){return nn(r,e,t,o,d,c)}),r.seen.pop(),Yc(p,f,l)}function zc(r,e){if(Q(e))return r.stylize("undefined","undefined");if(er(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(on(e))return r.stylize(""+e,"number");if(Gr(e))return r.stylize(""+e,"boolean");if(Qe(e))return r.stylize("null","null")}function tn(r){return"["+Error.prototype.toString.call(r)+"]"}function Xc(r,e,t,n,i){for(var a=[],o=0,s=e.length;o<s;++o)la(e,String(o))?a.push(nn(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(nn(r,e,t,n,f,!0))}),a}function nn(r,e,t,n,i,a){var o,s,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?s=r.stylize("[Getter/Setter]","special"):s=r.stylize("[Getter]","special"):f.set&&(s=r.stylize("[Setter]","special")),la(n,i)||(o="["+i+"]"),s||(r.seen.indexOf(f.value)<0?(Qe(t)?s=qr(r,f.value,null):s=qr(r,f.value,t-1),s.indexOf(`
|
|
9
|
-
`)>-1&&(
|
|
10
|
-
`).map(function(
|
|
11
|
-
`).substr(2):
|
|
12
|
-
`+
|
|
13
|
-
`).map(function(
|
|
14
|
-
`))):
|
|
15
|
-
`)>=0,
|
|
16
|
-
`)+" "+
|
|
17
|
-
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function an(r){return Array.isArray(r)}function Gr(r){return typeof r=="boolean"}function Qe(r){return r===null}function oa(r){return r==null}function on(r){return typeof r=="number"}function er(r){return typeof r=="string"}function ua(r){return typeof r=="symbol"}function Q(r){return r===void 0}function rr(r){return Ee(r)&&un(r)==="[object RegExp]"}function Ee(r){return typeof r=="object"&&r!==null}function Wr(r){return Ee(r)&&un(r)==="[object Date]"}function tr(r){return Ee(r)&&(un(r)==="[object Error]"||r instanceof Error)}function nr(r){return typeof r=="function"}function sa(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function fa(r){return y.isBuffer(r)}function un(r){return Object.prototype.toString.call(r)}function sn(r){return r<10?"0"+r.toString(10):r.toString(10)}var Kc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Zc(){var r=new Date,e=[sn(r.getHours()),sn(r.getMinutes()),sn(r.getSeconds())].join(":");return[r.getDate(),Kc[r.getMonth()],e].join(" ")}function ca(){console.log("%s - %s",Zc(),jr.apply(null,arguments))}function fn(r,e){if(!e||!Ee(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function la(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Jc={inherits:ia,_extend:fn,log:ca,isBuffer:fa,isPrimitive:sa,isFunction:nr,isError:tr,isDate:Wr,isObject:Ee,isRegExp:rr,isUndefined:Q,isSymbol:ua,isString:er,isNumber:on,isNullOrUndefined:oa,isNull:Qe,isBoolean:Gr,isArray:an,inspect:J,deprecate:en,format:jr,debuglog:aa},Qc=Object.freeze({__proto__:null,format:jr,deprecate:en,debuglog:aa,inspect:J,isArray:an,isBoolean:Gr,isNull:Qe,isNullOrUndefined:oa,isNumber:on,isString:er,isSymbol:ua,isUndefined:Q,isRegExp:rr,isObject:Ee,isDate:Wr,isError:tr,isFunction:nr,isPrimitive:sa,isBuffer:fa,log:ca,inherits:ia,_extend:fn,default:Jc}),el=Ke(Qc),rl=el.inspect,cn=typeof Map=="function"&&Map.prototype,ln=Object.getOwnPropertyDescriptor&&cn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Vr=cn&&ln&&typeof ln.get=="function"?ln.get:null,tl=cn&&Map.prototype.forEach,pn=typeof Set=="function"&&Set.prototype,hn=Object.getOwnPropertyDescriptor&&pn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=pn&&hn&&typeof hn.get=="function"?hn.get:null,nl=pn&&Set.prototype.forEach,il=typeof WeakMap=="function"&&WeakMap.prototype,ir=il?WeakMap.prototype.has:null,al=typeof WeakSet=="function"&&WeakSet.prototype,ar=al?WeakSet.prototype.has:null,ol=typeof WeakRef=="function"&&WeakRef.prototype,pa=ol?WeakRef.prototype.deref:null,ul=Boolean.prototype.valueOf,sl=Object.prototype.toString,fl=Function.prototype.toString,cl=String.prototype.match,dn=String.prototype.slice,ye=String.prototype.replace,ll=String.prototype.toUpperCase,ha=String.prototype.toLowerCase,da=RegExp.prototype.test,ya=Array.prototype.concat,ee=Array.prototype.join,pl=Array.prototype.slice,va=Math.floor,yn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,vn=Object.getOwnPropertySymbols,gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,je=typeof Symbol=="function"&&typeof Symbol.iterator=="object",j=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===je?"object":"symbol")?Symbol.toStringTag:null,ga=Object.prototype.propertyIsEnumerable,_a=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ma(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||da.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-va(-r):va(r);if(n!==r){var i=String(n),a=dn.call(e,i.length+1);return ye.call(i,t,"$&_")+"."+ye.call(ye.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ye.call(e,t,"$&_")}var _n=rl,wa=_n.custom,ba=Ea(wa)?wa:null,hl=function r(e,t,n,i){var a=t||{};if(ve(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ve(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=ve(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ve(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ve(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Sa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?ma(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?ma(e,c):c}var l=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return mn(e)?"[Array]":"[Object]";var u=Rl(a,n);if(typeof i>"u")i=[];else if(Oa(i,e)>=0)return"[Circular]";function p(H,te,X){if(te&&(i=pl.call(i),i.push(te)),X){var Re={depth:a.depth};return ve(a,"quoteStyle")&&(Re.quoteStyle=a.quoteStyle),r(H,Re,n+1,i)}return r(H,a,n+1,i)}if(typeof e=="function"&&!Aa(e)){var d=$l(e),_=zr(e,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(_.length>0?" { "+ee.call(_,", ")+" }":"")}if(Ea(e)){var $=je?ye.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):gn.call(e);return typeof e=="object"&&!je?or($):$}if(Il(e)){for(var b="<"+ha.call(String(e.nodeName)),w=e.attributes||[],A=0;A<w.length;A++)b+=" "+w[A].name+"="+$a(dl(w[A].value),"double",a);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+ha.call(String(e.nodeName))+">",b}if(mn(e)){if(e.length===0)return"[]";var h=zr(e,p);return u&&!xl(h)?"["+bn(h,u)+"]":"[ "+ee.call(h,", ")+" ]"}if(vl(e)){var P=zr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!ga.call(e,"cause")?"{ ["+String(e)+"] "+ee.call(ya.call("[cause]: "+p(e.cause),P),", ")+" }":P.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ee.call(P,", ")+" }"}if(typeof e=="object"&&o){if(ba&&typeof e[ba]=="function"&&_n)return _n(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Al(e)){var I=[];return tl.call(e,function(H,te){I.push(p(te,e,!0)+" => "+p(H,e))}),Pa("Map",Vr.call(e),I,u)}if(Sl(e)){var R=[];return nl.call(e,function(H){R.push(p(H,e))}),Pa("Set",Hr.call(e),R,u)}if(El(e))return wn("WeakMap");if(Pl(e))return wn("WeakSet");if(Ol(e))return wn("WeakRef");if(_l(e))return or(p(Number(e)));if(wl(e))return or(p(yn.call(e)));if(ml(e))return or(ul.call(e));if(gl(e))return or(p(String(e)));if(!yl(e)&&!Aa(e)){var m=zr(e,p),v=_a?_a(e)===Object.prototype:e instanceof Object||e.constructor===Object,g=e instanceof Object?"":"null prototype",O=!v&&j&&Object(e)===e&&j in e?dn.call(ge(e),8,-1):g?"Object":"",S=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",B=S+(O||g?"["+ee.call(ya.call([],O||[],g||[]),": ")+"] ":"");return m.length===0?B+"{}":u?B+"{"+bn(m,u)+"}":B+"{ "+ee.call(m,", ")+" }"}return String(e)};function $a(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function dl(r){return ye.call(String(r),/"/g,""")}function mn(r){return ge(r)==="[object Array]"&&(!j||!(typeof r=="object"&&j in r))}function yl(r){return ge(r)==="[object Date]"&&(!j||!(typeof r=="object"&&j in r))}function Aa(r){return ge(r)==="[object RegExp]"&&(!j||!(typeof r=="object"&&j in r))}function vl(r){return ge(r)==="[object Error]"&&(!j||!(typeof r=="object"&&j in r))}function gl(r){return ge(r)==="[object String]"&&(!j||!(typeof r=="object"&&j in r))}function _l(r){return ge(r)==="[object Number]"&&(!j||!(typeof r=="object"&&j in r))}function ml(r){return ge(r)==="[object Boolean]"&&(!j||!(typeof r=="object"&&j in r))}function Ea(r){if(je)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!gn)return!1;try{return gn.call(r),!0}catch{}return!1}function wl(r){if(!r||typeof r!="object"||!yn)return!1;try{return yn.call(r),!0}catch{}return!1}var bl=Object.prototype.hasOwnProperty||function(r){return r in this};function ve(r,e){return bl.call(r,e)}function ge(r){return sl.call(r)}function $l(r){if(r.name)return r.name;var e=cl.call(fl.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Oa(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function Al(r){if(!Vr||!r||typeof r!="object")return!1;try{Vr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function El(r){if(!ir||!r||typeof r!="object")return!1;try{ir.call(r,ir);try{ar.call(r,ar)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Ol(r){if(!pa||!r||typeof r!="object")return!1;try{return pa.call(r),!0}catch{}return!1}function Sl(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Vr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Pl(r){if(!ar||!r||typeof r!="object")return!1;try{ar.call(r,ar);try{ir.call(r,ir)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Il(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Sa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Sa(dn.call(r,0,e.maxStringLength),e)+n}var i=ye.call(ye.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Tl);return $a(i,"single",e)}function Tl(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+ll.call(e.toString(16))}function or(r){return"Object("+r+")"}function wn(r){return r+" { ? }"}function Pa(r,e,t,n){var i=n?bn(t,n):ee.call(t,", ");return r+" ("+e+") {"+i+"}"}function xl(r){for(var e=0;e<r.length;e++)if(Oa(r[e],`
|
|
18
|
-
`)>=0)return!1;return!0}function
|
|
19
|
-
`+
|
|
20
|
-
`+e.prev}function zr(r,e){var t=mn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ve(r,i)?e(r[i],r):""}var a=typeof vn=="function"?vn(r):[],o;if(je){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)!ve(r,f)||t&&String(Number(f))===f&&f<r.length||je&&o["$"+f]instanceof Symbol||(da.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof vn=="function")for(var c=0;c<a.length;c++)ga.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var $n=Xt,ke=Cf,Fl=hl,Ml=$n("%TypeError%"),Xr=$n("%WeakMap%",!0),Yr=$n("%Map%",!0),Dl=ke("WeakMap.prototype.get",!0),Bl=ke("WeakMap.prototype.set",!0),Nl=ke("WeakMap.prototype.has",!0),Ul=ke("Map.prototype.get",!0),Cl=ke("Map.prototype.set",!0),Ll=ke("Map.prototype.has",!0),An=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},jl=function(r,e){var t=An(r,e);return t&&t.value},kl=function(r,e,t){var n=An(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},ql=function(r,e){return!!An(r,e)},Gl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Ml("Side channel does not contain "+Fl(a))},get:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Dl(e,a)}else if(Yr){if(t)return Ul(t,a)}else if(n)return jl(n,a)},has:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Nl(e,a)}else if(Yr){if(t)return Ll(t,a)}else if(n)return ql(n,a);return!1},set:function(a,o){Xr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Xr),Bl(e,a,o)):Yr?(t||(t=new Yr),Cl(t,a,o)):(n||(n={key:{},next:null}),kl(n,a,o))}};return i},Wl=String.prototype.replace,Vl=/%20/g,En={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ia={default:En.RFC3986,formatters:{RFC1738:function(r){return Wl.call(r,Vl,"+")},RFC3986:function(r){return String(r)}},RFC1738:En.RFC1738,RFC3986:En.RFC3986},Hl=Ia,On=Object.prototype.hasOwnProperty,Oe=Array.isArray,re=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),zl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Oe(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Ta=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},Xl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Oe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!On.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return Oe(e)&&!Oe(t)&&(i=Ta(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(On.call(e,o)){var s=e[o];s&&typeof s=="object"&&a&&typeof a=="object"?e[o]=r(s,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var s=t[o];return On.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Yl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Kl=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Zl=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Hl.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+re[c];continue}if(c<2048){s=s+(re[192|c>>6]+re[128|c&63]);continue}if(c<55296||c>=57344){s=s+(re[224|c>>12]+re[128|c>>6&63]+re[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=re[240|c>>18]+re[128|c>>12&63]+re[128|c>>6&63]+re[128|c&63]}return s},Jl=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return zl(t),e},Ql=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},ep=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},rp=function(e,t){return[].concat(e,t)},tp=function(e,t){if(Oe(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},np={arrayToObject:Ta,assign:Yl,combine:rp,compact:Jl,decode:Kl,encode:Zl,isBuffer:ep,isRegExp:Ql,maybeMap:tp,merge:Xl},xa=Gl,Sn=np,ur=Ia,ip=Object.prototype.hasOwnProperty,Ra={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},oe=Array.isArray,ap=String.prototype.split,op=Array.prototype.push,Fa=function(r,e){op.apply(r,oe(e)?e:[e])},up=Date.prototype.toISOString,Ma=ur.default,C={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Sn.encode,encodeValuesOnly:!1,format:Ma,formatter:ur.formatters[Ma],indices:!1,serializeDate:function(e){return up.call(e)},skipNulls:!1,strictNullHandling:!1},sp=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Pn={},fp=function r(e,t,n,i,a,o,s,f,c,l,u,p,d,_,$,b){for(var w=e,A=b,h=0,P=!1;(A=A.get(Pn))!==void 0&&!P;){var I=A.get(e);if(h+=1,typeof I<"u"){if(I===h)throw new RangeError("Cyclic object value");P=!0}typeof A.get(Pn)>"u"&&(h=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=u(w):n==="comma"&&oe(w)&&(w=Sn.maybeMap(w,function(Ei){return Ei instanceof Date?u(Ei):Ei})),w===null){if(a)return s&&!_?s(t,C.encoder,$,"key",p):t;w=""}if(sp(w)||Sn.isBuffer(w)){if(s){var R=_?t:s(t,C.encoder,$,"key",p);if(n==="comma"&&_){for(var m=ap.call(String(w),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+d(s(m[g],C.encoder,$,"value",p));return[d(R)+(i&&oe(w)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(s(w,C.encoder,$,"value",p))]}return[d(t)+"="+d(String(w))]}var O=[];if(typeof w>"u")return O;var S;if(n==="comma"&&oe(w))S=[{value:w.length>0?w.join(",")||null:void 0}];else if(oe(f))S=f;else{var B=Object.keys(w);S=c?B.sort(c):B}for(var H=i&&oe(w)&&w.length===1?t+"[]":t,te=0;te<S.length;++te){var X=S[te],Re=typeof X=="object"&&typeof X.value<"u"?X.value:w[X];if(!(o&&Re===null)){var YR=oe(w)?typeof n=="function"?n(H,X):H:H+(l?"."+X:"["+X+"]");b.set(e,h);var af=xa();af.set(Pn,b),Fa(O,r(Re,YR,n,i,a,o,s,f,c,l,u,p,d,_,$,af))}}return O},cp=function(e){if(!e)return C;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||C.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=ur.default;if(typeof e.format<"u"){if(!ip.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=C.filter;return(typeof e.filter=="function"||oe(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:C.addQueryPrefix,allowDots:typeof e.allowDots>"u"?C.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:C.charsetSentinel,delimiter:typeof e.delimiter>"u"?C.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:C.encode,encoder:typeof e.encoder=="function"?e.encoder:C.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:C.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:C.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:C.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:C.strictNullHandling}},lp=function(r,e){var t=r,n=cp(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):oe(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in Ra?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=Ra[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=xa(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||Fa(o,fp(t[p],p,f,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var d=o.join(n.delimiter),_=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),d.length>0?_+d:""};let Da={storeIdentifier:"",environment:"prod"};function pp(r){Da=r}function ue(){return Da}const hp=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",In=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",dp=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",yp="/tools/recurring";class Kr{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}var vp=Object.defineProperty,gp=Object.defineProperties,_p=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,mp=Object.prototype.hasOwnProperty,wp=Object.prototype.propertyIsEnumerable,Na=(r,e,t)=>e in r?vp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zr=(r,e)=>{for(var t in e||(e={}))mp.call(e,t)&&Na(r,t,e[t]);if(Ba)for(var t of Ba(e))wp.call(e,t)&&Na(r,t,e[t]);return r},bp=(r,e)=>gp(r,_p(e));function $p(r){return lp(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Jr(r,e,t={}){const n=ue();return z(r,`${dp(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function E(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f,loginRetryFn:c}=ue(),l=o.apiToken,u=hp(s),p=Zr({"X-Recharge-Access-Token":l,"X-Recharge-Version":"2021-11"},a||{}),d=Zr({shop_url:f},n);try{return await z(r,`${u}${e}`,{id:t,query:d,data:i,headers:p})}catch(_){if(c&&_ instanceof Kr&&_.status===401)return c().then($=>{if($)return z(r,`${u}${e}`,{id:t,query:d,data:i,headers:bp(Zr({},p),{"X-Recharge-Access-Token":$.apiToken})});throw _});throw _}}async function sr(r,e,t={}){return z(r,`${yp}${e}`,t)}async function z(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const p=[u,$p(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=Zr({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Kr(l.error,c.status):l&&l.errors?new Kr(JSON.stringify(l.errors),c.status):new Kr("A connection error occurred while making the request");return l}function Ap(r,e){return E("get","/addresses",{query:e},r)}async function Ep(r,e,t){const{address:n}=await E("get","/addresses",{id:e,query:{include:t?.include}},r);return n}async function Op(r,e){const{address:t}=await E("post","/addresses",{data:e},r);return t}async function Tn(r,e,t){const{address:n}=await E("put","/addresses",{id:e,data:t},r);return n}async function Sp(r,e,t){return Tn(r,e,{discounts:[{code:t}]})}async function Pp(r,e){return Tn(r,e,{discounts:[]})}function Ip(r,e){return E("delete","/addresses",{id:e},r)}async function Tp(r,e){const{address:t}=await E("post","/addresses/merge",{data:e},r);return t}async function xp(r,e,t){const{charge:n}=await E("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Rp=Object.freeze({__proto__:null,listAddresses:Ap,getAddress:Ep,createAddress:Op,updateAddress:Tn,applyDiscountToAddress:Sp,removeDiscountsFromAddress:Pp,deleteAddress:Ip,mergeAddresses:Tp,skipFutureCharge:xp}),Fp=Object.defineProperty,Ua=Object.getOwnPropertySymbols,Mp=Object.prototype.hasOwnProperty,Dp=Object.prototype.propertyIsEnumerable,Ca=(r,e,t)=>e in r?Fp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,La=(r,e)=>{for(var t in e||(e={}))Mp.call(e,t)&&Ca(r,t,e[t]);if(Ua)for(var t of Ua(e))Dp.call(e,t)&&Ca(r,t,e[t]);return r};async function Bp(){const{storefrontAccessToken:r}=ue(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await sr("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function Np(r,e){const{environment:t,storefrontAccessToken:n,storeIdentifier:i}=ue(),a=In(t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const s=await z("post",`${a}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:i},headers:o});return s.api_token?{apiToken:s.api_token,customerId:s.customer_id}:null}async function Up(r,e={}){const{environment:t,storefrontAccessToken:n,storeIdentifier:i}=ue(),a=In(t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const s=await z("post",`${a}/attempt_login`,{data:La({email:r,shop:i},e),headers:o});if(s.errors)throw new Error(s.errors);return s.session_token}async function Cp(r,e={}){const{storefrontAccessToken:t,storeIdentifier:n}=ue(),i={};t&&(i["X-Recharge-Storefront-Access-Token"]=t);const a=await sr("post","/attempt_login",{data:La({email:r,shop:n},e),headers:i});if(a.errors)throw new Error(a.errors);return a.session_token}async function Lp(r,e,t){const{environment:n,storefrontAccessToken:i,storeIdentifier:a}=ue(),o=In(n),s={};i&&(s["X-Recharge-Storefront-Access-Token"]=i);const f=await z("post",`${o}/validate_login`,{data:{code:t,email:r,session_token:e,shop:a},headers:s});if(f.errors)throw new Error(f.errors);return{apiToken:f.api_token,customerId:f.customer_id}}async function jp(r,e,t){const{storefrontAccessToken:n,storeIdentifier:i}=ue(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const o=await sr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:i},headers:a});if(o.errors)throw new Error(o.errors);return{apiToken:o.api_token,customerId:o.customer_id}}var kp=Object.freeze({__proto__:null,loginShopifyAppProxy:Bp,loginShopifyApi:Np,sendPasswordlessCode:Up,sendPasswordlessCodeAppProxy:Cp,validatePasswordlessCode:Lp,validatePasswordlessCodeAppProxy:jp});let qp=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");function Gp(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var Qr=Gp;function Wp(){this.__data__=[],this.size=0}var Vp=Wp;function Hp(r,e){return r===e||r!==r&&e!==e}var et=Hp,zp=et;function Xp(r,e){for(var t=r.length;t--;)if(zp(r[t][0],e))return t;return-1}var rt=Xp,Yp=rt,Kp=Array.prototype,Zp=Kp.splice;function Jp(r){var e=this.__data__,t=Yp(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Zp.call(e,t,1),--this.size,!0}var Qp=Jp,eh=rt;function rh(r){var e=this.__data__,t=eh(e,r);return t<0?void 0:e[t][1]}var th=rh,nh=rt;function ih(r){return nh(this.__data__,r)>-1}var ah=ih,oh=rt;function uh(r,e){var t=this.__data__,n=oh(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var sh=uh,fh=Vp,ch=Qp,lh=th,ph=ah,hh=sh;function qe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}qe.prototype.clear=fh,qe.prototype.delete=ch,qe.prototype.get=lh,qe.prototype.has=ph,qe.prototype.set=hh;var tt=qe,dh=tt;function yh(){this.__data__=new dh,this.size=0}var vh=yh;function gh(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var _h=gh;function mh(r){return this.__data__.get(r)}var wh=mh;function bh(r){return this.__data__.has(r)}var $h=bh,Ah=typeof ne=="object"&&ne&&ne.Object===Object&&ne,ja=Ah,Eh=ja,Oh=typeof self=="object"&&self&&self.Object===Object&&self,Sh=Eh||Oh||Function("return this")(),G=Sh,Ph=G,Ih=Ph.Symbol,Ge=Ih,ka=Ge,qa=Object.prototype,Th=qa.hasOwnProperty,xh=qa.toString,fr=ka?ka.toStringTag:void 0;function Rh(r){var e=Th.call(r,fr),t=r[fr];try{r[fr]=void 0;var n=!0}catch{}var i=xh.call(r);return n&&(e?r[fr]=t:delete r[fr]),i}var Fh=Rh,Mh=Object.prototype,Dh=Mh.toString;function Bh(r){return Dh.call(r)}var Nh=Bh,Ga=Ge,Uh=Fh,Ch=Nh,Lh="[object Null]",jh="[object Undefined]",Wa=Ga?Ga.toStringTag:void 0;function kh(r){return r==null?r===void 0?jh:Lh:Wa&&Wa in Object(r)?Uh(r):Ch(r)}var se=kh;function qh(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var fe=qh,Gh=se,Wh=fe,Vh="[object AsyncFunction]",Hh="[object Function]",zh="[object GeneratorFunction]",Xh="[object Proxy]";function Yh(r){if(!Wh(r))return!1;var e=Gh(r);return e==Hh||e==zh||e==Vh||e==Xh}var xn=Yh,Kh=G,Zh=Kh["__core-js_shared__"],Jh=Zh,Rn=Jh,Va=function(){var r=/[^.]+$/.exec(Rn&&Rn.keys&&Rn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Qh(r){return!!Va&&Va in r}var ed=Qh,rd=Function.prototype,td=rd.toString;function nd(r){if(r!=null){try{return td.call(r)}catch{}try{return r+""}catch{}}return""}var Ha=nd,id=xn,ad=ed,od=fe,ud=Ha,sd=/[\\^$.*+?()[\]{}|]/g,fd=/^\[object .+?Constructor\]$/,cd=Function.prototype,ld=Object.prototype,pd=cd.toString,hd=ld.hasOwnProperty,dd=RegExp("^"+pd.call(hd).replace(sd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yd(r){if(!od(r)||ad(r))return!1;var e=id(r)?dd:fd;return e.test(ud(r))}var vd=yd;function gd(r,e){return r?.[e]}var _d=gd,md=vd,wd=_d;function bd(r,e){var t=wd(r,e);return md(t)?t:void 0}var Se=bd,$d=Se,Ad=G,Ed=$d(Ad,"Map"),Fn=Ed,Od=Se,Sd=Od(Object,"create"),nt=Sd,za=nt;function Pd(){this.__data__=za?za(null):{},this.size=0}var Id=Pd;function Td(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var xd=Td,Rd=nt,Fd="__lodash_hash_undefined__",Md=Object.prototype,Dd=Md.hasOwnProperty;function Bd(r){var e=this.__data__;if(Rd){var t=e[r];return t===Fd?void 0:t}return Dd.call(e,r)?e[r]:void 0}var Nd=Bd,Ud=nt,Cd=Object.prototype,Ld=Cd.hasOwnProperty;function jd(r){var e=this.__data__;return Ud?e[r]!==void 0:Ld.call(e,r)}var kd=jd,qd=nt,Gd="__lodash_hash_undefined__";function Wd(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=qd&&e===void 0?Gd:e,this}var Vd=Wd,Hd=Id,zd=xd,Xd=Nd,Yd=kd,Kd=Vd;function We(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}We.prototype.clear=Hd,We.prototype.delete=zd,We.prototype.get=Xd,We.prototype.has=Yd,We.prototype.set=Kd;var Zd=We,Xa=Zd,Jd=tt,Qd=Fn;function ey(){this.size=0,this.__data__={hash:new Xa,map:new(Qd||Jd),string:new Xa}}var ry=ey;function ty(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var ny=ty,iy=ny;function ay(r,e){var t=r.__data__;return iy(e)?t[typeof e=="string"?"string":"hash"]:t.map}var it=ay,oy=it;function uy(r){var e=oy(this,r).delete(r);return this.size-=e?1:0,e}var sy=uy,fy=it;function cy(r){return fy(this,r).get(r)}var ly=cy,py=it;function hy(r){return py(this,r).has(r)}var dy=hy,yy=it;function vy(r,e){var t=yy(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var gy=vy,_y=ry,my=sy,wy=ly,by=dy,$y=gy;function Ve(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Ve.prototype.clear=_y,Ve.prototype.delete=my,Ve.prototype.get=wy,Ve.prototype.has=by,Ve.prototype.set=$y;var Mn=Ve,Ay=tt,Ey=Fn,Oy=Mn,Sy=200;function Py(r,e){var t=this.__data__;if(t instanceof Ay){var n=t.__data__;if(!Ey||n.length<Sy-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Oy(n)}return t.set(r,e),this.size=t.size,this}var Iy=Py,Ty=tt,xy=vh,Ry=_h,Fy=wh,My=$h,Dy=Iy;function He(r){var e=this.__data__=new Ty(r);this.size=e.size}He.prototype.clear=xy,He.prototype.delete=Ry,He.prototype.get=Fy,He.prototype.has=My,He.prototype.set=Dy;var Dn=He;function By(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Bn=By,Ny=Se,Uy=function(){try{var r=Ny(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Ya=Uy,Ka=Ya;function Cy(r,e,t){e=="__proto__"&&Ka?Ka(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Za=Cy,Ly=Za,jy=et,ky=Object.prototype,qy=ky.hasOwnProperty;function Gy(r,e,t){var n=r[e];(!(qy.call(r,e)&&jy(n,t))||t===void 0&&!(e in r))&&Ly(r,e,t)}var Ja=Gy,Wy=Ja,Vy=Za;function Hy(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],f=n?n(t[s],r[s],s,t,r):void 0;f===void 0&&(f=r[s]),i?Vy(t,s,f):Wy(t,s,f)}return t}var ze=Hy;function zy(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Qa=zy;function Xy(r){return r!=null&&typeof r=="object"}var V=Xy,Yy=se,Ky=V,Zy="[object Arguments]";function Jy(r){return Ky(r)&&Yy(r)==Zy}var Qy=Jy,eo=Qy,ev=V,ro=Object.prototype,rv=ro.hasOwnProperty,tv=ro.propertyIsEnumerable,nv=eo(function(){return arguments}())?eo:function(r){return ev(r)&&rv.call(r,"callee")&&!tv.call(r,"callee")},Nn=nv,iv=Array.isArray,U=iv,cr={exports:{}};function av(){return!1}var ov=av;(function(r,e){var t=G,n=ov,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,s=o?t.Buffer:void 0,f=s?s.isBuffer:void 0,c=f||n;r.exports=c})(cr,cr.exports);var uv=9007199254740991,sv=/^(?:0|[1-9]\d*)$/;function fv(r,e){var t=typeof r;return e=e??uv,!!e&&(t=="number"||t!="symbol"&&sv.test(r))&&r>-1&&r%1==0&&r<e}var at=fv,cv=9007199254740991;function lv(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=cv}var Un=lv,pv=se,hv=Un,dv=V,yv="[object Arguments]",vv="[object Array]",gv="[object Boolean]",_v="[object Date]",mv="[object Error]",wv="[object Function]",bv="[object Map]",$v="[object Number]",Av="[object Object]",Ev="[object RegExp]",Ov="[object Set]",Sv="[object String]",Pv="[object WeakMap]",Iv="[object ArrayBuffer]",Tv="[object DataView]",xv="[object Float32Array]",Rv="[object Float64Array]",Fv="[object Int8Array]",Mv="[object Int16Array]",Dv="[object Int32Array]",Bv="[object Uint8Array]",Nv="[object Uint8ClampedArray]",Uv="[object Uint16Array]",Cv="[object Uint32Array]",F={};F[xv]=F[Rv]=F[Fv]=F[Mv]=F[Dv]=F[Bv]=F[Nv]=F[Uv]=F[Cv]=!0,F[yv]=F[vv]=F[Iv]=F[gv]=F[Tv]=F[_v]=F[mv]=F[wv]=F[bv]=F[$v]=F[Av]=F[Ev]=F[Ov]=F[Sv]=F[Pv]=!1;function Lv(r){return dv(r)&&hv(r.length)&&!!F[pv(r)]}var jv=Lv;function kv(r){return function(e){return r(e)}}var Cn=kv,lr={exports:{}};(function(r,e){var t=ja,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s})(lr,lr.exports);var qv=jv,Gv=Cn,to=lr.exports,no=to&&to.isTypedArray,Wv=no?Gv(no):qv,io=Wv,Vv=Qa,Hv=Nn,zv=U,Xv=cr.exports,Yv=at,Kv=io,Zv=Object.prototype,Jv=Zv.hasOwnProperty;function Qv(r,e){var t=zv(r),n=!t&&Hv(r),i=!t&&!n&&Xv(r),a=!t&&!n&&!i&&Kv(r),o=t||n||i||a,s=o?Vv(r.length,String):[],f=s.length;for(var c in r)(e||Jv.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Yv(c,f)))&&s.push(c);return s}var ao=Qv,eg=Object.prototype;function rg(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||eg;return r===t}var Ln=rg;function tg(r,e){return function(t){return r(e(t))}}var oo=tg,ng=oo,ig=ng(Object.keys,Object),ag=ig,og=Ln,ug=ag,sg=Object.prototype,fg=sg.hasOwnProperty;function cg(r){if(!og(r))return ug(r);var e=[];for(var t in Object(r))fg.call(r,t)&&t!="constructor"&&e.push(t);return e}var lg=cg,pg=xn,hg=Un;function dg(r){return r!=null&&hg(r.length)&&!pg(r)}var pr=dg,yg=ao,vg=lg,gg=pr;function _g(r){return gg(r)?yg(r):vg(r)}var Xe=_g,mg=ze,wg=Xe;function bg(r,e){return r&&mg(e,wg(e),r)}var $g=bg;function Ag(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Eg=Ag,Og=fe,Sg=Ln,Pg=Eg,Ig=Object.prototype,Tg=Ig.hasOwnProperty;function xg(r){if(!Og(r))return Pg(r);var e=Sg(r),t=[];for(var n in r)n=="constructor"&&(e||!Tg.call(r,n))||t.push(n);return t}var Rg=xg,Fg=ao,Mg=Rg,Dg=pr;function Bg(r){return Dg(r)?Fg(r,!0):Mg(r)}var ot=Bg,Ng=ze,Ug=ot;function Cg(r,e){return r&&Ng(e,Ug(e),r)}var Lg=Cg,jn={exports:{}};(function(r,e){var t=G,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,l){if(l)return c.slice();var u=c.length,p=s?s(u):new c.constructor(u);return c.copy(p),p}r.exports=f})(jn,jn.exports);function jg(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var kn=jg;function kg(r,e){for(var t=-1,n=r==null?0:r.length,i=0,a=[];++t<n;){var o=r[t];e(o,t,r)&&(a[i++]=o)}return a}var qg=kg;function Gg(){return[]}var uo=Gg,Wg=qg,Vg=uo,Hg=Object.prototype,zg=Hg.propertyIsEnumerable,so=Object.getOwnPropertySymbols,Xg=so?function(r){return r==null?[]:(r=Object(r),Wg(so(r),function(e){return zg.call(r,e)}))}:Vg,qn=Xg,Yg=ze,Kg=qn;function Zg(r,e){return Yg(r,Kg(r),e)}var Jg=Zg;function Qg(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Gn=Qg,e_=oo,r_=e_(Object.getPrototypeOf,Object),Wn=r_,t_=Gn,n_=Wn,i_=qn,a_=uo,o_=Object.getOwnPropertySymbols,u_=o_?function(r){for(var e=[];r;)t_(e,i_(r)),r=n_(r);return e}:a_,fo=u_,s_=ze,f_=fo;function c_(r,e){return s_(r,f_(r),e)}var l_=c_,p_=Gn,h_=U;function d_(r,e,t){var n=e(r);return h_(r)?n:p_(n,t(r))}var co=d_,y_=co,v_=qn,g_=Xe;function __(r){return y_(r,g_,v_)}var lo=__,m_=co,w_=fo,b_=ot;function $_(r){return m_(r,b_,w_)}var po=$_,A_=Se,E_=G,O_=A_(E_,"DataView"),S_=O_,P_=Se,I_=G,T_=P_(I_,"Promise"),x_=T_,R_=Se,F_=G,M_=R_(F_,"Set"),D_=M_,B_=Se,N_=G,U_=B_(N_,"WeakMap"),ho=U_,Vn=S_,Hn=Fn,zn=x_,Xn=D_,Yn=ho,yo=se,Ye=Ha,vo="[object Map]",C_="[object Object]",go="[object Promise]",_o="[object Set]",mo="[object WeakMap]",wo="[object DataView]",L_=Ye(Vn),j_=Ye(Hn),k_=Ye(zn),q_=Ye(Xn),G_=Ye(Yn),Pe=yo;(Vn&&Pe(new Vn(new ArrayBuffer(1)))!=wo||Hn&&Pe(new Hn)!=vo||zn&&Pe(zn.resolve())!=go||Xn&&Pe(new Xn)!=_o||Yn&&Pe(new Yn)!=mo)&&(Pe=function(r){var e=yo(r),t=e==C_?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case L_:return wo;case j_:return vo;case k_:return go;case q_:return _o;case G_:return mo}return e});var ut=Pe,W_=Object.prototype,V_=W_.hasOwnProperty;function H_(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&V_.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var z_=H_,X_=G,Y_=X_.Uint8Array,bo=Y_,$o=bo;function K_(r){var e=new r.constructor(r.byteLength);return new $o(e).set(new $o(r)),e}var Kn=K_,Z_=Kn;function J_(r,e){var t=e?Z_(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var Q_=J_,em=/\w*$/;function rm(r){var e=new r.constructor(r.source,em.exec(r));return e.lastIndex=r.lastIndex,e}var tm=rm,Ao=Ge,Eo=Ao?Ao.prototype:void 0,Oo=Eo?Eo.valueOf:void 0;function nm(r){return Oo?Object(Oo.call(r)):{}}var im=nm,am=Kn;function om(r,e){var t=e?am(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var um=om,sm=Kn,fm=Q_,cm=tm,lm=im,pm=um,hm="[object Boolean]",dm="[object Date]",ym="[object Map]",vm="[object Number]",gm="[object RegExp]",_m="[object Set]",mm="[object String]",wm="[object Symbol]",bm="[object ArrayBuffer]",$m="[object DataView]",Am="[object Float32Array]",Em="[object Float64Array]",Om="[object Int8Array]",Sm="[object Int16Array]",Pm="[object Int32Array]",Im="[object Uint8Array]",Tm="[object Uint8ClampedArray]",xm="[object Uint16Array]",Rm="[object Uint32Array]";function Fm(r,e,t){var n=r.constructor;switch(e){case bm:return sm(r);case hm:case dm:return new n(+r);case $m:return fm(r,t);case Am:case Em:case Om:case Sm:case Pm:case Im:case Tm:case xm:case Rm:return pm(r,t);case ym:return new n;case vm:case mm:return new n(r);case gm:return cm(r);case _m:return new n;case wm:return lm(r)}}var Mm=Fm,Dm=fe,So=Object.create,Bm=function(){function r(){}return function(e){if(!Dm(e))return{};if(So)return So(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),st=Bm,Nm=st,Um=Wn,Cm=Ln;function Lm(r){return typeof r.constructor=="function"&&!Cm(r)?Nm(Um(r)):{}}var jm=Lm,km=ut,qm=V,Gm="[object Map]";function Wm(r){return qm(r)&&km(r)==Gm}var Vm=Wm,Hm=Vm,zm=Cn,Po=lr.exports,Io=Po&&Po.isMap,Xm=Io?zm(Io):Hm,Ym=Xm,Km=ut,Zm=V,Jm="[object Set]";function Qm(r){return Zm(r)&&Km(r)==Jm}var ew=Qm,rw=ew,tw=Cn,To=lr.exports,xo=To&&To.isSet,nw=xo?tw(xo):rw,iw=nw,aw=Dn,ow=Bn,uw=Ja,sw=$g,fw=Lg,cw=jn.exports,lw=kn,pw=Jg,hw=l_,dw=lo,yw=po,vw=ut,gw=z_,_w=Mm,mw=jm,ww=U,bw=cr.exports,$w=Ym,Aw=fe,Ew=iw,Ow=Xe,Sw=ot,Pw=1,Iw=2,Tw=4,Ro="[object Arguments]",xw="[object Array]",Rw="[object Boolean]",Fw="[object Date]",Mw="[object Error]",Fo="[object Function]",Dw="[object GeneratorFunction]",Bw="[object Map]",Nw="[object Number]",Mo="[object Object]",Uw="[object RegExp]",Cw="[object Set]",Lw="[object String]",jw="[object Symbol]",kw="[object WeakMap]",qw="[object ArrayBuffer]",Gw="[object DataView]",Ww="[object Float32Array]",Vw="[object Float64Array]",Hw="[object Int8Array]",zw="[object Int16Array]",Xw="[object Int32Array]",Yw="[object Uint8Array]",Kw="[object Uint8ClampedArray]",Zw="[object Uint16Array]",Jw="[object Uint32Array]",x={};x[Ro]=x[xw]=x[qw]=x[Gw]=x[Rw]=x[Fw]=x[Ww]=x[Vw]=x[Hw]=x[zw]=x[Xw]=x[Bw]=x[Nw]=x[Mo]=x[Uw]=x[Cw]=x[Lw]=x[jw]=x[Yw]=x[Kw]=x[Zw]=x[Jw]=!0,x[Mw]=x[Fo]=x[kw]=!1;function ft(r,e,t,n,i,a){var o,s=e&Pw,f=e&Iw,c=e&Tw;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!Aw(r))return r;var l=ww(r);if(l){if(o=gw(r),!s)return lw(r,o)}else{var u=vw(r),p=u==Fo||u==Dw;if(bw(r))return cw(r,s);if(u==Mo||u==Ro||p&&!i){if(o=f||p?{}:mw(r),!s)return f?hw(r,fw(o,r)):pw(r,sw(o,r))}else{if(!x[u])return i?r:{};o=_w(r,u,s)}}a||(a=new aw);var d=a.get(r);if(d)return d;a.set(r,o),Ew(r)?r.forEach(function(b){o.add(ft(b,e,t,b,r,a))}):$w(r)&&r.forEach(function(b,w){o.set(w,ft(b,e,t,w,r,a))});var _=c?f?yw:dw:f?Sw:Ow,$=l?void 0:_(r);return ow($||r,function(b,w){$&&(w=b,b=r[w]),uw(o,w,ft(b,e,t,w,r,a))}),o}var Qw=ft,e0=se,r0=V,t0="[object Symbol]";function n0(r){return typeof r=="symbol"||r0(r)&&e0(r)==t0}var ct=n0,i0=U,a0=ct,o0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u0=/^\w*$/;function s0(r,e){if(i0(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||a0(r)?!0:u0.test(r)||!o0.test(r)||e!=null&&r in Object(e)}var Zn=s0,Do=Mn,f0="Expected a function";function Jn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(f0);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(Jn.Cache||Do),t}Jn.Cache=Do;var c0=Jn,l0=c0,p0=500;function h0(r){var e=l0(r,function(n){return t.size===p0&&t.clear(),n}),t=e.cache;return e}var d0=h0,y0=d0,v0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,g0=/\\(\\)?/g,_0=y0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(v0,function(t,n,i,a){e.push(i?a.replace(g0,"$1"):n||t)}),e}),m0=_0,Bo=Ge,w0=Qr,b0=U,$0=ct,A0=1/0,No=Bo?Bo.prototype:void 0,Uo=No?No.toString:void 0;function Co(r){if(typeof r=="string")return r;if(b0(r))return w0(r,Co)+"";if($0(r))return Uo?Uo.call(r):"";var e=r+"";return e=="0"&&1/r==-A0?"-0":e}var E0=Co,O0=E0;function S0(r){return r==null?"":O0(r)}var P0=S0,I0=U,T0=Zn,x0=m0,R0=P0;function F0(r,e){return I0(r)?r:T0(r,e)?[r]:x0(R0(r))}var lt=F0;function M0(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var D0=M0,B0=ct,N0=1/0;function U0(r){if(typeof r=="string"||B0(r))return r;var e=r+"";return e=="0"&&1/r==-N0?"-0":e}var hr=U0,C0=lt,L0=hr;function j0(r,e){e=C0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[L0(e[t++])];return t&&t==n?r:void 0}var Qn=j0;function k0(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}var q0=k0,G0=Qn,W0=q0;function V0(r,e){return e.length<2?r:G0(r,W0(e,0,-1))}var H0=V0,z0=lt,X0=D0,Y0=H0,K0=hr;function Z0(r,e){return e=z0(e,r),r=Y0(r,e),r==null||delete r[K0(X0(e))]}var J0=Z0,Q0=se,eb=Wn,rb=V,tb="[object Object]",nb=Function.prototype,ib=Object.prototype,Lo=nb.toString,ab=ib.hasOwnProperty,ob=Lo.call(Object);function ub(r){if(!rb(r)||Q0(r)!=tb)return!1;var e=eb(r);if(e===null)return!0;var t=ab.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Lo.call(t)==ob}var sb=ub,fb=sb;function cb(r){return fb(r)?void 0:r}var lb=cb,jo=Ge,pb=Nn,hb=U,ko=jo?jo.isConcatSpreadable:void 0;function db(r){return hb(r)||pb(r)||!!(ko&&r&&r[ko])}var yb=db,vb=Gn,gb=yb;function qo(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=gb),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?qo(s,e-1,t,n,i):vb(i,s):n||(i[i.length]=s)}return i}var _b=qo,mb=_b;function wb(r){var e=r==null?0:r.length;return e?mb(r,1):[]}var bb=wb;function $b(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var ei=$b,Ab=ei,Go=Math.max;function Eb(r,e,t){return e=Go(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Go(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=t(o),Ab(r,this,s)}}var Wo=Eb;function Ob(r){return function(){return r}}var Sb=Ob;function Pb(r){return r}var dr=Pb,Ib=Sb,Vo=Ya,Tb=dr,xb=Vo?function(r,e){return Vo(r,"toString",{configurable:!0,enumerable:!1,value:Ib(e),writable:!0})}:Tb,Rb=xb,Fb=800,Mb=16,Db=Date.now;function Bb(r){var e=0,t=0;return function(){var n=Db(),i=Mb-(n-t);if(t=n,i>0){if(++e>=Fb)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Ho=Bb,Nb=Rb,Ub=Ho,Cb=Ub(Nb),ri=Cb,Lb=bb,jb=Wo,kb=ri;function qb(r){return kb(jb(r,void 0,Lb),r+"")}var Gb=qb,Wb=Qr,Vb=Qw,Hb=J0,zb=lt,Xb=ze,Yb=lb,Kb=Gb,Zb=po,Jb=1,Qb=2,e1=4,r1=Kb(function(r,e){var t={};if(r==null)return t;var n=!1;e=Wb(e,function(a){return a=zb(a,r),n||(n=a.length>1),a}),Xb(r,Zb(r),t),n&&(t=Vb(t,Jb|Qb|e1,Yb));for(var i=e.length;i--;)Hb(t,e[i]);return t}),ti=r1,t1=Object.defineProperty,n1=Object.defineProperties,i1=Object.getOwnPropertyDescriptors,zo=Object.getOwnPropertySymbols,a1=Object.prototype.hasOwnProperty,o1=Object.prototype.propertyIsEnumerable,Xo=(r,e,t)=>e in r?t1(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,u1=(r,e)=>{for(var t in e||(e={}))a1.call(e,t)&&Xo(r,t,e[t]);if(zo)for(var t of zo(e))o1.call(e,t)&&Xo(r,t,e[t]);return r},s1=(r,e)=>n1(r,i1(e));function f1(r){try{return JSON.parse(r)}catch{return r}}function c1(r){return Object.entries(r).reduce((e,[t,n])=>s1(u1({},e),{[t]:f1(n)}),{})}const Yo=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;var l1=Object.defineProperty,p1=Object.defineProperties,h1=Object.getOwnPropertyDescriptors,Ko=Object.getOwnPropertySymbols,d1=Object.prototype.hasOwnProperty,y1=Object.prototype.propertyIsEnumerable,Zo=(r,e,t)=>e in r?l1(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Jo=(r,e)=>{for(var t in e||(e={}))d1.call(e,t)&&Zo(r,t,e[t]);if(Ko)for(var t of Ko(e))y1.call(e,t)&&Zo(r,t,e[t]);return r},Qo=(r,e)=>p1(r,h1(e));function eu(r){var e;const t=c1(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Qo(Jo({},ti(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function ru(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Qo(Jo({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function v1(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=ru(i)}),t})}const pt="2020-12",g1={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},yr=new Map;function ht(r,e){return yr.has(r)||yr.set(r,e()),yr.get(r)}async function ni(r){const{product:e}=await ht(`product.${r}`,()=>Jr("get",`/product/${pt}/${r}.json`));return ru(e)}async function tu(){return await ht("storeSettings",()=>Jr("get",`/${pt}/store_settings.json`).catch(()=>g1))}async function nu(){const{widget_settings:r}=await ht("widgetSettings",()=>Jr("get",`/${pt}/widget_settings.json`));return eu(r)}async function iu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await ht("productsAndSettings",()=>Jr("get",`/product/${pt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:v1(r),widget_settings:eu(e),store_settings:t??{}}}async function _1(){const{products:r}=await iu();return r}async function m1(r){const[e,t,n]=await Promise.all([ni(r),tu(),nu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function au(r){const{bundle_product:e}=await ni(r);return e}async function ou(){return Array.from(yr.keys()).forEach(r=>yr.delete(r))}var w1=Object.freeze({__proto__:null,getCDNProduct:ni,getCDNStoreSettings:tu,getCDNWidgetSettings:nu,getCDNProductsAndSettings:iu,getCDNProducts:_1,getCDNProductAndSettings:m1,getCDNBundleSettings:au,resetCDNCache:ou}),uu={},ii={},ce={},b1=se,$1=V,A1="[object Number]";function E1(r){return typeof r=="number"||$1(r)&&b1(r)==A1}var dt=E1,M={},su={exports:{}},O1=dr,S1=Wo,P1=ri;function I1(r,e){return P1(S1(r,e,O1),r+"")}var fu=I1,T1=et,x1=pr,R1=at,F1=fe;function M1(r,e,t){if(!F1(t))return!1;var n=typeof e;return(n=="number"?x1(t)&&R1(e,t.length):n=="string"&&e in t)?T1(t[e],r):!1}var cu=M1,D1=fu,B1=cu;function N1(r){return D1(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&B1(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=t[n];s&&r(e,s,n,a)}return e})}var U1=N1,C1=ze,L1=U1,j1=ot,k1=L1(function(r,e){C1(e,j1(e),r)}),q1=k1;(function(r){r.exports=q1})(su);var yt={},Ie={};function G1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(!e(r[t],t,r))return!1;return!0}var W1=G1;function V1(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var f=o[r?s:++i];if(t(a[f],f,a)===!1)break}return e}}var H1=V1,z1=H1,X1=z1(),Y1=X1,K1=Y1,Z1=Xe;function J1(r,e){return r&&K1(r,e,Z1)}var Q1=J1,e$=pr;function r$(r,e){return function(t,n){if(t==null)return t;if(!e$(t))return r(t,n);for(var i=t.length,a=e?i:-1,o=Object(t);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return t}}var t$=r$,n$=Q1,i$=t$,a$=i$(n$),ai=a$,o$=ai;function u$(r,e){var t=!0;return o$(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var s$=u$,f$="__lodash_hash_undefined__";function c$(r){return this.__data__.set(r,f$),this}var l$=c$;function p$(r){return this.__data__.has(r)}var h$=p$,d$=Mn,y$=l$,v$=h$;function vt(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new d$;++e<t;)this.add(r[e])}vt.prototype.add=vt.prototype.push=y$,vt.prototype.has=v$;var g$=vt;function _$(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}var m$=_$;function w$(r,e){return r.has(e)}var b$=w$,$$=g$,A$=m$,E$=b$,O$=1,S$=2;function P$(r,e,t,n,i,a){var o=t&O$,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var u=-1,p=!0,d=t&S$?new $$:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var _=r[u],$=e[u];if(n)var b=o?n($,_,u,e,r,a):n(_,$,u,r,e,a);if(b!==void 0){if(b)continue;p=!1;break}if(d){if(!A$(e,function(w,A){if(!E$(d,A)&&(_===w||i(_,w,t,n,a)))return d.push(A)})){p=!1;break}}else if(!(_===$||i(_,$,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var lu=P$;function I$(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var T$=I$;function x$(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var R$=x$,pu=Ge,hu=bo,F$=et,M$=lu,D$=T$,B$=R$,N$=1,U$=2,C$="[object Boolean]",L$="[object Date]",j$="[object Error]",k$="[object Map]",q$="[object Number]",G$="[object RegExp]",W$="[object Set]",V$="[object String]",H$="[object Symbol]",z$="[object ArrayBuffer]",X$="[object DataView]",du=pu?pu.prototype:void 0,oi=du?du.valueOf:void 0;function Y$(r,e,t,n,i,a,o){switch(t){case X$:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case z$:return!(r.byteLength!=e.byteLength||!a(new hu(r),new hu(e)));case C$:case L$:case q$:return F$(+r,+e);case j$:return r.name==e.name&&r.message==e.message;case G$:case V$:return r==e+"";case k$:var s=D$;case W$:var f=n&N$;if(s||(s=B$),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=U$,o.set(r,e);var l=M$(s(r),s(e),n,i,a,o);return o.delete(r),l;case H$:if(oi)return oi.call(r)==oi.call(e)}return!1}var K$=Y$,yu=lo,Z$=1,J$=Object.prototype,Q$=J$.hasOwnProperty;function eA(r,e,t,n,i,a){var o=t&Z$,s=yu(r),f=s.length,c=yu(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[u];if(!(o?p in e:Q$.call(e,p)))return!1}var d=a.get(r),_=a.get(e);if(d&&_)return d==e&&_==r;var $=!0;a.set(r,e),a.set(e,r);for(var b=o;++u<f;){p=s[u];var w=r[p],A=e[p];if(n)var h=o?n(A,w,p,e,r,a):n(w,A,p,r,e,a);if(!(h===void 0?w===A||i(w,A,t,n,a):h)){$=!1;break}b||(b=p=="constructor")}if($&&!b){var P=r.constructor,I=e.constructor;P!=I&&"constructor"in r&&"constructor"in e&&!(typeof P=="function"&&P instanceof P&&typeof I=="function"&&I instanceof I)&&($=!1)}return a.delete(r),a.delete(e),$}var rA=eA,ui=Dn,tA=lu,nA=K$,iA=rA,vu=ut,gu=U,_u=cr.exports,aA=io,oA=1,mu="[object Arguments]",wu="[object Array]",gt="[object Object]",uA=Object.prototype,bu=uA.hasOwnProperty;function sA(r,e,t,n,i,a){var o=gu(r),s=gu(e),f=o?wu:vu(r),c=s?wu:vu(e);f=f==mu?gt:f,c=c==mu?gt:c;var l=f==gt,u=c==gt,p=f==c;if(p&&_u(r)){if(!_u(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new ui),o||aA(r)?tA(r,e,t,n,i,a):nA(r,e,f,t,n,i,a);if(!(t&oA)){var d=l&&bu.call(r,"__wrapped__"),_=u&&bu.call(e,"__wrapped__");if(d||_){var $=d?r.value():r,b=_?e.value():e;return a||(a=new ui),i($,b,t,n,a)}}return p?(a||(a=new ui),iA(r,e,t,n,i,a)):!1}var fA=sA,cA=fA,$u=V;function Au(r,e,t,n,i){return r===e?!0:r==null||e==null||!$u(r)&&!$u(e)?r!==r&&e!==e:cA(r,e,t,n,Au,i)}var Eu=Au,lA=Dn,pA=Eu,hA=1,dA=2;function yA(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],l=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new lA;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?pA(l,c,hA|dA,n,u):p))return!1}}return!0}var vA=yA,gA=fe;function _A(r){return r===r&&!gA(r)}var Ou=_A,mA=Ou,wA=Xe;function bA(r){for(var e=wA(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,mA(i)]}return e}var $A=bA;function AA(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Su=AA,EA=vA,OA=$A,SA=Su;function PA(r){var e=OA(r);return e.length==1&&e[0][2]?SA(e[0][0],e[0][1]):function(t){return t===r||EA(t,r,e)}}var IA=PA,TA=Qn;function xA(r,e,t){var n=r==null?void 0:TA(r,e);return n===void 0?t:n}var RA=xA;function FA(r,e){return r!=null&&e in Object(r)}var MA=FA,DA=lt,BA=Nn,NA=U,UA=at,CA=Un,LA=hr;function jA(r,e,t){e=DA(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=LA(e[n]);if(!(a=r!=null&&t(r,o)))break;r=r[o]}return a||++n!=i?a:(i=r==null?0:r.length,!!i&&CA(i)&&UA(o,i)&&(NA(r)||BA(r)))}var kA=jA,qA=MA,GA=kA;function WA(r,e){return r!=null&&GA(r,e,qA)}var VA=WA,HA=Eu,zA=RA,XA=VA,YA=Zn,KA=Ou,ZA=Su,JA=hr,QA=1,eE=2;function rE(r,e){return YA(r)&&KA(e)?ZA(JA(r),e):function(t){var n=zA(t,r);return n===void 0&&n===e?XA(t,r):HA(e,n,QA|eE)}}var tE=rE;function nE(r){return function(e){return e?.[r]}}var iE=nE,aE=Qn;function oE(r){return function(e){return aE(e,r)}}var uE=oE,sE=iE,fE=uE,cE=Zn,lE=hr;function pE(r){return cE(r)?sE(lE(r)):fE(r)}var hE=pE,dE=IA,yE=tE,vE=dr,gE=U,_E=hE;function mE(r){return typeof r=="function"?r:r==null?vE:typeof r=="object"?gE(r)?yE(r[0],r[1]):dE(r):_E(r)}var Pu=mE,wE=W1,bE=s$,$E=Pu,AE=U,EE=cu;function OE(r,e,t){var n=AE(r)?wE:bE;return t&&EE(r,e,t)&&(e=void 0),n(r,$E(e))}var si=OE;Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calculatePadding=TE,Ie.slicePadding=xE;var SE=si,PE=IE(SE);function IE(r){return r&&r.__esModule?r:{default:r}}function TE(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function xE(r,e){var t=r.slice(e),n=(0,PE.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(yt,"__esModule",{value:!0}),yt.Cursor=void 0;var RE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),FE=Ie;function ME(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var fi=function(){function r(e){ME(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return RE(r,[{key:"_setBuffer",value:function(t){this._buffer=t,this.length=t.length}},{key:"buffer",value:function(){return this._buffer}},{key:"tap",value:function(t){return t(this),this}},{key:"clone",value:function(t){var n=new this.constructor(this.buffer());return n.seek(arguments.length===0?this.tell():t),n}},{key:"tell",value:function(){return this._index}},{key:"seek",value:function(t,n){return arguments.length===1&&(n=t,t="="),t==="+"?this._index+=n:t==="-"?this._index-=n:this._index=n,this}},{key:"rewind",value:function(){return this.seek(0)}},{key:"eof",value:function(){return this.tell()===this.buffer().length}},{key:"write",value:function(t,n,i){return this.seek("+",this.buffer().write(t,this.tell(),n,i))}},{key:"fill",value:function(t,n){return arguments.length===1&&(n=this.buffer().length-this.tell()),this.buffer().fill(t,this.tell(),this.tell()+n),this.seek("+",n),this}},{key:"slice",value:function(t){arguments.length===0&&(t=this.length-this.tell());var n=new this.constructor(this.buffer().slice(this.tell(),this.tell()+t));return this.seek("+",t),n}},{key:"copyFrom",value:function(t){var n=t instanceof y?t:t.buffer();return n.copy(this.buffer(),this.tell(),0,n.length),this.seek("+",n.length),this}},{key:"concat",value:function(t){t.forEach(function(i,a){i instanceof r&&(t[a]=i.buffer())}),t.unshift(this.buffer());var n=y.concat(t);return this._setBuffer(n),this}},{key:"toString",value:function(t,n){arguments.length===0?(t="utf8",n=this.buffer().length-this.tell()):arguments.length===1&&(n=this.buffer().length-this.tell());var i=this.buffer().toString(t,this.tell(),this.tell()+n);return this.seek("+",n),i}},{key:"writeBufferPadded",value:function(t){var n=(0,FE.calculatePadding)(t.length),i=y.alloc(n);return this.copyFrom(new r(t)).copyFrom(new r(i))}}]),r}();[[1,["readInt8","readUInt8"]],[2,["readInt16BE","readInt16LE","readUInt16BE","readUInt16LE"]],[4,["readInt32BE","readInt32LE","readUInt32BE","readUInt32LE","readFloatBE","readFloatLE"]],[8,["readDoubleBE","readDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){fi.prototype[e]=function(){var n=this.buffer()[e](this.tell());return this.seek("+",r[0]),n}})}),[[1,["writeInt8","writeUInt8"]],[2,["writeInt16BE","writeInt16LE","writeUInt16BE","writeUInt16LE"]],[4,["writeInt32BE","writeInt32LE","writeUInt32BE","writeUInt32LE","writeFloatBE","writeFloatLE"]],[8,["writeDoubleBE","writeDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){fi.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),yt.Cursor=fi,Object.defineProperty(M,"__esModule",{value:!0}),M.default=jE;var DE=su.exports,Iu=xu(DE),BE=xn,NE=xu(BE),Tu=yt;function xu(r){return r&&r.__esModule?r:{default:r}}var UE=Math.pow(2,16),CE={toXDR:function(e){var t=new Tu.Cursor(UE);this.write(e,t);var n=t.tell();return t.rewind(),t.slice(n).buffer()},fromXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw",n=void 0;switch(t){case"raw":n=e;break;case"hex":n=y.from(e,"hex");break;case"base64":n=y.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new Tu.Cursor(n),a=this.read(i);return a},validateXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch{return!1}}},LE={toXDR:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw",t=this.constructor.toXDR(this);switch(e){case"raw":return t;case"hex":return t.toString("hex");case"base64":return t.toString("base64");default:throw new Error("Invalid format "+e+', must be "raw", "hex", "base64"')}}};function jE(r){(0,Iu.default)(r,CE),(0,NE.default)(r)&&(0,Iu.default)(r.prototype,LE)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.Int=void 0;var kE=dt,Ru=Fu(kE),qE=M,GE=Fu(qE);function Fu(r){return r&&r.__esModule?r:{default:r}}var vr=ce.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Ru.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,Ru.default)(e)||Math.floor(e)!==e?!1:e>=vr.MIN_VALUE&&e<=vr.MAX_VALUE}};vr.MAX_VALUE=Math.pow(2,31)-1,vr.MIN_VALUE=-Math.pow(2,31),(0,GE.default)(vr);var _t={};function WE(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ci={exports:{}};(function(r){/**
|
|
21
|
-
|
|
22
|
-
* Released under the Apache License, Version 2.0
|
|
23
|
-
* see: https://github.com/dcodeIO/Long.js for details
|
|
24
|
-
*/(function(e,t){typeof WE=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(ne,function(){function e(l,u,p){this.low=l|0,this.high=u|0,this.unsigned=!!p}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,p){var d,_;return p?(u=u>>>0,0<=u&&u<256&&(_=n[u],_)?_:(d=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=d),d)):(u=u|0,-128<=u&&u<128&&(_=t[u],_)?_:(d=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=d),d))},e.fromNumber=function(u,p){return p=!!p,isNaN(u)||!isFinite(u)?e.ZERO:!p&&u<=-f?e.MIN_VALUE:!p&&u+1>=f?e.MAX_VALUE:p&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,p).negate():new e(u%o|0,u/o|0,p)},e.fromBits=function(u,p,d){return new e(u,p,d)},e.fromString=function(u,p,d){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof p=="number"&&(d=p,p=!1),d=d||10,d<2||36<d)throw Error("radix out of range: "+d);var _;if((_=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(_===0)return e.fromString(u.substring(1),p,d).negate();for(var $=e.fromNumber(Math.pow(d,8)),b=e.ZERO,w=0;w<u.length;w+=8){var A=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+A),d);if(A<8){var P=e.fromNumber(Math.pow(d,A));b=b.multiply(P).add(e.fromNumber(h))}else b=b.multiply($),b=b.add(e.fromNumber(h))}return b.unsigned=p,b},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,s=o*o,f=s/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),_=this.divide(d);return p=_.multiply(d).subtract(this),_.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var $=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var b="";;){var w=p.divide($),A=p.subtract(w.multiply($)).toInt()>>>0,h=A.toString(u);if(p=w,p.isZero())return h+b;for(;h.length<6;)h="0"+h;b=""+h+b}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var p=this.isNegative(),d=u.isNegative();return p&&!d?-1:!p&&d?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(u){e.isLong(u)||(u=e.fromValue(u));var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,P=0,I=0,R=0,m=0;return m+=$+h,R+=m>>>16,m&=65535,R+=_+A,I+=R>>>16,R&=65535,I+=d+w,P+=I>>>16,I&=65535,P+=p+b,P&=65535,e.fromBits(R<<16|m,P<<16|I,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(c)&&u.lessThan(c))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,P=0,I=0,R=0,m=0;return m+=$*h,R+=m>>>16,m&=65535,R+=_*h,I+=R>>>16,R&=65535,R+=$*A,I+=R>>>16,R&=65535,I+=d*h,P+=I>>>16,I&=65535,I+=_*A,P+=I>>>16,I&=65535,I+=$*w,P+=I>>>16,I&=65535,P+=p*h+d*A+_*w+$*b,P&=65535,e.fromBits(R<<16|m,P<<16|I,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var p,d,_;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var $=this.shiftRight(1);return p=$.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),_=p.add(d.divide(u)),_)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(_=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var b=Math.ceil(Math.log(p)/Math.LN2),w=b<=48?1:Math.pow(2,b-48),A=e.fromNumber(p),h=A.multiply(u);h.isNegative()||h.greaterThan(d);)p-=w,A=e.fromNumber(p,this.unsigned),h=A.multiply(u);A.isZero()&&(A=e.ONE),_=_.add(A),d=d.subtract(h)}return _},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var p=this.high;if(u<32){var d=this.low;return e.fromBits(d>>>u|p<<32-u,p>>>u,this.unsigned)}else return u===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>u-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(ci),Object.defineProperty(_t,"__esModule",{value:!0}),_t.Hyper=void 0;var VE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Mu=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},HE=ci.exports,gr=Du(HE),zE=M,XE=Du(zE);function Du(r){return r&&r.__esModule?r:{default:r}}function YE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function KE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function ZE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var _r=_t.Hyper=function(r){ZE(e,r),VE(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not a Hyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^-?\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Mu(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!1);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Mu(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!1);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return YE(this,e),KE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(gr.default);(0,XE.default)(_r),_r.MAX_VALUE=new _r(gr.default.MAX_VALUE.low,gr.default.MAX_VALUE.high),_r.MIN_VALUE=new _r(gr.default.MIN_VALUE.low,gr.default.MIN_VALUE.high);var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.UnsignedInt=void 0;var JE=dt,Bu=Nu(JE),QE=M,eO=Nu(QE);function Nu(r){return r&&r.__esModule?r:{default:r}}var mr=Te.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Bu.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");if(e<0)throw new Error("XDR Write Error: negative number "+e);t.writeUInt32BE(e)},isValid:function(e){return!(0,Bu.default)(e)||Math.floor(e)!==e?!1:e>=mr.MIN_VALUE&&e<=mr.MAX_VALUE}};mr.MAX_VALUE=Math.pow(2,32)-1,mr.MIN_VALUE=0,(0,eO.default)(mr);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.UnsignedHyper=void 0;var rO=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Uu=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},tO=ci.exports,wr=Cu(tO),nO=M,iO=Cu(nO);function Cu(r){return r&&r.__esModule?r:{default:r}}function aO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function oO(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function uO(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var br=mt.UnsignedHyper=function(r){uO(e,r),rO(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not an UnsignedHyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Uu(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!0);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Uu(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!0);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return aO(this,e),oO(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(wr.default);(0,iO.default)(br),br.MAX_VALUE=new br(wr.default.MAX_UNSIGNED_VALUE.low,wr.default.MAX_UNSIGNED_VALUE.high),br.MIN_VALUE=new br(wr.default.MIN_VALUE.low,wr.default.MIN_VALUE.high);var wt={};Object.defineProperty(wt,"__esModule",{value:!0}),wt.Float=void 0;var sO=dt,Lu=ju(sO),fO=M,cO=ju(fO);function ju(r){return r&&r.__esModule?r:{default:r}}var lO=wt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Lu.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Lu.default)(e)}};(0,cO.default)(lO);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.Double=void 0;var pO=dt,ku=qu(pO),hO=M,dO=qu(hO);function qu(r){return r&&r.__esModule?r:{default:r}}var yO=bt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,ku.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,ku.default)(e)}};(0,dO.default)(yO);var $t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.Quadruple=void 0;var vO=M,gO=_O(vO);function _O(r){return r&&r.__esModule?r:{default:r}}var mO=$t.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,gO.default)(mO);var $r={},wO=se,bO=V,$O="[object Boolean]";function AO(r){return r===!0||r===!1||bO(r)&&wO(r)==$O}var EO=AO;Object.defineProperty($r,"__esModule",{value:!0}),$r.Bool=void 0;var OO=EO,SO=Wu(OO),Gu=ce,PO=M,IO=Wu(PO);function Wu(r){return r&&r.__esModule?r:{default:r}}var TO=$r.Bool={read:function(e){var t=Gu.Int.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new Error("XDR Read Error: Got "+t+" when trying to read a bool")}},write:function(e,t){var n=e?1:0;return Gu.Int.write(n,t)},isValid:function(e){return(0,SO.default)(e)}};(0,IO.default)(TO);var At={},xO=se,RO=U,FO=V,MO="[object String]";function DO(r){return typeof r=="string"||!RO(r)&&FO(r)&&xO(r)==MO}var Vu=DO;Object.defineProperty(At,"__esModule",{value:!0}),At.String=void 0;var BO=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),NO=Vu,Hu=li(NO),UO=U,CO=li(UO),zu=ce,LO=Te,Xu=Ie,jO=M,kO=li(jO);function li(r){return r&&r.__esModule?r:{default:r}}function qO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GO=At.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:LO.UnsignedInt.MAX_VALUE;qO(this,r),this._maxLength=e}return BO(r,[{key:"read",value:function(t){var n=zu.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,Xu.calculatePadding)(n),a=t.slice(n);return(0,Xu.slicePadding)(t,i),a.buffer()}},{key:"readString",value:function(t){return this.read(t).toString("utf8")}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));var i=void 0;(0,Hu.default)(t)?i=y.from(t,"utf8"):i=y.from(t),zu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Hu.default)(t))n=y.from(t,"utf8");else if((0,CO.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,kO.default)(GO.prototype);var Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.Opaque=void 0;var WO=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Yu=Ie,VO=M,HO=zO(VO);function zO(r){return r&&r.__esModule?r:{default:r}}function XO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var YO=Et.Opaque=function(){function r(e){XO(this,r),this._length=e,this._padding=(0,Yu.calculatePadding)(e)}return WO(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Yu.slicePadding)(t,this._padding),n.buffer()}},{key:"write",value:function(t,n){if(t.length!==this._length)throw new Error("XDR Write Error: Got "+t.length+" bytes, expected "+this._length);n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length===this._length}}]),r}();(0,HO.default)(YO.prototype);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.VarOpaque=void 0;var KO=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Ku=ce,ZO=Te,Zu=Ie,JO=M,QO=eS(JO);function eS(r){return r&&r.__esModule?r:{default:r}}function rS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var tS=Ot.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ZO.UnsignedInt.MAX_VALUE;rS(this,r),this._maxLength=e}return KO(r,[{key:"read",value:function(t){var n=Ku.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length VarOpaque,"+("max allowed is "+this._maxLength));var i=(0,Zu.calculatePadding)(n),a=t.slice(n);return(0,Zu.slicePadding)(t,i),a.buffer()}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));Ku.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,QO.default)(tS.prototype);var St={},xe={exports:{}},nS=dr;function iS(r){return typeof r=="function"?r:nS}var Ju=iS,aS=Bn,oS=ai,uS=Ju,sS=U;function fS(r,e){var t=sS(r)?aS:oS;return t(r,uS(e))}var cS=fS;(function(r){r.exports=cS})(xe);var lS=/\s/;function pS(r){for(var e=r.length;e--&&lS.test(r.charAt(e)););return e}var hS=pS,dS=hS,yS=/^\s+/;function vS(r){return r&&r.slice(0,dS(r)+1).replace(yS,"")}var gS=vS,_S=gS,Qu=fe,mS=ct,es=0/0,wS=/^[-+]0x[0-9a-f]+$/i,bS=/^0b[01]+$/i,$S=/^0o[0-7]+$/i,AS=parseInt;function ES(r){if(typeof r=="number")return r;if(mS(r))return es;if(Qu(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Qu(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=_S(r);var t=bS.test(r);return t||$S.test(r)?AS(r.slice(2),t?2:8):wS.test(r)?es:+r}var OS=ES,SS=OS,rs=1/0,PS=17976931348623157e292;function IS(r){if(!r)return r===0?r:0;if(r=SS(r),r===rs||r===-rs){var e=r<0?-1:1;return e*PS}return r===r?r:0}var TS=IS,xS=TS;function RS(r){var e=xS(r),t=e%1;return e===e?t?e-t:e:0}var ts=RS,FS=Qa,MS=Ju,DS=ts,BS=9007199254740991,pi=4294967295,NS=Math.min;function US(r,e){if(r=DS(r),r<1||r>BS)return[];var t=pi,n=NS(r,pi);e=MS(e),r-=pi;for(var i=FS(n,e);++t<r;)e(t);return i}var ns=US;Object.defineProperty(St,"__esModule",{value:!0}),St.Array=void 0;var CS=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),LS=si,jS=Ar(LS),kS=xe.exports,qS=Ar(kS),GS=ns,WS=Ar(GS),VS=U,is=Ar(VS),HS=M,zS=Ar(HS);function Ar(r){return r&&r.__esModule?r:{default:r}}function XS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var YS=St.Array=function(){function r(e,t){XS(this,r),this._childType=e,this._length=t}return CS(r,[{key:"read",value:function(t){var n=this;return(0,WS.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,is.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,qS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,is.default)(t)||t.length!==this._length?!1:(0,jS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,zS.default)(YS.prototype);var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.VarArray=void 0;var KS=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),ZS=si,JS=Er(ZS),QS=xe.exports,e2=Er(QS),r2=ns,t2=Er(r2),n2=U,as=Er(n2),i2=Te,os=ce,a2=M,o2=Er(a2);function Er(r){return r&&r.__esModule?r:{default:r}}function u2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var s2=Pt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i2.UnsignedInt.MAX_VALUE;u2(this,r),this._childType=e,this._maxLength=t}return KS(r,[{key:"read",value:function(t){var n=this,i=os.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,t2.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,as.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));os.Int.write(t.length,n),(0,e2.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,as.default)(t)||t.length>this._maxLength?!1:(0,JS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,o2.default)(s2.prototype);var It={};function f2(r){return r===null}var c2=f2;function l2(r){return r===void 0}var Or=l2;Object.defineProperty(It,"__esModule",{value:!0}),It.Option=void 0;var p2=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),h2=c2,us=hi(h2),d2=Or,ss=hi(d2),fs=$r,y2=M,v2=hi(y2);function hi(r){return r&&r.__esModule?r:{default:r}}function g2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _2=It.Option=function(){function r(e){g2(this,r),this._childType=e}return p2(r,[{key:"read",value:function(t){if(fs.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,us.default)(t)||(0,ss.default)(t));fs.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,us.default)(t)||(0,ss.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,v2.default)(_2.prototype);var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Void=void 0;var m2=Or,cs=ls(m2),w2=M,b2=ls(w2);function ls(r){return r&&r.__esModule?r:{default:r}}var $2=Sr.Void={read:function(){},write:function(e){if(!(0,cs.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,cs.default)(e)}};(0,b2.default)($2);var Tt={},A2=Qr;function E2(r,e){return A2(e,function(t){return r[t]})}var O2=E2,S2=O2,P2=Xe;function I2(r){return r==null?[]:S2(r,P2(r))}var T2=I2;Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Enum=void 0;var x2=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),R2=xe.exports,F2=di(R2),M2=T2,D2=di(M2),ps=ce,B2=M,N2=di(B2);function di(r){return r&&r.__esModule?r:{default:r}}function U2(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function C2(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function hs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var L2=Tt.Enum=function(){function r(e,t){hs(this,r),this.name=e,this.value=t}return x2(r,null,[{key:"read",value:function(t){var n=ps.Int.read(t);if(!this._byValue.has(n))throw new Error("XDR Read Error: Unknown "+this.enumName+" member for value "+n);return this._byValue.get(n)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: Unknown "+t+" is not a "+this.enumName);ps.Int.write(t.value,n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"members",value:function(){return this._members}},{key:"values",value:function(){return(0,D2.default)(this._members)}},{key:"fromName",value:function(t){var n=this._members[t];if(!n)throw new Error(t+" is not a member of "+this.enumName);return n}},{key:"fromValue",value:function(t){var n=this._byValue.get(t);if(!n)throw new Error(t+" is not a value of any member of "+this.enumName);return n}},{key:"create",value:function(t,n,i){var a=function(o){C2(s,o);function s(){return hs(this,s),U2(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,F2.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,N2.default)(L2);var xt={},j2=ai,k2=pr;function q2(r,e){var t=-1,n=k2(r)?Array(r.length):[];return j2(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var G2=q2,W2=Qr,V2=Pu,H2=G2,z2=U;function X2(r,e){var t=z2(r)?W2:H2;return t(r,V2(e))}var Y2=X2;function K2(r){for(var e=-1,t=r==null?0:r.length,n={};++e<t;){var i=r[e];n[i[0]]=i[1]}return n}var Z2=K2,Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});var J2=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function Q2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Pr.Reference=function(){function r(){Q2(this,r)}return J2(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(xt,"__esModule",{value:!0}),xt.Struct=void 0;var Rt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),eP=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),rP=xe.exports,ds=Ir(rP),tP=Y2,nP=Ir(tP),iP=Or,aP=Ir(iP),oP=Z2,uP=Ir(oP),sP=Pr,fP=M,cP=Ir(fP);function Ir(r){return r&&r.__esModule?r:{default:r}}function lP(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function pP(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function ys(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var hP=xt.Struct=function(){function r(e){ys(this,r),this._attributes=e||{}}return eP(r,null,[{key:"read",value:function(t){var n=(0,nP.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,uP.default)(n))}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.structName);(0,ds.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){pP(s,o);function s(){return ys(this,s),lP(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Rt(o,2),f=s[0],c=s[1];return c instanceof sP.Reference&&(c=c.resolve(t)),[f,c]}),(0,ds.default)(a._fields,function(o){var s=Rt(o,1),f=s[0];a.prototype[f]=dP(f)}),a}}]),r}();(0,cP.default)(hP);function dP(r){return function(t){return(0,aP.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Union=void 0;var yP=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),vP=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),gP=xe.exports,Mt=Bt(gP),_P=Or,vs=Bt(_P),mP=Vu,gs=Bt(mP),Dt=Sr,yi=Pr,wP=M,bP=Bt(wP);function Bt(r){return r&&r.__esModule?r:{default:r}}function $P(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function AP(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function _s(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var EP=Ft.Union=function(){function r(e,t){_s(this,r),this.set(e,t)}return vP(r,[{key:"set",value:function(t,n){(0,gs.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==Dt.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===Dt.Void?Dt.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,vs.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(s){AP(f,s);function f(){return _s(this,f),$P(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof yi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Mt.default)(i.arms,function(s,f){s instanceof yi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof yi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Mt.default)(i.switches,function(s){var f=yP(s,2),c=f[0],l=f[1];(0,gs.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,vs.default)(a._switchOn.values)||(0,Mt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Mt.default)(a._arms,function(s,f){s!==Dt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,bP.default)(EP),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ce;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=_t;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Te;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=mt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=wt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=bt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=$t;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=$r;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=At;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=Et;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=Ot;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=St;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=Pt;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=It;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var $=Sr;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=Tt;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var w=xt;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var A=Ft;Object.keys(A).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return A[h]}})})}(ii);var ms={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var O=0;O<g.length;O++){var S=g[O];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,g,O){return g&&m(v.prototype,g),O&&m(v,O),v}}(),t=Pr;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=_;var n=Or,i=l(n),a=xe.exports,o=l(a),s=ii,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(v[g]=m[g]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function d(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function _(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var g=new R(v);m(g),g.resolve()}return v}var $=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.name=g,O}return e(v,[{key:"resolve",value:function(O){var S=O.definitions[this.name];return S.resolve(O)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g,O){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var B=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return B.childReference=g,B.length=O,B.variable=S,B}return e(v,[{key:"resolve",value:function(O){var S=this.childReference,B=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),B instanceof t.Reference&&(B=B.resolve(O)),this.variable?new f.VarArray(S,B):new f.Array(S,B)}}]),v}(t.Reference),w=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.childReference=g,O.name=g.name,O}return e(v,[{key:"resolve",value:function(O){var S=this.childReference;return S instanceof t.Reference&&(S=S.resolve(O)),new f.Option(S)}}]),v}(t.Reference),A=function(m){d(v,m);function v(g,O){u(this,v);var S=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return S.sizedType=g,S.length=O,S}return e(v,[{key:"resolve",value:function(O){var S=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),new this.sizedType(S)}}]),v}(t.Reference),h=function(){function m(v,g,O){u(this,m),this.constructor=v,this.name=g,this.config=O}return e(m,[{key:"resolve",value:function(g){return this.name in g.results?g.results[this.name]:this.constructor(g,this.name,this.config)}}]),m}();function P(m,v,g){return g instanceof t.Reference&&(g=g.resolve(m)),m.results[v]=g,g}function I(m,v,g){return m.results[v]=g,g}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(g,O){var S=new h(f.Enum.create,g,O);this.define(g,S)}},{key:"struct",value:function(g,O){var S=new h(f.Struct.create,g,O);this.define(g,S)}},{key:"union",value:function(g,O){var S=new h(f.Union.create,g,O);this.define(g,S)}},{key:"typedef",value:function(g,O){var S=new h(P,g,O);this.define(g,S)}},{key:"const",value:function(g,O){var S=new h(I,g,O);this.define(g,S)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(g){return new A(f.String,g)}},{key:"opaque",value:function(g){return new A(f.Opaque,g)}},{key:"varOpaque",value:function(g){return new A(f.VarOpaque,g)}},{key:"array",value:function(g,O){return new b(g,O)}},{key:"varArray",value:function(g,O){return new b(g,O,!0)}},{key:"option",value:function(g){return new w(g)}},{key:"define",value:function(g,O){if((0,i.default)(this._destination[g]))this._definitions[g]=O;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new $(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(O){O.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(ms),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ii;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=ms;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(uu);function OP(r){const e={variantId:le.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new le.BundleItem({collectionId:le.Uint64.fromString(n.collectionId.toString()),productId:le.Uint64.fromString(n.productId.toString()),variantId:le.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new le.BundleItemExt(0)})),ext:new le.BundleExt(0)},t=new le.Bundle(e);return le.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const le=uu.config(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})}),ws="/bundling-storefront-manager";function SP(){return Math.ceil(Date.now()/1e3)}async function PP(){try{const{timestamp:r}=await sr("get",`${ws}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),SP()}}async function IP(r){const e=ue(),t=await bs(r);if(t!==!0)throw new Error(t);const n=await PP(),i=OP({variantId:r.externalVariantId,version:n,items:r.selections.map(a=>({collectionId:a.collectionId,productId:a.externalProductId,variantId:a.externalVariantId,quantity:a.quantity,sku:""}))});try{const a=await sr("post",`${ws}/api/v1/bundles`,{data:{bundle:i},headers:{Origin:`https://${e.storeIdentifier}`}});if(!a.id||a.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(a)}`);return a.id}catch(a){throw new Error(`2: failed generating rb_id ${a}`)}}function TP(r,e){const t=$s(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${qp(9)}:${r.externalProductId}`;return r.selections.map(i=>{const a={id:i.externalVariantId,quantity:i.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:r.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:i.collectionId}};return i.sellingPlan?a.selling_plan=i.sellingPlan:i.shippingIntervalFrequency&&(a.properties.shipping_interval_frequency=i.shippingIntervalFrequency,a.properties.shipping_interval_unit_type=i.shippingIntervalUnitType,a.id=`${i.discountedVariantId}`),a})}async function bs(r){try{return r?await au(r.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const xP={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function $s(r){if(!r)return"No bundle defined.";if(r.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:t}=r.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||t){if(!e||!t)return"Shipping intervals do not match on selections.";{const n=xP[t];for(let i=0;i<r.selections.length;i++){const{shippingIntervalFrequency:a,shippingIntervalUnitType:o}=r.selections[i];if(a&&a!==e||o&&!n.includes(o))return"Shipping intervals do not match on selections."}}}return!0}async function RP(r,e){const{bundle_selection:t}=await E("get","/bundle_selections",{id:e},r);return t}function FP(r,e){return E("get","/bundle_selections",{query:e},r)}async function MP(r,e){const{bundle_selection:t}=await E("post","/bundle_selections",{data:e},r);return t}async function DP(r,e,t){const{bundle_selection:n}=await E("put","/bundle_selections",{id:e,data:t},r);return n}function BP(r,e){return E("delete","/bundle_selections",{id:e},r)}var NP=Object.freeze({__proto__:null,getBundleId:IP,getDynamicBundleItems:TP,validateBundle:bs,validateDynamicBundle:$s,getBundleSelection:RP,listBundleSelections:FP,createBundleSelection:MP,updateBundleSelection:DP,deleteBundleSelection:BP});async function UP(r,e,t){const{charge:n}=await E("get","/charges",{id:e,query:{include:t?.include}},r);return n}function CP(r,e){return E("get","/charges",{query:e},r)}async function LP(r,e,t){const{charge:n}=await E("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function jP(r,e){const{charge:t}=await E("post",`/charges/${e}/remove_discount`,{},r);return t}async function kP(r,e,t){const{charge:n}=await E("post",`/charges/${e}/skip`,{data:{purchase_item_ids:t.map(i=>Number(i))}},r);return n}async function qP(r,e,t){const{charge:n}=await E("post",`/charges/${e}/unskip`,{data:{purchase_item_ids:t.map(i=>Number(i))}},r);return n}async function GP(r,e){const{charge:t}=await E("post",`/charges/${e}/process`,{},r);return t}var WP=Object.freeze({__proto__:null,getCharge:UP,listCharges:CP,applyDiscountToCharge:LP,removeDiscountsFromCharge:jP,skipCharge:kP,unskipCharge:qP,processCharge:GP});async function VP(r,e){const{membership:t}=await E("get","/memberships",{id:e},r);return t}function HP(r,e){return E("get","/memberships",{query:e},r)}async function zP(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function XP(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/activate`,{data:t},r);return n}async function YP(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/change`,{data:t},r);return n}var KP=Object.freeze({__proto__:null,getMembership:VP,listMemberships:HP,cancelMembership:zP,activateMembership:XP,changeMembership:YP});async function ZP(r,e,t){const{membership_program:n}=await E("get","/membership_programs",{id:e,query:{include:t?.include}},r);return n}function JP(r,e){return E("get","/membership_programs",{query:e},r)}var QP=Object.freeze({__proto__:null,getMembershipProgram:ZP,listMembershipPrograms:JP});async function eI(r,e){const{metafield:t}=await E("post","/metafields",{data:{metafield:e}},r);return t}async function rI(r,e,t){const{metafield:n}=await E("put","/metafields",{id:e,data:{metafield:t}},r);return n}function tI(r,e){return E("delete","/metafields",{id:e},r)}var nI=Object.freeze({__proto__:null,createMetafield:eI,updateMetafield:rI,deleteMetafield:tI});async function iI(r,e){const{onetime:t}=await E("get","/onetimes",{id:e},r);return t}function aI(r,e){return E("get","/onetimes",{query:e},r)}async function oI(r,e){const{onetime:t}=await E("post","/onetimes",{data:e},r);return t}async function uI(r,e,t){const{onetime:n}=await E("put","/onetimes",{id:e,data:t},r);return n}function sI(r,e){return E("delete","/onetimes",{id:e},r)}var fI=Object.freeze({__proto__:null,getOnetime:iI,listOnetimes:aI,createOnetime:oI,updateOnetime:uI,deleteOnetime:sI});async function cI(r,e){const{order:t}=await E("get","/orders",{id:e},r);return t}function lI(r,e){return E("get","/orders",{query:e},r)}var pI=Object.freeze({__proto__:null,getOrder:cI,listOrders:lI});async function hI(r,e,t){const{payment_method:n}=await E("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function dI(r,e,t){const{payment_method:n}=await E("put","/payment_methods",{id:e,data:t},r);return n}function yI(r,e){return E("get","/payment_methods",{query:e},r)}var vI=Object.freeze({__proto__:null,getPaymentMethod:hI,updatePaymentMethod:dI,listPaymentMethods:yI});async function gI(r,e){const{plan:t}=await E("get","/plans",{id:e},r);return t}function _I(r,e){return E("get","/plans",{query:e},r)}var mI=Object.freeze({__proto__:null,getPlan:gI,listPlans:_I}),As=ho,wI=As&&new As,Es=wI,bI=dr,Os=Es,$I=Os?function(r,e){return Os.set(r,e),r}:bI,Ss=$I,AI=st,EI=fe;function OI(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=AI(r.prototype),n=r.apply(t,e);return EI(n)?n:t}}var Nt=OI,SI=Nt,PI=G,II=1;function TI(r,e,t){var n=e&II,i=SI(r);function a(){var o=this&&this!==PI&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}var xI=TI,RI=Math.max;function FI(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,c=RI(a-o,0),l=Array(f+c),u=!n;++s<f;)l[s]=e[s];for(;++i<o;)(u||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[s++]=r[i++];return l}var Ps=FI,MI=Math.max;function DI(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,c=e.length,l=MI(a-s,0),u=Array(l+c),p=!n;++i<l;)u[i]=r[i];for(var d=i;++f<c;)u[d+f]=e[f];for(;++o<s;)(p||i<a)&&(u[d+t[o]]=r[i++]);return u}var Is=DI;function BI(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&++n;return n}var NI=BI;function UI(){}var vi=UI,CI=st,LI=vi,jI=4294967295;function Ut(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=jI,this.__views__=[]}Ut.prototype=CI(LI.prototype),Ut.prototype.constructor=Ut;var gi=Ut;function kI(){}var qI=kI,Ts=Es,GI=qI,WI=Ts?function(r){return Ts.get(r)}:GI,xs=WI,VI={},HI=VI,Rs=HI,zI=Object.prototype,XI=zI.hasOwnProperty;function YI(r){for(var e=r.name+"",t=Rs[e],n=XI.call(Rs,e)?t.length:0;n--;){var i=t[n],a=i.func;if(a==null||a==r)return i.name}return e}var KI=YI,ZI=st,JI=vi;function Ct(r,e){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Ct.prototype=ZI(JI.prototype),Ct.prototype.constructor=Ct;var Fs=Ct,QI=gi,eT=Fs,rT=kn;function tT(r){if(r instanceof QI)return r.clone();var e=new eT(r.__wrapped__,r.__chain__);return e.__actions__=rT(r.__actions__),e.__index__=r.__index__,e.__values__=r.__values__,e}var nT=tT,iT=gi,Ms=Fs,aT=vi,oT=U,uT=V,sT=nT,fT=Object.prototype,cT=fT.hasOwnProperty;function Lt(r){if(uT(r)&&!oT(r)&&!(r instanceof iT)){if(r instanceof Ms)return r;if(cT.call(r,"__wrapped__"))return sT(r)}return new Ms(r)}Lt.prototype=aT.prototype,Lt.prototype.constructor=Lt;var lT=Lt,pT=gi,hT=xs,dT=KI,yT=lT;function vT(r){var e=dT(r),t=yT[e];if(typeof t!="function"||!(e in pT.prototype))return!1;if(r===t)return!0;var n=hT(t);return!!n&&r===n[0]}var gT=vT,_T=Ss,mT=Ho,wT=mT(_T),Ds=wT,bT=/\{\n\/\* \[wrapped with (.+)\] \*/,$T=/,? & /;function AT(r){var e=r.match(bT);return e?e[1].split($T):[]}var ET=AT,OT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function ST(r,e){var t=e.length;if(!t)return r;var n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(OT,`{
|
|
25
|
-
/* [wrapped with `+e+`] */
|
|
26
|
-
`)}var PT=ST;function IT(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}var TT=IT;function xT(r){return r!==r}var RT=xT;function FT(r,e,t){for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}var MT=FT,DT=TT,BT=RT,NT=MT;function UT(r,e,t){return e===e?NT(r,e,t):DT(r,BT,t)}var CT=UT,LT=CT;function jT(r,e){var t=r==null?0:r.length;return!!t&<(r,e,0)>-1}var kT=jT,qT=Bn,GT=kT,WT=1,VT=2,HT=8,zT=16,XT=32,YT=64,KT=128,ZT=256,JT=512,QT=[["ary",KT],["bind",WT],["bindKey",VT],["curry",HT],["curryRight",zT],["flip",JT],["partial",XT],["partialRight",YT],["rearg",ZT]];function ex(r,e){return qT(QT,function(t){var n="_."+t[0];e&t[1]&&!GT(r,n)&&r.push(n)}),r.sort()}var rx=ex,tx=ET,nx=PT,ix=ri,ax=rx;function ox(r,e,t){var n=e+"";return ix(r,nx(n,ax(tx(n),t)))}var Bs=ox,ux=gT,sx=Ds,fx=Bs,cx=1,lx=2,px=4,hx=8,Ns=32,Us=64;function dx(r,e,t,n,i,a,o,s,f,c){var l=e&hx,u=l?o:void 0,p=l?void 0:o,d=l?a:void 0,_=l?void 0:a;e|=l?Ns:Us,e&=~(l?Us:Ns),e&px||(e&=~(cx|lx));var $=[r,e,i,d,u,_,p,s,f,c],b=t.apply(void 0,$);return ux(r)&&sx(b,$),b.placeholder=n,fx(b,r,e)}var Cs=dx;function yx(r){var e=r;return e.placeholder}var _i=yx,vx=kn,gx=at,_x=Math.min;function mx(r,e){for(var t=r.length,n=_x(e.length,t),i=vx(r);n--;){var a=e[n];r[n]=gx(a,t)?i[a]:void 0}return r}var wx=mx,Ls="__lodash_placeholder__";function bx(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===Ls)&&(r[t]=Ls,a[i++]=t)}return a}var jt=bx,$x=Ps,Ax=Is,Ex=NI,js=Nt,Ox=Cs,Sx=_i,Px=wx,Ix=jt,Tx=G,xx=1,Rx=2,Fx=8,Mx=16,Dx=128,Bx=512;function ks(r,e,t,n,i,a,o,s,f,c){var l=e&Dx,u=e&xx,p=e&Rx,d=e&(Fx|Mx),_=e&Bx,$=p?void 0:js(r);function b(){for(var w=arguments.length,A=Array(w),h=w;h--;)A[h]=arguments[h];if(d)var P=Sx(b),I=Ex(A,P);if(n&&(A=$x(A,n,i,d)),a&&(A=Ax(A,a,o,d)),w-=I,d&&w<c){var R=Ix(A,P);return Ox(r,e,ks,b.placeholder,t,A,R,s,f,c-w)}var m=u?t:this,v=p?m[r]:r;return w=A.length,s?A=Px(A,s):_&&w>1&&A.reverse(),l&&f<w&&(A.length=f),this&&this!==Tx&&this instanceof b&&(v=$||js(v)),v.apply(m,A)}return b}var qs=ks,Nx=ei,Ux=Nt,Cx=qs,Lx=Cs,jx=_i,kx=jt,qx=G;function Gx(r,e,t){var n=Ux(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=jx(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:kx(o,f);if(a-=c.length,a<t)return Lx(r,e,Cx,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==qx&&this instanceof i?n:r;return Nx(l,this,o)}return i}var Wx=Gx,Vx=ei,Hx=Nt,zx=G,Xx=1;function Yx(r,e,t,n){var i=e&Xx,a=Hx(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),p=this&&this!==zx&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Vx(p,i?t:this,u)}return o}var Kx=Yx,Zx=Ps,Jx=Is,Gs=jt,Ws="__lodash_placeholder__",mi=1,Qx=2,eR=4,Vs=8,Tr=128,Hs=256,rR=Math.min;function tR(r,e){var t=r[1],n=e[1],i=t|n,a=i<(mi|Qx|Tr),o=n==Tr&&t==Vs||n==Tr&&t==Hs&&r[7].length<=e[8]||n==(Tr|Hs)&&e[7].length<=e[8]&&t==Vs;if(!(a||o))return r;n&mi&&(r[2]=e[2],i|=t&mi?0:eR);var s=e[3];if(s){var f=r[3];r[3]=f?Zx(f,s,e[4]):s,r[4]=f?Gs(r[3],Ws):e[4]}return s=e[5],s&&(f=r[5],r[5]=f?Jx(f,s,e[6]):s,r[6]=f?Gs(r[5],Ws):e[6]),s=e[7],s&&(r[7]=s),n&Tr&&(r[8]=r[8]==null?e[8]:rR(r[8],e[8])),r[9]==null&&(r[9]=e[9]),r[0]=e[0],r[1]=i,r}var nR=tR,iR=Ss,aR=xI,oR=Wx,uR=qs,sR=Kx,fR=xs,cR=nR,lR=Ds,pR=Bs,zs=ts,hR="Expected a function",Xs=1,dR=2,wi=8,bi=16,$i=32,Ys=64,Ks=Math.max;function yR(r,e,t,n,i,a,o,s){var f=e&dR;if(!f&&typeof r!="function")throw new TypeError(hR);var c=n?n.length:0;if(c||(e&=~($i|Ys),n=i=void 0),o=o===void 0?o:Ks(zs(o),0),s=s===void 0?s:zs(s),c-=i?i.length:0,e&Ys){var l=n,u=i;n=i=void 0}var p=f?void 0:fR(r),d=[r,e,t,n,i,l,u,a,o,s];if(p&&cR(d,p),r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]===void 0?f?0:r.length:Ks(d[9]-c,0),!s&&e&(wi|bi)&&(e&=~(wi|bi)),!e||e==Xs)var _=aR(r,e,t);else e==wi||e==bi?_=oR(r,e,s):(e==$i||e==(Xs|$i))&&!i.length?_=sR(r,e,t,n):_=uR.apply(void 0,d);var $=p?iR:lR;return pR($(_,d),r,e)}var vR=yR,gR=fu,_R=vR,mR=_i,wR=jt,bR=32,Ai=gR(function(r,e){var t=wR(e,mR(Ai));return _R(r,bR,void 0,e,t)});Ai.placeholder={};var Zs=Ai,$R=Object.defineProperty,AR=Object.defineProperties,ER=Object.getOwnPropertyDescriptors,Js=Object.getOwnPropertySymbols,OR=Object.prototype.hasOwnProperty,SR=Object.prototype.propertyIsEnumerable,Qs=(r,e,t)=>e in r?$R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ef=(r,e)=>{for(var t in e||(e={}))OR.call(e,t)&&Qs(r,t,e[t]);if(Js)for(var t of Js(e))SR.call(e,t)&&Qs(r,t,e[t]);return r},rf=(r,e)=>AR(r,ER(e));function PR(r,e){return rf(ef({},ti(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${e.charge_interval_frequency}`,order_interval_frequency:`${e.order_interval_frequency}`,status:e.status?e.status.toUpperCase():void 0})}function IR(r,e){var t;return rf(ef({},ti(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=e.external_variant_id)!=null&&t.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:e.charge_interval_frequency?`${e.charge_interval_frequency}`:void 0,order_interval_frequency:e.order_interval_frequency?`${e.order_interval_frequency}`:void 0,force_update:r})}function tf(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:u,shopify_variant_id:p,has_queued_charges:d,is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:w,next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:P,order_interval_frequency:I,order_interval_unit:R,presentment_currency:m,price:v,product_title:g,properties:O,quantity:S,sku:B,sku_override:H,status:te,updated_at:X,variant_title:Re}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${p}`},has_queued_charges:Yo(d),is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:Yo(w),next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:P,order_interval_frequency:parseInt(I,10),order_interval_unit:R,presentment_currency:m,price:`${v}`,product_title:g??"",properties:O,quantity:S,sku:B,sku_override:H,status:te.toLowerCase(),updated_at:X,variant_title:Re}}async function TR(r,e,t){const{subscription:n}=await E("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function xR(r,e){return E("get","/subscriptions",{query:e},r)}async function RR(r,e,t){const{subscription:n}=await E("post","/subscriptions",{data:e,query:t},r);return n}async function FR(r,e,t,n){const{subscription:i}=await E("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function MR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},r);return i}async function DR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function BR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/cancel`,{data:t,query:n},r);return i}async function NR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/activate`,{query:t},r);return n}async function UR(r,e,t){const{charge:n}=await E("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}async function CR(r,e){const t=e.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=r;if(!n)throw new Error("No customerId in session.");const i=e[0].address_id;if(!e.every(f=>f.address_id===i))throw new Error("All subscriptions must have the same address_id.");const a=Zs(PR,n),o=e.map(a),{subscriptions:s}=await E("post",`/addresses/${i}/subscriptions-bulk`,{data:{subscriptions:o},headers:{"X-Recharge-Version":"2021-01"}},r);return s.map(tf)}async function LR(r,e,t,n){const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=Zs(IR,!!(n!=null&&n.force_update)),s=t.map(o),{subscriptions:f}=await E("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s},headers:{"X-Recharge-Version":"2021-01"}},r);return f.map(tf)}var jR=Object.freeze({__proto__:null,getSubscription:TR,listSubscriptions:xR,createSubscription:RR,updateSubscription:FR,updateSubscriptionChargeDate:MR,updateSubscriptionAddress:DR,cancelSubscription:BR,activateSubscription:NR,skipSubscriptionCharge:UR,createSubscriptions:CR,updateSubscriptions:LR});async function kR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function qR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("put","/customers",{id:t,data:e},r);return n}async function GR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await E("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}async function WR(r){return await E("get","/portal_access",{},r)}var VR=Object.freeze({__proto__:null,getCustomer:kR,updateCustomer:qR,getDeliverySchedule:GR,getCustomerPortalAccess:WR});const HR={get(r,e){return z("get",r,e)},post(r,e){return z("post",r,e)},put(r,e){return z("put",r,e)},delete(r,e){return z("delete",r,e)}};function zR(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function XR(r={}){const e=r,{storefrontAccessToken:t}=r;if(t&&!t.startsWith("strfnt"))throw new Error("Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.");pp({storeIdentifier:zR(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:t,environment:e.environment?e.environment:"prod"}),ou()}const nf={init:XR,api:HR,address:Rp,auth:kp,bundle:NP,charge:WP,cdn:w1,customer:VR,membership:KP,membershipProgram:QP,metafield:nI,onetime:fI,order:pI,paymentMethod:vI,plan:mI,subscription:jR};try{nf.init()}catch{}return nf});
|
|
8
|
+
*/var wu=50;$.TYPED_ARRAY_SUPPORT=tr.TYPED_ARRAY_SUPPORT!==void 0?tr.TYPED_ARRAY_SUPPORT:!0,qr();function qr(){return $.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ae(e,r){if(qr()<r)throw new RangeError("Invalid typed array length");return $.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=$.prototype):(e===null&&(e=new $(r)),e.length=r),e}function $(e,r,t){if(!$.TYPED_ARRAY_SUPPORT&&!(this instanceof $))return new $(e,r,t);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return Lt(this,e)}return yi(this,e,r,t)}$.poolSize=8192,$._augment=function(e){return e.__proto__=$.prototype,e};function yi(e,r,t,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Au(e,r,t,n):typeof r=="string"?$u(e,r,t):Eu(e,r)}$.from=function(e,r,t){return yi(null,e,r,t)},$.TYPED_ARRAY_SUPPORT&&($.prototype.__proto__=Uint8Array.prototype,$.__proto__=Uint8Array);function gi(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function bu(e,r,t,n){return gi(r),r<=0?Ae(e,r):t!==void 0?typeof n=="string"?Ae(e,r).fill(t,n):Ae(e,r).fill(t):Ae(e,r)}$.alloc=function(e,r,t){return bu(null,e,r,t)};function Lt(e,r){if(gi(r),e=Ae(e,r<0?0:kt(r)|0),!$.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}$.allocUnsafe=function(e){return Lt(null,e)},$.allocUnsafeSlow=function(e){return Lt(null,e)};function $u(e,r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!$.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=vi(r,t)|0;e=Ae(e,n);var a=e.write(r,t);return a!==n&&(e=e.slice(0,a)),e}function jt(e,r){var t=r.length<0?0:kt(r.length)|0;e=Ae(e,t);for(var n=0;n<t;n+=1)e[n]=r[n]&255;return e}function Au(e,r,t,n){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,t):r=new Uint8Array(r,t,n),$.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=$.prototype):e=jt(e,r),e}function Eu(e,r){if(ge(r)){var t=kt(r.length)|0;return e=Ae(e,t),e.length===0||r.copy(e,0,0,t),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||Wu(r.length)?Ae(e,0):jt(e,r);if(r.type==="Buffer"&&di(r.data))return jt(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function kt(e){if(e>=qr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qr().toString(16)+" bytes");return e|0}$.isBuffer=qu;function ge(e){return!!(e!=null&&e._isBuffer)}$.compare=function(r,t){if(!ge(r)||!ge(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var n=r.length,a=t.length,s=0,c=Math.min(n,a);s<c;++s)if(r[s]!==t[s]){n=r[s],a=t[s];break}return n<a?-1:a<n?1:0},$.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},$.concat=function(r,t){if(!di(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return $.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;var a=$.allocUnsafe(t),s=0;for(n=0;n<r.length;++n){var c=r[n];if(!ge(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(a,s),s+=c.length}return a};function vi(e,r){if(ge(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;if(t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Hr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return xi(e).length;default:if(n)return Hr(e).length;r=(""+r).toLowerCase(),n=!0}}$.byteLength=vi;function Su(e,r,t){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return Uu(this,r,t);case"utf8":case"utf-8":return bi(this,r,t);case"ascii":return Fu(this,r,t);case"latin1":case"binary":return Cu(this,r,t);case"base64":return Pu(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Du(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}$.prototype._isBuffer=!0;function We(e,r,t){var n=e[r];e[r]=e[t],e[t]=n}$.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)We(this,t,t+1);return this},$.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)We(this,t,t+3),We(this,t+1,t+2);return this},$.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)We(this,t,t+7),We(this,t+1,t+6),We(this,t+2,t+5),We(this,t+3,t+4);return this},$.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?bi(this,0,r):Su.apply(this,arguments)},$.prototype.equals=function(r){if(!ge(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:$.compare(this,r)===0},$.prototype.inspect=function(){var r="",t=wu;return this.length>0&&(r=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(r+=" ... ")),"<Buffer "+r+">"},$.prototype.compare=function(r,t,n,a,s){if(!ge(r))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),a===void 0&&(a=0),s===void 0&&(s=this.length),t<0||n>r.length||a<0||s>this.length)throw new RangeError("out of range index");if(a>=s&&t>=n)return 0;if(a>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,a>>>=0,s>>>=0,this===r)return 0;for(var c=s-a,p=n-t,h=Math.min(c,p),v=this.slice(a,s),_=r.slice(t,n),w=0;w<h;++w)if(v[w]!==_[w]){c=v[w],p=_[w];break}return c<p?-1:p<c?1:0};function mi(e,r,t,n,a){if(e.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(a)return-1;t=e.length-1}else if(t<0)if(a)t=0;else return-1;if(typeof r=="string"&&(r=$.from(r,n)),ge(r))return r.length===0?-1:_i(e,r,t,n,a);if(typeof r=="number")return r=r&255,$.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):_i(e,[r],t,n,a);throw new TypeError("val must be string, number or Buffer")}function _i(e,r,t,n,a){var s=1,c=e.length,p=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;s=2,c/=2,p/=2,t/=2}function h(d,E){return s===1?d[E]:d.readUInt16BE(E*s)}var v;if(a){var _=-1;for(v=t;v<c;v++)if(h(e,v)===h(r,_===-1?0:v-_)){if(_===-1&&(_=v),v-_+1===p)return _*s}else _!==-1&&(v-=v-_),_=-1}else for(t+p>c&&(t=c-p),v=t;v>=0;v--){for(var w=!0,b=0;b<p;b++)if(h(e,v+b)!==h(r,b)){w=!1;break}if(w)return v}return-1}$.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1},$.prototype.indexOf=function(r,t,n){return mi(this,r,t,n,!0)},$.prototype.lastIndexOf=function(r,t,n){return mi(this,r,t,n,!1)};function xu(e,r,t,n){t=Number(t)||0;var a=e.length-t;n?(n=Number(n),n>a&&(n=a)):n=a;var s=r.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var c=0;c<n;++c){var p=parseInt(r.substr(c*2,2),16);if(isNaN(p))return c;e[t+c]=p}return c}function Iu(e,r,t,n){return Yr(Hr(r,e.length-t),e,t,n)}function wi(e,r,t,n){return Yr(ku(r),e,t,n)}function Tu(e,r,t,n){return wi(e,r,t,n)}function Ou(e,r,t,n){return Yr(xi(r),e,t,n)}function Bu(e,r,t,n){return Yr(Gu(r,e.length-t),e,t,n)}$.prototype.write=function(r,t,n,a){if(t===void 0)a="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")a=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((n===void 0||n>s)&&(n=s),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var c=!1;;)switch(a){case"hex":return xu(this,r,t,n);case"utf8":case"utf-8":return Iu(this,r,t,n);case"ascii":return wi(this,r,t,n);case"latin1":case"binary":return Tu(this,r,t,n);case"base64":return Ou(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Bu(this,r,t,n);default:if(c)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),c=!0}},$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Pu(e,r,t){return r===0&&t===e.length?pi(e):pi(e.slice(r,t))}function bi(e,r,t){t=Math.min(e.length,t);for(var n=[],a=r;a<t;){var s=e[a],c=null,p=s>239?4:s>223?3:s>191?2:1;if(a+p<=t){var h,v,_,w;switch(p){case 1:s<128&&(c=s);break;case 2:h=e[a+1],(h&192)===128&&(w=(s&31)<<6|h&63,w>127&&(c=w));break;case 3:h=e[a+1],v=e[a+2],(h&192)===128&&(v&192)===128&&(w=(s&15)<<12|(h&63)<<6|v&63,w>2047&&(w<55296||w>57343)&&(c=w));break;case 4:h=e[a+1],v=e[a+2],_=e[a+3],(h&192)===128&&(v&192)===128&&(_&192)===128&&(w=(s&15)<<18|(h&63)<<12|(v&63)<<6|_&63,w>65535&&w<1114112&&(c=w))}}c===null?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|c&1023),n.push(c),a+=p}return Ru(n)}var $i=4096;function Ru(e){var r=e.length;if(r<=$i)return String.fromCharCode.apply(String,e);for(var t="",n=0;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=$i));return t}function Fu(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(e[a]&127);return n}function Cu(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(e[a]);return n}function Uu(e,r,t){var n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);for(var a="",s=r;s<t;++s)a+=ju(e[s]);return a}function Du(e,r,t){for(var n=e.slice(r,t),a="",s=0;s<n.length;s+=2)a+=String.fromCharCode(n[s]+n[s+1]*256);return a}$.prototype.slice=function(r,t){var n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);var a;if($.TYPED_ARRAY_SUPPORT)a=this.subarray(r,t),a.__proto__=$.prototype;else{var s=t-r;a=new $(s,void 0);for(var c=0;c<s;++c)a[c]=this[c+r]}return a};function K(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUIntLE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r],s=1,c=0;++c<t&&(s*=256);)a+=this[r+c]*s;return a},$.prototype.readUIntBE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r+--t],s=1;t>0&&(s*=256);)a+=this[r+--t]*s;return a},$.prototype.readUInt8=function(r,t){return t||K(r,1,this.length),this[r]},$.prototype.readUInt16LE=function(r,t){return t||K(r,2,this.length),this[r]|this[r+1]<<8},$.prototype.readUInt16BE=function(r,t){return t||K(r,2,this.length),this[r]<<8|this[r+1]},$.prototype.readUInt32LE=function(r,t){return t||K(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},$.prototype.readUInt32BE=function(r,t){return t||K(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},$.prototype.readIntLE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r],s=1,c=0;++c<t&&(s*=256);)a+=this[r+c]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*t)),a},$.prototype.readIntBE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=t,s=1,c=this[r+--a];a>0&&(s*=256);)c+=this[r+--a]*s;return s*=128,c>=s&&(c-=Math.pow(2,8*t)),c},$.prototype.readInt8=function(r,t){return t||K(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},$.prototype.readInt16LE=function(r,t){t||K(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},$.prototype.readInt16BE=function(r,t){t||K(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},$.prototype.readInt32LE=function(r,t){return t||K(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},$.prototype.readInt32BE=function(r,t){return t||K(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},$.prototype.readFloatLE=function(r,t){return t||K(r,4,this.length),Wr(this,r,!0,23,4)},$.prototype.readFloatBE=function(r,t){return t||K(r,4,this.length),Wr(this,r,!1,23,4)},$.prototype.readDoubleLE=function(r,t){return t||K(r,8,this.length),Wr(this,r,!0,52,8)},$.prototype.readDoubleBE=function(r,t){return t||K(r,8,this.length),Wr(this,r,!1,52,8)};function ie(e,r,t,n,a,s){if(!ge(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>a||r<s)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}$.prototype.writeUIntLE=function(r,t,n,a){if(r=+r,t=t|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;ie(this,r,t,n,s,0)}var c=1,p=0;for(this[t]=r&255;++p<n&&(c*=256);)this[t+p]=r/c&255;return t+n},$.prototype.writeUIntBE=function(r,t,n,a){if(r=+r,t=t|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;ie(this,r,t,n,s,0)}var c=n-1,p=1;for(this[t+c]=r&255;--c>=0&&(p*=256);)this[t+c]=r/p&255;return t+n},$.prototype.writeUInt8=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,1,255,0),$.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=r&255,t+1};function zr(e,r,t,n){r<0&&(r=65535+r+1);for(var a=0,s=Math.min(e.length-t,2);a<s;++a)e[t+a]=(r&255<<8*(n?a:1-a))>>>(n?a:1-a)*8}$.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):zr(this,r,t,!0),t+2},$.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):zr(this,r,t,!1),t+2};function Vr(e,r,t,n){r<0&&(r=4294967295+r+1);for(var a=0,s=Math.min(e.length-t,4);a<s;++a)e[t+a]=r>>>(n?a:3-a)*8&255}$.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255):Vr(this,r,t,!0),t+4},$.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):Vr(this,r,t,!1),t+4},$.prototype.writeIntLE=function(r,t,n,a){if(r=+r,t=t|0,!a){var s=Math.pow(2,8*n-1);ie(this,r,t,n,s-1,-s)}var c=0,p=1,h=0;for(this[t]=r&255;++c<n&&(p*=256);)r<0&&h===0&&this[t+c-1]!==0&&(h=1),this[t+c]=(r/p>>0)-h&255;return t+n},$.prototype.writeIntBE=function(r,t,n,a){if(r=+r,t=t|0,!a){var s=Math.pow(2,8*n-1);ie(this,r,t,n,s-1,-s)}var c=n-1,p=1,h=0;for(this[t+c]=r&255;--c>=0&&(p*=256);)r<0&&h===0&&this[t+c+1]!==0&&(h=1),this[t+c]=(r/p>>0)-h&255;return t+n},$.prototype.writeInt8=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,1,127,-128),$.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=r&255,t+1},$.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):zr(this,r,t,!0),t+2},$.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):zr(this,r,t,!1),t+2},$.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,2147483647,-2147483648),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):Vr(this,r,t,!0),t+4},$.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):Vr(this,r,t,!1),t+4};function Ai(e,r,t,n,a,s){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ei(e,r,t,n,a){return a||Ai(e,r,t,4),hi(e,r,t,n,23,4),t+4}$.prototype.writeFloatLE=function(r,t,n){return Ei(this,r,t,!0,n)},$.prototype.writeFloatBE=function(r,t,n){return Ei(this,r,t,!1,n)};function Si(e,r,t,n,a){return a||Ai(e,r,t,8),hi(e,r,t,n,52,8),t+8}$.prototype.writeDoubleLE=function(r,t,n){return Si(this,r,t,!0,n)},$.prototype.writeDoubleBE=function(r,t,n){return Si(this,r,t,!1,n)},$.prototype.copy=function(r,t,n,a){if(n||(n=0),!a&&a!==0&&(a=this.length),t>=r.length&&(t=r.length),t||(t=0),a>0&&a<n&&(a=n),a===n||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),r.length-t<a-n&&(a=r.length-t+n);var s=a-n,c;if(this===r&&n<t&&t<a)for(c=s-1;c>=0;--c)r[c+t]=this[c+n];else if(s<1e3||!$.TYPED_ARRAY_SUPPORT)for(c=0;c<s;++c)r[c+t]=this[c+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+s),t);return s},$.prototype.fill=function(r,t,n,a){if(typeof r=="string"){if(typeof t=="string"?(a=t,t=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),r.length===1){var s=r.charCodeAt(0);s<256&&(r=s)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!$.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof r=="number"&&(r=r&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var c;if(typeof r=="number")for(c=t;c<n;++c)this[c]=r;else{var p=ge(r)?r:Hr(new $(r,a).toString()),h=p.length;for(c=0;c<n-t;++c)this[c+t]=p[c%h]}return this};var Nu=/[^+\/0-9A-Za-z-_]/g;function Mu(e){if(e=Lu(e).replace(Nu,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Lu(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function ju(e){return e<16?"0"+e.toString(16):e.toString(16)}function Hr(e,r){r=r||1/0;for(var t,n=e.length,a=null,s=[],c=0;c<n;++c){if(t=e.charCodeAt(c),t>55295&&t<57344){if(!a){if(t>56319){(r-=3)>-1&&s.push(239,191,189);continue}else if(c+1===n){(r-=3)>-1&&s.push(239,191,189);continue}a=t;continue}if(t<56320){(r-=3)>-1&&s.push(239,191,189),a=t;continue}t=(a-55296<<10|t-56320)+65536}else a&&(r-=3)>-1&&s.push(239,191,189);if(a=null,t<128){if((r-=1)<0)break;s.push(t)}else if(t<2048){if((r-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function ku(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function Gu(e,r){for(var t,n,a,s=[],c=0;c<e.length&&!((r-=2)<0);++c)t=e.charCodeAt(c),n=t>>8,a=t%256,s.push(a),s.push(n);return s}function xi(e){return gu(Mu(e))}function Yr(e,r,t,n){for(var a=0;a<n&&!(a+t>=r.length||a>=e.length);++a)r[a+t]=e[a];return a}function Wu(e){return e!==e}function qu(e){return e!=null&&(!!e._isBuffer||Ii(e)||zu(e))}function Ii(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function zu(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Ii(e.slice(0,0))}function Ti(){throw new Error("setTimeout has not been defined")}function Oi(){throw new Error("clearTimeout has not been defined")}var Be=Ti,Pe=Oi;typeof tr.setTimeout=="function"&&(Be=setTimeout),typeof tr.clearTimeout=="function"&&(Pe=clearTimeout);function Bi(e){if(Be===setTimeout)return setTimeout(e,0);if((Be===Ti||!Be)&&setTimeout)return Be=setTimeout,setTimeout(e,0);try{return Be(e,0)}catch{try{return Be.call(null,e,0)}catch{return Be.call(this,e,0)}}}function Vu(e){if(Pe===clearTimeout)return clearTimeout(e);if((Pe===Oi||!Pe)&&clearTimeout)return Pe=clearTimeout,clearTimeout(e);try{return Pe(e)}catch{try{return Pe.call(null,e)}catch{return Pe.call(this,e)}}}var Ee=[],nr=!1,qe,Kr=-1;function Hu(){!nr||!qe||(nr=!1,qe.length?Ee=qe.concat(Ee):Kr=-1,Ee.length&&Pi())}function Pi(){if(!nr){var e=Bi(Hu);nr=!0;for(var r=Ee.length;r;){for(qe=Ee,Ee=[];++Kr<r;)qe&&qe[Kr].run();Kr=-1,r=Ee.length}qe=null,nr=!1,Vu(e)}}function Yu(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];Ee.push(new Ri(e,r)),Ee.length===1&&!nr&&Bi(Pi)}function Ri(e,r){this.fun=e,this.array=r}Ri.prototype.run=function(){this.fun.apply(null,this.array)};var Ku="browser",Xu="browser",Ju=!0,Qu={},Zu=[],ec="",rc={},tc={},nc={};function ze(){}var ic=ze,oc=ze,ac=ze,sc=ze,uc=ze,cc=ze,fc=ze;function lc(e){throw new Error("process.binding is not supported")}function pc(){return"/"}function hc(e){throw new Error("process.chdir is not supported")}function dc(){return 0}var ir=tr.performance||{},yc=ir.now||ir.mozNow||ir.msNow||ir.oNow||ir.webkitNow||function(){return new Date().getTime()};function gc(e){var r=yc.call(ir)*.001,t=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(t=t-e[0],n=n-e[1],n<0&&(t--,n+=1e9)),[t,n]}var vc=new Date;function mc(){var e=new Date,r=e-vc;return r/1e3}var Xr={nextTick:Yu,title:Ku,browser:Ju,env:Qu,argv:Zu,version:ec,versions:rc,on:ic,addListener:oc,once:ac,off:sc,removeListener:uc,removeAllListeners:cc,emit:fc,binding:lc,cwd:pc,chdir:hc,umask:dc,hrtime:gc,platform:Xu,release:tc,config:nc,uptime:mc},Gt;typeof Object.create=="function"?Gt=function(r,t){r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:Gt=function(r,t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r};var Fi=Gt,_c=/%[sdj%]/g;function Jr(e){if(!br(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(ve(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,a=n.length,s=String(e).replace(_c,function(p){if(p==="%%")return"%";if(t>=a)return p;switch(p){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return p}}),c=n[t];t<a;c=n[++t])wr(c)||!Ve(c)?s+=" "+c:s+=" "+ve(c);return s}function Wt(e,r){if(me(tr.process))return function(){return Wt(e,r).apply(this,arguments)};if(Xr.noDeprecation===!0)return e;var t=!1;function n(){if(!t){if(Xr.throwDeprecation)throw new Error(r);Xr.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}return n}var Qr={},qt;function Ci(e){if(me(qt)&&(qt=Xr.env.NODE_DEBUG||""),e=e.toUpperCase(),!Qr[e])if(new RegExp("\\b"+e+"\\b","i").test(qt)){var r=0;Qr[e]=function(){var t=Jr.apply(null,arguments);console.error("%s %d: %s",e,r,t)}}else Qr[e]=function(){};return Qr[e]}function ve(e,r){var t={seen:[],stylize:bc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),et(r)?t.showHidden=r:r&&Jt(t,r),me(t.showHidden)&&(t.showHidden=!1),me(t.depth)&&(t.depth=2),me(t.colors)&&(t.colors=!1),me(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=wc),Zr(t,e,t.depth)}ve.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ve.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function wc(e,r){var t=ve.styles[r];return t?"\x1B["+ve.colors[t][0]+"m"+e+"\x1B["+ve.colors[t][1]+"m":e}function bc(e,r){return e}function $c(e){var r={};return e.forEach(function(t,n){r[t]=!0}),r}function Zr(e,r,t){if(e.customInspect&&r&&Er(r.inspect)&&r.inspect!==ve&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(t,e);return br(n)||(n=Zr(e,n,t)),n}var a=Ac(e,r);if(a)return a;var s=Object.keys(r),c=$c(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),Ar(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return zt(r);if(s.length===0){if(Er(r)){var p=r.name?": "+r.name:"";return e.stylize("[Function"+p+"]","special")}if($r(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(rt(r))return e.stylize(Date.prototype.toString.call(r),"date");if(Ar(r))return zt(r)}var h="",v=!1,_=["{","}"];if(Ht(r)&&(v=!0,_=["[","]"]),Er(r)){var w=r.name?": "+r.name:"";h=" [Function"+w+"]"}if($r(r)&&(h=" "+RegExp.prototype.toString.call(r)),rt(r)&&(h=" "+Date.prototype.toUTCString.call(r)),Ar(r)&&(h=" "+zt(r)),s.length===0&&(!v||r.length==0))return _[0]+h+_[1];if(t<0)return $r(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var b;return v?b=Ec(e,r,t,c,s):b=s.map(function(d){return Vt(e,r,t,c,d,v)}),e.seen.pop(),Sc(b,h,_)}function Ac(e,r){if(me(r))return e.stylize("undefined","undefined");if(br(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(Yt(r))return e.stylize(""+r,"number");if(et(r))return e.stylize(""+r,"boolean");if(wr(r))return e.stylize("null","null")}function zt(e){return"["+Error.prototype.toString.call(e)+"]"}function Ec(e,r,t,n,a){for(var s=[],c=0,p=r.length;c<p;++c)ji(r,String(c))?s.push(Vt(e,r,t,n,String(c),!0)):s.push("");return a.forEach(function(h){h.match(/^\d+$/)||s.push(Vt(e,r,t,n,h,!0))}),s}function Vt(e,r,t,n,a,s){var c,p,h;if(h=Object.getOwnPropertyDescriptor(r,a)||{value:r[a]},h.get?h.set?p=e.stylize("[Getter/Setter]","special"):p=e.stylize("[Getter]","special"):h.set&&(p=e.stylize("[Setter]","special")),ji(n,a)||(c="["+a+"]"),p||(e.seen.indexOf(h.value)<0?(wr(t)?p=Zr(e,h.value,null):p=Zr(e,h.value,t-1),p.indexOf(`
|
|
9
|
+
`)>-1&&(s?p=p.split(`
|
|
10
|
+
`).map(function(v){return" "+v}).join(`
|
|
11
|
+
`).substr(2):p=`
|
|
12
|
+
`+p.split(`
|
|
13
|
+
`).map(function(v){return" "+v}).join(`
|
|
14
|
+
`))):p=e.stylize("[Circular]","special")),me(c)){if(s&&a.match(/^\d+$/))return p;c=JSON.stringify(""+a),c.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=e.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=e.stylize(c,"string"))}return c+": "+p}function Sc(e,r,t){var n=e.reduce(function(a,s){return s.indexOf(`
|
|
15
|
+
`)>=0,a+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(r===""?"":r+`
|
|
16
|
+
`)+" "+e.join(`,
|
|
17
|
+
`)+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function Ht(e){return Array.isArray(e)}function et(e){return typeof e=="boolean"}function wr(e){return e===null}function Ui(e){return e==null}function Yt(e){return typeof e=="number"}function br(e){return typeof e=="string"}function Di(e){return typeof e=="symbol"}function me(e){return e===void 0}function $r(e){return Ve(e)&&Kt(e)==="[object RegExp]"}function Ve(e){return typeof e=="object"&&e!==null}function rt(e){return Ve(e)&&Kt(e)==="[object Date]"}function Ar(e){return Ve(e)&&(Kt(e)==="[object Error]"||e instanceof Error)}function Er(e){return typeof e=="function"}function Ni(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}function Mi(e){return $.isBuffer(e)}function Kt(e){return Object.prototype.toString.call(e)}function Xt(e){return e<10?"0"+e.toString(10):e.toString(10)}var xc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ic(){var e=new Date,r=[Xt(e.getHours()),Xt(e.getMinutes()),Xt(e.getSeconds())].join(":");return[e.getDate(),xc[e.getMonth()],r].join(" ")}function Li(){console.log("%s - %s",Ic(),Jr.apply(null,arguments))}function Jt(e,r){if(!r||!Ve(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e}function ji(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var Tc={inherits:Fi,_extend:Jt,log:Li,isBuffer:Mi,isPrimitive:Ni,isFunction:Er,isError:Ar,isDate:rt,isObject:Ve,isRegExp:$r,isUndefined:me,isSymbol:Di,isString:br,isNumber:Yt,isNullOrUndefined:Ui,isNull:wr,isBoolean:et,isArray:Ht,inspect:ve,deprecate:Wt,format:Jr,debuglog:Ci},Oc=Object.freeze({__proto__:null,format:Jr,deprecate:Wt,debuglog:Ci,inspect:ve,isArray:Ht,isBoolean:et,isNull:wr,isNullOrUndefined:Ui,isNumber:Yt,isString:br,isSymbol:Di,isUndefined:me,isRegExp:$r,isObject:Ve,isDate:rt,isError:Ar,isFunction:Er,isPrimitive:Ni,isBuffer:Mi,log:Li,inherits:Fi,_extend:Jt,default:Tc}),Bc=vr(Oc),Pc=Bc.inspect,Qt=typeof Map=="function"&&Map.prototype,Zt=Object.getOwnPropertyDescriptor&&Qt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,tt=Qt&&Zt&&typeof Zt.get=="function"?Zt.get:null,ki=Qt&&Map.prototype.forEach,en=typeof Set=="function"&&Set.prototype,rn=Object.getOwnPropertyDescriptor&&en?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,nt=en&&rn&&typeof rn.get=="function"?rn.get:null,Gi=en&&Set.prototype.forEach,Rc=typeof WeakMap=="function"&&WeakMap.prototype,Sr=Rc?WeakMap.prototype.has:null,Fc=typeof WeakSet=="function"&&WeakSet.prototype,xr=Fc?WeakSet.prototype.has:null,Cc=typeof WeakRef=="function"&&WeakRef.prototype,Wi=Cc?WeakRef.prototype.deref:null,Uc=Boolean.prototype.valueOf,Dc=Object.prototype.toString,Nc=Function.prototype.toString,Mc=String.prototype.match,tn=String.prototype.slice,Re=String.prototype.replace,Lc=String.prototype.toUpperCase,qi=String.prototype.toLowerCase,zi=RegExp.prototype.test,Vi=Array.prototype.concat,_e=Array.prototype.join,jc=Array.prototype.slice,Hi=Math.floor,nn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,on=Object.getOwnPropertySymbols,an=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,or=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ee=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===or?"object":"symbol")?Symbol.toStringTag:null,Yi=Object.prototype.propertyIsEnumerable,Ki=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Xi(e,r){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||zi.call(/e/,r))return r;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-Hi(-e):Hi(e);if(n!==e){var a=String(n),s=tn.call(r,a.length+1);return Re.call(a,t,"$&_")+"."+Re.call(Re.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Re.call(r,t,"$&_")}var sn=Pc,Ji=sn.custom,Qi=ro(Ji)?Ji:null,kc=function e(r,t,n,a){var s=t||{};if(Fe(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Fe(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=Fe(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Fe(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Fe(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=s.numericSeparator;if(typeof r>"u")return"undefined";if(r===null)return"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return no(r,s);if(typeof r=="number"){if(r===0)return 1/0/r>0?"0":"-0";var h=String(r);return p?Xi(r,h):h}if(typeof r=="bigint"){var v=String(r)+"n";return p?Xi(r,v):v}var _=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof r=="object")return un(r)?"[Array]":"[Object]";var w=af(s,n);if(typeof a>"u")a=[];else if(to(a,r)>=0)return"[Circular]";function b(k,re,N){if(re&&(a=jc.call(a),a.push(re)),N){var ce={depth:s.depth};return Fe(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),e(k,ce,n+1,a)}return e(k,s,n+1,a)}if(typeof r=="function"&&!eo(r)){var d=Xc(r),E=it(r,b);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(E.length>0?" { "+_e.call(E,", ")+" }":"")}if(ro(r)){var x=or?Re.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):an.call(r);return typeof r=="object"&&!or?Ir(x):x}if(tf(r)){for(var I="<"+qi.call(String(r.nodeName)),S=r.attributes||[],T=0;T<S.length;T++)I+=" "+S[T].name+"="+Zi(Gc(S[T].value),"double",s);return I+=">",r.childNodes&&r.childNodes.length&&(I+="..."),I+="</"+qi.call(String(r.nodeName))+">",I}if(un(r)){if(r.length===0)return"[]";var P=it(r,b);return w&&!of(P)?"["+fn(P,w)+"]":"[ "+_e.call(P,", ")+" ]"}if(qc(r)){var B=it(r,b);return!("cause"in Error.prototype)&&"cause"in r&&!Yi.call(r,"cause")?"{ ["+String(r)+"] "+_e.call(Vi.call("[cause]: "+b(r.cause),B),", ")+" }":B.length===0?"["+String(r)+"]":"{ ["+String(r)+"] "+_e.call(B,", ")+" }"}if(typeof r=="object"&&c){if(Qi&&typeof r[Qi]=="function"&&sn)return sn(r,{depth:_-n});if(c!=="symbol"&&typeof r.inspect=="function")return r.inspect()}if(Jc(r)){var D=[];return ki&&ki.call(r,function(k,re){D.push(b(re,r,!0)+" => "+b(k,r))}),io("Map",tt.call(r),D,w)}if(ef(r)){var j=[];return Gi&&Gi.call(r,function(k){j.push(b(k,r))}),io("Set",nt.call(r),j,w)}if(Qc(r))return cn("WeakMap");if(rf(r))return cn("WeakSet");if(Zc(r))return cn("WeakRef");if(Vc(r))return Ir(b(Number(r)));if(Yc(r))return Ir(b(nn.call(r)));if(Hc(r))return Ir(Uc.call(r));if(zc(r))return Ir(b(String(r)));if(!Wc(r)&&!eo(r)){var q=it(r,b),z=Ki?Ki(r)===Object.prototype:r instanceof Object||r.constructor===Object,X=r instanceof Object?"":"null prototype",V=!z&&ee&&Object(r)===r&&ee in r?tn.call(Ce(r),8,-1):X?"Object":"",ae=z||typeof r.constructor!="function"?"":r.constructor.name?r.constructor.name+" ":"",ue=ae+(V||X?"["+_e.call(Vi.call([],V||[],X||[]),": ")+"] ":"");return q.length===0?ue+"{}":w?ue+"{"+fn(q,w)+"}":ue+"{ "+_e.call(q,", ")+" }"}return String(r)};function Zi(e,r,t){var n=(t.quoteStyle||r)==="double"?'"':"'";return n+e+n}function Gc(e){return Re.call(String(e),/"/g,""")}function un(e){return Ce(e)==="[object Array]"&&(!ee||!(typeof e=="object"&&ee in e))}function Wc(e){return Ce(e)==="[object Date]"&&(!ee||!(typeof e=="object"&&ee in e))}function eo(e){return Ce(e)==="[object RegExp]"&&(!ee||!(typeof e=="object"&&ee in e))}function qc(e){return Ce(e)==="[object Error]"&&(!ee||!(typeof e=="object"&&ee in e))}function zc(e){return Ce(e)==="[object String]"&&(!ee||!(typeof e=="object"&&ee in e))}function Vc(e){return Ce(e)==="[object Number]"&&(!ee||!(typeof e=="object"&&ee in e))}function Hc(e){return Ce(e)==="[object Boolean]"&&(!ee||!(typeof e=="object"&&ee in e))}function ro(e){if(or)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!an)return!1;try{return an.call(e),!0}catch{}return!1}function Yc(e){if(!e||typeof e!="object"||!nn)return!1;try{return nn.call(e),!0}catch{}return!1}var Kc=Object.prototype.hasOwnProperty||function(e){return e in this};function Fe(e,r){return Kc.call(e,r)}function Ce(e){return Dc.call(e)}function Xc(e){if(e.name)return e.name;var r=Mc.call(Nc.call(e),/^function\s*([\w$]+)/);return r?r[1]:null}function to(e,r){if(e.indexOf)return e.indexOf(r);for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}function Jc(e){if(!tt||!e||typeof e!="object")return!1;try{tt.call(e);try{nt.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function Qc(e){if(!Sr||!e||typeof e!="object")return!1;try{Sr.call(e,Sr);try{xr.call(e,xr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function Zc(e){if(!Wi||!e||typeof e!="object")return!1;try{return Wi.call(e),!0}catch{}return!1}function ef(e){if(!nt||!e||typeof e!="object")return!1;try{nt.call(e);try{tt.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function rf(e){if(!xr||!e||typeof e!="object")return!1;try{xr.call(e,xr);try{Sr.call(e,Sr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function tf(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function no(e,r){if(e.length>r.maxStringLength){var t=e.length-r.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return no(tn.call(e,0,r.maxStringLength),r)+n}var a=Re.call(Re.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,nf);return Zi(a,"single",r)}function nf(e){var r=e.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return t?"\\"+t:"\\x"+(r<16?"0":"")+Lc.call(r.toString(16))}function Ir(e){return"Object("+e+")"}function cn(e){return e+" { ? }"}function io(e,r,t,n){var a=n?fn(t,n):_e.call(t,", ");return e+" ("+r+") {"+a+"}"}function of(e){for(var r=0;r<e.length;r++)if(to(e[r],`
|
|
18
|
+
`)>=0)return!1;return!0}function af(e,r){var t;if(e.indent===" ")t=" ";else if(typeof e.indent=="number"&&e.indent>0)t=_e.call(Array(e.indent+1)," ");else return null;return{base:t,prev:_e.call(Array(r+1),t)}}function fn(e,r){if(e.length===0)return"";var t=`
|
|
19
|
+
`+r.prev+r.base;return t+_e.call(e,","+t)+`
|
|
20
|
+
`+r.prev}function it(e,r){var t=un(e),n=[];if(t){n.length=e.length;for(var a=0;a<e.length;a++)n[a]=Fe(e,a)?r(e[a],e):""}var s=typeof on=="function"?on(e):[],c;if(or){c={};for(var p=0;p<s.length;p++)c["$"+s[p]]=s[p]}for(var h in e)!Fe(e,h)||t&&String(Number(h))===h&&h<e.length||or&&c["$"+h]instanceof Symbol||(zi.call(/[^\w$]/,h)?n.push(r(h,e)+": "+r(e[h],e)):n.push(h+": "+r(e[h],e)));if(typeof on=="function")for(var v=0;v<s.length;v++)Yi.call(e,s[v])&&n.push("["+r(s[v])+"]: "+r(e[s[v]],e));return n}var ln=Nt,ar=du,sf=kc,uf=ln("%TypeError%"),ot=ln("%WeakMap%",!0),at=ln("%Map%",!0),cf=ar("WeakMap.prototype.get",!0),ff=ar("WeakMap.prototype.set",!0),lf=ar("WeakMap.prototype.has",!0),pf=ar("Map.prototype.get",!0),hf=ar("Map.prototype.set",!0),df=ar("Map.prototype.has",!0),pn=function(e,r){for(var t=e,n;(n=t.next)!==null;t=n)if(n.key===r)return t.next=n.next,n.next=e.next,e.next=n,n},yf=function(e,r){var t=pn(e,r);return t&&t.value},gf=function(e,r,t){var n=pn(e,r);n?n.value=t:e.next={key:r,next:e.next,value:t}},vf=function(e,r){return!!pn(e,r)},mf=function(){var r,t,n,a={assert:function(s){if(!a.has(s))throw new uf("Side channel does not contain "+sf(s))},get:function(s){if(ot&&s&&(typeof s=="object"||typeof s=="function")){if(r)return cf(r,s)}else if(at){if(t)return pf(t,s)}else if(n)return yf(n,s)},has:function(s){if(ot&&s&&(typeof s=="object"||typeof s=="function")){if(r)return lf(r,s)}else if(at){if(t)return df(t,s)}else if(n)return vf(n,s);return!1},set:function(s,c){ot&&s&&(typeof s=="object"||typeof s=="function")?(r||(r=new ot),ff(r,s,c)):at?(t||(t=new at),hf(t,s,c)):(n||(n={key:{},next:null}),gf(n,s,c))}};return a},_f=String.prototype.replace,wf=/%20/g,hn={RFC1738:"RFC1738",RFC3986:"RFC3986"},oo={default:hn.RFC3986,formatters:{RFC1738:function(e){return _f.call(e,wf,"+")},RFC3986:function(e){return String(e)}},RFC1738:hn.RFC1738,RFC3986:hn.RFC3986},bf=oo,dn=Object.prototype.hasOwnProperty,He=Array.isArray,we=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),$f=function(r){for(;r.length>1;){var t=r.pop(),n=t.obj[t.prop];if(He(n)){for(var a=[],s=0;s<n.length;++s)typeof n[s]<"u"&&a.push(n[s]);t.obj[t.prop]=a}}},ao=function(r,t){for(var n=t&&t.plainObjects?Object.create(null):{},a=0;a<r.length;++a)typeof r[a]<"u"&&(n[a]=r[a]);return n},Af=function e(r,t,n){if(!t)return r;if(typeof t!="object"){if(He(r))r.push(t);else if(r&&typeof r=="object")(n&&(n.plainObjects||n.allowPrototypes)||!dn.call(Object.prototype,t))&&(r[t]=!0);else return[r,t];return r}if(!r||typeof r!="object")return[r].concat(t);var a=r;return He(r)&&!He(t)&&(a=ao(r,n)),He(r)&&He(t)?(t.forEach(function(s,c){if(dn.call(r,c)){var p=r[c];p&&typeof p=="object"&&s&&typeof s=="object"?r[c]=e(p,s,n):r.push(s)}else r[c]=s}),r):Object.keys(t).reduce(function(s,c){var p=t[c];return dn.call(s,c)?s[c]=e(s[c],p,n):s[c]=p,s},a)},Ef=function(r,t){return Object.keys(t).reduce(function(n,a){return n[a]=t[a],n},r)},Sf=function(e,r,t){var n=e.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},xf=function(r,t,n,a,s){if(r.length===0)return r;var c=r;if(typeof r=="symbol"?c=Symbol.prototype.toString.call(r):typeof r!="string"&&(c=String(r)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(_){return"%26%23"+parseInt(_.slice(2),16)+"%3B"});for(var p="",h=0;h<c.length;++h){var v=c.charCodeAt(h);if(v===45||v===46||v===95||v===126||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||s===bf.RFC1738&&(v===40||v===41)){p+=c.charAt(h);continue}if(v<128){p=p+we[v];continue}if(v<2048){p=p+(we[192|v>>6]+we[128|v&63]);continue}if(v<55296||v>=57344){p=p+(we[224|v>>12]+we[128|v>>6&63]+we[128|v&63]);continue}h+=1,v=65536+((v&1023)<<10|c.charCodeAt(h)&1023),p+=we[240|v>>18]+we[128|v>>12&63]+we[128|v>>6&63]+we[128|v&63]}return p},If=function(r){for(var t=[{obj:{o:r},prop:"o"}],n=[],a=0;a<t.length;++a)for(var s=t[a],c=s.obj[s.prop],p=Object.keys(c),h=0;h<p.length;++h){var v=p[h],_=c[v];typeof _=="object"&&_!==null&&n.indexOf(_)===-1&&(t.push({obj:c,prop:v}),n.push(_))}return $f(t),r},Tf=function(r){return Object.prototype.toString.call(r)==="[object RegExp]"},Of=function(r){return!r||typeof r!="object"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))},Bf=function(r,t){return[].concat(r,t)},Pf=function(r,t){if(He(r)){for(var n=[],a=0;a<r.length;a+=1)n.push(t(r[a]));return n}return t(r)},Rf={arrayToObject:ao,assign:Ef,combine:Bf,compact:If,decode:Sf,encode:xf,isBuffer:Of,isRegExp:Tf,maybeMap:Pf,merge:Af},so=mf,yn=Rf,Tr=oo,Ff=Object.prototype.hasOwnProperty,uo={brackets:function(r){return r+"[]"},comma:"comma",indices:function(r,t){return r+"["+t+"]"},repeat:function(r){return r}},Se=Array.isArray,Cf=String.prototype.split,Uf=Array.prototype.push,co=function(e,r){Uf.apply(e,Se(r)?r:[r])},Df=Date.prototype.toISOString,fo=Tr.default,J={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:yn.encode,encodeValuesOnly:!1,format:fo,formatter:Tr.formatters[fo],indices:!1,serializeDate:function(r){return Df.call(r)},skipNulls:!1,strictNullHandling:!1},Nf=function(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r=="symbol"||typeof r=="bigint"},gn={},Mf=function e(r,t,n,a,s,c,p,h,v,_,w,b,d,E,x,I){for(var S=r,T=I,P=0,B=!1;(T=T.get(gn))!==void 0&&!B;){var D=T.get(r);if(P+=1,typeof D<"u"){if(D===P)throw new RangeError("Cyclic object value");B=!0}typeof T.get(gn)>"u"&&(P=0)}if(typeof h=="function"?S=h(t,S):S instanceof Date?S=w(S):n==="comma"&&Se(S)&&(S=yn.maybeMap(S,function(Ne){return Ne instanceof Date?w(Ne):Ne})),S===null){if(s)return p&&!E?p(t,J.encoder,x,"key",b):t;S=""}if(Nf(S)||yn.isBuffer(S)){if(p){var j=E?t:p(t,J.encoder,x,"key",b);if(n==="comma"&&E){for(var q=Cf.call(String(S),","),z="",X=0;X<q.length;++X)z+=(X===0?"":",")+d(p(q[X],J.encoder,x,"value",b));return[d(j)+(a&&Se(S)&&q.length===1?"[]":"")+"="+z]}return[d(j)+"="+d(p(S,J.encoder,x,"value",b))]}return[d(t)+"="+d(String(S))]}var V=[];if(typeof S>"u")return V;var ae;if(n==="comma"&&Se(S))ae=[{value:S.length>0?S.join(",")||null:void 0}];else if(Se(h))ae=h;else{var ue=Object.keys(S);ae=v?ue.sort(v):ue}for(var k=a&&Se(S)&&S.length===1?t+"[]":t,re=0;re<ae.length;++re){var N=ae[re],ce=typeof N=="object"&&typeof N.value<"u"?N.value:S[N];if(!(c&&ce===null)){var hr=Se(S)?typeof n=="function"?n(k,N):k:k+(_?"."+N:"["+N+"]");I.set(r,P);var se=so();se.set(gn,I),co(V,e(ce,hr,n,a,s,c,p,h,v,_,w,b,d,E,x,se))}}return V},Lf=function(r){if(!r)return J;if(r.encoder!==null&&typeof r.encoder<"u"&&typeof r.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=r.charset||J.charset;if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Tr.default;if(typeof r.format<"u"){if(!Ff.call(Tr.formatters,r.format))throw new TypeError("Unknown format option provided.");n=r.format}var a=Tr.formatters[n],s=J.filter;return(typeof r.filter=="function"||Se(r.filter))&&(s=r.filter),{addQueryPrefix:typeof r.addQueryPrefix=="boolean"?r.addQueryPrefix:J.addQueryPrefix,allowDots:typeof r.allowDots>"u"?J.allowDots:!!r.allowDots,charset:t,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:J.charsetSentinel,delimiter:typeof r.delimiter>"u"?J.delimiter:r.delimiter,encode:typeof r.encode=="boolean"?r.encode:J.encode,encoder:typeof r.encoder=="function"?r.encoder:J.encoder,encodeValuesOnly:typeof r.encodeValuesOnly=="boolean"?r.encodeValuesOnly:J.encodeValuesOnly,filter:s,format:n,formatter:a,serializeDate:typeof r.serializeDate=="function"?r.serializeDate:J.serializeDate,skipNulls:typeof r.skipNulls=="boolean"?r.skipNulls:J.skipNulls,sort:typeof r.sort=="function"?r.sort:null,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:J.strictNullHandling}},jf=function(e,r){var t=e,n=Lf(r),a,s;typeof n.filter=="function"?(s=n.filter,t=s("",t)):Se(n.filter)&&(s=n.filter,a=s);var c=[];if(typeof t!="object"||t===null)return"";var p;r&&r.arrayFormat in uo?p=r.arrayFormat:r&&"indices"in r?p=r.indices?"indices":"repeat":p="indices";var h=uo[p];if(r&&"commaRoundTrip"in r&&typeof r.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=h==="comma"&&r&&r.commaRoundTrip;a||(a=Object.keys(t)),n.sort&&a.sort(n.sort);for(var _=so(),w=0;w<a.length;++w){var b=a[w];n.skipNulls&&t[b]===null||co(c,Mf(t[b],b,h,v,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,_))}var d=c.join(n.delimiter),E=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),d.length>0?E+d:""};let lo={storeIdentifier:"",environment:"prod"};function kf(e){lo=e}function xe(){return lo}const Gf=e=>e==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",vn=e=>e==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",Wf=e=>e==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",qf="/tools/recurring";class st{constructor(r,t){this.name="RechargeRequestError",this.message=r,this.status=t}}var zf=Object.defineProperty,Vf=Object.defineProperties,Hf=Object.getOwnPropertyDescriptors,po=Object.getOwnPropertySymbols,Yf=Object.prototype.hasOwnProperty,Kf=Object.prototype.propertyIsEnumerable,ho=(e,r,t)=>r in e?zf(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ut=(e,r)=>{for(var t in r||(r={}))Yf.call(r,t)&&ho(e,t,r[t]);if(po)for(var t of po(r))Kf.call(r,t)&&ho(e,t,r[t]);return e},Xf=(e,r)=>Vf(e,Hf(r));function Jf(e){return jf(e,{encode:!1,indices:!1,arrayFormat:"comma"})}async function ct(e,r,t={}){const n=xe();return he(e,`${Wf(n.environment)}/store/${n.storeIdentifier}${r}`,t)}async function O(e,r,{id:t,query:n,data:a,headers:s}={},c){const{environment:p,storeIdentifier:h,loginRetryFn:v}=xe(),_=c.apiToken,w=Gf(p),b=ut({"X-Recharge-Access-Token":_,"X-Recharge-Version":"2021-11"},s||{}),d=ut({shop_url:h},n);try{return await he(e,`${w}${r}`,{id:t,query:d,data:a,headers:b})}catch(E){if(v&&E instanceof st&&E.status===401)return v().then(x=>{if(x)return he(e,`${w}${r}`,{id:t,query:d,data:a,headers:Xf(ut({},b),{"X-Recharge-Access-Token":x.apiToken})});throw E});throw E}}async function Or(e,r,t={}){return he(e,`${qf}${r}`,t)}async function he(e,r,{id:t,query:n,data:a,headers:s}={}){let c=r.trim();if(t&&(c=[c,`${t}`.trim()].join("/")),n){let w;[c,w]=c.split("?");const b=[w,Jf(n)].join("&").replace(/^&/,"");c=`${c}${b?`?${b}`:""}`}let p;a&&e!=="get"&&(p=JSON.stringify(a));const h=ut({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},s||{}),v=await fetch(c,{method:e,headers:h,body:p});let _;try{_=await v.json()}catch{}if(!v.ok)throw _&&_.error?new st(_.error,v.status):_&&_.errors?new st(JSON.stringify(_.errors),v.status):new st("A connection error occurred while making the request");return _}function Qf(e,r){return O("get","/addresses",{query:r},e)}async function Zf(e,r,t){const{address:n}=await O("get","/addresses",{id:r,query:{include:t?.include}},e);return n}async function el(e,r){const{address:t}=await O("post","/addresses",{data:r},e);return t}async function mn(e,r,t){const{address:n}=await O("put","/addresses",{id:r,data:t},e);return n}async function rl(e,r,t){return mn(e,r,{discounts:[{code:t}]})}async function tl(e,r){return mn(e,r,{discounts:[]})}function nl(e,r){return O("delete","/addresses",{id:r},e)}async function il(e,r){const{address:t}=await O("post","/addresses/merge",{data:r},e);return t}async function ol(e,r,t){const{charge:n}=await O("post",`/addresses/${r}/charges/skip`,{data:t},e);return n}var al=Object.freeze({__proto__:null,listAddresses:Qf,getAddress:Zf,createAddress:el,updateAddress:mn,applyDiscountToAddress:rl,removeDiscountsFromAddress:tl,deleteAddress:nl,mergeAddresses:il,skipFutureCharge:ol}),sl=Object.defineProperty,yo=Object.getOwnPropertySymbols,ul=Object.prototype.hasOwnProperty,cl=Object.prototype.propertyIsEnumerable,go=(e,r,t)=>r in e?sl(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,vo=(e,r)=>{for(var t in r||(r={}))ul.call(r,t)&&go(e,t,r[t]);if(yo)for(var t of yo(r))cl.call(r,t)&&go(e,t,r[t]);return e};async function fl(){const{storefrontAccessToken:e}=xe(),r={};e&&(r["X-Recharge-Storefront-Access-Token"]=e);const t=await Or("get","/access",{headers:r});return{apiToken:t.api_token,customerId:t.customer_id}}async function ll(e,r){const{environment:t,storefrontAccessToken:n,storeIdentifier:a}=xe(),s=vn(t),c={};n&&(c["X-Recharge-Storefront-Access-Token"]=n);const p=await he("post",`${s}/shopify_storefront_access`,{data:{customer_token:r,storefront_token:e,shop_url:a},headers:c});return p.api_token?{apiToken:p.api_token,customerId:p.customer_id}:null}async function pl(e,r={}){const{environment:t,storefrontAccessToken:n,storeIdentifier:a}=xe(),s=vn(t),c={};n&&(c["X-Recharge-Storefront-Access-Token"]=n);const p=await he("post",`${s}/attempt_login`,{data:vo({email:e,shop:a},r),headers:c});if(p.errors)throw new Error(p.errors);return p.session_token}async function hl(e,r={}){const{storefrontAccessToken:t,storeIdentifier:n}=xe(),a={};t&&(a["X-Recharge-Storefront-Access-Token"]=t);const s=await Or("post","/attempt_login",{data:vo({email:e,shop:n},r),headers:a});if(s.errors)throw new Error(s.errors);return s.session_token}async function dl(e,r,t){const{environment:n,storefrontAccessToken:a,storeIdentifier:s}=xe(),c=vn(n),p={};a&&(p["X-Recharge-Storefront-Access-Token"]=a);const h=await he("post",`${c}/validate_login`,{data:{code:t,email:e,session_token:r,shop:s},headers:p});if(h.errors)throw new Error(h.errors);return{apiToken:h.api_token,customerId:h.customer_id}}async function yl(e,r,t){const{storefrontAccessToken:n,storeIdentifier:a}=xe(),s={};n&&(s["X-Recharge-Storefront-Access-Token"]=n);const c=await Or("post","/validate_login",{data:{code:t,email:e,session_token:r,shop:a},headers:s});if(c.errors)throw new Error(c.errors);return{apiToken:c.api_token,customerId:c.customer_id}}var gl=Object.freeze({__proto__:null,loginShopifyAppProxy:fl,loginShopifyApi:ll,sendPasswordlessCode:pl,sendPasswordlessCodeAppProxy:hl,validatePasswordlessCode:dl,validatePasswordlessCodeAppProxy:yl});let vl=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((r,t)=>(t&=63,t<36?r+=t.toString(36):t<62?r+=(t-26).toString(36).toUpperCase():t>62?r+="-":r+="_",r),"");function ml(e,r){for(var t=-1,n=e==null?0:e.length,a=Array(n);++t<n;)a[t]=r(e[t],t,e);return a}var mo=ml;function _l(){this.__data__=[],this.size=0}var wl=_l;function bl(e,r){return e===r||e!==e&&r!==r}var _o=bl,$l=_o;function Al(e,r){for(var t=e.length;t--;)if($l(e[t][0],r))return t;return-1}var ft=Al,El=ft,Sl=Array.prototype,xl=Sl.splice;function Il(e){var r=this.__data__,t=El(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():xl.call(r,t,1),--this.size,!0}var Tl=Il,Ol=ft;function Bl(e){var r=this.__data__,t=Ol(r,e);return t<0?void 0:r[t][1]}var Pl=Bl,Rl=ft;function Fl(e){return Rl(this.__data__,e)>-1}var Cl=Fl,Ul=ft;function Dl(e,r){var t=this.__data__,n=Ul(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}var Nl=Dl,Ml=wl,Ll=Tl,jl=Pl,kl=Cl,Gl=Nl;function sr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}sr.prototype.clear=Ml,sr.prototype.delete=Ll,sr.prototype.get=jl,sr.prototype.has=kl,sr.prototype.set=Gl;var lt=sr,Wl=lt;function ql(){this.__data__=new Wl,this.size=0}var zl=ql;function Vl(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}var Hl=Vl;function Yl(e){return this.__data__.get(e)}var Kl=Yl;function Xl(e){return this.__data__.has(e)}var Jl=Xl,Ql=typeof $e=="object"&&$e&&$e.Object===Object&&$e,wo=Ql,Zl=wo,ep=typeof self=="object"&&self&&self.Object===Object&&self,rp=Zl||ep||Function("return this")(),oe=rp,tp=oe,np=tp.Symbol,Br=np,bo=Br,$o=Object.prototype,ip=$o.hasOwnProperty,op=$o.toString,Pr=bo?bo.toStringTag:void 0;function ap(e){var r=ip.call(e,Pr),t=e[Pr];try{e[Pr]=void 0;var n=!0}catch{}var a=op.call(e);return n&&(r?e[Pr]=t:delete e[Pr]),a}var sp=ap,up=Object.prototype,cp=up.toString;function fp(e){return cp.call(e)}var lp=fp,Ao=Br,pp=sp,hp=lp,dp="[object Null]",yp="[object Undefined]",Eo=Ao?Ao.toStringTag:void 0;function gp(e){return e==null?e===void 0?yp:dp:Eo&&Eo in Object(e)?pp(e):hp(e)}var ur=gp;function vp(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Ye=vp,mp=ur,_p=Ye,wp="[object AsyncFunction]",bp="[object Function]",$p="[object GeneratorFunction]",Ap="[object Proxy]";function Ep(e){if(!_p(e))return!1;var r=mp(e);return r==bp||r==$p||r==wp||r==Ap}var So=Ep,Sp=oe,xp=Sp["__core-js_shared__"],Ip=xp,_n=Ip,xo=function(){var e=/[^.]+$/.exec(_n&&_n.keys&&_n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Tp(e){return!!xo&&xo in e}var Op=Tp,Bp=Function.prototype,Pp=Bp.toString;function Rp(e){if(e!=null){try{return Pp.call(e)}catch{}try{return e+""}catch{}}return""}var Io=Rp,Fp=So,Cp=Op,Up=Ye,Dp=Io,Np=/[\\^$.*+?()[\]{}|]/g,Mp=/^\[object .+?Constructor\]$/,Lp=Function.prototype,jp=Object.prototype,kp=Lp.toString,Gp=jp.hasOwnProperty,Wp=RegExp("^"+kp.call(Gp).replace(Np,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qp(e){if(!Up(e)||Cp(e))return!1;var r=Fp(e)?Wp:Mp;return r.test(Dp(e))}var zp=qp;function Vp(e,r){return e?.[r]}var Hp=Vp,Yp=zp,Kp=Hp;function Xp(e,r){var t=Kp(e,r);return Yp(t)?t:void 0}var Ke=Xp,Jp=Ke,Qp=oe,Zp=Jp(Qp,"Map"),wn=Zp,eh=Ke,rh=eh(Object,"create"),pt=rh,To=pt;function th(){this.__data__=To?To(null):{},this.size=0}var nh=th;function ih(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var oh=ih,ah=pt,sh="__lodash_hash_undefined__",uh=Object.prototype,ch=uh.hasOwnProperty;function fh(e){var r=this.__data__;if(ah){var t=r[e];return t===sh?void 0:t}return ch.call(r,e)?r[e]:void 0}var lh=fh,ph=pt,hh=Object.prototype,dh=hh.hasOwnProperty;function yh(e){var r=this.__data__;return ph?r[e]!==void 0:dh.call(r,e)}var gh=yh,vh=pt,mh="__lodash_hash_undefined__";function _h(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=vh&&r===void 0?mh:r,this}var wh=_h,bh=nh,$h=oh,Ah=lh,Eh=gh,Sh=wh;function cr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}cr.prototype.clear=bh,cr.prototype.delete=$h,cr.prototype.get=Ah,cr.prototype.has=Eh,cr.prototype.set=Sh;var xh=cr,Oo=xh,Ih=lt,Th=wn;function Oh(){this.size=0,this.__data__={hash:new Oo,map:new(Th||Ih),string:new Oo}}var Bh=Oh;function Ph(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var Rh=Ph,Fh=Rh;function Ch(e,r){var t=e.__data__;return Fh(r)?t[typeof r=="string"?"string":"hash"]:t.map}var ht=Ch,Uh=ht;function Dh(e){var r=Uh(this,e).delete(e);return this.size-=r?1:0,r}var Nh=Dh,Mh=ht;function Lh(e){return Mh(this,e).get(e)}var jh=Lh,kh=ht;function Gh(e){return kh(this,e).has(e)}var Wh=Gh,qh=ht;function zh(e,r){var t=qh(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}var Vh=zh,Hh=Bh,Yh=Nh,Kh=jh,Xh=Wh,Jh=Vh;function fr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}fr.prototype.clear=Hh,fr.prototype.delete=Yh,fr.prototype.get=Kh,fr.prototype.has=Xh,fr.prototype.set=Jh;var Bo=fr,Qh=lt,Zh=wn,ed=Bo,rd=200;function td(e,r){var t=this.__data__;if(t instanceof Qh){var n=t.__data__;if(!Zh||n.length<rd-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new ed(n)}return t.set(e,r),this.size=t.size,this}var nd=td,id=lt,od=zl,ad=Hl,sd=Kl,ud=Jl,cd=nd;function lr(e){var r=this.__data__=new id(e);this.size=r.size}lr.prototype.clear=od,lr.prototype.delete=ad,lr.prototype.get=sd,lr.prototype.has=ud,lr.prototype.set=cd;var fd=lr;function ld(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var Po=ld,pd=Ke,hd=function(){try{var e=pd(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Ro=hd,Fo=Ro;function dd(e,r,t){r=="__proto__"&&Fo?Fo(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var Co=dd,yd=Co,gd=_o,vd=Object.prototype,md=vd.hasOwnProperty;function _d(e,r,t){var n=e[r];(!(md.call(e,r)&&gd(n,t))||t===void 0&&!(r in e))&&yd(e,r,t)}var Uo=_d,wd=Uo,bd=Co;function $d(e,r,t,n){var a=!t;t||(t={});for(var s=-1,c=r.length;++s<c;){var p=r[s],h=n?n(t[p],e[p],p,t,e):void 0;h===void 0&&(h=e[p]),a?bd(t,p,h):wd(t,p,h)}return t}var Rr=$d;function Ad(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var Ed=Ad;function Sd(e){return e!=null&&typeof e=="object"}var Ue=Sd,xd=ur,Id=Ue,Td="[object Arguments]";function Od(e){return Id(e)&&xd(e)==Td}var Bd=Od,Do=Bd,Pd=Ue,No=Object.prototype,Rd=No.hasOwnProperty,Fd=No.propertyIsEnumerable,Cd=Do(function(){return arguments}())?Do:function(e){return Pd(e)&&Rd.call(e,"callee")&&!Fd.call(e,"callee")},Mo=Cd,Ud=Array.isArray,De=Ud,dt={exports:{}};function Dd(){return!1}var Nd=Dd;(function(e,r){var t=oe,n=Nd,a=r&&!r.nodeType&&r,s=a&&!0&&e&&!e.nodeType&&e,c=s&&s.exports===a,p=c?t.Buffer:void 0,h=p?p.isBuffer:void 0,v=h||n;e.exports=v})(dt,dt.exports);var Md=9007199254740991,Ld=/^(?:0|[1-9]\d*)$/;function jd(e,r){var t=typeof e;return r=r??Md,!!r&&(t=="number"||t!="symbol"&&Ld.test(e))&&e>-1&&e%1==0&&e<r}var Lo=jd,kd=9007199254740991;function Gd(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kd}var jo=Gd,Wd=ur,qd=jo,zd=Ue,Vd="[object Arguments]",Hd="[object Array]",Yd="[object Boolean]",Kd="[object Date]",Xd="[object Error]",Jd="[object Function]",Qd="[object Map]",Zd="[object Number]",ey="[object Object]",ry="[object RegExp]",ty="[object Set]",ny="[object String]",iy="[object WeakMap]",oy="[object ArrayBuffer]",ay="[object DataView]",sy="[object Float32Array]",uy="[object Float64Array]",cy="[object Int8Array]",fy="[object Int16Array]",ly="[object Int32Array]",py="[object Uint8Array]",hy="[object Uint8ClampedArray]",dy="[object Uint16Array]",yy="[object Uint32Array]",L={};L[sy]=L[uy]=L[cy]=L[fy]=L[ly]=L[py]=L[hy]=L[dy]=L[yy]=!0,L[Vd]=L[Hd]=L[oy]=L[Yd]=L[ay]=L[Kd]=L[Xd]=L[Jd]=L[Qd]=L[Zd]=L[ey]=L[ry]=L[ty]=L[ny]=L[iy]=!1;function gy(e){return zd(e)&&qd(e.length)&&!!L[Wd(e)]}var vy=gy;function my(e){return function(r){return e(r)}}var bn=my,Fr={exports:{}};(function(e,r){var t=wo,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,c=s&&t.process,p=function(){try{var h=a&&a.require&&a.require("util").types;return h||c&&c.binding&&c.binding("util")}catch{}}();e.exports=p})(Fr,Fr.exports);var _y=vy,wy=bn,ko=Fr.exports,Go=ko&&ko.isTypedArray,by=Go?wy(Go):_y,$y=by,Ay=Ed,Ey=Mo,Sy=De,xy=dt.exports,Iy=Lo,Ty=$y,Oy=Object.prototype,By=Oy.hasOwnProperty;function Py(e,r){var t=Sy(e),n=!t&&Ey(e),a=!t&&!n&&xy(e),s=!t&&!n&&!a&&Ty(e),c=t||n||a||s,p=c?Ay(e.length,String):[],h=p.length;for(var v in e)(r||By.call(e,v))&&!(c&&(v=="length"||a&&(v=="offset"||v=="parent")||s&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||Iy(v,h)))&&p.push(v);return p}var Wo=Py,Ry=Object.prototype;function Fy(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||Ry;return e===t}var $n=Fy;function Cy(e,r){return function(t){return e(r(t))}}var qo=Cy,Uy=qo,Dy=Uy(Object.keys,Object),Ny=Dy,My=$n,Ly=Ny,jy=Object.prototype,ky=jy.hasOwnProperty;function Gy(e){if(!My(e))return Ly(e);var r=[];for(var t in Object(e))ky.call(e,t)&&t!="constructor"&&r.push(t);return r}var Wy=Gy,qy=So,zy=jo;function Vy(e){return e!=null&&zy(e.length)&&!qy(e)}var zo=Vy,Hy=Wo,Yy=Wy,Ky=zo;function Xy(e){return Ky(e)?Hy(e):Yy(e)}var An=Xy,Jy=Rr,Qy=An;function Zy(e,r){return e&&Jy(r,Qy(r),e)}var eg=Zy;function rg(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var tg=rg,ng=Ye,ig=$n,og=tg,ag=Object.prototype,sg=ag.hasOwnProperty;function ug(e){if(!ng(e))return og(e);var r=ig(e),t=[];for(var n in e)n=="constructor"&&(r||!sg.call(e,n))||t.push(n);return t}var cg=ug,fg=Wo,lg=cg,pg=zo;function hg(e){return pg(e)?fg(e,!0):lg(e)}var En=hg,dg=Rr,yg=En;function gg(e,r){return e&&dg(r,yg(r),e)}var vg=gg,Sn={exports:{}};(function(e,r){var t=oe,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,c=s?t.Buffer:void 0,p=c?c.allocUnsafe:void 0;function h(v,_){if(_)return v.slice();var w=v.length,b=p?p(w):new v.constructor(w);return v.copy(b),b}e.exports=h})(Sn,Sn.exports);function mg(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var xn=mg;function _g(e,r){for(var t=-1,n=e==null?0:e.length,a=0,s=[];++t<n;){var c=e[t];r(c,t,e)&&(s[a++]=c)}return s}var wg=_g;function bg(){return[]}var Vo=bg,$g=wg,Ag=Vo,Eg=Object.prototype,Sg=Eg.propertyIsEnumerable,Ho=Object.getOwnPropertySymbols,xg=Ho?function(e){return e==null?[]:(e=Object(e),$g(Ho(e),function(r){return Sg.call(e,r)}))}:Ag,In=xg,Ig=Rr,Tg=In;function Og(e,r){return Ig(e,Tg(e),r)}var Bg=Og;function Pg(e,r){for(var t=-1,n=r.length,a=e.length;++t<n;)e[a+t]=r[t];return e}var Tn=Pg,Rg=qo,Fg=Rg(Object.getPrototypeOf,Object),On=Fg,Cg=Tn,Ug=On,Dg=In,Ng=Vo,Mg=Object.getOwnPropertySymbols,Lg=Mg?function(e){for(var r=[];e;)Cg(r,Dg(e)),e=Ug(e);return r}:Ng,Yo=Lg,jg=Rr,kg=Yo;function Gg(e,r){return jg(e,kg(e),r)}var Wg=Gg,qg=Tn,zg=De;function Vg(e,r,t){var n=r(e);return zg(e)?n:qg(n,t(e))}var Ko=Vg,Hg=Ko,Yg=In,Kg=An;function Xg(e){return Hg(e,Kg,Yg)}var Jg=Xg,Qg=Ko,Zg=Yo,ev=En;function rv(e){return Qg(e,ev,Zg)}var Xo=rv,tv=Ke,nv=oe,iv=tv(nv,"DataView"),ov=iv,av=Ke,sv=oe,uv=av(sv,"Promise"),cv=uv,fv=Ke,lv=oe,pv=fv(lv,"Set"),hv=pv,dv=Ke,yv=oe,gv=dv(yv,"WeakMap"),Jo=gv,Bn=ov,Pn=wn,Rn=cv,Fn=hv,Cn=Jo,Qo=ur,pr=Io,Zo="[object Map]",vv="[object Object]",ea="[object Promise]",ra="[object Set]",ta="[object WeakMap]",na="[object DataView]",mv=pr(Bn),_v=pr(Pn),wv=pr(Rn),bv=pr(Fn),$v=pr(Cn),Xe=Qo;(Bn&&Xe(new Bn(new ArrayBuffer(1)))!=na||Pn&&Xe(new Pn)!=Zo||Rn&&Xe(Rn.resolve())!=ea||Fn&&Xe(new Fn)!=ra||Cn&&Xe(new Cn)!=ta)&&(Xe=function(e){var r=Qo(e),t=r==vv?e.constructor:void 0,n=t?pr(t):"";if(n)switch(n){case mv:return na;case _v:return Zo;case wv:return ea;case bv:return ra;case $v:return ta}return r});var Un=Xe,Av=Object.prototype,Ev=Av.hasOwnProperty;function Sv(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Ev.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var xv=Sv,Iv=oe,Tv=Iv.Uint8Array,Ov=Tv,ia=Ov;function Bv(e){var r=new e.constructor(e.byteLength);return new ia(r).set(new ia(e)),r}var Dn=Bv,Pv=Dn;function Rv(e,r){var t=r?Pv(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var Fv=Rv,Cv=/\w*$/;function Uv(e){var r=new e.constructor(e.source,Cv.exec(e));return r.lastIndex=e.lastIndex,r}var Dv=Uv,oa=Br,aa=oa?oa.prototype:void 0,sa=aa?aa.valueOf:void 0;function Nv(e){return sa?Object(sa.call(e)):{}}var Mv=Nv,Lv=Dn;function jv(e,r){var t=r?Lv(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var kv=jv,Gv=Dn,Wv=Fv,qv=Dv,zv=Mv,Vv=kv,Hv="[object Boolean]",Yv="[object Date]",Kv="[object Map]",Xv="[object Number]",Jv="[object RegExp]",Qv="[object Set]",Zv="[object String]",e0="[object Symbol]",r0="[object ArrayBuffer]",t0="[object DataView]",n0="[object Float32Array]",i0="[object Float64Array]",o0="[object Int8Array]",a0="[object Int16Array]",s0="[object Int32Array]",u0="[object Uint8Array]",c0="[object Uint8ClampedArray]",f0="[object Uint16Array]",l0="[object Uint32Array]";function p0(e,r,t){var n=e.constructor;switch(r){case r0:return Gv(e);case Hv:case Yv:return new n(+e);case t0:return Wv(e,t);case n0:case i0:case o0:case a0:case s0:case u0:case c0:case f0:case l0:return Vv(e,t);case Kv:return new n;case Xv:case Zv:return new n(e);case Jv:return qv(e);case Qv:return new n;case e0:return zv(e)}}var h0=p0,d0=Ye,ua=Object.create,y0=function(){function e(){}return function(r){if(!d0(r))return{};if(ua)return ua(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}(),yt=y0,g0=yt,v0=On,m0=$n;function _0(e){return typeof e.constructor=="function"&&!m0(e)?g0(v0(e)):{}}var w0=_0,b0=Un,$0=Ue,A0="[object Map]";function E0(e){return $0(e)&&b0(e)==A0}var S0=E0,x0=S0,I0=bn,ca=Fr.exports,fa=ca&&ca.isMap,T0=fa?I0(fa):x0,O0=T0,B0=Un,P0=Ue,R0="[object Set]";function F0(e){return P0(e)&&B0(e)==R0}var C0=F0,U0=C0,D0=bn,la=Fr.exports,pa=la&&la.isSet,N0=pa?D0(pa):U0,M0=N0,L0=fd,j0=Po,k0=Uo,G0=eg,W0=vg,q0=Sn.exports,z0=xn,V0=Bg,H0=Wg,Y0=Jg,K0=Xo,X0=Un,J0=xv,Q0=h0,Z0=w0,em=De,rm=dt.exports,tm=O0,nm=Ye,im=M0,om=An,am=En,sm=1,um=2,cm=4,ha="[object Arguments]",fm="[object Array]",lm="[object Boolean]",pm="[object Date]",hm="[object Error]",da="[object Function]",dm="[object GeneratorFunction]",ym="[object Map]",gm="[object Number]",ya="[object Object]",vm="[object RegExp]",mm="[object Set]",_m="[object String]",wm="[object Symbol]",bm="[object WeakMap]",$m="[object ArrayBuffer]",Am="[object DataView]",Em="[object Float32Array]",Sm="[object Float64Array]",xm="[object Int8Array]",Im="[object Int16Array]",Tm="[object Int32Array]",Om="[object Uint8Array]",Bm="[object Uint8ClampedArray]",Pm="[object Uint16Array]",Rm="[object Uint32Array]",M={};M[ha]=M[fm]=M[$m]=M[Am]=M[lm]=M[pm]=M[Em]=M[Sm]=M[xm]=M[Im]=M[Tm]=M[ym]=M[gm]=M[ya]=M[vm]=M[mm]=M[_m]=M[wm]=M[Om]=M[Bm]=M[Pm]=M[Rm]=!0,M[hm]=M[da]=M[bm]=!1;function gt(e,r,t,n,a,s){var c,p=r&sm,h=r&um,v=r&cm;if(t&&(c=a?t(e,n,a,s):t(e)),c!==void 0)return c;if(!nm(e))return e;var _=em(e);if(_){if(c=J0(e),!p)return z0(e,c)}else{var w=X0(e),b=w==da||w==dm;if(rm(e))return q0(e,p);if(w==ya||w==ha||b&&!a){if(c=h||b?{}:Z0(e),!p)return h?H0(e,W0(c,e)):V0(e,G0(c,e))}else{if(!M[w])return a?e:{};c=Q0(e,w,p)}}s||(s=new L0);var d=s.get(e);if(d)return d;s.set(e,c),im(e)?e.forEach(function(I){c.add(gt(I,r,t,I,e,s))}):tm(e)&&e.forEach(function(I,S){c.set(S,gt(I,r,t,S,e,s))});var E=v?h?K0:Y0:h?am:om,x=_?void 0:E(e);return j0(x||e,function(I,S){x&&(S=I,I=e[S]),k0(c,S,gt(I,r,t,S,e,s))}),c}var Fm=gt,Cm=ur,Um=Ue,Dm="[object Symbol]";function Nm(e){return typeof e=="symbol"||Um(e)&&Cm(e)==Dm}var vt=Nm,Mm=De,Lm=vt,jm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,km=/^\w*$/;function Gm(e,r){if(Mm(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Lm(e)?!0:km.test(e)||!jm.test(e)||r!=null&&e in Object(r)}var Wm=Gm,ga=Bo,qm="Expected a function";function Nn(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(qm);var t=function(){var n=arguments,a=r?r.apply(this,n):n[0],s=t.cache;if(s.has(a))return s.get(a);var c=e.apply(this,n);return t.cache=s.set(a,c)||s,c};return t.cache=new(Nn.Cache||ga),t}Nn.Cache=ga;var zm=Nn,Vm=zm,Hm=500;function Ym(e){var r=Vm(e,function(n){return t.size===Hm&&t.clear(),n}),t=r.cache;return r}var Km=Ym,Xm=Km,Jm=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qm=/\\(\\)?/g,Zm=Xm(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Jm,function(t,n,a,s){r.push(a?s.replace(Qm,"$1"):n||t)}),r}),e_=Zm,va=Br,r_=mo,t_=De,n_=vt,i_=1/0,ma=va?va.prototype:void 0,_a=ma?ma.toString:void 0;function wa(e){if(typeof e=="string")return e;if(t_(e))return r_(e,wa)+"";if(n_(e))return _a?_a.call(e):"";var r=e+"";return r=="0"&&1/e==-i_?"-0":r}var o_=wa,a_=o_;function s_(e){return e==null?"":a_(e)}var u_=s_,c_=De,f_=Wm,l_=e_,p_=u_;function h_(e,r){return c_(e)?e:f_(e,r)?[e]:l_(p_(e))}var Mn=h_;function d_(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}var y_=d_,g_=vt,v_=1/0;function m_(e){if(typeof e=="string"||g_(e))return e;var r=e+"";return r=="0"&&1/e==-v_?"-0":r}var ba=m_,__=Mn,w_=ba;function b_(e,r){r=__(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[w_(r[t++])];return t&&t==n?e:void 0}var $_=b_;function A_(e,r,t){var n=-1,a=e.length;r<0&&(r=-r>a?0:a+r),t=t>a?a:t,t<0&&(t+=a),a=r>t?0:t-r>>>0,r>>>=0;for(var s=Array(a);++n<a;)s[n]=e[n+r];return s}var E_=A_,S_=$_,x_=E_;function I_(e,r){return r.length<2?e:S_(e,x_(r,0,-1))}var T_=I_,O_=Mn,B_=y_,P_=T_,R_=ba;function F_(e,r){return r=O_(r,e),e=P_(e,r),e==null||delete e[R_(B_(r))]}var C_=F_,U_=ur,D_=On,N_=Ue,M_="[object Object]",L_=Function.prototype,j_=Object.prototype,$a=L_.toString,k_=j_.hasOwnProperty,G_=$a.call(Object);function W_(e){if(!N_(e)||U_(e)!=M_)return!1;var r=D_(e);if(r===null)return!0;var t=k_.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&$a.call(t)==G_}var q_=W_,z_=q_;function V_(e){return z_(e)?void 0:e}var H_=V_,Aa=Br,Y_=Mo,K_=De,Ea=Aa?Aa.isConcatSpreadable:void 0;function X_(e){return K_(e)||Y_(e)||!!(Ea&&e&&e[Ea])}var J_=X_,Q_=Tn,Z_=J_;function Sa(e,r,t,n,a){var s=-1,c=e.length;for(t||(t=Z_),a||(a=[]);++s<c;){var p=e[s];r>0&&t(p)?r>1?Sa(p,r-1,t,n,a):Q_(a,p):n||(a[a.length]=p)}return a}var ew=Sa,rw=ew;function tw(e){var r=e==null?0:e.length;return r?rw(e,1):[]}var nw=tw;function iw(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}var Ln=iw,ow=Ln,xa=Math.max;function aw(e,r,t){return r=xa(r===void 0?e.length-1:r,0),function(){for(var n=arguments,a=-1,s=xa(n.length-r,0),c=Array(s);++a<s;)c[a]=n[r+a];a=-1;for(var p=Array(r+1);++a<r;)p[a]=n[a];return p[r]=t(c),ow(e,this,p)}}var Ia=aw;function sw(e){return function(){return e}}var uw=sw;function cw(e){return e}var jn=cw,fw=uw,Ta=Ro,lw=jn,pw=Ta?function(e,r){return Ta(e,"toString",{configurable:!0,enumerable:!1,value:fw(r),writable:!0})}:lw,hw=pw,dw=800,yw=16,gw=Date.now;function vw(e){var r=0,t=0;return function(){var n=gw(),a=yw-(n-t);if(t=n,a>0){if(++r>=dw)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var Oa=vw,mw=hw,_w=Oa,ww=_w(mw),kn=ww,bw=nw,$w=Ia,Aw=kn;function Ew(e){return Aw($w(e,void 0,bw),e+"")}var Sw=Ew,xw=mo,Iw=Fm,Tw=C_,Ow=Mn,Bw=Rr,Pw=H_,Rw=Sw,Fw=Xo,Cw=1,Uw=2,Dw=4,Nw=Rw(function(e,r){var t={};if(e==null)return t;var n=!1;r=xw(r,function(s){return s=Ow(s,e),n||(n=s.length>1),s}),Bw(e,Fw(e),t),n&&(t=Iw(t,Cw|Uw|Dw,Pw));for(var a=r.length;a--;)Tw(t,r[a]);return t}),Gn=Nw,Mw=Object.defineProperty,Lw=Object.defineProperties,jw=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,kw=Object.prototype.hasOwnProperty,Gw=Object.prototype.propertyIsEnumerable,Pa=(e,r,t)=>r in e?Mw(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ww=(e,r)=>{for(var t in r||(r={}))kw.call(r,t)&&Pa(e,t,r[t]);if(Ba)for(var t of Ba(r))Gw.call(r,t)&&Pa(e,t,r[t]);return e},qw=(e,r)=>Lw(e,jw(r));function zw(e){try{return JSON.parse(e)}catch{return e}}function Vw(e){return Object.entries(e).reduce((r,[t,n])=>qw(Ww({},r),{[t]:zw(n)}),{})}const Ra=e=>typeof e=="string"?e!=="0"&&e!=="false":!!e;var Hw=Object.defineProperty,Yw=Object.defineProperties,Kw=Object.getOwnPropertyDescriptors,Fa=Object.getOwnPropertySymbols,Xw=Object.prototype.hasOwnProperty,Jw=Object.prototype.propertyIsEnumerable,Ca=(e,r,t)=>r in e?Hw(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ua=(e,r)=>{for(var t in r||(r={}))Xw.call(r,t)&&Ca(e,t,r[t]);if(Fa)for(var t of Fa(r))Jw.call(r,t)&&Ca(e,t,r[t]);return e},Da=(e,r)=>Yw(e,Kw(r));function Na(e){var r;const t=Vw(e),n=t.auto_inject===void 0?!0:t.auto_inject,a=(r=t.display_on)!=null?r:[],s=t.first_option==="autodeliver";return Da(Ua({},Gn(t,["display_on","first_option"])),{auto_inject:n,valid_pages:a,is_subscription_first:s,autoInject:n,validPages:a,isSubscriptionFirst:s})}function Ma(e){var r;const t=((r=e.subscription_options)==null?void 0:r.storefront_purchase_options)==="subscription_only";return Da(Ua({},e),{is_subscription_only:t,isSubscriptionOnly:t})}function Qw(e){return e.map(r=>{const t={};return Object.entries(r).forEach(([n,a])=>{t[n]=Ma(a)}),t})}const mt="2020-12",Zw={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Cr=new Map;function _t(e,r){return Cr.has(e)||Cr.set(e,r()),Cr.get(e)}async function Wn(e){const{product:r}=await _t(`product.${e}`,()=>ct("get",`/product/${mt}/${e}.json`));return Ma(r)}async function La(){return await _t("storeSettings",()=>ct("get",`/${mt}/store_settings.json`).catch(()=>Zw))}async function ja(){const{widget_settings:e}=await _t("widgetSettings",()=>ct("get",`/${mt}/widget_settings.json`));return Na(e)}async function ka(){const{products:e,widget_settings:r,store_settings:t,meta:n}=await _t("productsAndSettings",()=>ct("get",`/product/${mt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:Qw(e),widget_settings:Na(r),store_settings:t??{}}}async function e1(){const{products:e}=await ka();return e}async function r1(e){const[r,t,n]=await Promise.all([Wn(e),La(),ja()]);return{product:r,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Ga(e){const{bundle_product:r}=await Wn(e);return r}async function Wa(){return Array.from(Cr.keys()).forEach(e=>Cr.delete(e))}var t1=Object.freeze({__proto__:null,getCDNProduct:Wn,getCDNStoreSettings:La,getCDNWidgetSettings:ja,getCDNProductsAndSettings:ka,getCDNProducts:e1,getCDNProductAndSettings:r1,getCDNBundleSettings:Ga,resetCDNCache:Wa}),qa={exports:{}};/*! For license information please see xdr.js.LICENSE.txt */(function(e,r){(function(t,n){e.exports=n()})($e,()=>(()=>{var t={899:(s,c,p)=>{const h=p(221);s.exports=h},221:(s,c,p)=>{p.r(c),p.d(c,{Array:()=>yr,Bool:()=>H,Double:()=>St,Enum:()=>be,Float:()=>Ne,Hyper:()=>k,Int:()=>V,Opaque:()=>Nr,Option:()=>Lr,Quadruple:()=>G,Reference:()=>te,String:()=>Dr,Struct:()=>Me,Union:()=>Oe,UnsignedHyper:()=>se,UnsignedInt:()=>N,VarArray:()=>Mr,VarOpaque:()=>Te,Void:()=>Q,config:()=>g});class h extends TypeError{constructor(o){super(`XDR Write Error: ${o}`)}}class v extends TypeError{constructor(o){super(`XDR Read Error: ${o}`)}}class _ extends TypeError{constructor(o){super(`XDR Type Definition Error: ${o}`)}}class w extends _{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var b=p(764).lW;class d{constructor(o){if(!b.isBuffer(o)){if(!(o instanceof Array))throw new v("source not specified");o=b.from(o)}this._buffer=o,this._length=o.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(o){const l=this._index;if(this._index+=o,this._length<this._index)throw new v("attempt to read outside the boundary of the buffer");const m=4-(o%4||4);if(m>0){for(let A=0;A<m;A++)if(this._buffer[this._index+A]!==0)throw new v("invalid padding");this._index+=m}return l}rewind(){this._index=0}read(o){const l=this.advance(o);return this._buffer.subarray(l,l+o)}readInt32BE(){return this._buffer.readInt32BE(this.advance(4))}readUInt32BE(){return this._buffer.readUInt32BE(this.advance(4))}readBigInt64BE(){return this._buffer.readBigInt64BE(this.advance(8))}readBigUInt64BE(){return this._buffer.readBigUInt64BE(this.advance(8))}readFloatBE(){return this._buffer.readFloatBE(this.advance(4))}readDoubleBE(){return this._buffer.readDoubleBE(this.advance(8))}ensureInputConsumed(){if(this._index!==this._length)throw new v("invalid XDR contract typecast - source buffer not entirely consumed")}}var E=p(764).lW;const x=8192;class I{constructor(o){typeof o=="number"?o=E.allocUnsafe(o):o instanceof E||(o=E.allocUnsafe(x)),this._buffer=o,this._length=o.length}_buffer;_length;_index=0;alloc(o){const l=this._index;return this._index+=o,this._length<this._index&&this.resize(this._index),l}resize(o){const l=Math.ceil(o/x)*x,m=E.allocUnsafe(l);this._buffer.copy(m,0,0,this._length),this._buffer=m,this._length=l}finalize(){return this._buffer.subarray(0,this._index)}toArray(){return[...this.finalize()]}write(o,l){if(typeof o=="string"){const A=this.alloc(l);this._buffer.write(o,A,"utf8")}else{o instanceof E||(o=E.from(o));const A=this.alloc(l);o.copy(this._buffer,A,0,l)}const m=4-(l%4||4);if(m>0){const A=this.alloc(m);this._buffer.fill(0,A,this._index)}}writeInt32BE(o){const l=this.alloc(4);this._buffer.writeInt32BE(o,l)}writeUInt32BE(o){const l=this.alloc(4);this._buffer.writeUInt32BE(o,l)}writeBigInt64BE(o){const l=this.alloc(8);this._buffer.writeBigInt64BE(o,l)}writeBigUInt64BE(o){const l=this.alloc(8);this._buffer.writeBigUInt64BE(o,l)}writeFloatBE(o){const l=this.alloc(4);this._buffer.writeFloatBE(o,l)}writeDoubleBE(o){const l=this.alloc(8);this._buffer.writeDoubleBE(o,l)}static bufferChunkSize=x}var S=p(764).lW;class T{toXDR(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw";if(!this.write)return this.constructor.toXDR(this,o);const l=new I;return this.write(this,l),j(l.finalize(),o)}fromXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";if(!this.read)return this.constructor.fromXDR(o,l);const m=new d(q(o,l)),A=this.read(m);return m.ensureInputConsumed(),A}validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}static toXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";const m=new I;return this.write(o,m),j(m.finalize(),l)}static fromXDR(o){const l=new d(q(o,arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw")),m=this.read(l);return l.ensureInputConsumed(),m}static validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}}class P extends T{static read(o){throw new w}static write(o,l){throw new w}static isValid(o){return!1}}class B extends T{isValid(o){return!1}}class D extends TypeError{constructor(o){super(`Invalid format ${o}, must be one of "raw", "hex", "base64"`)}}function j(y,o){switch(o){case"raw":return y;case"hex":return y.toString("hex");case"base64":return y.toString("base64");default:throw new D(o)}}function q(y,o){switch(o){case"raw":return y;case"hex":return S.from(y,"hex");case"base64":return S.from(y,"base64");default:throw new D(o)}}const z=2147483647,X=-2147483648;class V extends P{static read(o){return o.readInt32BE()}static write(o,l){if(typeof o!="number")throw new h("not a number");if((0|o)!==o)throw new h("invalid i32 value");l.writeInt32BE(o)}static isValid(o){return typeof o=="number"&&(0|o)===o&&o>=X&&o<=z}}V.MAX_VALUE=z,V.MIN_VALUE=2147483648;const ae=-9223372036854775808n,ue=9223372036854775807n;class k extends P{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ae||o>ue)throw new TypeError("Invalid i64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid i64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!1}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new k(o.readBigInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a Hyper`);l.writeBigInt64BE(o._value)}static fromString(o){if(!/^-?\d{0,19}$/.test(o))throw new TypeError(`Invalid i64 string value: ${o}`);return new k(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}k.MAX_VALUE=new k(ue),k.MIN_VALUE=new k(ae);const re=4294967295;class N extends P{static read(o){return o.readUInt32BE()}static write(o,l){if(typeof o!="number"||!(o>=0&&o<=re)||o%1!=0)throw new h("invalid u32 value");l.writeUInt32BE(o)}static isValid(o){return typeof o=="number"&&o%1==0&&o>=0&&o<=re}}N.MAX_VALUE=re,N.MIN_VALUE=0;const ce=0n,hr=0xFFFFFFFFFFFFFFFFn;class se extends P{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ce||o>hr)throw new TypeError("Invalid u64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid u64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!0}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new se(o.readBigUInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not an UnsignedHyper`);l.writeBigUInt64BE(o._value)}static fromString(o){if(!/^\d{0,20}$/.test(o))throw new TypeError(`Invalid u64 string value: ${o}`);return new se(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}se.MAX_VALUE=new se(hr),se.MIN_VALUE=new se(ce);class Ne extends P{static read(o){return o.readFloatBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeFloatBE(o)}static isValid(o){return typeof o=="number"}}class St extends P{static read(o){return o.readDoubleBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeDoubleBE(o)}static isValid(o){return typeof o=="number"}}class G extends P{static read(){throw new _("quadruple not supported")}static write(){throw new _("quadruple not supported")}static isValid(){return!1}}class H extends P{static read(o){const l=V.read(o);switch(l){case 0:return!1;case 1:return!0;default:throw new v(`got ${l} when trying to read a bool`)}}static write(o,l){const m=o?1:0;V.write(m,l)}static isValid(o){return typeof o=="boolean"}}var dr=p(764).lW;class Dr extends B{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length String, max allowed is ${this._maxLength}`);return o.read(l)}readString(o){return this.read(o).toString("utf8")}write(o,l){const m=typeof o=="string"?dr.byteLength(o,"utf8"):o.length;if(m>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(m,l),l.write(o,m)}isValid(o){return typeof o=="string"?dr.byteLength(o,"utf8")<=this._maxLength:!!(o instanceof Array||dr.isBuffer(o))&&o.length<=this._maxLength}}var xt=p(764).lW;class Nr extends B{constructor(o){super(),this._length=o}read(o){return o.read(this._length)}write(o,l){const{length:m}=o;if(m!==this._length)throw new h(`got ${o.length} bytes, expected ${this._length}`);l.write(o,m)}isValid(o){return xt.isBuffer(o)&&o.length===this._length}}var It=p(764).lW;class Te extends B{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length VarOpaque, max allowed is ${this._maxLength}`);return o.read(l)}write(o,l){const{length:m}=o;if(o.length>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(m,l),l.write(o,m)}isValid(o){return It.isBuffer(o)&&o.length<=this._maxLength}}class yr extends B{constructor(o,l){super(),this._childType=o,this._length=l}read(o){const l=new p.g.Array(this._length);for(let m=0;m<this._length;m++)l[m]=this._childType.read(o);return l}write(o,l){if(!(o instanceof p.g.Array))throw new h("value is not array");if(o.length!==this._length)throw new h(`got array of size ${o.length}, expected ${this._length}`);for(const m of o)this._childType.write(m,l)}isValid(o){if(!(o instanceof p.g.Array)||o.length!==this._length)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Mr extends B{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:N.MAX_VALUE;super(),this._childType=o,this._maxLength=l}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length VarArray, max allowed is ${this._maxLength}`);const m=new Array(l);for(let A=0;A<l;A++)m[A]=this._childType.read(o);return m}write(o,l){if(!(o instanceof Array))throw new h("value is not array");if(o.length>this._maxLength)throw new h(`got array of size ${o.length}, max allowed is ${this._maxLength}`);N.write(o.length,l);for(const m of o)this._childType.write(m,l)}isValid(o){if(!(o instanceof Array)||o.length>this._maxLength)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Lr extends P{constructor(o){super(),this._childType=o}read(o){if(H.read(o))return this._childType.read(o)}write(o,l){const m=o!=null;H.write(m,l),m&&this._childType.write(o,l)}isValid(o){return o==null||this._childType.isValid(o)}}class Q extends P{static read(){}static write(o){if(o!==void 0)throw new h("trying to write value to a void slot")}static isValid(o){return o===void 0}}class be extends P{constructor(o,l){super(),this.name=o,this.value=l}static read(o){const l=V.read(o),m=this._byValue[l];if(m===void 0)throw new v(`unknown ${this.enumName} member for value ${l}`);return m}static write(o,l){if(!(o instanceof this))throw new h(`unknown ${o} is not a ${this.enumName}`);V.write(o.value,l)}static isValid(o){return o instanceof this}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(o){const l=this._members[o];if(!l)throw new TypeError(`${o} is not a member of ${this.enumName}`);return l}static fromValue(o){const l=this._byValue[o];if(l===void 0)throw new TypeError(`${o} is not a value of any member of ${this.enumName}`);return l}static create(o,l,m){const A=class extends be{};A.enumName=l,o.results[l]=A,A._members={},A._byValue={};for(const[F,R]of Object.entries(m)){const C=new A(F,R);A._members[F]=C,A._byValue[R]=C,A[F]=()=>C}return A}}class te extends P{resolve(){throw new _('"resolve" method should be implemented in the descendant class')}}class Me extends P{constructor(o){super(),this._attributes=o||{}}static read(o){const l={};for(const[m,A]of this._fields)l[m]=A.read(o);return new this(l)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.structName}`);for(const[m,A]of this._fields){const F=o._attributes[m];A.write(F,l)}}static isValid(o){return o instanceof this}static create(o,l,m){const A=class extends Me{};A.structName=l,o.results[l]=A;const F=new Array(m.length);for(let R=0;R<m.length;R++){const C=m[R],jr=C[0];let Ot=C[1];Ot instanceof te&&(Ot=Ot.resolve(o)),F[R]=[jr,Ot],A.prototype[jr]=Tt(jr)}return A._fields=F,A}}function Tt(y){return function(o){return o!==void 0&&(this._attributes[y]=o),this._attributes[y]}}class Oe extends B{constructor(o,l){super(),this.set(o,l)}set(o,l){typeof o=="string"&&(o=this.constructor._switchOn.fromName(o)),this._switch=o;const m=this.constructor.armForSwitch(this._switch);this._arm=m,this._armType=m===Q?Q:this.constructor._arms[m],this._value=l}get(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==Q&&this._arm!==o)throw new TypeError(`${o} not set`);return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(o){const l=this._switches.get(o);if(l!==void 0)return l;if(this._defaultArm)return this._defaultArm;throw new TypeError(`Bad union switch: ${o}`)}static armTypeForArm(o){return o===Q?Q:this._arms[o]}static read(o){const l=this._switchOn.read(o),m=this.armForSwitch(l),A=m===Q?Q:this._arms[m];let F;return F=A!==void 0?A.read(o):m.read(o),new this(l,F)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.unionName}`);this._switchOn.write(o.switch(),l),o.armType().write(o.value(),l)}static isValid(o){return o instanceof this}static create(o,l,m){const A=class extends Oe{};A.unionName=l,o.results[l]=A,m.switchOn instanceof te?A._switchOn=m.switchOn.resolve(o):A._switchOn=m.switchOn,A._switches=new Map,A._arms={};let F=m.defaultArm;F instanceof te&&(F=F.resolve(o)),A._defaultArm=F;for(const[R,C]of m.switches){const jr=typeof R=="string"?A._switchOn.fromName(R):R;A._switches.set(jr,C)}if(A._switchOn.values!==void 0)for(const R of A._switchOn.values())A[R.name]=function(C){return new A(R,C)},A.prototype[R.name]=function(C){return this.set(R,C)};if(m.arms)for(const[R,C]of Object.entries(m.arms))A._arms[R]=C instanceof te?C.resolve(o):C,C!==Q&&(A.prototype[R]=function(){return this.get(R)});return A}}class le extends te{constructor(o){super(),this.name=o}resolve(o){return o.definitions[this.name].resolve(o)}}class gr extends te{constructor(o,l){let m=arguments.length>2&&arguments[2]!==void 0&&arguments[2];super(),this.childReference=o,this.length=l,this.variable=m}resolve(o){let l=this.childReference,m=this.length;return l instanceof te&&(l=l.resolve(o)),m instanceof te&&(m=m.resolve(o)),this.variable?new Mr(l,m):new yr(l,m)}}class Qn extends te{constructor(o){super(),this.childReference=o,this.name=o.name}resolve(o){let l=this.childReference;return l instanceof te&&(l=l.resolve(o)),new Lr(l)}}class pe extends te{constructor(o,l){super(),this.sizedType=o,this.length=l}resolve(o){let l=this.length;return l instanceof te&&(l=l.resolve(o)),new this.sizedType(l)}}class Je{constructor(o,l,m){this.constructor=o,this.name=l,this.config=m}resolve(o){return this.name in o.results?o.results[this.name]:this.constructor(o,this.name,this.config)}}function i(y,o,l){return l instanceof te&&(l=l.resolve(y)),y.results[o]=l,l}function u(y,o,l){return y.results[o]=l,l}class f{constructor(o){this._destination=o,this._definitions={}}enum(o,l){const m=new Je(be.create,o,l);this.define(o,m)}struct(o,l){const m=new Je(Me.create,o,l);this.define(o,m)}union(o,l){const m=new Je(Oe.create,o,l);this.define(o,m)}typedef(o,l){const m=new Je(i,o,l);this.define(o,m)}const(o,l){const m=new Je(u,o,l);this.define(o,m)}void(){return Q}bool(){return H}int(){return V}hyper(){return k}uint(){return N}uhyper(){return se}float(){return Ne}double(){return St}quadruple(){return G}string(o){return new pe(Dr,o)}opaque(o){return new pe(Nr,o)}varOpaque(o){return new pe(Te,o)}array(o,l){return new gr(o,l)}varArray(o,l){return new gr(o,l,!0)}option(o){return new Qn(o)}define(o,l){if(this._destination[o]!==void 0)throw new _(`${o} is already defined`);this._definitions[o]=l}lookup(o){return new le(o)}resolve(){for(const o of Object.values(this._definitions))o.resolve({definitions:this._definitions,results:this._destination})}}function g(y){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(y){const l=new f(o);y(l),l.resolve()}return o}},742:(s,c)=>{c.byteLength=function(E){var x=b(E),I=x[0],S=x[1];return 3*(I+S)/4-S},c.toByteArray=function(E){var x,I,S=b(E),T=S[0],P=S[1],B=new v(function(q,z,X){return 3*(z+X)/4-X}(0,T,P)),D=0,j=P>0?T-4:T;for(I=0;I<j;I+=4)x=h[E.charCodeAt(I)]<<18|h[E.charCodeAt(I+1)]<<12|h[E.charCodeAt(I+2)]<<6|h[E.charCodeAt(I+3)],B[D++]=x>>16&255,B[D++]=x>>8&255,B[D++]=255&x;return P===2&&(x=h[E.charCodeAt(I)]<<2|h[E.charCodeAt(I+1)]>>4,B[D++]=255&x),P===1&&(x=h[E.charCodeAt(I)]<<10|h[E.charCodeAt(I+1)]<<4|h[E.charCodeAt(I+2)]>>2,B[D++]=x>>8&255,B[D++]=255&x),B},c.fromByteArray=function(E){for(var x,I=E.length,S=I%3,T=[],P=16383,B=0,D=I-S;B<D;B+=P)T.push(d(E,B,B+P>D?D:B+P));return S===1?(x=E[I-1],T.push(p[x>>2]+p[x<<4&63]+"==")):S===2&&(x=(E[I-2]<<8)+E[I-1],T.push(p[x>>10]+p[x>>4&63]+p[x<<2&63]+"=")),T.join("")};for(var p=[],h=[],v=typeof Uint8Array<"u"?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=0;w<64;++w)p[w]=_[w],h[_.charCodeAt(w)]=w;function b(E){var x=E.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=E.indexOf("=");return I===-1&&(I=x),[I,I===x?0:4-I%4]}function d(E,x,I){for(var S,T,P=[],B=x;B<I;B+=3)S=(E[B]<<16&16711680)+(E[B+1]<<8&65280)+(255&E[B+2]),P.push(p[(T=S)>>18&63]+p[T>>12&63]+p[T>>6&63]+p[63&T]);return P.join("")}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},764:(s,c,p)=>{const h=p(742),v=p(645),_=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;c.lW=d,c.h2=50;const w=2147483647;function b(i){if(i>w)throw new RangeError('The value "'+i+'" is invalid for option "size"');const u=new Uint8Array(i);return Object.setPrototypeOf(u,d.prototype),u}function d(i,u,f){if(typeof i=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return I(i)}return E(i,u,f)}function E(i,u,f){if(typeof i=="string")return function(o,l){if(typeof l=="string"&&l!==""||(l="utf8"),!d.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const m=0|B(o,l);let A=b(m);const F=A.write(o,l);return F!==m&&(A=A.slice(0,F)),A}(i,u);if(ArrayBuffer.isView(i))return function(o){if(le(o,Uint8Array)){const l=new Uint8Array(o);return T(l.buffer,l.byteOffset,l.byteLength)}return S(o)}(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(le(i,ArrayBuffer)||i&&le(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(le(i,SharedArrayBuffer)||i&&le(i.buffer,SharedArrayBuffer)))return T(i,u,f);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const g=i.valueOf&&i.valueOf();if(g!=null&&g!==i)return d.from(g,u,f);const y=function(o){if(d.isBuffer(o)){const l=0|P(o.length),m=b(l);return m.length===0||o.copy(m,0,0,l),m}if(o.length!==void 0)return typeof o.length!="number"||gr(o.length)?b(0):S(o);if(o.type==="Buffer"&&Array.isArray(o.data))return S(o.data)}(i);if(y)return y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return d.from(i[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function x(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function I(i){return x(i),b(i<0?0:0|P(i))}function S(i){const u=i.length<0?0:0|P(i.length),f=b(u);for(let g=0;g<u;g+=1)f[g]=255&i[g];return f}function T(i,u,f){if(u<0||i.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let g;return g=u===void 0&&f===void 0?new Uint8Array(i):f===void 0?new Uint8Array(i,u):new Uint8Array(i,u,f),Object.setPrototypeOf(g,d.prototype),g}function P(i){if(i>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return 0|i}function B(i,u){if(d.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||le(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const f=i.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&f===0)return 0;let y=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return Me(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*f;case"hex":return f>>>1;case"base64":return Tt(i).length;default:if(y)return g?-1:Me(i).length;u=(""+u).toLowerCase(),y=!0}}function D(i,u,f){let g=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0)<=(u>>>=0))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ne(this,u,f);case"utf8":case"utf-8":return N(this,u,f);case"ascii":return hr(this,u,f);case"latin1":case"binary":return se(this,u,f);case"base64":return re(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return St(this,u,f);default:if(g)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),g=!0}}function j(i,u,f){const g=i[u];i[u]=i[f],i[f]=g}function q(i,u,f,g,y){if(i.length===0)return-1;if(typeof f=="string"?(g=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),gr(f=+f)&&(f=y?0:i.length-1),f<0&&(f=i.length+f),f>=i.length){if(y)return-1;f=i.length-1}else if(f<0){if(!y)return-1;f=0}if(typeof u=="string"&&(u=d.from(u,g)),d.isBuffer(u))return u.length===0?-1:z(i,u,f,g,y);if(typeof u=="number")return u&=255,typeof Uint8Array.prototype.indexOf=="function"?y?Uint8Array.prototype.indexOf.call(i,u,f):Uint8Array.prototype.lastIndexOf.call(i,u,f):z(i,[u],f,g,y);throw new TypeError("val must be string, number or Buffer")}function z(i,u,f,g,y){let o,l=1,m=i.length,A=u.length;if(g!==void 0&&((g=String(g).toLowerCase())==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(i.length<2||u.length<2)return-1;l=2,m/=2,A/=2,f/=2}function F(R,C){return l===1?R[C]:R.readUInt16BE(C*l)}if(y){let R=-1;for(o=f;o<m;o++)if(F(i,o)===F(u,R===-1?0:o-R)){if(R===-1&&(R=o),o-R+1===A)return R*l}else R!==-1&&(o-=o-R),R=-1}else for(f+A>m&&(f=m-A),o=f;o>=0;o--){let R=!0;for(let C=0;C<A;C++)if(F(i,o+C)!==F(u,C)){R=!1;break}if(R)return o}return-1}function X(i,u,f,g){f=Number(f)||0;const y=i.length-f;g?(g=Number(g))>y&&(g=y):g=y;const o=u.length;let l;for(g>o/2&&(g=o/2),l=0;l<g;++l){const m=parseInt(u.substr(2*l,2),16);if(gr(m))return l;i[f+l]=m}return l}function V(i,u,f,g){return Oe(Me(u,i.length-f),i,f,g)}function ae(i,u,f,g){return Oe(function(y){const o=[];for(let l=0;l<y.length;++l)o.push(255&y.charCodeAt(l));return o}(u),i,f,g)}function ue(i,u,f,g){return Oe(Tt(u),i,f,g)}function k(i,u,f,g){return Oe(function(y,o){let l,m,A;const F=[];for(let R=0;R<y.length&&!((o-=2)<0);++R)l=y.charCodeAt(R),m=l>>8,A=l%256,F.push(A),F.push(m);return F}(u,i.length-f),i,f,g)}function re(i,u,f){return u===0&&f===i.length?h.fromByteArray(i):h.fromByteArray(i.slice(u,f))}function N(i,u,f){f=Math.min(i.length,f);const g=[];let y=u;for(;y<f;){const o=i[y];let l=null,m=o>239?4:o>223?3:o>191?2:1;if(y+m<=f){let A,F,R,C;switch(m){case 1:o<128&&(l=o);break;case 2:A=i[y+1],(192&A)==128&&(C=(31&o)<<6|63&A,C>127&&(l=C));break;case 3:A=i[y+1],F=i[y+2],(192&A)==128&&(192&F)==128&&(C=(15&o)<<12|(63&A)<<6|63&F,C>2047&&(C<55296||C>57343)&&(l=C));break;case 4:A=i[y+1],F=i[y+2],R=i[y+3],(192&A)==128&&(192&F)==128&&(192&R)==128&&(C=(15&o)<<18|(63&A)<<12|(63&F)<<6|63&R,C>65535&&C<1114112&&(l=C))}}l===null?(l=65533,m=1):l>65535&&(l-=65536,g.push(l>>>10&1023|55296),l=56320|1023&l),g.push(l),y+=m}return function(o){const l=o.length;if(l<=ce)return String.fromCharCode.apply(String,o);let m="",A=0;for(;A<l;)m+=String.fromCharCode.apply(String,o.slice(A,A+=ce));return m}(g)}d.TYPED_ARRAY_SUPPORT=function(){try{const i=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(i,u),i.foo()===42}catch{return!1}}(),d.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),d.poolSize=8192,d.from=function(i,u,f){return E(i,u,f)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(i,u,f){return function(g,y,o){return x(g),g<=0?b(g):y!==void 0?typeof o=="string"?b(g).fill(y,o):b(g).fill(y):b(g)}(i,u,f)},d.allocUnsafe=function(i){return I(i)},d.allocUnsafeSlow=function(i){return I(i)},d.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==d.prototype},d.compare=function(i,u){if(le(i,Uint8Array)&&(i=d.from(i,i.offset,i.byteLength)),le(u,Uint8Array)&&(u=d.from(u,u.offset,u.byteLength)),!d.isBuffer(i)||!d.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===u)return 0;let f=i.length,g=u.length;for(let y=0,o=Math.min(f,g);y<o;++y)if(i[y]!==u[y]){f=i[y],g=u[y];break}return f<g?-1:g<f?1:0},d.isEncoding=function(i){switch(String(i).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(i,u){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return d.alloc(0);let f;if(u===void 0)for(u=0,f=0;f<i.length;++f)u+=i[f].length;const g=d.allocUnsafe(u);let y=0;for(f=0;f<i.length;++f){let o=i[f];if(le(o,Uint8Array))y+o.length>g.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(g,y)):Uint8Array.prototype.set.call(g,o,y);else{if(!d.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(g,y)}y+=o.length}return g},d.byteLength=B,d.prototype._isBuffer=!0,d.prototype.swap16=function(){const i=this.length;if(i%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<i;u+=2)j(this,u,u+1);return this},d.prototype.swap32=function(){const i=this.length;if(i%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<i;u+=4)j(this,u,u+3),j(this,u+1,u+2);return this},d.prototype.swap64=function(){const i=this.length;if(i%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<i;u+=8)j(this,u,u+7),j(this,u+1,u+6),j(this,u+2,u+5),j(this,u+3,u+4);return this},d.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?N(this,0,i):D.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(i){if(!d.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i||d.compare(this,i)===0},d.prototype.inspect=function(){let i="";const u=c.h2;return i=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(i+=" ... "),"<Buffer "+i+">"},_&&(d.prototype[_]=d.prototype.inspect),d.prototype.compare=function(i,u,f,g,y){if(le(i,Uint8Array)&&(i=d.from(i,i.offset,i.byteLength)),!d.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(u===void 0&&(u=0),f===void 0&&(f=i?i.length:0),g===void 0&&(g=0),y===void 0&&(y=this.length),u<0||f>i.length||g<0||y>this.length)throw new RangeError("out of range index");if(g>=y&&u>=f)return 0;if(g>=y)return-1;if(u>=f)return 1;if(this===i)return 0;let o=(y>>>=0)-(g>>>=0),l=(f>>>=0)-(u>>>=0);const m=Math.min(o,l),A=this.slice(g,y),F=i.slice(u,f);for(let R=0;R<m;++R)if(A[R]!==F[R]){o=A[R],l=F[R];break}return o<l?-1:l<o?1:0},d.prototype.includes=function(i,u,f){return this.indexOf(i,u,f)!==-1},d.prototype.indexOf=function(i,u,f){return q(this,i,u,f,!0)},d.prototype.lastIndexOf=function(i,u,f){return q(this,i,u,f,!1)},d.prototype.write=function(i,u,f,g){if(u===void 0)g="utf8",f=this.length,u=0;else if(f===void 0&&typeof u=="string")g=u,f=this.length,u=0;else{if(!isFinite(u))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");u>>>=0,isFinite(f)?(f>>>=0,g===void 0&&(g="utf8")):(g=f,f=void 0)}const y=this.length-u;if((f===void 0||f>y)&&(f=y),i.length>0&&(f<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");g||(g="utf8");let o=!1;for(;;)switch(g){case"hex":return X(this,i,u,f);case"utf8":case"utf-8":return V(this,i,u,f);case"ascii":case"latin1":case"binary":return ae(this,i,u,f);case"base64":return ue(this,i,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,i,u,f);default:if(o)throw new TypeError("Unknown encoding: "+g);g=(""+g).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const ce=4096;function hr(i,u,f){let g="";f=Math.min(i.length,f);for(let y=u;y<f;++y)g+=String.fromCharCode(127&i[y]);return g}function se(i,u,f){let g="";f=Math.min(i.length,f);for(let y=u;y<f;++y)g+=String.fromCharCode(i[y]);return g}function Ne(i,u,f){const g=i.length;(!u||u<0)&&(u=0),(!f||f<0||f>g)&&(f=g);let y="";for(let o=u;o<f;++o)y+=Qn[i[o]];return y}function St(i,u,f){const g=i.slice(u,f);let y="";for(let o=0;o<g.length-1;o+=2)y+=String.fromCharCode(g[o]+256*g[o+1]);return y}function G(i,u,f){if(i%1!=0||i<0)throw new RangeError("offset is not uint");if(i+u>f)throw new RangeError("Trying to access beyond buffer length")}function H(i,u,f,g,y,o){if(!d.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>y||u<o)throw new RangeError('"value" argument is out of bounds');if(f+g>i.length)throw new RangeError("Index out of range")}function dr(i,u,f,g,y){Lr(u,g,y,i,f,7);let o=Number(u&BigInt(4294967295));i[f++]=o,o>>=8,i[f++]=o,o>>=8,i[f++]=o,o>>=8,i[f++]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[f++]=l,l>>=8,i[f++]=l,l>>=8,i[f++]=l,l>>=8,i[f++]=l,f}function Dr(i,u,f,g,y){Lr(u,g,y,i,f,7);let o=Number(u&BigInt(4294967295));i[f+7]=o,o>>=8,i[f+6]=o,o>>=8,i[f+5]=o,o>>=8,i[f+4]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[f+3]=l,l>>=8,i[f+2]=l,l>>=8,i[f+1]=l,l>>=8,i[f]=l,f+8}function xt(i,u,f,g,y,o){if(f+g>i.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Nr(i,u,f,g,y){return u=+u,f>>>=0,y||xt(i,0,f,4),v.write(i,u,f,g,23,4),f+4}function It(i,u,f,g,y){return u=+u,f>>>=0,y||xt(i,0,f,8),v.write(i,u,f,g,52,8),f+8}d.prototype.slice=function(i,u){const f=this.length;(i=~~i)<0?(i+=f)<0&&(i=0):i>f&&(i=f),(u=u===void 0?f:~~u)<0?(u+=f)<0&&(u=0):u>f&&(u=f),u<i&&(u=i);const g=this.subarray(i,u);return Object.setPrototypeOf(g,d.prototype),g},d.prototype.readUintLE=d.prototype.readUIntLE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i],y=1,o=0;for(;++o<u&&(y*=256);)g+=this[i+o]*y;return g},d.prototype.readUintBE=d.prototype.readUIntBE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i+--u],y=1;for(;u>0&&(y*=256);)g+=this[i+--u]*y;return g},d.prototype.readUint8=d.prototype.readUInt8=function(i,u){return i>>>=0,u||G(i,1,this.length),this[i]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(i,u){return i>>>=0,u||G(i,2,this.length),this[i]|this[i+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(i,u){return i>>>=0,u||G(i,2,this.length),this[i]<<8|this[i+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(i,u){return i>>>=0,u||G(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+16777216*this[i+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(i,u){return i>>>=0,u||G(i,4,this.length),16777216*this[i]+(this[i+1]<<16|this[i+2]<<8|this[i+3])},d.prototype.readBigUInt64LE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=u+256*this[++i]+65536*this[++i]+this[++i]*2**24,y=this[++i]+256*this[++i]+65536*this[++i]+f*2**24;return BigInt(g)+(BigInt(y)<<BigInt(32))}),d.prototype.readBigUInt64BE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=u*2**24+65536*this[++i]+256*this[++i]+this[++i],y=this[++i]*2**24+65536*this[++i]+256*this[++i]+f;return(BigInt(g)<<BigInt(32))+BigInt(y)}),d.prototype.readIntLE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i],y=1,o=0;for(;++o<u&&(y*=256);)g+=this[i+o]*y;return y*=128,g>=y&&(g-=Math.pow(2,8*u)),g},d.prototype.readIntBE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=u,y=1,o=this[i+--g];for(;g>0&&(y*=256);)o+=this[i+--g]*y;return y*=128,o>=y&&(o-=Math.pow(2,8*u)),o},d.prototype.readInt8=function(i,u){return i>>>=0,u||G(i,1,this.length),128&this[i]?-1*(255-this[i]+1):this[i]},d.prototype.readInt16LE=function(i,u){i>>>=0,u||G(i,2,this.length);const f=this[i]|this[i+1]<<8;return 32768&f?4294901760|f:f},d.prototype.readInt16BE=function(i,u){i>>>=0,u||G(i,2,this.length);const f=this[i+1]|this[i]<<8;return 32768&f?4294901760|f:f},d.prototype.readInt32LE=function(i,u){return i>>>=0,u||G(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},d.prototype.readInt32BE=function(i,u){return i>>>=0,u||G(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},d.prototype.readBigInt64LE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=this[i+4]+256*this[i+5]+65536*this[i+6]+(f<<24);return(BigInt(g)<<BigInt(32))+BigInt(u+256*this[++i]+65536*this[++i]+this[++i]*16777216)}),d.prototype.readBigInt64BE=pe(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||be(i,this.length-8);const g=(u<<24)+65536*this[++i]+256*this[++i]+this[++i];return(BigInt(g)<<BigInt(32))+BigInt(this[++i]*16777216+65536*this[++i]+256*this[++i]+f)}),d.prototype.readFloatLE=function(i,u){return i>>>=0,u||G(i,4,this.length),v.read(this,i,!0,23,4)},d.prototype.readFloatBE=function(i,u){return i>>>=0,u||G(i,4,this.length),v.read(this,i,!1,23,4)},d.prototype.readDoubleLE=function(i,u){return i>>>=0,u||G(i,8,this.length),v.read(this,i,!0,52,8)},d.prototype.readDoubleBE=function(i,u){return i>>>=0,u||G(i,8,this.length),v.read(this,i,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(i,u,f,g){i=+i,u>>>=0,f>>>=0,!g&&H(this,i,u,f,Math.pow(2,8*f)-1,0);let y=1,o=0;for(this[u]=255&i;++o<f&&(y*=256);)this[u+o]=i/y&255;return u+f},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(i,u,f,g){i=+i,u>>>=0,f>>>=0,!g&&H(this,i,u,f,Math.pow(2,8*f)-1,0);let y=f-1,o=1;for(this[u+y]=255&i;--y>=0&&(o*=256);)this[u+y]=i/o&255;return u+f},d.prototype.writeUint8=d.prototype.writeUInt8=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,1,255,0),this[u]=255&i,u+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,65535,0),this[u]=255&i,this[u+1]=i>>>8,u+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,65535,0),this[u]=i>>>8,this[u+1]=255&i,u+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,4294967295,0),this[u+3]=i>>>24,this[u+2]=i>>>16,this[u+1]=i>>>8,this[u]=255&i,u+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,4294967295,0),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},d.prototype.writeBigUInt64LE=pe(function(i,u=0){return dr(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=pe(function(i,u=0){return Dr(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(i,u,f,g){if(i=+i,u>>>=0,!g){const m=Math.pow(2,8*f-1);H(this,i,u,f,m-1,-m)}let y=0,o=1,l=0;for(this[u]=255&i;++y<f&&(o*=256);)i<0&&l===0&&this[u+y-1]!==0&&(l=1),this[u+y]=(i/o>>0)-l&255;return u+f},d.prototype.writeIntBE=function(i,u,f,g){if(i=+i,u>>>=0,!g){const m=Math.pow(2,8*f-1);H(this,i,u,f,m-1,-m)}let y=f-1,o=1,l=0;for(this[u+y]=255&i;--y>=0&&(o*=256);)i<0&&l===0&&this[u+y+1]!==0&&(l=1),this[u+y]=(i/o>>0)-l&255;return u+f},d.prototype.writeInt8=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,1,127,-128),i<0&&(i=255+i+1),this[u]=255&i,u+1},d.prototype.writeInt16LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,32767,-32768),this[u]=255&i,this[u+1]=i>>>8,u+2},d.prototype.writeInt16BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,32767,-32768),this[u]=i>>>8,this[u+1]=255&i,u+2},d.prototype.writeInt32LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,2147483647,-2147483648),this[u]=255&i,this[u+1]=i>>>8,this[u+2]=i>>>16,this[u+3]=i>>>24,u+4},d.prototype.writeInt32BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},d.prototype.writeBigInt64LE=pe(function(i,u=0){return dr(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=pe(function(i,u=0){return Dr(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeFloatLE=function(i,u,f){return Nr(this,i,u,!0,f)},d.prototype.writeFloatBE=function(i,u,f){return Nr(this,i,u,!1,f)},d.prototype.writeDoubleLE=function(i,u,f){return It(this,i,u,!0,f)},d.prototype.writeDoubleBE=function(i,u,f){return It(this,i,u,!1,f)},d.prototype.copy=function(i,u,f,g){if(!d.isBuffer(i))throw new TypeError("argument should be a Buffer");if(f||(f=0),g||g===0||(g=this.length),u>=i.length&&(u=i.length),u||(u=0),g>0&&g<f&&(g=f),g===f||i.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(f<0||f>=this.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("sourceEnd out of bounds");g>this.length&&(g=this.length),i.length-u<g-f&&(g=i.length-u+f);const y=g-f;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,f,g):Uint8Array.prototype.set.call(i,this.subarray(f,g),u),y},d.prototype.fill=function(i,u,f,g){if(typeof i=="string"){if(typeof u=="string"?(g=u,u=0,f=this.length):typeof f=="string"&&(g=f,f=this.length),g!==void 0&&typeof g!="string")throw new TypeError("encoding must be a string");if(typeof g=="string"&&!d.isEncoding(g))throw new TypeError("Unknown encoding: "+g);if(i.length===1){const o=i.charCodeAt(0);(g==="utf8"&&o<128||g==="latin1")&&(i=o)}}else typeof i=="number"?i&=255:typeof i=="boolean"&&(i=Number(i));if(u<0||this.length<u||this.length<f)throw new RangeError("Out of range index");if(f<=u)return this;let y;if(u>>>=0,f=f===void 0?this.length:f>>>0,i||(i=0),typeof i=="number")for(y=u;y<f;++y)this[y]=i;else{const o=d.isBuffer(i)?i:d.from(i,g),l=o.length;if(l===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(y=0;y<f-u;++y)this[y+u]=o[y%l]}return this};const Te={};function yr(i,u,f){Te[i]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(g){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:g,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}function Mr(i){let u="",f=i.length;const g=i[0]==="-"?1:0;for(;f>=g+4;f-=3)u=`_${i.slice(f-3,f)}${u}`;return`${i.slice(0,f)}${u}`}function Lr(i,u,f,g,y,o){if(i>f||i<u){const l=typeof u=="bigint"?"n":"";let m;throw m=o>3?u===0||u===BigInt(0)?`>= 0${l} and < 2${l} ** ${8*(o+1)}${l}`:`>= -(2${l} ** ${8*(o+1)-1}${l}) and < 2 ** ${8*(o+1)-1}${l}`:`>= ${u}${l} and <= ${f}${l}`,new Te.ERR_OUT_OF_RANGE("value",m,i)}(function(l,m,A){Q(m,"offset"),l[m]!==void 0&&l[m+A]!==void 0||be(m,l.length-(A+1))})(g,y,o)}function Q(i,u){if(typeof i!="number")throw new Te.ERR_INVALID_ARG_TYPE(u,"number",i)}function be(i,u,f){throw Math.floor(i)!==i?(Q(i,f),new Te.ERR_OUT_OF_RANGE(f||"offset","an integer",i)):u<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS:new Te.ERR_OUT_OF_RANGE(f||"offset",`>= ${f?1:0} and <= ${u}`,i)}yr("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),yr("ERR_INVALID_ARG_TYPE",function(i,u){return`The "${i}" argument must be of type number. Received type ${typeof u}`},TypeError),yr("ERR_OUT_OF_RANGE",function(i,u,f){let g=`The value of "${i}" is out of range.`,y=f;return Number.isInteger(f)&&Math.abs(f)>4294967296?y=Mr(String(f)):typeof f=="bigint"&&(y=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(y=Mr(y)),y+="n"),g+=` It must be ${u}. Received ${y}`,g},RangeError);const te=/[^+/0-9A-Za-z-_]/g;function Me(i,u){let f;u=u||1/0;const g=i.length;let y=null;const o=[];for(let l=0;l<g;++l){if(f=i.charCodeAt(l),f>55295&&f<57344){if(!y){if(f>56319){(u-=3)>-1&&o.push(239,191,189);continue}if(l+1===g){(u-=3)>-1&&o.push(239,191,189);continue}y=f;continue}if(f<56320){(u-=3)>-1&&o.push(239,191,189),y=f;continue}f=65536+(y-55296<<10|f-56320)}else y&&(u-=3)>-1&&o.push(239,191,189);if(y=null,f<128){if((u-=1)<0)break;o.push(f)}else if(f<2048){if((u-=2)<0)break;o.push(f>>6|192,63&f|128)}else if(f<65536){if((u-=3)<0)break;o.push(f>>12|224,f>>6&63|128,63&f|128)}else{if(!(f<1114112))throw new Error("Invalid code point");if((u-=4)<0)break;o.push(f>>18|240,f>>12&63|128,f>>6&63|128,63&f|128)}}return o}function Tt(i){return h.toByteArray(function(u){if((u=(u=u.split("=")[0]).trim().replace(te,"")).length<2)return"";for(;u.length%4!=0;)u+="=";return u}(i))}function Oe(i,u,f,g){let y;for(y=0;y<g&&!(y+f>=u.length||y>=i.length);++y)u[y+f]=i[y];return y}function le(i,u){return i instanceof u||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===u.name}function gr(i){return i!=i}const Qn=function(){const i="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){const g=16*f;for(let y=0;y<16;++y)u[g+y]=i[f]+i[y]}return u}();function pe(i){return typeof BigInt>"u"?Je:i}function Je(){throw new Error("BigInt not supported")}},645:(s,c)=>{c.read=function(p,h,v,_,w){var b,d,E=8*w-_-1,x=(1<<E)-1,I=x>>1,S=-7,T=v?w-1:0,P=v?-1:1,B=p[h+T];for(T+=P,b=B&(1<<-S)-1,B>>=-S,S+=E;S>0;b=256*b+p[h+T],T+=P,S-=8);for(d=b&(1<<-S)-1,b>>=-S,S+=_;S>0;d=256*d+p[h+T],T+=P,S-=8);if(b===0)b=1-I;else{if(b===x)return d?NaN:1/0*(B?-1:1);d+=Math.pow(2,_),b-=I}return(B?-1:1)*d*Math.pow(2,b-_)},c.write=function(p,h,v,_,w,b){var d,E,x,I=8*b-w-1,S=(1<<I)-1,T=S>>1,P=w===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=_?0:b-1,D=_?1:-1,j=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(E=isNaN(h)?1:0,d=S):(d=Math.floor(Math.log(h)/Math.LN2),h*(x=Math.pow(2,-d))<1&&(d--,x*=2),(h+=d+T>=1?P/x:P*Math.pow(2,1-T))*x>=2&&(d++,x/=2),d+T>=S?(E=0,d=S):d+T>=1?(E=(h*x-1)*Math.pow(2,w),d+=T):(E=h*Math.pow(2,T-1)*Math.pow(2,w),d=0));w>=8;p[v+B]=255&E,B+=D,E/=256,w-=8);for(d=d<<w|E,I+=w;I>0;p[v+B]=255&d,B+=D,d/=256,I-=8);p[v+B-D]|=128*j}}},n={};function a(s){var c=n[s];if(c!==void 0)return c.exports;var p=n[s]={exports:{}};return t[s](p,p.exports,a),p.exports}return a.d=(s,c)=>{for(var p in c)a.o(c,p)&&!a.o(s,p)&&Object.defineProperty(s,p,{enumerable:!0,get:c[p]})},a.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),a.o=(s,c)=>Object.prototype.hasOwnProperty.call(s,c),a.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},a(899)})())})(qa);function n1(e){const r={variantId:Ie.Uint64.fromString(e.variantId.toString()),version:e.version||Math.floor(Date.now()/1e3),items:e.items.map(n=>new Ie.BundleItem({collectionId:Ie.Uint64.fromString(n.collectionId.toString()),productId:Ie.Uint64.fromString(n.productId.toString()),variantId:Ie.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new Ie.BundleItemExt(0)})),ext:new Ie.BundleExt(0)},t=new Ie.Bundle(r);return Ie.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const Ie=qa.exports.config(e=>{e.enum("EnvelopeType",{envelopeTypeBundle:0}),e.typedef("Uint32",e.uint()),e.typedef("Uint64",e.uhyper()),e.union("BundleItemExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("BundleItem",[["collectionId",e.lookup("Uint64")],["productId",e.lookup("Uint64")],["variantId",e.lookup("Uint64")],["sku",e.string()],["quantity",e.lookup("Uint32")],["ext",e.lookup("BundleItemExt")]]),e.union("BundleExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("Bundle",[["variantId",e.lookup("Uint64")],["items",e.varArray(e.lookup("BundleItem"),500)],["version",e.lookup("Uint32")],["ext",e.lookup("BundleExt")]]),e.union("BundleEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:e.lookup("Bundle")}})}),za="/bundling-storefront-manager";function i1(){return Math.ceil(Date.now()/1e3)}async function o1(){try{const{timestamp:e}=await Or("get",`${za}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return e}catch(e){return console.error(`Fetch failed: ${e}. Using client-side date.`),i1()}}async function a1(e){const r=xe(),t=await Va(e);if(t!==!0)throw new Error(t);const n=await o1(),a=n1({variantId:e.externalVariantId,version:n,items:e.selections.map(s=>({collectionId:s.collectionId,productId:s.externalProductId,variantId:s.externalVariantId,quantity:s.quantity,sku:""}))});try{const s=await Or("post",`${za}/api/v1/bundles`,{data:{bundle:a},headers:{Origin:`https://${r.storeIdentifier}`}});if(!s.id||s.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(s)}`);return s.id}catch(s){throw new Error(`2: failed generating rb_id ${s}`)}}function s1(e,r){const t=Ha(e);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${vl(9)}:${e.externalProductId}`;return e.selections.map(a=>{const s={id:a.externalVariantId,quantity:a.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:e.externalVariantId,_rc_bundle_parent:r,_rc_bundle_collection_id:a.collectionId}};return a.sellingPlan?s.selling_plan=a.sellingPlan:a.shippingIntervalFrequency&&(s.properties.shipping_interval_frequency=a.shippingIntervalFrequency,s.properties.shipping_interval_unit_type=a.shippingIntervalUnitType,s.id=`${a.discountedVariantId}`),s})}async function Va(e){try{return e?await Ga(e.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(r){return`Error fetching bundle settings: ${r}`}}const u1={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function Ha(e){if(!e)return"No bundle defined.";if(e.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:r,shippingIntervalUnitType:t}=e.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(r||t){if(!r||!t)return"Shipping intervals do not match on selections.";{const n=u1[t];for(let a=0;a<e.selections.length;a++){const{shippingIntervalFrequency:s,shippingIntervalUnitType:c}=e.selections[a];if(s&&s!==r||c&&!n.includes(c))return"Shipping intervals do not match on selections."}}}return!0}async function c1(e,r){const{bundle_selection:t}=await O("get","/bundle_selections",{id:r},e);return t}function f1(e,r){return O("get","/bundle_selections",{query:r},e)}async function l1(e,r){const{bundle_selection:t}=await O("post","/bundle_selections",{data:r},e);return t}async function p1(e,r,t){const{bundle_selection:n}=await O("put","/bundle_selections",{id:r,data:t},e);return n}function h1(e,r){return O("delete","/bundle_selections",{id:r},e)}var d1=Object.freeze({__proto__:null,getBundleId:a1,getDynamicBundleItems:s1,validateBundle:Va,validateDynamicBundle:Ha,getBundleSelection:c1,listBundleSelections:f1,createBundleSelection:l1,updateBundleSelection:p1,deleteBundleSelection:h1});async function y1(e,r,t){const{charge:n}=await O("get","/charges",{id:r,query:{include:t?.include}},e);return n}function g1(e,r){return O("get","/charges",{query:r},e)}async function v1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/apply_discount`,{data:{discount_code:t}},e);return n}async function m1(e,r){const{charge:t}=await O("post",`/charges/${r}/remove_discount`,{},e);return t}async function _1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/skip`,{data:{purchase_item_ids:t.map(a=>Number(a))}},e);return n}async function w1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/unskip`,{data:{purchase_item_ids:t.map(a=>Number(a))}},e);return n}async function b1(e,r){const{charge:t}=await O("post",`/charges/${r}/process`,{},e);return t}var $1=Object.freeze({__proto__:null,getCharge:y1,listCharges:g1,applyDiscountToCharge:v1,removeDiscountsFromCharge:m1,skipCharge:_1,unskipCharge:w1,processCharge:b1});async function A1(e,r){const{membership:t}=await O("get","/memberships",{id:r},e);return t}function E1(e,r){return O("get","/memberships",{query:r},e)}async function S1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/cancel`,{data:t},e);return n}async function x1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/activate`,{data:t},e);return n}async function I1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/change`,{data:t},e);return n}var T1=Object.freeze({__proto__:null,getMembership:A1,listMemberships:E1,cancelMembership:S1,activateMembership:x1,changeMembership:I1});async function O1(e,r,t){const{membership_program:n}=await O("get","/membership_programs",{id:r,query:{include:t?.include}},e);return n}function B1(e,r){return O("get","/membership_programs",{query:r},e)}var P1=Object.freeze({__proto__:null,getMembershipProgram:O1,listMembershipPrograms:B1});async function R1(e,r){const{metafield:t}=await O("post","/metafields",{data:{metafield:r}},e);return t}async function F1(e,r,t){const{metafield:n}=await O("put","/metafields",{id:r,data:{metafield:t}},e);return n}function C1(e,r){return O("delete","/metafields",{id:r},e)}var U1=Object.freeze({__proto__:null,createMetafield:R1,updateMetafield:F1,deleteMetafield:C1});async function D1(e,r){const{onetime:t}=await O("get","/onetimes",{id:r},e);return t}function N1(e,r){return O("get","/onetimes",{query:r},e)}async function M1(e,r){const{onetime:t}=await O("post","/onetimes",{data:r},e);return t}async function L1(e,r,t){const{onetime:n}=await O("put","/onetimes",{id:r,data:t},e);return n}function j1(e,r){return O("delete","/onetimes",{id:r},e)}var k1=Object.freeze({__proto__:null,getOnetime:D1,listOnetimes:N1,createOnetime:M1,updateOnetime:L1,deleteOnetime:j1});async function G1(e,r){const{order:t}=await O("get","/orders",{id:r},e);return t}function W1(e,r){return O("get","/orders",{query:r},e)}var q1=Object.freeze({__proto__:null,getOrder:G1,listOrders:W1});async function z1(e,r,t){const{payment_method:n}=await O("get","/payment_methods",{id:r,query:{include:t?.include}},e);return n}async function V1(e,r,t){const{payment_method:n}=await O("put","/payment_methods",{id:r,data:t},e);return n}function H1(e,r){return O("get","/payment_methods",{query:r},e)}var Y1=Object.freeze({__proto__:null,getPaymentMethod:z1,updatePaymentMethod:V1,listPaymentMethods:H1});async function K1(e,r){const{plan:t}=await O("get","/plans",{id:r},e);return t}function X1(e,r){return O("get","/plans",{query:r},e)}var J1=Object.freeze({__proto__:null,getPlan:K1,listPlans:X1}),Q1=jn,Z1=Ia,eb=kn;function rb(e,r){return eb(Z1(e,r,Q1),e+"")}var tb=rb,Ya=Jo,nb=Ya&&new Ya,Ka=nb,ib=jn,Xa=Ka,ob=Xa?function(e,r){return Xa.set(e,r),e}:ib,Ja=ob,ab=yt,sb=Ye;function ub(e){return function(){var r=arguments;switch(r.length){case 0:return new e;case 1:return new e(r[0]);case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[1],r[2]);case 4:return new e(r[0],r[1],r[2],r[3]);case 5:return new e(r[0],r[1],r[2],r[3],r[4]);case 6:return new e(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new e(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var t=ab(e.prototype),n=e.apply(t,r);return sb(n)?n:t}}var wt=ub,cb=wt,fb=oe,lb=1;function pb(e,r,t){var n=r&lb,a=cb(e);function s(){var c=this&&this!==fb&&this instanceof s?a:e;return c.apply(n?t:this,arguments)}return s}var hb=pb,db=Math.max;function yb(e,r,t,n){for(var a=-1,s=e.length,c=t.length,p=-1,h=r.length,v=db(s-c,0),_=Array(h+v),w=!n;++p<h;)_[p]=r[p];for(;++a<c;)(w||a<s)&&(_[t[a]]=e[a]);for(;v--;)_[p++]=e[a++];return _}var Qa=yb,gb=Math.max;function vb(e,r,t,n){for(var a=-1,s=e.length,c=-1,p=t.length,h=-1,v=r.length,_=gb(s-p,0),w=Array(_+v),b=!n;++a<_;)w[a]=e[a];for(var d=a;++h<v;)w[d+h]=r[h];for(;++c<p;)(b||a<s)&&(w[d+t[c]]=e[a++]);return w}var Za=vb;function mb(e,r){for(var t=e.length,n=0;t--;)e[t]===r&&++n;return n}var _b=mb;function wb(){}var qn=wb,bb=yt,$b=qn,Ab=4294967295;function bt(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ab,this.__views__=[]}bt.prototype=bb($b.prototype),bt.prototype.constructor=bt;var zn=bt;function Eb(){}var Sb=Eb,es=Ka,xb=Sb,Ib=es?function(e){return es.get(e)}:xb,rs=Ib,Tb={},Ob=Tb,ts=Ob,Bb=Object.prototype,Pb=Bb.hasOwnProperty;function Rb(e){for(var r=e.name+"",t=ts[r],n=Pb.call(ts,r)?t.length:0;n--;){var a=t[n],s=a.func;if(s==null||s==e)return a.name}return r}var Fb=Rb,Cb=yt,Ub=qn;function $t(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=void 0}$t.prototype=Cb(Ub.prototype),$t.prototype.constructor=$t;var ns=$t,Db=zn,Nb=ns,Mb=xn;function Lb(e){if(e instanceof Db)return e.clone();var r=new Nb(e.__wrapped__,e.__chain__);return r.__actions__=Mb(e.__actions__),r.__index__=e.__index__,r.__values__=e.__values__,r}var jb=Lb,kb=zn,is=ns,Gb=qn,Wb=De,qb=Ue,zb=jb,Vb=Object.prototype,Hb=Vb.hasOwnProperty;function At(e){if(qb(e)&&!Wb(e)&&!(e instanceof kb)){if(e instanceof is)return e;if(Hb.call(e,"__wrapped__"))return zb(e)}return new is(e)}At.prototype=Gb.prototype,At.prototype.constructor=At;var Yb=At,Kb=zn,Xb=rs,Jb=Fb,Qb=Yb;function Zb(e){var r=Jb(e),t=Qb[r];if(typeof t!="function"||!(r in Kb.prototype))return!1;if(e===t)return!0;var n=Xb(t);return!!n&&e===n[0]}var e$=Zb,r$=Ja,t$=Oa,n$=t$(r$),os=n$,i$=/\{\n\/\* \[wrapped with (.+)\] \*/,o$=/,? & /;function a$(e){var r=e.match(i$);return r?r[1].split(o$):[]}var s$=a$,u$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function c$(e,r){var t=r.length;if(!t)return e;var n=t-1;return r[n]=(t>1?"& ":"")+r[n],r=r.join(t>2?", ":" "),e.replace(u$,`{
|
|
21
|
+
/* [wrapped with `+r+`] */
|
|
22
|
+
`)}var f$=c$;function l$(e,r,t,n){for(var a=e.length,s=t+(n?1:-1);n?s--:++s<a;)if(r(e[s],s,e))return s;return-1}var p$=l$;function h$(e){return e!==e}var d$=h$;function y$(e,r,t){for(var n=t-1,a=e.length;++n<a;)if(e[n]===r)return n;return-1}var g$=y$,v$=p$,m$=d$,_$=g$;function w$(e,r,t){return r===r?_$(e,r,t):v$(e,m$,t)}var b$=w$,$$=b$;function A$(e,r){var t=e==null?0:e.length;return!!t&&$$(e,r,0)>-1}var E$=A$,S$=Po,x$=E$,I$=1,T$=2,O$=8,B$=16,P$=32,R$=64,F$=128,C$=256,U$=512,D$=[["ary",F$],["bind",I$],["bindKey",T$],["curry",O$],["curryRight",B$],["flip",U$],["partial",P$],["partialRight",R$],["rearg",C$]];function N$(e,r){return S$(D$,function(t){var n="_."+t[0];r&t[1]&&!x$(e,n)&&e.push(n)}),e.sort()}var M$=N$,L$=s$,j$=f$,k$=kn,G$=M$;function W$(e,r,t){var n=r+"";return k$(e,j$(n,G$(L$(n),t)))}var as=W$,q$=e$,z$=os,V$=as,H$=1,Y$=2,K$=4,X$=8,ss=32,us=64;function J$(e,r,t,n,a,s,c,p,h,v){var _=r&X$,w=_?c:void 0,b=_?void 0:c,d=_?s:void 0,E=_?void 0:s;r|=_?ss:us,r&=~(_?us:ss),r&K$||(r&=~(H$|Y$));var x=[e,r,a,d,w,E,b,p,h,v],I=t.apply(void 0,x);return q$(e)&&z$(I,x),I.placeholder=n,V$(I,e,r)}var cs=J$;function Q$(e){var r=e;return r.placeholder}var Vn=Q$,Z$=xn,eA=Lo,rA=Math.min;function tA(e,r){for(var t=e.length,n=rA(r.length,t),a=Z$(e);n--;){var s=r[n];e[n]=eA(s,t)?a[s]:void 0}return e}var nA=tA,fs="__lodash_placeholder__";function iA(e,r){for(var t=-1,n=e.length,a=0,s=[];++t<n;){var c=e[t];(c===r||c===fs)&&(e[t]=fs,s[a++]=t)}return s}var Et=iA,oA=Qa,aA=Za,sA=_b,ls=wt,uA=cs,cA=Vn,fA=nA,lA=Et,pA=oe,hA=1,dA=2,yA=8,gA=16,vA=128,mA=512;function ps(e,r,t,n,a,s,c,p,h,v){var _=r&vA,w=r&hA,b=r&dA,d=r&(yA|gA),E=r&mA,x=b?void 0:ls(e);function I(){for(var S=arguments.length,T=Array(S),P=S;P--;)T[P]=arguments[P];if(d)var B=cA(I),D=sA(T,B);if(n&&(T=oA(T,n,a,d)),s&&(T=aA(T,s,c,d)),S-=D,d&&S<v){var j=lA(T,B);return uA(e,r,ps,I.placeholder,t,T,j,p,h,v-S)}var q=w?t:this,z=b?q[e]:e;return S=T.length,p?T=fA(T,p):E&&S>1&&T.reverse(),_&&h<S&&(T.length=h),this&&this!==pA&&this instanceof I&&(z=x||ls(z)),z.apply(q,T)}return I}var hs=ps,_A=Ln,wA=wt,bA=hs,$A=cs,AA=Vn,EA=Et,SA=oe;function xA(e,r,t){var n=wA(e);function a(){for(var s=arguments.length,c=Array(s),p=s,h=AA(a);p--;)c[p]=arguments[p];var v=s<3&&c[0]!==h&&c[s-1]!==h?[]:EA(c,h);if(s-=v.length,s<t)return $A(e,r,bA,a.placeholder,void 0,c,v,void 0,void 0,t-s);var _=this&&this!==SA&&this instanceof a?n:e;return _A(_,this,c)}return a}var IA=xA,TA=Ln,OA=wt,BA=oe,PA=1;function RA(e,r,t,n){var a=r&PA,s=OA(e);function c(){for(var p=-1,h=arguments.length,v=-1,_=n.length,w=Array(_+h),b=this&&this!==BA&&this instanceof c?s:e;++v<_;)w[v]=n[v];for(;h--;)w[v++]=arguments[++p];return TA(b,a?t:this,w)}return c}var FA=RA,CA=Qa,UA=Za,ds=Et,ys="__lodash_placeholder__",Hn=1,DA=2,NA=4,gs=8,Ur=128,vs=256,MA=Math.min;function LA(e,r){var t=e[1],n=r[1],a=t|n,s=a<(Hn|DA|Ur),c=n==Ur&&t==gs||n==Ur&&t==vs&&e[7].length<=r[8]||n==(Ur|vs)&&r[7].length<=r[8]&&t==gs;if(!(s||c))return e;n&Hn&&(e[2]=r[2],a|=t&Hn?0:NA);var p=r[3];if(p){var h=e[3];e[3]=h?CA(h,p,r[4]):p,e[4]=h?ds(e[3],ys):r[4]}return p=r[5],p&&(h=e[5],e[5]=h?UA(h,p,r[6]):p,e[6]=h?ds(e[5],ys):r[6]),p=r[7],p&&(e[7]=p),n&Ur&&(e[8]=e[8]==null?r[8]:MA(e[8],r[8])),e[9]==null&&(e[9]=r[9]),e[0]=r[0],e[1]=a,e}var jA=LA,kA=/\s/;function GA(e){for(var r=e.length;r--&&kA.test(e.charAt(r)););return r}var WA=GA,qA=WA,zA=/^\s+/;function VA(e){return e&&e.slice(0,qA(e)+1).replace(zA,"")}var HA=VA,YA=HA,ms=Ye,KA=vt,_s=0/0,XA=/^[-+]0x[0-9a-f]+$/i,JA=/^0b[01]+$/i,QA=/^0o[0-7]+$/i,ZA=parseInt;function e2(e){if(typeof e=="number")return e;if(KA(e))return _s;if(ms(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=ms(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=YA(e);var t=JA.test(e);return t||QA.test(e)?ZA(e.slice(2),t?2:8):XA.test(e)?_s:+e}var r2=e2,t2=r2,ws=1/0,n2=17976931348623157e292;function i2(e){if(!e)return e===0?e:0;if(e=t2(e),e===ws||e===-ws){var r=e<0?-1:1;return r*n2}return e===e?e:0}var o2=i2,a2=o2;function s2(e){var r=a2(e),t=r%1;return r===r?t?r-t:r:0}var u2=s2,c2=Ja,f2=hb,l2=IA,p2=hs,h2=FA,d2=rs,y2=jA,g2=os,v2=as,bs=u2,m2="Expected a function",$s=1,_2=2,Yn=8,Kn=16,Xn=32,As=64,Es=Math.max;function w2(e,r,t,n,a,s,c,p){var h=r&_2;if(!h&&typeof e!="function")throw new TypeError(m2);var v=n?n.length:0;if(v||(r&=~(Xn|As),n=a=void 0),c=c===void 0?c:Es(bs(c),0),p=p===void 0?p:bs(p),v-=a?a.length:0,r&As){var _=n,w=a;n=a=void 0}var b=h?void 0:d2(e),d=[e,r,t,n,a,_,w,s,c,p];if(b&&y2(d,b),e=d[0],r=d[1],t=d[2],n=d[3],a=d[4],p=d[9]=d[9]===void 0?h?0:e.length:Es(d[9]-v,0),!p&&r&(Yn|Kn)&&(r&=~(Yn|Kn)),!r||r==$s)var E=f2(e,r,t);else r==Yn||r==Kn?E=l2(e,r,p):(r==Xn||r==($s|Xn))&&!a.length?E=h2(e,r,t,n):E=p2.apply(void 0,d);var x=b?c2:g2;return v2(x(E,d),e,r)}var b2=w2,$2=tb,A2=b2,E2=Vn,S2=Et,x2=32,Jn=$2(function(e,r){var t=S2(r,E2(Jn));return A2(e,x2,void 0,r,t)});Jn.placeholder={};var Ss=Jn,I2=Object.defineProperty,T2=Object.defineProperties,O2=Object.getOwnPropertyDescriptors,xs=Object.getOwnPropertySymbols,B2=Object.prototype.hasOwnProperty,P2=Object.prototype.propertyIsEnumerable,Is=(e,r,t)=>r in e?I2(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ts=(e,r)=>{for(var t in r||(r={}))B2.call(r,t)&&Is(e,t,r[t]);if(xs)for(var t of xs(r))P2.call(r,t)&&Is(e,t,r[t]);return e},Os=(e,r)=>T2(e,O2(r));function R2(e,r){return Os(Ts({},Gn(r,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(e,10),shopify_variant_id:r.external_variant_id.ecommerce?parseInt(r.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${r.charge_interval_frequency}`,order_interval_frequency:`${r.order_interval_frequency}`,status:r.status?r.status.toUpperCase():void 0})}function F2(e,r){var t;return Os(Ts({},Gn(r,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=r.external_variant_id)!=null&&t.ecommerce?parseInt(r.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:r.charge_interval_frequency?`${r.charge_interval_frequency}`:void 0,order_interval_frequency:r.order_interval_frequency?`${r.order_interval_frequency}`:void 0,force_update:e})}function Bs(e){const{id:r,address_id:t,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:c,cancelled_at:p,charge_interval_frequency:h,created_at:v,expire_after_specific_number_of_charges:_,shopify_product_id:w,shopify_variant_id:b,has_queued_charges:d,is_prepaid:E,is_skippable:x,is_swappable:I,max_retries_reached:S,next_charge_scheduled_at:T,order_day_of_month:P,order_day_of_week:B,order_interval_frequency:D,order_interval_unit:j,presentment_currency:q,price:z,product_title:X,properties:V,quantity:ae,sku:ue,sku_override:k,status:re,updated_at:N,variant_title:ce}=e;return{id:r,address_id:t,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:c,cancelled_at:p,charge_interval_frequency:parseInt(h,10),created_at:v,expire_after_specific_number_of_charges:_,external_product_id:{ecommerce:`${w}`},external_variant_id:{ecommerce:`${b}`},has_queued_charges:Ra(d),is_prepaid:E,is_skippable:x,is_swappable:I,max_retries_reached:Ra(S),next_charge_scheduled_at:T,order_day_of_month:P,order_day_of_week:B,order_interval_frequency:parseInt(D,10),order_interval_unit:j,presentment_currency:q,price:`${z}`,product_title:X??"",properties:V,quantity:ae,sku:ue,sku_override:k,status:re.toLowerCase(),updated_at:N,variant_title:ce}}async function C2(e,r,t){const{subscription:n}=await O("get","/subscriptions",{id:r,query:{include:t?.include}},e);return n}function U2(e,r){return O("get","/subscriptions",{query:r},e)}async function D2(e,r,t){const{subscription:n}=await O("post","/subscriptions",{data:r,query:t},e);return n}async function N2(e,r,t,n){const{subscription:a}=await O("put","/subscriptions",{id:r,data:t,query:n},e);return a}async function M2(e,r,t,n){const{subscription:a}=await O("post",`/subscriptions/${r}/set_next_charge_date`,{data:{date:t},query:n},e);return a}async function L2(e,r,t){const{subscription:n}=await O("post",`/subscriptions/${r}/change_address`,{data:{address_id:t}},e);return n}async function j2(e,r,t,n){const{subscription:a}=await O("post",`/subscriptions/${r}/cancel`,{data:t,query:n},e);return a}async function k2(e,r,t){const{subscription:n}=await O("post",`/subscriptions/${r}/activate`,{query:t},e);return n}async function G2(e,r,t){const{charge:n}=await O("post",`/subscriptions/${r}/charges/skip`,{data:{date:t,subscription_id:`${r}`}},e);return n}async function W2(e,r){const t=r.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=e;if(!n)throw new Error("No customerId in session.");const a=r[0].address_id;if(!r.every(h=>h.address_id===a))throw new Error("All subscriptions must have the same address_id.");const s=Ss(R2,n),c=r.map(s),{subscriptions:p}=await O("post",`/addresses/${a}/subscriptions-bulk`,{data:{subscriptions:c},headers:{"X-Recharge-Version":"2021-01"}},e);return p.map(Bs)}async function q2(e,r,t,n){const a=t.length;if(a<1||a>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:s}=e;if(!s)throw new Error("No customerId in session.");const c=Ss(F2,!!(n!=null&&n.force_update)),p=t.map(c),{subscriptions:h}=await O("put",`/addresses/${r}/subscriptions-bulk`,{data:{subscriptions:p},headers:{"X-Recharge-Version":"2021-01"}},e);return h.map(Bs)}var z2=Object.freeze({__proto__:null,getSubscription:C2,listSubscriptions:U2,createSubscription:D2,updateSubscription:N2,updateSubscriptionChargeDate:M2,updateSubscriptionAddress:L2,cancelSubscription:j2,activateSubscription:k2,skipSubscriptionCharge:G2,createSubscriptions:W2,updateSubscriptions:q2});async function V2(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("get","/customers",{id:t,query:{include:r?.include}},e);return n}async function H2(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("put","/customers",{id:t,data:r},e);return n}async function Y2(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await O("get",`/customers/${t}/delivery_schedule`,{query:r},e);return n}async function K2(e){return await O("get","/portal_access",{},e)}var X2=Object.freeze({__proto__:null,getCustomer:V2,updateCustomer:H2,getDeliverySchedule:Y2,getCustomerPortalAccess:K2});const J2={get(e,r){return he("get",e,r)},post(e,r){return he("post",e,r)},put(e,r){return he("put",e,r)},delete(e,r){return he("delete",e,r)}};function Q2(e){var r,t;if(e)return e;if((r=window?.Shopify)!=null&&r.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const a=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");a&&(n=`${a}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function Z2(e={}){const r=e,{storefrontAccessToken:t}=e;if(t&&!t.startsWith("strfnt"))throw new Error("Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.");kf({storeIdentifier:Q2(e.storeIdentifier),loginRetryFn:e.loginRetryFn,storefrontAccessToken:t,environment:r.environment?r.environment:"prod"}),Wa()}const Ps={init:Z2,api:J2,address:al,auth:gl,bundle:d1,charge:$1,cdn:t1,customer:X2,membership:T1,membershipProgram:P1,metafield:U1,onetime:k1,order:q1,paymentMethod:Y1,plan:J1,subscription:z2};try{Ps.init()}catch{}return Ps});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rechargeapps/storefront-client",
|
|
3
3
|
"description": "Storefront client for Recharge",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"author": "Recharge Inc.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"/dist"
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
|
-
"dev": "concurrently '
|
|
17
|
+
"dev": "concurrently 'pnpm dev:rollup' 'pnpm serve'",
|
|
18
18
|
"dev:rollup": "NODE_ENV=development rollup -c rollup.config.js --watch",
|
|
19
19
|
"build": "rm -rf dist && NODE_ENV=production rollup -c rollup.config.js",
|
|
20
|
-
"serve": "
|
|
20
|
+
"serve": "http-server ./dist",
|
|
21
21
|
"test": "vitest run --coverage",
|
|
22
|
-
"test:e2e": "
|
|
22
|
+
"test:e2e": "start-server-and-test 'pnpm serve' http://localhost:8080 'pnpm cypress run --browser=chrome'",
|
|
23
23
|
"test:watch": "vitest",
|
|
24
|
-
"deploy": "
|
|
24
|
+
"deploy": "pnpm deploy:cdn && pnpm deploy:npm",
|
|
25
25
|
"deploy:cdn": "rc-scripts cdn deploy",
|
|
26
26
|
"deploy:npm": "rc-scripts deploy-npm --package @rechargeapps/storefront-client",
|
|
27
27
|
"lint": "eslint '*/**/*.{js,ts}'",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"isomorphic-fetch": "3.0.0",
|
|
33
|
-
"js-xdr": "
|
|
33
|
+
"js-xdr": "2.0.0",
|
|
34
34
|
"lodash": "4.17.21",
|
|
35
35
|
"nanoid": "3.3.4",
|
|
36
36
|
"qs": "6.11.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@recharge-packages/eslint-config": "
|
|
40
|
-
"@recharge-packages/prettier-config": "
|
|
41
|
-
"@recharge-packages/scripts": "
|
|
42
|
-
"@recharge-packages/tsconfig": "
|
|
39
|
+
"@recharge-packages/eslint-config": "2.2.2",
|
|
40
|
+
"@recharge-packages/prettier-config": "1.2.0",
|
|
41
|
+
"@recharge-packages/scripts": "workspace:*",
|
|
42
|
+
"@recharge-packages/tsconfig": "workspace:*",
|
|
43
43
|
"@rollup/plugin-commonjs": "22.0.1",
|
|
44
44
|
"@rollup/plugin-node-resolve": "13.3.0",
|
|
45
45
|
"@types/lodash": "4.14.182",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"cypress": "11.1.0",
|
|
50
50
|
"esbuild": "0.14.49",
|
|
51
51
|
"http-server": "14.1.1",
|
|
52
|
+
"jsdom": "22.0.0",
|
|
52
53
|
"rollup": "2.75.7",
|
|
53
54
|
"rollup-plugin-banner": "0.2.1",
|
|
54
55
|
"rollup-plugin-dts": "4.2.2",
|