bitsnap-react 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/README.md +40 -3
  2. package/dist/CartProvider-F7ER3WSS.js +2 -0
  3. package/dist/CartProvider-F7ER3WSS.js.map +1 -0
  4. package/dist/CartProvider-N73XNL7S.mjs +2 -0
  5. package/dist/analytics.js +1 -1
  6. package/dist/analytics.js.map +1 -1
  7. package/dist/analytics.mjs +1 -1
  8. package/dist/catalog.js +1 -1
  9. package/dist/catalog.js.map +1 -1
  10. package/dist/catalog.mjs +1 -1
  11. package/dist/{chunk-ICFYSZTV.js → chunk-3A4YOO7Z.js} +2 -2
  12. package/dist/chunk-3A4YOO7Z.js.map +1 -0
  13. package/dist/{chunk-UCESDAEC.mjs → chunk-3DGHF373.mjs} +2 -2
  14. package/dist/chunk-5GMWRCHK.mjs +4 -0
  15. package/dist/chunk-5GMWRCHK.mjs.map +1 -0
  16. package/dist/{chunk-MLSKHOA3.js → chunk-6CUCRTIK.js} +2 -2
  17. package/dist/chunk-6CUCRTIK.js.map +1 -0
  18. package/dist/{chunk-DGUIG334.js → chunk-EWLOGFF2.js} +2 -2
  19. package/dist/chunk-EWLOGFF2.js.map +1 -0
  20. package/dist/chunk-GAVLY6RX.mjs +2 -0
  21. package/dist/chunk-GAVLY6RX.mjs.map +1 -0
  22. package/dist/{chunk-XTIY6PXH.js → chunk-IP4OOWZ6.js} +2 -2
  23. package/dist/chunk-IP4OOWZ6.js.map +1 -0
  24. package/dist/chunk-JSDGZ4NY.js.map +1 -1
  25. package/dist/{chunk-3QG7H2AI.mjs → chunk-K2EITRNW.mjs} +2 -2
  26. package/dist/{chunk-5R3WR22A.mjs → chunk-KH7DFTJY.mjs} +2 -2
  27. package/dist/chunk-KOYBZORL.js.map +1 -1
  28. package/dist/{chunk-E5DCEFI2.mjs → chunk-L6J6H73J.mjs} +2 -2
  29. package/dist/chunk-M4KEUK6I.js +2 -0
  30. package/dist/chunk-M4KEUK6I.js.map +1 -0
  31. package/dist/{chunk-QSIKRVZL.mjs → chunk-OC7YS3UY.mjs} +2 -2
  32. package/dist/chunk-TMBC2BHN.js +4 -0
  33. package/dist/chunk-TMBC2BHN.js.map +1 -0
  34. package/dist/{chunk-DF2IK2GN.js → chunk-TSJCVFOX.js} +2 -2
  35. package/dist/chunk-TSJCVFOX.js.map +1 -0
  36. package/dist/{chunk-6IACFTJR.js → chunk-UFQVOGBS.js} +2 -2
  37. package/dist/chunk-UFQVOGBS.js.map +1 -0
  38. package/dist/chunk-XIHGWNTS.js.map +1 -1
  39. package/dist/{chunk-FF2ICGFQ.mjs → chunk-YNGXQJPE.mjs} +2 -2
  40. package/dist/{chunk-FF2ICGFQ.mjs.map → chunk-YNGXQJPE.mjs.map} +1 -1
  41. package/dist/consent.js.map +1 -1
  42. package/dist/course.js +1 -1
  43. package/dist/course.js.map +1 -1
  44. package/dist/course.mjs +1 -1
  45. package/dist/embed/analytics.js +1 -1
  46. package/dist/errors.js.map +1 -1
  47. package/dist/index.css +1 -1
  48. package/dist/index.css.map +1 -1
  49. package/dist/index.d.mts +59 -2
  50. package/dist/index.d.ts +59 -2
  51. package/dist/index.js +1 -1
  52. package/dist/index.js.map +1 -1
  53. package/dist/index.mjs +1 -1
  54. package/dist/index.mjs.map +1 -1
  55. package/dist/internal.js.map +1 -1
  56. package/dist/methods-ADH5XI4I.js +2 -0
  57. package/dist/methods-ADH5XI4I.js.map +1 -0
  58. package/dist/methods-BCR54EWX.mjs +2 -0
  59. package/dist/models.js.map +1 -1
  60. package/dist/returns.js +1 -1
  61. package/dist/returns.js.map +1 -1
  62. package/dist/returns.mjs +1 -1
  63. package/package.json +26 -51
  64. package/dist/CartProvider-XNFSUOCB.js +0 -2
  65. package/dist/CartProvider-XNFSUOCB.js.map +0 -1
  66. package/dist/CartProvider-YMJ7RFO4.mjs +0 -2
  67. package/dist/chunk-4BW6J7FP.js +0 -4
  68. package/dist/chunk-4BW6J7FP.js.map +0 -1
  69. package/dist/chunk-6IACFTJR.js.map +0 -1
  70. package/dist/chunk-DF2IK2GN.js.map +0 -1
  71. package/dist/chunk-DGUIG334.js.map +0 -1
  72. package/dist/chunk-ERL4Z7M7.js +0 -2
  73. package/dist/chunk-ERL4Z7M7.js.map +0 -1
  74. package/dist/chunk-ICFYSZTV.js.map +0 -1
  75. package/dist/chunk-MLSKHOA3.js.map +0 -1
  76. package/dist/chunk-P4Q5KXKS.mjs +0 -2
  77. package/dist/chunk-P4Q5KXKS.mjs.map +0 -1
  78. package/dist/chunk-PNTO3L2C.mjs +0 -4
  79. package/dist/chunk-PNTO3L2C.mjs.map +0 -1
  80. package/dist/chunk-XTIY6PXH.js.map +0 -1
  81. package/dist/methods-DDGOXLP6.mjs +0 -2
  82. package/dist/methods-RQPDIUUN.js +0 -2
  83. package/dist/methods-RQPDIUUN.js.map +0 -1
  84. /package/dist/{CartProvider-YMJ7RFO4.mjs.map → CartProvider-N73XNL7S.mjs.map} +0 -0
  85. /package/dist/{chunk-UCESDAEC.mjs.map → chunk-3DGHF373.mjs.map} +0 -0
  86. /package/dist/{chunk-3QG7H2AI.mjs.map → chunk-K2EITRNW.mjs.map} +0 -0
  87. /package/dist/{chunk-5R3WR22A.mjs.map → chunk-KH7DFTJY.mjs.map} +0 -0
  88. /package/dist/{chunk-E5DCEFI2.mjs.map → chunk-L6J6H73J.mjs.map} +0 -0
  89. /package/dist/{chunk-QSIKRVZL.mjs.map → chunk-OC7YS3UY.mjs.map} +0 -0
  90. /package/dist/{methods-DDGOXLP6.mjs.map → methods-BCR54EWX.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/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/web/bitsnap/bitsnap/bitsnap-react/dist/internal.js","sourcesContent":[null,""]}
1
+ {"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/cart-payment-method/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/cart-payment-method/dist/internal.js","sourcesContent":[null,""]}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTMBC2BHNjs = require('./chunk-TMBC2BHN.js');require('./chunk-6CUCRTIK.js');require('./chunk-KOYBZORL.js');require('./chunk-EWLOGFF2.js');require('./chunk-UFQVOGBS.js');require('./chunk-M4KEUK6I.js');require('./chunk-TSJCVFOX.js');require('./chunk-XIHGWNTS.js');require('./chunk-JSDGZ4NY.js');exports.Bitsnap = _chunkTMBC2BHNjs.B; exports.createCheckout = _chunkTMBC2BHNjs.E; exports.createPaymentURL = _chunkTMBC2BHNjs.D; exports.getPaymentMethodChoice = _chunkTMBC2BHNjs.C; exports.getReferenceIfPossible = _chunkTMBC2BHNjs.F; exports.injectReferenceToRequestIfNeeded = _chunkTMBC2BHNjs.G;
2
+ //# sourceMappingURL=methods-ADH5XI4I.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/cart-payment-method/dist/methods-ADH5XI4I.js"],"names":[],"mappings":"AAAA,+HAA0E,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,0SAA6J","file":"/home/emems/.t3/worktrees/bitsnap-react/cart-payment-method/dist/methods-ADH5XI4I.js"}
@@ -0,0 +1,2 @@
1
+ import{B as a,C as b,D as c,E as d,F as e,G as f}from"./chunk-5GMWRCHK.mjs";import"./chunk-KH7DFTJY.mjs";import"./chunk-KOVKUJAW.mjs";import"./chunk-K2EITRNW.mjs";import"./chunk-3DGHF373.mjs";import"./chunk-GAVLY6RX.mjs";import"./chunk-YNGXQJPE.mjs";import"./chunk-ADYVTMGH.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-BCR54EWX.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/models.js","../src/models.ts"],"names":["BitsnapModels"],"mappings":"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","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/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 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/cart-payment-method/dist/models.js","../src/models.ts"],"names":["BitsnapModels"],"mappings":"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","file":"/home/emems/.t3/worktrees/bitsnap-react/cart-payment-method/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 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 _chunkICFYSZTVjs = require('./chunk-ICFYSZTV.js');var _chunkMLSKHOA3js = require('./chunk-MLSKHOA3.js');require('./chunk-KOYBZORL.js');var _chunk6IACFTJRjs = require('./chunk-6IACFTJR.js');require('./chunk-ERL4Z7M7.js');require('./chunk-DF2IK2GN.js');require('./chunk-XIHGWNTS.js');require('./chunk-JSDGZ4NY.js');exports.BitsnapReturns = _chunkICFYSZTVjs.a; exports.BitsnapReturnsProvider = _chunkMLSKHOA3js.l; exports.Environment = _chunk6IACFTJRjs.h; exports.RETURNS_SLOT_NAMES = _chunkMLSKHOA3js.c; exports.ReturnsAppearanceProvider = _chunkMLSKHOA3js.d; exports.ReturnsCodeStep = _chunkMLSKHOA3js.u; exports.ReturnsConfirmation = _chunkMLSKHOA3js.x; exports.ReturnsEmailStep = _chunkMLSKHOA3js.t; exports.ReturnsMyReturnDetail = _chunkMLSKHOA3js.A; exports.ReturnsMyReturnsList = _chunkMLSKHOA3js.z; exports.ReturnsOrderDetail = _chunkMLSKHOA3js.w; exports.ReturnsOrderList = _chunkMLSKHOA3js.v; exports.ReturnsProvider = _chunkMLSKHOA3js.k; exports.ReturnsResult = _chunkMLSKHOA3js.y; exports.useCreateReturn = _chunkMLSKHOA3js.p; exports.useMyReturn = _chunkMLSKHOA3js.r; exports.useMyReturns = _chunkMLSKHOA3js.q; exports.useReturnOrders = _chunkMLSKHOA3js.n; exports.useReturnSession = _chunkMLSKHOA3js.m; exports.useReturnableOrder = _chunkMLSKHOA3js.o; exports.useReturnsAppearance = _chunkMLSKHOA3js.e; exports.useReturnsSlot = _chunkMLSKHOA3js.f; exports.useReturnsText = _chunkMLSKHOA3js.i;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk3A4YOO7Zjs = require('./chunk-3A4YOO7Z.js');var _chunk6CUCRTIKjs = require('./chunk-6CUCRTIK.js');require('./chunk-KOYBZORL.js');var _chunkUFQVOGBSjs = require('./chunk-UFQVOGBS.js');require('./chunk-M4KEUK6I.js');require('./chunk-TSJCVFOX.js');require('./chunk-XIHGWNTS.js');require('./chunk-JSDGZ4NY.js');exports.BitsnapReturns = _chunk3A4YOO7Zjs.a; exports.BitsnapReturnsProvider = _chunk6CUCRTIKjs.l; exports.Environment = _chunkUFQVOGBSjs.h; exports.RETURNS_SLOT_NAMES = _chunk6CUCRTIKjs.c; exports.ReturnsAppearanceProvider = _chunk6CUCRTIKjs.d; exports.ReturnsCodeStep = _chunk6CUCRTIKjs.u; exports.ReturnsConfirmation = _chunk6CUCRTIKjs.x; exports.ReturnsEmailStep = _chunk6CUCRTIKjs.t; exports.ReturnsMyReturnDetail = _chunk6CUCRTIKjs.A; exports.ReturnsMyReturnsList = _chunk6CUCRTIKjs.z; exports.ReturnsOrderDetail = _chunk6CUCRTIKjs.w; exports.ReturnsOrderList = _chunk6CUCRTIKjs.v; exports.ReturnsProvider = _chunk6CUCRTIKjs.k; exports.ReturnsResult = _chunk6CUCRTIKjs.y; exports.useCreateReturn = _chunk6CUCRTIKjs.p; exports.useMyReturn = _chunk6CUCRTIKjs.r; exports.useMyReturns = _chunk6CUCRTIKjs.q; exports.useReturnOrders = _chunk6CUCRTIKjs.n; exports.useReturnSession = _chunk6CUCRTIKjs.m; exports.useReturnableOrder = _chunk6CUCRTIKjs.o; exports.useReturnsAppearance = _chunk6CUCRTIKjs.e; exports.useReturnsSlot = _chunk6CUCRTIKjs.f; exports.useReturnsText = _chunk6CUCRTIKjs.i;
2
2
  //# sourceMappingURL=returns.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/returns.js"],"names":[],"mappings":"AAAA,+HAAuC,sDAAoL,+BAA4B,sDAAwC,+BAA4B,+BAA4B,+BAA4B,+BAA4B,kkCAA4gB","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/returns.js"}
1
+ {"version":3,"sources":["/home/emems/.t3/worktrees/bitsnap-react/cart-payment-method/dist/returns.js"],"names":[],"mappings":"AAAA,+HAAuC,sDAAoL,+BAA4B,sDAAwC,+BAA4B,+BAA4B,+BAA4B,+BAA4B,kkCAA4gB","file":"/home/emems/.t3/worktrees/bitsnap-react/cart-payment-method/dist/returns.js"}
package/dist/returns.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{a as L}from"./chunk-E5DCEFI2.mjs";import{A as C,c as t,d as r,e as s,f as n,i as p,k as u,l as R,m as o,n as y,o as a,p as i,q as m,r as l,t as x,u as d,v as P,w as f,x as S,y as c,z as T}from"./chunk-5R3WR22A.mjs";import"./chunk-KOVKUJAW.mjs";import{h as e}from"./chunk-UCESDAEC.mjs";import"./chunk-P4Q5KXKS.mjs";import"./chunk-FF2ICGFQ.mjs";import"./chunk-ADYVTMGH.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};
1
+ import{a as L}from"./chunk-L6J6H73J.mjs";import{A as C,c as t,d as r,e as s,f as n,i as p,k as u,l as R,m as o,n as y,o as a,p as i,q as m,r as l,t as x,u as d,v as P,w as f,x as S,y as c,z as T}from"./chunk-KH7DFTJY.mjs";import"./chunk-KOVKUJAW.mjs";import{h as e}from"./chunk-3DGHF373.mjs";import"./chunk-GAVLY6RX.mjs";import"./chunk-YNGXQJPE.mjs";import"./chunk-ADYVTMGH.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/package.json CHANGED
@@ -1,31 +1,35 @@
1
1
  {
2
2
  "name": "bitsnap-react",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "This is Bitsnap React library for easy integration with any website which is using React framework",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
7
7
  "type": "commonjs",
8
+ "scripts": {
9
+ "build": "node scripts/write-version.mjs && tsup",
10
+ "test:returns-ssr": "pnpm build && node --test test/returns-widget.ssr.test.cjs",
11
+ "test:catalog-ssr": "pnpm build && node --test test/catalog.ssr.test.cjs",
12
+ "test:course-ssr": "pnpm build && node --test test/course.ssr.test.cjs",
13
+ "build:publish": "pnpm build --env.publish",
14
+ "clean": "rimraf ./dist",
15
+ "dev": "node scripts/write-version.mjs && tsup --watch",
16
+ "dev:publish": "pnpm dev --env.publish",
17
+ "test": "tsup src/components/checkout/appearance.test.ts src/components/checkout/texts.test.ts src/components/checkout/buy-error.test.ts src/components/checkout/cart-buy-error.test.tsx src/lib/appearance-core.test.ts src/lib/texts.test.ts src/components/returns/appearance.test.ts src/components/returns/texts.test.ts src/components/returns/errors.test.ts src/components/returns/money.test.ts src/components/returns/session-storage.test.ts src/components/returns/state-machine.test.ts src/components/returns/selection.test.ts src/components/returns/legacy.test.ts src/panel/returns-appearance.test.ts src/components/products/appearance.test.ts src/components/products/texts.test.ts src/components/products/format.test.ts src/components/products/fetch.test.ts src/components/products/useProducts.test.ts src/components/products/cart-target.test.ts src/components/checkout/cart-items.test.ts src/components/checkout/pending-order.test.ts src/components/checkout/quantity.test.ts src/components/checkout/cart-a11y.test.tsx src/components/checkout/payment-method.test.ts src/components/checkout/cart-payment-method.test.tsx src/course/logic.test.ts src/course/accent.test.ts src/course/texts.test.ts src/course/datasource.test.ts src/course/sanitize.test.ts src/course/VideoPlayer.test.tsx src/course/PanelCourse.test.tsx src/consent/core/cookie.test.ts src/consent/core/texts.test.ts src/consent/core/activate.test.ts src/consent/core/gcm.test.ts src/consent/core/contrast.test.ts src/consent/core/controller.test.ts src/consent/embed.test.ts src/consent/react.test.tsx src/analytics/core.test.ts src/analytics/embed.test.ts src/analytics/instrument.test.tsx src/analytics/page-views.test.tsx src/analytics/visitor.test.ts src/components/checkout/visitor-header.test.ts src/components/products/impressions.test.ts src/components/products/ProductList.analytics.test.tsx src/components/checkout/cart-analytics.test.tsx src/components/checkout/apple-pay-analytics.test.tsx src/components/notifications/notifications-analytics.test.tsx src/components/returns/returns-analytics.test.tsx src/panel/panel-analytics.test.tsx src/course/course-analytics.test.tsx --format esm --out-dir .test-dist --no-config --external jsdom --silent && node --test --test-force-exit \".test-dist/**/*.test.mjs\"",
18
+ "test:types": "tsc -p test/consumer/tsconfig.json",
19
+ "test:package": "node test/consumer/verify-package.mjs"
20
+ },
8
21
  "repository": {
9
22
  "type": "git",
10
23
  "url": "git+https://github.com/emmems/bitsnap-react.git"
11
24
  },
12
- "keywords": [
13
- "bitsnap",
14
- "checkout",
15
- "shop",
16
- "ecommerce"
17
- ],
25
+ "keywords": ["bitsnap", "checkout", "shop", "ecommerce"],
18
26
  "author": "Piotr Michalik",
19
27
  "license": "SEE LICENSE IN LICENSE file",
20
28
  "bugs": {
21
29
  "url": "https://github.com/emmems/bitsnap-react/issues"
22
30
  },
23
- "sideEffects": [
24
- "*.css"
25
- ],
26
- "files": [
27
- "dist"
28
- ],
31
+ "sideEffects": ["*.css"],
32
+ "files": ["dist"],
29
33
  "types": "./dist/index.d.ts",
30
34
  "homepage": "https://github.com/emmems/bitsnap-react#readme",
31
35
  "devDependencies": {
@@ -188,43 +192,14 @@
188
192
  },
189
193
  "typesVersions": {
190
194
  "*": {
191
- "models": [
192
- "./dist/models.d.ts"
193
- ],
194
- "internal": [
195
- "./dist/internal.d.ts"
196
- ],
197
- "errors": [
198
- "./dist/errors.d.ts"
199
- ],
200
- "returns": [
201
- "./dist/returns.d.ts"
202
- ],
203
- "catalog": [
204
- "./dist/catalog.d.ts"
205
- ],
206
- "course": [
207
- "./dist/course.d.ts"
208
- ],
209
- "consent": [
210
- "./dist/consent.d.ts"
211
- ],
212
- "analytics": [
213
- "./dist/analytics.d.ts"
214
- ]
195
+ "models": ["./dist/models.d.ts"],
196
+ "internal": ["./dist/internal.d.ts"],
197
+ "errors": ["./dist/errors.d.ts"],
198
+ "returns": ["./dist/returns.d.ts"],
199
+ "catalog": ["./dist/catalog.d.ts"],
200
+ "course": ["./dist/course.d.ts"],
201
+ "consent": ["./dist/consent.d.ts"],
202
+ "analytics": ["./dist/analytics.d.ts"]
215
203
  }
216
- },
217
- "scripts": {
218
- "build": "node scripts/write-version.mjs && tsup",
219
- "test:returns-ssr": "pnpm build && node --test test/returns-widget.ssr.test.cjs",
220
- "test:catalog-ssr": "pnpm build && node --test test/catalog.ssr.test.cjs",
221
- "test:course-ssr": "pnpm build && node --test test/course.ssr.test.cjs",
222
- "build:publish": "pnpm build --env.publish",
223
- "clean": "rimraf ./dist",
224
- "dev": "node scripts/write-version.mjs && tsup --watch",
225
- "dev:publish": "pnpm dev --env.publish",
226
- "test": "tsup src/components/checkout/appearance.test.ts src/components/checkout/texts.test.ts src/components/checkout/buy-error.test.ts src/components/checkout/cart-buy-error.test.tsx src/lib/appearance-core.test.ts src/lib/texts.test.ts src/components/returns/appearance.test.ts src/components/returns/texts.test.ts src/components/returns/errors.test.ts src/components/returns/money.test.ts src/components/returns/session-storage.test.ts src/components/returns/state-machine.test.ts src/components/returns/selection.test.ts src/components/returns/legacy.test.ts src/panel/returns-appearance.test.ts src/components/products/appearance.test.ts src/components/products/texts.test.ts src/components/products/format.test.ts src/components/products/fetch.test.ts src/components/products/useProducts.test.ts src/components/products/cart-target.test.ts src/components/checkout/cart-items.test.ts src/components/checkout/pending-order.test.ts src/components/checkout/quantity.test.ts src/components/checkout/cart-a11y.test.tsx src/course/logic.test.ts src/course/accent.test.ts src/course/texts.test.ts src/course/datasource.test.ts src/course/sanitize.test.ts src/course/VideoPlayer.test.tsx src/course/PanelCourse.test.tsx src/consent/core/cookie.test.ts src/consent/core/texts.test.ts src/consent/core/activate.test.ts src/consent/core/gcm.test.ts src/consent/core/contrast.test.ts src/consent/core/controller.test.ts src/consent/embed.test.ts src/consent/react.test.tsx src/analytics/core.test.ts src/analytics/embed.test.ts src/analytics/instrument.test.tsx src/analytics/page-views.test.tsx src/analytics/visitor.test.ts src/components/checkout/visitor-header.test.ts src/components/products/impressions.test.ts src/components/products/ProductList.analytics.test.tsx src/components/checkout/cart-analytics.test.tsx src/components/checkout/apple-pay-analytics.test.tsx src/components/notifications/notifications-analytics.test.tsx src/components/returns/returns-analytics.test.tsx src/panel/panel-analytics.test.tsx src/course/course-analytics.test.tsx --format esm --out-dir .test-dist --no-config --external jsdom --silent && node --test --test-force-exit \".test-dist/**/*.test.mjs\"",
227
- "test:types": "tsc -p test/consumer/tsconfig.json",
228
- "test:package": "node test/consumer/verify-package.mjs"
229
204
  }
230
- }
205
+ }
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk4BW6J7FPjs = require('./chunk-4BW6J7FP.js');require('./chunk-MLSKHOA3.js');require('./chunk-KOYBZORL.js');require('./chunk-DGUIG334.js');require('./chunk-6IACFTJR.js');var _chunkERL4Z7M7js = require('./chunk-ERL4Z7M7.js');require('./chunk-DF2IK2GN.js');require('./chunk-XIHGWNTS.js');require('./chunk-JSDGZ4NY.js');exports.MARKETING_AGREEMENT_ID = _chunk4BW6J7FPjs.H; exports.bitsnapProjectID = _chunk4BW6J7FPjs.I; exports.default = _chunk4BW6J7FPjs.P; exports.getCartLines = _chunk4BW6J7FPjs.M; exports.getCheckoutMethods = _chunk4BW6J7FPjs.Q; exports.getCheckoutSelection = _chunk4BW6J7FPjs.L; exports.getLocale = _chunkERL4Z7M7js.m; exports.getProjectID = _chunk4BW6J7FPjs.K; exports.reconcileOrderOfLastPayment = _chunk4BW6J7FPjs.N; exports.setLocale = _chunkERL4Z7M7js.l; exports.setProjectID = _chunk4BW6J7FPjs.J; exports.useCartProvider = _chunk4BW6J7FPjs.O;
2
- //# sourceMappingURL=CartProvider-XNFSUOCB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/CartProvider-XNFSUOCB.js"],"names":[],"mappings":"AAAA,+HAAsG,+BAA4B,+BAA4B,+BAA4B,+BAA4B,sDAA+C,+BAA4B,+BAA4B,+BAA4B,siBAAmQ","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/CartProvider-XNFSUOCB.js"}
@@ -1,2 +0,0 @@
1
- import{H as c,I as d,J as e,K as f,L as g,M as h,N as i,O as j,P as k,Q as l}from"./chunk-PNTO3L2C.mjs";import"./chunk-5R3WR22A.mjs";import"./chunk-KOVKUJAW.mjs";import"./chunk-3QG7H2AI.mjs";import"./chunk-UCESDAEC.mjs";import{l as a,m as b}from"./chunk-P4Q5KXKS.mjs";import"./chunk-FF2ICGFQ.mjs";import"./chunk-ADYVTMGH.mjs";import"./chunk-U6FLIRIV.mjs";export{c as MARKETING_AGREEMENT_ID,d as bitsnapProjectID,k as default,h as getCartLines,l as getCheckoutMethods,g as getCheckoutSelection,b as getLocale,f as getProjectID,i as reconcileOrderOfLastPayment,a as setLocale,e as setProjectID,j as useCartProvider};
2
- //# sourceMappingURL=CartProvider-YMJ7RFO4.mjs.map
@@ -1,4 +0,0 @@
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; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkMLSKHOA3js = require('./chunk-MLSKHOA3.js');var _chunkDGUIG334js = require('./chunk-DGUIG334.js');var _chunk6IACFTJRjs = require('./chunk-6IACFTJR.js');var _chunkERL4Z7M7js = require('./chunk-ERL4Z7M7.js');var _chunkDF2IK2GNjs = require('./chunk-DF2IK2GN.js');var _react = require('@formkit/auto-animate/react');var _react3 = require('react'); var En = _interopRequireWildcard(_react3); var ft = _interopRequireWildcard(_react3);var _jsxruntime = require('react/jsx-runtime');function ue({className:e,...t}){return _jsxruntime.jsx.call(void 0, "div",{"data-slot":"card",className:_chunkERL4Z7M7js.d.call(void 0, "bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function be({className:e,...t}){return _jsxruntime.jsx.call(void 0, "div",{"data-slot":"card-header",className:_chunkERL4Z7M7js.d.call(void 0, "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function ve({className:e,...t}){return _jsxruntime.jsx.call(void 0, "div",{"data-slot":"card-title",className:_chunkERL4Z7M7js.d.call(void 0, "leading-none font-semibold",e),...t})}function Ut({className:e,...t}){return _jsxruntime.jsx.call(void 0, "div",{"data-slot":"card-description",className:_chunkERL4Z7M7js.d.call(void 0, "text-muted-foreground text-sm",e),...t})}function me({className:e,...t}){return _jsxruntime.jsx.call(void 0, "div",{"data-slot":"card-content",className:_chunkERL4Z7M7js.d.call(void 0, "px-6",e),...t})}var _inputotp = require('input-otp');var _lucidereact = require('lucide-react');function On({className:e,containerClassName:t,...r}){return _jsxruntime.jsx.call(void 0, _inputotp.OTPInput,{"data-slot":"input-otp",containerClassName:_chunkERL4Z7M7js.d.call(void 0, "flex items-center gap-2 has-disabled:opacity-50",t),className:_chunkERL4Z7M7js.d.call(void 0, "disabled:cursor-not-allowed",e),...r})}function Mt({className:e,...t}){return _jsxruntime.jsx.call(void 0, "div",{"data-slot":"input-otp-group",className:_chunkERL4Z7M7js.d.call(void 0, "flex items-center",e),...t})}function Se({index:e,className:t,...r}){let o=En.useContext(_inputotp.OTPInputContext),{char:n,hasFakeCaret:a,isActive:i}=_nullishCoalesce(_optionalChain([o, 'optionalAccess', _2 => _2.slots, 'access', _3 => _3[e]]), () => ({}));return _jsxruntime.jsxs.call(void 0, "div",{"data-slot":"input-otp-slot","data-active":i,className:_chunkERL4Z7M7js.d.call(void 0, "data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",t),...r,children:[n,a&&_jsxruntime.jsx.call(void 0, "div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:_jsxruntime.jsx.call(void 0, "div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function Un({...e}){return _jsxruntime.jsx.call(void 0, "div",{"data-slot":"input-otp-separator",role:"separator",...e,children:_jsxruntime.jsx.call(void 0, _lucidereact.MinusIcon,{})})}function ta(){return _jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-2",children:[_jsxruntime.jsx.call(void 0, "div",{className:"h-3 w-3 animate-bounce rounded-full bg-current [animation-delay:-0.3s]"}),_jsxruntime.jsx.call(void 0, "div",{className:"h-3 w-3 animate-bounce rounded-full bg-current [animation-delay:-0.15s]"}),_jsxruntime.jsx.call(void 0, "div",{className:"h-3 w-3 animate-bounce rounded-full bg-current"})]})}var Z=ta;var ra="return_url",_t="__return_url",aa="accessToken";function Je(e){let t=new URLSearchParams(e).get(ra);return t?Mn(t):null}function Qe(e){typeof window>"u"||(e?window.sessionStorage.setItem(_t,e):window.sessionStorage.removeItem(_t))}function Ue(){if(typeof window>"u")return null;let e=window.sessionStorage.getItem(_t);return e?Mn(e):null}function oa(e,t){return t.some(r=>{if(e===r)return!0;let o=new URL(r).hostname,n=new URL(e).hostname;return n.endsWith(`.${o}`)||n===o})}function Mn(e){try{let t=new URL(e);return t.protocol!=="https:"&&t.protocol!=="http:"||!oa(t.origin,_chunkDGUIG334js.h.call(void 0, ))?null:t.toString()}catch (e2){return null}}function Me(e,t){let r=new URL(e);return r.searchParams.set(aa,t),r.toString()}if(typeof window<"u"){let t=[window.location.origin,"https://bitsnap.pl","https://kursy.bitsnap.pl"];_chunkDGUIG334js.h.call(void 0, ).length===0&&_chunkDGUIG334js.g.call(void 0, Array.from(new Set(t)))}var ca=({projectID:e,host:t,reveal:r,email:o,setEmail:n,loginUser:a,isLoginLoading:i,errMsg:c})=>{let{projectID:d,host:l}=_chunkDGUIG334js.j.call(void 0, );if(typeof window<"u"&&_chunkDGUIG334js.k.call(void 0, _nullishCoalesce(e, () => (d)),_nullishCoalesce(t, () => (l)))!=null)return window.location.href=window.location.href.replaceAll("login",""),null;let[u,g]=_react3.useState.call(void 0, !1),k=s=>/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(s.trim())?g(!0):g(!1),m=s=>{let{value:h}=s.target;k(h),n(h)};function v(){r()}function C(s){s.preventDefault(),a()}return _jsxruntime.jsx.call(void 0, "main",{className:"mx-auto flex max-w-sm flex-1 flex-col justify-center space-y-12",children:_jsxruntime.jsx.call(void 0, "div",{className:_chunkERL4Z7M7js.d.call(void 0, "flex min-w-sm flex-col gap-6"),children:_jsxruntime.jsxs.call(void 0, ue,{children:[_jsxruntime.jsxs.call(void 0, be,{children:[_jsxruntime.jsx.call(void 0, ve,{className:"text-2xl",children:"Zaloguj si\u0119"}),_jsxruntime.jsx.call(void 0, Ut,{children:"Wy\u015Blemy do Ciebie kod na maila, dzi\u0119ki kt\xF3remu si\u0119 zalogujesz."})]}),_jsxruntime.jsx.call(void 0, me,{children:_jsxruntime.jsxs.call(void 0, "form",{onSubmit:C,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-6",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"grid gap-2",children:[_jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.a,{htmlFor:"email",children:"Email"}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.r,{id:"email",onChange:m,type:"email",placeholder:"m@example.com",required:!0}),_jsxruntime.jsx.call(void 0, "span",{className:_chunkERL4Z7M7js.d.call(void 0, !u&&o.length>0?"font-bold text-red-500":"text-neutral-700 dark:text-neutral-400","text-xs"),children:!u&&o.length>0?"Nieprawid\u0142owy adres email":"Wpisz sw\xF3j adres email"})]}),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{type:"submit",disabled:i,className:"relative w-full",onClick:a,children:[i&&_jsxruntime.jsx.call(void 0, "div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:_jsxruntime.jsx.call(void 0, Z,{})}),"Zaloguj si\u0119"]}),c.length>0&&_jsxruntime.jsx.call(void 0, "p",{className:"text-xs font-medium text-red-500",children:c})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"mt-4 text-center text-sm",children:["Masz ju\u017C kod?"," ",_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:v,className:"underline underline-offset-4",children:"Mam ju\u017C kod"})]})]})})]})})})},da=({projectID:e,host:t,email:r,reveal:o,setEmail:n,isLoginLoading:a,loginUserResponse:i,setLoginUserResponse:c,setResponseStatus:d,errMsg:l})=>{let u=_chunkDF2IK2GNjs.m.call(void 0, ),{mutateAsync:g,isPending:k}=_chunk6IACFTJRjs.l.call(void 0, _chunk6IACFTJRjs.j.publicApi.userPanelLoginWithCode),[m,v]=_react3.useState.call(void 0, ""),[C,s]=_react3.useState.call(void 0, !1),[h,R]=_react3.useState.call(void 0, !1),[q,F]=_react3.useState.call(void 0, 0),A=U=>/^\d+$/.test(U.trim())?s(!0):s(!1),E=U=>{A(U),v(U)};async function z(){if(R(!0),m.length==0){s(!1);return}let U=parseInt(m),X=await g({code:U}),ye,Ce,re;if(X.result.case==="accessToken"?(s(!0),ye="ok",Ce=void 0,re=X.result.value):(s(!1),ye="error",Ce=X.result.value,re=void 0),ye==="error"&&(s(!1),console.warn("error:",`Kod b\u0142\u0119du: ${Ce}`),console.warn("Nieprawid\u0142owy kod, spr\xF3buj ponownie.")),ye==="ok"){u.track("panel_login",{}),re&&_chunkDGUIG334js.l.call(void 0, e,re,r,t);let P=typeof window<"u"?Ue():null;setTimeout(()=>{if(re&&P){window.location.href=Me(P,re);return}window.location.reload()},100)}}function D(){let U=setInterval(()=>{F(X=>X>0?X-1:(clearInterval(U),0))},1e3);return()=>{clearInterval(U)}}_react3.useEffect.call(void 0, ()=>{_optionalChain([i, 'optionalAccess', _4 => _4.status])==="ok"&&_optionalChain([i, 'optionalAccess', _5 => _5.retryIn])>0&&(F(i.retryIn),D())},[i]);function $(){n(""),c(null),d("default"),o()}function ge(U){U.preventDefault(),z()}return _jsxruntime.jsx.call(void 0, "main",{className:"mx-auto flex max-w-md flex-1 flex-col justify-center space-y-8",children:_jsxruntime.jsx.call(void 0, "div",{className:_chunkERL4Z7M7js.d.call(void 0, "flex min-w-sm flex-col gap-6"),children:_jsxruntime.jsxs.call(void 0, ue,{children:[_jsxruntime.jsxs.call(void 0, be,{children:[_jsxruntime.jsx.call(void 0, ve,{className:"text-2xl",children:"Wpisz kod z maila"}),_jsxruntime.jsx.call(void 0, Ut,{children:"Sprawd\u017A czy przypadkiem nie wyl\u0105dowa\u0142 w spamie."})]}),_jsxruntime.jsxs.call(void 0, me,{children:[_jsxruntime.jsxs.call(void 0, "form",{onSubmit:ge,className:"flex flex-col gap-6",children:[_jsxruntime.jsx.call(void 0, "div",{className:"grid gap-2",children:_jsxruntime.jsx.call(void 0, "div",{className:"my-5 flex w-full items-center justify-center",children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col gap-2",children:[_jsxruntime.jsxs.call(void 0, On,{id:"verify-code",maxLength:6,pattern:_inputotp.REGEXP_ONLY_DIGITS,onChange:U=>{E(U)},children:[_jsxruntime.jsxs.call(void 0, Mt,{children:[_jsxruntime.jsx.call(void 0, Se,{index:0}),_jsxruntime.jsx.call(void 0, Se,{index:1}),_jsxruntime.jsx.call(void 0, Se,{index:2})]}),_jsxruntime.jsx.call(void 0, Un,{}),_jsxruntime.jsxs.call(void 0, Mt,{children:[_jsxruntime.jsx.call(void 0, Se,{index:3}),_jsxruntime.jsx.call(void 0, Se,{index:4}),_jsxruntime.jsx.call(void 0, Se,{index:5})]})]}),_jsxruntime.jsx.call(void 0, "span",{className:_chunkERL4Z7M7js.d.call(void 0, !C&&h?"text-red-500":"text-neutral-700 dark:text-neutral-400","text-xs"),children:!C&&h?m.length==0?"Kod nie mo\u017Ce by\u0107 pusty":"Kod musi sk\u0142ada\u0107 si\u0119 z cyfr":"Wpisz kod z maila"})]})})}),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{type:"submit",disabled:a||k,className:"relative w-full",children:[(a||k)&&_jsxruntime.jsx.call(void 0, "div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",children:_jsxruntime.jsx.call(void 0, Z,{})}),"Zaloguj si\u0119"]}),l.length>0&&_jsxruntime.jsx.call(void 0, "p",{className:"text-xs font-medium text-red-500",children:l})]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"mt-4 text-center text-sm",children:["Nie masz kodu?"," ",_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:$,className:"underline underline-offset-4",children:"Wr\xF3\u0107"})]})]})]})})})},la=({analytics:e})=>{let{theme:t,allowedReturnOrigins:r,projectID:o,host:n}=_chunkDGUIG334js.j.call(void 0, ),a=_chunkDF2IK2GNjs.n.call(void 0, o,e,"panel"),i={"--button-background-color":_nullishCoalesce(_optionalChain([t, 'optionalAccess', _6 => _6.colors, 'optionalAccess', _7 => _7.brand]), () => ("#FFFFFF")),"--button-background-color-dark":_nullishCoalesce(_optionalChain([t, 'optionalAccess', _8 => _8.colors, 'optionalAccess', _9 => _9.brandDark]), () => ("#000000")),"--button-text-color":_nullishCoalesce(_optionalChain([t, 'optionalAccess', _10 => _10.colors, 'optionalAccess', _11 => _11.brandDark]), () => ("#000000")),"--button-text-color-dark":_nullishCoalesce(_optionalChain([t, 'optionalAccess', _12 => _12.colors, 'optionalAccess', _13 => _13.brand]), () => ("#FFFFFF"))},[c,d]=_react3.useState.call(void 0, "login"),[l]=_react.useAutoAnimate.call(void 0, {duration:300,easing:"ease-in-out",disrespectUserMotionPreference:!1}),u=()=>d(E=>E==="login"?"verifyCode":"login"),[g,k]=_react3.useState.call(void 0, ""),[m,v]=_react3.useState.call(void 0, "default"),[C,s]=_react3.useState.call(void 0, null),{mutateAsync:h,isPending:R}=_chunk6IACFTJRjs.l.call(void 0, _chunk6IACFTJRjs.j.publicApi.userPanelLogin),[q,F]=_react3.useState.call(void 0, "");_react3.useEffect.call(void 0, ()=>{if(typeof window>"u"||window.parent!==window)return;let E=Je(window.location.search);E&&Qe(E);let z=_nullishCoalesce(E, () => (Ue()));if(!z)return;let D=_chunkDGUIG334js.k.call(void 0, o,n);D&&(window.location.href=Me(z,D))},[r,o,n]);async function A(){F(""),v("default");let E=await h({email:g}),z=E.result.case==="success"?"ok":"error",D=0,$;E.result.case==="success"&&(D=E.result.value.retryIn),z==="error"&&($="Nieprawid\u0142owy adres email, spr\xF3buj ponownie."),s({status:z,retryIn:D,message:$}),z==="ok"&&c==="login"?u():z==="ok"&&c==="verifyCode"?v("success"):z==="error"&&F(_nullishCoalesce($, () => ("Nieprawid\u0142owy adres email, spr\xF3buj ponownie.")))}return _jsxruntime.jsx.call(void 0, _chunkDF2IK2GNjs.l,{value:a,children:_jsxruntime.jsx.call(void 0, "div",{className:"bg-white text-black dark:bg-black dark:text-white",children:_jsxruntime.jsxs.call(void 0, "div",{className:"font-inter flex h-screen w-screen flex-col p-4",style:i,ref:l,children:[_jsxruntime.jsxs.call(void 0, "header",{children:[_optionalChain([t, 'optionalAccess', _14 => _14.logoDarkURL])&&_jsxruntime.jsx.call(void 0, "img",{src:_optionalChain([t, 'optionalAccess', _15 => _15.logoDarkURL]),className:"hidden dark:inline",alt:"Company Logo",draggable:!1}),_optionalChain([t, 'optionalAccess', _16 => _16.logoURL])&&_jsxruntime.jsx.call(void 0, "img",{src:_optionalChain([t, 'optionalAccess', _17 => _17.logoURL]),className:"dark:hidden",alt:"Company Logo",draggable:!1})]}),c==="login"&&_jsxruntime.jsx.call(void 0, ca,{projectID:o,host:n,reveal:u,email:g,setEmail:k,loginUser:A,isLoginLoading:R,errMsg:q}),c==="verifyCode"&&_jsxruntime.jsx.call(void 0, da,{projectID:o,host:n,email:g,reveal:u,setEmail:k,loginUser:A,isLoginLoading:R,loginUserResponse:C,setLoginUserResponse:s,responseStatus:m,setResponseStatus:v,errMsg:q})]})})})},ua= exports.n =({analytics:e}={})=>_jsxruntime.jsx.call(void 0, la,{analytics:e});function _n(e){let[t,r]=_react3.useState.call(void 0, ()=>{if(typeof window>"u")return e;let n=new URLSearchParams(window.location.search),a={};return Object.keys(e).forEach(i=>{let c=n.get(i);if(c!==null)try{a[i]=JSON.parse(c)}catch (e3){a[i]=c}}),{...e,...a}}),o=_react3.useCallback.call(void 0, n=>{r(a=>{let i={...a,...n};if(typeof window<"u"){let c=new URLSearchParams;Object.keys(i).forEach(l=>{let u=i[l];u!=null&&c.set(l,JSON.stringify(u))});let d=`${window.location.pathname}?${c.toString()}`;window.history.pushState({},"",d)}return i})},[]);return _react3.useEffect.call(void 0, ()=>{let n=()=>{let a=new URLSearchParams(window.location.search),i={};Object.keys(e).forEach(c=>{let d=a.get(c);if(d!==null)try{i[c]=JSON.parse(d)}catch (e4){i[c]=d}}),r({...e,...i})};return window.addEventListener("popstate",n),()=>window.removeEventListener("popstate",n)},[e]),[t,o]}function zn(e,t){if(e!=null)return e;let r=_optionalChain([t, 'optionalAccess', _18 => _18.trim, 'call', _19 => _19()]);if(!(r==null||r===""))return{tokens:_chunk6IACFTJRjs.t.call(void 0, r)}}var _reactswitch = require('@radix-ui/react-switch'); var ut = _interopRequireWildcard(_reactswitch);function Fn({className:e,...t}){return _jsxruntime.jsx.call(void 0, ut.Root,{"data-slot":"switch",className:_chunkERL4Z7M7js.d.call(void 0, "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:_jsxruntime.jsx.call(void 0, ut.Thumb,{"data-slot":"switch-thumb",className:_chunkERL4Z7M7js.d.call(void 0, "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function ya({}){let[e,t]=_react3.useState.call(void 0, {disableAll:!1});return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-2xl",children:"Powiadomienia"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm text-neutral-500",children:"Zarz\u0105dzaj swoimi powiadomieniami"}),_jsxruntime.jsx.call(void 0, "div",{className:"mt-6",children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center space-x-2",children:[_jsxruntime.jsx.call(void 0, Fn,{id:"disable-all-notifications",checked:e.disableAll,onCheckedChange:r=>t(o=>({...o,disableAll:r}))}),_jsxruntime.jsxs.call(void 0, _chunkMLSKHOA3js.a,{htmlFor:"disable-all-notifications",className:"flex flex-col gap-1 text-base",children:["Wszystkie powiadomienia",_jsxruntime.jsx.call(void 0, "span",{className:"text-xs font-normal text-neutral-500 md:text-sm",children:"Ten przycisk mo\u017Ce wy\u0142\u0105czy\u0107 wszystkie powiadomienia"})]})]})})]})}var Bn=ya;function Gn({className:e,...t}){return _jsxruntime.jsx.call(void 0, "nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:_chunkERL4Z7M7js.d.call(void 0, "mx-auto flex w-full justify-center",e),...t})}function $n({className:e,...t}){return _jsxruntime.jsx.call(void 0, "ul",{"data-slot":"pagination-content",className:_chunkERL4Z7M7js.d.call(void 0, "flex flex-row items-center gap-1",e),...t})}function we({...e}){return _jsxruntime.jsx.call(void 0, "li",{"data-slot":"pagination-item",...e})}function je({className:e,isActive:t,size:r="icon",...o}){return _jsxruntime.jsx.call(void 0, "a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:_chunkERL4Z7M7js.d.call(void 0, _chunk6IACFTJRjs.p.call(void 0, {variant:t?"outline":"ghost",size:r}),e),...o})}function Hn({className:e,...t}){return _jsxruntime.jsxs.call(void 0, je,{"aria-label":"Go to previous page",size:"default",className:_chunkERL4Z7M7js.d.call(void 0, "gap-1 px-2.5 sm:pl-2.5",e),...t,children:[_jsxruntime.jsx.call(void 0, _lucidereact.ChevronLeftIcon,{}),_jsxruntime.jsx.call(void 0, "span",{className:"hidden sm:block",children:"Previous"})]})}function Vn({className:e,...t}){return _jsxruntime.jsxs.call(void 0, je,{"aria-label":"Go to next page",size:"default",className:_chunkERL4Z7M7js.d.call(void 0, "gap-1 px-2.5 sm:pr-2.5",e),...t,children:[_jsxruntime.jsx.call(void 0, "span",{className:"hidden sm:block",children:"Next"}),_jsxruntime.jsx.call(void 0, _lucidereact.ChevronRightIcon,{})]})}function qt({className:e,...t}){return _jsxruntime.jsxs.call(void 0, "span",{"aria-hidden":!0,"data-slot":"pagination-ellipsis",className:_chunkERL4Z7M7js.d.call(void 0, "flex size-9 items-center justify-center",e),...t,children:[_jsxruntime.jsx.call(void 0, _lucidereact.MoreHorizontalIcon,{className:"size-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"More pages"})]})}var xa=e=>new Date(e*1e3).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),ka=(e,t)=>new Intl.NumberFormat("en-US",{style:"currency",currency:t.toUpperCase()}).format(e/100),Ca={draft:"Szkic",unpaid:"Nieop\u0142acona",paid:"Op\u0142acona",overdue:"Zaleg\u0142a",cancelled:"Anulowana",completed:"Zako\u0144czone",processing:"Przetwarzane",refunded:"Zwr\xF3cone"},Na={draft:"text-neutral-400",unpaid:"text-yellow-500",paid:"text-green-600",overdue:"text-red-500",cancelled:"text-neutral-400 line-through",completed:"text-green-600",processing:"text-blue-500",refunded:"text-purple-500"};function Ia({openOrderDetails:e,projectID:t,accessToken:r}){let[o,n]=_react3.useState.call(void 0, 0),a=20,{data:i,isFetching:c}=_chunk6IACFTJRjs.k.call(void 0, _chunk6IACFTJRjs.j.publicApi.getOrders,{projectId:t,accessToken:r,offset:o,limit:a}),d=_nullishCoalesce(_optionalChain([i, 'optionalAccess', _20 => _20.orders]), () => ([])),l=_nullishCoalesce(_optionalChain([i, 'optionalAccess', _21 => _21.totalCount]), () => (0)),u=Math.floor(o/a)+1,g=Math.ceil(l/a),k=m=>{n(m)};return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-2xl",children:"Historia zam\xF3wie\u0144"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Twoje zam\xF3wienia"}),c?_jsxruntime.jsx.call(void 0, "div",{className:"mt-6 flex w-full flex-col gap-3",children:[...Array(5)].map((m,v)=>_jsxruntime.jsxs.call(void 0, "div",{className:"rounded-xl bg-white p-4 shadow-sm dark:bg-neutral-800",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"space-y-2",children:[_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.u,{className:"h-4 w-24"}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.u,{className:"h-3 w-32"})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"space-y-2 text-right",children:[_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.u,{className:"ml-auto h-4 w-16"}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.u,{className:"ml-auto h-3 w-12"})]})]}),_jsxruntime.jsx.call(void 0, "div",{className:"mt-3",children:_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.u,{className:"h-3 w-40"})})]},v))}):d.length===0?_jsxruntime.jsx.call(void 0, "div",{className:"mt-6 text-sm text-neutral-400",children:"Brak zam\xF3wie\u0144."}):_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "div",{className:"mt-6 flex w-full flex-col gap-3",children:d.map(m=>_jsxruntime.jsxs.call(void 0, "button",{onClick:()=>e(m.id),className:"block rounded-xl bg-white p-4 text-left shadow-sm transition-colors hover:bg-neutral-50 dark:bg-neutral-800 dark:hover:bg-neutral-700",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between",children:[_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsxs.call(void 0, "p",{className:"font-medium",children:["Zam\xF3wienie #",m.id]}),_jsxruntime.jsx.call(void 0, "p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:m.customerName||"Klient"})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"text-right",children:[_jsxruntime.jsx.call(void 0, "p",{className:"font-semibold",children:ka(m.totalAmount,m.currency)}),_jsxruntime.jsx.call(void 0, "p",{className:`text-xs font-medium ${_nullishCoalesce(Na[m.status], () => ("text-neutral-400"))}`,children:_nullishCoalesce(Ca[m.status], () => (m.status))})]})]}),_jsxruntime.jsx.call(void 0, "div",{className:"mt-2 flex items-center justify-between text-xs text-neutral-500 dark:text-neutral-400",children:_jsxruntime.jsxs.call(void 0, "span",{children:["Data:"," ",m.createdAt?xa(Number(m.createdAt.seconds)):"-"]})})]},m.id))}),g>1&&!c&&_jsxruntime.jsx.call(void 0, "div",{className:"mt-4 flex justify-center",children:_jsxruntime.jsx.call(void 0, Gn,{children:_jsxruntime.jsxs.call(void 0, $n,{children:[u>1&&_jsxruntime.jsx.call(void 0, we,{children:_jsxruntime.jsx.call(void 0, Hn,{onClick:()=>k(o-a)})}),u>2&&_jsxruntime.jsx.call(void 0, we,{children:_jsxruntime.jsx.call(void 0, je,{onClick:()=>k(0),children:"1"})}),u>3&&_jsxruntime.jsx.call(void 0, we,{children:_jsxruntime.jsx.call(void 0, qt,{})}),[u-1,u,u+1].filter(m=>m>0&&m<=g).map(m=>_jsxruntime.jsx.call(void 0, we,{children:_jsxruntime.jsx.call(void 0, je,{onClick:()=>k((m-1)*a),isActive:u===m,children:m})},m)),u<g-2&&_jsxruntime.jsx.call(void 0, we,{children:_jsxruntime.jsx.call(void 0, qt,{})}),u<g&&_jsxruntime.jsx.call(void 0, we,{children:_jsxruntime.jsx.call(void 0, je,{onClick:()=>k((g-1)*a),children:g})}),u<g&&_jsxruntime.jsx.call(void 0, we,{children:_jsxruntime.jsx.call(void 0, Vn,{onClick:()=>k(o+a)})})]})})})]})]})}var Wn=Ia;var Zn=e=>new Date(e*1e3).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),Ra={active:"Aktywny",cancelled:"Anulowany",paused:"Wstrzymany"},Aa={active:"text-green-600",cancelled:"text-red-500",paused:"text-yellow-500"};function Ta({projectID:e}){let[t,r]=_react3.useState.call(void 0, []),[o,n]=_react3.useState.call(void 0, !0);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-2xl",children:"Plany"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm text-neutral-500",children:"Twoje aktywne subskrypcje"}),o?_jsxruntime.jsx.call(void 0, "div",{className:"mt-6 text-sm text-neutral-400",children:"\u0141adowanie..."}):t.length===0?_jsxruntime.jsx.call(void 0, "div",{className:"mt-6 text-sm text-neutral-400",children:"Brak aktywnych plan\xF3w."}):_jsxruntime.jsx.call(void 0, "div",{className:"mt-6 flex flex-col gap-4",children:t.map(a=>_jsxruntime.jsxs.call(void 0, "div",{className:"rounded-xl bg-white p-5 shadow-sm dark:bg-neutral-800",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-start justify-between",children:[_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "p",{className:"font-semibold",children:a.tierName}),a.configName&&_jsxruntime.jsx.call(void 0, "p",{className:"text-sm text-neutral-500",children:a.configName})]}),_jsxruntime.jsx.call(void 0, "span",{className:`text-sm font-medium ${_nullishCoalesce(Aa[a.status], () => ("text-neutral-500"))}`,children:_nullishCoalesce(Ra[a.status], () => (a.status))})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"mt-3 grid grid-cols-2 gap-2 text-sm text-neutral-600 dark:text-neutral-400",children:[_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:"Dzie\u0144 rozliczenia:"})," ",a.billingDay]}),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:"Data startu:"})," ",Zn(a.startDate)]}),a.endDate&&_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:"Data zako\u0144czenia:"})," ",Zn(a.endDate)]})]})]},a.id))})]})}var Jn=Ta;function Ea(e,t,r,o){typeof window>"u"||(t&&_chunkDGUIG334js.n.call(void 0, r,o),window.location.href=e)}function Oa({projectID:e,host:t,loginURL:r,screen:o,params:n,setParams:a,setActiveScreen:i}){let{status:c,exchangeError:d}=_chunkMLSKHOA3js.j.call(void 0, "PanelReturns"),l=_chunkMLSKHOA3js.i.call(void 0, ),u=c==="anonymous"&&(d==null||_chunkMLSKHOA3js.g.call(void 0, d));_react3.useEffect.call(void 0, ()=>{u&&Ea(r,d!=null,e,t)},[u,r,d,e,t]);let[g,k]=_react3.useState.call(void 0, "orders"),[m,v]=_react3.useState.call(void 0, {items:[],note:""}),[C,s]=_react3.useState.call(void 0, );if(c==="anonymous"&&!u)return _jsxruntime.jsxs.call(void 0, "div",{role:"alert",className:"flex flex-col items-start gap-3",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm",children:l(_chunkMLSKHOA3js.h.call(void 0, d))}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.q,{type:"button",onClick:()=>window.location.reload(),children:l("errorRetry")})]});if(c!=="authenticated")return _jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.s,{});let h=R=>{k(R),a({state:"returns",orderId:void 0,returnId:void 0}),i("returns")};if(o==="return-details"&&n.returnId)return _jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.A,{returnId:n.returnId,onBack:()=>h("myReturns")});if(g==="myReturns")return _jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.z,{onBack:()=>h("orders"),onSelectReturn:R=>{a({state:"return-details",returnId:R,orderId:void 0}),i("return-details")}});if(g==="result"&&C!=null)return _jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.y,{returnId:C,onContinue:()=>h("orders"),onOpenMyReturns:()=>h("myReturns")});if(n.orderId){let R=n.orderId;return g==="confirmation"?_jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.x,{orderId:R,items:m.items,note:m.note,onBack:()=>k("orders"),onSubmitted:q=>{s(q),v({items:[],note:""}),k("result"),a({orderId:void 0})}}):_jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.w,{orderId:R,initialItems:m.items.length>0?m.items:void 0,initialNote:m.note,onBack:()=>{v({items:[],note:""}),a({orderId:void 0})},onContinue:q=>{v(q),k("confirmation")}})}return _jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.v,{showLogout:!1,onSelectOrder:R=>{v({items:[],note:""}),k("orders"),a({orderId:R})},onOpenMyReturns:()=>h("myReturns")})}function Gt({accessToken:e,appearance:t,texts:r,...o}){return _jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.k,{projectID:o.projectID,host:o.host,appearance:t,texts:r,panelAccessToken:e,children:_jsxruntime.jsx.call(void 0, Oa,{...o})})}var Ma=/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g,ja=e=>[...e.matchAll(Ma)].map(r=>({url:r[0],startIndex:r.index,endIndex:r.index+r[0].length-1})),_a=(e,t)=>{let r="",o=0;t.sort((n,a)=>n.startIndex-a.startIndex);for(let{startIndex:n,endIndex:a,replacementText:i}of t)r+=e.slice(o,n),r+=i,o=a+1;return r+=e.slice(o),r},Qn=e=>{let t=ja(e);return _jsxruntime.jsx.call(void 0, "p",{dangerouslySetInnerHTML:{__html:_a(e,t.map(r=>(r.replacementText=`<a key=${r.url} href=${r.url} style="text-decoration: underline;" target="_blank">
2
- ${r.url}
3
- </a>`,r)))}})};var _protobuf = require('@bufbuild/protobuf');var _hlsjs = require('hls.js'); var _hlsjs2 = _interopRequireDefault(_hlsjs);function Yn(){typeof navigator>"u"||typeof navigator.mediaSession>"u"||(navigator.mediaSession.playbackState="playing")}function Xn(){typeof navigator>"u"||typeof navigator.mediaSession>"u"||(navigator.mediaSession.playbackState="paused")}function er(e,t){typeof navigator>"u"||typeof navigator.mediaSession>"u"||e!=null&&isNaN(e)||t!=null&&isNaN(t)||navigator.mediaSession.setPositionState({playbackRate:1,duration:e,position:t})}function tr(e){typeof navigator>"u"||typeof navigator.mediaSession>"u"||(navigator.mediaSession.metadata=new MediaMetadata({title:e.title,artwork:e.artwork?[{type:"image/png",src:e.artwork}]:void 0}),navigator.mediaSession.setActionHandler("play",t=>{e.action(t)}),navigator.mediaSession.setActionHandler("pause",t=>{e.action(t)}),navigator.mediaSession.setActionHandler("stop",t=>{e.action(t)}),navigator.mediaSession.setActionHandler("seekbackward",t=>{e.action(t)}),navigator.mediaSession.setActionHandler("seekforward",t=>{e.action(t)}),navigator.mediaSession.setActionHandler("seekto",t=>{e.action(t)}))}function nr(){navigator.mediaSession.metadata=null}var $a=_react3.forwardRef.call(void 0, ({chapters:e,styles:t,updateCurrentTime:r,setCurrentTimeHandler:o,title:n,imageURL:a,uniqueProductID:i,onChapterChange:c},d)=>{let l;(H=>(H[H.Playing=0]="Playing",H[H.Paused=1]="Paused"))(l||={});let[u,g]=_react3.useState.call(void 0, 1);_react3.useEffect.call(void 0, ()=>{switch(u){case 0:Yn();break;case 1:Xn();break}},[u]),_react3.useImperativeHandle.call(void 0, d,()=>({selectChapter:f=>{He(f)}}));let[k,m]=_react3.useState.call(void 0, void 0),[v,C]=_react3.useState.call(void 0, void 0),s=_react3.useRef.call(void 0, null),h=_react3.useRef.call(void 0, void 0),R=_react3.useRef.call(void 0, void 0),q=_react3.useRef.call(void 0, null),F=_react3.useRef.call(void 0, null),[A,E]=_react3.useState.call(void 0, !0),[z,D]=_react3.useState.call(void 0, !1),[$,ge]=_react3.useState.call(void 0, !Ha());function U(f){f<10||localStorage.setItem(`__player__${i}_${_optionalChain([F, 'access', _22 => _22.current, 'optionalAccess', _23 => _23.id])}`,`${f}`)}function X(){let f=localStorage.getItem(`__player__${i}_${_optionalChain([F, 'access', _24 => _24.current, 'optionalAccess', _25 => _25.id])}`);if(f!=null)try{let M=parseInt(f);return isNaN(M)||M<0?void 0:M}catch (e5){return}}function ye(){let f=localStorage.getItem(`__player__${i}_last_chapter`);if(f!=null)return f}function Ce(f){localStorage.setItem(`__player__${i}_last_chapter`,f)}function re(f){localStorage.removeItem(`__player__${i}_${f}`)}function P(){s.current!=null&&(s.current.onloadeddata=()=>{if(s.current!=null){if(s.current.readyState<2&&ge(!0),s.current.readyState>=2&&ge(!1),!z){let f=X();f!=null&&it(f),D(!0)}if(A){E(!1);try{Nt()}catch(f){console.log("play error",f)}}}},s.current.onplay=()=>{},s.current.onseeked=()=>{},s.current.onseeking=()=>{},s.current.onpause=()=>{},s.current.onended=()=>{ae()},tr({title:_nullishCoalesce(n, () => ("")),artwork:a,action:f=>{switch(f.action){case"play":Nt();break;case"pause":It();break;case"seekbackward":ot(-15);break;case"seekforward":ot(15);break;case"seekto":f.seekTime&&it(f.seekTime);break;case"stop":It();break;default:break}}}),Ne())}function ae(){if(e==null||e.length==0)return;let f=e.findIndex(H=>H.id==_optionalChain([F, 'access', _26 => _26.current, 'optionalAccess', _27 => _27.id]));f==-1||(re(e[f].id),f+1>=e.length)||He(e[f+1])}function Ne(){Re(),R.current==null&&(R.current=setTimeout(()=>{Re(),R.current=void 0,Ne()},500))}function $e(){R.current!=null&&clearTimeout(R.current)}function Re(){s.current!=null&&(g(s.current.paused?1:0),C(s.current.duration),m(s.current.currentTime),U(s.current.currentTime),er(s.current.duration,s.current.currentTime),s.current.networkState===s.current.NETWORK_LOADING&&s.current.readyState<=s.current.HAVE_FUTURE_DATA?ge(!0):ge(!1),r&&r(s.current.currentTime))}function Nt(){_optionalChain([s, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.play, 'call', _30 => _30(), 'access', _31 => _31.then, 'call', _32 => _32(), 'access', _33 => _33.catch, 'call', _34 => _34()]),Re()}function It(){_optionalChain([s, 'access', _35 => _35.current, 'optionalAccess', _36 => _36.pause, 'call', _37 => _37()]),Re()}function Hr(){if(u===0){It();return}Nt()}function ot(f){if(s.current==null)return;let M=s.current.currentTime+f;if(M<0){s.current.currentTime=0;return}if(M>s.current.duration){s.current.currentTime=s.current.duration;return}s.current.currentTime+=f}function it(f){if(s.current!=null){if(m(f),f<0){s.current.currentTime=0;return}if(f>s.current.duration){s.current.currentTime=s.current.duration;return}s.current.currentTime=f}}function Vr(){s.current!=null&&(s.current.onplay=null,s.current.onseeked=null,s.current.onseeking=null,s.current.onpause=null,s.current.onended=null,s.current.src="",_optionalChain([h, 'access', _38 => _38.current, 'optionalAccess', _39 => _39.destroy, 'call', _40 => _40()]))}function dn(f){if(f.length==0)return;let M=ye();if(M==null){He(f[0]);return}let H=f.find(Ae=>Ae.id==M);if(H==null){He(f[0]);return}He(H)}function He(f){D(!1),E(!0),F.current=f,Wr(f.publicUrl),_optionalChain([c, 'optionalCall', _41 => _41(f)]),Ce(f.id)}function Wr(f){s.current!=null&&(s.current.canPlayType("application/vnd.apple.mpegurl")?s.current.src=f:_hlsjs2.default.isSupported()&&(h.current==null&&(h.current=new _hlsjs2.default,_optionalChain([h, 'access', _42 => _42.current, 'optionalAccess', _43 => _43.attachMedia, 'call', _44 => _44(s.current)])),_optionalChain([h, 'access', _45 => _45.current, 'optionalAccess', _46 => _46.loadSource, 'call', _47 => _47(f)])))}_react3.useEffect.call(void 0, ()=>{s.current!=null&&(P(),dn(e))},[s.current]),_react3.useEffect.call(void 0, ()=>{dn(e)},[e]),_react3.useEffect.call(void 0, ()=>(_optionalChain([o, 'optionalCall', _48 => _48(it)]),()=>{m(void 0),_optionalChain([s, 'access', _49 => _49.current, 'optionalAccess', _50 => _50.pause, 'call', _51 => _51()]),Vr(),nr()}),[]);let ln=f=>{let M=Math.floor(f/3600),H=Math.floor(f/60)%60,Ae=Math.floor(f%60),Zr=M>0?M<10?`0${M}:`:`${M}:`:"",Jr=Ae<10?`0${Ae}`:`${Ae}`;return isNaN(Ae)||isNaN(H)||isNaN(M)?"":`${Zr}${H}:${Jr}`},Kr=f=>{let M=parseFloat(f.value)/parseFloat(f.max)*100;q.current.style.setProperty("--seek-before-width",M+"%");let H=v*M/100;it(H)};return _jsxruntime.jsxs.call(void 0, "div",{id:"audio-player-container",className:"flex flex-col",style:t,ref:q,children:[_jsxruntime.jsx.call(void 0, "video",{ref:s,className:"hidden",poster:a,title:n}),_jsxruntime.jsx.call(void 0, "input",{type:"range",min:"0",max:v!=null?Math.floor(v).toString():100,value:_nullishCoalesce(k, () => (0)),onChange:f=>Kr(f.target),className:"w-full"}),_jsxruntime.jsxs.call(void 0, "section",{className:"flex w-full items-center justify-between text-sm font-medium",children:[_jsxruntime.jsx.call(void 0, "span",{id:"current-time",children:ln(k)}),_jsxruntime.jsx.call(void 0, "span",{id:"duration",children:ln(v)})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"mt-6 flex items-center justify-center gap-x-12",children:[_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.q,{variant:"outline",onClick:()=>ot(-10),"aria-label":"Rewind 10 Seconds",children:"-10"}),_jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{variant:"outline",onClick:Hr,"aria-label":"Play Or Pause",children:[u===1&&_jsxruntime.jsx.call(void 0, _lucidereact.Play,{className:"h-5 w-5"}),u===0&&_jsxruntime.jsx.call(void 0, _lucidereact.Pause,{className:"h-5 w-5"})]}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.q,{variant:"outline",onClick:()=>ot(10),"aria-label":"Fast Forward 10 Seconds",children:"+10"})]}),$&&_jsxruntime.jsx.call(void 0, "div",{className:"mt-2 flex w-full justify-center",children:_jsxruntime.jsx.call(void 0, Z,{})})]})});function Ha(){return navigator.userAgent.toLowerCase().indexOf("safari/")>-1}var ar=$a;var Va={pl:{returnsNavLabel:"Zwroty",openCourse:"Otw\xF3rz kurs"},en:{returnsNavLabel:"Returns",openCourse:"Open the course"}};function et(e=_chunkERL4Z7M7js.m.call(void 0, )){return _chunkERL4Z7M7js.h.call(void 0, Va,e)}function ir(){let[e,t]=ft.useState(13);return ft.useEffect(()=>{let r=setTimeout(()=>t(66),500);return()=>clearTimeout(r)},[]),_jsxruntime.jsx.call(void 0, "div",{className:"w-[60%] h-2 bg-gray-200 rounded-full overflow-hidden",children:_jsxruntime.jsx.call(void 0, "div",{className:"h-full bg-blue-600 transition-all duration-300",style:{width:`${e}%`}})})}function pe(e,...t){console.warn(e,...t)}function $t(e){console.error(e)}var Za=({accessToken:e,product:t,styles:r,reveal:o,onOpenCourse:n})=>{let a=t.productType,i=_chunkDF2IK2GNjs.m.call(void 0, ),c=()=>i.track("panel_download",{},{product_id:t.productId.length<=64?t.productId:null}),d=_react3.useRef.call(void 0, null),[l]=_react.useAutoAnimate.call(void 0, ),[u,g]=_react3.useState.call(void 0, null),{mutateAsync:k,isPending:m}=_chunk6IACFTJRjs.l.call(void 0, _chunk6IACFTJRjs.j.publicApi.userPanelGetFileDetails),v=_react3.useRef.call(void 0, void 0),[C,s]=_react3.useState.call(void 0, null),[h,R]=_react3.useState.call(void 0, null),[q,F]=_react3.useState.call(void 0, !1),{mutateAsync:A,isPending:E}=_chunk6IACFTJRjs.l.call(void 0, _chunk6IACFTJRjs.j.publicApi.userPanelGetAudiobookDetails),{mutateAsync:z,isPending:D}=_chunk6IACFTJRjs.l.call(void 0, _chunk6IACFTJRjs.j.publicApi.userPanelGetAudiobookDetailsDownloadURLs),[$,ge]=_react3.useState.call(void 0, null),[U,X]=_react3.useState.call(void 0, null);async function ye(){try{let P=await k({accessId:t.accessId,accessToken:e});if(P.result.case==="success"){g(P.result.value.files);return}else pe("Pobranie plik\xF3w nie powiod\u0142o si\u0119. Zalecamy kontakt."),pe("Kod b\u0142\u0119du: ",P.result.value)}catch(P){pe("Nieoczekiwany b\u0142\u0105d. Spr\xF3buj ponownie za chwil\u0119."),$t("B\u0142\u0105d podczas pobierania danych:"+P)}}async function Ce(){try{let P=await A({accessId:t.accessId,accessToken:e});if(P.result.case==="audiobook"){s(P.result.value);return}else pe("Pobranie plik\xF3w nie powiod\u0142o si\u0119. Zalecamy kontakt."),pe("Kod b\u0142\u0119du: ",P.result.value)}catch(P){pe("Nieoczekiwany b\u0142\u0105d. Spr\xF3buj ponownie za chwil\u0119."),$t("B\u0142\u0105d podczas pobierania danych:"+P)}}async function re(){try{let P=await z({accessId:t.accessId,accessToken:e,isBrowser:!0});if(P.result.case==="success"){R(P.result.value.audiobookDownloadDetails),F(P.result.value.isAvailableToDownloadInMobileApp===!0);return}else pe("Pobranie plik\xF3w nie powiod\u0142o si\u0119. Zalecamy kontakt."),pe("Kod b\u0142\u0119du: ",P.result.value)}catch(P){pe("Nieoczekiwany b\u0142\u0105d. Spr\xF3buj ponownie za chwil\u0119."),$t("B\u0142\u0105d podczas pobierania danych:"+P)}}return _react3.useEffect.call(void 0, ()=>{a===1&&(Ce().then().catch(),re().then().catch())},[]),_react3.useEffect.call(void 0, ()=>{if(C!=null&&h!=null){let P=C.chapters;if(!P)return;let ae=P.map(Ne=>{let $e=_optionalChain([h, 'optionalAccess', _52 => _52.find, 'call', _53 => _53(Re=>Re.chapterId===Ne.id)]);if($e!=null)return{...Ne,publicUrl:$e.publicUrl,downloadableUrl:$e.downloadableUrl,duration:$e.duration}}).filter(Ne=>Ne!=null);ae!=null&&ae.length>0&&X(ae)}},[C,h]),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "div",{className:"mb-3 space-y-4 rounded bg-white p-4 dark:bg-black",children:_jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{onClick:()=>o(),variant:"ghost",className:"w-fit",children:[_jsxruntime.jsx.call(void 0, _lucidereact.ChevronLeft,{className:"h-6 w-6"}),_jsxruntime.jsx.call(void 0, "span",{className:"font-inter text-sm font-medium",children:"Wr\xF3\u0107"})]})}),_jsxruntime.jsxs.call(void 0, "main",{className:"grid grid-cols-1 justify-center gap-6 sm:justify-start lg:grid-cols-2",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex w-full max-w-xl flex-col gap-6",children:[a===2&&_jsxruntime.jsxs.call(void 0, "div",{ref:l,className:"flex flex-col space-y-4 rounded bg-white p-6 drop-shadow-xl dark:border dark:border-neutral-700 dark:bg-neutral-800 dark:drop-shadow-none",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between gap-x-4",children:[_jsxruntime.jsx.call(void 0, "h4",{className:"text-xl font-semibold",children:"Twoje pliki"}),(u==null||u.length==0)&&_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.q,{onClick:ye,"aria-label":"Download Product",className:"text-sm font-medium transition-opacity duration-300 ease-in-out hover:opacity-80 active:opacity-80",style:r,children:m?_jsxruntime.jsx.call(void 0, Z,{}):"Wy\u015Bwietl"})]}),m&&_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col items-start gap-2",children:[_jsxruntime.jsx.call(void 0, ir,{}),_jsxruntime.jsx.call(void 0, "p",{className:"font-bold transition hover:text-blue-600",children:"Trwa przygotowanie plik\xF3w..."})]}),u!=null&&u.length>0&&_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col items-start justify-start gap-2",children:u.map((P,ae)=>_jsxruntime.jsxs.call(void 0, "a",{target:"_blank",className:"flex w-fit items-center gap-2 rounded-md bg-neutral-800 px-3 py-2 text-neutral-200 dark:bg-neutral-200 dark:text-neutral-800",href:P,download:!0,onClick:c,children:[`Plik numer ${ae+1}`,_jsxruntime.jsx.call(void 0, _lucidereact.Download,{width:14,height:14})]},ae))})]}),a===4&&_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-col items-center justify-center rounded-xl bg-white p-6 drop-shadow-xl dark:bg-neutral-900 dark:drop-shadow-none",children:_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.q,{onClick:()=>n(t.accessId),className:"text-sm font-medium transition-opacity duration-300 ease-in-out hover:opacity-80 active:opacity-80",style:r,children:et().openCourse})}),a===1&&_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col space-y-6 rounded-xl bg-white p-3 drop-shadow-xl dark:bg-neutral-900 dark:drop-shadow-none",children:[_jsxruntime.jsx.call(void 0, "h4",{className:"text-xl font-semibold",children:_nullishCoalesce(_optionalChain([$, 'optionalAccess', _54 => _54.name]), () => ("Odtwarzacz"))}),_optionalChain([$, 'optionalAccess', _55 => _55.description])&&_jsxruntime.jsx.call(void 0, "p",{className:"text-sm",children:_optionalChain([$, 'optionalAccess', _56 => _56.description])}),_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:E?_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-2",children:[_jsxruntime.jsx.call(void 0, Z,{}),_jsxruntime.jsx.call(void 0, "p",{className:"text-xl font-semibold",children:"Trwa pobierania audiobooka..."})]}):_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:U!=null?_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsx.call(void 0, ar,{ref:d,chapters:U,title:_nullishCoalesce(_nullishCoalesce(_optionalChain([C, 'optionalAccess', _57 => _57.name]), () => (t.productName)), () => (void 0)),imageURL:_nullishCoalesce(_nullishCoalesce(_optionalChain([C, 'optionalAccess', _58 => _58.coverImage]), () => (t.productImageUrl)), () => (void 0)),styles:r,setCurrentTimeHandler:P=>{v.current=P},uniqueProductID:t.productId,onChapterChange:P=>{ge(P)}})}):_jsxruntime.jsx.call(void 0, "p",{className:"mt-2",children:"Wybierz rozdzia\u0142, kt\xF3ry ci\u0119 interesuje."})})}),_jsxruntime.jsxs.call(void 0, "div",{className:"rounded-xl bg-neutral-100 p-3 dark:bg-neutral-800",children:[_jsxruntime.jsx.call(void 0, "p",{className:"mt-3 mb-3 text-xs",children:q?"Mo\u017Cesz s\u0142ucha\u0107 tego audiobooka w aplikacji r\xF3wnie\u017C bez dost\u0119pu do internetu.":"Mo\u017Cesz s\u0142ucha\u0107 tego audiobooka w aplikacji."}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-3",children:[_jsxruntime.jsx.call(void 0, "a",{href:"https://apps.apple.com/us/app/bitsnap/id6741902807",children:_jsxruntime.jsx.call(void 0, "img",{width:"100",src:"https://bitsnap.pl/appstore.svg",alt:"Pobierz aplikacje z AppStore"})}),_jsxruntime.jsx.call(void 0, "a",{href:"https://docs.bitsnap.pl/guides/audiobook",children:_jsxruntime.jsx.call(void 0, "img",{width:"100",src:"https://bitsnap.pl/playstore.svg",alt:"Pobierz aplikacj\u0119 z GooglePlay"})})]})]})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center justify-center rounded-xl bg-white p-3 drop-shadow-xl dark:bg-neutral-900 dark:drop-shadow-none",children:a===1&&_jsxruntime.jsx.call(void 0, "div",{className:"max-h-96 w-full overflow-y-auto",children:E?_jsxruntime.jsxs.call(void 0, "div",{className:"jusitfy-center flex flex-col items-center gap-2",children:[_jsxruntime.jsx.call(void 0, Z,{}),_jsxruntime.jsx.call(void 0, "p",{children:"\u0141adowanie rozdzia\u0142\xF3w..."})]}):_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "h2",{className:"mb-3 text-xl font-semibold",children:"Rozdzia\u0142y"}),U==null?_jsxruntime.jsx.call(void 0, "p",{children:"Brak rozdzia\u0142\xF3w do wy\u015Bwietlenia."}):_jsxruntime.jsx.call(void 0, "ul",{className:"flex w-full flex-col gap-2",children:U.map((P,ae)=>_jsxruntime.jsxs.call(void 0, "li",{className:"flex items-center justify-between",children:[_jsxruntime.jsxs.call(void 0, "button",{className:_chunkERL4Z7M7js.d.call(void 0, "w-full rounded-lg p-2 text-left transition hover:bg-neutral-200 active:bg-neutral-200 dark:hover:bg-neutral-700 dark:active:bg-neutral-700",_optionalChain([$, 'optionalAccess', _59 => _59.id])==P.id?"bg-neutral-200 dark:bg-neutral-700":"bg-neutral-100 dark:bg-neutral-800 dark:text-neutral-300"),onClick:()=>{d.current.selectChapter(P)},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center justify-between",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-medium",children:P.name}),P.duration&&_jsxruntime.jsxs.call(void 0, "span",{className:"text-xs text-neutral-500",children:[Math.floor(P.duration/60),":",String(Math.floor(P.duration%60)).padStart(2,"0")]})]}),P.description&&_jsxruntime.jsx.call(void 0, "p",{className:"mt-3 text-xs",children:P.description})]}),C&&C.isDownloadable&&P.downloadableUrl&&_jsxruntime.jsx.call(void 0, "a",{href:P.downloadableUrl,onClick:c,children:_jsxruntime.jsx.call(void 0, _lucidereact.Download,{width:14,height:14})})]},ae))})]})})})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"w-full max-w-3xl space-y-6 rounded-xl bg-white p-6 drop-shadow-xl dark:bg-neutral-900 dark:drop-shadow-none",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"text-3xl font-semibold",children:t.productName}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm font-normal text-neutral-600 dark:text-neutral-300",children:t.productDescription}),_jsxruntime.jsx.call(void 0, "img",{src:t.productImageUrl,alt:"Product Photo",width:384,height:384,className:"max-h-sm max-w-sm",draggable:!1})]})]})]})},lr=Za;var Xa=({accessToken:e,projectID:t,loginURL:r,styles:o,activeScreen:n,params:a,setParams:i,openCourse:c})=>{let{data:d,isLoading:l}=_chunk6IACFTJRjs.k.call(void 0, _chunk6IACFTJRjs.j.publicApi.userPanelGetProducts,{accessToken:e});if(l)return _jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-2 bg-white p-2 dark:bg-black",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-dark font-inter font-medium dark:text-white",children:"\u0141adowanie..."}),_jsxruntime.jsx.call(void 0, Z,{})]});if(d&&d.result.case==="failure")return console.warn("error:",`Kod b\u0142\u0119du: ${d.result.value}`),_chunkDGUIG334js.n.call(void 0, t),window.location.href=r,null;let u=d&&d.result.case==="success"?d.result.value.products:[];return _jsxruntime.jsx.call(void 0, eo,{accessToken:e,products:u,styles:o,loginURL:r,activeScreen:n,params:a,setParams:i,openCourse:c})},ur=Xa,eo=({accessToken:e,products:t,styles:r,loginURL:o,activeScreen:n,params:a,setParams:i,openCourse:c})=>{if(t.length===0)return window.location.href=o,null;let[d,l]=_react3.useState.call(void 0, a.product?_protobuf.fromJsonString.call(void 0, _chunk6IACFTJRjs.e,a.product):void 0),u=m=>{m==null?(l(void 0),i({product:void 0,state:"products"})):i({product:_protobuf.toJsonString.call(void 0, _chunk6IACFTJRjs.e,m),state:"products"})};function g(m){switch(m){case 1:return"Audio";case 2:return"Plik";case 3:return"Bilet";case 4:return"Kurs";default:return}}function k(m){if(m.productType===4){c(m.accessId);return}l(m),u(m)}return n==="products"&&d!=null?_jsxruntime.jsx.call(void 0, lr,{accessToken:e,product:d,styles:r,reveal:u,onOpenCourse:c}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-2xl",children:"Hej \u{1F44B}"}),_jsxruntime.jsx.call(void 0, "p",{className:"text-sm text-neutral-500",children:"Poni\u017Cej znajdziesz swoje produkty"}),_jsxruntime.jsx.call(void 0, "div",{className:"mt-6 flex flex-wrap items-center justify-center gap-9 sm:justify-start",children:_optionalChain([t, 'optionalAccess', _60 => _60.map, 'call', _61 => _61((m,v)=>_jsxruntime.jsxs.call(void 0, "section",{onClick:()=>k(m),className:"w-full max-w-xs cursor-pointer rounded drop-shadow-xl dark:border dark:border-slate-600 dark:drop-shadow-none",children:[_jsxruntime.jsxs.call(void 0, "section",{className:"flex flex-col items-center space-y-2 rounded bg-slate-100 p-4 dark:bg-neutral-900",children:[m.productType&&_jsxruntime.jsx.call(void 0, "div",{className:"w-fit self-end rounded bg-red-900 px-4 py-1",children:_jsxruntime.jsx.call(void 0, "span",{className:"text-sm font-medium text-white dark:text-slate-100",children:g(m.productType)})}),_jsxruntime.jsx.call(void 0, "div",{className:"jusitfy-center flex max-h-40 items-center",children:_jsxruntime.jsx.call(void 0, "img",{src:m.productImageUrl,alt:`Product ${v} Photo`,draggable:!1,className:"aspect-auto max-h-40"})})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"space-y-4 rounded bg-white p-4 dark:bg-black",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"text-xl font-semibold",children:m.productName}),_jsxruntime.jsx.call(void 0, "p",{title:m.productDescription,className:"line-clamp-3 text-sm font-normal text-neutral-600 dark:text-neutral-300",children:Qn(m.productDescription)}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.q,{onClick:C=>{C.stopPropagation(),k(m)},className:"w-full text-sm font-medium transition-opacity duration-300 ease-in-out hover:opacity-80 active:opacity-80",style:r,children:"Zobacz"})]})]},v))])})]})};function oo({activeScreen:e,setActiveScreen:t,setParams:r,styles:o,theme:n,logout:a}){return _jsxruntime.jsxs.call(void 0, "header",{className:"md:border-r-neutral-150 md:bg-beige-50 fixed right-0 bottom-0 left-0 z-10 flex h-12 w-full items-center bg-neutral-800 md:static md:z-0 md:min-h-screen md:w-auto md:border-r dark:md:border-r-neutral-900",children:[_jsxruntime.jsx.call(void 0, io,{activeScreen:e,setActiveScreen:t,setParams:r}),_jsxruntime.jsx.call(void 0, so,{activeScreen:e,setActiveScreen:t,setParams:r,theme:n,logout:a})]})}var fr=oo;function io({activeScreen:e,setActiveScreen:t,setParams:r}){let{returnsNavLabel:o}=et();return _jsxruntime.jsxs.call(void 0, "nav",{className:"flex w-full items-center justify-evenly gap-4 md:hidden",children:[_jsxruntime.jsx.call(void 0, yt,{panelScreen:"products",label:"Produkty",imageURL:"/icons/bitsnap-24x24.svg",activeScreen:e,setActiveScreen:t,setParams:r}),_jsxruntime.jsx.call(void 0, yt,{panelScreen:"orders",label:"Faktury",imageURL:"/icons/category-24x24.svg",activeScreen:e,setActiveScreen:t,setParams:r}),_jsxruntime.jsx.call(void 0, yt,{panelScreen:"returns",label:o,icon:_jsxruntime.jsx.call(void 0, _lucidereact.Undo2,{className:"h-5 w-5 text-white","aria-hidden":!0}),activeScreen:e,setActiveScreen:t,setParams:r}),_jsxruntime.jsx.call(void 0, yt,{panelScreen:"profile",label:"Profil",imageURL:"/icons/profile-24x24.svg",activeScreen:e,setActiveScreen:t,setParams:r})]})}function yt({panelScreen:e,label:t,imageURL:r,icon:o,activeScreen:n,setActiveScreen:a,setParams:i}){return _jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{onClick:()=>{a(e),i({product:void 0,state:e})},"aria-label":t,variant:null,className:_chunkERL4Z7M7js.d.call(void 0, "flex flex-col gap-0",n===e?"opacity-100":"opacity-50"),children:[_nullishCoalesce(o, () => (_jsxruntime.jsx.call(void 0, "img",{src:r,alt:t,className:"scale-75"}))),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs font-normal text-white",children:t})]})}function Pt({panelScreen:e,label:t,imageURL:r,darkImageURL:o,icon:n,activeScreen:a,setActiveScreen:i,setParams:c,isExpanded:d}){return _jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{onClick:()=>{i(e),c({product:void 0,state:e})},variant:a===e?"secondary":"ghost",className:"justify-start",children:[n!=null?_jsxruntime.jsx.call(void 0, "span",{className:_chunkERL4Z7M7js.d.call(void 0, "inline-flex h-5 w-5 items-center justify-center",d?"mr-4":"mr-2"),children:n}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "img",{src:r,alt:t,className:_chunkERL4Z7M7js.d.call(void 0, "aspect-auto h-5 w-5 dark:hidden",d?"mr-4":"mr-2")}),_jsxruntime.jsx.call(void 0, "img",{src:o,alt:t,className:_chunkERL4Z7M7js.d.call(void 0, "hidden aspect-auto h-5 w-5 dark:inline",d?"mr-4":"mr-2")})]}),d&&_jsxruntime.jsx.call(void 0, "span",{className:"md:text-medium hidden md:inline",children:t})]})}function so({activeScreen:e,setActiveScreen:t,setParams:r,theme:o,logout:n}){let[a]=_react.useAutoAnimate.call(void 0, ),[i,c]=_react3.useState.call(void 0, !0),{returnsNavLabel:d}=et();return _jsxruntime.jsxs.call(void 0, "div",{ref:a,className:_chunkERL4Z7M7js.d.call(void 0, "hidden px-4 pt-4 pb-12 md:flex md:h-full md:flex-col dark:bg-neutral-900",i?"md:w-52":"md:w-16"),children:[_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center justify-between",children:_jsxruntime.jsx.call(void 0, co,{theme:o,isExpanded:i})}),_jsxruntime.jsx.call(void 0, mr,{className:"my-6"}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-1 flex-col gap-2",children:[_jsxruntime.jsx.call(void 0, Pt,{panelScreen:"products",label:"Produkty",imageURL:"/icons/bitsnap-dark-24x24.svg",darkImageURL:"/icons/bitsnap-24x24.svg",activeScreen:e,setActiveScreen:t,setParams:r,isExpanded:i}),_jsxruntime.jsx.call(void 0, Pt,{panelScreen:"orders",label:"Zam\xF3wienia",imageURL:"/icons/category-dark-24x24.svg",darkImageURL:"/icons/category-24x24.svg",activeScreen:e,setActiveScreen:t,setParams:r,isExpanded:i}),_jsxruntime.jsx.call(void 0, Pt,{panelScreen:"returns",label:d,icon:_jsxruntime.jsx.call(void 0, _lucidereact.Undo2,{className:"h-5 w-5","aria-hidden":!0}),activeScreen:e,setActiveScreen:t,setParams:r,isExpanded:i}),_jsxruntime.jsx.call(void 0, Pt,{panelScreen:"profile",label:"Profil",imageURL:"/icons/profile-dark-24x24.svg",darkImageURL:"/icons/profile-24x24.svg",activeScreen:e,setActiveScreen:t,setParams:r,isExpanded:i})]}),_jsxruntime.jsx.call(void 0, mr,{className:"mb-6"}),_jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{onClick:n,children:[_jsxruntime.jsx.call(void 0, _lucidereact.LogOut,{className:"mr-2",width:16,height:16}),i&&_jsxruntime.jsx.call(void 0, "p",{className:"md:text-medium hidden md:inline md:text-center",children:"Wyloguj si\u0119"})]})]})}function mr({className:e}){return _jsxruntime.jsxs.call(void 0, "div",{className:_chunkERL4Z7M7js.d.call(void 0, "relative h-px w-full bg-neutral-300",e),children:[_jsxruntime.jsx.call(void 0, "div",{className:"absolute -top-px left-0 h-1 w-1 rounded-full bg-neutral-500"}),_jsxruntime.jsx.call(void 0, "div",{className:"absolute -top-px right-0 h-1 w-1 rounded-full bg-neutral-500"})]})}function co({theme:e,isExpanded:t}){return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e==null&&_jsxruntime.jsx.call(void 0, "p",{className:"text-xl tracking-wider md:inline dark:text-neutral-200",children:"bitsnap."}),(_optionalChain([e, 'optionalAccess', _62 => _62.logoDarkURL])||_optionalChain([e, 'optionalAccess', _63 => _63.logoURL]))&&_jsxruntime.jsx.call(void 0, "img",{src:_nullishCoalesce(e.logoDarkURL, () => (e.logoURL)),alt:"Company Logo",className:"hidden h-6 w-6 dark:inline",draggable:!1}),_optionalChain([e, 'optionalAccess', _64 => _64.logoURL])&&_jsxruntime.jsx.call(void 0, "img",{src:e.logoURL,alt:"Company Logo",className:"h-6 w-6 dark:hidden",draggable:!1})]})}function uo({email:e,logout:t}){return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "h3",{className:"text-2xl",children:"Profil"}),_jsxruntime.jsxs.call(void 0, "div",{className:"mt-6 flex-1 md:flex-none",children:[_jsxruntime.jsx.call(void 0, "span",{className:"text-sm text-neutral-500",children:"Email"}),_jsxruntime.jsx.call(void 0, "p",{className:"mt-2 text-base",children:e||"Brak danych"})]}),_jsxruntime.jsx.call(void 0, "div",{className:"flex w-full flex-col items-center space-y-2",children:_jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{onClick:t,className:"max-w-64 md:hidden",children:[_jsxruntime.jsx.call(void 0, _lucidereact.LogOut,{className:"mr-2",width:16,height:16}),_jsxruntime.jsx.call(void 0, "p",{className:"text-medium inline text-center",children:"Wyloguj si\u0119"})]})})]})}var yr=uo;var go=_react3.lazy.call(void 0, ()=>Promise.resolve().then(() => _interopRequireWildcard(require("./course.js"))).then(e=>({default:e.PanelCourse})));function Vt(e){return _jsxruntime.jsx.call(void 0, _react3.Suspense,{fallback:_jsxruntime.jsx.call(void 0, "div",{className:"flex items-center gap-2 p-2",role:"status",children:_jsxruntime.jsx.call(void 0, Z,{})}),children:_jsxruntime.jsx.call(void 0, go,{...e})})}function bo({status:e}){let t={created:{color:"bg-neutral-100 text-neutral-700",icon:null},paid:{color:"bg-green-100 text-green-700",icon:_lucidereact.CheckCircle2},completed:{color:"bg-blue-100 text-blue-700",icon:_lucidereact.CheckCircle2},canceled:{color:"bg-red-100 text-red-700",icon:_lucidereact.AlertCircle},sent:{color:"bg-purple-100 text-purple-700",icon:_lucidereact.Truck},processing:{color:"bg-yellow-100 text-yellow-700",icon:_lucidereact.Loader2}},r=t[e]||t.created,o=r.icon,n={created:"Utworzone",paid:"Op\u0142acone",completed:"Zako\u0144czone",canceled:"Anulowane",sent:"Wys\u0142ane",processing:"Przetwarzane"};return _jsxruntime.jsxs.call(void 0, "span",{className:`inline-flex items-center gap-1 rounded-full px-3 py-1 text-sm font-medium ${r.color}`,children:[o&&_jsxruntime.jsx.call(void 0, o,{className:"h-4 w-4"}),n[e]||e]})}function vo({orderID:e,email:t}){let[r,o]=_react3.useState.call(void 0, ""),n=_chunk6IACFTJRjs.l.call(void 0, _chunk6IACFTJRjs.j.publicApi.addPublicOrderComment);return _jsxruntime.jsxs.call(void 0, "form",{onSubmit:async i=>{if(i.preventDefault(),!!r.trim())try{await n.mutateAsync({projectId:"",orderId:e,message:r.trim(),accessToken:t}),o("")}catch(c){console.error("Failed to add comment:",c)}},className:"mt-4 space-y-2",children:[_jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.a,{htmlFor:"comment",children:"Dodaj komentarz"}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.v,{id:"comment",value:r,onChange:i=>o(i.target.value),placeholder:"Wpisz komentarz...",rows:3,disabled:n.isPending}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.q,{type:"submit",disabled:!r.trim()||n.isPending,children:n.isPending?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, _lucidereact.Loader2,{className:"mr-2 h-4 w-4 animate-spin"}),"Wysy\u0142anie..."]}):"Dodaj komentarz"})]})}function br(e){return e?new Date(Number(e.seconds)*1e3).toLocaleDateString("pl-PL",{year:"numeric",month:"long",day:"numeric"}):"N/A"}function vr(e,t){return new Intl.NumberFormat("pl-PL",{style:"currency",currency:t.toUpperCase()}).format(e/100)}function wo({orderID:e,initialEmail:t,onBack:r,accessToken:o,analytics:n}){let{theme:a,projectID:i}=_chunkDGUIG334js.j.call(void 0, ),c=_chunkDF2IK2GNjs.n.call(void 0, i,n,"order"),[d,l]=_react3.useState.call(void 0, t||""),[u,g]=_react3.useState.call(void 0, !1),{data:k,isLoading:m,error:v,refetch:C}=_chunk6IACFTJRjs.k.call(void 0, _chunk6IACFTJRjs.j.publicApi.getPublicOrderDetails,{projectId:_nullishCoalesce(i, () => ("")),orderId:e,email:d||void 0,accessToken:o},{enabled:!!e}),s=_optionalChain([k, 'optionalAccess', _65 => _65.result, 'access', _66 => _66.case])==="order"?k.result.value:null,h=_nullishCoalesce(_optionalChain([s, 'optionalAccess', _67 => _67.isVerified]), () => (!1)),R=s!=null;_react3.useEffect.call(void 0, ()=>{R&&c.track("panel_order_viewed",{},{order_ref:null})},[c,R]);let q=()=>{C(),g(!1)},F={"--button-background-color":_nullishCoalesce(_optionalChain([a, 'optionalAccess', _68 => _68.colors, 'optionalAccess', _69 => _69.brand]), () => ("#000000")),"--button-background-color-dark":_nullishCoalesce(_optionalChain([a, 'optionalAccess', _70 => _70.colors, 'optionalAccess', _71 => _71.brandDark]), () => ("#ffffff")),"--button-text-color":_nullishCoalesce(_optionalChain([a, 'optionalAccess', _72 => _72.colors, 'optionalAccess', _73 => _73.brandDark]), () => ("#000000")),"--button-text-color-dark":_nullishCoalesce(_optionalChain([a, 'optionalAccess', _74 => _74.colors, 'optionalAccess', _75 => _75.brand]), () => ("#000000"))};return m?_jsxruntime.jsx.call(void 0, "div",{className:"flex min-h-screen items-center justify-center",children:_jsxruntime.jsxs.call(void 0, "div",{className:"text-center",children:[_jsxruntime.jsx.call(void 0, _lucidereact.Loader2,{className:"mx-auto h-8 w-8 animate-spin text-neutral-400"}),_jsxruntime.jsx.call(void 0, "p",{className:"mt-2 text-neutral-600 dark:text-neutral-400",children:"\u0141adowanie zam\xF3wienia..."})]})}):v||!s?_jsxruntime.jsx.call(void 0, "div",{className:"flex min-h-screen items-center justify-center",children:_jsxruntime.jsx.call(void 0, ue,{className:"w-full max-w-md",children:_jsxruntime.jsx.call(void 0, me,{className:"pt-6",children:_jsxruntime.jsxs.call(void 0, "div",{className:"text-center",children:[_jsxruntime.jsx.call(void 0, _lucidereact.AlertCircle,{className:"mx-auto h-12 w-12 text-red-500"}),_jsxruntime.jsx.call(void 0, "h2",{className:"mt-4 text-xl font-semibold",children:"Zam\xF3wienie nie znalezione"}),_jsxruntime.jsx.call(void 0, "p",{className:"mt-2 text-neutral-600 dark:text-neutral-400",children:"Nie znaleziono zam\xF3wienia o podanym numerze."})]})})})}):_jsxruntime.jsx.call(void 0, "div",{className:"w-full bg-white py-8 dark:bg-black",style:F,children:_jsxruntime.jsxs.call(void 0, "div",{className:"w-full px-4",children:[r&&_jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{onClick:r,variant:"ghost",className:"mb-4 w-fit",children:[_jsxruntime.jsx.call(void 0, _lucidereact.ChevronLeft,{className:"h-4 w-4"}),"Wr\xF3\u0107 do historii zam\xF3wie\u0144"]}),_jsxruntime.jsxs.call(void 0, "div",{className:"mb-6 flex items-center gap-4",children:[_optionalChain([a, 'optionalAccess', _76 => _76.logoURL])&&_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "img",{src:a.logoURL,alt:"Project logo",className:`h-12 w-auto ${a.logoDarkURL?"dark:hidden":""}`}),a.logoDarkURL&&_jsxruntime.jsx.call(void 0, "img",{src:a.logoDarkURL,alt:"Project logo",className:"hidden h-12 w-auto dark:block"})]}),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "h1",{className:"text-3xl font-bold",children:"Zam\xF3wienie"}),_jsxruntime.jsxs.call(void 0, "p",{className:"text-neutral-600 dark:text-neutral-400",children:["Numer zam\xF3wienia: #",s.orderId]})]})]}),_jsxruntime.jsxs.call(void 0, ue,{className:"mb-6",children:[_jsxruntime.jsx.call(void 0, be,{children:_jsxruntime.jsxs.call(void 0, ve,{className:"flex items-center",children:[_jsxruntime.jsx.call(void 0, _lucidereact.Package,{className:"mr-2 h-5 w-5"}),"Status zam\xF3wienia"]})}),_jsxruntime.jsxs.call(void 0, me,{className:"space-y-6",children:[_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-2",children:[_jsxruntime.jsx.call(void 0, bo,{status:s.status}),s.processingStatus&&_jsxruntime.jsxs.call(void 0, "span",{className:"text-sm text-neutral-600",children:["\xB7 ",s.processingStatus]})]}),_jsxruntime.jsxs.call(void 0, "p",{className:"mt-2 text-sm text-neutral-600",children:["Zam\xF3wienie z\u0142o\u017Cone ",br(s.createdAt)]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"border-t pt-4",children:[_jsxruntime.jsx.call(void 0, "h3",{className:"mb-3 font-semibold",children:"Dane klienta"}),_jsxruntime.jsxs.call(void 0, "div",{className:"space-y-2",children:[_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:"Imi\u0119 i nazwisko:"})," ",_jsxruntime.jsx.call(void 0, "span",{className:h?"":"text-neutral-500",children:s.customerName})]}),_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:"Email:"})," ",_jsxruntime.jsx.call(void 0, "span",{className:h?"":"text-neutral-500",children:s.customerEmail})]}),s.customerPhone&&_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:"Telefon:"})," ",_jsxruntime.jsx.call(void 0, "span",{className:h?"":"text-neutral-500",children:s.customerPhone})]})]})]}),!h&&_jsxruntime.jsx.call(void 0, "div",{className:"border-t pt-4",children:_jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{onClick:()=>g(!0),variant:"outline",className:"w-full",children:[_jsxruntime.jsx.call(void 0, _lucidereact.Lock,{className:"mr-2 h-4 w-4"}),"Zweryfikuj sw\xF3j email"]})})]})]}),_jsxruntime.jsxs.call(void 0, ue,{className:"mb-6",children:[_jsxruntime.jsx.call(void 0, be,{children:_jsxruntime.jsx.call(void 0, ve,{children:"Produkty"})}),_jsxruntime.jsxs.call(void 0, me,{className:"space-y-6",children:[_jsxruntime.jsx.call(void 0, "div",{className:"space-y-4",children:s.items.map((A,E)=>_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center gap-4",children:[A.imageUrl&&_jsxruntime.jsx.call(void 0, "img",{src:A.imageUrl,alt:A.name,className:"h-16 w-16 rounded object-cover"}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex-1",children:[_jsxruntime.jsx.call(void 0, "p",{className:"font-medium",children:A.name}),_jsxruntime.jsxs.call(void 0, "p",{className:"text-sm text-neutral-600",children:["Ilo\u015B\u0107: ",A.quantity]})]}),_jsxruntime.jsx.call(void 0, "div",{className:"text-right",children:_jsxruntime.jsx.call(void 0, "p",{className:"font-medium",children:vr(Number(A.price),A.currency)})})]},E))}),(s.deliveryAddress||s.deliveryMethod)&&_jsxruntime.jsxs.call(void 0, "div",{className:"border-t pt-4",children:[_jsxruntime.jsxs.call(void 0, "h3",{className:"mb-3 flex items-center font-semibold",children:[_jsxruntime.jsx.call(void 0, _lucidereact.Truck,{className:"mr-2 h-5 w-5"}),"Informacje o dostawie"]}),_jsxruntime.jsxs.call(void 0, "div",{className:"space-y-2",children:[s.deliveryAddress&&_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:"Adres:"})," ",_jsxruntime.jsx.call(void 0, "span",{className:h?"":"text-neutral-500",children:s.deliveryAddress})]}),s.deliveryMethod&&_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:"Metoda:"})," ",s.deliveryMethod]}),s.trackingNumber&&h&&_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:"Tracking:"})," ",s.trackingNumber]})]})]}),_jsxruntime.jsx.call(void 0, "div",{className:"border-t pt-4",children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex justify-between text-lg font-bold",children:[_jsxruntime.jsx.call(void 0, "span",{children:"Suma:"}),_jsxruntime.jsx.call(void 0, "span",{children:vr(Number(s.totalAmount),s.currency)})]})})]})]}),_jsxruntime.jsxs.call(void 0, ue,{children:[_jsxruntime.jsx.call(void 0, be,{children:_jsxruntime.jsxs.call(void 0, ve,{children:["Komentarze ",s.commentCount>0&&`(${s.commentCount})`]})}),_jsxruntime.jsxs.call(void 0, me,{children:[s.comments.length>0?_jsxruntime.jsx.call(void 0, "div",{className:"space-y-4",children:s.comments.map(A=>_jsxruntime.jsxs.call(void 0, "div",{className:"border-b pb-4 last:border-b-0",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"mb-1 flex items-center gap-2",children:[_jsxruntime.jsx.call(void 0, "span",{className:"font-medium",children:A.authorName||"System"}),_jsxruntime.jsx.call(void 0, "span",{className:"text-xs text-neutral-500",children:br(A.createdAt)}),A.authorType==="admin"&&_jsxruntime.jsx.call(void 0, "span",{className:"rounded bg-blue-100 px-2 py-0.5 text-xs text-blue-700",children:"Admin"})]}),_jsxruntime.jsx.call(void 0, "p",{className:h?"":"text-neutral-500",children:A.message})]},A.id))}):_jsxruntime.jsx.call(void 0, "p",{className:"text-neutral-600",children:"Brak komentarzy."}),h?_jsxruntime.jsx.call(void 0, vo,{orderID:s.orderId,email:d}):_jsxruntime.jsx.call(void 0, "div",{className:"mt-4",children:_jsxruntime.jsxs.call(void 0, _chunk6IACFTJRjs.q,{onClick:()=>g(!0),variant:"outline",className:"w-full",children:[_jsxruntime.jsx.call(void 0, _lucidereact.Lock,{className:"mr-2 h-4 w-4"}),"Zweryfikuj sw\xF3j email"]})})]})]}),u&&_jsxruntime.jsx.call(void 0, "div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:_jsxruntime.jsxs.call(void 0, ue,{className:"w-full max-w-md",children:[_jsxruntime.jsx.call(void 0, be,{children:_jsxruntime.jsx.call(void 0, ve,{children:"Zweryfikuj sw\xF3j email"})}),_jsxruntime.jsxs.call(void 0, me,{className:"space-y-4",children:[_jsxruntime.jsx.call(void 0, "p",{className:"text-sm text-neutral-700",children:"Podaj adres email u\u017Cyty przy sk\u0142adaniu zam\xF3wienia."}),_jsxruntime.jsxs.call(void 0, "div",{className:"space-y-2",children:[_jsxruntime.jsx.call(void 0, _chunkMLSKHOA3js.a,{htmlFor:"verify-email",children:"Adres email"}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.r,{id:"verify-email",type:"email",placeholder:"twoj@email.com",value:d,onChange:A=>l(A.target.value)})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"flex gap-2",children:[_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.q,{variant:"outline",onClick:()=>g(!1),className:"flex-1",children:"Anuluj"}),_jsxruntime.jsx.call(void 0, _chunk6IACFTJRjs.q,{onClick:q,className:"flex-1",children:"Zweryfikuj"})]})]})]})})]})})}function xo(e){return _jsxruntime.jsx.call(void 0, wo,{...e})}var Zt=xo;var No=({returnsAppearance:e,returnsTexts:t,analytics:r}={})=>{let{projectID:o,theme:n,loginURL:a,host:i}=_chunkDGUIG334js.j.call(void 0, ),c=_chunkDF2IK2GNjs.n.call(void 0, o,r,"panel"),d=_chunkDGUIG334js.k.call(void 0, o,i),l=_chunkDGUIG334js.m.call(void 0, o,i),{mutateAsync:u}=_chunk6IACFTJRjs.l.call(void 0, _chunk6IACFTJRjs.j.publicApi.userPanelLogout);async function g(){d&&await u({accessToken:d}),typeof window<"u"&&(_chunkDGUIG334js.n.call(void 0, o,i),window.location.reload())}let[k]=_react.useAutoAnimate.call(void 0, ),m=D=>["products","notifications","profile","plans","orders","order-details","returns","return-details","course"].includes(D),[v,C]=_n({product:void 0,state:"products",orderId:void 0,returnId:void 0,course:void 0,item:void 0}),[s,h]=_react3.useState.call(void 0, m(v.state)?v.state:"products"),R=D=>{C({state:"order-details",orderId:D}),h("order-details")},q=()=>{C({state:"orders",orderId:void 0}),h("orders")},F=D=>C({orderId:void 0,returnId:void 0,course:void 0,item:void 0,...D}),A=D=>{C({state:"course",course:D,item:void 0,product:void 0}),h("course")},E=()=>{C({state:"products",course:void 0,item:void 0,product:void 0}),h("products")};_react3.useEffect.call(void 0, ()=>{m(v.state)&&(v.state==="course"||s==="course")&&h(v.state)},[v.state]);let z={"--button-background-color":_nullishCoalesce(_optionalChain([n, 'optionalAccess', _77 => _77.colors, 'optionalAccess', _78 => _78.brand]), () => ("#000000")),"--button-background-color-dark":_nullishCoalesce(_optionalChain([n, 'optionalAccess', _79 => _79.colors, 'optionalAccess', _80 => _80.brandDark]), () => ("#ffffff")),"--button-text-color":_nullishCoalesce(_optionalChain([n, 'optionalAccess', _81 => _81.colors, 'optionalAccess', _82 => _82.brandDark]), () => ("#000000")),"--button-text-color-dark":_nullishCoalesce(_optionalChain([n, 'optionalAccess', _83 => _83.colors, 'optionalAccess', _84 => _84.brand]), () => ("#000000"))};return _react3.useEffect.call(void 0, ()=>{if(d==null||d.length===0){window.location.href=_nullishCoalesce(a, () => ("/panel/login"));return}},[]),_react3.useEffect.call(void 0, ()=>{if(d==null||d.length===0){window.location.href=_nullishCoalesce(a, () => ("/panel/login"));return}},[s]),_react3.useEffect.call(void 0, ()=>{if(typeof window>"u"||window.parent!==window||!d)return;let D=Je(window.location.search);D&&Qe(D);let $=_nullishCoalesce(D, () => (Ue()));$&&(window.location.href=Me($,d))},[d]),_jsxruntime.jsx.call(void 0, _chunkDF2IK2GNjs.l,{value:c,children:_jsxruntime.jsxs.call(void 0, "div",{ref:k,className:"font-inter relative min-h-screen w-screen bg-beige-100 text-black dark:bg-black dark:text-white md:flex",children:[_jsxruntime.jsx.call(void 0, fr,{activeScreen:s,setActiveScreen:h,setParams:F,styles:z,theme:n,logout:g}),_jsxruntime.jsxs.call(void 0, "main",{className:"flex h-[calc(100vh-80px)] flex-col overflow-y-auto w-full p-5 md:h-screen",children:[s==="products"&&_jsxruntime.jsx.call(void 0, ur,{projectID:_nullishCoalesce(o, () => ("")),accessToken:d,loginURL:_nullishCoalesce(a, () => ("/panel/login")),styles:z,activeScreen:s,params:v,setParams:C,openCourse:A}),s==="course"&&v.course&&d&&_jsxruntime.jsx.call(void 0, Vt,{accessId:v.course,accessToken:d,theme:n,itemId:v.item,onItemChange:D=>C({item:D}),onBack:E}),s==="notifications"&&_jsxruntime.jsx.call(void 0, Bn,{}),s==="plans"&&_jsxruntime.jsx.call(void 0, Jn,{projectID:_nullishCoalesce(o, () => (""))}),s==="orders"&&_jsxruntime.jsx.call(void 0, Wn,{projectID:_nullishCoalesce(o, () => ("")),accessToken:_nullishCoalesce(d, () => ("")),openOrderDetails:R}),s==="order-details"&&v.orderId&&_jsxruntime.jsx.call(void 0, Zt,{orderID:v.orderId,onBack:q}),(s==="returns"||s==="return-details")&&d&&_jsxruntime.jsx.call(void 0, Gt,{projectID:_nullishCoalesce(o, () => ("")),host:i,accessToken:d,loginURL:_nullishCoalesce(a, () => ("/panel/login")),appearance:zn(e,_optionalChain([n, 'optionalAccess', _85 => _85.colors, 'optionalAccess', _86 => _86.brand])),texts:t,screen:s,params:v,setParams:C,setActiveScreen:h}),s==="profile"&&_jsxruntime.jsx.call(void 0, yr,{email:l,logout:g})]})]})})},Io= exports.q =No;var _reactquery = require('@tanstack/react-query');var _connect = require('@connectrpc/connect');var _connectweb = require('@connectrpc/connect-web');var le;(o=>{function e(n){return _connect.createClient.call(void 0, _chunk6IACFTJRjs.f,r(n))}o.get=e;let t=new Map;function r(n){let a=t.get(n);return a==null&&(a=_connectweb.createConnectTransport.call(void 0, {useBinaryFormat:!0,baseUrl:n+"/api/rpc",interceptors:[_chunkERL4Z7M7js.b]}),t.set(n,a)),a}})(le = exports.a||={});var _zod = require('zod'); var _zod2 = _interopRequireDefault(_zod);function _(e,t=2){return+(Math.round(+(e+"e+"+t))+"e-"+t)}function Nr(e,t){let r=typeof navigator>"u"?"pl-PL":navigator.language;return Intl.NumberFormat(r,{style:"currency",currency:t,currencyDisplay:"symbol"}).format(e/100)}var jd=_zod2.default.object({event:_zod2.default.enum(["purchase","addToCart","customizeProduct","viewCart","removeFromCart","initiateCheckout","lead"]),step:_zod2.default.string().optional(),value:_zod2.default.number().optional(),currency:_zod2.default.string().optional(),content_name:_zod2.default.string().optional(),items:_zod2.default.array(_zod2.default.object({id:_zod2.default.string(),name:_zod2.default.string(),price:_zod2.default.number().default(0),currency:_zod2.default.string().default("PLN"),quantity:_zod2.default.number().default(1)})).optional()});function Jt(e){typeof window>"u"||(Ao(e),Do(e),Lo(e))}function Ao(e){try{typeof window.dataLayer>"u"&&(window.dataLayer=[]);let t=To(e);window.dataLayer.push(t)}catch(t){console.warn("cannot send google analytics event",t)}}function To(e){let t=_nullishCoalesce(_nullishCoalesce(e.value, () => (_optionalChain([e, 'access', _87 => _87.items, 'optionalAccess', _88 => _88.reduce, 'call', _89 => _89((a,i)=>a+(i.price||0)*(i.quantity||1),0)]))), () => (0)),r=_optionalChain([e, 'access', _90 => _90.items, 'optionalAccess', _91 => _91.map, 'call', _92 => _92(a=>({item_id:a.id,item_name:a.name||a.id,price:_((a.price||0)/100,2),quantity:a.quantity||1}))]),o={currency:e.currency||"PLN",value:_(t/100,2)};r&&r.length>0&&(o.items=r);let n;switch(e.event){case"purchase":n="purchase",o.transaction_id=e.step||`txn_${Date.now()}`;break;case"addToCart":n="add_to_cart";break;case"viewCart":n="view_cart";break;case"removeFromCart":n="remove_from_cart";break;case"initiateCheckout":n="begin_checkout";break;case"customizeProduct":n="customize_product";break;default:n=e.event}return{event:n,ecommerce:o,...e.step&&{step:e.step},...e.content_name&&{content_name:e.content_name}}}function Do(e){if(typeof window.fbq>"u")return;let t="",r="",o={};switch(e.event){case"purchase":t="track",r="Purchase",o={category_name:e.step,...e};break;case"lead":t="track",r="Lead",o={category_name:e.step,...e};break;case"addToCart":t="track",r="Add to Cart",o={category_name:e.step,...e};break;case"customizeProduct":t="track",r="Customize Product",o={category_name:e.step,...e};break;case"viewCart":t="track",r="View Cart",o={category_name:e.step,...e};break;case"removeFromCart":t="track",r="Remove from Cart",o={category_name:e.step,...e};break;case"initiateCheckout":t="track",r="Initiate Checkout",o={category_name:e.step,...e};break;default:break}window.location.search.includes("analytics")&&console.log("Pushing FB event",t,r,o),window.fbq(t,r,o)}function Lo(e){try{if(typeof window.ttq>"u")return;let t=Eo(e);if(!t)return;window.location.search.includes("analytics")&&console.log("Pushing TikTok event",t.eventName,t.eventPayload),window.ttq.track(t.eventName,t.eventPayload)}catch(t){console.warn("cannot send tiktok analytics event",t)}}function Eo(e){let t=_nullishCoalesce(_nullishCoalesce(e.value, () => (_optionalChain([e, 'access', _93 => _93.items, 'optionalAccess', _94 => _94.reduce, 'call', _95 => _95((a,i)=>a+(i.price||0)*(i.quantity||1),0)]))), () => (0)),r=_optionalChain([e, 'access', _96 => _96.items, 'optionalAccess', _97 => _97.map, 'call', _98 => _98(a=>({content_id:a.id,content_type:"product",content_name:a.name||a.id,quantity:a.quantity||1,price:_((a.price||0)/100,2)}))])||[];r.length===0&&e.content_name&&r.push({content_id:e.step||"unknown",content_type:"product",content_name:e.content_name,quantity:1,price:_(t/100,2)});let o={currency:e.currency||"PLN",value:_(t/100,2)};r.length>0&&(o.contents=r);let n=null;switch(e.event){case"purchase":n="Purchase";break;case"addToCart":n="AddToCart";break;case"initiateCheckout":n="InitiateCheckout";break;case"customizeProduct":n="CustomizeProduct";break;case"viewCart":return;case"removeFromCart":return;case"lead":return;default:return null}return{eventName:n,eventPayload:o}}function Ir(e){let{items:t,googlePayConfig:r,checkout:o,result:n,cartRequiresShipping:a}=e,i=_nullishCoalesce(e.locale, () => (_chunkERL4Z7M7js.m.call(void 0, )));if(n.totalAmount==null)return;let c=[];return a&&(c.push("SHIPPING_ADDRESS"),c.push("SHIPPING_OPTION")),{apiVersion:2,apiVersionMinor:0,callbackIntents:c,allowedPaymentMethods:[{type:"CARD",parameters:{allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["MASTERCARD","VISA"]},tokenizationSpecification:{type:"PAYMENT_GATEWAY",parameters:{gateway:r.gateway,gatewayMerchantId:r.gatewayId}}}],emailRequired:!0,shippingAddressParameters:{phoneNumberRequired:a},shippingAddressRequired:a,shippingOptionRequired:a,shippingOptionParameters:a?{shippingOptions:n.methods.slice(0,5).map(l=>({id:l.id,label:l.name+` - ${Nr(l.amount,n.currency)}`,description:_nullishCoalesce(l.description, () => (""))})),defaultSelectedOptionId:n.selectedDeliveryMethod}:void 0,merchantInfo:{merchantId:r.merchantId+"",merchantName:r.merchantName},transactionInfo:{totalPriceStatus:"FINAL",totalPriceLabel:_chunkERL4Z7M7js.j.call(void 0, "paymentForCart",i,e.texts),totalPrice:`${_(n.totalAmount/100,2)}`,currencyCode:n.currency,countryCode:n.country,checkoutOption:"COMPLETE_IMMEDIATE_PURCHASE",displayItems:Oo(t,n.methods,_nullishCoalesce(n.selectedDeliveryMethod, () => ((n.methods.length>0?n.methods[0].id:void 0))),o.couponCode,n.couponValue,_chunkERL4Z7M7js.j.call(void 0, "coupon",i,e.texts))}}}function Oo(e,t,r,o,n,a="Coupon"){let i=[],c=0;for(let l of e){if(l.details==null)continue;let u=_nullishCoalesce(_optionalChain([l, 'access', _99 => _99.details, 'access', _100 => _100.pricing, 'optionalAccess', _101 => _101.effectivePrice]), () => (l.details.price));c+=u*l.quantity,i.push({label:l.details.name+" x "+l.quantity,price:`${_(u/100,2)}`,type:"LINE_ITEM",status:"FINAL"})}let d=t.find(l=>l.id===r);return d!=null&&i.push({label:d.name,price:`${_(d.amount/100,2)}`,type:"SHIPPING_OPTION",status:"FINAL"}),o!=null&&n!=null&&i.push({label:`${a} ${o}`,price:`${_(n/100,2)}`,type:"DISCOUNT",status:"FINAL"}),c>0&&i.push({label:"Subtotal",price:`${_(c/100,2)}`,type:"SUBTOTAL",status:"FINAL"}),i}function nt(e,t){return`${_chunkERL4Z7M7js.f}/api/integrations/${e}/public-commerce${t}`}function ke(e){return typeof e=="object"&&e!=null&&"ERR"in e}function G(e,t,r){return{ERR:!0,error:e,type:t,data:r}}function Sr(e,t){return _optionalChain([t, 'optionalAccess', _102 => _102.find, 'call', _103 => _103(r=>r.id===e||(_nullishCoalesce(_optionalChain([r, 'access', _104 => _104.variants, 'optionalAccess', _105 => _105.some, 'call', _106 => _106(o=>o.id===e)]), () => (!1))))])}function Rr(e,t){let r=new Set(t.map(o=>o.productID));return Array.from(new Set(e.filter(o=>!r.has(o))))}function Ar(e,t){let r=_optionalChain([e, 'optionalAccess', _107 => _107.trim, 'call', _108 => _108()]);if(!(r==null||r.length===0))try{let o=new URL(r,t);return o.protocol!=="http:"&&o.protocol!=="https:"?void 0:o.href}catch (e6){return}}var _zustand = require('zustand');var Fe=_zustand.create.call(void 0, e=>({isCartVisible:!1,notice:void 0,setNotice:t=>e(r=>({...r,notice:t})),numberOfProductsInCart:0,showCart:()=>e(t=>({...t,isCartVisible:!0})),hideCart:()=>e(t=>({...t,isCartVisible:!1})),setNumberOfProductsInCart:t=>e(r=>({...r,numberOfProductsInCart:t}))}));var vt=_react3.createContext.call(void 0, {});function Yd({texts:e,locale:t,children:r}){let o=_react3.useMemo.call(void 0, ()=>({texts:e,locale:t}),[e,t]);return _jsxruntime.jsx.call(void 0, vt.Provider,{value:o,children:r})}function Dr(){return _react3.useContext.call(void 0, vt)}function Xd(e){let{texts:t,locale:r}=_react3.useContext.call(void 0, vt);return _chunkERL4Z7M7js.j.call(void 0, e,_nullishCoalesce(r, () => (_chunkERL4Z7M7js.m.call(void 0, ))),t)}function el(){let{texts:e,locale:t}=_react3.useContext.call(void 0, vt),r=_nullishCoalesce(t, () => (_chunkERL4Z7M7js.m.call(void 0, )));return _react3.useMemo.call(void 0, ()=>o=>_chunkERL4Z7M7js.j.call(void 0, o,r,e),[r,e])}var Xt="bitsnap-pending-order";function Or(e,t){let r=new Map;for(let n of t)r.set(n.id,(_nullishCoalesce(r.get(n.id), () => (0)))+n.quantity);let o=[];for(let n of e){let a=r.get(n.id);a==null?o.push(n):n.quantity>a&&o.push({...n,quantity:n.quantity-a})}return o}var _o=60*1e3;function Ur(e,t=Date.now,r=_o){let o;return n=>{let a=`${n.orderId}:${n.ts}`,i=t();return _optionalChain([o, 'optionalAccess', _109 => _109.key])===a&&i-o.at<r?Promise.reject(new Error("pending order was asked about recently")):(o={key:a,at:i},e(n))}}function zo(e){if(!(e==null||e.length===0))try{let t=new URL(e,"https://bitsnap.invalid").pathname,r=/\/payment\/common\/([^/]+)\/([^/]+)\/?$/.exec(t);return r==null?void 0:{projectId:decodeURIComponent(r[1]),orderId:decodeURIComponent(r[2])}}catch (e7){return}}function qo(e,t=Date.now(),r={}){let o=zo(e.url),n=_nullishCoalesce(Lr(e.orderId), () => (_optionalChain([o, 'optionalAccess', _110 => _110.orderId]))),a=_nullishCoalesce(Lr(e.projectId), () => (_optionalChain([o, 'optionalAccess', _111 => _111.projectId])));if(!(n==null||a==null))return{orderId:n,projectId:a,...r.cartProjectId!=null?{cartProjectId:r.cartProjectId}:{},lines:_nullishCoalesce(r.lines, () => ([])),ts:t}}function rl(e,t={}){let r=qo(e,t.now,t);return r!=null&&Fo(r,t.storage)}function Lr(e){return e!=null&&e.length>0?e:void 0}function wt(){try{return typeof localStorage>"u"?void 0:localStorage}catch (e8){return}}function Fo(e,t=wt()){try{return _optionalChain([t, 'optionalAccess', _112 => _112.setItem, 'call', _113 => _113(Xt,JSON.stringify(e))]),t!=null}catch (e9){return!1}}function Er(e=wt()){try{let t=_optionalChain([e, 'optionalAccess', _114 => _114.getItem, 'call', _115 => _115(Xt)]);if(t==null)return;let r=JSON.parse(t);if(typeof r=="object"&&r!=null&&typeof r.orderId=="string"&&typeof r.projectId=="string"&&typeof r.ts=="number"&&r.orderId.length>0){let{orderId:o,projectId:n,cartProjectId:a,ts:i,lines:c}=r;return{orderId:o,projectId:n,...typeof a=="string"?{cartProjectId:a}:{},lines:Array.isArray(c)?c.filter(d=>typeof _optionalChain([d, 'optionalAccess', _116 => _116.id])=="string"&&typeof d.quantity=="number"):[],ts:i}}}catch (e10){}Yt(e)}function Yt(e=wt()){try{_optionalChain([e, 'optionalAccess', _117 => _117.removeItem, 'call', _118 => _118(Xt)])}catch (e11){}}function Mr(e){let t=_nullishCoalesce(_optionalChain([e, 'access', _119 => _119.details, 'optionalAccess', _120 => _120.status]), () => (Bo(_optionalChain([e, 'access', _121 => _121.details, 'optionalAccess', _122 => _122.$unknown]))));return t==="created"||t==="paid"||t==="canceled"?t:"unknown"}function Bo(e){if(Array.isArray(e)){for(let t of e)if(_optionalChain([t, 'optionalAccess', _123 => _123.no])===3&&t.wireType===2&&t.data instanceof Uint8Array){let r=0,o=0;for(let n=0;o<t.data.length&&n<35;n+=7){let a=t.data[o++];if(r|=(a&127)<<n,!(a&128))break}if(o+r!==t.data.length)return;try{return new TextDecoder().decode(t.data.subarray(o))}catch (e12){return}}}}async function jr(e){let t=_nullishCoalesce(e.storage, () => (wt())),r=Er(t);if(r==null)return"none";if((_nullishCoalesce(e.now, () => (Date.now)))()-r.ts>864e5)return Yt(t),"expired";if(e.projectId!=null&&r.cartProjectId!=null&&r.cartProjectId!==e.projectId)return"pending";let n;try{n=await e.fetchStatus(r)}catch (e13){return"pending"}let a=Er(t);if(_optionalChain([a, 'optionalAccess', _124 => _124.orderId])!==r.orderId||a.ts!==r.ts)return"pending";if(n==="paid"){try{await e.removeLines(r.lines)}catch (e14){return"pending"}return Yt(t),"paid"}return"pending"}var Ko="__m_a",Fr=_react3.createContext.call(void 0, void 0),rn= exports.I =void 0;function Tl(e){_chunkDGUIG334js.a.call(void 0, {projectID:e}),rn= exports.I =e,typeof window<"u"&&_chunkDGUIG334js.g.call(void 0, [window.location.origin])}function rt(){return _nullishCoalesce(_nullishCoalesce(rn, () => (_optionalChain([document, 'access', _125 => _125.querySelector, 'call', _126 => _126('script[data-id][data-name="internal-cart"]'), 'optionalAccess', _127 => _127.getAttribute, 'call', _128 => _128("data-id")]))), () => (void 0))}function Zo(){return _nullishCoalesce(_optionalChain([document, 'access', _129 => _129.querySelector, 'call', _130 => _130('script[data-id][data-name="internal-cart"]'), 'optionalAccess', _131 => _131.getAttribute, 'call', _132 => _132("data-custom-host")]), () => (void 0))}var Jo=({children:e,locale:t})=>{let[r]=_react3.useState.call(void 0, ()=>new _reactquery.QueryClient),o=Dr();_react3.useEffect.call(void 0, ()=>{Ge()},[]);let n=rt();if(_react3.useEffect.call(void 0, ()=>{if(n==null)return;let i=()=>{Xo(n).then(d=>{d==="paid"&&r.invalidateQueries({queryKey:["cart"]})})},c=()=>{document.visibilityState==="visible"&&i()};return i(),window.addEventListener("pageshow",i),document.addEventListener("visibilitychange",c),()=>{window.removeEventListener("pageshow",i),document.removeEventListener("visibilitychange",c)}},[n,r]),n==null)return _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{});let a=on(n,_nullishCoalesce(t, () => (o.locale)),o.texts);return _jsxruntime.jsx.call(void 0, _reactquery.QueryClientProvider,{client:r,children:_jsxruntime.jsx.call(void 0, Fr.Provider,{value:a,children:e})})},en,Qo=Ur(async e=>Mr(await le.get(_chunkERL4Z7M7js.f).getOrder({id:e.orderId,projectId:e.projectId})));function Dl(){let{country:e,couponCode:t,selectedDeliveryMethod:r,postalCode:o}=_nullishCoalesce(L(), () => (kt));return{country:e,couponCode:t,selectedDeliveryMethod:r,postalCode:o}}function Ll(){return(_nullishCoalesce(_optionalChain([L, 'call', _133 => _133(), 'optionalAccess', _134 => _134.products]), () => ([]))).map(e=>({id:e.id,quantity:e.quantity}))}function Yo(e){let t=L();Y({...t,products:Or(_nullishCoalesce(_optionalChain([t, 'optionalAccess', _135 => _135.products]), () => ([])),e)}),Ge()}function Xo(e){return en??=jr({projectId:e,fetchStatus:Qo,removeLines:Yo}).catch(t=>{console.warn("cannot check the pending order",t)}).finally(()=>{en=void 0}),en}var Be=async(e,t)=>{let r=[];_optionalChain([t, 'optionalAccess', _136 => _136.items])!=null&&t.items.length>0?r=t.items:r=_nullishCoalesce(_optionalChain([L, 'call', _137 => _137(), 'optionalAccess', _138 => _138.products]), () => ([]));let o=Array.from(new Set(r.map(i=>i.productID)));if(o.length===0)return[];let n=new URLSearchParams;n.set("ids",o.join(",")),n.set("locale",_nullishCoalesce(_optionalChain([t, 'optionalAccess', _139 => _139.locale]), () => (_chunkERL4Z7M7js.m.call(void 0, ))));let a;try{let i=await fetch(_chunkERL4Z7M7js.c.call(void 0, nt(e,`/products?${n.toString()}`)),{method:"GET"});if(i.status!=200)return G("products-load-failed","internal");a=await i.json()}catch(i){return console.warn("cannot load the products of the cart",i),G("products-load-failed","internal")}return r.flatMap(i=>{let c=Sr(i.productID,a.result);return c==null?[]:[{...i,details:oi(i.productID,c),catalogProductID:c.id}]})},El= exports.O =()=>{let e=_react3.useContext.call(void 0, Fr);if(e===void 0)throw new Error("useCartProvider must be used within a CartProvider");return e},Ol= exports.P =Jo,ei=_zod2.default.object({isAvailable:_zod2.default.boolean(),merchantId:_zod2.default.string(),merchantName:_zod2.default.string(),gateway:_zod2.default.string(),gatewayId:_zod2.default.string()}),ti=_zod2.default.object({id:_zod2.default.string(),productID:_zod2.default.string(),quantity:_zod2.default.number(),priceVersion:_zod2.default.string().optional(),metadata:_zod2.default.record(_zod2.default.string(),_zod2.default.string().optional()).optional(),url:_zod2.default.string().optional()}),ni=_zod2.default.object({country:_zod2.default.string().optional(),couponCode:_zod2.default.string().optional(),selectedDeliveryMethod:_zod2.default.string().optional(),postalCode:_zod2.default.string().optional(),email:_zod2.default.string().optional(),products:_zod2.default.array(ti).optional(),googlePayConfig:ei.optional()}),kt={country:void 0,couponCode:void 0,email:void 0,selectedDeliveryMethod:void 0,postalCode:void 0,products:[],googlePayConfig:void 0},Br="checkout";function L(){try{let e=localStorage.getItem(Br);return e==null?kt:ni.parse(JSON.parse(e))}catch (e15){return kt}}async function zr(e,t){let r=await Be(e,{items:t.map((a,i)=>({...a,id:`price-check-${i}`}))});if(ke(r))return r;let o=Rr(t.map(a=>a.productID),r);if(o.length>0)return G("item-ids-not-found","notFound",o);let n=L();n.products==null&&(n.products=[]),n.products.push(...t.map(a=>({id:Math.random().toString(36).substring(7),productID:a.productID,quantity:a.quantity,priceVersion:_optionalChain([r, 'access', _140 => _140.find, 'call', _141 => _141(i=>i.productID===a.productID), 'optionalAccess', _142 => _142.details, 'optionalAccess', _143 => _143.pricing, 'optionalAccess', _144 => _144.priceVersion]),metadata:a.metadata,url:Ar(a.url,typeof window<"u"?window.location.href:void 0)}))),ri(t,r),Jt({event:"addToCart",currency:"PLN",items:t.map(a=>({id:a.productID,name:_nullishCoalesce(a.name, () => ("")),price:_nullishCoalesce(a.price, () => (0)),quantity:a.quantity,currency:_nullishCoalesce(a.currency, () => ("PLN"))}))}),Y(n),Ge()}function ri(e,t){for(let r of e)try{let o=t.find(c=>c.productID===r.productID),n=_nullishCoalesce(_nullishCoalesce(_optionalChain([o, 'optionalAccess', _145 => _145.details, 'optionalAccess', _146 => _146.pricing, 'optionalAccess', _147 => _147.effectivePrice]), () => (_optionalChain([o, 'optionalAccess', _148 => _148.details, 'optionalAccess', _149 => _149.price]))), () => (r.price)),a=_nullishCoalesce(_optionalChain([o, 'optionalAccess', _150 => _150.details, 'optionalAccess', _151 => _151.currency]), () => (r.currency));if(n==null||a==null)continue;let i=_nullishCoalesce(_optionalChain([o, 'optionalAccess', _152 => _152.catalogProductID]), () => (r.productID));(_nullishCoalesce(r.analytics, () => (_chunkDF2IK2GNjs.o.call(void 0, )))).track("add_to_cart",{qty:r.quantity,value_minor:Math.round(n*r.quantity),currency:a},{product_id:i,variant_id:i!==r.productID?r.productID:null})}catch (e16){}}function qr(e){let t=L(),r={...t,products:_optionalChain([t, 'optionalAccess', _153 => _153.products, 'optionalAccess', _154 => _154.filter, 'call', _155 => _155(o=>!e.includes(o.productID)&&!e.includes(o.id))])};Jt({event:"removeFromCart",items:e.map(o=>({id:o,name:"",price:0,quantity:1,currency:"PLN"}))}),Y(r),Ge()}function Y(e){localStorage.setItem(Br,JSON.stringify(e))}var on=(e,t=_chunkERL4Z7M7js.m.call(void 0, ),r)=>{let o=Zo();return o!=null&&_chunkERL4Z7M7js.g.call(void 0, o),{async checkIfApplePayIsAvailable(){if(typeof window>"u"||typeof document>"u"||!("ApplePaySession"in window))return!1;try{return(await le.get(_chunkERL4Z7M7js.f).isOneClickPaymentAvailable({projectId:e})).applePay}catch(n){return console.error("Error checking if Apple Pay is available",n),!1}},async getGooglePayConfiguration(n){if(typeof window>"u"||typeof document>"u")return{isAvailable:!1};try{let a=await ai(e);if(_optionalChain([a, 'optionalAccess', _156 => _156.isAvailable])!=!0)return{isAvailable:!1};let i=L();if(i==null)return console.log("checkout is null"),{isAvailable:!1};let c=await Be(e,{locale:t,items:n.items.map(g=>({id:Math.random().toString(36).substring(7),quantity:g.quantity,metadata:g.metadata,productID:g.productID}))});if(ke(c))return{isAvailable:!1};let d=await le.get(_chunkERL4Z7M7js.f).getPreOrderDetails({items:c.map(g=>_protobuf.create.call(void 0, _chunk6IACFTJRjs.c,{id:g.productID,quantity:g.quantity})),projectId:e,postCode:i.postalCode,couponCode:i.couponCode,countryCode:i.country,selectedDeliveryMethod:i.selectedDeliveryMethod});if(d.totalAmount==null)return{isAvailable:!1};let l=c.find(g=>_optionalChain([g, 'access', _157 => _157.details, 'optionalAccess', _158 => _158.isDeliverable])==!0)!=null,u=await Ir({items:c,googlePayConfig:a,checkout:i,cartRequiresShipping:l,result:d,locale:t,texts:r});return u==null?{isAvailable:!1}:{isAvailable:!0,config:u}}catch(a){return console.error("Error resolving Google Pay configuration",a),{isAvailable:!1}}},async clearCart(){let n=structuredClone(kt);n.country=_optionalChain([L, 'call', _159 => _159(), 'optionalAccess', _160 => _160.country]),Y(n),Ge()},async getAvailableCountries(){let n=await fetch(_chunkERL4Z7M7js.c.call(void 0, nt(e,"/countries")),{method:"GET"});if(n.status!=200)return[];try{return _zod2.default.array(_zod2.default.object({name:_zod2.default.string(),code:_zod2.default.string()})).parse(await n.json())}catch(a){return G(a.toString(),"internal")}},async getCountry(){let n=_optionalChain([L, 'call', _161 => _161(), 'optionalAccess', _162 => _162.country]);if(n==null){n="PL";let a=L();a.country=n,Y(a)}return n},async getNumberOfElementsInCart(){return _nullishCoalesce(_optionalChain([L, 'call', _163 => _163(), 'optionalAccess', _164 => _164.products, 'optionalAccess', _165 => _165.reduce, 'call', _166 => _166((n,a)=>n+a.quantity,0)]), () => (0))},async getProducts(){return await Be(e,{locale:t})},async removeProductFromCart(n){return qr([n.id])},async setCountry(n){let a=L();a.country=n,Y(a)},async setCouponCodeIfPossible(n){let a=L();a.couponCode=n,Y(a)},async setPostalCode(n){let a=L();a.postalCode=n,Y(a)},async setDeliveryMethod(n){let a=L();a.selectedDeliveryMethod=n,Y(a)},async setEmail(n){let a=L();a.email=n,Y(a)},async addProduct(n){return await zr(e,[n])},async updateQuantity(n){let a=L();a.products=_optionalChain([a, 'access', _167 => _167.products, 'optionalAccess', _168 => _168.map, 'call', _169 => _169(i=>(i.id===n.id&&(i.quantity=n.quantity),i))]),Y(a),Ge()},async redirectToNextStep(){let n=L();if(n.products==null||n.products.length==0)return G("cart-is-empty","badInput");let a=n.products.reduce((d,l)=>(l.metadata!=null&&Object.keys(l.metadata).forEach(u=>{let g=_optionalChain([l, 'access', _170 => _170.metadata, 'optionalAccess', _171 => _171[u]]);g!=null&&(d[u]=g)}),d),{}),i={items:n.products.map(d=>({id:d.productID,quantity:d.quantity,priceVersion:d.priceVersion})),askForNote:!0,countries:n.country?[n.country]:void 0,metadata:a,locale:t},c=await nn(i);return ke(c)?(console.warn("cannot create payment URL",c.error),c):{url:c.url,...c.orderId!=null?{orderId:c.orderId}:{},...c.projectId!=null?{projectId:c.projectId}:{}}},async justRedirectToPayment(n){let a={items:[{id:n.productID,quantity:1}],askForNote:!1,details:n.email||n.name?{name:n.name,email:n.email}:void 0,locale:_nullishCoalesce(n.locale, () => (t))};a=an(a),n.country==null&&(n.country="pl"),a.details==null&&(a.details={}),a.details.address==null&&(a.details.address={}),a.details.address.country=n.country,n.marketingAgreement===!0&&(a.additionalAgreements=[{id:Ko,name:"",required:!0,answer:!0}]);let i=await nn(a);return ke(i)?i:{url:i.url}},async getApplePayPreview(n){let a=L();try{let i=await le.get(_chunkERL4Z7M7js.f).getPreOrderDetails({items:n.items.map(c=>_protobuf.create.call(void 0, _chunk6IACFTJRjs.c,{id:c.productID,quantity:c.quantity})),projectId:e,postCode:a.postalCode,couponCode:a.couponCode,countryCode:a.country,selectedDeliveryMethod:a.selectedDeliveryMethod});return i.totalAmount==null||i.currency.length===0?G("pre-order-unavailable","internal"):{countryCode:i.country||a.country||"PL",currencyCode:i.currency,totalAmount:`${_(i.totalAmount/100,2)}`}}catch(i){return console.warn("cannot load the Apple Pay preview",i),G("pre-order-unavailable","internal")}},async completeApplePayPayment(n){let a=L();if(a==null)return G("Checkout not found");let i=await Be(e,{locale:t});if(ke(i))return i;try{let c=_optionalChain([n, 'access', _172 => _172.shippingContact, 'optionalAccess', _173 => _173.givenName]);_optionalChain([n, 'access', _174 => _174.shippingContact, 'optionalAccess', _175 => _175.familyName])!=null?c+=" "+_optionalChain([n, 'access', _176 => _176.shippingContact, 'optionalAccess', _177 => _177.familyName]):_optionalChain([n, 'access', _178 => _178.billingContact, 'optionalAccess', _179 => _179.familyName])!=null&&(c+=" "+_optionalChain([n, 'access', _180 => _180.billingContact, 'optionalAccess', _181 => _181.familyName]));let d={},l=xt();l!=null&&(d.ref=l);let u=await le.get(_chunkERL4Z7M7js.f).authorizeOneClickPayment({gateway:0,paymentData:JSON.stringify(n.token.paymentData),paymentMethod:JSON.stringify(n.token.paymentMethod),transactionIdentifier:n.token.transactionIdentifier,order:_protobuf.create.call(void 0, _chunk6IACFTJRjs.d,{items:i.map(g=>({id:g.productID,quantity:g.quantity})),couponCode:a.couponCode,email:_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([n, 'access', _182 => _182.shippingContact, 'optionalAccess', _183 => _183.emailAddress]), () => (_optionalChain([n, 'access', _184 => _184.billingContact, 'optionalAccess', _185 => _185.emailAddress]))), () => (a.email)), () => (void 0)),phone:_nullishCoalesce(_nullishCoalesce(_optionalChain([n, 'access', _186 => _186.shippingContact, 'optionalAccess', _187 => _187.phoneNumber]), () => (_optionalChain([n, 'access', _188 => _188.billingContact, 'optionalAccess', _189 => _189.phoneNumber]))), () => (void 0)),selectedDeliveryMethod:a.selectedDeliveryMethod,postCode:a.postalCode,projectId:e}),shippingAddress:_protobuf.create.call(void 0, _chunk6IACFTJRjs.a,{line1:_nullishCoalesce(_optionalChain([n, 'access', _190 => _190.shippingContact, 'optionalAccess', _191 => _191.addressLines, 'optionalAccess', _192 => _192[0]]), () => ("")),city:_nullishCoalesce(_optionalChain([n, 'access', _193 => _193.shippingContact, 'optionalAccess', _194 => _194.locality]), () => ("")),country:_nullishCoalesce(_optionalChain([n, 'access', _195 => _195.shippingContact, 'optionalAccess', _196 => _196.countryCode]), () => ("")),zipCode:_nullishCoalesce(_optionalChain([n, 'access', _197 => _197.shippingContact, 'optionalAccess', _198 => _198.postalCode]), () => ("")),name:c}),billingAddress:_protobuf.create.call(void 0, _chunk6IACFTJRjs.b,{name:_nullishCoalesce(_optionalChain([n, 'access', _199 => _199.billingContact, 'optionalAccess', _200 => _200.givenName]), () => (" "+(_nullishCoalesce(_optionalChain([n, 'access', _201 => _201.billingContact, 'optionalAccess', _202 => _202.familyName]), () => (""))))),line1:_nullishCoalesce(_optionalChain([n, 'access', _203 => _203.billingContact, 'optionalAccess', _204 => _204.addressLines, 'optionalAccess', _205 => _205[0]]), () => ("")),city:_nullishCoalesce(_optionalChain([n, 'access', _206 => _206.billingContact, 'optionalAccess', _207 => _207.locality]), () => ("")),country:_nullishCoalesce(_optionalChain([n, 'access', _208 => _208.billingContact, 'optionalAccess', _209 => _209.countryCode]), () => ("")),zipCode:_nullishCoalesce(_optionalChain([n, 'access', _210 => _210.billingContact, 'optionalAccess', _211 => _211.postalCode]), () => (""))}),metadata:Object.keys(d).length>0?JSON.stringify(d):void 0});return{isSuccess:u.isSuccess,redirectURL:u.redirectUrl}}catch(c){return console.error(c),G("Failed to authorize payment")}},async completeGooglePayPayment(n){let a=L();if(a==null)return G("Checkout not found");let i=await Be(e,{locale:t});if(ke(i))return i;try{let c=_optionalChain([n, 'access', _212 => _212.paymentData, 'access', _213 => _213.shippingAddress, 'optionalAccess', _214 => _214.name]),d={},l=xt();l!=null&&(d.ref=l);let u=await le.get(_chunkERL4Z7M7js.f).authorizeOneClickPayment({gateway:1,paymentData:n.paymentData.paymentMethodData.tokenizationData.token,paymentMethod:n.paymentData.paymentMethodData.type,transactionIdentifier:"",order:_protobuf.create.call(void 0, _chunk6IACFTJRjs.d,{items:i.map(g=>({id:g.productID,quantity:g.quantity})),couponCode:a.couponCode,email:_nullishCoalesce(n.paymentData.email, () => (void 0)),phone:_nullishCoalesce(_optionalChain([n, 'access', _215 => _215.paymentData, 'access', _216 => _216.shippingAddress, 'optionalAccess', _217 => _217.phoneNumber]), () => (void 0)),selectedDeliveryMethod:_nullishCoalesce(_optionalChain([n, 'access', _218 => _218.paymentData, 'access', _219 => _219.shippingOptionData, 'optionalAccess', _220 => _220.id]), () => (a.selectedDeliveryMethod)),postCode:_optionalChain([n, 'access', _221 => _221.paymentData, 'access', _222 => _222.shippingAddress, 'optionalAccess', _223 => _223.postalCode]),projectId:e}),shippingAddress:_protobuf.create.call(void 0, _chunk6IACFTJRjs.a,{line1:_nullishCoalesce(_optionalChain([n, 'access', _224 => _224.paymentData, 'access', _225 => _225.shippingAddress, 'optionalAccess', _226 => _226.address1]), () => ("")),city:_nullishCoalesce(_optionalChain([n, 'access', _227 => _227.paymentData, 'access', _228 => _228.shippingAddress, 'optionalAccess', _229 => _229.locality]), () => ("")),country:_nullishCoalesce(_optionalChain([n, 'access', _230 => _230.paymentData, 'access', _231 => _231.shippingAddress, 'optionalAccess', _232 => _232.countryCode]), () => ("")),zipCode:_nullishCoalesce(_optionalChain([n, 'access', _233 => _233.paymentData, 'access', _234 => _234.shippingAddress, 'optionalAccess', _235 => _235.postalCode]), () => ("")),name:c}),billingAddress:_protobuf.create.call(void 0, _chunk6IACFTJRjs.b,{name:_optionalChain([n, 'access', _236 => _236.paymentData, 'access', _237 => _237.paymentMethodData, 'access', _238 => _238.info, 'optionalAccess', _239 => _239.billingAddress, 'optionalAccess', _240 => _240.name]),line1:_nullishCoalesce(_optionalChain([n, 'access', _241 => _241.paymentData, 'access', _242 => _242.paymentMethodData, 'access', _243 => _243.info, 'optionalAccess', _244 => _244.billingAddress, 'optionalAccess', _245 => _245.address1]), () => ("")),city:_nullishCoalesce(_optionalChain([n, 'access', _246 => _246.paymentData, 'access', _247 => _247.paymentMethodData, 'access', _248 => _248.info, 'optionalAccess', _249 => _249.billingAddress, 'optionalAccess', _250 => _250.locality]), () => ("")),country:_nullishCoalesce(_optionalChain([n, 'access', _251 => _251.paymentData, 'access', _252 => _252.paymentMethodData, 'access', _253 => _253.info, 'optionalAccess', _254 => _254.billingAddress, 'optionalAccess', _255 => _255.countryCode]), () => ("")),zipCode:_nullishCoalesce(_optionalChain([n, 'access', _256 => _256.paymentData, 'access', _257 => _257.paymentMethodData, 'access', _258 => _258.info, 'optionalAccess', _259 => _259.billingAddress, 'optionalAccess', _260 => _260.postalCode]), () => (""))}),metadata:Object.keys(d).length>0?JSON.stringify(d):void 0});return{isSuccess:u.isSuccess,redirectURL:u.redirectUrl}}catch(c){return console.error(c),G("Failed to authorize payment")}return{isSuccess:!0}},async getApplePayPaymentRequest(n){let a=L();if(a==null)return G("Checkout not found");n&&n.expectedItems!=null&&n.expectedItems.length>0&&(a.products&&qr(a.products.map(l=>l.productID)),await zr(e,n.expectedItems));let i=await Be(e,{locale:t});if(ke(i))return i;let c=await le.get(_chunkERL4Z7M7js.f).getPreOrderDetails({items:i.map(l=>_protobuf.create.call(void 0, _chunk6IACFTJRjs.c,{id:l.productID,quantity:l.quantity})),projectId:e,postCode:a.postalCode,couponCode:a.couponCode,countryCode:a.country,selectedDeliveryMethod:a.selectedDeliveryMethod}),d=i.map(l=>({amount:`${_(l.quantity*(_nullishCoalesce(_nullishCoalesce(_optionalChain([l, 'access', _261 => _261.details, 'optionalAccess', _262 => _262.pricing, 'optionalAccess', _263 => _263.effectivePrice]), () => (_optionalChain([l, 'access', _264 => _264.details, 'optionalAccess', _265 => _265.price]))), () => (0)))/100,2)}`,label:_optionalChain([l, 'access', _266 => _266.details, 'optionalAccess', _267 => _267.name])+" - "+l.quantity,type:"final"}));if(c.selectedDeliveryMethod!=null){let l=c.methods.find(u=>u.id==c.selectedDeliveryMethod);l!=null&&d.push({amount:`${_(l.amount/100,2)}`,label:l.name,type:"final"})}return c.couponCode!=null&&c.couponValue!=null&&d.push({amount:`-${_(c.couponValue/100,2)}`,label:c.couponCode,type:"final"}),{countryCode:c.country||a.country||"PL",merchantCapabilities:["supports3DS","supportsCredit","supportsDebit"],supportedNetworks:["visa","masterCard"],total:{amount:`${_((_nullishCoalesce(c.totalAmount, () => (0)))/100,2)}`,label:_chunkERL4Z7M7js.j.call(void 0, "paymentForCart",t,r),type:"final"},shippingMethods:c.methods.map(l=>({amount:`${_(l.amount/100,2)}`,detail:_nullishCoalesce(l.description, () => ("")),identifier:l.id,label:l.name,dateComponentsRange:{startDateComponents:{days:_nullishCoalesce(l.minDays, () => (1)),hours:0,months:0,years:0},endDateComponents:{days:_nullishCoalesce(l.maxDays, () => (14)),hours:0,months:0,years:0}}})),lineItems:d,currencyCode:c.currency||_optionalChain([i, 'access', _268 => _268[0], 'optionalAccess', _269 => _269.details, 'optionalAccess', _270 => _270.currency])||"PLN"}}}};async function ai(e){let t=L();if(_optionalChain([t, 'access', _271 => _271.googlePayConfig, 'optionalAccess', _272 => _272.isAvailable])!=!0){let r=await le.get(_chunkERL4Z7M7js.f).isOneClickPaymentAvailable({projectId:e});r.googlePay==!0&&r.googlePayConfig!=null?t.googlePayConfig={isAvailable:!0,gateway:r.googlePayConfig.gateway,gatewayId:r.googlePayConfig.gatewayMerchantId,merchantName:r.googlePayConfig.merchantName,merchantId:r.googlePayConfig.merchantId}:t.googlePayConfig={isAvailable:!1,gateway:"",gatewayId:"",merchantName:"",merchantId:""}}return Y(t),t.googlePayConfig}function oi(e,t){if(e==t.id){let o=_optionalChain([t, 'access', _273 => _273.variants, 'optionalAccess', _274 => _274.findIndex, 'call', _275 => _275(n=>n.id===e)]);if(o!=null&&o!=-1){let n=t.variants[o];return{...t,availableQuantity:n.availableQuantity,isDeliverable:n.isDeliverable,images:_nullishCoalesce(n.images, () => (t.images)),name:t.name+" "+n.name,baseName:t.name,variantName:n.name,price:n.price,currency:n.currency,pricing:n.pricing}}return t}let r=_optionalChain([t, 'access', _276 => _276.variants, 'optionalAccess', _277 => _277.find, 'call', _278 => _278(o=>o.id===e)]);return r==null?t:{...t,id:r.id,name:t.name+" "+r.name,baseName:t.name,variantName:r.name,price:r.price,currency:r.currency,pricing:r.pricing,metadata:t.metadata,availableQuantity:r.availableQuantity,isDeliverable:r.isDeliverable,images:_nullishCoalesce(r.images, () => (t.images))}}function Ge(){let e=L(),t=0;if(e==null){Fe.setState(r=>({...r,numberOfProductsInCart:t}));return}t=_nullishCoalesce(_optionalChain([e, 'access', _279 => _279.products, 'optionalAccess', _280 => _280.reduce, 'call', _281 => _281((r,o)=>r+o.quantity,0)]), () => (0)),Fe.setState(r=>({...r,numberOfProductsInCart:t}))}var si=200,ci= exports.v ="item-ids-not-found",at="internal-error",Gr={"no-payment-gateway":"noPaymentGateway","gateway-not-configured":"gatewayNotConfigured","shipping-not-configured":"shippingNotConfigured","mixed-recurring":"mixedRecurring","currency-unsupported":"currencyUnsupported","price-changed":"priceChanged","product-not-found":"unavailableProducts","product-not-available":"unavailableProducts"},di=new Set(["internal","invalid-request"]),li=new Set(["product-not-available","product-not-found"]);function ui(e){return typeof e=="string"&&Object.hasOwn(Gr,e)?Gr[e]:void 0}function mi(e){return/<\/?[a-z!?][^>]*>/i.test(e)}function pi(e){return/^[A-Za-z][A-Za-z0-9]*(?:[-_.:][A-Za-z0-9]+)*$/.test(e)&&!/^[A-Z][a-z]+$/.test(e)||/^\[object \w+\]$|^(?:undefined|null)$/.test(e)}function fi(e){return/Error:/.test(e)||/\n\s+at /.test(e)}function sn(e){let t=e.trim();if(!(t.length===0||t.length>si||/[\r\n]/.test(t)||mi(t)||pi(t)||fi(t)))return t}var gi=3;function Ct(e,t=0){if(typeof e=="object"&&e!=null){if(Array.isArray(e)||t>=gi)return{};let r=e,o=Ct(r.error,t+1);if(o.message==null&&r.message!=null){let n=Ct(r.message,t+1);o={...n,code:_nullishCoalesce(o.code, () => (n.code))}}return typeof r.code=="string"&&r.code.length>0&&(o.code=r.code),o}if(typeof e!="string")return{};try{let r=JSON.parse(e);return typeof r=="object"&&r!=null?Ct(r,t+1):{}}catch (e17){}return{message:sn(e)}}function yi(e){let t;try{t=JSON.parse(e)}catch (e18){return{code:at,message:sn(e)}}if(typeof t=="string")return{code:at,message:sn(t)};if(typeof t!="object"||t==null)return{code:at};let r=t,{message:o,code:n}=Ct(r.error),a={code:typeof r.code=="string"&&r.code.length>0?r.code:_nullishCoalesce(n, () => (at)),message:o};return Array.isArray(r.itemIds)&&(a.itemIds=r.itemIds.filter(i=>typeof i=="string")),a}function cn(e,t){let{code:r,message:o,itemIds:n}=yi(t),a=n!=null&&n.length>0;if(a&&(r===at||li.has(r)))return G(ci,"badInput",n);let i={message:o};return a&&(i.itemIds=n),G(r,e>=500?"internal":"badInput",i)}function zl(e,t){let r=ui(e.error);if(r!=null)return t(r);if(e.type==="internal"||typeof e.error=="string"&&di.has(e.error))return t("checkoutFailed");let o=_optionalChain([e, 'access', _282 => _282.data, 'optionalAccess', _283 => _283.message]);return typeof o=="string"&&o.length>0?o:t("checkoutFailed")}var Pi;(o=>{async function e(n,a=1,i,c){let d=rt();if(d==null)throw new Error("No project ID found");let u=await on(d).addProduct({productID:n,quantity:a,metadata:i,...c});if(u!=null)return u}o.addProductToCart=e;function t(){Fe.setState({isCartVisible:!0})}o.showCart=t;function r(){Fe.setState({isCartVisible:!1})}o.hideCart=r})(Pi = exports.y||={});async function $r(e){try{return await e.text()}catch (e19){return""}}async function nn(e){let t=rt();if(t==null)throw new Error("No project ID found");e=an(e),e.locale??=_chunkERL4Z7M7js.m.call(void 0, );let r=await fetch(nt(t,"/buy"),{method:"POST",headers:{..._chunkERL4Z7M7js.a,..._chunkDF2IK2GNjs.h.call(void 0, t),"Content-Type":"application/json"},body:JSON.stringify(e)});if(r.status!=200){let n=cn(r.status,await $r(r));return console.warn("cannot create payment URL",r.status,n.error),n}let o=await r.json();return{url:o.url,...o.orderId!=null?{orderId:o.orderId}:{},...o.projectId!=null?{projectId:o.projectId}:{}}}async function Kl(e){let t=rt();if(t==null)throw new Error("No project ID found");let r={..._chunkERL4Z7M7js.a,..._chunkDF2IK2GNjs.h.call(void 0, t),"Content-Type":"application/json",...e.apiKey!=null?{Authorization:`Bearer ${e.apiKey}`}:{}},o=e.testMode?`/api/payment/link/auto/${t}/test`:`/api/payment/link/auto/${t}`;delete e.apiKey,delete e.testMode,e.locale??=_chunkERL4Z7M7js.m.call(void 0, );let n=await fetch(_chunkERL4Z7M7js.f+o,{method:"POST",headers:r,body:JSON.stringify(e)});return n.ok?{status:"ok",redirectURL:(await n.json()).url}:{...cn(n.status,await $r(n)),status:"error"}}function xt(){if(typeof localStorage>"u")return;let e=localStorage.getItem("bitsnap-ref");if(e!=null)return e}function an(e){let t=xt();return t==null||(e.metadata==null&&(e.metadata={}),e.metadata.ref=t),e}exports.a = le; exports.b = ue; exports.c = be; exports.d = ve; exports.e = Ut; exports.f = me; exports.g = On; exports.h = Mt; exports.i = Se; exports.j = Je; exports.k = Qe; exports.l = Ue; exports.m = Me; exports.n = ua; exports.o = Fn; exports.p = Zt; exports.q = Io; exports.r = _; exports.s = Nr; exports.t = Jt; exports.u = ke; exports.v = ci; exports.w = zl; exports.x = Fe; exports.y = Pi; exports.z = nn; exports.A = Kl; exports.B = xt; exports.C = an; exports.D = Yd; exports.E = Xd; exports.F = el; exports.G = rl; exports.H = Ko; exports.I = rn; exports.J = Tl; exports.K = rt; exports.L = Dl; exports.M = Ll; exports.N = Xo; exports.O = El; exports.P = Ol; exports.Q = on;
4
- //# sourceMappingURL=chunk-4BW6J7FP.js.map