bitsnap-react 1.7.1 → 1.8.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 (85) hide show
  1. package/dist/CartProvider-5KAG5QGA.mjs +2 -0
  2. package/dist/CartProvider-7GJXW2IP.js +2 -0
  3. package/dist/CartProvider-7GJXW2IP.js.map +1 -0
  4. package/dist/catalog.js +1 -1
  5. package/dist/catalog.js.map +1 -1
  6. package/dist/catalog.mjs +1 -1
  7. package/dist/chunk-45AP7UZE.mjs +2 -0
  8. package/dist/chunk-45AP7UZE.mjs.map +1 -0
  9. package/dist/chunk-7XTDFTQU.js +4 -0
  10. package/dist/chunk-7XTDFTQU.js.map +1 -0
  11. package/dist/chunk-C6Z7LOHB.mjs +2 -0
  12. package/dist/chunk-C6Z7LOHB.mjs.map +1 -0
  13. package/dist/chunk-HB6KQT26.mjs +4 -0
  14. package/dist/chunk-HB6KQT26.mjs.map +1 -0
  15. package/dist/chunk-JSDGZ4NY.js +2 -0
  16. package/dist/chunk-JSDGZ4NY.js.map +1 -0
  17. package/dist/chunk-KOVKUJAW.mjs +2 -0
  18. package/dist/chunk-KOVKUJAW.mjs.map +1 -0
  19. package/dist/chunk-KOYBZORL.js +2 -0
  20. package/dist/chunk-KOYBZORL.js.map +1 -0
  21. package/dist/chunk-LWK4E5G5.js +2 -0
  22. package/dist/chunk-LWK4E5G5.js.map +1 -0
  23. package/dist/chunk-OJT3YO2R.mjs +2 -0
  24. package/dist/{chunk-6KQBDN7M.mjs.map → chunk-OJT3YO2R.mjs.map} +1 -1
  25. package/dist/chunk-OUYRKNZJ.mjs +2 -0
  26. package/dist/chunk-OUYRKNZJ.mjs.map +1 -0
  27. package/dist/chunk-P2YB25KZ.js +2 -0
  28. package/dist/chunk-P2YB25KZ.js.map +1 -0
  29. package/dist/chunk-T2POA6RW.js +2 -0
  30. package/dist/chunk-T2POA6RW.js.map +1 -0
  31. package/dist/chunk-VPKE2ZOR.mjs +2 -0
  32. package/dist/{chunk-FTYJTO6O.mjs.map → chunk-VPKE2ZOR.mjs.map} +1 -1
  33. package/dist/chunk-WRCXZMKK.js +2 -0
  34. package/dist/chunk-WRCXZMKK.js.map +1 -0
  35. package/dist/chunk-WSM4OM72.mjs +2 -0
  36. package/dist/chunk-WSM4OM72.mjs.map +1 -0
  37. package/dist/chunk-XRNTUSBH.js +2 -0
  38. package/dist/chunk-XRNTUSBH.js.map +1 -0
  39. package/dist/chunk-Z2BKIX6F.js +2 -0
  40. package/dist/chunk-Z2BKIX6F.js.map +1 -0
  41. package/dist/course.d.mts +1872 -0
  42. package/dist/course.d.ts +1872 -0
  43. package/dist/course.js +2 -0
  44. package/dist/course.js.map +1 -0
  45. package/dist/course.mjs +2 -0
  46. package/dist/course.mjs.map +1 -0
  47. package/dist/errors.js +1 -1
  48. package/dist/errors.js.map +1 -1
  49. package/dist/index.css +1 -1
  50. package/dist/index.css.map +1 -1
  51. package/dist/index.d.mts +5 -36
  52. package/dist/index.d.ts +5 -36
  53. package/dist/index.js +1 -3
  54. package/dist/index.js.map +1 -1
  55. package/dist/index.mjs +1 -1
  56. package/dist/index.mjs.map +1 -1
  57. package/dist/internal.js +1 -1
  58. package/dist/internal.js.map +1 -1
  59. package/dist/methods-ITD6WFIY.mjs +2 -0
  60. package/dist/methods-JENIGNF7.js +2 -0
  61. package/dist/methods-JENIGNF7.js.map +1 -0
  62. package/dist/models.js +1 -1
  63. package/dist/models.js.map +1 -1
  64. package/dist/returns.d.mts +5 -195
  65. package/dist/returns.d.ts +5 -195
  66. package/dist/returns.js +1 -1
  67. package/dist/returns.js.map +1 -1
  68. package/dist/returns.mjs +1 -1
  69. package/dist/texts-CIEFbJTN.d.ts +196 -0
  70. package/dist/texts-tQtAGJCT.d.mts +196 -0
  71. package/dist/types-BTm_ZolC.d.ts +40 -0
  72. package/dist/types-PSBBDdQm.d.mts +40 -0
  73. package/package.json +57 -22
  74. package/dist/CartProvider-F2VH7WFO.mjs +0 -2
  75. package/dist/chunk-3TENJTY4.mjs +0 -2
  76. package/dist/chunk-3TENJTY4.mjs.map +0 -1
  77. package/dist/chunk-4HOZFM6V.mjs +0 -2
  78. package/dist/chunk-4HOZFM6V.mjs.map +0 -1
  79. package/dist/chunk-6KQBDN7M.mjs +0 -2
  80. package/dist/chunk-FTYJTO6O.mjs +0 -2
  81. package/dist/chunk-RATFYRKZ.mjs +0 -4
  82. package/dist/chunk-RATFYRKZ.mjs.map +0 -1
  83. package/dist/methods-PFZSMZFU.mjs +0 -2
  84. /package/dist/{CartProvider-F2VH7WFO.mjs.map → CartProvider-5KAG5QGA.mjs.map} +0 -0
  85. /package/dist/{methods-PFZSMZFU.mjs.map → methods-ITD6WFIY.mjs.map} +0 -0
package/dist/internal.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJSDGZ4NYjs = require('./chunk-JSDGZ4NY.js');var b=_chunkJSDGZ4NYjs.a.call(void 0, ()=>{});exports. default = b();
2
2
  //# sourceMappingURL=internal.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
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,""]}
@@ -0,0 +1,2 @@
1
+ import{A as e,w as a,x as b,y as c,z as d}from"./chunk-HB6KQT26.mjs";import"./chunk-45AP7UZE.mjs";import"./chunk-KOVKUJAW.mjs";import"./chunk-C6Z7LOHB.mjs";import"./chunk-WSM4OM72.mjs";import"./chunk-OUYRKNZJ.mjs";import"./chunk-U6FLIRIV.mjs";export{a as Bitsnap,c as createCheckout,b as createPaymentURL,d as getReferenceIfPossible,e as injectReferenceToRequestIfNeeded};
2
+ //# sourceMappingURL=methods-ITD6WFIY.mjs.map
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk7XTDFTQUjs = require('./chunk-7XTDFTQU.js');require('./chunk-LWK4E5G5.js');require('./chunk-KOYBZORL.js');require('./chunk-XRNTUSBH.js');require('./chunk-WRCXZMKK.js');require('./chunk-Z2BKIX6F.js');require('./chunk-JSDGZ4NY.js');exports.Bitsnap = _chunk7XTDFTQUjs.w; exports.createCheckout = _chunk7XTDFTQUjs.y; exports.createPaymentURL = _chunk7XTDFTQUjs.x; exports.getReferenceIfPossible = _chunk7XTDFTQUjs.z; exports.injectReferenceToRequestIfNeeded = _chunk7XTDFTQUjs.A;
2
+ //# sourceMappingURL=methods-JENIGNF7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/methods-JENIGNF7.js"],"names":[],"mappings":"AAAA,+HAAmE,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,+BAA4B,qPAAiI","file":"/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/methods-JENIGNF7.js"}
package/dist/models.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var g=Object.create;var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var f=(r,o)=>{for(var n in o)c(r,n,{get:o[n],enumerable:!0})},u=(r,o,n,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of P(o))!d.call(r,a)&&a!==n&&c(r,a,{get:()=>o[a],enumerable:!(i=y(o,a))||i.enumerable});return r};var S=(r,o,n)=>(n=r!=null?g(h(r)):{},u(o||!r||!r.__esModule?c(n,"default",{value:r,enumerable:!0}):n,r)),x=r=>u(c({},"__esModule",{value:!0}),r);var D={};f(D,{BitsnapModels:()=>l});module.exports=x(D);var e=S(require("zod")),l;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.ProductPricingSchema=e.object({regularPrice:e.number(),effectivePrice:e.number(),currency:e.string(),discount:e.object({id:e.string(),type:e.enum(["FIXED","PERCENTAGE"]),value:e.number(),status:e.enum(["ACTIVE","SCHEDULED","EXPIRED","DISABLED"]),startsAt:e.number().optional(),endsAt:e.number().optional()}).optional(),referencePrice:e.object({amount:e.number().optional(),windowDays:e.literal(30),asOf:e.number(),basis:e.literal("observed-history"),historyAvailable:e.boolean()}),priceVersion:e.string(),nextPriceChangeAt:e.number().optional()}),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})})),t.PublicListProductImageSchema=e.object({url:e.string(),thumbnailUrl:e.union([e.string(),e.null()])}),t.PublicListProductSchema=e.object({id:e.string(),cartItemId:e.string().optional(),uniqueSlug:e.string(),name:e.string(),shortDescription:e.union([e.string(),e.null()]),image:e.union([t.PublicListProductImageSchema,e.null()]),price:e.number(),currency:e.string(),compareAtPrice:e.union([e.number(),e.null()]),priceFrom:e.boolean(),variantCount:e.number(),isRecurring:e.boolean(),available:e.boolean(),addToCart:e.boolean()}),t.ProductListResponseSchema=e.object({items:e.array(t.PublicListProductSchema),totalCount:e.number()})))(l||={});
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; } }require('./chunk-JSDGZ4NY.js');var _zod = require('zod'); var e = _interopRequireWildcard(_zod);var s;(t=>(t.BaselinkerFieldsSchema=e.object({storageID:e.string().optional()}),t.MetadataSchema=e.record(e.string(),e.any()),t.ProductPricingSchema=e.object({regularPrice:e.number(),effectivePrice:e.number(),currency:e.string(),discount:e.object({id:e.string(),type:e.enum(["FIXED","PERCENTAGE"]),value:e.number(),status:e.enum(["ACTIVE","SCHEDULED","EXPIRED","DISABLED"]),startsAt:e.number().optional(),endsAt:e.number().optional()}).optional(),referencePrice:e.object({amount:e.number().optional(),windowDays:e.literal(30),asOf:e.number(),basis:e.literal("observed-history"),historyAvailable:e.boolean()}),priceVersion:e.string(),nextPriceChangeAt:e.number().optional()}),t.VariantSchema=e.object({id:e.string(),name:e.string(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),images:e.array(e.string()),availableQuantity:e.number().optional(),isDeliverable:e.boolean().optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.AdditionalSchema=e.object({sku:e.string().optional(),baselinkerFields:t.BaselinkerFieldsSchema.optional(),isPresale:e.boolean().optional()}),t.ItemSchema=e.object({id:e.string(),ownerID:e.string().optional(),name:e.string(),description:e.union([e.string(),e.null()]).optional(),createdAt:e.number().optional(),updatedAt:e.number().optional(),price:e.number(),currency:e.string(),metadata:t.MetadataSchema.optional(),image_url:e.string(),images:e.array(e.string()),isDeliverable:e.boolean().optional(),availableQuantity:e.number().optional(),additional:t.AdditionalSchema.optional(),variants:e.array(t.VariantSchema).optional(),estimatedDeliveryAt:e.number().optional(),pricing:t.ProductPricingSchema.optional()}),t.DataSchema=e.object({success:e.boolean(),result:e.array(t.ItemSchema),totalCount:e.number()}),t.ProductsResultResultSchema=e.object({data:t.DataSchema}),t.ProductsResultElementSchema=e.array(e.object({result:t.ProductsResultResultSchema})),t.ProductResultSchema=e.array(e.object({result:e.object({data:e.object({success:e.boolean(),message:e.string().optional(),result:t.ItemSchema.optional()})})})),t.PublicListProductImageSchema=e.object({url:e.string(),thumbnailUrl:e.union([e.string(),e.null()])}),t.PublicListProductSchema=e.object({id:e.string(),cartItemId:e.string().optional(),uniqueSlug:e.string(),name:e.string(),shortDescription:e.union([e.string(),e.null()]),image:e.union([t.PublicListProductImageSchema,e.null()]),price:e.number(),currency:e.string(),compareAtPrice:e.union([e.number(),e.null()]),priceFrom:e.boolean(),variantCount:e.number(),isRecurring:e.boolean(),available:e.boolean(),addToCart:e.boolean()}),t.ProductListResponseSchema=e.object({items:e.array(t.PublicListProductSchema),totalCount:e.number()})))(s = exports.BitsnapModels||={});exports.BitsnapModels = s;
2
2
  //# sourceMappingURL=models.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/models.ts"],"sourcesContent":["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"],"mappings":"0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmB,kBAEFF,OACFA,EAAA,uBAA2B,SAAO,CAC7C,UAAa,SAAO,EAAE,SAAS,CACjC,CAAC,EAGYA,EAA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AgB,SAAO,EACvB,YAAe,UAAQ,EACvB,UAAa,UAAQ,EAErB,UAAa,UAAQ,CACvB,CAAC,EAGYA,EAAA,0BAA8B,SAAO,CAChD,MAAS,QAAMA,EAAA,uBAAuB,EACtC,WAAc,SAAO,CACvB,CAAC,IApJcA,IAAA","names":["models_exports","__export","BitsnapModels","__toCommonJS","z"]}
1
+ {"version":3,"sources":["/home/emems/web/bitsnap/bitsnap/bitsnap-react/dist/models.js","../src/models.ts"],"names":["BitsnapModels"],"mappings":"AAAA,0XAA2B,iECAR,IAEFA,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CACFA,CAAAA,CAAA,sBAAA,CAA2B,CAAA,CAAA,MAAA,CAAO,CAC7C,SAAA,CAAa,CAAA,CAAA,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CACjC,CAAC,CAAA,CAGYA,CAAAA,CAAA,cAAA,CAAmB,CAAA,CAAA,MAAA,CAAS,CAAA,CAAA,MAAA,CAAO,CAAA,CAAK,CAAA,CAAA,GAAA,CAAI,CAAC,CAAA,CAE7CA,CAAAA,CAAA,oBAAA,CAAyB,CAAA,CAAA,MAAA,CAAO,CAC3C,YAAA,CAAgB,CAAA,CAAA,MAAA,CAAO,CAAA,CACvB,cAAA,CAAkB,CAAA,CAAA,MAAA,CAAO,CAAA,CACzB,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CAAA,CACnB,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CACjB,EAAA,CAAM,CAAA,CAAA,MAAA,CAAO,CAAA,CACb,IAAA,CAAQ,CAAA,CAAA,IAAA,CAAK,CAAC,OAAA,CAAS,YAAY,CAAC,CAAA,CACpC,KAAA,CAAS,CAAA,CAAA,MAAA,CAAO,CAAA,CAChB,MAAA,CAAU,CAAA,CAAA,IAAA,CAAK,CAAC,QAAA,CAAU,WAAA,CAAa,SAAA,CAAW,UAAU,CAAC,CAAA,CAC7D,QAAA,CAAY,CAAA,CAAA,MAAA,CAAO,CAAA,C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A,CAAa,CAAA,CAAA,OAAA,CAAQ,CACvB,CAAC,CAAA,CAGYA,CAAAA,CAAA,yBAAA,CAA8B,CAAA,CAAA,MAAA,CAAO,CAChD,KAAA,CAAS,CAAA,CAAA,KAAA,CAAMA,CAAAA,CAAA,uBAAuB,CAAA,CACtC,UAAA,CAAc,CAAA,CAAA,MAAA,CAAO,CACvB,CAAC,CAAA,CAAA,CAAA,CApJcA,yBAAAA,GAAA,CAAA,CAAA,CAAA,CAAA,0BAAA","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,8 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CSSProperties, ReactNode } from 'react';
3
- import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.mjs';
2
+ import { ReactNode } from 'react';
3
+ import { a as ReturnsTexts, R as ReturnsAppearance, h as ReturnsTextKey, i as ResolvedReturnsAppearance, f as ReturnsSlotName, e as ReturnsSlotAppearance } from './texts-tQtAGJCT.mjs';
4
+ export { b as RETURNS_SLOT_NAMES, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, g as ReturnsTheme } from './texts-tQtAGJCT.mjs';
4
5
  import { Timestamp } from '@bufbuild/protobuf/wkt';
5
6
  import { Message } from '@bufbuild/protobuf';
7
+ import './appearance-core-Dt2grZdl.mjs';
6
8
 
7
9
  /**
8
10
  * @generated from enum common.v1.Environment
@@ -18,198 +20,6 @@ declare enum Environment {
18
20
  TEST = 1
19
21
  }
20
22
 
21
- /**
22
- * Returns appearance API.
23
- *
24
- * It mirrors `CheckoutAppearance` (theme, tokens, elements) so a shop can reuse
25
- * one brand object for both. The resolver is pure: it turns the caller input
26
- * into a theme name, the tokens in effect, the slot overrides and the inline
27
- * style for the theme boundary.
28
- */
29
- type ReturnsTheme = "light" | "dark";
30
- type ReturnsAppearanceTokens = {
31
- /** Font family of the returns views. The library never loads fonts. */
32
- fontFamily?: string;
33
- /** Base font size. */
34
- fontSize?: string;
35
- /** Page background. */
36
- background?: string;
37
- /** Raised surfaces: cards, skeletons, summaries. */
38
- surface?: string;
39
- /** Main text color. */
40
- foreground?: string;
41
- /** Secondary text: descriptions, dates, hints. */
42
- mutedForeground?: string;
43
- /** Borders of cards, inputs and separators. */
44
- border?: string;
45
- /** Primary button background. */
46
- buttonBackground?: string;
47
- /** Primary button text. */
48
- buttonForeground?: string;
49
- /** Primary button background on hover. */
50
- buttonHoverBackground?: string;
51
- /** Hover surface of secondary buttons and selectable cards. */
52
- hoverSurface?: string;
53
- /** Focus ring color. Also applied to shared UI primitives through `--ring`. */
54
- focusRing?: string;
55
- /** Error color. */
56
- error?: string;
57
- /** Success color: result screen, completed and refunded statuses. */
58
- success?: string;
59
- /** Warning color: statuses that need attention. */
60
- warning?: string;
61
- /** Status badge background. */
62
- badgeBackground?: string;
63
- /** Status badge text. */
64
- badgeForeground?: string;
65
- /** Background of text inputs and the note field. */
66
- inputBackground?: string;
67
- /** Corner radius, applied through `--radius`. */
68
- radius?: string;
69
- };
70
- /**
71
- * Stable slot names. They are exposed as `data-bitsnap-returns-slot`
72
- * attributes so they can also be targeted from plain CSS.
73
- */
74
- declare const RETURNS_SLOT_NAMES: readonly ["root", "header", "title", "description", "backButton", "stepIndicator", "error", "emptyState", "skeleton", "emailForm", "emailInput", "codeForm", "codeInput", "resendButton", "logoutButton", "orderList", "orderCard", "orderReference", "orderDate", "orderTotal", "pagination", "lineList", "line", "lineName", "linePrice", "lineQuantityControl", "quantityButton", "quantityInput", "lineIneligibleReason", "noteInput", "summary", "submitButton", "secondaryButton", "successState", "returnReference", "returnInstructions", "returnList", "returnCard", "statusBadge", "history", "historyEntry"];
75
- type ReturnsSlotName = (typeof RETURNS_SLOT_NAMES)[number];
76
- type ReturnsSlotAppearance = SlotAppearance;
77
- type ReturnsAppearanceElements = AppearanceElements<ReturnsSlotName>;
78
- type ReturnsAppearance = {
79
- /** `"light"` or `"dark"`. Omitted means `"light"`. */
80
- theme?: ReturnsTheme;
81
- /** Partial overrides applied over the theme preset. */
82
- tokens?: ReturnsAppearanceTokens;
83
- /** Per element `className`/`style` overrides. */
84
- elements?: ReturnsAppearanceElements;
85
- };
86
- type ResolvedReturnsAppearance = {
87
- theme: ReturnsTheme;
88
- /** Tokens that are in effect (the theme preset plus caller overrides). */
89
- tokens: ReturnsAppearanceTokens;
90
- elements: ReturnsAppearanceElements;
91
- /** Theme marker class for the theme boundary. */
92
- boundaryClassName: string;
93
- /** Inline custom properties applied to the returns root. */
94
- boundaryStyle: CSSProperties;
95
- };
96
-
97
- /**
98
- * Every string the returns views render. Pass a partial object through the
99
- * `texts` prop of `BitsnapReturns`/`ReturnsProvider` to override any of them,
100
- * whatever the locale. Strings with `{name}` placeholders keep them in
101
- * overrides; unknown placeholders are left untouched.
102
- */
103
- type ReturnsTexts = {
104
- /** Label of the back buttons. */
105
- back: string;
106
- /** Step indicator, placeholders `{current}` and `{total}`. */
107
- stepIndicator: string;
108
- /** Skeleton accessible label. */
109
- loading: string;
110
- /** Button that opens the list of previous returns. */
111
- myReturnsLink: string;
112
- emailStepTitle: string;
113
- emailStepDescription: string;
114
- emailLabel: string;
115
- emailPlaceholder: string;
116
- emailSubmit: string;
117
- codeStepTitle: string;
118
- /** Placeholder `{email}`. */
119
- codeStepDescription: string;
120
- codeLabel: string;
121
- codeSubmit: string;
122
- resend: string;
123
- /** Placeholder `{seconds}`. */
124
- resendIn: string;
125
- logout: string;
126
- ordersTitle: string;
127
- ordersDescription: string;
128
- ordersEmpty: string;
129
- /** Placeholder `{reference}`. */
130
- orderTitle: string;
131
- /** Placeholder `{count}`. */
132
- orderReturnableLines: string;
133
- orderSelect: string;
134
- paginationPrevious: string;
135
- paginationNext: string;
136
- /** Placeholders `{page}` and `{total}` (number of orders). */
137
- paginationInfo: string;
138
- /** Placeholder `{reference}`. */
139
- orderDetailTitle: string;
140
- orderDetailDescription: string;
141
- /** Placeholder `{name}`. */
142
- quantityLabel: string;
143
- /** Placeholder `{name}`. */
144
- quantityDecrease: string;
145
- /** Placeholder `{name}`. */
146
- quantityIncrease: string;
147
- /** Placeholder `{available}`. */
148
- quantityOfAvailable: string;
149
- /** Shown for an ineligible line without a reason from the backend. */
150
- lineIneligibleFallback: string;
151
- noteLabel: string;
152
- notePlaceholder: string;
153
- selectionContinue: string;
154
- selectionEmpty: string;
155
- previousReturnsTitle: string;
156
- confirmationTitle: string;
157
- confirmationDescription: string;
158
- confirmationSummary: string;
159
- /** Placeholder `{quantity}`. */
160
- confirmationQuantity: string;
161
- confirmationNote: string;
162
- confirmationSubmit: string;
163
- successTitle: string;
164
- successDescription: string;
165
- successReference: string;
166
- successInstructions: string;
167
- successDone: string;
168
- myReturnsTitle: string;
169
- myReturnsDescription: string;
170
- myReturnsEmpty: string;
171
- myReturnOpen: string;
172
- myReturnDetailTitle: string;
173
- /** Placeholder `{reference}`. */
174
- myReturnTitle: string;
175
- myReturnCreatedAt: string;
176
- myReturnRefund: string;
177
- myReturnLines: string;
178
- /** Placeholders `{requested}`, `{approved}`, `{received}`. */
179
- myReturnLineQuantities: string;
180
- myReturnNote: string;
181
- myReturnHistory: string;
182
- statusSubmitted: string;
183
- statusApproved: string;
184
- statusRejected: string;
185
- statusAwaitingReceipt: string;
186
- statusReceived: string;
187
- statusCompleted: string;
188
- statusCancelled: string;
189
- statusRefunded: string;
190
- /** Any status the backend adds later. */
191
- statusFallback: string;
192
- refundStatusNotStarted: string;
193
- refundStatusPending: string;
194
- refundStatusSucceeded: string;
195
- refundStatusFailed: string;
196
- refundStatusFallback: string;
197
- errorGeneric: string;
198
- errorInvalidEmail: string;
199
- errorInvalidCode: string;
200
- errorSessionExpired: string;
201
- errorOrderNotFound: string;
202
- errorReturnNotFound: string;
203
- errorQuantityUnavailable: string;
204
- errorItemNotReturnable: string;
205
- errorReturnsDisabled: string;
206
- errorRateLimited: string;
207
- errorIdempotencyConflict: string;
208
- errorDeliveryFailed: string;
209
- errorRetry: string;
210
- };
211
- type ReturnsTextKey = keyof ReturnsTexts;
212
-
213
23
  /**
214
24
  * Compatibility layer for the `bitsnap-react` 1.6.0 returns widget. Everything
215
25
  * here is pure; the components and hooks apply it at their boundary.
@@ -964,4 +774,4 @@ declare function useReturnsSlot(slot: ReturnsSlotName): ReturnsSlotAppearance;
964
774
  */
965
775
  declare function useReturnsText(): (key: ReturnsTextKey, values?: Record<string, string | number>) => string;
966
776
 
967
- export { BitsnapReturns, type BitsnapReturnsProps, BitsnapReturnsProvider, type BitsnapReturnsProviderProps, type CreateReturnInput, Environment, type LegacyCreateReturnInput, type LegacyReturnsTexts, type LegacyReturnsTheme, RETURNS_SLOT_NAMES, type ReturnsAppearance, type ReturnsAppearanceElements, ReturnsAppearanceProvider, type ReturnsAppearanceTokens, type ReturnsChallenge, ReturnsCodeStep, type ReturnsCodeStepProps, ReturnsConfirmation, type ReturnsConfirmationProps, ReturnsEmailStep, type ReturnsEmailStepProps, type ReturnsEnvironment, type ReturnsEnvironmentInput, ReturnsMyReturnDetail, type ReturnsMyReturnDetailProps, ReturnsMyReturnsList, type ReturnsMyReturnsListProps, ReturnsOrderDetail, type ReturnsOrderDetailProps, ReturnsOrderList, type ReturnsOrderListProps, ReturnsProvider, type ReturnsProviderProps, ReturnsResult, type ReturnsResultProps, type ReturnsSessionStatus, type ReturnsSlotAppearance, type ReturnsSlotName, type ReturnsTextKey, type ReturnsTexts, type ReturnsTextsInput, type ReturnsTheme, type SelectedReturnLine, type UseCreateReturnResult, type UseMyReturnResult, type UseMyReturnsResult, type UseReturnOrdersResult, type UseReturnSessionResult, type UseReturnableOrderResult, useCreateReturn, useMyReturn, useMyReturns, useReturnOrders, useReturnSession, useReturnableOrder, useReturnsAppearance, useReturnsSlot, useReturnsText };
777
+ export { BitsnapReturns, type BitsnapReturnsProps, BitsnapReturnsProvider, type BitsnapReturnsProviderProps, type CreateReturnInput, Environment, type LegacyCreateReturnInput, type LegacyReturnsTexts, type LegacyReturnsTheme, ReturnsAppearance, ReturnsAppearanceProvider, type ReturnsChallenge, ReturnsCodeStep, type ReturnsCodeStepProps, ReturnsConfirmation, type ReturnsConfirmationProps, ReturnsEmailStep, type ReturnsEmailStepProps, type ReturnsEnvironment, type ReturnsEnvironmentInput, ReturnsMyReturnDetail, type ReturnsMyReturnDetailProps, ReturnsMyReturnsList, type ReturnsMyReturnsListProps, ReturnsOrderDetail, type ReturnsOrderDetailProps, ReturnsOrderList, type ReturnsOrderListProps, ReturnsProvider, type ReturnsProviderProps, ReturnsResult, type ReturnsResultProps, type ReturnsSessionStatus, ReturnsSlotAppearance, ReturnsSlotName, ReturnsTextKey, ReturnsTexts, type ReturnsTextsInput, type SelectedReturnLine, type UseCreateReturnResult, type UseMyReturnResult, type UseMyReturnsResult, type UseReturnOrdersResult, type UseReturnSessionResult, type UseReturnableOrderResult, useCreateReturn, useMyReturn, useMyReturns, useReturnOrders, useReturnSession, useReturnableOrder, useReturnsAppearance, useReturnsSlot, useReturnsText };
package/dist/returns.d.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CSSProperties, ReactNode } from 'react';
3
- import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.js';
2
+ import { ReactNode } from 'react';
3
+ import { a as ReturnsTexts, R as ReturnsAppearance, h as ReturnsTextKey, i as ResolvedReturnsAppearance, f as ReturnsSlotName, e as ReturnsSlotAppearance } from './texts-CIEFbJTN.js';
4
+ export { b as RETURNS_SLOT_NAMES, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, g as ReturnsTheme } from './texts-CIEFbJTN.js';
4
5
  import { Timestamp } from '@bufbuild/protobuf/wkt';
5
6
  import { Message } from '@bufbuild/protobuf';
7
+ import './appearance-core-Dt2grZdl.js';
6
8
 
7
9
  /**
8
10
  * @generated from enum common.v1.Environment
@@ -18,198 +20,6 @@ declare enum Environment {
18
20
  TEST = 1
19
21
  }
20
22
 
21
- /**
22
- * Returns appearance API.
23
- *
24
- * It mirrors `CheckoutAppearance` (theme, tokens, elements) so a shop can reuse
25
- * one brand object for both. The resolver is pure: it turns the caller input
26
- * into a theme name, the tokens in effect, the slot overrides and the inline
27
- * style for the theme boundary.
28
- */
29
- type ReturnsTheme = "light" | "dark";
30
- type ReturnsAppearanceTokens = {
31
- /** Font family of the returns views. The library never loads fonts. */
32
- fontFamily?: string;
33
- /** Base font size. */
34
- fontSize?: string;
35
- /** Page background. */
36
- background?: string;
37
- /** Raised surfaces: cards, skeletons, summaries. */
38
- surface?: string;
39
- /** Main text color. */
40
- foreground?: string;
41
- /** Secondary text: descriptions, dates, hints. */
42
- mutedForeground?: string;
43
- /** Borders of cards, inputs and separators. */
44
- border?: string;
45
- /** Primary button background. */
46
- buttonBackground?: string;
47
- /** Primary button text. */
48
- buttonForeground?: string;
49
- /** Primary button background on hover. */
50
- buttonHoverBackground?: string;
51
- /** Hover surface of secondary buttons and selectable cards. */
52
- hoverSurface?: string;
53
- /** Focus ring color. Also applied to shared UI primitives through `--ring`. */
54
- focusRing?: string;
55
- /** Error color. */
56
- error?: string;
57
- /** Success color: result screen, completed and refunded statuses. */
58
- success?: string;
59
- /** Warning color: statuses that need attention. */
60
- warning?: string;
61
- /** Status badge background. */
62
- badgeBackground?: string;
63
- /** Status badge text. */
64
- badgeForeground?: string;
65
- /** Background of text inputs and the note field. */
66
- inputBackground?: string;
67
- /** Corner radius, applied through `--radius`. */
68
- radius?: string;
69
- };
70
- /**
71
- * Stable slot names. They are exposed as `data-bitsnap-returns-slot`
72
- * attributes so they can also be targeted from plain CSS.
73
- */
74
- declare const RETURNS_SLOT_NAMES: readonly ["root", "header", "title", "description", "backButton", "stepIndicator", "error", "emptyState", "skeleton", "emailForm", "emailInput", "codeForm", "codeInput", "resendButton", "logoutButton", "orderList", "orderCard", "orderReference", "orderDate", "orderTotal", "pagination", "lineList", "line", "lineName", "linePrice", "lineQuantityControl", "quantityButton", "quantityInput", "lineIneligibleReason", "noteInput", "summary", "submitButton", "secondaryButton", "successState", "returnReference", "returnInstructions", "returnList", "returnCard", "statusBadge", "history", "historyEntry"];
75
- type ReturnsSlotName = (typeof RETURNS_SLOT_NAMES)[number];
76
- type ReturnsSlotAppearance = SlotAppearance;
77
- type ReturnsAppearanceElements = AppearanceElements<ReturnsSlotName>;
78
- type ReturnsAppearance = {
79
- /** `"light"` or `"dark"`. Omitted means `"light"`. */
80
- theme?: ReturnsTheme;
81
- /** Partial overrides applied over the theme preset. */
82
- tokens?: ReturnsAppearanceTokens;
83
- /** Per element `className`/`style` overrides. */
84
- elements?: ReturnsAppearanceElements;
85
- };
86
- type ResolvedReturnsAppearance = {
87
- theme: ReturnsTheme;
88
- /** Tokens that are in effect (the theme preset plus caller overrides). */
89
- tokens: ReturnsAppearanceTokens;
90
- elements: ReturnsAppearanceElements;
91
- /** Theme marker class for the theme boundary. */
92
- boundaryClassName: string;
93
- /** Inline custom properties applied to the returns root. */
94
- boundaryStyle: CSSProperties;
95
- };
96
-
97
- /**
98
- * Every string the returns views render. Pass a partial object through the
99
- * `texts` prop of `BitsnapReturns`/`ReturnsProvider` to override any of them,
100
- * whatever the locale. Strings with `{name}` placeholders keep them in
101
- * overrides; unknown placeholders are left untouched.
102
- */
103
- type ReturnsTexts = {
104
- /** Label of the back buttons. */
105
- back: string;
106
- /** Step indicator, placeholders `{current}` and `{total}`. */
107
- stepIndicator: string;
108
- /** Skeleton accessible label. */
109
- loading: string;
110
- /** Button that opens the list of previous returns. */
111
- myReturnsLink: string;
112
- emailStepTitle: string;
113
- emailStepDescription: string;
114
- emailLabel: string;
115
- emailPlaceholder: string;
116
- emailSubmit: string;
117
- codeStepTitle: string;
118
- /** Placeholder `{email}`. */
119
- codeStepDescription: string;
120
- codeLabel: string;
121
- codeSubmit: string;
122
- resend: string;
123
- /** Placeholder `{seconds}`. */
124
- resendIn: string;
125
- logout: string;
126
- ordersTitle: string;
127
- ordersDescription: string;
128
- ordersEmpty: string;
129
- /** Placeholder `{reference}`. */
130
- orderTitle: string;
131
- /** Placeholder `{count}`. */
132
- orderReturnableLines: string;
133
- orderSelect: string;
134
- paginationPrevious: string;
135
- paginationNext: string;
136
- /** Placeholders `{page}` and `{total}` (number of orders). */
137
- paginationInfo: string;
138
- /** Placeholder `{reference}`. */
139
- orderDetailTitle: string;
140
- orderDetailDescription: string;
141
- /** Placeholder `{name}`. */
142
- quantityLabel: string;
143
- /** Placeholder `{name}`. */
144
- quantityDecrease: string;
145
- /** Placeholder `{name}`. */
146
- quantityIncrease: string;
147
- /** Placeholder `{available}`. */
148
- quantityOfAvailable: string;
149
- /** Shown for an ineligible line without a reason from the backend. */
150
- lineIneligibleFallback: string;
151
- noteLabel: string;
152
- notePlaceholder: string;
153
- selectionContinue: string;
154
- selectionEmpty: string;
155
- previousReturnsTitle: string;
156
- confirmationTitle: string;
157
- confirmationDescription: string;
158
- confirmationSummary: string;
159
- /** Placeholder `{quantity}`. */
160
- confirmationQuantity: string;
161
- confirmationNote: string;
162
- confirmationSubmit: string;
163
- successTitle: string;
164
- successDescription: string;
165
- successReference: string;
166
- successInstructions: string;
167
- successDone: string;
168
- myReturnsTitle: string;
169
- myReturnsDescription: string;
170
- myReturnsEmpty: string;
171
- myReturnOpen: string;
172
- myReturnDetailTitle: string;
173
- /** Placeholder `{reference}`. */
174
- myReturnTitle: string;
175
- myReturnCreatedAt: string;
176
- myReturnRefund: string;
177
- myReturnLines: string;
178
- /** Placeholders `{requested}`, `{approved}`, `{received}`. */
179
- myReturnLineQuantities: string;
180
- myReturnNote: string;
181
- myReturnHistory: string;
182
- statusSubmitted: string;
183
- statusApproved: string;
184
- statusRejected: string;
185
- statusAwaitingReceipt: string;
186
- statusReceived: string;
187
- statusCompleted: string;
188
- statusCancelled: string;
189
- statusRefunded: string;
190
- /** Any status the backend adds later. */
191
- statusFallback: string;
192
- refundStatusNotStarted: string;
193
- refundStatusPending: string;
194
- refundStatusSucceeded: string;
195
- refundStatusFailed: string;
196
- refundStatusFallback: string;
197
- errorGeneric: string;
198
- errorInvalidEmail: string;
199
- errorInvalidCode: string;
200
- errorSessionExpired: string;
201
- errorOrderNotFound: string;
202
- errorReturnNotFound: string;
203
- errorQuantityUnavailable: string;
204
- errorItemNotReturnable: string;
205
- errorReturnsDisabled: string;
206
- errorRateLimited: string;
207
- errorIdempotencyConflict: string;
208
- errorDeliveryFailed: string;
209
- errorRetry: string;
210
- };
211
- type ReturnsTextKey = keyof ReturnsTexts;
212
-
213
23
  /**
214
24
  * Compatibility layer for the `bitsnap-react` 1.6.0 returns widget. Everything
215
25
  * here is pure; the components and hooks apply it at their boundary.
@@ -964,4 +774,4 @@ declare function useReturnsSlot(slot: ReturnsSlotName): ReturnsSlotAppearance;
964
774
  */
965
775
  declare function useReturnsText(): (key: ReturnsTextKey, values?: Record<string, string | number>) => string;
966
776
 
967
- export { BitsnapReturns, type BitsnapReturnsProps, BitsnapReturnsProvider, type BitsnapReturnsProviderProps, type CreateReturnInput, Environment, type LegacyCreateReturnInput, type LegacyReturnsTexts, type LegacyReturnsTheme, RETURNS_SLOT_NAMES, type ReturnsAppearance, type ReturnsAppearanceElements, ReturnsAppearanceProvider, type ReturnsAppearanceTokens, type ReturnsChallenge, ReturnsCodeStep, type ReturnsCodeStepProps, ReturnsConfirmation, type ReturnsConfirmationProps, ReturnsEmailStep, type ReturnsEmailStepProps, type ReturnsEnvironment, type ReturnsEnvironmentInput, ReturnsMyReturnDetail, type ReturnsMyReturnDetailProps, ReturnsMyReturnsList, type ReturnsMyReturnsListProps, ReturnsOrderDetail, type ReturnsOrderDetailProps, ReturnsOrderList, type ReturnsOrderListProps, ReturnsProvider, type ReturnsProviderProps, ReturnsResult, type ReturnsResultProps, type ReturnsSessionStatus, type ReturnsSlotAppearance, type ReturnsSlotName, type ReturnsTextKey, type ReturnsTexts, type ReturnsTextsInput, type ReturnsTheme, type SelectedReturnLine, type UseCreateReturnResult, type UseMyReturnResult, type UseMyReturnsResult, type UseReturnOrdersResult, type UseReturnSessionResult, type UseReturnableOrderResult, useCreateReturn, useMyReturn, useMyReturns, useReturnOrders, useReturnSession, useReturnableOrder, useReturnsAppearance, useReturnsSlot, useReturnsText };
777
+ export { BitsnapReturns, type BitsnapReturnsProps, BitsnapReturnsProvider, type BitsnapReturnsProviderProps, type CreateReturnInput, Environment, type LegacyCreateReturnInput, type LegacyReturnsTexts, type LegacyReturnsTheme, ReturnsAppearance, ReturnsAppearanceProvider, type ReturnsChallenge, ReturnsCodeStep, type ReturnsCodeStepProps, ReturnsConfirmation, type ReturnsConfirmationProps, ReturnsEmailStep, type ReturnsEmailStepProps, type ReturnsEnvironment, type ReturnsEnvironmentInput, ReturnsMyReturnDetail, type ReturnsMyReturnDetailProps, ReturnsMyReturnsList, type ReturnsMyReturnsListProps, ReturnsOrderDetail, type ReturnsOrderDetailProps, ReturnsOrderList, type ReturnsOrderListProps, ReturnsProvider, type ReturnsProviderProps, ReturnsResult, type ReturnsResultProps, type ReturnsSessionStatus, ReturnsSlotAppearance, ReturnsSlotName, ReturnsTextKey, ReturnsTexts, type ReturnsTextsInput, type SelectedReturnLine, type UseCreateReturnResult, type UseMyReturnResult, type UseMyReturnsResult, type UseReturnOrdersResult, type UseReturnSessionResult, type UseReturnableOrderResult, useCreateReturn, useMyReturn, useMyReturns, useReturnOrders, useReturnSession, useReturnableOrder, useReturnsAppearance, useReturnsSlot, useReturnsText };