@rechargeapps/storefront-client 1.11.0 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/api/gift.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gift.js","sources":["../../../src/api/gift.ts"],"sourcesContent":["import { GiftPurchase, GiftPurchasesParams, GiftPurchasesResponse } from '../types/gift';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\
|
|
1
|
+
{"version":3,"file":"gift.js","sources":["../../../src/api/gift.ts"],"sourcesContent":["import { GiftPurchase, GiftPurchasesParams, GiftPurchasesResponse } from '../types/gift';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\nexport function listGiftPurchases(session: Session, options?: GiftPurchasesParams): Promise<GiftPurchasesResponse> {\n if (!session.customerId) {\n throw new Error('Not logged in.');\n }\n return rechargeApiRequest<GiftPurchasesResponse>(\n 'get',\n `/gift_purchases`,\n {\n query: options,\n },\n session\n );\n}\n\nexport async function getGiftPurchase(session: Session, id: number): Promise<GiftPurchase> {\n if (!session.customerId) {\n throw new Error('Not logged in.');\n }\n const { gift_purchase } = await rechargeApiRequest<{ gift_purchase: GiftPurchase }>(\n 'get',\n `/gift_purchases`,\n {\n id,\n },\n session\n );\n return gift_purchase;\n}\n"],"names":["rechargeApiRequest"],"mappings":";;;;;;AACO,SAAS,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE;AACpD,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;AAC3B,IAAI,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACtC,GAAG;AACH,EAAE,OAAOA,0BAAkB;AAC3B,IAAI,KAAK;AACT,IAAI,CAAC,eAAe,CAAC;AACrB,IAAI;AACJ,MAAM,KAAK,EAAE,OAAO;AACpB,KAAK;AACL,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,CAAC;AACM,eAAe,eAAe,CAAC,OAAO,EAAE,EAAE,EAAE;AACnD,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;AAC3B,IAAI,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACtC,GAAG;AACH,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAMA,0BAAkB;AACpD,IAAI,KAAK;AACT,IAAI,CAAC,eAAe,CAAC;AACrB,IAAI;AACJ,MAAM,EAAE;AACR,KAAK;AACL,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,EAAE,OAAO,aAAa,CAAC;AACvB;;;;;"}
|
package/dist/esm/api/gift.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gift.js","sources":["../../../src/api/gift.ts"],"sourcesContent":["import { GiftPurchase, GiftPurchasesParams, GiftPurchasesResponse } from '../types/gift';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\
|
|
1
|
+
{"version":3,"file":"gift.js","sources":["../../../src/api/gift.ts"],"sourcesContent":["import { GiftPurchase, GiftPurchasesParams, GiftPurchasesResponse } from '../types/gift';\nimport { Session } from '../types/session';\nimport { rechargeApiRequest } from '../utils/request';\n\nexport function listGiftPurchases(session: Session, options?: GiftPurchasesParams): Promise<GiftPurchasesResponse> {\n if (!session.customerId) {\n throw new Error('Not logged in.');\n }\n return rechargeApiRequest<GiftPurchasesResponse>(\n 'get',\n `/gift_purchases`,\n {\n query: options,\n },\n session\n );\n}\n\nexport async function getGiftPurchase(session: Session, id: number): Promise<GiftPurchase> {\n if (!session.customerId) {\n throw new Error('Not logged in.');\n }\n const { gift_purchase } = await rechargeApiRequest<{ gift_purchase: GiftPurchase }>(\n 'get',\n `/gift_purchases`,\n {\n id,\n },\n session\n );\n return gift_purchase;\n}\n"],"names":[],"mappings":";;AACO,SAAS,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE;AACpD,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;AAC3B,IAAI,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACtC,GAAG;AACH,EAAE,OAAO,kBAAkB;AAC3B,IAAI,KAAK;AACT,IAAI,CAAC,eAAe,CAAC;AACrB,IAAI;AACJ,MAAM,KAAK,EAAE,OAAO;AACpB,KAAK;AACL,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,CAAC;AACM,eAAe,eAAe,CAAC,OAAO,EAAE,EAAE,EAAE;AACnD,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;AAC3B,IAAI,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;AACtC,GAAG;AACH,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,kBAAkB;AACpD,IAAI,KAAK;AACT,IAAI,CAAC,eAAe,CAAC;AACrB,IAAI;AACJ,MAAM,EAAE;AACR,KAAK;AACL,IAAI,OAAO;AACX,GAAG,CAAC;AACJ,EAAE,OAAO,aAAa,CAAC;AACvB;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -690,6 +690,11 @@ interface SubscriptionListParams extends ListParams<SubscriptionSortBy> {
|
|
|
690
690
|
type SubscriptionRequiredCreateProps = 'address_id' | 'charge_interval_frequency' | 'external_variant_id' | 'next_charge_scheduled_at' | 'order_interval_frequency' | 'order_interval_unit' | 'quantity';
|
|
691
691
|
type SubscriptionOptionalCreateProps = 'expire_after_specific_number_of_charges' | 'order_day_of_month' | 'order_day_of_week' | 'external_product_id' | 'properties' | 'status';
|
|
692
692
|
interface CreateSubscriptionRequest extends SubType<Subscription, SubscriptionRequiredCreateProps, SubscriptionOptionalCreateProps> {
|
|
693
|
+
/**
|
|
694
|
+
* When creating a subscription using a gift, pass the `credit_account_id` that is associated with that gift.
|
|
695
|
+
* This will create the subscription using the credit account associated with the gift.
|
|
696
|
+
*/
|
|
697
|
+
gift_id?: number;
|
|
693
698
|
}
|
|
694
699
|
interface UpdateSubscriptionRequest extends Partial<Pick<Subscription, 'charge_interval_frequency' | 'expire_after_specific_number_of_charges' | 'external_variant_id' | 'order_day_of_month' | 'order_day_of_week' | 'order_interval_frequency' | 'order_interval_unit' | 'properties' | 'quantity'>> {
|
|
695
700
|
}
|
|
@@ -1213,6 +1218,8 @@ interface CreateAddressRequest {
|
|
|
1213
1218
|
}[] | null;
|
|
1214
1219
|
/** The zip or postal code associated with the address. */
|
|
1215
1220
|
zip: string;
|
|
1221
|
+
/** Set to true when this address is being used for redeeming gifts. */
|
|
1222
|
+
is_gift?: boolean;
|
|
1216
1223
|
}
|
|
1217
1224
|
interface CreateRecipientAddress extends Omit<CreateAddressRequest, 'customer_id' | 'discounts' | 'order_attributes' | 'order_notes' | 'payment_method_id' | 'presentment_currency' | 'shipping_lines_override'> {
|
|
1218
1225
|
email: string;
|
|
@@ -1299,6 +1306,8 @@ interface Address {
|
|
|
1299
1306
|
created_at: IsoDateString;
|
|
1300
1307
|
/** The date and time when the address was last updated. */
|
|
1301
1308
|
updated_at: IsoDateString;
|
|
1309
|
+
/** This address is set as a gift address and should only be used for gift redemptions. */
|
|
1310
|
+
is_gift: boolean;
|
|
1302
1311
|
/** Additional information as requested */
|
|
1303
1312
|
include?: {
|
|
1304
1313
|
customer?: Customer;
|
|
@@ -2017,7 +2026,7 @@ interface CDNBundleSettings extends Omit<BundleProduct, 'created_at' | 'custom_p
|
|
|
2017
2026
|
variants: CDNBundleVariant[];
|
|
2018
2027
|
}
|
|
2019
2028
|
|
|
2020
|
-
/**
|
|
2029
|
+
/** A gift given to a customer. */
|
|
2021
2030
|
interface GiftPurchase {
|
|
2022
2031
|
/** Unique numeric identifier for the Gift. */
|
|
2023
2032
|
id: number;
|
|
@@ -2027,10 +2036,13 @@ interface GiftPurchase {
|
|
|
2027
2036
|
recipient_customer_id: number;
|
|
2028
2037
|
/** Gift sender unique Recharge customer id */
|
|
2029
2038
|
sender_customer_id: number;
|
|
2039
|
+
/**
|
|
2040
|
+
* The name the sender specified as who the gift is from.
|
|
2041
|
+
* This will be the checkout customers name if not provided on checkout.
|
|
2042
|
+
*/
|
|
2043
|
+
sender_name: string;
|
|
2030
2044
|
/** The amount for the gift. */
|
|
2031
2045
|
amount: string;
|
|
2032
|
-
/** ISO date for when the gift was created. */
|
|
2033
|
-
created_at: IsoDateString;
|
|
2034
2046
|
/** Store platform product id for the gift product */
|
|
2035
2047
|
external_gift_product_id: ExternalId;
|
|
2036
2048
|
/** Store platform product variant id for the gift product */
|
|
@@ -2039,6 +2051,8 @@ interface GiftPurchase {
|
|
|
2039
2051
|
external_order_id: ExternalId;
|
|
2040
2052
|
/** List of platform product ids that that can be used when redeeming the gift. */
|
|
2041
2053
|
external_redeemable_product_ids: ExternalId[];
|
|
2054
|
+
/** The currency the gift is in. */
|
|
2055
|
+
gift_currency: string;
|
|
2042
2056
|
/** Note attached to the gift by the sender. */
|
|
2043
2057
|
gift_note: string;
|
|
2044
2058
|
/** An ISO date for when the gift was redeemed */
|
|
@@ -2048,14 +2062,20 @@ interface GiftPurchase {
|
|
|
2048
2062
|
* This link includes an authenticated customer token. Login will be required if the token expires.
|
|
2049
2063
|
*/
|
|
2050
2064
|
redemption_link: string;
|
|
2065
|
+
/** When the notification about the gift will be sent to the recipient. */
|
|
2066
|
+
notification_scheduled_at: IsoDateString;
|
|
2067
|
+
/** When the notification about the gift was sent to the recipient. */
|
|
2068
|
+
notification_sent_at?: IsoDateString;
|
|
2069
|
+
/** ISO date for when the gift was updated */
|
|
2070
|
+
updated_at: IsoDateString;
|
|
2071
|
+
/** ISO date for when the gift was created. */
|
|
2072
|
+
created_at: IsoDateString;
|
|
2051
2073
|
}
|
|
2052
|
-
/** @internal */
|
|
2053
2074
|
interface GiftPurchasesResponse {
|
|
2054
2075
|
next_cursor: null | string;
|
|
2055
2076
|
previous_cursor: null | string;
|
|
2056
2077
|
gift_purchases: GiftPurchase[];
|
|
2057
2078
|
}
|
|
2058
|
-
/** @internal */
|
|
2059
2079
|
interface GiftPurchasesParams {
|
|
2060
2080
|
/** Credit account to filter the gift on. This is unique for each gift. */
|
|
2061
2081
|
credit_account_id?: number;
|
|
@@ -2388,9 +2408,7 @@ declare function updateBundleSelection(session: Session, id: string | number, up
|
|
|
2388
2408
|
declare function deleteBundleSelection(session: Session, id: string | number): Promise<void>;
|
|
2389
2409
|
declare function updateBundle(session: Session, purchase_item_id: string | number, updateRequest: UpdateBundlePurchaseItem, query?: BundlePurchaseItemParams): Promise<BundlePurchaseItem>;
|
|
2390
2410
|
|
|
2391
|
-
/** @internal */
|
|
2392
2411
|
declare function listGiftPurchases(session: Session, options?: GiftPurchasesParams): Promise<GiftPurchasesResponse>;
|
|
2393
|
-
/** @internal */
|
|
2394
2412
|
declare function getGiftPurchase(session: Session, id: number): Promise<GiftPurchase>;
|
|
2395
2413
|
|
|
2396
2414
|
/** @internal Retrieves membership information for passed in id */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// recharge-client-1.11.
|
|
1
|
+
// recharge-client-1.11.2.min.js | MIT License | © Recharge Inc.
|
|
2
2
|
(function(oe,pt){typeof exports=="object"&&typeof module<"u"?module.exports=pt():typeof define=="function"&&define.amd?define(pt):(oe=typeof globalThis<"u"?globalThis:oe||self,oe.recharge=pt())})(this,function(){"use strict";var oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pt(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var K=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof K<"u"&&K,te={searchParams:"URLSearchParams"in K,iterable:"Symbol"in K&&"iterator"in Symbol,blob:"FileReader"in K&&"Blob"in K&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in K,arrayBuffer:"ArrayBuffer"in K};function Wo(t){return t&&DataView.prototype.isPrototypeOf(t)}if(te.arrayBuffer)var Ho=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Yo=ArrayBuffer.isView||function(t){return t&&Ho.indexOf(Object.prototype.toString.call(t))>-1};function ht(t){if(typeof t!="string"&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||t==="")throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function mr(t){return typeof t!="string"&&(t=String(t)),t}function wr(t){var e={next:function(){var r=t.shift();return{done:r===void 0,value:r}}};return te.iterable&&(e[Symbol.iterator]=function(){return e}),e}function j(t){this.map={},t instanceof j?t.forEach(function(e,r){this.append(r,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}j.prototype.append=function(t,e){t=ht(t),e=mr(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},j.prototype.delete=function(t){delete this.map[ht(t)]},j.prototype.get=function(t){return t=ht(t),this.has(t)?this.map[t]:null},j.prototype.has=function(t){return this.map.hasOwnProperty(ht(t))},j.prototype.set=function(t,e){this.map[ht(t)]=mr(e)},j.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},j.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),wr(t)},j.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),wr(t)},j.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),wr(t)},te.iterable&&(j.prototype[Symbol.iterator]=j.prototype.entries);function vr(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function An(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function Xo(t){var e=new FileReader,r=An(e);return e.readAsArrayBuffer(t),r}function Jo(t){var e=new FileReader,r=An(e);return e.readAsText(t),r}function Ko(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function xn(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Sn(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?typeof t=="string"?this._bodyText=t:te.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:te.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:te.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():te.arrayBuffer&&te.blob&&Wo(t)?(this._bodyArrayBuffer=xn(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):te.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||Yo(t))?this._bodyArrayBuffer=xn(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||(typeof t=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):te.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},te.blob&&(this.blob=function(){var t=vr(this);if(t)return t;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 t=vr(this);return t||(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(Xo)}),this.text=function(){var t=vr(this);if(t)return t;if(this._bodyBlob)return Jo(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ko(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},te.formData&&(this.formData=function(){return this.text().then(ea)}),this.json=function(){return this.text().then(JSON.parse)},this}var Qo=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Zo(t){var e=t.toUpperCase();return Qo.indexOf(e)>-1?e:t}function Ue(t,e){if(!(this instanceof Ue))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var r=e.body;if(t instanceof Ue){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new j(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!r&&t._bodyInit!=null&&(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new j(e.headers)),this.method=Zo(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.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()}}}Ue.prototype.clone=function(){return new Ue(this,{body:this._bodyInit})};function ea(t){var e=new FormData;return t.trim().split("&").forEach(function(r){if(r){var n=r.split("="),a=n.shift().replace(/\+/g," "),s=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(a),decodeURIComponent(s))}}),e}function ta(t){var e=new j,r=t.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
|
|
3
3
|
`)===0?n.substr(1,n.length):n}).forEach(function(n){var a=n.split(":"),s=a.shift().trim();if(s){var f=a.join(":").trim();e.append(s,f)}}),e}Sn.call(Ue.prototype);function pe(t,e){if(!(this instanceof pe))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 j(e.headers),this.url=e.url||"",this._initBody(t)}Sn.call(pe.prototype),pe.prototype.clone=function(){return new pe(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new j(this.headers),url:this.url})},pe.error=function(){var t=new pe(null,{status:0,statusText:""});return t.type="error",t};var ra=[301,302,303,307,308];pe.redirect=function(t,e){if(ra.indexOf(e)===-1)throw new RangeError("Invalid status code");return new pe(null,{status:e,headers:{location:t}})};var Ce=K.DOMException;try{new Ce}catch{Ce=function(e,r){this.message=e,this.name=r;var n=Error(e);this.stack=n.stack},Ce.prototype=Object.create(Error.prototype),Ce.prototype.constructor=Ce}function In(t,e){return new Promise(function(r,n){var a=new Ue(t,e);if(a.signal&&a.signal.aborted)return n(new Ce("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var h={status:s.status,statusText:s.statusText,headers:ta(s.getAllResponseHeaders()||"")};h.url="responseURL"in s?s.responseURL:h.headers.get("X-Request-URL");var m="response"in s?s.response:s.responseText;setTimeout(function(){r(new pe(m,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 Ce("Aborted","AbortError"))},0)};function p(h){try{return h===""&&K.location.href?K.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&&(te.blob?s.responseType="blob":te.arrayBuffer&&a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(s.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof j)?Object.getOwnPropertyNames(e.headers).forEach(function(h){s.setRequestHeader(h,mr(e.headers[h]))}):a.headers.forEach(function(h,m){s.setRequestHeader(m,h)}),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){s.readyState===4&&a.signal.removeEventListener("abort",f)}),s.send(typeof a._bodyInit>"u"?null:a._bodyInit)})}In.polyfill=!0,K.fetch||(K.fetch=In,K.Headers=j,K.Request=Ue,K.Response=pe),self.fetch.bind(self);var na=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[r]=a;for(r 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 s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(e,r);if(f.value!==a||f.enumerable!==!0)return!1}return!0},Bn=typeof Symbol<"u"&&Symbol,ia=na,oa=function(){return typeof Bn!="function"||typeof Symbol!="function"||typeof Bn("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ia()},On={foo:{}},aa=Object,sa=function(){return{__proto__:On}.foo===On.foo&&!({__proto__:null}instanceof aa)},ua="Function.prototype.bind called on incompatible ",_r=Array.prototype.slice,ca=Object.prototype.toString,fa="[object Function]",la=function(e){var r=this;if(typeof r!="function"||ca.call(r)!==fa)throw new TypeError(ua+r);for(var n=_r.call(arguments,1),a,s=function(){if(this instanceof a){var v=r.apply(this,n.concat(_r.call(arguments)));return Object(v)===v?v:this}else return r.apply(e,n.concat(_r.call(arguments)))},f=Math.max(0,r.length-n.length),p=[],h=0;h<f;h++)p.push("$"+h);if(a=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var m=function(){};m.prototype=r.prototype,a.prototype=new m,m.prototype=null}return a},pa=la,br=Function.prototype.bind||pa,ha=br,da=ha.call(Function.call,Object.prototype.hasOwnProperty),C,He=SyntaxError,$n=Function,Ye=TypeError,Er=function(t){try{return $n('"use strict"; return ('+t+").constructor;")()}catch{}},De=Object.getOwnPropertyDescriptor;if(De)try{De({},"")}catch{De=null}var Ar=function(){throw new Ye},ya=De?function(){try{return arguments.callee,Ar}catch{try{return De(arguments,"callee").get}catch{return Ar}}}():Ar,Xe=oa(),ga=sa(),W=Object.getPrototypeOf||(ga?function(t){return t.__proto__}:null),Je={},ma=typeof Uint8Array>"u"||!W?C:W(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?C:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?C:ArrayBuffer,"%ArrayIteratorPrototype%":Xe&&W?W([][Symbol.iterator]()):C,"%AsyncFromSyncIteratorPrototype%":C,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics>"u"?C:Atomics,"%BigInt%":typeof BigInt>"u"?C:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?C:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?C:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?C:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?C:Float32Array,"%Float64Array%":typeof Float64Array>"u"?C:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?C:FinalizationRegistry,"%Function%":$n,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?C:Int8Array,"%Int16Array%":typeof Int16Array>"u"?C:Int16Array,"%Int32Array%":typeof Int32Array>"u"?C:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xe&&W?W(W([][Symbol.iterator]())):C,"%JSON%":typeof JSON=="object"?JSON:C,"%Map%":typeof Map>"u"?C:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Xe||!W?C:W(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?C:Promise,"%Proxy%":typeof Proxy>"u"?C:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?C:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?C:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Xe||!W?C:W(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?C:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xe&&W?W(""[Symbol.iterator]()):C,"%Symbol%":Xe?Symbol:C,"%SyntaxError%":He,"%ThrowTypeError%":ya,"%TypedArray%":ma,"%TypeError%":Ye,"%Uint8Array%":typeof Uint8Array>"u"?C:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?C:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?C:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?C:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?C:WeakMap,"%WeakRef%":typeof WeakRef>"u"?C:WeakRef,"%WeakSet%":typeof WeakSet>"u"?C:WeakSet};if(W)try{null.error}catch(t){var wa=W(W(t));Ne["%Error.prototype%"]=wa}var va=function t(e){var r;if(e==="%AsyncFunction%")r=Er("async function () {}");else if(e==="%GeneratorFunction%")r=Er("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Er("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=t("%AsyncGenerator%");a&&W&&(r=W(a.prototype))}return Ne[e]=r,r},Tn={"%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"]},dt=br,Dt=da,_a=dt.call(Function.call,Array.prototype.concat),ba=dt.call(Function.apply,Array.prototype.splice),Rn=dt.call(Function.call,String.prototype.replace),Nt=dt.call(Function.call,String.prototype.slice),Ea=dt.call(Function.call,RegExp.prototype.exec),Aa=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,xa=/\\(\\)?/g,Sa=function(e){var r=Nt(e,0,1),n=Nt(e,-1);if(r==="%"&&n!=="%")throw new He("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new He("invalid intrinsic syntax, expected opening `%`");var a=[];return Rn(e,Aa,function(s,f,p,h){a[a.length]=p?Rn(h,xa,"$1"):f||s}),a},Ia=function(e,r){var n=e,a;if(Dt(Tn,n)&&(a=Tn[n],n="%"+a[0]+"%"),Dt(Ne,n)){var s=Ne[n];if(s===Je&&(s=va(n)),typeof s>"u"&&!r)throw new Ye("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new He("intrinsic "+e+" does not exist!")},xr=function(e,r){if(typeof e!="string"||e.length===0)throw new Ye("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ye('"allowMissing" argument must be a boolean');if(Ea(/^%?[^%]*%?$/,e)===null)throw new He("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Sa(e),a=n.length>0?n[0]:"",s=Ia("%"+a+"%",r),f=s.name,p=s.value,h=!1,m=s.alias;m&&(a=m[0],ba(n,_a([0,1],m)));for(var v=1,_=!0;v<n.length;v+=1){var b=n[v],y=Nt(b,0,1),x=Nt(b,-1);if((y==='"'||y==="'"||y==="`"||x==='"'||x==="'"||x==="`")&&y!==x)throw new He("property names with quotes must have matching quotes");if((b==="constructor"||!_)&&(h=!0),a+="."+b,f="%"+a+"%",Dt(Ne,f))p=Ne[f];else if(p!=null){if(!(b in p)){if(!r)throw new Ye("base intrinsic for "+e+" exists, but the property is not available.");return}if(De&&v+1>=n.length){var I=De(p,b);_=!!I,_&&"get"in I&&!("originalValue"in I.get)?p=I.get:p=p[b]}else _=Dt(p,b),p=p[b];_&&!h&&(Ne[f]=p)}}return p},Pn={exports:{}};(function(t){var e=br,r=xr,n=r("%Function.prototype.apply%"),a=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(a,n),f=r("%Object.getOwnPropertyDescriptor%",!0),p=r("%Object.defineProperty%",!0),h=r("%Math.max%");if(p)try{p({},"a",{value:1})}catch{p=null}t.exports=function(_){var b=s(e,a,arguments);if(f&&p){var y=f(b,"length");y.configurable&&p(b,"length",{value:1+h(0,_.length-(arguments.length-1))})}return b};var m=function(){return s(e,n,arguments)};p?p(t.exports,"apply",{value:m}):t.exports.apply=m})(Pn);var Fn=xr,Un=Pn.exports,Ba=Un(Fn("String.prototype.indexOf")),Oa=function(e,r){var n=Fn(e,!!r);return typeof n=="function"&&Ba(e,".prototype.")>-1?Un(n):n},Ke=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},he=[],ue=[],$a=typeof Uint8Array<"u"?Uint8Array:Array,Sr=!1;function Cn(){Sr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)he[e]=t[e],ue[t.charCodeAt(e)]=e;ue["-".charCodeAt(0)]=62,ue["_".charCodeAt(0)]=63}function Ta(t){Sr||Cn();var e,r,n,a,s,f,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=t[p-2]==="="?2:t[p-1]==="="?1:0,f=new $a(p*3/4-s),n=s>0?p-4:p;var h=0;for(e=0,r=0;e<n;e+=4,r+=3)a=ue[t.charCodeAt(e)]<<18|ue[t.charCodeAt(e+1)]<<12|ue[t.charCodeAt(e+2)]<<6|ue[t.charCodeAt(e+3)],f[h++]=a>>16&255,f[h++]=a>>8&255,f[h++]=a&255;return s===2?(a=ue[t.charCodeAt(e)]<<2|ue[t.charCodeAt(e+1)]>>4,f[h++]=a&255):s===1&&(a=ue[t.charCodeAt(e)]<<10|ue[t.charCodeAt(e+1)]<<4|ue[t.charCodeAt(e+2)]>>2,f[h++]=a>>8&255,f[h++]=a&255),f}function Ra(t){return he[t>>18&63]+he[t>>12&63]+he[t>>6&63]+he[t&63]}function Pa(t,e,r){for(var n,a=[],s=e;s<r;s+=3)n=(t[s]<<16)+(t[s+1]<<8)+t[s+2],a.push(Ra(n));return a.join("")}function Dn(t){Sr||Cn();for(var e,r=t.length,n=r%3,a="",s=[],f=16383,p=0,h=r-n;p<h;p+=f)s.push(Pa(t,p,p+f>h?h:p+f));return n===1?(e=t[r-1],a+=he[e>>2],a+=he[e<<4&63],a+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],a+=he[e>>10],a+=he[e>>4&63],a+=he[e<<2&63],a+="="),s.push(a),s.join("")}function Mt(t,e,r,n,a){var s,f,p=a*8-n-1,h=(1<<p)-1,m=h>>1,v=-7,_=r?a-1:0,b=r?-1:1,y=t[e+_];for(_+=b,s=y&(1<<-v)-1,y>>=-v,v+=p;v>0;s=s*256+t[e+_],_+=b,v-=8);for(f=s&(1<<-v)-1,s>>=-v,v+=n;v>0;f=f*256+t[e+_],_+=b,v-=8);if(s===0)s=1-m;else{if(s===h)return f?NaN:(y?-1:1)*(1/0);f=f+Math.pow(2,n),s=s-m}return(y?-1:1)*f*Math.pow(2,s-n)}function Nn(t,e,r,n,a,s){var f,p,h,m=s*8-a-1,v=(1<<m)-1,_=v>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:s-1,x=n?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,f=v):(f=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-f))<1&&(f--,h*=2),f+_>=1?e+=b/h:e+=b*Math.pow(2,1-_),e*h>=2&&(f++,h/=2),f+_>=v?(p=0,f=v):f+_>=1?(p=(e*h-1)*Math.pow(2,a),f=f+_):(p=e*Math.pow(2,_-1)*Math.pow(2,a),f=0));a>=8;t[r+y]=p&255,y+=x,p/=256,a-=8);for(f=f<<a|p,m+=a;m>0;t[r+y]=f&255,y+=x,f/=256,m-=8);t[r+y-x]|=I*128}var Fa={}.toString,Mn=Array.isArray||function(t){return Fa.call(t)=="[object Array]"};/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|