bitsnap-react 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BitsnapCart-V4S4EXYV.js +2 -0
- package/dist/BitsnapCart-V4S4EXYV.js.map +1 -0
- package/dist/BitsnapCart-Z6JFYNH2.mjs +2 -0
- package/dist/CartProvider-5NP4WACK.js +2 -0
- package/dist/CartProvider-5NP4WACK.js.map +1 -0
- package/dist/CartProvider-G7FQUPXL.mjs +2 -0
- package/dist/PanelModelFiles-EKQRLF46.js.map +1 -1
- package/dist/analytics.js +1 -1
- package/dist/analytics.js.map +1 -1
- package/dist/analytics.mjs +1 -1
- package/dist/catalog.js +1 -1
- package/dist/catalog.js.map +1 -1
- package/dist/catalog.mjs +1 -1
- package/dist/chat.d.mts +10 -9
- package/dist/chat.d.ts +10 -9
- package/dist/chat.js +1 -1
- package/dist/chat.js.map +1 -1
- package/dist/chat.mjs +1 -1
- package/dist/chat.mjs.map +1 -1
- package/dist/{chunk-WG54EHST.mjs → chunk-2G46TAUX.mjs} +2 -2
- package/dist/chunk-2G46TAUX.mjs.map +1 -0
- package/dist/{chunk-DOJICJCQ.js → chunk-4Y233NII.js} +2 -2
- package/dist/chunk-4Y233NII.js.map +1 -0
- package/dist/chunk-5M3OUOMU.mjs +5 -0
- package/dist/chunk-5M3OUOMU.mjs.map +1 -0
- package/dist/chunk-6Q3VGPSF.js.map +1 -1
- package/dist/{chunk-DDIEFKNP.mjs → chunk-A2ZDFN3J.mjs} +2 -2
- package/dist/{chunk-GJOGATP6.js → chunk-AQYHQY2Y.js} +2 -2
- package/dist/chunk-AQYHQY2Y.js.map +1 -0
- package/dist/{chunk-N523LFAM.mjs → chunk-BTERIY6N.mjs} +2 -2
- package/dist/{chunk-MWWEPEU2.js → chunk-C736F727.js} +2 -2
- package/dist/chunk-C736F727.js.map +1 -0
- package/dist/{chunk-LGPNJ5XE.js → chunk-EFN4OW2C.js} +2 -2
- package/dist/chunk-EFN4OW2C.js.map +1 -0
- package/dist/{chunk-GQ5OKU74.js → chunk-GHBRR665.js} +2 -2
- package/dist/chunk-GHBRR665.js.map +1 -0
- package/dist/chunk-HKRH6FI6.mjs +2 -0
- package/dist/chunk-HKRH6FI6.mjs.map +1 -0
- package/dist/chunk-HP3I6D2R.js +2 -0
- package/dist/chunk-HP3I6D2R.js.map +1 -0
- package/dist/{chunk-D2ASWUXM.js → chunk-IRZJIPUF.js} +2 -2
- package/dist/chunk-IRZJIPUF.js.map +1 -0
- package/dist/{chunk-5M6M7FAR.mjs → chunk-IXQCN7MR.mjs} +2 -2
- package/dist/chunk-IXX6SUMB.mjs +2 -0
- package/dist/chunk-IXX6SUMB.mjs.map +1 -0
- package/dist/chunk-JSDGZ4NY.js.map +1 -1
- package/dist/chunk-KDL35KEI.js +2 -0
- package/dist/chunk-KDL35KEI.js.map +1 -0
- package/dist/{chunk-OR566YJI.mjs → chunk-KO7ZERN5.mjs} +2 -2
- package/dist/chunk-KO7ZERN5.mjs.map +1 -0
- package/dist/chunk-KOYBZORL.js.map +1 -1
- package/dist/chunk-KZWCVKLU.js +5 -0
- package/dist/chunk-KZWCVKLU.js.map +1 -0
- package/dist/{chunk-SCEWYZUZ.mjs → chunk-LHNTSQYO.mjs} +2 -2
- package/dist/{chunk-5JRUPLXY.mjs → chunk-LHQEM3CU.mjs} +2 -2
- package/dist/chunk-MDAFPGPA.js.map +1 -1
- package/dist/chunk-Q337IQNA.js.map +1 -1
- package/dist/{chunk-YV2C276H.js → chunk-RJPQMDIQ.js} +2 -2
- package/dist/chunk-RJPQMDIQ.js.map +1 -0
- package/dist/{chunk-SSSF64M7.mjs → chunk-TW25G7XX.mjs} +2 -2
- package/dist/{chunk-SSSF64M7.mjs.map → chunk-TW25G7XX.mjs.map} +1 -1
- package/dist/{chunk-MMLBQHBM.mjs → chunk-URQBHNJK.mjs} +2 -2
- package/dist/chunk-W3RGQYPD.js.map +1 -1
- package/dist/{chunk-2FD2QP4Y.js → chunk-YPA6MMGJ.js} +2 -2
- package/dist/chunk-YPA6MMGJ.js.map +1 -0
- package/dist/chunk-Z3YOJ6NZ.js +2 -0
- package/dist/chunk-Z3YOJ6NZ.js.map +1 -0
- package/dist/consent.js.map +1 -1
- package/dist/course.d.mts +1 -1
- package/dist/course.d.ts +1 -1
- package/dist/course.js +1 -1
- package/dist/course.js.map +1 -1
- package/dist/course.mjs +1 -1
- package/dist/embed/analytics.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +37 -34
- package/dist/index.d.ts +37 -34
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal.js.map +1 -1
- package/dist/methods-33CWGKNA.mjs +2 -0
- package/dist/methods-4GB652MQ.js +2 -0
- package/dist/methods-4GB652MQ.js.map +1 -0
- package/dist/model-files-client-P4PORZJ6.js.map +1 -1
- package/dist/models.js.map +1 -1
- package/dist/returns.js +1 -1
- package/dist/returns.js.map +1 -1
- package/dist/returns.mjs +1 -1
- package/dist/{types-B-sjyZQs.d.mts → types-CjWyHunk.d.mts} +2 -0
- package/dist/{types-iRe6ix2y.d.ts → types-DfqzDP9k.d.ts} +2 -0
- package/dist/viewer3d.js.map +1 -1
- package/dist/viewer3d.mjs +2 -2
- package/dist/{widgets-BVOSj9fU.d.ts → widgets-Bsojw94g.d.ts} +10 -1
- package/dist/{widgets-BT2LN2Nq.d.mts → widgets-u7xMJbsY.d.mts} +10 -1
- package/package.json +2 -2
- package/dist/BitsnapCart-E72W5RRZ.mjs +0 -2
- package/dist/BitsnapCart-Q2HER6GU.js +0 -2
- package/dist/BitsnapCart-Q2HER6GU.js.map +0 -1
- package/dist/CartProvider-677CE2FI.js +0 -2
- package/dist/CartProvider-677CE2FI.js.map +0 -1
- package/dist/CartProvider-YPDOFSYC.mjs +0 -2
- package/dist/chunk-2FD2QP4Y.js.map +0 -1
- package/dist/chunk-AAC576BC.mjs +0 -5
- package/dist/chunk-AAC576BC.mjs.map +0 -1
- package/dist/chunk-AB37DWOK.mjs +0 -2
- package/dist/chunk-AB37DWOK.mjs.map +0 -1
- package/dist/chunk-BUYTK7KM.js +0 -2
- package/dist/chunk-BUYTK7KM.js.map +0 -1
- package/dist/chunk-D2ASWUXM.js.map +0 -1
- package/dist/chunk-DOJICJCQ.js.map +0 -1
- package/dist/chunk-GJOGATP6.js.map +0 -1
- package/dist/chunk-GQ5OKU74.js.map +0 -1
- package/dist/chunk-KHQEDQYF.js +0 -5
- package/dist/chunk-KHQEDQYF.js.map +0 -1
- package/dist/chunk-LGPNJ5XE.js.map +0 -1
- package/dist/chunk-MWWEPEU2.js.map +0 -1
- package/dist/chunk-NWXZ45TV.js +0 -2
- package/dist/chunk-NWXZ45TV.js.map +0 -1
- package/dist/chunk-OR566YJI.mjs.map +0 -1
- package/dist/chunk-WG54EHST.mjs.map +0 -1
- package/dist/chunk-YV2C276H.js.map +0 -1
- package/dist/methods-64D5DD6K.js +0 -2
- package/dist/methods-64D5DD6K.js.map +0 -1
- package/dist/methods-NQA3DFLE.mjs +0 -2
- /package/dist/{BitsnapCart-E72W5RRZ.mjs.map → BitsnapCart-Z6JFYNH2.mjs.map} +0 -0
- /package/dist/{CartProvider-YPDOFSYC.mjs.map → CartProvider-G7FQUPXL.mjs.map} +0 -0
- /package/dist/{chunk-DDIEFKNP.mjs.map → chunk-A2ZDFN3J.mjs.map} +0 -0
- /package/dist/{chunk-N523LFAM.mjs.map → chunk-BTERIY6N.mjs.map} +0 -0
- /package/dist/{chunk-5M6M7FAR.mjs.map → chunk-IXQCN7MR.mjs.map} +0 -0
- /package/dist/{chunk-SCEWYZUZ.mjs.map → chunk-LHNTSQYO.mjs.map} +0 -0
- /package/dist/{chunk-5JRUPLXY.mjs.map → chunk-LHQEM3CU.mjs.map} +0 -0
- /package/dist/{chunk-MMLBQHBM.mjs.map → chunk-URQBHNJK.mjs.map} +0 -0
- /package/dist/{methods-NQA3DFLE.mjs.map → methods-33CWGKNA.mjs.map} +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -6,10 +6,10 @@ export { BitsnapReturns, BitsnapReturnsProps, BitsnapReturnsProvider, BitsnapRet
|
|
|
6
6
|
export { b as RETURNS_SLOT_NAMES, R as ReturnsAppearance, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, e as ReturnsSlotAppearance, f as ReturnsSlotName, h as ReturnsTextKey, a as ReturnsTexts, g as ReturnsTheme } from './texts-LGhuQfA9.mjs';
|
|
7
7
|
import { CSSProperties, ReactNode } from 'react';
|
|
8
8
|
import z__default from 'zod';
|
|
9
|
-
import { P as PanelLoginProps, a as PanelProps, G as GetThemeOutput } from './types-
|
|
10
|
-
export { b as PanelScreen, c as PanelSearchParamsType } from './types-
|
|
11
|
-
import { e as ChatThreadProps, c as ChannelProps } from './widgets-
|
|
12
|
-
export { d as ChatBuyRequest, C as ChatTexts, f as ChatWidgetBaseProps } from './widgets-
|
|
9
|
+
import { P as PanelLoginProps, a as PanelProps, G as GetThemeOutput } from './types-CjWyHunk.mjs';
|
|
10
|
+
export { b as PanelScreen, c as PanelSearchParamsType } from './types-CjWyHunk.mjs';
|
|
11
|
+
import { e as ChatThreadProps, c as ChannelProps } from './widgets-u7xMJbsY.mjs';
|
|
12
|
+
export { d as ChatBuyRequest, C as ChatTexts, f as ChatWidgetBaseProps } from './widgets-u7xMJbsY.mjs';
|
|
13
13
|
import './models.mjs';
|
|
14
14
|
import '@bufbuild/protobuf/wkt';
|
|
15
15
|
import '@bufbuild/protobuf';
|
|
@@ -722,36 +722,6 @@ type Err = {
|
|
|
722
722
|
};
|
|
723
723
|
declare function Err(message: string, type?: ErrTypes, data?: unknown): Err;
|
|
724
724
|
|
|
725
|
-
/**
|
|
726
|
-
* The buyer's choice between paying online, paying the seller by hand (bank
|
|
727
|
-
* transfer or "BLIK przelew na telefon") and paying the courier on delivery,
|
|
728
|
-
* offered when the seller turned on "show at checkout" for the manual payment
|
|
729
|
-
* gateway or offers cash on delivery.
|
|
730
|
-
*
|
|
731
|
-
* `POST /public-commerce/payment-methods` takes the body of `/buy` and answers
|
|
732
|
-
* `{ success: true, choice: null }` (nothing to choose) or
|
|
733
|
-
* `{ success: true, choice: { methods, manualAccountTypes } }`. The pick goes
|
|
734
|
-
* to `/buy` as `paymentMethod`. Anything else (an old backend, an error, a
|
|
735
|
-
* timeout) counts as "nothing to choose", so the cart buys as before.
|
|
736
|
-
*/
|
|
737
|
-
|
|
738
|
-
/** `cod` is cash on delivery: the buyer pays the courier (Poland only, shipped carts). */
|
|
739
|
-
type PaymentMethod = "online" | "manual" | "cod";
|
|
740
|
-
type ManualAccountType = "bankTransfer" | "blik";
|
|
741
|
-
type PaymentMethodChoice = {
|
|
742
|
-
/** In the seller's order (cash on delivery last); the first one is selected by default. */
|
|
743
|
-
methods: PaymentMethod[];
|
|
744
|
-
/** How the manual option is paid; decides its label. */
|
|
745
|
-
manualAccountTypes: ManualAccountType[];
|
|
746
|
-
};
|
|
747
|
-
|
|
748
|
-
declare function setLocale(locale?: string): void;
|
|
749
|
-
declare function getLocale(): string;
|
|
750
|
-
|
|
751
|
-
declare function setProjectID$1(projectID: string): void;
|
|
752
|
-
|
|
753
|
-
declare function setCustomHost(host: string): void;
|
|
754
|
-
|
|
755
725
|
declare enum BillingPeriod {
|
|
756
726
|
DAILY = "daily",
|
|
757
727
|
WEEKLY = "weekly",
|
|
@@ -802,6 +772,7 @@ declare const linkRequestSchema: z__default.ZodObject<{
|
|
|
802
772
|
id: z__default.ZodString;
|
|
803
773
|
quantity: z__default.ZodNumber;
|
|
804
774
|
priceVersion: z__default.ZodOptional<z__default.ZodString>;
|
|
775
|
+
amount: z__default.ZodOptional<z__default.ZodNumber>;
|
|
805
776
|
name: z__default.ZodOptional<z__default.ZodString>;
|
|
806
777
|
description: z__default.ZodOptional<z__default.ZodString>;
|
|
807
778
|
imageURL: z__default.ZodOptional<z__default.ZodString>;
|
|
@@ -841,6 +812,36 @@ declare const linkRequestSchema: z__default.ZodObject<{
|
|
|
841
812
|
}, z__default.core.$strip>>;
|
|
842
813
|
}, z__default.core.$strip>;
|
|
843
814
|
|
|
815
|
+
/**
|
|
816
|
+
* The buyer's choice between paying online, paying the seller by hand (bank
|
|
817
|
+
* transfer or "BLIK przelew na telefon") and paying the courier on delivery,
|
|
818
|
+
* offered when the seller turned on "show at checkout" for the manual payment
|
|
819
|
+
* gateway or offers cash on delivery.
|
|
820
|
+
*
|
|
821
|
+
* `POST /public-commerce/payment-methods` takes the body of `/buy` and answers
|
|
822
|
+
* `{ success: true, choice: null }` (nothing to choose) or
|
|
823
|
+
* `{ success: true, choice: { methods, manualAccountTypes } }`. The pick goes
|
|
824
|
+
* to `/buy` as `paymentMethod`. Anything else (an old backend, an error, a
|
|
825
|
+
* timeout) counts as "nothing to choose", so the cart buys as before.
|
|
826
|
+
*/
|
|
827
|
+
|
|
828
|
+
/** `cod` is cash on delivery: the buyer pays the courier (Poland only, shipped carts). */
|
|
829
|
+
type PaymentMethod = "online" | "manual" | "cod";
|
|
830
|
+
type ManualAccountType = "bankTransfer" | "blik";
|
|
831
|
+
type PaymentMethodChoice = {
|
|
832
|
+
/** In the seller's order (cash on delivery last); the first one is selected by default. */
|
|
833
|
+
methods: PaymentMethod[];
|
|
834
|
+
/** How the manual option is paid; decides its label. */
|
|
835
|
+
manualAccountTypes: ManualAccountType[];
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
declare function setLocale(locale?: string): void;
|
|
839
|
+
declare function getLocale(): string;
|
|
840
|
+
|
|
841
|
+
declare function setProjectID$1(projectID: string): void;
|
|
842
|
+
|
|
843
|
+
declare function setCustomHost(host: string): void;
|
|
844
|
+
|
|
844
845
|
declare namespace Bitsnap {
|
|
845
846
|
/**
|
|
846
847
|
* Adds a product or variant to the cart. Returns an `Err` instead of adding
|
|
@@ -857,6 +858,8 @@ declare namespace Bitsnap {
|
|
|
857
858
|
name?: string;
|
|
858
859
|
price?: number;
|
|
859
860
|
currency?: string;
|
|
861
|
+
/** Buyer chosen pay-what-you-want amount, in minor units. */
|
|
862
|
+
amount?: number;
|
|
860
863
|
/** Where `add_to_cart` is reported. Defaults to the mounted `<BitsnapCheckout>`. */
|
|
861
864
|
analytics?: Instrument;
|
|
862
865
|
}): Promise<Err | undefined>;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export { BitsnapReturns, BitsnapReturnsProps, BitsnapReturnsProvider, BitsnapRet
|
|
|
6
6
|
export { b as RETURNS_SLOT_NAMES, R as ReturnsAppearance, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, e as ReturnsSlotAppearance, f as ReturnsSlotName, h as ReturnsTextKey, a as ReturnsTexts, g as ReturnsTheme } from './texts-m6XQGZ6w.js';
|
|
7
7
|
import { CSSProperties, ReactNode } from 'react';
|
|
8
8
|
import z__default from 'zod';
|
|
9
|
-
import { P as PanelLoginProps, a as PanelProps, G as GetThemeOutput } from './types-
|
|
10
|
-
export { b as PanelScreen, c as PanelSearchParamsType } from './types-
|
|
11
|
-
import { e as ChatThreadProps, c as ChannelProps } from './widgets-
|
|
12
|
-
export { d as ChatBuyRequest, C as ChatTexts, f as ChatWidgetBaseProps } from './widgets-
|
|
9
|
+
import { P as PanelLoginProps, a as PanelProps, G as GetThemeOutput } from './types-DfqzDP9k.js';
|
|
10
|
+
export { b as PanelScreen, c as PanelSearchParamsType } from './types-DfqzDP9k.js';
|
|
11
|
+
import { e as ChatThreadProps, c as ChannelProps } from './widgets-Bsojw94g.js';
|
|
12
|
+
export { d as ChatBuyRequest, C as ChatTexts, f as ChatWidgetBaseProps } from './widgets-Bsojw94g.js';
|
|
13
13
|
import './models.js';
|
|
14
14
|
import '@bufbuild/protobuf/wkt';
|
|
15
15
|
import '@bufbuild/protobuf';
|
|
@@ -722,36 +722,6 @@ type Err = {
|
|
|
722
722
|
};
|
|
723
723
|
declare function Err(message: string, type?: ErrTypes, data?: unknown): Err;
|
|
724
724
|
|
|
725
|
-
/**
|
|
726
|
-
* The buyer's choice between paying online, paying the seller by hand (bank
|
|
727
|
-
* transfer or "BLIK przelew na telefon") and paying the courier on delivery,
|
|
728
|
-
* offered when the seller turned on "show at checkout" for the manual payment
|
|
729
|
-
* gateway or offers cash on delivery.
|
|
730
|
-
*
|
|
731
|
-
* `POST /public-commerce/payment-methods` takes the body of `/buy` and answers
|
|
732
|
-
* `{ success: true, choice: null }` (nothing to choose) or
|
|
733
|
-
* `{ success: true, choice: { methods, manualAccountTypes } }`. The pick goes
|
|
734
|
-
* to `/buy` as `paymentMethod`. Anything else (an old backend, an error, a
|
|
735
|
-
* timeout) counts as "nothing to choose", so the cart buys as before.
|
|
736
|
-
*/
|
|
737
|
-
|
|
738
|
-
/** `cod` is cash on delivery: the buyer pays the courier (Poland only, shipped carts). */
|
|
739
|
-
type PaymentMethod = "online" | "manual" | "cod";
|
|
740
|
-
type ManualAccountType = "bankTransfer" | "blik";
|
|
741
|
-
type PaymentMethodChoice = {
|
|
742
|
-
/** In the seller's order (cash on delivery last); the first one is selected by default. */
|
|
743
|
-
methods: PaymentMethod[];
|
|
744
|
-
/** How the manual option is paid; decides its label. */
|
|
745
|
-
manualAccountTypes: ManualAccountType[];
|
|
746
|
-
};
|
|
747
|
-
|
|
748
|
-
declare function setLocale(locale?: string): void;
|
|
749
|
-
declare function getLocale(): string;
|
|
750
|
-
|
|
751
|
-
declare function setProjectID$1(projectID: string): void;
|
|
752
|
-
|
|
753
|
-
declare function setCustomHost(host: string): void;
|
|
754
|
-
|
|
755
725
|
declare enum BillingPeriod {
|
|
756
726
|
DAILY = "daily",
|
|
757
727
|
WEEKLY = "weekly",
|
|
@@ -802,6 +772,7 @@ declare const linkRequestSchema: z__default.ZodObject<{
|
|
|
802
772
|
id: z__default.ZodString;
|
|
803
773
|
quantity: z__default.ZodNumber;
|
|
804
774
|
priceVersion: z__default.ZodOptional<z__default.ZodString>;
|
|
775
|
+
amount: z__default.ZodOptional<z__default.ZodNumber>;
|
|
805
776
|
name: z__default.ZodOptional<z__default.ZodString>;
|
|
806
777
|
description: z__default.ZodOptional<z__default.ZodString>;
|
|
807
778
|
imageURL: z__default.ZodOptional<z__default.ZodString>;
|
|
@@ -841,6 +812,36 @@ declare const linkRequestSchema: z__default.ZodObject<{
|
|
|
841
812
|
}, z__default.core.$strip>>;
|
|
842
813
|
}, z__default.core.$strip>;
|
|
843
814
|
|
|
815
|
+
/**
|
|
816
|
+
* The buyer's choice between paying online, paying the seller by hand (bank
|
|
817
|
+
* transfer or "BLIK przelew na telefon") and paying the courier on delivery,
|
|
818
|
+
* offered when the seller turned on "show at checkout" for the manual payment
|
|
819
|
+
* gateway or offers cash on delivery.
|
|
820
|
+
*
|
|
821
|
+
* `POST /public-commerce/payment-methods` takes the body of `/buy` and answers
|
|
822
|
+
* `{ success: true, choice: null }` (nothing to choose) or
|
|
823
|
+
* `{ success: true, choice: { methods, manualAccountTypes } }`. The pick goes
|
|
824
|
+
* to `/buy` as `paymentMethod`. Anything else (an old backend, an error, a
|
|
825
|
+
* timeout) counts as "nothing to choose", so the cart buys as before.
|
|
826
|
+
*/
|
|
827
|
+
|
|
828
|
+
/** `cod` is cash on delivery: the buyer pays the courier (Poland only, shipped carts). */
|
|
829
|
+
type PaymentMethod = "online" | "manual" | "cod";
|
|
830
|
+
type ManualAccountType = "bankTransfer" | "blik";
|
|
831
|
+
type PaymentMethodChoice = {
|
|
832
|
+
/** In the seller's order (cash on delivery last); the first one is selected by default. */
|
|
833
|
+
methods: PaymentMethod[];
|
|
834
|
+
/** How the manual option is paid; decides its label. */
|
|
835
|
+
manualAccountTypes: ManualAccountType[];
|
|
836
|
+
};
|
|
837
|
+
|
|
838
|
+
declare function setLocale(locale?: string): void;
|
|
839
|
+
declare function getLocale(): string;
|
|
840
|
+
|
|
841
|
+
declare function setProjectID$1(projectID: string): void;
|
|
842
|
+
|
|
843
|
+
declare function setCustomHost(host: string): void;
|
|
844
|
+
|
|
844
845
|
declare namespace Bitsnap {
|
|
845
846
|
/**
|
|
846
847
|
* Adds a product or variant to the cart. Returns an `Err` instead of adding
|
|
@@ -857,6 +858,8 @@ declare namespace Bitsnap {
|
|
|
857
858
|
name?: string;
|
|
858
859
|
price?: number;
|
|
859
860
|
currency?: string;
|
|
861
|
+
/** Buyer chosen pay-what-you-want amount, in minor units. */
|
|
862
|
+
amount?: number;
|
|
860
863
|
/** Where `add_to_cart` is reported. Defaults to the mounted `<BitsnapCheckout>`. */
|
|
861
864
|
analytics?: Instrument;
|
|
862
865
|
}): Promise<Err | undefined>;
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkRJPQMDIQjs = require('./chunk-RJPQMDIQ.js');var _chunkKZWCVKLUjs = require('./chunk-KZWCVKLU.js');var _chunkAQYHQY2Yjs = require('./chunk-AQYHQY2Y.js');var _chunkHP3I6D2Rjs = require('./chunk-HP3I6D2R.js');var _chunkGHBRR665js = require('./chunk-GHBRR665.js');require('./chunk-KOYBZORL.js');var _chunkKDL35KEIjs = require('./chunk-KDL35KEI.js');var _chunkYPA6MMGJjs = require('./chunk-YPA6MMGJ.js');require('./chunk-Z3YOJ6NZ.js');require('./chunk-C736F727.js');var _chunkMDAFPGPAjs = require('./chunk-MDAFPGPA.js');require('./chunk-EFN4OW2C.js');var _chunk4Y233NIIjs = require('./chunk-4Y233NII.js');require('./chunk-IRZJIPUF.js');require('./chunk-W3RGQYPD.js');var _chunkQ337IQNAjs = require('./chunk-Q337IQNA.js');require('./chunk-JSDGZ4NY.js');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var n=_react.lazy.call(void 0, ()=>Promise.resolve().then(() => _interopRequireWildcard(require("./chat.js"))).then(t=>({default:t.ChatThread}))),o=_react.lazy.call(void 0, ()=>Promise.resolve().then(() => _interopRequireWildcard(require("./chat.js"))).then(t=>({default:t.Channel})));function i(){return _jsxruntime.jsx.call(void 0, "div",{className:"bitsnap-react h-full",children:_jsxruntime.jsx.call(void 0, "div",{role:"status","aria-busy":"true",className:"h-full min-h-[28rem] w-full rounded-xl border border-neutral-200 bg-white motion-safe:animate-pulse dark:border-neutral-800 dark:bg-neutral-900"})})}function c(t){return _jsxruntime.jsx.call(void 0, _react.Suspense,{fallback:_jsxruntime.jsx.call(void 0, i,{}),children:_jsxruntime.jsx.call(void 0, n,{...t})})}function s(t){return _jsxruntime.jsx.call(void 0, _react.Suspense,{fallback:_jsxruntime.jsx.call(void 0, i,{}),children:_jsxruntime.jsx.call(void 0, o,{...t})})}exports.ApplePayButton = _chunkRJPQMDIQjs.e; exports.Bitsnap = _chunkKZWCVKLUjs.s; exports.BitsnapCheckout = _chunkRJPQMDIQjs.d; exports.BitsnapReturns = _chunkAQYHQY2Yjs.a; exports.BitsnapReturnsProvider = _chunkHP3I6D2Rjs.v; exports.CHECKOUT_SLOT_NAMES = _chunkRJPQMDIQjs.a; exports.Channel = s; exports.ChatThread = c; exports.Environment = _chunkYPA6MMGJjs.c; exports.GooglePayButton = _chunkRJPQMDIQjs.f; exports.ITEM_IDS_NOT_FOUND = _chunkKZWCVKLUjs.m; exports.InPostPayButton = _chunkRJPQMDIQjs.b; exports.NotificationsComponent = _chunkRJPQMDIQjs.g; exports.PRODUCT_LIST_SLOT_NAMES = _chunkGHBRR665js.a; exports.Panel = _chunkKZWCVKLUjs.G; exports.PanelLogin = _chunkKZWCVKLUjs.k; exports.PanelProvider = _chunkKDL35KEIjs.a; exports.ProductList = _chunkGHBRR665js.d; exports.PublicOrderPage = _chunkKZWCVKLUjs.F; exports.RETURNS_SLOT_NAMES = _chunkHP3I6D2Rjs.l; exports.ReturnsAppearanceProvider = _chunkHP3I6D2Rjs.m; exports.ReturnsCodeStep = _chunkHP3I6D2Rjs.E; exports.ReturnsConfirmation = _chunkHP3I6D2Rjs.H; exports.ReturnsEmailStep = _chunkHP3I6D2Rjs.D; exports.ReturnsMyReturnDetail = _chunkHP3I6D2Rjs.K; exports.ReturnsMyReturnsList = _chunkHP3I6D2Rjs.J; exports.ReturnsOrderDetail = _chunkHP3I6D2Rjs.G; exports.ReturnsOrderList = _chunkHP3I6D2Rjs.F; exports.ReturnsProvider = _chunkHP3I6D2Rjs.u; exports.ReturnsResult = _chunkHP3I6D2Rjs.I; exports.RevolutPayButton = _chunkRJPQMDIQjs.c; exports.buildAccessTokenRedirect = _chunkKZWCVKLUjs.j; exports.createCheckout = _chunkKZWCVKLUjs.v; exports.createPaymentURL = _chunkKZWCVKLUjs.u; exports.formatProductPrice = _chunkGHBRR665js.b; exports.getAllowedReturnOrigins = _chunkMDAFPGPAjs.h; exports.getLocale = _chunkQ337IQNAjs.f; exports.getPanelConfig = _chunkMDAFPGPAjs.b; exports.getPaymentMethodChoice = _chunkKZWCVKLUjs.t; exports.getReferenceIfPossible = _chunkKZWCVKLUjs.w; exports.getReturnURLFromSearch = _chunkKZWCVKLUjs.g; exports.injectReferenceToRequestIfNeeded = _chunkKZWCVKLUjs.x; exports.persistReturnURL = _chunkKZWCVKLUjs.h; exports.readPersistedReturnURL = _chunkKZWCVKLUjs.i; exports.setAllowedReturnOrigins = _chunkMDAFPGPAjs.g; exports.setCustomHost = _chunk4Y233NIIjs.f; exports.setHost = _chunkMDAFPGPAjs.f; exports.setLocale = _chunkQ337IQNAjs.e; exports.setLoginURL = _chunkMDAFPGPAjs.e; exports.setPanelConfig = _chunkMDAFPGPAjs.a; exports.setPanelProjectID = _chunkMDAFPGPAjs.c; exports.setProjectID = _chunkKZWCVKLUjs.J; exports.setTheme = _chunkMDAFPGPAjs.d; exports.useCreateReturn = _chunkHP3I6D2Rjs.z; exports.useMyReturn = _chunkHP3I6D2Rjs.B; exports.useMyReturns = _chunkHP3I6D2Rjs.A; exports.usePanelConfig = _chunkKDL35KEIjs.b; exports.useProducts = _chunkGHBRR665js.c; exports.useReturnOrders = _chunkHP3I6D2Rjs.x; exports.useReturnSession = _chunkHP3I6D2Rjs.w; exports.useReturnableOrder = _chunkHP3I6D2Rjs.y; exports.useReturnsAppearance = _chunkHP3I6D2Rjs.n; exports.useReturnsSlot = _chunkHP3I6D2Rjs.o; exports.useReturnsText = _chunkHP3I6D2Rjs.r;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/index.js","../src/chat/lazy.tsx"],"names":["LazyThread","lazy","module","LazyChannel","Fallback","jsx","ChatThread","props","Suspense","Channel"],"mappings":"AAAA,iZAAwF,sDAA+I,sDAAyC,sDAA0K,sDAAiE,+BAA4B,sDAA+C,sDAAwC,+BAA4B,+BAA4B,sDAAyF,+BAA4B,sDAAmC,+BAA4B,+BAA4B,sDAA+C,+BAA4B,8BCAl6B,+CAczB,IAVAA,CAAAA,CAAaC,yBAAAA,CAAK,CAAA,EACtB,4DAAA,CAAO,WAAS,GAAA,CAAE,IAAA,CAAMC,CAAAA,EAAAA,CAAY,CAAE,OAAA,CAASA,CAAAA,CAAO,UAAW,CAAA,CAAE,CACrE,CAAA,CACMC,CAAAA,CAAcF,yBAAAA,CAAK,CAAA,EACvB,4DAAA,CAAO,WAAS,GAAA,CAAE,IAAA,CAAMC,CAAAA,EAAAA,CAAY,CAAE,OAAA,CAASA,CAAAA,CAAO,OAAQ,CAAA,CAAE,CAClE,CAAA,CAEA,SAASE,CAAAA,CAAAA,CAAW,CAClB,OACEC,6BAAAA,KAAC,CAAA,CAAI,SAAA,CAAU,sBAAA,CACb,QAAA,CAAAA,6BAAAA,KAAC,CAAA,CACC,IAAA,CAAK,QAAA,CACL,WAAA,CAAU,MAAA,CACV,SAAA,CAAU,iJAAA,CACZ,CAAA,CACF,CAEJ,CAMO,SAASC,CAAAA,CAAWC,CAAAA,CAAwB,CACjD,OACEF,6BAAAA,eAACG,CAAA,CAAS,QAAA,CAAUH,6BAAAA,CAACD,CAAA,CAAA,CAAS,CAAA,CAC5B,QAAA,CAAAC,6BAAAA,CAACL,CAAA,CAAY,GAAGO,CAAAA,CAAO,CAAA,CACzB,CAEJ,CAMO,SAASE,CAAAA,CAAQF,CAAAA,CAAqB,CAC3C,OACEF,6BAAAA,eAACG,CAAA,CAAS,QAAA,CAAUH,6BAAAA,CAACD,CAAA,CAAA,CAAS,CAAA,CAC5B,QAAA,CAAAC,6BAAAA,CAACF,CAAA,CAAa,GAAGI,CAAAA,CAAO,CAAA,CAC1B,CAEJ,CAAA,24FAAA","file":"/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/index.js","sourcesContent":[null,"import { lazy, Suspense } from \"react\";\nimport type { ChannelProps, ChatThreadProps } from \"./widgets\";\n\n// The chat view is a separate chunk: shops without chat never load it.\nconst LazyThread = lazy(() =>\n import(\"./index\").then((module) => ({ default: module.ChatThread })),\n);\nconst LazyChannel = lazy(() =>\n import(\"./index\").then((module) => ({ default: module.Channel })),\n);\n\nfunction Fallback() {\n return (\n <div className=\"bitsnap-react h-full\">\n <div\n role=\"status\"\n aria-busy=\"true\"\n className=\"h-full min-h-[28rem] w-full rounded-xl border border-neutral-200 bg-white motion-safe:animate-pulse dark:border-neutral-800 dark:bg-neutral-900\"\n />\n </div>\n );\n}\n\n/**\n * A buyer's pack thread for one service product. Loads the chat on demand;\n * the same component is exported eagerly from `bitsnap-react/chat`.\n */\nexport function ChatThread(props: ChatThreadProps) {\n return (\n <Suspense fallback={<Fallback />}>\n <LazyThread {...props} />\n </Suspense>\n );\n}\n\n/**\n * A community channel. Loads the chat on demand; the same component is\n * exported eagerly from `bitsnap-react/chat`.\n */\nexport function Channel(props: ChannelProps) {\n return (\n <Suspense fallback={<Fallback />}>\n <LazyChannel {...props} />\n </Suspense>\n );\n}\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as ra,b as ea,c as ia,d as na,e as la,f as
|
|
1
|
+
import{a as ra,b as ea,c as ia,d as na,e as la,f as va,g as ga}from"./chunk-IXQCN7MR.mjs";import{F as oa,G as ca,J as sa,g as z,h as j,i as C,j as _,k as S,m as Q,s as V,t as X,u as Z,v as $,w as aa,x as ta}from"./chunk-5M3OUOMU.mjs";import{a as ha}from"./chunk-URQBHNJK.mjs";import{A as q,B as A,D as R,E as F,F as W,G as Y,H as G,I as H,J,K,l as B,m as E,n as T,o as M,r as I,u as P,v as L,w as O,x as U,y as N,z as D}from"./chunk-IXX6SUMB.mjs";import{a as pa,b as ba,c as ua}from"./chunk-A2ZDFN3J.mjs";import{a as da}from"./chunk-EMR4YXNY.mjs";import"./chunk-KOVKUJAW.mjs";import{a as k,b as y}from"./chunk-LHQEM3CU.mjs";import{c as x}from"./chunk-LHNTSQYO.mjs";import"./chunk-HKRH6FI6.mjs";import"./chunk-KO7ZERN5.mjs";import"./chunk-XEXPQFKN.mjs";import{a as l,b as p,c as d,d as b,e as u,f as h,g as v,h as g}from"./chunk-CUPG4B5W.mjs";import"./chunk-2G46TAUX.mjs";import"./chunk-5R6AGO3Z.mjs";import{f}from"./chunk-BTERIY6N.mjs";import"./chunk-TW25G7XX.mjs";import"./chunk-MDCP5JNP.mjs";import{e as m,f as w}from"./chunk-OFPRIENJ.mjs";import"./chunk-U6FLIRIV.mjs";import{lazy as r,Suspense as e}from"react";import{jsx as a}from"react/jsx-runtime";var n=r(()=>import("./chat.mjs").then(t=>({default:t.ChatThread}))),o=r(()=>import("./chat.mjs").then(t=>({default:t.Channel})));function i(){return a("div",{className:"bitsnap-react h-full",children:a("div",{role:"status","aria-busy":"true",className:"h-full min-h-[28rem] w-full rounded-xl border border-neutral-200 bg-white motion-safe:animate-pulse dark:border-neutral-800 dark:bg-neutral-900"})})}function c(t){return a(e,{fallback:a(i,{}),children:a(n,{...t})})}function s(t){return a(e,{fallback:a(i,{}),children:a(o,{...t})})}export{la as ApplePayButton,V as Bitsnap,na as BitsnapCheckout,ha as BitsnapReturns,L as BitsnapReturnsProvider,ra as CHECKOUT_SLOT_NAMES,s as Channel,c as ChatThread,x as Environment,va as GooglePayButton,Q as ITEM_IDS_NOT_FOUND,ea as InPostPayButton,ga as NotificationsComponent,pa as PRODUCT_LIST_SLOT_NAMES,ca as Panel,S as PanelLogin,k as PanelProvider,ua as ProductList,oa as PublicOrderPage,B as RETURNS_SLOT_NAMES,E as ReturnsAppearanceProvider,F as ReturnsCodeStep,G as ReturnsConfirmation,R as ReturnsEmailStep,K as ReturnsMyReturnDetail,J as ReturnsMyReturnsList,Y as ReturnsOrderDetail,W as ReturnsOrderList,P as ReturnsProvider,H as ReturnsResult,ia as RevolutPayButton,_ as buildAccessTokenRedirect,$ as createCheckout,Z as createPaymentURL,da as formatProductPrice,g as getAllowedReturnOrigins,w as getLocale,p as getPanelConfig,X as getPaymentMethodChoice,aa as getReferenceIfPossible,z as getReturnURLFromSearch,ta as injectReferenceToRequestIfNeeded,j as persistReturnURL,C as readPersistedReturnURL,v as setAllowedReturnOrigins,f as setCustomHost,h as setHost,m as setLocale,u as setLoginURL,l as setPanelConfig,d as setPanelProjectID,sa as setProjectID,b as setTheme,D as useCreateReturn,A as useMyReturn,q as useMyReturns,y as usePanelConfig,ba as useProducts,U as useReturnOrders,O as useReturnSession,N as useReturnableOrder,T as useReturnsAppearance,M as useReturnsSlot,I as useReturnsText};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chat/lazy.tsx"],"sourcesContent":["import { lazy, Suspense } from \"react\";\nimport type { ChannelProps, ChatThreadProps } from \"./widgets\";\n\n// The chat view is a separate chunk: shops without chat never load it.\nconst LazyThread = lazy(() =>\n import(\"./index\").then((module) => ({ default: module.ChatThread })),\n);\nconst LazyChannel = lazy(() =>\n import(\"./index\").then((module) => ({ default: module.Channel })),\n);\n\nfunction Fallback() {\n return (\n <div className=\"bitsnap-react h-full\">\n <div\n role=\"status\"\n aria-busy=\"true\"\n className=\"h-full min-h-[28rem] w-full rounded-xl border border-neutral-200 bg-white motion-safe:animate-pulse dark:border-neutral-800 dark:bg-neutral-900\"\n />\n </div>\n );\n}\n\n/**\n * A buyer's pack thread for one service product. Loads the chat on demand;\n * the same component is exported eagerly from `bitsnap-react/chat`.\n */\nexport function ChatThread(props: ChatThreadProps) {\n return (\n <Suspense fallback={<Fallback />}>\n <LazyThread {...props} />\n </Suspense>\n );\n}\n\n/**\n * A community channel. Loads the chat on demand; the same component is\n * exported eagerly from `bitsnap-react/chat`.\n */\nexport function Channel(props: ChannelProps) {\n return (\n <Suspense fallback={<Fallback />}>\n <LazyChannel {...props} />\n </Suspense>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/chat/lazy.tsx"],"sourcesContent":["import { lazy, Suspense } from \"react\";\nimport type { ChannelProps, ChatThreadProps } from \"./widgets\";\n\n// The chat view is a separate chunk: shops without chat never load it.\nconst LazyThread = lazy(() =>\n import(\"./index\").then((module) => ({ default: module.ChatThread })),\n);\nconst LazyChannel = lazy(() =>\n import(\"./index\").then((module) => ({ default: module.Channel })),\n);\n\nfunction Fallback() {\n return (\n <div className=\"bitsnap-react h-full\">\n <div\n role=\"status\"\n aria-busy=\"true\"\n className=\"h-full min-h-[28rem] w-full rounded-xl border border-neutral-200 bg-white motion-safe:animate-pulse dark:border-neutral-800 dark:bg-neutral-900\"\n />\n </div>\n );\n}\n\n/**\n * A buyer's pack thread for one service product. Loads the chat on demand;\n * the same component is exported eagerly from `bitsnap-react/chat`.\n */\nexport function ChatThread(props: ChatThreadProps) {\n return (\n <Suspense fallback={<Fallback />}>\n <LazyThread {...props} />\n </Suspense>\n );\n}\n\n/**\n * A community channel. Loads the chat on demand; the same component is\n * exported eagerly from `bitsnap-react/chat`.\n */\nexport function Channel(props: ChannelProps) {\n return (\n <Suspense fallback={<Fallback />}>\n <LazyChannel {...props} />\n </Suspense>\n );\n}\n"],"mappings":"+iCAAA,OAAS,QAAAA,EAAM,YAAAC,MAAgB,QAczB,cAAAC,MAAA,oBAVN,IAAMC,EAAaH,EAAK,IACtB,OAAO,YAAS,EAAE,KAAMI,IAAY,CAAE,QAASA,EAAO,UAAW,EAAE,CACrE,EACMC,EAAcL,EAAK,IACvB,OAAO,YAAS,EAAE,KAAMI,IAAY,CAAE,QAASA,EAAO,OAAQ,EAAE,CAClE,EAEA,SAASE,GAAW,CAClB,OACEJ,EAAC,OAAI,UAAU,uBACb,SAAAA,EAAC,OACC,KAAK,SACL,YAAU,OACV,UAAU,kJACZ,EACF,CAEJ,CAMO,SAASK,EAAWC,EAAwB,CACjD,OACEN,EAACD,EAAA,CAAS,SAAUC,EAACI,EAAA,EAAS,EAC5B,SAAAJ,EAACC,EAAA,CAAY,GAAGK,EAAO,EACzB,CAEJ,CAMO,SAASC,EAAQD,EAAqB,CAC3C,OACEN,EAACD,EAAA,CAAS,SAAUC,EAACI,EAAA,EAAS,EAC5B,SAAAJ,EAACG,EAAA,CAAa,GAAGG,EAAO,EAC1B,CAEJ","names":["lazy","Suspense","jsx","LazyThread","module","LazyChannel","Fallback","ChatThread","props","Channel"]}
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/internal.js","../src/internal.ts"],"names":["require_internal","__commonJSMin"],"mappings":"AAAA,+HAAkC,ICAlCA,CAAAA,CAAAC,gCAAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,SAAA,UAAA,CAAA,CAAA,CAAA","file":"/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/internal.js","sourcesContent":[null,""]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{s as a,t as b,u as c,v as d,w as e,x as f}from"./chunk-5M3OUOMU.mjs";import"./chunk-IXX6SUMB.mjs";import"./chunk-KOVKUJAW.mjs";import"./chunk-LHQEM3CU.mjs";import"./chunk-LHNTSQYO.mjs";import"./chunk-HKRH6FI6.mjs";import"./chunk-XEXPQFKN.mjs";import"./chunk-CUPG4B5W.mjs";import"./chunk-2G46TAUX.mjs";import"./chunk-5R6AGO3Z.mjs";import"./chunk-BTERIY6N.mjs";import"./chunk-TW25G7XX.mjs";import"./chunk-MDCP5JNP.mjs";import"./chunk-OFPRIENJ.mjs";import"./chunk-U6FLIRIV.mjs";export{a as Bitsnap,d as createCheckout,c as createPaymentURL,b as getPaymentMethodChoice,e as getReferenceIfPossible,f as injectReferenceToRequestIfNeeded};
|
|
2
|
+
//# sourceMappingURL=methods-33CWGKNA.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkKZWCVKLUjs = require('./chunk-KZWCVKLU.js');require('./chunk-HP3I6D2R.js');require('./chunk-KOYBZORL.js');require('./chunk-KDL35KEI.js');require('./chunk-YPA6MMGJ.js');require('./chunk-Z3YOJ6NZ.js');require('./chunk-MDAFPGPA.js');require('./chunk-EFN4OW2C.js');require('./chunk-4Y233NII.js');require('./chunk-IRZJIPUF.js');require('./chunk-W3RGQYPD.js');require('./chunk-Q337IQNA.js');require('./chunk-JSDGZ4NY.js');exports.Bitsnap = _chunkKZWCVKLUjs.s; exports.createCheckout = _chunkKZWCVKLUjs.v; exports.createPaymentURL = _chunkKZWCVKLUjs.u; exports.getPaymentMethodChoice = _chunkKZWCVKLUjs.t; exports.getReferenceIfPossible = _chunkKZWCVKLUjs.w; exports.injectReferenceToRequestIfNeeded = _chunkKZWCVKLUjs.x;
|
|
2
|
+
//# sourceMappingURL=methods-4GB652MQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/methods-4GB652MQ.js"],"names":[],"mappings":"AAAA,+HAA0E,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,0SAA6J","file":"/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/methods-4GB652MQ.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/model-files-client-P4PORZJ6.js","../src/panel/components/model-files-client.ts"],"names":["listModelFiles","transport","accessToken","projectID","response","createClient","ModelDeliveryService","error","code","ConnectError","Code"],"mappings":"AAAA,+HAAuC,+BAA4B,8CCAF,MAejE,SAAsBA,CAAAA,CACpBC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACyB,CACzB,GAAI,CACF,IAAMC,CAAAA,CAAW,MAAMC,mCAAAA,kBAAaC,CAAsBL,CAAS,CAAA,CAAE,cAAA,CAAe,CAClF,WAAA,CAAAC,CAAAA,CACA,SAAA,CAAWC,CACb,CAAC,CAAA,CACD,OAAIC,CAAAA,CAAS,MAAA,CAAO,IAAA,GAAS,SAAA,CACpB,CAAE,MAAA,CAAQ,OAAA,CAAS,MAAA,CAAQA,CAAAA,CAAS,MAAA,CAAO,KAAA,CAAM,MAAO,CAAA,CAG/DA,CAAAA,CAAS,MAAA,CAAO,IAAA,GAAS,SAAA,EACzBA,CAAAA,CAAS,MAAA,CAAO,KAAA,GAAU,CAAA,CAEnB,CAAE,MAAA,CAAQ,cAAe,CAAA,CAE3B,CAAE,MAAA,CAAQ,QAAS,CAC5B,CAAA,KAAA,CAASG,CAAAA,CAAO,CACd,IAAMC,CAAAA,CAAOC,qBAAAA,CAAa,IAAA,CAAKF,CAAK,CAAA,CAAE,IAAA,CACtC,OAAIC,CAAAA,GAASE,aAAAA,CAAK,aAAA,EAAiBF,CAAAA,GAASE,aAAAA,CAAK,QAAA,EAC/C,OAAA,CAAQ,IAAA,CAAK,8CAAA,CAAgDH,CAAK,CAAA,CAE7D,CAAE,MAAA,CAAQ,QAAS,CAC5B,CACF,CAAA,2BAAA","file":"/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/model-files-client-P4PORZJ6.js","sourcesContent":[null,"import { Code, ConnectError, createClient, type Transport } from \"@connectrpc/connect\";\n\nimport {\n ModelDeliveryFailure,\n ModelDeliveryService,\n} from \"../../gen/proto/public/v1/model_delivery_pb\";\nimport type { ModelFilesLoad } from \"./model-files-load\";\n\n/**\n * Lists the buyer's 3D files (`public.v1.ModelDeliveryService`). Loaded with\n * `import()` by `useModelFiles`, so the service descriptor stays out of the\n * main bundle. A transport error (an older server without the service\n * answers 404 / unimplemented) or any failure other than an expired session\n * hides the section.\n */\nexport async function listModelFiles(\n transport: Transport,\n accessToken: string,\n projectID: string,\n): Promise<ModelFilesLoad> {\n try {\n const response = await createClient(ModelDeliveryService, transport).listModelFiles({\n accessToken,\n projectId: projectID,\n });\n if (response.result.case === \"success\") {\n return { status: \"ready\", models: response.result.value.models };\n }\n if (\n response.result.case === \"failure\" &&\n response.result.value === ModelDeliveryFailure.UNAUTHORIZED\n ) {\n return { status: \"unauthorized\" };\n }\n return { status: \"hidden\" };\n } catch (error) {\n const code = ConnectError.from(error).code;\n if (code !== Code.Unimplemented && code !== Code.NotFound) {\n console.warn(\"[bitsnap-react] 3D files could not be loaded\", error);\n }\n return { status: \"hidden\" };\n }\n}\n"]}
|
package/dist/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/emems-chat-v1/dist/models.js","../src/models.ts"],"names":["BitsnapModels"],"mappings":"AAAA,0XAA2B,iECAR,IAEFA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CACFA,CAAAA,CAAA,sBAAA,CAA2B,CAAA,CAAA,MAAA,CAAO,CAC7C,SAAA,CAAa,CAAA,CAAA,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CACjC,CAAC,CAAA,CAGYA,CAAAA,CAAA,cAAA,CAAmB,CAAA,CAAA,MAAA,CAAS,CAAA,CAAA,MAAA,CAAO,CAAA,CAAK,CAAA,CAAA,GAAA,CAAI,CAAC,CAAA,CAE7CA,CAAAA,CAAA,oBAAA,CAAyB,CAAA,CAAA,MAAA,CAAO,CAC3C,YAAA,CAAgB,CAAA,CAAA,MAAA,CAAO,CAAA,CACvB,cAAA,CAAkB,CAAA,CAAA,MAAA,CAAO,CAAA,CACzB,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CAAA,CACnB,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CACjB,EAAA,CAAM,CAAA,CAAA,MAAA,CAAO,CAAA,CACb,IAAA,CAAQ,CAAA,CAAA,IAAA,CAAK,CAAC,OAAA,CAAS,YAAY,CAAC,CAAA,CACpC,KAAA,CAAS,CAAA,CAAA,MAAA,CAAO,CAAA,CAChB,MAAA,CAAU,CAAA,CAAA,IAAA,CAAK,CAAC,QAAA,CAAU,WAAA,CAAa,SAAA,CAAW,UAAU,CAAC,CAAA,CAC7D,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA,CAC9B,MAAA,CAAU,CAAA,CAAA,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAC9B,CAAC,CAAA,CAAE,QAAA,CAAS,C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AGYA,CAAAA,CAAA,yBAAA,CAA8B,CAAA,CAAA,MAAA,CAAO,CAChD,KAAA,CAAS,CAAA,CAAA,KAAA,CAAMA,CAAAA,CAAA,uBAAuB,CAAA,CACtC,UAAA,CAAc,CAAA,CAAA,MAAA,CAAO,CACvB,CAAC,CAAA,CAAA,CAAA,CAzJcA,yBAAAA,GAAA,CAAA,CAAA,CAAA,CAAA,0BAAA","file":"/home/emems/.t3/worktrees/bitsnap-react/emems-chat-v1/dist/models.js","sourcesContent":[null,"import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const ProductPricingSchema = z.object({\n regularPrice: z.number(),\n effectivePrice: z.number(),\n currency: z.string(),\n discount: z.object({\n id: z.string(),\n type: z.enum([\"FIXED\", \"PERCENTAGE\"]),\n value: z.number(),\n status: z.enum([\"ACTIVE\", \"SCHEDULED\", \"EXPIRED\", \"DISABLED\"]),\n startsAt: z.number().optional(),\n endsAt: z.number().optional(),\n }).optional(),\n referencePrice: z.object({\n amount: z.number().optional(),\n windowDays: z.literal(30),\n asOf: z.number(),\n basis: z.literal(\"observed-history\"),\n historyAvailable: z.boolean(),\n }),\n priceVersion: z.string(),\n nextPriceChangeAt: z.number().optional(),\n });\n export type ProductPricing = z.infer<typeof ProductPricingSchema>;\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n\n export const PublicListProductImageSchema = z.object({\n url: z.string(),\n thumbnailUrl: z.union([z.string(), z.null()]),\n });\n export type PublicListProductImage = z.infer<\n typeof PublicListProductImageSchema\n >;\n\n /**\n * One card of the public product catalog\n * (`GET /api/integrations/{projectID}/public-commerce/product-list`).\n * `price` and `compareAtPrice` are in minor units (grosze, cents), like the\n * prices of the cart.\n */\n export const PublicListProductSchema = z.object({\n id: z.string(),\n /**\n * ID the cart should add: the variant ID for single-variant products.\n * Older backends omit it; use `cartItemId ?? id`.\n */\n cartItemId: z.string().optional(),\n uniqueSlug: z.string(),\n name: z.string(),\n shortDescription: z.union([z.string(), z.null()]),\n image: z.union([PublicListProductImageSchema, z.null()]),\n price: z.number(),\n currency: z.string(),\n compareAtPrice: z.union([z.number(), z.null()]),\n /** `true` when the variants have different prices: show \"from {price}\". */\n priceFrom: z.boolean(),\n variantCount: z.number(),\n isRecurring: z.boolean(),\n available: z.boolean(),\n /** `true` when the product can be added to the cart straight from the list. */\n addToCart: z.boolean(),\n /**\n * `true` when the product or one of its variants has a ready 3D model\n * (the card shows a \"3D\" badge). Older backends omit it.\n */\n has3d: z.boolean().optional(),\n });\n export type PublicListProduct = z.infer<typeof PublicListProductSchema>;\n\n export const ProductListResponseSchema = z.object({\n items: z.array(PublicListProductSchema),\n totalCount: z.number(),\n });\n export type ProductListResponse = z.infer<typeof ProductListResponseSchema>;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/models.js","../src/models.ts"],"names":["BitsnapModels"],"mappings":"AAAA,0XAA2B,iECAR,IAEFA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CACFA,CAAAA,CAAA,sBAAA,CAA2B,CAAA,CAAA,MAAA,CAAO,CAC7C,SAAA,CAAa,CAAA,CAAA,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CACjC,CAAC,CAAA,CAGYA,CAAAA,CAAA,cAAA,CAAmB,CAAA,CAAA,MAAA,CAAS,CAAA,CAAA,MAAA,CAAO,CAAA,CAAK,CAAA,CAAA,GAAA,CAAI,CAAC,CAAA,CAE7CA,CAAAA,CAAA,oBAAA,CAAyB,CAAA,CAAA,MAAA,CAAO,CAC3C,YAAA,CAAgB,CAAA,CAAA,MAAA,CAAO,CAAA,CACvB,cAAA,CAAkB,CAAA,CAAA,MAAA,CAAO,CAAA,CACzB,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CAAA,CACnB,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CACjB,EAAA,CAAM,CAAA,CAAA,MAAA,CAAO,CAAA,CACb,IAAA,CAAQ,CAAA,CAAA,IAAA,CAAK,CAAC,OAA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,CAAC,CAAC,CAAA,CAE9C,SAAA,CAAa,CAAA,CAAA,OAAA,CAAQ,CAAA,CACrB,YAAA,CAAgB,CAAA,CAAA,MAAA,CAAO,CAAA,CACvB,WAAA,CAAe,CAAA,CAAA,OAAA,CAAQ,CAAA,CACvB,SAAA,CAAa,CAAA,CAAA,OAAA,CAAQ,CAAA,CAErB,SAAA,CAAa,CAAA,CAAA,OAAA,CAAQ,CAAA,CAKrB,KAAA,CAAS,CAAA,CAAA,OAAA,CAAQ,CAAA,CAAE,QAAA,CAAS,CAC9B,CAAC,CAAA,CAGYA,CAAAA,CAAA,yBAAA,CAA8B,CAAA,CAAA,MAAA,CAAO,CAChD,KAAA,CAAS,CAAA,CAAA,KAAA,CAAMA,CAAAA,CAAA,uBAAuB,CAAA,CACtC,UAAA,CAAc,CAAA,CAAA,MAAA,CAAO,CACvB,CAAC,CAAA,CAAA,CAAA,CAzJcA,yBAAAA,GAAA,CAAA,CAAA,CAAA,CAAA,0BAAA","file":"/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/models.js","sourcesContent":[null,"import * as z from \"zod\";\n\nexport namespace BitsnapModels {\n export const BaselinkerFieldsSchema = z.object({\n storageID: z.string().optional(),\n });\n export type BaselinkerFields = z.infer<typeof BaselinkerFieldsSchema>;\n\n export const MetadataSchema = z.record(z.string(), z.any());\n\n export const ProductPricingSchema = z.object({\n regularPrice: z.number(),\n effectivePrice: z.number(),\n currency: z.string(),\n discount: z.object({\n id: z.string(),\n type: z.enum([\"FIXED\", \"PERCENTAGE\"]),\n value: z.number(),\n status: z.enum([\"ACTIVE\", \"SCHEDULED\", \"EXPIRED\", \"DISABLED\"]),\n startsAt: z.number().optional(),\n endsAt: z.number().optional(),\n }).optional(),\n referencePrice: z.object({\n amount: z.number().optional(),\n windowDays: z.literal(30),\n asOf: z.number(),\n basis: z.literal(\"observed-history\"),\n historyAvailable: z.boolean(),\n }),\n priceVersion: z.string(),\n nextPriceChangeAt: z.number().optional(),\n });\n export type ProductPricing = z.infer<typeof ProductPricingSchema>;\n\n export const VariantSchema = z.object({\n id: z.string(),\n name: z.string(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n images: z.array(z.string()),\n availableQuantity: z.number().optional(),\n isDeliverable: z.boolean().optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Variant = z.infer<typeof VariantSchema>;\n\n export const AdditionalSchema = z.object({\n sku: z.string().optional(),\n baselinkerFields: BaselinkerFieldsSchema.optional(),\n isPresale: z.boolean().optional(),\n });\n export type Additional = z.infer<typeof AdditionalSchema>;\n\n export const ItemSchema = z.object({\n id: z.string(),\n ownerID: z.string().optional(),\n name: z.string(),\n description: z.union([z.string(), z.null()]).optional(),\n createdAt: z.number().optional(),\n updatedAt: z.number().optional(),\n price: z.number(),\n currency: z.string(),\n metadata: MetadataSchema.optional(),\n image_url: z.string(),\n images: z.array(z.string()),\n isDeliverable: z.boolean().optional(),\n availableQuantity: z.number().optional(),\n additional: AdditionalSchema.optional(),\n variants: z.array(VariantSchema).optional(),\n estimatedDeliveryAt: z.number().optional(),\n pricing: ProductPricingSchema.optional(),\n });\n export type Item = z.infer<typeof ItemSchema>;\n\n export const DataSchema = z.object({\n success: z.boolean(),\n result: z.array(ItemSchema),\n totalCount: z.number(),\n });\n export type Data = z.infer<typeof DataSchema>;\n\n export const ProductsResultResultSchema = z.object({\n data: DataSchema,\n });\n export type ProductsResultResult = z.infer<typeof ProductsResultResultSchema>;\n\n export const ProductsResultElementSchema = z.array(\n z.object({\n result: ProductsResultResultSchema,\n }),\n );\n export type ProductsResultElement = z.infer<\n typeof ProductsResultElementSchema\n >;\n\n export const ProductResultSchema = z.array(\n z.object({\n result: z.object({\n data: z.object({\n success: z.boolean(),\n message: z.string().optional(),\n result: ItemSchema.optional(),\n }),\n }),\n }),\n );\n\n export const PublicListProductImageSchema = z.object({\n url: z.string(),\n thumbnailUrl: z.union([z.string(), z.null()]),\n });\n export type PublicListProductImage = z.infer<\n typeof PublicListProductImageSchema\n >;\n\n /**\n * One card of the public product catalog\n * (`GET /api/integrations/{projectID}/public-commerce/product-list`).\n * `price` and `compareAtPrice` are in minor units (grosze, cents), like the\n * prices of the cart.\n */\n export const PublicListProductSchema = z.object({\n id: z.string(),\n /**\n * ID the cart should add: the variant ID for single-variant products.\n * Older backends omit it; use `cartItemId ?? id`.\n */\n cartItemId: z.string().optional(),\n uniqueSlug: z.string(),\n name: z.string(),\n shortDescription: z.union([z.string(), z.null()]),\n image: z.union([PublicListProductImageSchema, z.null()]),\n price: z.number(),\n currency: z.string(),\n compareAtPrice: z.union([z.number(), z.null()]),\n /** `true` when the variants have different prices: show \"from {price}\". */\n priceFrom: z.boolean(),\n variantCount: z.number(),\n isRecurring: z.boolean(),\n available: z.boolean(),\n /** `true` when the product can be added to the cart straight from the list. */\n addToCart: z.boolean(),\n /**\n * `true` when the product or one of its variants has a ready 3D model\n * (the card shows a \"3D\" badge). Older backends omit it.\n */\n has3d: z.boolean().optional(),\n });\n export type PublicListProduct = z.infer<typeof PublicListProductSchema>;\n\n export const ProductListResponseSchema = z.object({\n items: z.array(PublicListProductSchema),\n totalCount: z.number(),\n });\n export type ProductListResponse = z.infer<typeof ProductListResponseSchema>;\n}\n"]}
|
package/dist/returns.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkAQYHQY2Yjs = require('./chunk-AQYHQY2Y.js');var _chunkHP3I6D2Rjs = require('./chunk-HP3I6D2R.js');require('./chunk-KOYBZORL.js');var _chunkYPA6MMGJjs = require('./chunk-YPA6MMGJ.js');require('./chunk-EFN4OW2C.js');require('./chunk-4Y233NII.js');require('./chunk-IRZJIPUF.js');require('./chunk-W3RGQYPD.js');require('./chunk-Q337IQNA.js');require('./chunk-JSDGZ4NY.js');exports.BitsnapReturns = _chunkAQYHQY2Yjs.a; exports.BitsnapReturnsProvider = _chunkHP3I6D2Rjs.v; exports.Environment = _chunkYPA6MMGJjs.c; exports.RETURNS_SLOT_NAMES = _chunkHP3I6D2Rjs.l; exports.ReturnsAppearanceProvider = _chunkHP3I6D2Rjs.m; exports.ReturnsCodeStep = _chunkHP3I6D2Rjs.E; exports.ReturnsConfirmation = _chunkHP3I6D2Rjs.H; exports.ReturnsEmailStep = _chunkHP3I6D2Rjs.D; exports.ReturnsMyReturnDetail = _chunkHP3I6D2Rjs.K; exports.ReturnsMyReturnsList = _chunkHP3I6D2Rjs.J; exports.ReturnsOrderDetail = _chunkHP3I6D2Rjs.G; exports.ReturnsOrderList = _chunkHP3I6D2Rjs.F; exports.ReturnsProvider = _chunkHP3I6D2Rjs.u; exports.ReturnsResult = _chunkHP3I6D2Rjs.I; exports.useCreateReturn = _chunkHP3I6D2Rjs.z; exports.useMyReturn = _chunkHP3I6D2Rjs.B; exports.useMyReturns = _chunkHP3I6D2Rjs.A; exports.useReturnOrders = _chunkHP3I6D2Rjs.x; exports.useReturnSession = _chunkHP3I6D2Rjs.w; exports.useReturnableOrder = _chunkHP3I6D2Rjs.y; exports.useReturnsAppearance = _chunkHP3I6D2Rjs.n; exports.useReturnsSlot = _chunkHP3I6D2Rjs.o; exports.useReturnsText = _chunkHP3I6D2Rjs.r;
|
|
2
2
|
//# sourceMappingURL=returns.js.map
|
package/dist/returns.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/returns.js"],"names":[],"mappings":"AAAA,+HAAuC,sDAA+K,+BAA4B,sDAAwC,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,kkCAA4gB","file":"/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/returns.js"}
|
package/dist/returns.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as L}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-URQBHNJK.mjs";import{A as m,B as l,D as x,E as d,F as P,G as f,H as S,I as c,J as T,K as C,l as t,m as r,n as s,o as n,r as p,u,v as R,w as o,x as y,y as a,z as i}from"./chunk-IXX6SUMB.mjs";import"./chunk-KOVKUJAW.mjs";import{c as e}from"./chunk-LHNTSQYO.mjs";import"./chunk-2G46TAUX.mjs";import"./chunk-5R6AGO3Z.mjs";import"./chunk-BTERIY6N.mjs";import"./chunk-TW25G7XX.mjs";import"./chunk-MDCP5JNP.mjs";import"./chunk-OFPRIENJ.mjs";import"./chunk-U6FLIRIV.mjs";export{L as BitsnapReturns,R as BitsnapReturnsProvider,e as Environment,t as RETURNS_SLOT_NAMES,r as ReturnsAppearanceProvider,d as ReturnsCodeStep,S as ReturnsConfirmation,x as ReturnsEmailStep,C as ReturnsMyReturnDetail,T as ReturnsMyReturnsList,f as ReturnsOrderDetail,P as ReturnsOrderList,u as ReturnsProvider,c as ReturnsResult,i as useCreateReturn,l as useMyReturn,m as useMyReturns,y as useReturnOrders,o as useReturnSession,a as useReturnableOrder,s as useReturnsAppearance,n as useReturnsSlot,p as useReturnsText};
|
|
2
2
|
//# sourceMappingURL=returns.mjs.map
|
package/dist/viewer3d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/
|
|
1
|
+
{"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/viewer3d.js","../src/viewer3d/index.ts"],"names":["require_viewer3d","__commonJSMin"],"mappings":"AAAA,+HAAuC,ICAvCA,CAAAA,CAAAC,gCAAAA,CAAA,CAAA,EAAA,CAAA,MAAM,IAAI,KAAA,CAAM,6DAA6D,CAAA,CAAA,CAAA,CAAA,SAAA,UAAA,CAAA,CAAA,CAAA","file":"/home/emems/.t3/worktrees/bitsnap-react/chat-free-pwyw/dist/viewer3d.js","sourcesContent":[null,"throw new Error(\"bitsnap-react/viewer3d is ESM only: use import, not require\");"]}
|
package/dist/viewer3d.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as it,b as oe,e as xe,g as st,h as O}from"./chunk-5ED7FWNY.mjs";import{a as Pe}from"./chunk-EMR4YXNY.mjs";import{e as De}from"./chunk-
|
|
1
|
+
import{a as it,b as oe,e as xe,g as st,h as O}from"./chunk-5ED7FWNY.mjs";import{a as Pe}from"./chunk-EMR4YXNY.mjs";import{e as De}from"./chunk-KO7ZERN5.mjs";import{b as j}from"./chunk-CUPG4B5W.mjs";import{c as he,e as _}from"./chunk-BTERIY6N.mjs";import"./chunk-TW25G7XX.mjs";import"./chunk-MDCP5JNP.mjs";import{f as we}from"./chunk-OFPRIENJ.mjs";import"./chunk-U6FLIRIV.mjs";import{useState as Mt}from"react";var Se={sectionLabel:"Model 3D",show:e=>`Poka\u017C model 3D (${e})`,heroPill:"Zobacz w 3D",heroPillWithSize:e=>`Zobacz w 3D (${e})`,loading:"Wczytywanie modelu 3D\u2026",loadingProgress:e=>`Wczytywanie modelu 3D: ${e}%`,error:"Nie uda\u0142o si\u0119 wczyta\u0107 modelu 3D",retry:"Spr\xF3buj ponownie",unsupported:"Ta przegl\u0105darka nie wy\u015Bwietli modelu 3D.",hintDrag:"Przeci\u0105gnij, aby obr\xF3ci\u0107",hintTap:"Dotknij, aby obraca\u0107",touchDone:"Gotowe",reset:"Reset widoku",fullscreen:"Pe\u0142ny ekran",closeFullscreen:"Zamknij pe\u0142ny ekran",disclaimer:"Model 3D jest pogl\u0105dowy; kolory i detale mog\u0105 si\u0119 r\xF3\u017Cni\u0107 od produktu.",report:"Zg\u0142o\u015B ten model",factsTitle:"Szczeg\xF3\u0142y modelu",factsFormat:"Format",factsFileSize:"Rozmiar pliku",factsTriangles:"Tr\xF3jk\u0105ty",factsDimensions:"Wymiary",triangles:e=>e,licence:"Licencja",licenceShow:"Warunki licencji",licenceOpen:"Otw\xF3rz licencj\u0119",licenceClose:"Zamknij",licenceDefaultName:"Licencja sprzedawcy",units:{meters:"m",centimeters:"cm",millimeters:"mm",inches:"in"},addToCart:"Dodaj do koszyka",addingToCart:"Dodawanie\u2026",addedToCart:"Dodano do koszyka",addToCartError:"Nie uda\u0142o si\u0119 doda\u0107 do koszyka. Spr\xF3buj ponownie."},Ee={sectionLabel:"3D model",show:e=>`Show 3D model (${e})`,heroPill:"View in 3D",heroPillWithSize:e=>`View in 3D (${e})`,loading:"Loading the 3D model\u2026",loadingProgress:e=>`Loading the 3D model: ${e}%`,error:"The 3D model could not be loaded",retry:"Try again",unsupported:"This browser cannot show the 3D model.",hintDrag:"Drag to rotate",hintTap:"Tap to rotate",touchDone:"Done",reset:"Reset view",fullscreen:"Full screen",closeFullscreen:"Close full screen",disclaimer:"The 3D model is illustrative; colours and details may differ from the product.",report:"Report this model",factsTitle:"Model details",factsFormat:"Format",factsFileSize:"File size",factsTriangles:"Triangles",factsDimensions:"Dimensions",triangles:e=>e,licence:"Licence",licenceShow:"Licence terms",licenceOpen:"Open the licence",licenceClose:"Close",licenceDefaultName:"Seller's licence",units:{meters:"m",centimeters:"cm",millimeters:"mm",inches:"in"},addToCart:"Add to cart",addingToCart:"Adding\u2026",addedToCart:"Added to cart",addToCartError:"Could not add to the cart. Try again."};function H(e,t){let r=e?.toLowerCase().startsWith("en")?Ee:Se;return t?{...r,...t}:r}function z(e){return e?.toLowerCase().startsWith("en")?"en-GB":"pl-PL"}import{Box as _e,Hand as Ae,Maximize2 as pt,Rotate3d as mt,RotateCcw as Ue,X as ft}from"lucide-react";import{useCallback as W,useEffect as h,useId as gt,useReducer as bt,useRef as ie,useState as P}from"react";import{createPortal as vt}from"react-dom";var at={meters:1e3,centimeters:10,millimeters:1,inches:25.4};function dt(e,t,r,o){if(e.length!==3)return;let i=new Intl.NumberFormat(z(o),{maximumFractionDigits:t==="millimeters"?0:2}),m=at[t]??1e3;return`${e.map(a=>i.format(a/m)).join(" \xD7 ")} ${r.units[t]}`}function ke(e,t,r){let o=[{label:t.factsFormat,value:"GLB"}];e.fileSize>0&&o.push({label:t.factsFileSize,value:O(e.fileSize,z(r))}),e.triangleCount>0&&o.push({label:t.factsTriangles,value:t.triangles(new Intl.NumberFormat(z(r)).format(e.triangleCount))});let i=dt(e.dimensionsMm,e.unit,t,r);return i&&o.push({label:t.factsDimensions,value:i}),o}import{useCallback as Me,useEffect as B,useRef as lt,useState as ct}from"react";function ut(e){return e!=null&&typeof e.requestFullscreen=="function"&&document.fullscreenEnabled===!0}function Ve(e){let[t,r]=ct(null),o=lt(0),i=Me(()=>{if(document.fullscreenElement!=null){document.exitFullscreen().catch(()=>r(null));return}r(null)},[]),m=Me(()=>{let a=e.current;if(o.current=window.scrollY,ut(a)){a.requestFullscreen({navigationUI:"hide"}).then(()=>r("native")).catch(()=>r("overlay"));return}r("overlay")},[e]);return B(()=>{let a=()=>{document.fullscreenElement==null&&r(d=>d==="native"?null:d)};return document.addEventListener("fullscreenchange",a),()=>document.removeEventListener("fullscreenchange",a)},[]),B(()=>{if(t!=="native")return;let a=d=>{d.key==="Escape"&&document.fullscreenElement!=null&&document.exitFullscreen().catch(()=>r(null))};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[t]),B(()=>{if(t!=="overlay")return;let{body:a,documentElement:d}=document,p={overflow:a.style.overflow,rootOverflow:d.style.overflow};a.style.overflow="hidden",d.style.overflow="hidden";let f=u=>{u.key==="Escape"&&r(null)};return window.addEventListener("keydown",f),()=>{window.removeEventListener("keydown",f),a.style.overflow=p.overflow,d.style.overflow=p.rootOverflow}},[t]),B(()=>{if(t==null&&o.current>0){let a=o.current;o.current=0,requestAnimationFrame(()=>window.scrollTo({top:a,behavior:"instant"}))}},[t]),{mode:t,isFullscreen:t!=null,enter:m,exit:i}}var Ce="bitsnap:viewer3d:gesture-hint-seen";function Te(){try{return typeof window>"u"?void 0:window.localStorage}catch{return}}function Re(e=Te()){try{return e?.getItem(Ce)==="1"}catch{return!1}}function Le(e=Te()){try{e?.setItem(Ce,"1")}catch{}}function Ne(e,t){return oe(e.size)?"awaiting-click":t?"loading":"poster"}function $e(e){return{status:Ne(e,!1),model:e,progress:0,attempt:0}}function ze(e,t){switch(t.type){case"NO_WEBGL":return e.status==="ready"?e:{...e,status:"unsupported"};case"VISIBLE":return e.status==="poster"?{...e,status:"loading",progress:0}:e;case"REQUEST":return e.status==="poster"||e.status==="awaiting-click"?{...e,status:"loading",progress:0}:e.status==="error"?{...e,status:"loading",progress:0,attempt:e.attempt+1}:e;case"RETRY":return e.status==="error"?{...e,status:"loading",progress:0,attempt:e.attempt+1}:e;case"PROGRESS":{if(e.status!=="loading"||t.key!==e.model.key)return e;let r=t.total>0?Math.min(1,Math.max(0,t.loaded/t.total)):0;return r===e.progress?e:{...e,progress:r}}case"LOADED":return e.status!=="loading"||t.key!==e.model.key?e:{...e,status:"ready",progress:1};case"FAILED":return e.status!=="loading"||t.key!==e.model.key?e:{...e,status:"error"};case"MODEL_CHANGED":return t.model.key===e.model.key?t.model.size===e.model.size?e:{...e,model:t.model}:e.status==="unsupported"?{...e,model:t.model}:{status:Ne(t.model,t.visible),model:t.model,progress:0,attempt:0}}}function Fe(e){return e==="loading"||e==="ready"}var Ie="bitsnap-react-viewer3d",T="[data-bitsnap-viewer3d]",k="var(--bitsnap-viewer3d-background,#ffffff)",g="var(--bitsnap-viewer3d-foreground,#171717)",G="var(--bitsnap-viewer3d-border,#e5e5e5)",ne="var(--bitsnap-viewer3d-radius,0.75rem)",Oe=`
|
|
2
2
|
${T}{container-type:inline-size;display:flex;flex-direction:column;gap:.75rem;font-family:inherit;color:${g}}
|
|
3
3
|
${T} *{box-sizing:border-box}
|
|
4
4
|
${T} .bsv3d-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
|
|
@@ -59,5 +59,5 @@ ${T} button:focus-visible,${T} a:focus-visible,.bsv3d-frame button:focus-visible
|
|
|
59
59
|
.bsv3d-hint{transition:opacity .3s}
|
|
60
60
|
.bsv3d-bar>div{transition:width .2s}
|
|
61
61
|
}
|
|
62
|
-
`;import{jsx as n,jsxs as b}from"react/jsx-runtime";var yt=()=>import("./Viewer3D-2IDEH6W3.mjs");function ht(e){let t={};if(e==null)return t;for(let[r,o]of Object.entries(e))o&&(t[`--bitsnap-viewer3d-${r}`]=o);return t}function wt(){try{let e=document.createElement("canvas");return(e.getContext("webgl2")??e.getContext("webgl"))!=null}catch{return!1}}function je(e){let[t,r]=P(!1);return h(()=>{if(typeof window.matchMedia!="function")return;let o=window.matchMedia(e),i=()=>r(o.matches);return i(),o.addEventListener?.("change",i),()=>o.removeEventListener?.("change",i)},[e]),t}function Dt(){let[e,t]=P(!0);return h(()=>{let r=()=>t(document.visibilityState!=="hidden");return r(),document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[]),e}function se({model:e,productName:t,locale:r,texts:o,appearance:i,decoderPath:m,reportHref:a,startSignal:d,renderFullscreenBar:p,hideNotes:f,id:u,className:w,style:M,loadViewer:x=yt}){let l=H(r,o),V={key:e.previewUrl,size:e.previewSize},[c,v]=bt(ze,V,$e),[D,C]=P(null),X=ie(null),pe=ie(null),[J,me]=P(!1),[q,fe]=P(!1),Qe=Dt(),Ye=je("(prefers-reduced-motion: reduce)"),R=je("(pointer: coarse)"),[L,A]=P(!1),[ee,U]=P(!1),[Ze,Ke]=P(0),S=Ve(X),ge=gt(),be=ht(i);h(()=>{wt()||v({type:"NO_WEBGL"})},[]),h(()=>{let s=pe.current;if(s==null||typeof IntersectionObserver>"u"){me(!0),fe(!0);return}let y=new IntersectionObserver(([re])=>me(re?.isIntersecting??!1),{rootMargin:"200px 0px"}),ye=new IntersectionObserver(([re])=>fe(re?.isIntersecting??!1),{threshold:.05});return y.observe(s),ye.observe(s),()=>{y.disconnect(),ye.disconnect()}},[]),h(()=>{J&&v({type:"VISIBLE"})},[J,c.status]),h(()=>{v({type:"MODEL_CHANGED",model:V,visible:J})},[V.key,V.size]);let Xe=ie(d);h(()=>{d==null||d===Xe.current||v({type:"REQUEST"})},[d]);let te=Fe(c.status);h(()=>{if(!te||D!=null)return;let s=!1;return x().then(y=>{s||C(()=>y.default)},y=>{console.warn("[bitsnap-react/viewer3d] the viewer could not be loaded; are three, @react-three/fiber and @react-three/drei installed?",y),s||v({type:"FAILED",key:c.model.key})}),()=>{s=!0}},[te,D,c.model.key,c.attempt]);let N=c.status==="ready";h(()=>{if(!N||Re())return;Le(),U(!0);let s=setTimeout(()=>U(!1),xe);return()=>clearTimeout(s)},[N]),h(()=>{if(!L)return;let s=y=>{X.current?.contains(y.target)||A(!1)};return document.addEventListener("pointerdown",s),()=>document.removeEventListener("pointerdown",s)},[L]),h(()=>{!q&&!S.isFullscreen&&A(!1)},[q,S.isFullscreen]);let Je=!R||L||S.isFullscreen,qe=W(()=>U(!1),[]),$=c.model.key,et=W((s,y)=>v({type:"PROGRESS",key:$,loaded:s,total:y}),[$]),tt=W(()=>v({type:"LOADED",key:$}),[$]),rt=W(s=>{console.warn("[bitsnap-react/viewer3d] model failed",s),v({type:"FAILED",key:$})},[$]),ot=O(e.previewSize,z(r)),I=Math.round(c.progress*100),E=S.isFullscreen,ve=!Ye&&Qe&&(q||E),nt=s=>S.mode==="overlay"?vt(s,document.body):s;return b("section",{id:u,"aria-labelledby":ge,"data-bitsnap-viewer3d":"",className:w,style:{...be,...M},children:[n("style",{href:Ie,precedence:"default",children:Oe}),n("h2",{id:ge,className:"bsv3d-sr",children:l.sectionLabel}),S.mode==="overlay"&&n("div",{"aria-hidden":"true",className:"bsv3d-placeholder"}),nt(b("div",{ref:X,"data-viewer3d-frame":"","data-state":c.status,"data-motion":ve?"on":"off","data-fullscreen":E?"":void 0,className:"bsv3d-frame",style:be,onClick:()=>{N&&R&&!L&&(A(!0),U(!1))},children:[b("div",{ref:pe,className:"bsv3d-stage",children:[te&&D!=null&&n(D,{className:"bsv3d-canvas",url:c.model.key,decoderPath:m,expectedSize:c.model.size,attempt:c.attempt,motionAllowed:ve,interactive:Je,allowZoom:E||R&&L,resetSignal:Ze,onProgress:et,onLoaded:tt,onError:rt,onInteract:qe},`${c.model.key}#${c.attempt}`),n(Pt,{src:e.thumbnailUrl,alt:t,hidden:N}),c.status==="loading"&&b("div",{className:"bsv3d-loading",children:[n("span",{className:"bsv3d-chip","data-small":"","aria-hidden":"true",children:I>0?l.loadingProgress(I):l.loading}),n("div",{className:"bsv3d-bar",children:n("div",{style:{width:`${Math.max(I,3)}%`}})})]}),c.status==="awaiting-click"&&n("div",{className:"bsv3d-center",children:b("button",{type:"button",className:"bsv3d-button","data-viewer3d-show":"",onClick:s=>{s.stopPropagation(),v({type:"REQUEST"})},children:[n(_e,{"aria-hidden":"true"}),l.show(ot)]})}),c.status==="error"&&n("div",{className:"bsv3d-center",children:b("div",{role:"alert",className:"bsv3d-alert",children:[n("p",{children:l.error}),b("button",{type:"button",className:"bsv3d-button","data-viewer3d-retry":"",onClick:s=>{s.stopPropagation(),v({type:"RETRY"})},children:[n(Ue,{"aria-hidden":"true"}),l.retry]})]})}),c.status==="unsupported"&&n("p",{className:"bsv3d-chip bsv3d-unsupported","data-small":"",children:l.unsupported}),N&&n("div",{"aria-hidden":!ee,className:"bsv3d-hint","data-visible":ee?"":void 0,children:b("span",{className:"bsv3d-chip",children:[R?n(Ae,{"aria-hidden":"true"}):n(mt,{"aria-hidden":"true"}),R&&!E?l.hintTap:l.hintDrag]})}),N&&b("div",{className:"bsv3d-controls",children:[n("div",{children:R&&!E&&(L?n("button",{type:"button",className:"bsv3d-icon","data-wide":"",onClick:s=>{s.stopPropagation(),A(!1)},children:l.touchDone}):!ee&&b("span",{className:"bsv3d-chip","data-small":"",children:[n(Ae,{"aria-hidden":"true"}),l.hintTap]}))}),b("div",{children:[n("button",{type:"button","aria-label":l.reset,title:l.reset,className:"bsv3d-icon",onClick:s=>{s.stopPropagation(),Ke(y=>y+1)},children:n(Ue,{"aria-hidden":"true"})}),!E&&n("button",{type:"button","aria-label":l.fullscreen,title:l.fullscreen,className:"bsv3d-icon","data-viewer3d-fullscreen":"",onClick:s=>{s.stopPropagation(),S.enter()},children:n(pt,{"aria-hidden":"true"})})]})]}),E&&n("button",{type:"button","aria-label":l.closeFullscreen,title:l.closeFullscreen,className:"bsv3d-icon bsv3d-close",onClick:s=>{s.stopPropagation(),S.exit()},children:n(ft,{"aria-hidden":"true"})}),n("p",{className:"bsv3d-sr","aria-live":"polite",children:c.status==="loading"?I>0?l.loadingProgress(I):l.loading:c.status==="error"?l.error:""})]}),E&&p!=null&&n("div",{className:"bsv3d-buybar",onClick:s=>s.stopPropagation(),children:p({close:S.exit})})]})),!f&&n(xt,{model:e,copy:l,locale:r,reportHref:a})]})}function Pt({src:e,alt:t,hidden:r}){let[o,i]=P(!1);return n("div",{"aria-hidden":r,className:"bsv3d-poster","data-hidden":r?"":void 0,children:e!=null&&!o?n("img",{src:e,alt:t,decoding:"async",loading:"lazy",onError:()=>i(!0)}):n(_e,{"aria-hidden":"true",strokeWidth:1.25})})}function xt({model:e,copy:t,locale:r,reportHref:o}){let[i,m]=P(o);h(()=>{if(o==null){m(void 0);return}try{let d=new URL(o,window.location.href);d.searchParams.has("url")||d.searchParams.set("url",window.location.href),m(d.toString())}catch{m(o)}},[o]);let a=e.facts!=null?ke(e.facts,t,r):[];return!e.illustrative&&i==null&&a.length===0?null:b("div",{className:"bsv3d-notes",children:[a.length>0&&b("div",{children:[n("p",{className:"bsv3d-facts-title",children:t.factsTitle}),n("dl",{children:a.map(d=>b("div",{children:[n("dt",{children:d.label}),n("dd",{children:d.value})]},d.label))})]}),(e.illustrative||i!=null)&&b("p",{className:"bsv3d-links",children:[e.illustrative&&n("span",{children:t.disclaimer}),i!=null&&n("a",{href:i,children:t.report})]})]})}import{useCallback as Et,useEffect as kt,useState as Z}from"react";var Q=class extends Error{status;constructor(t,r){super(t),this.name="Product3DError",this.status=r}};function He(e){let t=new URLSearchParams;return t.set("ids",e.productId),e.locale&&t.set("locale",e.locale),t.set("include","model3d"),`${e.host.replace(/\/+$/,"")}/api/integrations/${encodeURIComponent(e.projectID)}/public-commerce/products?${t.toString()}`}function ae(e){return typeof e=="object"&&e!=null&&typeof e.previewUrl=="string"&&e.previewUrl.length>0&&typeof e.previewSize=="number"}function Be(e,t){return e.find(r=>r.id===t)??e.find(r=>r.variants?.some(o=>o.id===t))??(e.length===1?e[0]:void 0)}function St(e){return/^(prodv2_[^_]+)/.exec(e)?.[1]??e}function Y(e,t){if(!t)return;let r=e.variants??[],o=`${St(e.id)}_${t}`;return r.find(i=>i.id===t)??r.find(i=>i.id===o)}function le(e,t){let r=Y(e,t);return r!=null?ae(r.model3d)?r.model3d:void 0:ae(e.model3d)?e.model3d:e.variants?.map(o=>o.model3d).find(ae)}var de=new Map;function ce(e){let t=he(He(e)),r=de.get(t);return r==null&&(r=(async()=>{let o=await fetch(t,{method:"GET",credentials:"omit",headers:{Accept:"application/json"}});if(!o.ok)throw new Q(`Could not load the product (${o.status})`,o.status);let i=await o.json();return Array.isArray(i?.result)?i.result:[]})(),de.set(t,r),r.catch(()=>de.delete(t))),r}function ue(e,t,r={}){let o=r.projectID??_().projectID,[i]=Z(()=>r.host??j),m=r.host??i,[a]=Z(()=>r.locale??we()),d=r.locale??a,p=`${m}|${o}|${e}|${d}`,[f,u]=Z(),[w,M]=Z(0);kt(()=>{if(!e)return;if(!o){u({key:p,error:new Error("bitsnap-react/viewer3d: no project ID (pass projectID or call setProjectID)")});return}let D=!1;return ce({projectID:o,host:m,productId:e,locale:d}).then(C=>{D||u({key:p,products:C})},C=>{D||u({key:p,error:C instanceof Error?C:new Error(String(C))})}),()=>{D=!0}},[p,w]);let x=Et(()=>M(D=>D+1),[]);if(!e)return{status:"none",retry:x};if(f==null||f.key!==p)return{status:"loading",retry:x};if(f.error!=null)return{status:"error",error:f.error,retry:x};let l=Be(f.products,e);if(l==null)return{status:"none",retry:x};let V=t??(Y(l,e)!=null?e:void 0),c=Y(l,V),v=le(l,V);return{status:v!=null?"ready":"none",model:v,product:l,variant:c,retry:x}}import{Fragment as Tt,jsx as F,jsxs as K}from"react/jsx-runtime";function Vt({productId:e,variantId:t,projectID:r,host:o,locale:i,renderBuyBar:m,fallback:a=null,productUrl:d,onAddedToCart:p,...f}){let u=ue(e,t,{projectID:r,host:o,locale:i});if(u.status!=="ready"||u.model==null||u.product==null)return F(Tt,{children:a});let w=u.product,M=H(i,f.texts);return F(se,{...f,locale:i,model:u.model,productName:u.variant?.name?`${w.name} \u2013 ${u.variant.name}`:w.name,renderFullscreenBar:({close:x})=>m!=null?m({product:w,variant:u.variant,close:x}):F(Ct,{product:w,variant:u.variant,copy:M,locale:i,projectID:r??_().projectID,host:o,productUrl:d,onAdded:p})})}function Ge(e,t){if(e.recurring!=null)return!1;let r=t?.priceType??e.priceType;if(r!=null&&r!=="one_time")return!1;let o=t?.availableQuantity??e.availableQuantity;return o==null||o>0}function We(e,t){return t?.id??e.variants?.[0]?.id??e.id}function Ct({product:e,variant:t,copy:r,locale:o,projectID:i,host:m,productUrl:a,onAdded:d}){let[p,f]=Mt("idle"),u=t?.price??e.price,w=t?.currency??e.currency,M=i!=null&&Ge(e,t);return K("div",{children:[K("div",{className:"bsv3d-buybar-row",children:[K("div",{children:[K("p",{className:"bsv3d-buybar-name",children:[e.name,t?.name?` \u2013 ${t.name}`:""]}),F("p",{className:"bsv3d-buybar-price",children:Pe(u,w,o)})]}),M&&F("button",{type:"button",className:"bsv3d-button","data-viewer3d-add":"",disabled:p==="adding","aria-live":"polite",onClick:async()=>{f("adding");try{await De({id:e.id,cartItemId:We(e,t),name:t?.name?`${e.name} \u2013 ${t.name}`:e.name,price:u,currency:w},{projectID:i,host:m??j,showCart:!1,url:a??(typeof window<"u"?window.location.href:void 0)}),f("added"),d?.({product:e,variant:t})}catch{f("error")}},children:p==="adding"?r.addingToCart:p==="added"?r.addedToCart:r.addToCart})]}),p==="error"&&F("p",{className:"bsv3d-buybar-error",role:"alert",children:r.addToCartError})]})}export{it as AUTO_LOAD_MAX_BYTES,se as Model3DViewer,Q as Product3DError,Vt as Product3DViewer,Ee as VIEWER3D_COPY_EN,Se as VIEWER3D_COPY_PL,He as buildProduct3DURL,We as cartItemIdFor,st as defaultDecoderPath,ce as fetchProduct3D,O as formatModelSize,Ge as isCartable,oe as needsClickToLoad,le as resolveModel,ue as useProduct3DModel};
|
|
62
|
+
`;import{jsx as n,jsxs as b}from"react/jsx-runtime";var yt=()=>import("./Viewer3D-2IDEH6W3.mjs");function ht(e){let t={};if(e==null)return t;for(let[r,o]of Object.entries(e))o&&(t[`--bitsnap-viewer3d-${r}`]=o);return t}function wt(){try{let e=document.createElement("canvas");return(e.getContext("webgl2")??e.getContext("webgl"))!=null}catch{return!1}}function je(e){let[t,r]=P(!1);return h(()=>{if(typeof window.matchMedia!="function")return;let o=window.matchMedia(e),i=()=>r(o.matches);return i(),o.addEventListener?.("change",i),()=>o.removeEventListener?.("change",i)},[e]),t}function Dt(){let[e,t]=P(!0);return h(()=>{let r=()=>t(document.visibilityState!=="hidden");return r(),document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)},[]),e}function se({model:e,productName:t,locale:r,texts:o,appearance:i,decoderPath:m,reportHref:a,startSignal:d,renderFullscreenBar:p,hideNotes:f,id:u,className:w,style:M,loadViewer:x=yt}){let l=H(r,o),V={key:e.previewUrl,size:e.previewSize},[c,v]=bt(ze,V,$e),[D,C]=P(null),X=ie(null),pe=ie(null),[J,me]=P(!1),[q,fe]=P(!1),Qe=Dt(),Ye=je("(prefers-reduced-motion: reduce)"),R=je("(pointer: coarse)"),[L,A]=P(!1),[ee,U]=P(!1),[Ze,Ke]=P(0),S=Ve(X),ge=gt(),be=ht(i);h(()=>{wt()||v({type:"NO_WEBGL"})},[]),h(()=>{let s=pe.current;if(s==null||typeof IntersectionObserver>"u"){me(!0),fe(!0);return}let y=new IntersectionObserver(([re])=>me(re?.isIntersecting??!1),{rootMargin:"200px 0px"}),ye=new IntersectionObserver(([re])=>fe(re?.isIntersecting??!1),{threshold:.05});return y.observe(s),ye.observe(s),()=>{y.disconnect(),ye.disconnect()}},[]),h(()=>{J&&v({type:"VISIBLE"})},[J,c.status]),h(()=>{v({type:"MODEL_CHANGED",model:V,visible:J})},[V.key,V.size]);let Xe=ie(d);h(()=>{d==null||d===Xe.current||v({type:"REQUEST"})},[d]);let te=Fe(c.status);h(()=>{if(!te||D!=null)return;let s=!1;return x().then(y=>{s||C(()=>y.default)},y=>{console.warn("[bitsnap-react/viewer3d] the viewer could not be loaded; are three, @react-three/fiber and @react-three/drei installed?",y),s||v({type:"FAILED",key:c.model.key})}),()=>{s=!0}},[te,D,c.model.key,c.attempt]);let N=c.status==="ready";h(()=>{if(!N||Re())return;Le(),U(!0);let s=setTimeout(()=>U(!1),xe);return()=>clearTimeout(s)},[N]),h(()=>{if(!L)return;let s=y=>{X.current?.contains(y.target)||A(!1)};return document.addEventListener("pointerdown",s),()=>document.removeEventListener("pointerdown",s)},[L]),h(()=>{!q&&!S.isFullscreen&&A(!1)},[q,S.isFullscreen]);let Je=!R||L||S.isFullscreen,qe=W(()=>U(!1),[]),$=c.model.key,et=W((s,y)=>v({type:"PROGRESS",key:$,loaded:s,total:y}),[$]),tt=W(()=>v({type:"LOADED",key:$}),[$]),rt=W(s=>{console.warn("[bitsnap-react/viewer3d] model failed",s),v({type:"FAILED",key:$})},[$]),ot=O(e.previewSize,z(r)),I=Math.round(c.progress*100),E=S.isFullscreen,ve=!Ye&&Qe&&(q||E),nt=s=>S.mode==="overlay"?vt(s,document.body):s;return b("section",{id:u,"aria-labelledby":ge,"data-bitsnap-viewer3d":"",className:w,style:{...be,...M},children:[n("style",{href:Ie,precedence:"default",children:Oe}),n("h2",{id:ge,className:"bsv3d-sr",children:l.sectionLabel}),S.mode==="overlay"&&n("div",{"aria-hidden":"true",className:"bsv3d-placeholder"}),nt(b("div",{ref:X,"data-viewer3d-frame":"","data-state":c.status,"data-motion":ve?"on":"off","data-fullscreen":E?"":void 0,className:"bsv3d-frame",style:be,onClick:()=>{N&&R&&!L&&(A(!0),U(!1))},children:[b("div",{ref:pe,className:"bsv3d-stage",children:[te&&D!=null&&n(D,{className:"bsv3d-canvas",url:c.model.key,decoderPath:m,expectedSize:c.model.size,attempt:c.attempt,motionAllowed:ve,interactive:Je,allowZoom:E||R&&L,resetSignal:Ze,onProgress:et,onLoaded:tt,onError:rt,onInteract:qe},`${c.model.key}#${c.attempt}`),n(Pt,{src:e.thumbnailUrl,alt:t,hidden:N}),c.status==="loading"&&b("div",{className:"bsv3d-loading",children:[n("span",{className:"bsv3d-chip","data-small":"","aria-hidden":"true",children:I>0?l.loadingProgress(I):l.loading}),n("div",{className:"bsv3d-bar",children:n("div",{style:{width:`${Math.max(I,3)}%`}})})]}),c.status==="awaiting-click"&&n("div",{className:"bsv3d-center",children:b("button",{type:"button",className:"bsv3d-button","data-viewer3d-show":"",onClick:s=>{s.stopPropagation(),v({type:"REQUEST"})},children:[n(_e,{"aria-hidden":"true"}),l.show(ot)]})}),c.status==="error"&&n("div",{className:"bsv3d-center",children:b("div",{role:"alert",className:"bsv3d-alert",children:[n("p",{children:l.error}),b("button",{type:"button",className:"bsv3d-button","data-viewer3d-retry":"",onClick:s=>{s.stopPropagation(),v({type:"RETRY"})},children:[n(Ue,{"aria-hidden":"true"}),l.retry]})]})}),c.status==="unsupported"&&n("p",{className:"bsv3d-chip bsv3d-unsupported","data-small":"",children:l.unsupported}),N&&n("div",{"aria-hidden":!ee,className:"bsv3d-hint","data-visible":ee?"":void 0,children:b("span",{className:"bsv3d-chip",children:[R?n(Ae,{"aria-hidden":"true"}):n(mt,{"aria-hidden":"true"}),R&&!E?l.hintTap:l.hintDrag]})}),N&&b("div",{className:"bsv3d-controls",children:[n("div",{children:R&&!E&&(L?n("button",{type:"button",className:"bsv3d-icon","data-wide":"",onClick:s=>{s.stopPropagation(),A(!1)},children:l.touchDone}):!ee&&b("span",{className:"bsv3d-chip","data-small":"",children:[n(Ae,{"aria-hidden":"true"}),l.hintTap]}))}),b("div",{children:[n("button",{type:"button","aria-label":l.reset,title:l.reset,className:"bsv3d-icon",onClick:s=>{s.stopPropagation(),Ke(y=>y+1)},children:n(Ue,{"aria-hidden":"true"})}),!E&&n("button",{type:"button","aria-label":l.fullscreen,title:l.fullscreen,className:"bsv3d-icon","data-viewer3d-fullscreen":"",onClick:s=>{s.stopPropagation(),S.enter()},children:n(pt,{"aria-hidden":"true"})})]})]}),E&&n("button",{type:"button","aria-label":l.closeFullscreen,title:l.closeFullscreen,className:"bsv3d-icon bsv3d-close",onClick:s=>{s.stopPropagation(),S.exit()},children:n(ft,{"aria-hidden":"true"})}),n("p",{className:"bsv3d-sr","aria-live":"polite",children:c.status==="loading"?I>0?l.loadingProgress(I):l.loading:c.status==="error"?l.error:""})]}),E&&p!=null&&n("div",{className:"bsv3d-buybar",onClick:s=>s.stopPropagation(),children:p({close:S.exit})})]})),!f&&n(xt,{model:e,copy:l,locale:r,reportHref:a})]})}function Pt({src:e,alt:t,hidden:r}){let[o,i]=P(!1);return n("div",{"aria-hidden":r,className:"bsv3d-poster","data-hidden":r?"":void 0,children:e!=null&&!o?n("img",{src:e,alt:t,decoding:"async",loading:"lazy",onError:()=>i(!0)}):n(_e,{"aria-hidden":"true",strokeWidth:1.25})})}function xt({model:e,copy:t,locale:r,reportHref:o}){let[i,m]=P(o);h(()=>{if(o==null){m(void 0);return}try{let d=new URL(o,window.location.href);d.searchParams.has("url")||d.searchParams.set("url",window.location.href),m(d.toString())}catch{m(o)}},[o]);let a=e.facts!=null?ke(e.facts,t,r):[];return!e.illustrative&&i==null&&a.length===0?null:b("div",{className:"bsv3d-notes",children:[a.length>0&&b("div",{children:[n("p",{className:"bsv3d-facts-title",children:t.factsTitle}),n("dl",{children:a.map(d=>b("div",{children:[n("dt",{children:d.label}),n("dd",{children:d.value})]},d.label))})]}),(e.illustrative||i!=null)&&b("p",{className:"bsv3d-links",children:[e.illustrative&&n("span",{children:t.disclaimer}),i!=null&&n("a",{href:i,children:t.report})]})]})}import{useCallback as Et,useEffect as kt,useState as Z}from"react";var Q=class extends Error{status;constructor(t,r){super(t),this.name="Product3DError",this.status=r}};function He(e){let t=new URLSearchParams;return t.set("ids",e.productId),e.locale&&t.set("locale",e.locale),t.set("include","model3d"),`${e.host.replace(/\/+$/,"")}/api/integrations/${encodeURIComponent(e.projectID)}/public-commerce/products?${t.toString()}`}function ae(e){return typeof e=="object"&&e!=null&&typeof e.previewUrl=="string"&&e.previewUrl.length>0&&typeof e.previewSize=="number"}function Be(e,t){return e.find(r=>r.id===t)??e.find(r=>r.variants?.some(o=>o.id===t))??(e.length===1?e[0]:void 0)}function St(e){return/^(prodv2_[^_]+)/.exec(e)?.[1]??e}function Y(e,t){if(!t)return;let r=e.variants??[],o=`${St(e.id)}_${t}`;return r.find(i=>i.id===t)??r.find(i=>i.id===o)}function le(e,t){let r=Y(e,t);return r!=null?ae(r.model3d)?r.model3d:void 0:ae(e.model3d)?e.model3d:e.variants?.map(o=>o.model3d).find(ae)}var de=new Map;function ce(e){let t=he(He(e)),r=de.get(t);return r==null&&(r=(async()=>{let o=await fetch(t,{method:"GET",credentials:"omit",headers:{Accept:"application/json"}});if(!o.ok)throw new Q(`Could not load the product (${o.status})`,o.status);let i=await o.json();return Array.isArray(i?.result)?i.result:[]})(),de.set(t,r),r.catch(()=>de.delete(t))),r}function ue(e,t,r={}){let o=r.projectID??j().projectID,[i]=Z(()=>r.host??_),m=r.host??i,[a]=Z(()=>r.locale??we()),d=r.locale??a,p=`${m}|${o}|${e}|${d}`,[f,u]=Z(),[w,M]=Z(0);kt(()=>{if(!e)return;if(!o){u({key:p,error:new Error("bitsnap-react/viewer3d: no project ID (pass projectID or call setProjectID)")});return}let D=!1;return ce({projectID:o,host:m,productId:e,locale:d}).then(C=>{D||u({key:p,products:C})},C=>{D||u({key:p,error:C instanceof Error?C:new Error(String(C))})}),()=>{D=!0}},[p,w]);let x=Et(()=>M(D=>D+1),[]);if(!e)return{status:"none",retry:x};if(f==null||f.key!==p)return{status:"loading",retry:x};if(f.error!=null)return{status:"error",error:f.error,retry:x};let l=Be(f.products,e);if(l==null)return{status:"none",retry:x};let V=t??(Y(l,e)!=null?e:void 0),c=Y(l,V),v=le(l,V);return{status:v!=null?"ready":"none",model:v,product:l,variant:c,retry:x}}import{Fragment as Tt,jsx as F,jsxs as K}from"react/jsx-runtime";function Vt({productId:e,variantId:t,projectID:r,host:o,locale:i,renderBuyBar:m,fallback:a=null,productUrl:d,onAddedToCart:p,...f}){let u=ue(e,t,{projectID:r,host:o,locale:i});if(u.status!=="ready"||u.model==null||u.product==null)return F(Tt,{children:a});let w=u.product,M=H(i,f.texts);return F(se,{...f,locale:i,model:u.model,productName:u.variant?.name?`${w.name} \u2013 ${u.variant.name}`:w.name,renderFullscreenBar:({close:x})=>m!=null?m({product:w,variant:u.variant,close:x}):F(Ct,{product:w,variant:u.variant,copy:M,locale:i,projectID:r??j().projectID,host:o,productUrl:d,onAdded:p})})}function Ge(e,t){if(e.recurring!=null)return!1;let r=t?.priceType??e.priceType;if(r!=null&&r!=="one_time")return!1;let o=t?.availableQuantity??e.availableQuantity;return o==null||o>0}function We(e,t){return t?.id??e.variants?.[0]?.id??e.id}function Ct({product:e,variant:t,copy:r,locale:o,projectID:i,host:m,productUrl:a,onAdded:d}){let[p,f]=Mt("idle"),u=t?.price??e.price,w=t?.currency??e.currency,M=i!=null&&Ge(e,t);return K("div",{children:[K("div",{className:"bsv3d-buybar-row",children:[K("div",{children:[K("p",{className:"bsv3d-buybar-name",children:[e.name,t?.name?` \u2013 ${t.name}`:""]}),F("p",{className:"bsv3d-buybar-price",children:Pe(u,w,o)})]}),M&&F("button",{type:"button",className:"bsv3d-button","data-viewer3d-add":"",disabled:p==="adding","aria-live":"polite",onClick:async()=>{f("adding");try{await De({id:e.id,cartItemId:We(e,t),name:t?.name?`${e.name} \u2013 ${t.name}`:e.name,price:u,currency:w},{projectID:i,host:m??_,showCart:!1,url:a??(typeof window<"u"?window.location.href:void 0)}),f("added"),d?.({product:e,variant:t})}catch{f("error")}},children:p==="adding"?r.addingToCart:p==="added"?r.addedToCart:r.addToCart})]}),p==="error"&&F("p",{className:"bsv3d-buybar-error",role:"alert",children:r.addToCartError})]})}export{it as AUTO_LOAD_MAX_BYTES,se as Model3DViewer,Q as Product3DError,Vt as Product3DViewer,Ee as VIEWER3D_COPY_EN,Se as VIEWER3D_COPY_PL,He as buildProduct3DURL,We as cartItemIdFor,st as defaultDecoderPath,ce as fetchProduct3D,O as formatModelSize,Ge as isCartable,oe as needsClickToLoad,le as resolveModel,ue as useProduct3DModel};
|
|
63
63
|
//# sourceMappingURL=viewer3d.mjs.map
|
|
@@ -153,7 +153,7 @@ declare class ChatError extends Error {
|
|
|
153
153
|
readonly status: number;
|
|
154
154
|
/** `cooldown`: seconds to wait before the next post. */
|
|
155
155
|
readonly retryAfter?: number;
|
|
156
|
-
/** Extra fields of the answer (`locked`:
|
|
156
|
+
/** Extra fields of the answer (`locked`: product, price type and bounds). */
|
|
157
157
|
readonly data: Record<string, unknown>;
|
|
158
158
|
constructor(code: string, status: number, data?: Record<string, unknown>);
|
|
159
159
|
}
|
|
@@ -409,6 +409,11 @@ type ConversationLock = {
|
|
|
409
409
|
reason: "replies" | "expired" | "no-pack" | "no-access";
|
|
410
410
|
productId?: string;
|
|
411
411
|
priceCents?: number;
|
|
412
|
+
amount?: number;
|
|
413
|
+
priceType?: "one_time" | "pay_what_you_want" | "free";
|
|
414
|
+
minimumCents?: number;
|
|
415
|
+
maximumCents?: number;
|
|
416
|
+
freeClaimLimit?: number;
|
|
412
417
|
welcome?: string;
|
|
413
418
|
};
|
|
414
419
|
type ConversationState = {
|
|
@@ -470,6 +475,10 @@ type ChatBuyRequest = {
|
|
|
470
475
|
reason: ConversationLock["reason"];
|
|
471
476
|
/** Known for a locked channel (from the chat service). */
|
|
472
477
|
priceCents?: number;
|
|
478
|
+
amount?: number;
|
|
479
|
+
email?: string;
|
|
480
|
+
code?: string;
|
|
481
|
+
turnstileToken?: string;
|
|
473
482
|
};
|
|
474
483
|
/** Props shared by `ChatThread` and `Channel`. */
|
|
475
484
|
type ChatWidgetBaseProps = {
|