@vio-live/web-sdk 0.1.0 → 0.3.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.
@@ -0,0 +1,3 @@
1
+
2
+ //# sourceMappingURL=chunk-PBQSHIID.js.map
3
+ //# sourceMappingURL=chunk-PBQSHIID.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-GGM2AIK5.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-PBQSHIID.js"}
@@ -51,9 +51,20 @@ interface ResolvedConfig {
51
51
  }
52
52
  declare class ConfigurationSingleton {
53
53
  private resolved;
54
+ private readyWaiters;
54
55
  init(input: VioConfig): void;
55
56
  get(): ResolvedConfig;
56
57
  get isInitialized(): boolean;
58
+ /**
59
+ * Resolves once `Vio.init()` has run, or after `timeoutMs` — whichever
60
+ * comes first. Hosts that mount several independent components (e.g. Vev
61
+ * blocks, which mount in no guaranteed order) may have one fire a GraphQL
62
+ * call before another has called `Vio.init()`. Awaiting this briefly lets
63
+ * that race resolve instead of silently sending an unauthenticated
64
+ * request. Resolves `true` if init happened in time, `false` on timeout —
65
+ * callers should still degrade gracefully either way.
66
+ */
67
+ whenReady(timeoutMs?: number): Promise<boolean>;
57
68
  /** For tests only. */
58
69
  reset(): void;
59
70
  }
@@ -163,9 +174,19 @@ interface PlacementComponent {
163
174
  }
164
175
  /** Helper: extract a useful display price from a Product. */
165
176
  declare function displayPrice(product: Product): string;
166
- /** Format a numeric amount + currency for Norwegian style: "1 299 kr". */
167
- declare function formatPrice(amount: number, currency: string): string;
168
- /** Helper: pick the first image URL (variant first, then product). */
177
+ /**
178
+ * Active display currency for the page. The host (e.g. the Vev Config block)
179
+ * sets `globalThis.__VIO_CURRENCY__` / localStorage `vio.currency`; falls back
180
+ * to NOK.
181
+ */
182
+ declare function getGlobalCurrency(): string;
183
+ /** Format a numeric amount + currency using the page locale and symbol map. */
184
+ declare function formatPrice(amount: number, currency?: string): string;
185
+ /**
186
+ * Helper: pick the first image URL (variant first, then product). Defensive:
187
+ * accepts loose shapes (backend cart rows, catalog rows) where images may be
188
+ * plain strings or live under image / imageUrl / image_url / primaryImage.
189
+ */
169
190
  declare function primaryImageUrl(product: Product): string | undefined;
170
191
 
171
192
  /**
@@ -276,6 +297,8 @@ declare function createCommerceClient(options: CommerceClientOptions): CommerceC
276
297
  interface CartLineItem {
277
298
  /** Unique local id for this line item (used for update/remove). */
278
299
  id: string;
300
+ /** Backend cart item id (set once the server-side cart is synced). */
301
+ cartItemId?: string;
279
302
  /** Vio Commerce product id. */
280
303
  productId: number;
281
304
  /** Sponsor (merchant) id this line item belongs to. */
@@ -294,12 +317,22 @@ interface CartLineItem {
294
317
  imageUrl: string;
295
318
  /** Quantity. */
296
319
  quantity: number;
320
+ /** Selected shipping for this line (backend cart). */
321
+ shipping?: unknown;
322
+ /** Shipping options offered by the backend for this line. */
323
+ availableShippings?: unknown[];
297
324
  }
298
325
  interface SponsorCartState {
299
326
  sponsorId: number;
300
327
  sponsorName?: string;
301
328
  items: CartLineItem[];
302
329
  currency: string;
330
+ /** Backend (Vio Commerce) cart id, once created. */
331
+ cartId?: string;
332
+ shippingCountry?: string;
333
+ subtotal?: number;
334
+ shipping?: number;
335
+ availableShippingCountries?: string[];
303
336
  }
304
337
 
305
338
  /**
@@ -341,15 +374,74 @@ interface AddManualOptions {
341
374
  }
342
375
  declare class CartManager extends EventTarget {
343
376
  private cartsBySponsor;
377
+ /** In-flight CreateCart per sponsor — two quick adds must share ONE backend
378
+ * cart (two CreateCarts split the items and one silently disappears). */
379
+ private cartIdPromises;
380
+ /** Monotonic mutation counter per sponsor + last applied response, so a
381
+ * slow response can't overwrite the state of a newer one. */
382
+ private mutationSeq;
383
+ private appliedSeq;
344
384
  constructor();
345
- /** Add a Product DTO to a sponsor's cart. Bumps quantity if already present. */
385
+ private nextSeq;
386
+ /** Apply a backend response only if no newer response was applied already. */
387
+ private applyBackendCart;
388
+ /** Surface a cart sync problem to hosts/UI (and the console). */
389
+ private emitError;
390
+ /** Ensure the sponsor cart exists server-side; returns its backend cart id. */
391
+ ensureCartId(sponsorId: number, currency?: string, shippingCountry?: string): Promise<string | undefined>;
392
+ /** Overwrite local cart state with the backend cart response (source of truth). */
393
+ updateFromBackendCart(sponsorId: number, backendCart: {
394
+ cart_id?: string;
395
+ currency?: string;
396
+ shipping_country?: string;
397
+ subtotal?: number;
398
+ shipping?: number;
399
+ available_shipping_countries?: string[];
400
+ line_items?: Array<{
401
+ id: string;
402
+ product_id: number;
403
+ variant_id?: number | string | null;
404
+ variant_title?: string | null;
405
+ brand?: string | null;
406
+ title?: string | null;
407
+ quantity: number;
408
+ image?: string | {
409
+ url?: string;
410
+ } | null;
411
+ imageUrl?: string | null;
412
+ image_url?: string | null;
413
+ price?: {
414
+ amount?: number;
415
+ amount_incl_taxes?: number | null;
416
+ currency_code?: string;
417
+ } | null;
418
+ shipping?: unknown;
419
+ available_shippings?: unknown[];
420
+ }>;
421
+ }): void;
422
+ /** Add a Product DTO to a sponsor's cart. Bumps quantity if already present.
423
+ * When a variantId is given, the line uses the VARIANT's price / image / title
424
+ * (not the product base), so different combinations are priced correctly. */
346
425
  addProduct(opts: AddProductOptions): CartLineItem;
347
426
  /** Add a manually-specified line item (no Product DTO). */
348
427
  addManual(opts: AddManualOptions): CartLineItem;
428
+ /** Quantity intents for lines whose backend id hasn't arrived yet — replayed
429
+ * when the AddItem response reconciles (keyed by product::variant). */
430
+ private pendingQtyIntents;
431
+ private intentKey;
349
432
  updateQuantity(lineItemId: string, sponsorId: number, quantity: number): void;
350
433
  removeItem(lineItemId: string, sponsorId: number): void;
351
434
  clearSponsorCart(sponsorId: number): void;
352
435
  clearAllCarts(): void;
436
+ /** Refresh the local cart from the backend (source of truth). */
437
+ fetchCartFromBackend(sponsorId: number): Promise<unknown>;
438
+ /** Line items grouped by supplier (shipping is per-supplier server-side). */
439
+ fetchLineItemsBySupplier(sponsorId: number): Promise<unknown>;
440
+ /** Set the chosen shipping option per supplier on the backend cart. */
441
+ updateShippingsBySupplier(sponsorId: number, data: Array<{
442
+ shipping_id: string;
443
+ supplier_id: number;
444
+ }>): Promise<unknown>;
353
445
  getAllCarts(): Map<number, SponsorCartState>;
354
446
  getCart(sponsorId: number): SponsorCartState | undefined;
355
447
  get itemCount(): number;
@@ -411,6 +503,13 @@ interface ApplePayConfig {
411
503
  detail?: string;
412
504
  amount: number;
413
505
  }>;
506
+ /**
507
+ * Charge hook, run INSIDE the sheet's authorize event with the tokenized
508
+ * payment. Must perform the real (backend) charge and throw on failure —
509
+ * only then does the sheet close with success; a throw closes it with
510
+ * failure. Its resolved value is surfaced as `ApplePayResult.confirmation`.
511
+ */
512
+ onAuthorize?: (result: ApplePayResult) => Promise<unknown>;
414
513
  }
415
514
  interface ApplePayResult {
416
515
  /** Stripe PaymentMethod id (pm_xxx) — pass to backend to confirm the PaymentIntent. */
@@ -426,6 +525,8 @@ interface ApplePayResult {
426
525
  state?: string;
427
526
  country?: string;
428
527
  };
528
+ /** Whatever `onAuthorize` resolved with (e.g. backend order_id/status). */
529
+ confirmation?: unknown;
429
530
  }
430
531
  /**
431
532
  * Check whether Apple Pay is available right now (Safari + supported device
@@ -441,7 +542,7 @@ declare function checkApplePayAvailability(config: ApplePayConfig): Promise<bool
441
542
  * The backend must then confirm a Stripe PaymentIntent with this
442
543
  * payment method id (server-side step, not handled here).
443
544
  */
444
- declare function showApplePaySheet(config: ApplePayConfig): Promise<ApplePayResult>;
545
+ declare function showApplePaySheet(config: ApplePayConfig): Promise<ApplePayResult | null>;
445
546
 
446
547
  /** One line in the express button's purchase data. Amounts in MINOR units. */
447
548
  interface KlarnaLineItem {
@@ -528,7 +629,7 @@ declare global {
528
629
  * merchant, same as iOS multi-sponsor model). Multiple sponsors → multiple
529
630
  * sequential checkouts.
530
631
  */
531
- type PaymentMethod = 'apple-pay' | 'klarna' | 'vipps' | 'card';
632
+ type PaymentMethod = 'apple-pay' | 'klarna' | 'vipps' | 'card' | 'stripe';
532
633
  interface CheckoutAddress {
533
634
  firstName: string;
534
635
  lastName: string;
@@ -551,6 +652,14 @@ interface CheckoutState {
551
652
  subtotal: number;
552
653
  /** Currency code. */
553
654
  currency: string;
655
+ /** Backend checkout id (Vio Commerce CreateCheckout). */
656
+ checkoutId?: string;
657
+ /** Full backend checkout payload (untyped upstream). */
658
+ checkout?: unknown;
659
+ /** Klarna Payments session id (native GraphQL flow). */
660
+ sessionId?: string;
661
+ /** Klarna Payments client token (native GraphQL flow). */
662
+ clientToken?: string;
554
663
  }
555
664
 
556
665
  /**
@@ -565,6 +674,24 @@ interface CheckoutState {
565
674
  * a method) and `payment-complete` (vendor sheet completed successfully).
566
675
  */
567
676
 
677
+ /** A shipping option offered in the checkout. `price` in minor units (øre). */
678
+ interface KlarnaShippingOption {
679
+ id: string;
680
+ method: string;
681
+ description: string;
682
+ price: number;
683
+ tax_amount: number;
684
+ tax_rate: number;
685
+ preselected: boolean;
686
+ /** Backend supplier the option belongs to (server-side shippings). */
687
+ supplierId?: string;
688
+ /** Display name from the backend (mirror of `method`). */
689
+ name?: string;
690
+ country_code?: string;
691
+ /** Price in MAJOR units, as delivered by the backend. */
692
+ priceMajor?: number;
693
+ currency?: string;
694
+ }
568
695
  interface CheckoutChangeDetail {
569
696
  state: CheckoutState | null;
570
697
  }
@@ -581,6 +708,8 @@ interface PaymentCompleteDetail {
581
708
  interface KlarnaPaymentsHandle {
582
709
  /** Categories offered by the session (pay_now / pay_later / pay_over_time). */
583
710
  categories: KlarnaPaymentsCategory[];
711
+ /** Shipping options in effect (backend per-supplier, or the static fallback). */
712
+ shippings: KlarnaShippingOption[];
584
713
  /** Currently selected category. */
585
714
  readonly selected: string;
586
715
  /** (Re)load the widget for a category. */
@@ -596,11 +725,67 @@ declare class CheckoutManager extends EventTarget {
596
725
  private readonly cartManager;
597
726
  private state;
598
727
  private applePayAvailableCache;
728
+ /** Gateway hints learned from CreatePaymentApplePay (per session). The
729
+ * backend's gateway_merchant_id may be a publishable key (pk_…) or a Stripe
730
+ * Connect account (acct_…) — stored defensively by prefix. */
731
+ private applePayPublishableKey;
732
+ private applePayConnectedAccount;
599
733
  private klarnaAvailableCache;
600
734
  private klarnaOrderInFlight;
735
+ /** Last backend shippings fetched (per-supplier), for UI reuse. */
736
+ private lastFetchedShippings;
737
+ /** Per-sponsor payment methods cache + in-flight dedupe. */
738
+ private paymentMethodsCache;
739
+ private paymentMethodsPromises;
601
740
  constructor(cartManager: CartManager);
602
741
  open(sponsorId: number): CheckoutState;
603
742
  close(): void;
743
+ /** Create the backend checkout for the sponsor's cart (auto-accepts terms). */
744
+ createCheckout(sponsorId: number): Promise<any>;
745
+ /** Update the backend checkout (terms are re-asserted unless overridden). */
746
+ updateCheckout(variables: Record<string, unknown>, sponsorId?: number): Promise<any>;
747
+ getCheckout(checkoutId: string, sponsorId?: number): Promise<any>;
748
+ /**
749
+ * Payment methods enabled for the sponsor (backend-configured). Memoised per
750
+ * sponsor with in-flight dedupe — several UI components ask on every open.
751
+ */
752
+ getAvailablePaymentMethods(sponsorId?: number): Promise<any>;
753
+ clearPaymentMethodsCache(): void;
754
+ /**
755
+ * Real shipping options from the backend cart (per supplier), mapped to the
756
+ * KlarnaShippingOption shape (minor units). Empty array on failure — callers
757
+ * fall back to the static KLARNA_SHIPPING_OPTIONS.
758
+ */
759
+ fetchAvailableShippings(sponsorId?: number): Promise<KlarnaShippingOption[]>;
760
+ /** Set the chosen shipping per supplier on the backend cart. */
761
+ updateShippingsBySupplier(data: Array<{
762
+ shipping_id: string;
763
+ supplier_id: number;
764
+ }>, sponsorId?: number): Promise<any>;
765
+ /**
766
+ * Shared setup for the redirect payment links (Stripe / Vipps): ensure the
767
+ * backend cart + checkout exist, push email/address onto the checkout, and
768
+ * return everything the payment mutation needs.
769
+ */
770
+ private prepareRedirectPayment;
771
+ /** Redirect the top window to a payment provider URL. */
772
+ private static redirectTo;
773
+ /**
774
+ * Stripe payment link: create/refresh the backend checkout, mint the Stripe
775
+ * Checkout URL (CreatePaymentStripe) and redirect. The return URL carries
776
+ * vio_payment/vio_method/checkout_id so the page can show the confirmation.
777
+ */
778
+ startStripePayment(sponsorId?: number, formData?: unknown): Promise<any>;
779
+ /**
780
+ * Vipps payment link: same flow as Stripe — CreatePaymentVipps → redirect to
781
+ * payment_url.
782
+ */
783
+ startVippsPayment(sponsorId?: number, formData?: unknown): Promise<any>;
784
+ /** Vipps' own payment state for the checkout — see getVippsStatus in
785
+ * cart-queries.ts for why this exists instead of trusting GetCheckout. */
786
+ getVippsStatus(checkoutId: string, sponsorId?: number): Promise<{
787
+ state?: string;
788
+ } | null>;
604
789
  setAddress(address: CheckoutAddress): void;
605
790
  selectPaymentMethod(method: PaymentMethod): void;
606
791
  /**
@@ -629,19 +814,33 @@ declare class CheckoutManager extends EventTarget {
629
814
  * The caller (the cart drawer) renders its own confirmation. `show()` must be
630
815
  * called synchronously inside the tap (Apple's user-gesture rule).
631
816
  */
632
- prepareApplePayExpress(amount: number, currency: string, country?: string): Promise<{
817
+ prepareApplePayExpress(amount: number, currency: string, country?: string, sponsorId?: number): Promise<{
633
818
  available: boolean;
634
819
  show: () => Promise<ApplePayResult | null>;
635
820
  }>;
821
+ /** The charge closure run inside the Apple Pay sheet's authorize event —
822
+ * shared by the checkout button and the cart's express button. Fail-closed:
823
+ * any failure throws and the sheet closes with failure, nothing confirmed. */
824
+ private buildApplePayAuthorize;
825
+ /** Backend statuses from ConfirmPaymentApplePay that mean the charge did
826
+ * NOT go through — anything here fails the sheet (fail-closed). */
827
+ private static readonly APPLE_PAY_FAILED_STATUSES;
636
828
  /**
637
- * Launches the Apple Pay sheet. Resolves with the Stripe PaymentMethod
638
- * id once the user authorises — the backend then confirms the
639
- * PaymentIntent with that id to actually capture the funds.
829
+ * Launches the Apple Pay sheet and charges server-side INSIDE the sheet's
830
+ * authorize event (round-5 wiring, contract from the commerce backend):
831
+ * 1. ensure a backend checkout exists (create if missing)
832
+ * 2. UpdateCheckout(paymentMethod: "Apple Pay" + payer email)
833
+ * 3. CreatePaymentApplePay → gateway hints (pk_/acct_ stored by prefix)
834
+ * 4. ConfirmPaymentApplePay(token, email, shipping) → the REAL charge;
835
+ * a failed/absent confirmation throws → the sheet closes with failure
836
+ * Resolves null if the user closes the sheet. On success, dispatches
837
+ * `payment-complete` with the backend order id in `result.confirmation`.
640
838
  */
641
839
  startApplePay(options?: {
642
840
  country?: string;
643
841
  label?: string;
644
- }): Promise<ApplePayResult>;
842
+ sponsorId?: number;
843
+ }): Promise<ApplePayResult | null>;
645
844
  /**
646
845
  * True if the Klarna Express button can be offered (clientId configured +
647
846
  * SDK loads). Memoised per active checkout. Never throws.
@@ -673,6 +872,7 @@ declare class CheckoutManager extends EventTarget {
673
872
  mountKlarnaPayments(container: HTMLElement, opts?: {
674
873
  withShipping?: boolean;
675
874
  shippingId?: string;
875
+ category?: string;
676
876
  }): Promise<KlarnaPaymentsHandle>;
677
877
  /** True if the Klarna Payments widget lib can load (UI gate). */
678
878
  klarnaPaymentsAvailable(): Promise<boolean>;
@@ -717,6 +917,9 @@ declare class VioFacade {
717
917
  private commerceClients;
718
918
  private bootstrapPromise;
719
919
  private cachedBootstrap;
920
+ /** Last bootstrap failure — short backoff so cart mutations don't hammer a
921
+ * dead endpoint on every call. */
922
+ private bootstrapFailedAt;
720
923
  private cartManager;
721
924
  private checkoutManager;
722
925
  init(config: VioConfig): void;
@@ -745,4 +948,103 @@ declare class VioFacade {
745
948
  }
746
949
  declare const Vio: VioFacade;
747
950
 
748
- export { type AddManualOptions, type AddProductOptions, type ApplePayConfig, type ApplePayResult, type BootstrapResponse, type CartChangeDetail, type CartLineItem, CartManager, type CheckoutAddress, type CheckoutChangeDetail, CheckoutManager, type CheckoutState, CommerceClient, Configuration, type Environment, type ImageSize, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type ResolvedConfig, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, Vio, VioApi, VioApiError, type VioConfig, checkApplePayAvailability, createCommerceClient, createVioApi, displayPrice, formatPrice, primaryImageUrl, showApplePaySheet };
951
+ /**
952
+ * Vipps MobilePay Payment Adapter — GraphQL Integration & Types.
953
+ *
954
+ * Vipps payment integration uses 2 GraphQL operations:
955
+ *
956
+ * 1. `CreatePaymentVipps` mutation:
957
+ * Initiates a Vipps payment session for a checkout and returns `payment_url`.
958
+ *
959
+ * 2. `GetVippsStatus` query:
960
+ * Queries Vipps payment state directly for a checkout (`state`).
961
+ */
962
+
963
+ /**
964
+ * GraphQL mutation to create a Vipps payment session.
965
+ */
966
+ declare const CREATE_PAYMENT_VIPPS_MUTATION = "\nmutation CreatePaymentVipps($checkoutId: String!, $email: String!, $returnUrl: String!) {\n Payment {\n CreatePaymentVipps(checkout_id: $checkoutId, email: $email, return_url: $returnUrl) {\n payment_url\n }\n }\n}\n";
967
+ /**
968
+ * GraphQL query to fetch current Vipps payment status.
969
+ */
970
+ declare const GET_VIPPS_STATUS_QUERY = "\nquery GetVippsStatus($checkoutId: String!) {\n Payment {\n GetVippsStatus(checkout_id: $checkoutId) {\n state\n }\n }\n}\n";
971
+ interface CreatePaymentVippsVariables extends Record<string, unknown> {
972
+ checkoutId: string;
973
+ email: string;
974
+ returnUrl: string;
975
+ }
976
+ interface CreatePaymentVippsResponse {
977
+ payment_url: string;
978
+ }
979
+ interface GetVippsStatusVariables extends Record<string, unknown> {
980
+ checkoutId: string;
981
+ }
982
+ interface VippsStatusResult {
983
+ state: string;
984
+ }
985
+ type VippsPaymentState = 'CREATED' | 'INITIATED' | 'AUTHORIZED' | 'TERMINATED' | 'EXPIRED' | string;
986
+ /**
987
+ * Executes the `CreatePaymentVipps` GraphQL mutation.
988
+ */
989
+ declare function createPaymentVipps(variables: CreatePaymentVippsVariables | Record<string, unknown>, options?: CartQueryOptions): Promise<CreatePaymentVippsResponse | null>;
990
+ /**
991
+ * Executes the `GetVippsStatus` GraphQL query.
992
+ */
993
+ declare function getVippsStatus(variables: GetVippsStatusVariables | Record<string, unknown>, options?: CartQueryOptions): Promise<VippsStatusResult | null>;
994
+
995
+ declare const CREATE_CART_MUTATION = "\nmutation CreateCart($customerSessionId: String!, $currency: String!, $shippingCountry: String) {\n Cart {\n CreateCart(customer_session_id: $customerSessionId, currency: $currency, shipping_country: $shippingCountry) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
996
+ declare const ADD_ITEM_MUTATION = "\nmutation AddItem($cartId: String!, $lineItems: [LineItemInput!]!) {\n Cart {\n AddItem(cart_id: $cartId, line_items: $lineItems) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
997
+ declare const DELETE_ITEM_MUTATION = "\nmutation DeleteItem($cartId: String!, $cartItemId: String!) {\n Cart {\n DeleteItem(cart_id: $cartId, cart_item_id: $cartItemId) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
998
+ declare const UPDATE_ITEM_MUTATION = "\nmutation UpdateItem($cartId: String!, $cartItemId: String!, $shippingId: String, $qty: Int) {\n Cart {\n UpdateItem(cart_id: $cartId, cart_item_id: $cartItemId, shipping_id: $shippingId, qty: $qty) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
999
+ declare const GET_CART_QUERY = "\nquery GetCart($cartId: String!) {\n Cart {\n GetCart(cart_id: $cartId) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
1000
+ declare const GET_LINE_ITEMS_BY_SUPPLIER_QUERY = "\nquery GetLineItemsBySupplier($cartId: String!) {\n Cart {\n GetLineItemsBySupplier(cart_id: $cartId) {\n supplier {\n id\n name\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n }\n }\n}\n";
1001
+ declare const UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION = "\nmutation UpdateShippingsBySupplier($cartId: String!, $data: [DataUpdateShippingsBySupplier!]!) {\n Cart {\n UpdateShippingsBySupplier(cart_id: $cartId, data: $data) {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n }\n}\n";
1002
+ declare const CREATE_CHECKOUT_MUTATION = "\nmutation CreateCheckout($cartId: String!) {\n Checkout {\n CreateCheckout(cart_id: $cartId) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
1003
+ declare const UPDATE_CHECKOUT_MUTATION = "\nmutation UpdateCheckout($checkoutId: String!, $status: String, $successUrl: String, $email: String, $cancelUrl: String, $paymentMethod: String, $shippingAddress: AddressArgs, $billingAddress: AddressArgs, $buyerAcceptsPurchaseConditions: Boolean, $buyerAcceptsTermsConditions: Boolean) {\n Checkout {\n UpdateCheckout(checkout_id: $checkoutId, status: $status, success_url: $successUrl, email: $email, cancel_url: $cancelUrl, payment_method: $paymentMethod, shipping_address: $shippingAddress, billing_address: $billingAddress, buyer_accepts_purchase_conditions: $buyerAcceptsPurchaseConditions, buyer_accepts_terms_conditions: $buyerAcceptsTermsConditions) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
1004
+ declare const GET_CHECKOUT_QUERY = "\nquery GetCheckout($checkoutId: String!) {\n Checkout {\n GetCheckout(checkout_id: $checkoutId) {\n buyer_accepts_purchase_conditions\n buyer_accepts_terms_conditions\n created_at\n updated_at\n id\n deleted_at\n success_url\n cancel_url\n payment_method\n email\n status\n checkout_url\n origin_payment_id\n billing_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n shipping_address {\n id\n first_name\n last_name\n phone_code\n phone\n company\n address1\n address2\n city\n province\n province_code\n country\n country_code\n zip\n }\n available_payment_methods {\n name\n }\n discount_code\n cart {\n cart_id\n customer_session_id\n shipping_country\n line_items {\n id\n supplier\n image {\n id\n url\n width\n height\n }\n sku\n barcode\n brand\n product_id\n title\n variant_id\n variant_title\n variant {\n option\n value\n }\n quantity\n price {\n amount\n currency_code\n discount\n compare_at\n compare_at_incl_taxes\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n shipping {\n id\n name\n description\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n available_shippings {\n id\n name\n description\n country_code\n price {\n amount\n currency_code\n amount_incl_taxes\n tax_amount\n tax_rate\n }\n }\n }\n subtotal\n shipping\n currency\n available_shipping_countries\n }\n totals {\n currency_code\n subtotal\n shipping\n total\n taxes\n tax_rate\n discounts\n }\n }\n }\n}\n";
1005
+ declare const GET_AVAILABLE_PAYMENT_METHODS_QUERY = "\nquery Config {\n Payment {\n GetAvailablePaymentMethods {\n config {\n name\n type\n value\n }\n name\n }\n }\n}\n";
1006
+ /** Transport options for a cart/checkout GraphQL call. */
1007
+ interface CartQueryOptions {
1008
+ endpoint?: string;
1009
+ apiKey?: string;
1010
+ /** Sponsor commerce key — goes in the Authorization header. */
1011
+ commerceKey?: string;
1012
+ /** True when the commerce key came from a resolved sponsor (bootstrap).
1013
+ * False = we fell back to the host apiKey — writes like CreateCart should
1014
+ * NOT proceed with the wrong key (the cart would be orphaned). */
1015
+ sponsorResolved?: boolean;
1016
+ }
1017
+ /**
1018
+ * Resolve endpoint + keys for cart GraphQL calls. Awaits Vio.bootstrap() once
1019
+ * if it hasn't run yet (the sponsor commerce keys come from bootstrap), then
1020
+ * uses the sponsor's commerce apiKey (via the Vio facade on globalThis,
1021
+ * avoiding an import cycle); falls back to the host apiKey.
1022
+ */
1023
+ declare function getCartGraphQLOptions(sponsorId?: number): Promise<CartQueryOptions>;
1024
+ /** Stable per-browser customer session id (backend CreateCart requires one). */
1025
+ declare function getCustomerSessionId(): string;
1026
+ interface GraphQLEnvelope {
1027
+ data?: Record<string, Record<string, unknown>>;
1028
+ errors?: Array<{
1029
+ message?: string;
1030
+ }>;
1031
+ }
1032
+ /** Execute a GraphQL query/mutation against the configured commerce endpoint.
1033
+ * Callers that skip `getCartGraphQLOptions()` (or pass a bare sponsorId) get
1034
+ * it resolved here instead of silently sending an unauthenticated request. */
1035
+ declare function executeCartGraphQL(query: string, variables: Record<string, unknown>, options?: CartQueryOptions | number | undefined): Promise<GraphQLEnvelope>;
1036
+ declare function createCart(customerSessionId: string, currency: string, shippingCountry?: string | null, options?: CartQueryOptions): Promise<any>;
1037
+ declare function addItem(cartId: string, lineItems: unknown[], options?: CartQueryOptions): Promise<any>;
1038
+ declare function deleteItem(cartId: string, cartItemId: string, options?: CartQueryOptions): Promise<any>;
1039
+ declare function updateItem(cartId: string, cartItemId: string, shippingId?: string | null, qty?: number | null, options?: CartQueryOptions): Promise<any>;
1040
+ declare function getCart(cartId: string, options?: CartQueryOptions): Promise<any>;
1041
+ declare function getLineItemsBySupplier(cartId: string, options?: CartQueryOptions): Promise<any>;
1042
+ declare function updateShippingsBySupplier(cartId: string, data: unknown[], options?: CartQueryOptions): Promise<any>;
1043
+ declare function createCheckout(cartId: string, options?: CartQueryOptions): Promise<any>;
1044
+ declare function updateCheckout(variables: Record<string, unknown>, options?: CartQueryOptions): Promise<any>;
1045
+ declare function getCheckout(checkoutId: string, options?: CartQueryOptions): Promise<any>;
1046
+ declare function getAvailablePaymentMethods(options?: CartQueryOptions): Promise<any>;
1047
+ declare const CREATE_PAYMENT_STRIPE_MUTATION = "\nmutation CreatePaymentStripe($checkoutId: String!, $successUrl: String!, $paymentMethod: String!, $email: String!) {\n Payment {\n CreatePaymentStripe(checkout_id: $checkoutId, success_url: $successUrl, payment_method: $paymentMethod, email: $email) {\n order_id\n checkout_url\n }\n }\n}\n";
1048
+ declare function createPaymentStripe(variables: Record<string, unknown>, options?: CartQueryOptions): Promise<any>;
1049
+
1050
+ export { ADD_ITEM_MUTATION, type AddManualOptions, type AddProductOptions, type ApplePayConfig, type ApplePayResult, type BootstrapResponse, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, type CartChangeDetail, type CartLineItem, CartManager, type CartQueryOptions, type CheckoutAddress, type CheckoutChangeDetail, CheckoutManager, type CheckoutState, CommerceClient, Configuration, type CreatePaymentVippsResponse, type CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, type Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, type GetVippsStatusVariables, type ImageSize, type PaymentCompleteDetail, type PaymentMethod, type PaymentSelectDetail, type PlacementComponent, type Product, type ProductCategory, type ProductImage, type ProductOption, type ProductPrice, type ProductVariant, type ResolvedConfig, type Sponsor, type SponsorCartState, type SponsorCommerceBlock, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, type VioConfig, type VippsPaymentState, type VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier };
@@ -1,4 +1,4 @@
1
- import '../chunk-GGM2AIK5.js';
2
- export { CartManager, CheckoutManager, CommerceClient, Configuration, Vio, VioApi, VioApiError, checkApplePayAvailability, createCommerceClient, createVioApi, displayPrice, formatPrice, primaryImageUrl, showApplePaySheet } from '../chunk-5SPY7TH6.js';
1
+ import '../chunk-PBQSHIID.js';
2
+ export { ADD_ITEM_MUTATION, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from '../chunk-NP2KCM7X.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
package/dist/index.d.ts CHANGED
@@ -1,5 +1,2 @@
1
- export { AddManualOptions, AddProductOptions, ApplePayConfig, ApplePayResult, BootstrapResponse, CartChangeDetail, CartLineItem, CartManager, CheckoutAddress, CheckoutChangeDetail, CheckoutManager, CheckoutState, CommerceClient, Configuration, Environment, ImageSize, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, ResolvedConfig, Sponsor, SponsorCartState, SponsorCommerceBlock, Vio, VioApi, VioApiError, VioConfig, checkApplePayAvailability, createCommerceClient, createVioApi, displayPrice, formatPrice, primaryImageUrl, showApplePaySheet } from './core/index.js';
2
- import './vio-checkout-D8B4Upk8.js';
1
+ export { ADD_ITEM_MUTATION, AddManualOptions, AddProductOptions, ApplePayConfig, ApplePayResult, BootstrapResponse, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartChangeDetail, CartLineItem, CartManager, CartQueryOptions, CheckoutAddress, CheckoutChangeDetail, CheckoutManager, CheckoutState, CommerceClient, Configuration, CreatePaymentVippsResponse, CreatePaymentVippsVariables, DELETE_ITEM_MUTATION, Environment, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, GetVippsStatusVariables, ImageSize, PaymentCompleteDetail, PaymentMethod, PaymentSelectDetail, PlacementComponent, Product, ProductCategory, ProductImage, ProductOption, ProductPrice, ProductVariant, ResolvedConfig, Sponsor, SponsorCartState, SponsorCommerceBlock, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, VioConfig, VippsPaymentState, VippsStatusResult, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './core/index.js';
3
2
  import 'graphql-request';
4
- import 'lit-html';
5
- import 'lit';
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
- import './chunk-GGM2AIK5.js';
2
- import './chunk-4CCGE7DE.js';
3
- export { CartManager, CheckoutManager, CommerceClient, Configuration, Vio, VioApi, VioApiError, checkApplePayAvailability, createCommerceClient, createVioApi, displayPrice, formatPrice, primaryImageUrl, showApplePaySheet } from './chunk-5SPY7TH6.js';
1
+ import './chunk-PBQSHIID.js';
2
+ export { ADD_ITEM_MUTATION, CREATE_CART_MUTATION, CREATE_CHECKOUT_MUTATION, CREATE_PAYMENT_STRIPE_MUTATION, CREATE_PAYMENT_VIPPS_MUTATION, CartManager, CheckoutManager, CommerceClient, Configuration, DELETE_ITEM_MUTATION, GET_AVAILABLE_PAYMENT_METHODS_QUERY, GET_CART_QUERY, GET_CHECKOUT_QUERY, GET_LINE_ITEMS_BY_SUPPLIER_QUERY, GET_VIPPS_STATUS_QUERY, UPDATE_CHECKOUT_MUTATION, UPDATE_ITEM_MUTATION, UPDATE_SHIPPINGS_BY_SUPPLIER_MUTATION, Vio, VioApi, VioApiError, addItem, checkApplePayAvailability, createCart, createCheckout, createCommerceClient, createPaymentStripe, createPaymentVipps, createVioApi, deleteItem, displayPrice, executeCartGraphQL, formatPrice, getAvailablePaymentMethods, getCart, getCartGraphQLOptions, getCheckout, getCustomerSessionId, getGlobalCurrency, getLineItemsBySupplier, getVippsStatus, primaryImageUrl, showApplePaySheet, updateCheckout, updateItem, updateShippingsBySupplier } from './chunk-NP2KCM7X.js';
4
3
  //# sourceMappingURL=index.js.map
5
4
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,23 @@
1
+ import * as _lit_react from '@lit/react';
2
+ import { V as VioCart$1, a as VioCheckout$1, b as VioProduct$1, c as VioProductCarousel$1, d as VioProductDetail$1 } from '../vio-checkout-T9R5hpDx.js';
3
+ import 'lit-html';
4
+ import 'lit';
5
+
6
+ declare const VioProduct: _lit_react.ReactWebComponent<VioProduct$1, {
7
+ onProductClick: string;
8
+ onProductAdd: string;
9
+ }>;
10
+ declare const VioProductCarousel: _lit_react.ReactWebComponent<VioProductCarousel$1, {}>;
11
+ declare const VioProductDetail: _lit_react.ReactWebComponent<VioProductDetail$1, {
12
+ onAddedToCart: string;
13
+ onCheckoutOpen: string;
14
+ }>;
15
+ declare const VioCart: _lit_react.ReactWebComponent<VioCart$1, {
16
+ onPaymentSuccess: string;
17
+ onCheckoutOpen: string;
18
+ }>;
19
+ declare const VioCheckout: _lit_react.ReactWebComponent<VioCheckout$1, {
20
+ onPaymentSuccess: string;
21
+ }>;
22
+
23
+ export { VioCart, VioCheckout, VioProduct, VioProductCarousel, VioProductDetail };
@@ -0,0 +1,74 @@
1
+ import { registerVioElements, VioProduct, VioProductCarousel, VioProductDetail, VioCart, VioCheckout } from '../chunk-NWORYWIL.js';
2
+ import '../chunk-NP2KCM7X.js';
3
+ import * as React from 'react';
4
+
5
+ // node_modules/@lit/react/node/create-component.js
6
+ var e = /* @__PURE__ */ new Set(["children", "localName", "ref", "style", "className"]);
7
+ var t = ({ react: t2, tagName: n, elementClass: l, events: a, displayName: c }) => {
8
+ const s = new Set(Object.keys(a ?? {})), o = t2.forwardRef(((a2, c2) => {
9
+ t2.useRef(/* @__PURE__ */ new Map());
10
+ const o2 = t2.useRef(null), r = {}, m = {};
11
+ for (const [t3, n2] of Object.entries(a2)) e.has(t3) ? r["className" === t3 ? "class" : t3] = n2 : s.has(t3) || t3 in l.prototype ? m[t3] = n2 : r[t3] = n2;
12
+ return ("litPatchedCreateElement" === t2.createElement.name || globalThis.litSsrReactEnabled) && Object.keys(m).length && (r._$litProps$ = m), t2.createElement(n, { ...r, ref: t2.useCallback(((e2) => {
13
+ o2.current = e2, "function" == typeof c2 ? c2(e2) : null !== c2 && (c2.current = e2);
14
+ }), [c2]) });
15
+ }));
16
+ return o.displayName = c ?? l.name, o;
17
+ };
18
+
19
+ // src/react/index.ts
20
+ registerVioElements();
21
+ var VioProduct2 = t({
22
+ react: React,
23
+ tagName: "vio-product",
24
+ elementClass: VioProduct,
25
+ events: {
26
+ onProductClick: "vio:product-click",
27
+ onProductAdd: "vio:product-add"
28
+ }
29
+ });
30
+ var VioProductCarousel2 = t({
31
+ react: React,
32
+ tagName: "vio-product-carousel",
33
+ elementClass: VioProductCarousel,
34
+ events: {}
35
+ });
36
+ var VioProductDetail2 = t({
37
+ react: React,
38
+ tagName: "vio-product-detail",
39
+ elementClass: VioProductDetail,
40
+ events: {
41
+ onAddedToCart: "vio:added-to-cart",
42
+ onCheckoutOpen: "vio:checkout-open"
43
+ }
44
+ });
45
+ var VioCart2 = t({
46
+ react: React,
47
+ tagName: "vio-cart",
48
+ elementClass: VioCart,
49
+ events: {
50
+ onPaymentSuccess: "vio:payment-success",
51
+ onCheckoutOpen: "vio:checkout-open"
52
+ }
53
+ });
54
+ var VioCheckout2 = t({
55
+ react: React,
56
+ tagName: "vio-checkout",
57
+ elementClass: VioCheckout,
58
+ events: {
59
+ onPaymentSuccess: "vio:payment-success"
60
+ }
61
+ });
62
+ /*! Bundled license information:
63
+
64
+ @lit/react/node/create-component.js:
65
+ (**
66
+ * @license
67
+ * Copyright 2018 Google LLC
68
+ * SPDX-License-Identifier: BSD-3-Clause
69
+ *)
70
+ */
71
+
72
+ export { VioCart2 as VioCart, VioCheckout2 as VioCheckout, VioProduct2 as VioProduct, VioProductCarousel2 as VioProductCarousel, VioProductDetail2 as VioProductDetail };
73
+ //# sourceMappingURL=index.js.map
74
+ //# sourceMappingURL=index.js.map