@delopay/sdk 0.443.0 → 0.446.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 (276) hide show
  1. package/dist/airwallexCard.cjs.map +1 -1
  2. package/dist/branding.cjs.map +1 -1
  3. package/dist/cardFormStyles.cjs.map +1 -1
  4. package/dist/checkoutSession.cjs +2 -2
  5. package/dist/checkoutSession.cjs.map +1 -1
  6. package/dist/checkoutSession.js +1 -1
  7. package/dist/chunk-244VZFFO.cjs.map +1 -1
  8. package/dist/chunk-2IJRBJXW.cjs.map +1 -1
  9. package/dist/chunk-34PC72O7.cjs.map +1 -1
  10. package/dist/chunk-3GBWQWTP.cjs.map +1 -1
  11. package/dist/chunk-3YBBJT3Y.cjs.map +1 -1
  12. package/dist/chunk-44QBWVRS.cjs.map +1 -1
  13. package/dist/chunk-4EKAWNYI.cjs.map +1 -1
  14. package/dist/chunk-4LN4BR2T.cjs.map +1 -1
  15. package/dist/chunk-4T4XHPYN.cjs.map +1 -1
  16. package/dist/chunk-5CITBN33.cjs.map +1 -1
  17. package/dist/chunk-5HCKC4HF.cjs.map +1 -1
  18. package/dist/chunk-5O2JSQYA.cjs.map +1 -1
  19. package/dist/chunk-6EBY2KKL.cjs.map +1 -1
  20. package/dist/chunk-6LFOM6HV.cjs.map +1 -1
  21. package/dist/chunk-6LOWE2YI.cjs.map +1 -1
  22. package/dist/chunk-6LSG5Z4T.cjs.map +1 -1
  23. package/dist/chunk-6SU2MTN2.cjs.map +1 -1
  24. package/dist/chunk-6YCDLSIU.cjs.map +1 -1
  25. package/dist/chunk-75E5WNJG.cjs.map +1 -1
  26. package/dist/chunk-7JV6VVO7.cjs.map +1 -1
  27. package/dist/chunk-7QZCUXWB.cjs.map +1 -1
  28. package/dist/chunk-7VXF5D67.cjs.map +1 -1
  29. package/dist/{chunk-75FQADKN.cjs → chunk-AAZUJFDE.cjs} +29 -1
  30. package/dist/chunk-AAZUJFDE.cjs.map +1 -0
  31. package/dist/chunk-ACZ2R47X.cjs.map +1 -1
  32. package/dist/chunk-AVR2GPXU.cjs.map +1 -1
  33. package/dist/chunk-AYUYJO3I.cjs.map +1 -1
  34. package/dist/chunk-BCA3TCGS.cjs.map +1 -1
  35. package/dist/chunk-BP6KDQ6I.cjs.map +1 -1
  36. package/dist/chunk-BRY3W7N3.cjs.map +1 -1
  37. package/dist/chunk-CAMALM35.cjs.map +1 -1
  38. package/dist/chunk-CCN44NZJ.cjs.map +1 -1
  39. package/dist/chunk-CKKNFFKP.cjs.map +1 -1
  40. package/dist/chunk-CR3JBTP3.cjs.map +1 -1
  41. package/dist/chunk-DJASVBOJ.cjs.map +1 -1
  42. package/dist/{chunk-LTMHV6PC.cjs → chunk-EDDQXVWP.cjs} +3 -3
  43. package/dist/chunk-EDDQXVWP.cjs.map +1 -0
  44. package/dist/chunk-EEB2HDYL.cjs.map +1 -1
  45. package/dist/chunk-ENPSUWTS.cjs.map +1 -1
  46. package/dist/chunk-EQ6P6ZND.cjs.map +1 -1
  47. package/dist/chunk-EXPWQBI3.cjs.map +1 -1
  48. package/dist/chunk-F3I5DOWV.cjs.map +1 -1
  49. package/dist/chunk-F46K5H3U.cjs.map +1 -1
  50. package/dist/chunk-F6S3WCCB.cjs.map +1 -1
  51. package/dist/chunk-FG7YBXJQ.cjs.map +1 -1
  52. package/dist/chunk-FQRC4NJG.cjs.map +1 -1
  53. package/dist/chunk-FYISDU2Y.cjs.map +1 -1
  54. package/dist/chunk-GG52SAHA.cjs.map +1 -1
  55. package/dist/chunk-GK5FWN4H.cjs.map +1 -1
  56. package/dist/{chunk-6H5AJY4O.js → chunk-GPXRPBCL.js} +29 -1
  57. package/dist/chunk-GPXRPBCL.js.map +1 -0
  58. package/dist/chunk-GSQN5EOO.cjs.map +1 -1
  59. package/dist/chunk-GW7IHYXR.cjs.map +1 -1
  60. package/dist/chunk-GWJ33GOK.cjs.map +1 -1
  61. package/dist/chunk-HHUUSNIL.cjs.map +1 -1
  62. package/dist/chunk-HLHML5ES.cjs.map +1 -1
  63. package/dist/chunk-HLKFUOAQ.cjs.map +1 -1
  64. package/dist/chunk-HLYGHP6F.cjs.map +1 -1
  65. package/dist/{chunk-UJ7EBPTO.js → chunk-HMA2CT6D.js} +2 -2
  66. package/dist/{chunk-OUDYJEZN.js → chunk-HRJL4J5J.js} +2 -2
  67. package/dist/chunk-HSJABE7X.cjs.map +1 -1
  68. package/dist/chunk-I2W7AO4B.cjs.map +1 -1
  69. package/dist/chunk-I2XGNALG.cjs.map +1 -1
  70. package/dist/chunk-IKXGA2Z5.cjs.map +1 -1
  71. package/dist/chunk-IR2LFKKA.cjs.map +1 -1
  72. package/dist/chunk-J4ZB7MU4.cjs.map +1 -1
  73. package/dist/chunk-JJPKURUG.cjs.map +1 -1
  74. package/dist/chunk-JPRSNCYP.cjs.map +1 -1
  75. package/dist/chunk-K5Q2H3VD.cjs.map +1 -1
  76. package/dist/chunk-KD5Y2YWK.cjs.map +1 -1
  77. package/dist/chunk-KJDMNF2T.cjs.map +1 -1
  78. package/dist/chunk-KLONGJCL.cjs.map +1 -1
  79. package/dist/chunk-KOB6MOAV.cjs.map +1 -1
  80. package/dist/chunk-KSJ7JLR3.cjs.map +1 -1
  81. package/dist/chunk-LJ2EG6JK.cjs.map +1 -1
  82. package/dist/chunk-LLYY4TCZ.cjs.map +1 -1
  83. package/dist/chunk-LYIBTVK6.cjs.map +1 -1
  84. package/dist/chunk-M3HWE7KT.cjs.map +1 -1
  85. package/dist/chunk-M3SJHFT4.cjs.map +1 -1
  86. package/dist/chunk-MCNDMK7F.cjs.map +1 -1
  87. package/dist/chunk-MLG6NXI6.cjs.map +1 -1
  88. package/dist/chunk-NFB3S2E6.cjs.map +1 -1
  89. package/dist/chunk-NKDUQ2BI.cjs.map +1 -1
  90. package/dist/{chunk-PVVAAENM.cjs → chunk-NNVGR5ZD.cjs} +3 -3
  91. package/dist/chunk-NNVGR5ZD.cjs.map +1 -0
  92. package/dist/chunk-NYL3BNHR.cjs.map +1 -1
  93. package/dist/chunk-O4AYHLQX.cjs.map +1 -1
  94. package/dist/chunk-ODPNVNYE.cjs.map +1 -1
  95. package/dist/chunk-OG2KJAYD.cjs.map +1 -1
  96. package/dist/chunk-OWP7XBY2.cjs.map +1 -1
  97. package/dist/chunk-OYZP6NF6.cjs.map +1 -1
  98. package/dist/chunk-P6JLNQ6L.cjs.map +1 -1
  99. package/dist/chunk-P7DYLUUI.cjs.map +1 -1
  100. package/dist/chunk-PKAE6AQT.cjs.map +1 -1
  101. package/dist/chunk-Q7M7DO7M.cjs.map +1 -1
  102. package/dist/chunk-QKUWFMZP.cjs.map +1 -1
  103. package/dist/chunk-QRSA72B3.cjs.map +1 -1
  104. package/dist/chunk-QYNRNDIY.cjs.map +1 -1
  105. package/dist/chunk-R4FE6K43.cjs.map +1 -1
  106. package/dist/chunk-R4GA6BVP.cjs.map +1 -1
  107. package/dist/chunk-R5VYSZ3Q.cjs.map +1 -1
  108. package/dist/chunk-RHFUXHQN.cjs.map +1 -1
  109. package/dist/chunk-RI42IDRR.cjs.map +1 -1
  110. package/dist/chunk-RSVLVW4L.cjs.map +1 -1
  111. package/dist/{chunk-LZB4FKZD.js → chunk-S5JD5XAT.js} +2 -2
  112. package/dist/chunk-S77LQWYC.cjs.map +1 -1
  113. package/dist/chunk-S7SBNOGS.cjs.map +1 -1
  114. package/dist/chunk-SQELICSX.cjs.map +1 -1
  115. package/dist/chunk-TMAJE5P2.cjs.map +1 -1
  116. package/dist/chunk-TNIJ6OSH.cjs.map +1 -1
  117. package/dist/chunk-UGSM7RJ2.cjs.map +1 -1
  118. package/dist/chunk-UKLZAOLW.cjs.map +1 -1
  119. package/dist/chunk-V47G7P6L.cjs.map +1 -1
  120. package/dist/chunk-VH5A6SMU.cjs.map +1 -1
  121. package/dist/chunk-VHMH4QMY.cjs.map +1 -1
  122. package/dist/chunk-VYC7WUM5.cjs.map +1 -1
  123. package/dist/chunk-W457XUA6.cjs.map +1 -1
  124. package/dist/chunk-WHDI3TMP.cjs.map +1 -1
  125. package/dist/chunk-WITCPKNL.cjs.map +1 -1
  126. package/dist/chunk-WX6NP7UU.cjs.map +1 -1
  127. package/dist/{chunk-OHKZR745.cjs → chunk-XJBP2MBS.cjs} +3 -3
  128. package/dist/chunk-XJBP2MBS.cjs.map +1 -0
  129. package/dist/chunk-XQLRIBVR.cjs.map +1 -1
  130. package/dist/chunk-YJQPKT6W.cjs.map +1 -1
  131. package/dist/chunk-YK3P5QNZ.cjs.map +1 -1
  132. package/dist/chunk-ZKPVUCQV.cjs.map +1 -1
  133. package/dist/chunk-ZUULK36E.cjs.map +1 -1
  134. package/dist/client.cjs +2 -2
  135. package/dist/client.cjs.map +1 -1
  136. package/dist/client.js +1 -1
  137. package/dist/core.cjs.map +1 -1
  138. package/dist/currencies.cjs.map +1 -1
  139. package/dist/enigmaCardForm.cjs.map +1 -1
  140. package/dist/error.cjs.map +1 -1
  141. package/dist/eventStream.cjs.map +1 -1
  142. package/dist/exportDownload.cjs.map +1 -1
  143. package/dist/feeProgram.cjs.map +1 -1
  144. package/dist/index.cjs +4 -4
  145. package/dist/index.cjs.map +1 -1
  146. package/dist/index.d.cts +1 -1
  147. package/dist/index.d.ts +1 -1
  148. package/dist/index.js +3 -3
  149. package/dist/internal/resources/admin.cjs.map +1 -1
  150. package/dist/internal/resources/adminBranding.cjs.map +1 -1
  151. package/dist/internal/resources/adminCheckoutDomains.cjs.map +1 -1
  152. package/dist/internal/resources/adminFeePlans.cjs.map +1 -1
  153. package/dist/internal/resources/adminFileScans.cjs.map +1 -1
  154. package/dist/internal/resources/adminIndustries.cjs.map +1 -1
  155. package/dist/internal/resources/adminLive.cjs.map +1 -1
  156. package/dist/internal/resources/adminNotices.cjs.map +1 -1
  157. package/dist/internal/resources/adminPortal.cjs +2 -2
  158. package/dist/internal/resources/adminPortal.cjs.map +1 -1
  159. package/dist/internal/resources/adminPortal.js +1 -1
  160. package/dist/internal/resources/adminSupport.cjs.map +1 -1
  161. package/dist/internal/resources/auditLogs.cjs.map +1 -1
  162. package/dist/internal/resources/cache.cjs.map +1 -1
  163. package/dist/internal/resources/cardIssuers.cjs.map +1 -1
  164. package/dist/internal/resources/configs.cjs.map +1 -1
  165. package/dist/internal/resources/connectorRestrictionRules.cjs.map +1 -1
  166. package/dist/internal/resources/connectorRestrictions.cjs.map +1 -1
  167. package/dist/internal/resources/diagnostic.cjs.map +1 -1
  168. package/dist/internal/resources/gsm.cjs.map +1 -1
  169. package/dist/internal/resources/nativeRenewals.cjs.map +1 -1
  170. package/dist/internal/resources/platformBilling.cjs.map +1 -1
  171. package/dist/internal/resources/platformFees.cjs.map +1 -1
  172. package/dist/internal/resources/platformMessageTemplates.cjs.map +1 -1
  173. package/dist/internal/resources/platformSettings.cjs.map +1 -1
  174. package/dist/internal.cjs +7 -7
  175. package/dist/internal.cjs.map +1 -1
  176. package/dist/internal.d.cts +1 -1
  177. package/dist/internal.d.ts +1 -1
  178. package/dist/internal.js +4 -4
  179. package/dist/listQuery.cjs.map +1 -1
  180. package/dist/panes.cjs.map +1 -1
  181. package/dist/paymentPresentation.cjs.map +1 -1
  182. package/dist/recordCounter.cjs.map +1 -1
  183. package/dist/resources/aiTools.cjs.map +1 -1
  184. package/dist/resources/analytics.cjs.map +1 -1
  185. package/dist/resources/analyticsDashboard.cjs.map +1 -1
  186. package/dist/resources/apiKeys.cjs.map +1 -1
  187. package/dist/resources/audit.cjs.map +1 -1
  188. package/dist/resources/authentication.cjs.map +1 -1
  189. package/dist/resources/availabilityOverrides.cjs.map +1 -1
  190. package/dist/resources/billing.cjs.map +1 -1
  191. package/dist/resources/buyerAccount.cjs.map +1 -1
  192. package/dist/resources/buyerBlocklist.cjs.map +1 -1
  193. package/dist/resources/buyerConversations.cjs.map +1 -1
  194. package/dist/resources/buyerEvidenceReviews.cjs.map +1 -1
  195. package/dist/resources/buyerPortal.cjs.map +1 -1
  196. package/dist/resources/cards.cjs.map +1 -1
  197. package/dist/resources/chargebackPrevention.cjs.map +1 -1
  198. package/dist/resources/checkoutDomains.cjs.map +1 -1
  199. package/dist/resources/checkoutMethods.cjs.map +1 -1
  200. package/dist/resources/checkoutRecovery.cjs.map +1 -1
  201. package/dist/resources/checkoutTemplates.cjs.map +1 -1
  202. package/dist/resources/connectors.cjs.map +1 -1
  203. package/dist/resources/contentEncryption.cjs.map +1 -1
  204. package/dist/resources/costRules.cjs.map +1 -1
  205. package/dist/resources/customers.cjs.map +1 -1
  206. package/dist/resources/deploymentBranding.cjs.map +1 -1
  207. package/dist/resources/disputes.cjs.map +1 -1
  208. package/dist/resources/ephemeralKeys.cjs.map +1 -1
  209. package/dist/resources/events.cjs.map +1 -1
  210. package/dist/resources/export.cjs.map +1 -1
  211. package/dist/resources/externalRecords.cjs.map +1 -1
  212. package/dist/resources/featureMatrix.cjs.map +1 -1
  213. package/dist/resources/fees.cjs.map +1 -1
  214. package/dist/resources/files.cjs.map +1 -1
  215. package/dist/resources/forex.cjs.map +1 -1
  216. package/dist/resources/identityVerifications.cjs.map +1 -1
  217. package/dist/resources/industries.cjs.map +1 -1
  218. package/dist/resources/invoiceSettings.cjs.map +1 -1
  219. package/dist/resources/invoices.cjs.map +1 -1
  220. package/dist/resources/live.cjs.map +1 -1
  221. package/dist/resources/mandates.cjs.map +1 -1
  222. package/dist/resources/merchantAccounts.cjs.map +1 -1
  223. package/dist/resources/messageTemplates.cjs.map +1 -1
  224. package/dist/resources/notices.cjs.map +1 -1
  225. package/dist/resources/operationLimits.cjs.map +1 -1
  226. package/dist/resources/paymentLinks.cjs.map +1 -1
  227. package/dist/resources/paymentMethods.cjs.map +1 -1
  228. package/dist/resources/payments.cjs.map +1 -1
  229. package/dist/resources/payoutDestinations.cjs.map +1 -1
  230. package/dist/resources/payouts.cjs.map +1 -1
  231. package/dist/resources/paypalDisputes.cjs.map +1 -1
  232. package/dist/resources/persons.cjs.map +1 -1
  233. package/dist/resources/poll.cjs.map +1 -1
  234. package/dist/resources/processorCosts.cjs.map +1 -1
  235. package/dist/resources/processorImports.cjs.map +1 -1
  236. package/dist/resources/products.cjs.map +1 -1
  237. package/dist/resources/profileAcquirers.cjs.map +1 -1
  238. package/dist/resources/profiles.cjs.map +1 -1
  239. package/dist/resources/projects.cjs.map +1 -1
  240. package/dist/resources/refunds.cjs.map +1 -1
  241. package/dist/resources/regions.cjs.map +1 -1
  242. package/dist/resources/relay.cjs.map +1 -1
  243. package/dist/resources/risk.cjs.map +1 -1
  244. package/dist/resources/routing.cjs.map +1 -1
  245. package/dist/resources/search.cjs.map +1 -1
  246. package/dist/resources/sellToRestrictions.cjs.map +1 -1
  247. package/dist/resources/settings.cjs.map +1 -1
  248. package/dist/resources/settlement.cjs +2 -2
  249. package/dist/resources/settlement.cjs.map +1 -1
  250. package/dist/resources/settlement.d.cts +18 -1
  251. package/dist/resources/settlement.d.ts +18 -1
  252. package/dist/resources/settlement.js +1 -1
  253. package/dist/resources/shopLabels.cjs.map +1 -1
  254. package/dist/resources/shops.cjs.map +1 -1
  255. package/dist/resources/stripeConnect.cjs.map +1 -1
  256. package/dist/resources/subscriptions.cjs.map +1 -1
  257. package/dist/resources/support.cjs.map +1 -1
  258. package/dist/resources/threeDsRules.cjs.map +1 -1
  259. package/dist/resources/users.cjs.map +1 -1
  260. package/dist/resources/vatRates.cjs.map +1 -1
  261. package/dist/resources/verification.cjs.map +1 -1
  262. package/dist/resources/webhooks.cjs.map +1 -1
  263. package/dist/resources/whopResolutionCases.cjs.map +1 -1
  264. package/dist/trustedOrigins.cjs.map +1 -1
  265. package/dist/types.cjs.map +1 -1
  266. package/dist/types.d.cts +179 -1
  267. package/dist/types.d.ts +179 -1
  268. package/package.json +1 -1
  269. package/dist/chunk-6H5AJY4O.js.map +0 -1
  270. package/dist/chunk-75FQADKN.cjs.map +0 -1
  271. package/dist/chunk-LTMHV6PC.cjs.map +0 -1
  272. package/dist/chunk-OHKZR745.cjs.map +0 -1
  273. package/dist/chunk-PVVAAENM.cjs.map +0 -1
  274. /package/dist/{chunk-UJ7EBPTO.js.map → chunk-HMA2CT6D.js.map} +0 -0
  275. /package/dist/{chunk-OUDYJEZN.js.map → chunk-HRJL4J5J.js.map} +0 -0
  276. /package/dist/{chunk-LZB4FKZD.js.map → chunk-S5JD5XAT.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w4-sdk-publish-0443/dist/chunk-WHDI3TMP.cjs","../src/resources/verification.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,uBAAA,CACJ,UAAA,EACA,MAAA,EACuC;AACvC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AACvE,MAAA;AACP,IAAA;AACH,EAAA;AAI4C,EAAA;AACsB,IAAA;AACvD,MAAA;AACR,IAAA;AACH,EAAA;AACF;ADVoF;AACA;AACA;AACA","file":"/tmp/w4-sdk-publish-0443/dist/chunk-WHDI3TMP.cjs","sourcesContent":[null,"import type {\n ApplePayVerificationRequest,\n ApplePayVerificationResponse,\n ApplePayVerifiedDomainsResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Verification {\n constructor(private readonly request: RequestFn) {}\n\n async registerApplePayDomains(\n merchantId: string,\n params: ApplePayVerificationRequest,\n ): Promise<ApplePayVerificationResponse> {\n return this.request('POST', `/verify/apple-pay/${encodeURIComponent(merchantId)}`, {\n body: params,\n });\n }\n\n async getApplePayVerifiedDomains(\n params: Record<string, string>,\n ): Promise<ApplePayVerifiedDomainsResponse> {\n return this.request('GET', '/verify/applepay-verified-domains', {\n query: params,\n });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-WHDI3TMP.cjs","../src/resources/verification.ts"],"names":[],"mappings":"AAAA;ACOO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,uBAAA,CACJ,UAAA,EACA,MAAA,EACuC;AACvC,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,CAAA,kBAAA,EAAqB,kBAAA,CAAmB,UAAU,CAAC,CAAA,CAAA;AACvE,MAAA;AACP,IAAA;AACH,EAAA;AAI4C,EAAA;AACsB,IAAA;AACvD,MAAA;AACR,IAAA;AACH,EAAA;AACF;ADVoF;AACA;AACA;AACA","file":"/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-WHDI3TMP.cjs","sourcesContent":[null,"import type {\n ApplePayVerificationRequest,\n ApplePayVerificationResponse,\n ApplePayVerifiedDomainsResponse,\n} from '../types';\nimport type { RequestFn } from '../client';\n\nexport class Verification {\n constructor(private readonly request: RequestFn) {}\n\n async registerApplePayDomains(\n merchantId: string,\n params: ApplePayVerificationRequest,\n ): Promise<ApplePayVerificationResponse> {\n return this.request('POST', `/verify/apple-pay/${encodeURIComponent(merchantId)}`, {\n body: params,\n });\n }\n\n async getApplePayVerifiedDomains(\n params: Record<string, string>,\n ): Promise<ApplePayVerifiedDomainsResponse> {\n return this.request('GET', '/verify/applepay-verified-domains', {\n query: params,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w4-sdk-publish-0443/dist/chunk-WITCPKNL.cjs","../src/internal/resources/cardIssuers.ts"],"names":[],"mappings":"AAAA;ACQO,IAAM,YAAA,EAAN,MAAkB;AAAA,EACvB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAA8D;AACzE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,eAAA,EAAiB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC/D;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAAkB,MAAA,EAA8D;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,cAAA,EAAiB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAC1E,EAAA;AAE8C,EAAA;AACF,IAAA;AAC5C,EAAA;AACF;ADP6E;AACA;AACA;AACA","file":"/tmp/w4-sdk-publish-0443/dist/chunk-WITCPKNL.cjs","sourcesContent":[null,"import type {\n CardIssuerCreateRequest,\n CardIssuerResponse,\n CardIssuerUpdateRequest,\n CardIssuerListResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class CardIssuers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse> {\n return this.request('POST', '/card-issuers', { body: params });\n }\n\n async update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse> {\n return this.request('PUT', `/card-issuers/${encodeURIComponent(issuerId)}`, { body: params });\n }\n\n async list(): Promise<CardIssuerListResponse> {\n return this.request('GET', '/card-issuers');\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-WITCPKNL.cjs","../src/internal/resources/cardIssuers.ts"],"names":[],"mappings":"AAAA;ACQO,IAAM,YAAA,EAAN,MAAkB;AAAA,EACvB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,MAAA,CAAO,MAAA,EAA8D;AACzE,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,eAAA,EAAiB,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC/D;AAAA,EAEA,MAAM,MAAA,CAAO,QAAA,EAAkB,MAAA,EAA8D;AAC3F,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,KAAA,EAAO,CAAA,cAAA,EAAiB,kBAAA,CAAmB,QAAQ,CAAC,CAAA,CAAA;AAC1E,EAAA;AAE8C,EAAA;AACF,IAAA;AAC5C,EAAA;AACF;ADP6E;AACA;AACA;AACA","file":"/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-WITCPKNL.cjs","sourcesContent":[null,"import type {\n CardIssuerCreateRequest,\n CardIssuerResponse,\n CardIssuerUpdateRequest,\n CardIssuerListResponse,\n} from '../types';\nimport type { RequestFn } from '../../client';\n\nexport class CardIssuers {\n constructor(private readonly request: RequestFn) {}\n\n async create(params: CardIssuerCreateRequest): Promise<CardIssuerResponse> {\n return this.request('POST', '/card-issuers', { body: params });\n }\n\n async update(issuerId: string, params: CardIssuerUpdateRequest): Promise<CardIssuerResponse> {\n return this.request('PUT', `/card-issuers/${encodeURIComponent(issuerId)}`, { body: params });\n }\n\n async list(): Promise<CardIssuerListResponse> {\n return this.request('GET', '/card-issuers');\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w4-sdk-publish-0443/dist/chunk-WX6NP7UU.cjs","../src/resources/threeDsRules.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,OAAA,CAAQ,MAAA,EAAiE;AAC7E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,4BAAA,EAA8B,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC5E;AACF,CAAA;ADAA;AACA;AACE;AACF,oCAAC","file":"/tmp/w4-sdk-publish-0443/dist/chunk-WX6NP7UU.cjs","sourcesContent":[null,"import type { ThreeDsRuleExecuteRequest, ThreeDsRuleResponse } from '../types';\nimport type { RequestFn } from '../client';\n\nexport class ThreeDsRules {\n constructor(private readonly request: RequestFn) {}\n\n async execute(params: ThreeDsRuleExecuteRequest): Promise<ThreeDsRuleResponse> {\n return this.request('POST', '/three-ds-decision/execute', { body: params });\n }\n}\n"]}
1
+ {"version":3,"sources":["/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-WX6NP7UU.cjs","../src/resources/threeDsRules.ts"],"names":[],"mappings":"AAAA;ACGO,IAAM,aAAA,EAAN,MAAmB;AAAA,EACxB,WAAA,CAA6B,OAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,QAAA,EAAA,OAAA;AAAA,EAAqB;AAAA,EAElD,MAAM,OAAA,CAAQ,MAAA,EAAiE;AAC7E,IAAA,OAAO,IAAA,CAAK,OAAA,CAAQ,MAAA,EAAQ,4BAAA,EAA8B,EAAE,IAAA,EAAM,OAAO,CAAC,CAAA;AAAA,EAC5E;AACF,CAAA;ADAA;AACA;AACE;AACF,oCAAC","file":"/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-WX6NP7UU.cjs","sourcesContent":[null,"import type { ThreeDsRuleExecuteRequest, ThreeDsRuleResponse } from '../types';\nimport type { RequestFn } from '../client';\n\nexport class ThreeDsRules {\n constructor(private readonly request: RequestFn) {}\n\n async execute(params: ThreeDsRuleExecuteRequest): Promise<ThreeDsRuleResponse> {\n return this.request('POST', '/three-ds-decision/execute', { body: params });\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); 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; }
2
2
 
3
- var _chunkPVVAAENMcjs = require('./chunk-PVVAAENM.cjs');
3
+ var _chunkNNVGR5ZDcjs = require('./chunk-NNVGR5ZD.cjs');
4
4
 
5
5
 
6
6
  var _chunkI2W7AO4Bcjs = require('./chunk-I2W7AO4B.cjs');
@@ -69,7 +69,7 @@ var CheckoutSession = class {
69
69
  this.paymentId = options.paymentId;
70
70
  this.publishableKey = options.publishableKey;
71
71
  this.clientSecret = options.clientSecret;
72
- this.client = new (0, _chunkPVVAAENMcjs.Delopay)("", {
72
+ this.client = new (0, _chunkNNVGR5ZDcjs.Delopay)("", {
73
73
  baseUrl: options.baseUrl,
74
74
  sandbox: options.sandbox,
75
75
  timeout: options.timeout,
@@ -1035,4 +1035,4 @@ var CheckoutSession = class {
1035
1035
 
1036
1036
 
1037
1037
  exports.CheckoutSession = CheckoutSession;
1038
- //# sourceMappingURL=chunk-OHKZR745.cjs.map
1038
+ //# sourceMappingURL=chunk-XJBP2MBS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-XJBP2MBS.cjs","../src/checkoutSession.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACF,wDAA6B;AAC7B;AACA;ACoEA,SAAS,wBAAA,CAAyB,KAAA,EAAwD;AACxF,EAAA,GAAA,CAAI,CAAC,KAAA,EAAO,OAAO,CAAC,CAAA;AACpB,EAAA,MAAM,IAAA,EAA8B,CAAC,CAAA;AACrC,EAAA,IAAA,CAAA,MAAW,CAAC,GAAA,EAAK,KAAK,EAAA,GAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,IAAA,MAAM,MAAA,EAAQ,GAAA,CAAI,WAAA,CAAY,CAAA;AAC9B,IAAA,GAAA,CAAI,MAAA,IAAU,UAAA,GAAa,MAAA,IAAU,eAAA,EAAiB,QAAA;AACtD,IAAA,GAAA,CAAI,GAAG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A;AACmC,QAAA;AACvB,QAAA;AACD,QAAA;AACU,QAAA;AAC5B,MAAA;AACG,MAAA;AACqC,MAAA;AACzC,IAAA;AACH,EAAA;AACF;AD/VsG;AACA;AACA;AACA","file":"/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-XJBP2MBS.cjs","sourcesContent":[null,"import { Delopay } from './client';\nimport type { DelopayLogger, RequestExtras } from './client';\nimport { DelopayError } from './error';\nimport type {\n BrowserCardClaimRequest,\n BrowserCardClaimResponse,\n CheckoutAddonChoiceRequest,\n CheckoutAddonChoiceResponse,\n CheckoutDataResponse,\n CheckoutTax,\n CheckoutTaxRequest,\n CheckoutIdentityEmailCodeRequest,\n CheckoutIdentityEmailCodeResponse,\n CheckoutIdentityEmailVerifyRequest,\n CheckoutIdentityEmailVerifyResponse,\n CheckoutIdentityReuseRequest,\n CheckoutIdentityVerificationResponse,\n CheckoutIdentityVerificationStartRequest,\n CheckoutDeviceSessionCompleteRequest,\n CheckoutDeviceSessionResponse,\n ConfirmSubscriptionRequest,\n ConfirmSubscriptionResponse,\n EpayoutsMethodsOptions,\n EpayoutsMethodsResponse,\n MollieApplePaySessionRequest,\n MollieApplePaySessionResponse,\n MicropaymentBankSessionRequest,\n MicropaymentBankSessionResponse,\n EpayoutsPaypalDeclineRequest,\n EpayoutsPaypalDeclineResponse,\n EpayoutsPaypalOrderResponse,\n PaymentAbandonAttemptResponse,\n PaymentReopenAttemptResponse,\n PaymentConfirmRequest,\n PaymentMethodListResponse,\n PaymentMethodPresentationResponse,\n PaymentResponse,\n PaymentsPostSessionTokensRequest,\n PaymentsPostSessionTokensResponse,\n PaymentUpdateRequest,\n RecordCheckoutEventRequest,\n RecordCheckoutEventResponse,\n ReplayIngestParams,\n ReplayIngestResponse,\n NomupayCardAuthorizationRequest,\n NomupayCardAuthorizationResponse,\n StripeHostedConfirmRequest,\n SubscriptionCheckoutResponse,\n SubscriptionReturnStatusResponse,\n SelectSubscriptionMethodRequest,\n SubscriptionCheckoutMethod,\n SubscriptionMethodOptionsResponse,\n SubscriptionResponse,\n StripeHostedConfirmResponse,\n EnigmaFormSession,\n VaultCollectSessionParams,\n VaultCollectSessionResponse,\n VaultPaymentMethodRequest,\n VaultPaymentMethodResponse,\n VaultSavedCardsResponse,\n} from './types';\n\n/**\n * A publishable (browser-safe) API key. The template type rejects secret\n * keys (`prd_…` / `snd_…`) at compile time, so a checkout cannot be handed\n * a credential that would reach secret-key routes.\n */\nexport type PublishableKey = `pk_${string}`;\n\n/**\n * Drop any caller-supplied credential headers (case-insensitively), so a\n * route can only ever carry the one credential its family requires — the\n * class's isolation guarantee must hold against per-call `headers` too.\n * Non-credential extras (`Idempotency-Key`, `X-Dp-*`, …) pass through.\n */\nfunction withoutCredentialHeaders(extra?: Record<string, string>): Record<string, string> {\n if (!extra) return {};\n const out: Record<string, string> = {};\n for (const [key, value] of Object.entries(extra)) {\n const lower = key.toLowerCase();\n if (lower === 'api-key' || lower === 'authorization') continue;\n out[key] = value;\n }\n return out;\n}\n\n/** The query a vault form session is asked with: the buyer's locale and the form's look. */\nfunction vaultFormQuery(params?: VaultCollectSessionParams): Record<string, string | undefined> {\n const look = params?.appearance;\n return {\n locale: params?.locale,\n form_surface: look?.surface,\n form_text: look?.text,\n form_border: look?.border,\n form_accent: look?.accent,\n form_danger: look?.danger,\n form_font: look?.font,\n form_radius: look?.radius,\n form_size: look?.size,\n form_labels: look?.labels,\n form_chrome: look?.chrome,\n form_label: look?.label,\n form_hints: look?.hints === undefined ? undefined : String(look.hints),\n form_order: look?.order,\n form_marks: look?.marks,\n form_focus: look?.focus,\n form_motion: look?.motion,\n form_height: look?.height,\n form_gap: look?.gap,\n form_corner: look?.corner,\n form_fill: look?.fill,\n form_custom: look?.custom ? 'true' : undefined,\n };\n}\n\n/** Drop one header (case-insensitively) from a caller-supplied extras map. */\nfunction withoutHeader(headers: Record<string, string>, name: string): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [key, value] of Object.entries(headers)) {\n if (key.toLowerCase() === name) continue;\n out[key] = value;\n }\n return out;\n}\n\n/** Configuration for a {@link CheckoutSession}. */\nexport interface CheckoutSessionOptions {\n /** The merchant the payment belongs to. */\n merchantId: string;\n /** The payment this session is about. */\n paymentId: string;\n /**\n * The merchant's publishable key (`pk_prd_…` / `pk_snd_…`), from the\n * checkout payload's `pub_key`. Required for the `/payments/*` and\n * `/payment-methods` calls.\n */\n publishableKey?: PublishableKey;\n /**\n * The payment's client secret, from the checkout payload. Required for\n * every `/payment-link/*` call, and rides along on the payment calls.\n */\n clientSecret?: string;\n /** Override the API base URL (e.g. `/api` behind a same-origin proxy). */\n baseUrl?: string;\n /** Use the sandbox environment. Ignored when `baseUrl` is set. */\n sandbox?: boolean;\n /** Per-request timeout in milliseconds. */\n timeout?: number;\n /** Maximum automatic retries for retryable requests. */\n maxRetries?: number;\n debug?: boolean;\n logger?: DelopayLogger;\n}\n\n/**\n * Buyer-side client for a single hosted-checkout payment.\n *\n * Binds the two browser-safe credentials once — the merchant's publishable\n * key and the payment's client secret — and sends each request with exactly\n * the credential its route expects:\n *\n * - `/payment-link/*` side-channel routes authenticate with\n * `Authorization: Bearer <client_secret>`.\n * - `/payments/*` and `/payment-methods` authenticate with the publishable\n * key in the `api-key` header, with the client secret as query parameter\n * or body field.\n *\n * Neither credential can reach a secret-key route: the publishable key is\n * typed to the `pk_` prefix and the client secret only ever leaves as a\n * bearer token / parameter, never as an `api-key`.\n *\n * @example\n * ```typescript\n * const session = new CheckoutSession({\n * merchantId: checkout.merchant_id,\n * paymentId: checkout.payment_id,\n * publishableKey: checkout.pub_key,\n * clientSecret: checkout.client_secret,\n * });\n * const catalog = await session.epayoutsMethods('de');\n * ```\n */\n/**\n * A `CompressionStream` constructor, as much of it as this module uses.\n *\n * Declared structurally rather than taken from the DOM lib: the global is\n * absent in some runtimes this SDK is dropped into, and a type that asserts it\n * exists would make the feature test look redundant to the next reader.\n */\ntype GzipStreamCtor = new (format: 'gzip') => {\n readable: ReadableStream<Uint8Array>;\n writable: WritableStream<Uint8Array>;\n};\n\n/**\n * Gzip a JSON body, or answer `null` where the runtime cannot.\n *\n * `null` is not a failure — it is the caller's instruction to send the body\n * uncompressed. `CompressionStream` is a global in Node 18+ and in current\n * browsers but is missing from older Safari and from some embedded runtimes,\n * and this SDK carries no runtime dependencies, so there is no polyfill to\n * reach for. Sending plain JSON is always correct; the server reads the\n * encoding off the header it is given.\n *\n * The compressed stream is drained to an `ArrayBuffer` rather than handed to\n * `fetch` as a stream. A streamed request body needs `duplex: 'half'`, cannot\n * be replayed on a retry, and is refused outright together with `keepalive` —\n * which is precisely the case a recorder needs when the page is navigating\n * away.\n */\nasync function gzipJson(value: unknown): Promise<ArrayBuffer | null> {\n const ctor = (globalThis as { CompressionStream?: GzipStreamCtor }).CompressionStream;\n if (typeof ctor !== 'function') return null;\n try {\n const bytes = new TextEncoder().encode(JSON.stringify(value));\n return await new Response(\n new Blob([bytes]).stream().pipeThrough(new ctor('gzip')),\n ).arrayBuffer();\n } catch {\n // A runtime carrying the constructor but unable to run it — no\n // `Blob.prototype.stream`, no `pipeThrough` — is the uncompressed case\n // too. A recording must never cost the caller a payment page.\n return null;\n }\n}\n\nexport class CheckoutSession {\n private readonly client: Delopay;\n private readonly merchantId: string;\n private readonly paymentId: string;\n private readonly publishableKey?: PublishableKey;\n private readonly clientSecret?: string;\n\n constructor(options: CheckoutSessionOptions) {\n this.merchantId = options.merchantId;\n this.paymentId = options.paymentId;\n this.publishableKey = options.publishableKey;\n this.clientSecret = options.clientSecret;\n // Constructed WITHOUT a key: every call attaches its own credential\n // explicitly, so a bearer-authenticated route never carries an api-key\n // header and vice versa.\n this.client = new Delopay('', {\n baseUrl: options.baseUrl,\n sandbox: options.sandbox,\n timeout: options.timeout,\n maxRetries: options.maxRetries,\n debug: options.debug,\n logger: options.logger,\n });\n }\n\n private get linkBase(): string {\n return `/payment-link/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`;\n }\n\n /** Headers for the client-secret bearer routes (`/payment-link/*`). */\n private bearerHeaders(extra?: Record<string, string>): Record<string, string> {\n return {\n ...withoutCredentialHeaders(extra),\n Authorization: `Bearer ${this.requireClientSecret()}`,\n };\n }\n\n /** Headers for the publishable-key routes (`/payments/*`, `/payment-methods`). */\n private pkHeaders(extra?: Record<string, string>): Record<string, string> {\n if (!this.publishableKey) {\n throw new DelopayError('This call requires the publishable key', {\n status: 0,\n code: 'MISSING_CREDENTIAL',\n type: 'invalid_request',\n });\n }\n return { ...withoutCredentialHeaders(extra), 'api-key': this.publishableKey };\n }\n\n private requireClientSecret(): string {\n if (!this.clientSecret) {\n throw new DelopayError('This call requires the payment client secret', {\n status: 0,\n code: 'MISSING_CREDENTIAL',\n type: 'invalid_request',\n });\n }\n return this.clientSecret;\n }\n\n /**\n * The hosted checkout's bootstrap payload for a one-time payment —\n * `CheckoutDetails` while payable, a status view once settled.\n *\n * Deliberately unauthenticated: a `pay_` link bootstraps before any\n * credential exists, so no credential header is ever attached (caller\n * extras are still stripped of credentials). Core fields and the collection\n * policy are typed; provider-specific fields remain available as unknown.\n *\n * `theme` (a named checkout variant) and `country` are the route's declared\n * query parameters. `country` is a manual override of the buyer country the\n * router otherwise resolves from the client IP — it decides which payment\n * methods the layout shows — as an ISO 3166-1 alpha-2 code, sent uppercased\n * and omitted when empty. `locale` travels as `Accept-Language` — the only\n * channel the backend's locale resolution reads; a `?locale=` query is\n * silently ignored by this route.\n *\n * `cardOnly` is a direct link to the card form (`payment_method=card`):\n * when the Stripe card form being prepared is the one the link names, its\n * PaymentIntent is created for `card` alone. `cardProvider` and\n * `cardAccount` name that form's connector and account; absent or blank\n * matches any.\n *\n * `entry` opens one of the shop's checkout entries (`?entry=`): the layout\n * holds only that entry's methods and is drawn in its named look, and\n * `entry` on the answer says whether it had anything to offer.\n *\n * `GET /payment-link/data/{merchantId}/{paymentId}`\n */\n async fetchCheckoutData(\n params?: {\n locale?: string;\n theme?: string;\n country?: string;\n cardOnly?: boolean;\n cardProvider?: string;\n cardAccount?: string;\n entry?: string;\n },\n options?: RequestExtras,\n ): Promise<CheckoutDataResponse> {\n const country = params?.country?.trim().toUpperCase();\n return this.client.request(\n 'GET',\n `/payment-link/data/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n query: {\n theme: params?.theme,\n country: country || undefined,\n card_only: params?.cardOnly || undefined,\n card_provider: params?.cardOnly ? params.cardProvider?.trim() || undefined : undefined,\n card_account: params?.cardOnly ? params.cardAccount?.trim() || undefined : undefined,\n entry: params?.entry?.trim() || undefined,\n },\n ...options,\n headers: {\n ...(params?.locale\n ? {\n ...withoutHeader(withoutCredentialHeaders(options?.headers), 'accept-language'),\n 'Accept-Language': params.locale,\n }\n : withoutCredentialHeaders(options?.headers)),\n },\n },\n );\n }\n\n /**\n * The subscription twin of {@link CheckoutSession.fetchCheckoutData}: the\n * bootstrap payload for a `sub_` checkout. Authenticated with the\n * subscription's client secret (construct the session with the `sub_…` id\n * in the `paymentId` slot). `locale` travels as `Accept-Language`, same\n * as {@link CheckoutSession.fetchCheckoutData}.\n *\n * `GET /subscriptions/data/{merchantId}/{subscriptionId}`\n */\n async fetchSubscriptionData(\n params?: { locale?: string },\n options?: RequestExtras,\n ): Promise<SubscriptionCheckoutResponse> {\n return this.client.request(\n 'GET',\n `/subscriptions/data/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n ...options,\n headers: {\n ...(params?.locale\n ? {\n ...withoutHeader(this.bearerHeaders(options?.headers), 'accept-language'),\n 'Accept-Language': params.locale,\n }\n : this.bearerHeaders(options?.headers)),\n },\n },\n );\n }\n\n /**\n * Report buyer/device signals for rails that never reach\n * `/payments/{id}/confirm` (the Stripe SAQ-A rail: raw cards, Apple Pay,\n * Google Pay). Same telemetry contract as\n * {@link CheckoutSession.recordEvent}: sent with `keepalive: true`, and\n * failures resolve instead of rejecting — signals must never block or\n * break a checkout. Unauthenticated by design.\n *\n * `POST /payment-link/client-signals/{merchantId}/{paymentId}`\n */\n async reportClientSignals(\n params: {\n browser_info?: Record<string, unknown>;\n signals: Record<string, unknown>;\n },\n options?: RequestExtras,\n ): Promise<void> {\n try {\n await this.client.request(\n 'POST',\n `/payment-link/client-signals/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n body: params,\n keepalive: true,\n ...options,\n headers: withoutCredentialHeaders(options?.headers),\n },\n );\n } catch {\n // Telemetry: swallowing is the contract, not an oversight.\n }\n }\n\n /**\n * Store one slice of the buyer's checkout recording on our own side.\n * Called by the hosted checkout as the buyer works through the page; the\n * client secret is attached automatically.\n *\n * **Not telemetry semantics, on purpose.** Unlike\n * {@link CheckoutSession.recordEvent}, this rejects with a `DelopayError`\n * like every other payment call, because the recorder has to tell the\n * answers apart: a `400` with code `IR_16` means the backend will not take\n * this recording (recording is off on that deployment, the recording is\n * full, the payment is already recording a different session, or this\n * number is stored with different content) and the recorder must stop; any\n * other `400` is the slice itself being refused; a transport failure may be\n * retried with the **same** bytes under the **same** number, which the\n * backend answers with `duplicate: true`.\n *\n * Pass `keepalive: true` for the last slice of a page that is navigating\n * away (a redirect rail); browsers refuse keepalive bodies over ~64 KiB, so\n * only a small final slice should carry it.\n *\n * Pass `compress: true` to send the slice gzipped. Recorded page events\n * compress heavily, so this is mostly a saving on the buyer's connection. It\n * is opt-in and degrades silently: a runtime without `CompressionStream`\n * sends the same slice uncompressed rather than failing, so a caller never\n * has to feature-test before asking for it.\n *\n * ⚠️ `keepalive` overrides it. Compressing means awaiting a stream read\n * before the request is made, and `keepalive` protects a request only once\n * it has been initiated — so a page torn down mid-compression would drop the\n * final slice altogether. A slice sent with `keepalive` therefore always\n * travels uncompressed, whatever `compress` says. Passing both is allowed and\n * is what a recorder should do: every ordinary slice compresses, and the last\n * one is sent the way that actually arrives.\n *\n * For a precompressed event array, pass `compressed_events` and `gzipBody`.\n * The latter receives the complete JSON request (including the session's\n * client secret) and must return gzip bytes synchronously. Fetch then starts\n * before this method yields, including on a page-navigation slice. A\n * keepalive request is used only when that prepared body is at most 60 KiB.\n *\n * `POST /payments/{paymentId}/replay/slice` (publishable key)\n */\n async storeReplaySlice(\n params: ReplayIngestParams,\n options?: RequestExtras & {\n keepalive?: boolean;\n compress?: boolean;\n /** Gzip a prepared JSON envelope synchronously before the request starts. */\n gzipBody?: (body: Uint8Array) => Uint8Array;\n },\n ): Promise<ReplayIngestResponse> {\n const { keepalive, compress, gzipBody, ...extras } = options ?? {};\n // Built before anything can be compressed, so a missing credential still\n // rejects without a request going out.\n const body = { ...params, client_secret: this.requireClientSecret() };\n const headers = this.pkHeaders(extras.headers);\n // `keepalive` wins over `compress`, and that is a correctness rule rather\n // than a preference. `keepalive` preserves a request only once it has been\n // *initiated*; compressing first means awaiting a stream read, and a page\n // torn down during that await never reaches `fetch()` at all — the final\n // slice is then lost outright, which is the one thing `keepalive` exists to\n // prevent. Losing a slice to save bytes is the wrong trade, so the slice a\n // page is navigating away from travels uncompressed. It is also the\n // smallest one: browsers refuse keepalive bodies over ~64 KiB anyway.\n const encoded = gzipBody?.(new TextEncoder().encode(JSON.stringify(body)));\n const gzipped = encoded\n ? Uint8Array.from(encoded).buffer\n : compress === true && keepalive !== true\n ? await gzipJson(body)\n : null;\n return this.client.request(\n 'POST',\n `/payments/${encodeURIComponent(this.paymentId)}/replay/slice`,\n {\n body: gzipped ?? body,\n ...(keepalive !== undefined\n ? { keepalive: encoded ? keepalive && encoded.byteLength <= 60 * 1024 : keepalive }\n : {}),\n ...extras,\n // `Content-Type` has to be stated for the compressed body: the client\n // only sets it for a body it serialises itself, and the bytes are\n // still JSON — gzip is how they travel, not what they are.\n headers:\n gzipped === null\n ? headers\n : { ...headers, 'Content-Type': 'application/json', 'Content-Encoding': 'gzip' },\n },\n );\n }\n\n /**\n * The status a buyer coming back from the processor's checkout may read:\n * the subscription's status, and whether the processor has reported it yet\n * (`awaiting_processor`). Construct the session with the `sub_…` id in the\n * `paymentId` slot.\n *\n * Authenticated with the return token (`rt`) the return URL carried, sent as\n * `Authorization: Bearer <rt>`. That token reads only this, for a day; it is\n * never the client secret, which this call does not send.\n *\n * `GET /subscriptions/return-status/{merchantId}/{subscriptionId}`\n */\n async subscriptionReturnStatus(\n returnToken: string,\n options?: RequestExtras,\n ): Promise<SubscriptionReturnStatusResponse> {\n if (!returnToken) {\n throw new DelopayError('This call requires the return token (rt) from the return URL', {\n status: 0,\n code: 'MISSING_CREDENTIAL',\n type: 'invalid_request',\n });\n }\n return this.client.request(\n 'GET',\n `/subscriptions/return-status/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n ...options,\n headers: {\n ...withoutCredentialHeaders(options?.headers),\n Authorization: `Bearer ${returnToken}`,\n },\n },\n );\n }\n\n /**\n * The methods the buyer may pick for a subscription that waits for the\n * choice (`method_choice_pending`), judged for the buyer. Call it from the\n * buyer's browser: the sell-to country is read from this request's own\n * connection. A cancelled subscription answers 400, and one that already\n * bills on an account answers 409 (`DE_20`). Authenticated with the\n * subscription's client secret.\n *\n * `GET /subscriptions/method-options/{merchantId}/{subscriptionId}`\n */\n async subscriptionMethodOptions(\n options?: RequestExtras,\n ): Promise<SubscriptionMethodOptionsResponse> {\n return this.client.request(\n 'GET',\n `/subscriptions/method-options/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Bind a waiting subscription to the method the buyer picked and open its\n * first cycle on that method's billing account. The methods are judged\n * again from this request; afterwards\n * {@link CheckoutSession.fetchSubscriptionData} describes the bound\n * subscription (Stripe's Payment Element for `card`, `confirmSubscription`\n * for the others). Picking the same method again answers the bound\n * subscription. A subscription bound to another method already, or whose\n * billing account changed meanwhile, answers 409 (`DE_20`); a method not\n * offered to this buyer, or a cancelled subscription, answers 400.\n * Authenticated with the subscription's client secret.\n *\n * `POST /subscriptions/select-method/{merchantId}/{subscriptionId}`\n */\n async selectSubscriptionMethod(\n method: SubscriptionCheckoutMethod,\n options?: RequestExtras,\n ): Promise<SubscriptionResponse> {\n const body: SelectSubscriptionMethodRequest = { method };\n return this.client.request(\n 'POST',\n `/subscriptions/select-method/${encodeURIComponent(this.merchantId)}/${encodeURIComponent(this.paymentId)}`,\n {\n body,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Confirm a subscription (PayPal approval rail). The client secret is\n * attached automatically; the shop's profile id travels as the\n * `X-Profile-Id` header the subscription routes require.\n *\n * `POST /subscriptions/{subscriptionId}/confirm` (publishable key)\n */\n async confirmSubscription(\n subscriptionId: string,\n profileId: string,\n params: Omit<ConfirmSubscriptionRequest, 'client_secret'>,\n options?: RequestExtras,\n ): Promise<ConfirmSubscriptionResponse> {\n return this.client.request(\n 'POST',\n `/subscriptions/${encodeURIComponent(subscriptionId)}/confirm`,\n {\n body: { ...params, client_secret: this.requireClientSecret() },\n ...options,\n // Strip any caller-supplied x-profile-id first (case-insensitively):\n // Fetch folds duplicate headers into `caller, pro_x`, and the\n // subscription routes must see exactly one profile scope.\n headers: {\n ...withoutHeader(this.pkHeaders(options?.headers), 'x-profile-id'),\n 'X-Profile-Id': profileId,\n },\n },\n );\n }\n\n /**\n * The e-Payouts rail catalog for the buyer's country, plus the set of\n * countries that have at least one vendor.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/epayouts/methods`\n *\n * Pass `{ paypalSdk: true }` from a checkout drawing an experimental PayPal\n * SDK pane to also receive e-Payouts' PayPal client id\n * (`paypal_client_id`, `paypal_currency`); it is present only when `ppal`\n * is among the methods.\n *\n * @param country - Lowercase ISO 3166-1 alpha-2 country code.\n */\n async epayoutsMethods(\n country: string,\n options?: RequestExtras & EpayoutsMethodsOptions,\n ): Promise<EpayoutsMethodsResponse> {\n const { paypalSdk, merchantConnectorId, ...extras } = options ?? {};\n return this.client.request('GET', `${this.linkBase}/epayouts/methods`, {\n query: paypalSdk\n ? {\n cc: country,\n paypal_sdk: 'true',\n ...(merchantConnectorId ? { merchant_connector_id: merchantConnectorId } : {}),\n }\n : { cc: country },\n ...extras,\n headers: this.bearerHeaders(extras.headers),\n });\n }\n\n /**\n * The PayPal order e-Payouts created for the payment, for the PayPal SDK's\n * `createOrder` on the PayPal Express or Pay with card pane, after the payment\n * was confirmed through that pane. Return `order_id` from `createOrder` and\n * send the buyer to `approve_url` once PayPal approved it; without an order,\n * or when PayPal's button cannot be drawn, send the buyer to `redirect_url`.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/epayouts/paypal-order`\n */\n async epayoutsPaypalOrder(options?: RequestExtras): Promise<EpayoutsPaypalOrderResponse> {\n return this.client.request('POST', `${this.linkBase}/epayouts/paypal-order`, {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Report PayPal's refusal of the card or the payer on the PayPal Express or\n * Pay with card pane (for example `INSTRUMENT_DECLINED`, `PAYER_CANNOT_PAY`,\n * or `AUTHENTICATION_FAILED` for a failed 3-D Secure). The attempt is\n * recorded declined and the payment stays payable with another card or\n * method. An issue that is not a refusal, or a payment that no longer awaits\n * PayPal, is left as it is (`declined: false`). Nothing here captures: the\n * payment settles from e-Payouts' notification.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/epayouts/paypal-decline`\n */\n async epayoutsPaypalDecline(\n params: EpayoutsPaypalDeclineRequest,\n options?: RequestExtras,\n ): Promise<EpayoutsPaypalDeclineResponse> {\n return this.client.request('POST', `${this.linkBase}/epayouts/paypal-decline`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Record a buyer-side checkout event on the payment's status timeline.\n *\n * Telemetry semantics, built in so callers can genuinely fire-and-forget:\n * the request is sent with `keepalive: true` (it survives the document\n * navigating away, e.g. right before a `window.open`), and transport or\n * server failures resolve to `undefined` instead of rejecting — telemetry\n * must never break a checkout or surface an unhandled rejection. Do not\n * `await` this in a click handler that must stay synchronous.\n *\n * A missing client secret still throws `MISSING_CREDENTIAL`: that is a\n * wiring bug, not a telemetry failure.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/checkout-events`\n */\n async recordEvent(\n params: RecordCheckoutEventRequest,\n options?: RequestExtras,\n ): Promise<RecordCheckoutEventResponse | undefined> {\n const headers = this.bearerHeaders(options?.headers);\n try {\n return await this.client.request('POST', `${this.linkBase}/checkout-events`, {\n body: params,\n keepalive: true,\n ...options,\n headers,\n });\n } catch {\n return undefined;\n }\n }\n\n /** Create a new Apple merchant-validation session for a payable Mollie checkout.\n * Requires a live Mollie validation key even for a test payment; never charges.\n * Browser Origin must match the configured checkout domain.\n */\n async mollieApplePaySession(\n params: MollieApplePaySessionRequest,\n options?: RequestExtras,\n ): Promise<MollieApplePaySessionResponse> {\n return this.client.request('POST', `${this.linkBase}/mollie/apple-pay-session`, {\n ...options,\n body: params,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Prepare MicroPayment transfer instructions or an unsigned SEPA mandate.\n * No debit is approved. Show the returned mandate disclosure before collecting\n * acceptance, then confirm with metadata.micropayment_preparation and, for\n * new SEPA mandates, explicit customer_acceptance. Every SEPA confirm must\n * acknowledge its amount/date notice with metadata.micropayment_prenotified.\n * Echo native_pane_merchant_connector_id and the returned\n * native_pane_quote_generation on confirm. Saved reuse sends\n * recurring_details: { type: 'payment_method_id', data: payment_method_id }\n * with payment_method: 'bank_debit', payment_method_type: 'sepa' and no raw\n * bank data. Only saved off-session preparation may omit quote_generation.\n * Transfer instructions become available only after canonical confirmation.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/micropayment/bank-session`\n */\n async micropaymentBankSession(\n params: MicropaymentBankSessionRequest,\n options?: RequestExtras,\n ): Promise<MicropaymentBankSessionResponse> {\n return this.client.request('POST', `${this.linkBase}/micropayment/bank-session`, {\n ...options,\n body: params,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * A short-lived VGS Collect session for browser-side card capture.\n *\n * **Exactly one refusal means \"this shop has no vault\": a 400 carrying\n * `IR_19`.** Every other refusal means a vault exists and could not be used,\n * and answering it by falling back to the processor's own card pane sends an\n * unprotected card number to the very processor the shop pays to hide it\n * from — the bug this endpoint's error contract exists to prevent.\n *\n * A **404 is not benign.** The router answers it when the shop's vault\n * account cannot be found — the state a shop is left in when its vault\n * connector is deleted while the profile keeps naming the id: it still\n * reports the vault as enabled and still expects its cards cloaked. The same\n * status also covers a payment that does not exist.\n *\n * `params.appearance` asks for a form styled to match the page (Enigma\n * Vault). The answer then carries `height`, the frame height to use. If the\n * vault refuses the styled form the answer is the plain one, without\n * `height`. `params.locale` is the buyer's locale.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/vault/collect-session`\n */\n async vaultCollectSession(\n options?: RequestExtras,\n params?: VaultCollectSessionParams,\n ): Promise<VaultCollectSessionResponse> {\n return this.client.request('GET', `${this.linkBase}/vault/collect-session`, {\n ...options,\n query: vaultFormQuery(params),\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * The saved cards the buyer of this payment can pay with, on a shop whose\n * vault keeps the security code itself (Enigma Vault): the cards of the\n * payment's own customer that the shop's vault holds, most recently used\n * first. A payment without a customer answers an empty list.\n *\n * Draw saved cards from this list, not from the customer's payment-method\n * list: that one also carries cards the security-code form cannot open.\n * To pay with one, mint its form with {@link vaultSecurityCodeSession},\n * and confirm with its `payment_token` once the form reports the code\n * stored.\n *\n * A shop without a vault, and a VGS shop, answer `400`.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/vault/saved-cards`\n */\n async vaultSavedCards(options?: RequestExtras): Promise<VaultSavedCardsResponse> {\n return this.client.request('GET', `${this.linkBase}/vault/saved-cards`, {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Remove one of the buyer's saved cards, named by its `payment_token` from\n * {@link vaultSavedCards}: from the customer's saved cards and from the\n * shop's vault, with every saved copy of the same card. Only a card of the\n * payment's own customer that the shop's vault holds can be removed, and\n * only within the payment's session.\n *\n * Refusals throw a `DelopayError`:\n *\n * - `400` with code `IR_16` and `data.reason` set to a\n * {@link VaultSavedCardRemovalRefusal}: the card stays listed.\n * `saved_card_in_use` means a subscription or agreement still charges it,\n * `saved_card_payment_in_progress` a payment with it is in flight, and\n * `saved_card_removal_unavailable` that the shop cannot remove cards here.\n * - `404`: the card is not one this buyer can remove, for example because it\n * is already gone.\n * - `422` with code `IR_29`: the token is no longer held. Read\n * {@link vaultSavedCards} again and remove the card by its new token.\n *\n * `DELETE /payment-link/{merchantId}/{paymentId}/vault/saved-cards/{paymentToken}`\n */\n async vaultRemoveSavedCard(paymentToken: string, options?: RequestExtras): Promise<void> {\n await this.client.request(\n 'DELETE',\n `${this.linkBase}/vault/saved-cards/${encodeURIComponent(paymentToken)}`,\n {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Mint the security-code form for a saved card, on a shop whose vault keeps\n * the code itself (Enigma Vault). The buyer re-enters the code into the\n * vault's own form, so it never reaches the checkout; confirm with the saved\n * card's `payment_token` once the form reports it stored.\n *\n * `paymentToken` is the saved card's token from {@link vaultSavedCards}. A\n * VGS shop answers `400`: VGS re-collects the code with Collect.\n *\n * `params.appearance` asks for a form styled to match the page, as on\n * {@link vaultCollectSession}. The styled form is the security-code field\n * alone, with no label: draw the label beside the frame, and size the frame\n * to the answer's `height`. `labels` is ignored. If the vault refuses the\n * styled form the answer is the plain one, without `height`.\n *\n * The form stores one code and then disables itself. After a failed\n * payment, mint a new form before the buyer tries again.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/vault/security-code-session`\n */\n async vaultSecurityCodeSession(\n paymentToken: string,\n options?: RequestExtras,\n params?: VaultCollectSessionParams,\n ): Promise<EnigmaFormSession> {\n return this.client.request('GET', `${this.linkBase}/vault/security-code-session`, {\n ...options,\n query: { payment_token: paymentToken, ...vaultFormQuery(params) },\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Register the aliased card as a payment method and mint the one-shot\n * `payment_token` the confirm call spends.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/vault/payment-method`\n */\n async registerVaultPaymentMethod(\n params: VaultPaymentMethodRequest,\n options?: RequestExtras,\n ): Promise<VaultPaymentMethodResponse> {\n return this.client.request('POST', `${this.linkBase}/vault/payment-method`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Reserve this payment attempt before a hosted card form contacts Stripe,\n * Airwallex, or NomuPay. Send the provider object rendered to this checkout\n * and retain the same `flow_id` across retries and any 3-D Secure step.\n *\n * Only `authorized: true` permits the form to contact its processor. A\n * competing flow receives `false` and must reload; an unresolved provider\n * outcome stays reserved, regardless of elapsed time. A buyer-blocklist\n * refusal throws a `DelopayError` with code `DE_14`; a shop whose payments\n * DeloPay stopped is refused with `DE_22`, and a shop whose payments the\n * merchant switched off with `DE_21`.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/browser-card-claim`\n */\n async claimBrowserCard(\n params: BrowserCardClaimRequest,\n options?: RequestExtras,\n ): Promise<BrowserCardClaimResponse> {\n return this.client.request('POST', `${this.linkBase}/browser-card-claim`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Confirm the Stripe card form's PaymentIntent through the router, for a\n * checkout payload with `card_connector_server_confirm: true`. Stripe refuses\n * a Stripe.js confirm of such an intent.\n *\n * Send the PaymentMethod `stripe.createPaymentMethod` produced from the\n * Payment Element (or Express Checkout Element), which needs\n * `paymentMethodCreation: 'manual'` on the Elements instance. A\n * ConfirmationToken is refused with `400`: Stripe will not confirm such an\n * intent with one.\n *\n * The router judges the card's issuing country and the buyer's IP country\n * against the shop's sell-to restrictions before Stripe authorises, and a\n * refusal throws a `DelopayError` with code `DE_10`. A buyer on the\n * merchant's buyer blocklist is refused before any Stripe call with code\n * `DE_14` (`buyer_blocked`, 422), which names no entry, a shop whose\n * payments DeloPay stopped with `DE_22`, and a shop whose payments the\n * merchant switched off with `DE_21`. A buyer the merchant's buyer risk\n * model refuses fails with `DE_23` (`buyer_risk_refused`, 422), which says\n * nothing about the signals. When the answer's\n * `status` is `requires_action`, run `stripe.handleNextAction` with its\n * `client_secret` — safe, because the intent is `confirmation_method=manual`\n * and that secret confirms nothing without the secret key — then call this\n * again without a payment method to finalize.\n *\n * Reserve the attempt with {@link claimBrowserCard} first. Send its granted\n * `flow_id` as `browser_flow_id` on both the initial and post-action confirm;\n * an omitted, null or nonholder flow is refused with `400` and code `IR_16`.\n *\n * A PaymentMethod rules out what `stripe.createPaymentMethod` cannot\n * produce: Stripe names Amazon Pay and Klarna in the Express Checkout\n * Element, which need `stripe.createConfirmationToken` instead. Neither can\n * be paid through this route, so a caller must not offer them on a\n * server-confirmed intent — mount the Express Checkout Element with those\n * methods `'never'`, as DeloPay's own checkout does. The router drops only\n * the methods its server-side confirm cannot finish at all (BLIK and ACSS\n * pre-authorized debits) from the card form's mount, so the rest of the\n * selection still reaches the element and is the caller's to constrain.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/stripe-confirm`\n */\n async confirmStripeCardForm(\n params: StripeHostedConfirmRequest,\n options?: RequestExtras,\n ): Promise<StripeHostedConfirmResponse> {\n return this.client.request('POST', `${this.linkBase}/stripe-confirm`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Make the buyer's add-on choice while the checkout data answers\n * `type: 'addon_choice'`.\n *\n * Only price ids and quantities are sent; the router prices them from the\n * catalog and judges every selection group's bounds. The payment's lines and\n * amount change together, once: the choice is final afterwards, the same\n * choice sent again answers the same result, and another is refused with\n * `IR_16` — as is a choice once anything could have been charged at the\n * previous amount. Fetch the checkout data again afterwards for the payment\n * methods at the final amount.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/addons`\n */\n async chooseAddons(\n params: CheckoutAddonChoiceRequest,\n options?: RequestExtras,\n ): Promise<CheckoutAddonChoiceResponse> {\n return this.client.request('POST', `${this.linkBase}/addons`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Send the buyer's tax country, region and VAT ID while the checkout data's\n * `tax.step` is `open`, and get the VAT the payment carries for them.\n *\n * `close: false` recalculates and keeps the step open, for a live total\n * while the buyer types; it also opens a confirmed step again while nothing\n * was prepared at a provider. `close: true` recalculates and confirms: the\n * payment is charged what the answer says, and the checkout data, fetched\n * again, answers the payment methods with `tax.step` `closed`. A confirmed\n * step answers the same closing request again. A change once something was\n * prepared at a provider is refused with `DE_28` (409), as is one while the\n * add-on choice is open or after the checkout expired. A malformed country\n * or region is refused with `IR_06` (400).\n *\n * `POST /payment-link/{merchantId}/{paymentId}/tax`\n */\n async submitTax(params: CheckoutTaxRequest, options?: RequestExtras): Promise<CheckoutTax> {\n return this.client.request('POST', `${this.linkBase}/tax`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * The payment's identity verification step: whether the payment asked for\n * one, its outcome, and the provider's page while it is pending. A pending\n * verification is read from the provider first, so call this when the buyer\n * comes back from the provider's page.\n *\n * `required` is `false` when the payment asked for no verification.\n * `can_retry` is `true` after an expired or abandoned attempt; start a new\n * one with {@link CheckoutSession.startIdentityVerification}.\n *\n * `GET /payment-link/{merchantId}/{paymentId}/identity-verification`\n */\n async identityVerification(\n options?: RequestExtras,\n ): Promise<CheckoutIdentityVerificationResponse> {\n return this.client.request('GET', `${this.linkBase}/identity-verification`, {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Resume the payment's pending identity verification, start it, or start a\n * new attempt after an expired or abandoned one. Send the buyer to the\n * returned `verification_url`; the provider sends them back to `return_url`,\n * which must be on the payment's checkout origin.\n *\n * Refusals throw a `DelopayError`: `400` when the return URL is not on the\n * payment's checkout or the verification is already decided, `404` when the\n * payment asked for no verification.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/identity-verification`\n */\n async startIdentityVerification(\n params: CheckoutIdentityVerificationStartRequest,\n options?: RequestExtras,\n ): Promise<CheckoutIdentityVerificationResponse> {\n return this.client.request('POST', `${this.linkBase}/identity-verification`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Mail the buyer a code that confirms their email, so the payment can reuse\n * a verification the merchant already has for them. Offer it only while the\n * checkout data says `identity_verification_reuse_allowed`. The answer is\n * the same whether or not the merchant verified anyone with the address.\n *\n * Refusals throw a `DelopayError`: `400` with code `DE_26` and the reason as\n * its message (`IV_REUSE_OFF` when the payment's requirement does not allow\n * reuse, `IV_REUSE_STEP` when the payment has no verification step a reuse\n * can stand for, `IV_EMAIL_INVALID`), `429` after too many codes for the\n * caller or the address.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/identity-verification/email-code`\n */\n async sendIdentityEmailCode(\n params: CheckoutIdentityEmailCodeRequest,\n options?: RequestExtras,\n ): Promise<CheckoutIdentityEmailCodeResponse> {\n return this.client.request('POST', `${this.linkBase}/identity-verification/email-code`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Check the code the buyer entered. `reusable` says only whether the\n * merchant has a verification the payment can reuse; then call\n * {@link CheckoutSession.reuseIdentityVerification}. Otherwise pass the\n * `challenge_id` as `email_challenge_id` to\n * {@link CheckoutSession.startIdentityVerification}, so a later payment can\n * reuse the verification it starts.\n *\n * Refusals throw a `DelopayError`: `400` with code `DE_26` and the reason as\n * its message. `IV_CODE_INCORRECT` is a wrong code, with the tries left in\n * `data.attempts_left`; `IV_CODE_EXPIRED` is an expired code or one out of\n * tries; `IV_CHALLENGE_UNKNOWN` names no code of this payment.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/identity-verification/email-code/verify`\n */\n async verifyIdentityEmailCode(\n params: CheckoutIdentityEmailVerifyRequest,\n options?: RequestExtras,\n ): Promise<CheckoutIdentityEmailVerifyResponse> {\n return this.client.request('POST', `${this.linkBase}/identity-verification/email-code/verify`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Reuse the merchant's verification for the buyer's confirmed email as the\n * payment's verification. Needs the challenge confirmed on this payment in\n * the last 30 minutes, and uses it up. No provider session, provider cost or\n * DeloPay fee is made. Answers the payment's verification step, verified.\n *\n * Refusals throw a `DelopayError`: `400` with code `DE_26` and the reason as\n * its message (`IV_CHALLENGE_NOT_CONFIRMED`, `IV_REUSE_NOT_ELIGIBLE`,\n * `IV_REUSE_OFF`, `IV_REUSE_STEP`).\n *\n * `POST /payment-link/{merchantId}/{paymentId}/identity-verification/reuse`\n */\n async reuseIdentityVerification(\n params: CheckoutIdentityReuseRequest,\n options?: RequestExtras,\n ): Promise<CheckoutIdentityVerificationResponse> {\n return this.client.request('POST', `${this.linkBase}/identity-verification/reuse`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Start the device assessment of the payment's checkout. `required` is\n * `false` when the shop assesses no devices, the payment's device is already\n * assessed, or the provider cannot start a session: go on without it. Run\n * the named `library` with the `token`, then call\n * {@link CheckoutSession.completeDeviceSession}.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/device-session`\n */\n async startDeviceSession(options?: RequestExtras): Promise<CheckoutDeviceSessionResponse> {\n return this.client.request('POST', `${this.linkBase}/device-session`, {\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Report the device assessment finished. The router records it with the\n * provider and stores the signal on the payment. Refused with `400` when the\n * session and token are not the payment's pending ones.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/device-session/complete`\n */\n async completeDeviceSession(\n params: CheckoutDeviceSessionCompleteRequest,\n options?: RequestExtras,\n ): Promise<void> {\n await this.client.request('POST', `${this.linkBase}/device-session/complete`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * Ask whether NomuPay's COPYandPAY widget may submit a card, from the\n * form's pre-submit hook.\n *\n * Only for a checkout stamped `NomupayOppwaCheckoutData.submit_grant`: the\n * card form sits beside always-shown wallet buttons of another account, and\n * this answer closes those buttons before it allows the card. `authorized`\n * is `false` when the payment no longer waits for a payment method, or when\n * this is not the attempt's live card-form checkout; when a wallet beside it\n * is already being paid, the route answers an error instead. Submit the\n * widget only on `true`.\n *\n * `POST /payment-link/{merchantId}/{paymentId}/nomupay-card-authorization`\n */\n async nomupayCardAuthorization(\n params: NomupayCardAuthorizationRequest,\n options?: RequestExtras,\n ): Promise<NomupayCardAuthorizationResponse> {\n return this.client.request('POST', `${this.linkBase}/nomupay-card-authorization`, {\n body: params,\n ...options,\n headers: this.bearerHeaders(options?.headers),\n });\n }\n\n /**\n * The payment's current state — status polling for redirect/popup rails.\n *\n * `GET /payments/{paymentId}` (publishable key + client secret)\n */\n async retrievePayment(options?: RequestExtras): Promise<PaymentResponse> {\n return this.client.request('GET', `/payments/${encodeURIComponent(this.paymentId)}`, {\n query: { client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n\n /**\n * Update the payment before confirmation (e.g. persist custom-field\n * answers as `metadata` on rails that never hit `/confirm`). The client\n * secret is attached automatically.\n *\n * `POST /payments/{paymentId}` (publishable key)\n */\n async updatePayment(\n params: PaymentUpdateRequest,\n options?: RequestExtras,\n ): Promise<PaymentResponse> {\n return this.client.request('POST', `/payments/${encodeURIComponent(this.paymentId)}`, {\n body: { ...params, client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n\n /**\n * Confirm the payment. The client secret is attached automatically; pass\n * an `Idempotency-Key` header via `options` to make retries safe.\n *\n * `POST /payments/{paymentId}/confirm` (publishable key)\n */\n async confirmPayment(\n params: PaymentConfirmRequest,\n options?: RequestExtras,\n ): Promise<PaymentResponse> {\n return this.client.request('POST', `/payments/${encodeURIComponent(this.paymentId)}/confirm`, {\n body: { ...params, client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n\n /**\n * Mint the processor-side session a browser SDK completes — the PayPal\n * order that PayPal's buttons or Card Fields attach the buyer's choice to.\n * The client secret is attached automatically.\n *\n * For PayPal Card Fields pass `payment_method: 'card'` and the\n * `merchant_connector_id` the checkout was rendered with; the order id comes\n * back in `next_action.next_action_data.order_id` and is what the SDK's\n * `createOrder` returns. The confirm that captures it sends the same order\n * and account as `payment_method_data.card_reference`.\n *\n * Send a distinct `Idempotency-Key` through `options.headers` for each new\n * card submission; reuse it only to retry that same session request. The\n * returned order is bound to this attempt and account. Sessions cannot\n * replace an order while authentication or money processing is unresolved,\n * or after authorization/capture; stale or foreign references are refused.\n *\n * `POST /payments/{paymentId}/post-session-tokens` (publishable key)\n */\n async postSessionTokens(\n params: PaymentsPostSessionTokensRequest,\n options?: RequestExtras,\n ): Promise<PaymentsPostSessionTokensResponse> {\n return this.client.request(\n 'POST',\n `/payments/${encodeURIComponent(this.paymentId)}/post-session-tokens`,\n {\n body: { ...params, client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Abandon the attempt the buyer left open on a connector's hosted page\n * (the payment sits in `requires_customer_action`) and open a fresh attempt\n * awaiting a payment method, so the same payment can be confirmed again\n * with another method or connector. Nothing has been authorised on the\n * abandoned attempt; it is voided locally and kept in the attempt history.\n * Idempotent: a payment already in `requires_payment_method` comes back\n * unchanged with `abandoned_attempt_id: null`.\n *\n * `POST /payments/{paymentId}/abandon-attempt` (publishable key + client secret)\n */\n async abandonAttempt(options?: RequestExtras): Promise<PaymentAbandonAttemptResponse> {\n return this.client.request(\n 'POST',\n `/payments/${encodeURIComponent(this.paymentId)}/abandon-attempt`,\n {\n body: { client_secret: this.requireClientSecret() },\n ...options,\n headers: this.pkHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Reopen a provider session the buyer switched away from, when they pick the\n * same method again, instead of opening a second session at the provider\n *. Pass an `attempt_id` from the checkout's\n * `reopenable_attempts`; the attempt becomes the payment's active one again\n * and `redirect_url` sends the buyer back to it. Refused (`IR_16`) when the\n * payment no longer awaits a method, a payment is under way on the checkout,\n * or the session can no longer be reopened (settled, lapsed at the provider,\n * ended by the switch); open a new session as usual then.\n *\n * `POST /payments/{paymentId}/reopen-attempt` (publishable key + client secret)\n */\n async reopenAttempt(\n attemptId: string,\n options?: RequestExtras,\n ): Promise<PaymentReopenAttemptResponse> {\n return this.client.request(\n 'POST',\n `/payments/${encodeURIComponent(this.paymentId)}/reopen-attempt`,\n {\n body: { client_secret: this.requireClientSecret(), attempt_id: attemptId },\n ...options,\n headers: this.pkHeaders(options?.headers),\n },\n );\n }\n\n /**\n * Payment methods available for this payment.\n *\n * `GET /payment-methods` (publishable key + client secret)\n *\n * @param params - Optional filters; `country` is the highest-precedence\n * geo hint, ahead of billing address and IP geolocation.\n */\n async listPaymentMethods(\n params?: { country?: string },\n options?: RequestExtras,\n ): Promise<PaymentMethodListResponse> {\n return this.client.request('GET', '/payment-methods', {\n query: { client_secret: this.requireClientSecret(), country: params?.country },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n\n /**\n * This payment's checkout buttons, as the hosted checkout draws them: order,\n * labels, artwork, and what selecting each one does. The shop, environment,\n * currency and amount are the payment's. Ask again when the cart changes;\n * an answer is never reused for another payment.\n *\n * `GET /account/payment-methods/presentation` (publishable key + client secret)\n *\n * @param params - `country` outranks the billing address and IP\n * geolocation; `locale` names the language of the labels.\n */\n async paymentMethodPresentation(\n params?: { country?: string; locale?: string; contract_version?: number },\n options?: RequestExtras,\n ): Promise<PaymentMethodPresentationResponse> {\n return this.client.request('GET', '/account/payment-methods/presentation', {\n query: {\n client_secret: this.requireClientSecret(),\n country: params?.country,\n locale: params?.locale,\n contract_version: params?.contract_version,\n },\n ...options,\n headers: this.pkHeaders(options?.headers),\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w4-sdk-publish-0443/dist/chunk-XQLRIBVR.cjs","../src/eventStream.ts"],"names":[],"mappings":"AAAA;AC0BA,IAAM,GAAA,EAAK,EAAA;AACX,IAAM,GAAA,EAAK,EAAA;AAGJ,IAAM,kBAAA,EAAN,MAAwB;AAA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A,EAAkB,MAAA,EAAQ,KAAA,CAAM,KAAA,CAAM,CAAC,CAAA;AAAA,IACrE;AACA,IAAA,OAAA,CAAQ,KAAA,EAAO;AAAA,MACb,KAAK,OAAA;AACH,QAAA,IAAA,CAAK,UAAA,EAAY,KAAA;AACjB,QAAA,KAAA;AAAA,MACF,KAAK,MAAA;AACH,QAAA,IAAA,CAAK,KAAA,EAAO,IAAA,CAAK,QAAA,EAAU,CAAA,EAAA;AAA2B;AACvC,QAAA;AACf,QAAA;AACG,MAAA;AAC4B,QAAA;AAC/B,QAAA;AACG,MAAA;AACyB,QAAA;AACH,UAAA;AACE,UAAA;AAC3B,QAAA;AACA,QAAA;AACF,MAAA;AAEE,QAAA;AACJ,IAAA;AACF,EAAA;AAEmD,EAAA;AAClB,IAAA;AACF,IAAA;AACjB,IAAA;AACG,IAAA;AACE,IAAA;AACnB,EAAA;AACF;AD/BoC;AACA;AACA;AACA","file":"/tmp/w4-sdk-publish-0443/dist/chunk-XQLRIBVR.cjs","sourcesContent":[null,"/**\n * A `text/event-stream` (server-sent events) parser, after the WHATWG HTML\n * standard's \"event stream interpretation\", for streams read through `fetch`\n * rather than `EventSource` — which cannot send an `Authorization` header.\n *\n * It holds only the line in progress and the event being assembled, never the\n * body read so far: a stream may stay open for half an hour.\n */\n\n/** One dispatch of the stream, in the order the stream made them. */\nexport interface EventStreamDispatch {\n /**\n * The stream's last event id after this dispatch. Every dispatch sets it,\n * one without data too: that is how a keepalive advances the position.\n * `''` when the server reset it, or never sent one.\n */\n lastEventId: string;\n /** The reconnection time the stream last announced (`retry:`), in ms. */\n retry: number | null;\n /**\n * The event, or `null` for a dispatch without data, which carries only\n * the id. `type` is `message` when the stream named none.\n */\n event: { type: string; data: string } | null;\n}\n\nconst LF = 10;\nconst CR = 13;\n\n/** Parses decoded text into dispatches, however the text is split into chunks. */\nexport class EventStreamParser {\n private line = '';\n /** The previous chunk ended in CR: a LF opening the next one belongs to it. */\n private skipLf = false;\n private data = '';\n private hasData = false;\n private eventType = '';\n private idBuffer: string;\n private retry: number | null = null;\n\n /**\n * @param lastEventId - The id the stream resumes after, as `EventSource`\n * carries it into a reconnection: a dispatch before the server names an\n * id keeps this one.\n */\n constructor(lastEventId = '') {\n this.idBuffer = lastEventId;\n }\n\n /** Feed the next piece of decoded text; returns the dispatches it completed. */\n push(text: string): EventStreamDispatch[] {\n const out: EventStreamDispatch[] = [];\n if (text.length === 0) return out;\n let start = 0;\n if (this.skipLf) {\n this.skipLf = false;\n if (text.charCodeAt(0) === LF) start = 1;\n }\n for (let i = start; i < text.length; i++) {\n const c = text.charCodeAt(i);\n if (c !== LF && c !== CR) continue;\n const line = this.line + text.slice(start, i);\n this.line = '';\n this.processLine(line, out);\n if (c === CR) {\n if (i + 1 < text.length) {\n if (text.charCodeAt(i + 1) === LF) i++;\n } else {\n this.skipLf = true;\n }\n }\n start = i + 1;\n }\n this.line += text.slice(start);\n return out;\n }\n\n private processLine(line: string, out: EventStreamDispatch[]): void {\n if (line === '') {\n this.dispatch(out);\n return;\n }\n if (line.charCodeAt(0) === 0x3a /* : */) return; // a comment\n const colon = line.indexOf(':');\n let field: string;\n let value: string;\n if (colon === -1) {\n field = line;\n value = '';\n } else {\n field = line.slice(0, colon);\n value = line.slice(colon + 1);\n if (value.charCodeAt(0) === 0x20 /* space */) value = value.slice(1);\n }\n switch (field) {\n case 'event':\n this.eventType = value;\n break;\n case 'data':\n this.data = this.hasData ? `${this.data}\\n${value}` : value;\n this.hasData = true;\n break;\n case 'id':\n if (!value.includes('\\u0000')) this.idBuffer = value;\n break;\n case 'retry':\n if (/^[0-9]+$/.test(value)) {\n const ms = Number(value);\n if (Number.isSafeInteger(ms)) this.retry = ms;\n }\n break;\n default:\n // Unknown fields are ignored.\n break;\n }\n }\n\n private dispatch(out: EventStreamDispatch[]): void {\n const event = this.hasData ? { type: this.eventType || 'message', data: this.data } : null;\n out.push({ lastEventId: this.idBuffer, retry: this.retry, event });\n this.data = '';\n this.hasData = false;\n this.event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O;AACL,MAAA,MAAA,EAAQ,IAAA,CAAK,KAAA,CAAM,CAAA,EAAG,KAAK,CAAA;AAC3B,MAAA,MAAA,EAAQ,IAAA,CAAK,KAAA,CAAM,MAAA,EAAQ,CAAC,CAAA;AAC5B,MAAA,GAAA,CAAI,KAAA,CAAM,UAAA,CAAW,CAAC,EAAA,IAAM,EAAA,EAAkB,MAAA,EAAQ,KAAA,CAAM,KAAA,CAAM,CAAC,CAAA;AAAA,IACrE;AACA,IAAA,OAAA,CAAQ,KAAA,EAAO;AAAA,MACb,KAAK,OAAA;AACH,QAAA,IAAA,CAAK,UAAA,EAAY,KAAA;AACjB,QAAA,KAAA;AAAA,MACF,KAAK,MAAA;AACH,QAAA,IAAA,CAAK,KAAA,EAAO,IAAA,CAAK,QAAA,EAAU,CAAA,EAAA;AAA2B;AACvC,QAAA;AACf,QAAA;AACG,MAAA;AAC4B,QAAA;AAC/B,QAAA;AACG,MAAA;AACyB,QAAA;AACH,UAAA;AACE,UAAA;AAC3B,QAAA;AACA,QAAA;AACF,MAAA;AAEE,QAAA;AACJ,IAAA;AACF,EAAA;AAEmD,EAAA;AAClB,IAAA;AACF,IAAA;AACjB,IAAA;AACG,IAAA;AACE,IAAA;AACnB,EAAA;AACF;AD/BoC;AACA;AACA;AACA","file":"/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-XQLRIBVR.cjs","sourcesContent":[null,"/**\n * A `text/event-stream` (server-sent events) parser, after the WHATWG HTML\n * standard's \"event stream interpretation\", for streams read through `fetch`\n * rather than `EventSource` — which cannot send an `Authorization` header.\n *\n * It holds only the line in progress and the event being assembled, never the\n * body read so far: a stream may stay open for half an hour.\n */\n\n/** One dispatch of the stream, in the order the stream made them. */\nexport interface EventStreamDispatch {\n /**\n * The stream's last event id after this dispatch. Every dispatch sets it,\n * one without data too: that is how a keepalive advances the position.\n * `''` when the server reset it, or never sent one.\n */\n lastEventId: string;\n /** The reconnection time the stream last announced (`retry:`), in ms. */\n retry: number | null;\n /**\n * The event, or `null` for a dispatch without data, which carries only\n * the id. `type` is `message` when the stream named none.\n */\n event: { type: string; data: string } | null;\n}\n\nconst LF = 10;\nconst CR = 13;\n\n/** Parses decoded text into dispatches, however the text is split into chunks. */\nexport class EventStreamParser {\n private line = '';\n /** The previous chunk ended in CR: a LF opening the next one belongs to it. */\n private skipLf = false;\n private data = '';\n private hasData = false;\n private eventType = '';\n private idBuffer: string;\n private retry: number | null = null;\n\n /**\n * @param lastEventId - The id the stream resumes after, as `EventSource`\n * carries it into a reconnection: a dispatch before the server names an\n * id keeps this one.\n */\n constructor(lastEventId = '') {\n this.idBuffer = lastEventId;\n }\n\n /** Feed the next piece of decoded text; returns the dispatches it completed. */\n push(text: string): EventStreamDispatch[] {\n const out: EventStreamDispatch[] = [];\n if (text.length === 0) return out;\n let start = 0;\n if (this.skipLf) {\n this.skipLf = false;\n if (text.charCodeAt(0) === LF) start = 1;\n }\n for (let i = start; i < text.length; i++) {\n const c = text.charCodeAt(i);\n if (c !== LF && c !== CR) continue;\n const line = this.line + text.slice(start, i);\n this.line = '';\n this.processLine(line, out);\n if (c === CR) {\n if (i + 1 < text.length) {\n if (text.charCodeAt(i + 1) === LF) i++;\n } else {\n this.skipLf = true;\n }\n }\n start = i + 1;\n }\n this.line += text.slice(start);\n return out;\n }\n\n private processLine(line: string, out: EventStreamDispatch[]): void {\n if (line === '') {\n this.dispatch(out);\n return;\n }\n if (line.charCodeAt(0) === 0x3a /* : */) return; // a comment\n const colon = line.indexOf(':');\n let field: string;\n let value: string;\n if (colon === -1) {\n field = line;\n value = '';\n } else {\n field = line.slice(0, colon);\n value = line.slice(colon + 1);\n if (value.charCodeAt(0) === 0x20 /* space */) value = value.slice(1);\n }\n switch (field) {\n case 'event':\n this.eventType = value;\n break;\n case 'data':\n this.data = this.hasData ? `${this.data}\\n${value}` : value;\n this.hasData = true;\n break;\n case 'id':\n if (!value.includes('\\u0000')) this.idBuffer = value;\n break;\n case 'retry':\n if (/^[0-9]+$/.test(value)) {\n const ms = Number(value);\n if (Number.isSafeInteger(ms)) this.retry = ms;\n }\n break;\n default:\n // Unknown fields are ignored.\n break;\n }\n }\n\n private dispatch(out: EventStreamDispatch[]): void {\n const event = this.hasData ? { type: this.eventType || 'message', data: this.data } : null;\n out.push({ lastEventId: this.idBuffer, retry: this.retry, event });\n this.data = '';\n this.hasData = false;\n this.eventType = '';\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["/tmp/w4-sdk-publish-0443/dist/chunk-YJQPKT6W.cjs","../src/panes.ts"],"names":[],"mappings":"AAAA;ACqEA,IAAM,kBAAA,EAA+C,CAAC,QAAA,EAAU,eAAA,EAAiB,eAAe,CAAA;AAMhG,SAAS,eAAA,CAAgB,GAAA,EAA8B;AACrD,EAAA,OAAO,IAAA,IAAQ,QAAA,GAAW,IAAA,IAAQ,YAAA,EAAc,IAAA,EAAM,KAAA;AACxD;AAEA,SAAS,eAAA,CAAgB,GAAA,EAA8B;AACrD,EAAA,wBAAO,iBAAA,CAAkB,IAAA,CAAK,CAAC,KAAA,EAAA,GAAU,MAAA,IAAU,GAAG,CAAA,UAAK,UAAA;AAC7D;AAEA,IAAM,qBAAA,EAAqD;AAAA,EACzD,YAAA;AAAA,EACA,eAAA;AAAA,EACA;AACF,CAAA;AAYA,SAAS,kBAAA,CAAmB,GAAA,EAAiC;AAC3D,EAAA,wBAAO,oBAAA,CAAqB,IAAA,CAAK,CAAC,KAAA,EAAA,GAAU,MAAA,IAAU,GAAG,CAAA,UAAK,cAAA;AAChE;AA4EO,SAAS,kBAAA,CACd,IAAA,EACgB;AAChB,EAAA,MAAM,SAAA,EAAW,iBAAA,CAAkB,IAAA,CAAK,CAAC,KAAA,EAAA,GAAU,MAAA,IAAU,IAAA,CAAK,UAAU,CAAA;AAC5E,EAAA,GAAA,CAAI,QAAA,EAAU,OAAO,QAAA;AACrB,EAAA,OAAO,IAAA,CAAK,cAAA,IAAkB,KAAA,EAAO,gBAAA,EAAkB,QAAA;AACzD;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iD;AACT,EAAA;AACxE;AAYwD;AACd,EAAA;AACjC,EAAA;AACgB,IAAA;AACX,IAAA;AACiB,IAAA;AAC7B,EAAA;AACF;AAG+B;AAEE;AAEA;AD7sB2D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/w4-sdk-publish-0443/dist/chunk-YJQPKT6W.cjs","sourcesContent":[null,"// **Payment panes** — merchant-configured payment methods that render as\n// DeloPay-drawn tiles in the embedded checkout instead of inside a connector's\n// own embedded form.\n//\n// Why they exist: Stripe only offers Apple Pay / Google Pay / Link when the\n// *top-level* document's domain is registered as a payment method domain on the\n// merchant's Stripe account. In an embedded iframe that domain is the\n// merchant's shop, not the DeloPay checkout — so the wallet silently\n// disappears. A pane replaces it with our own tile that opens the DeloPay\n// hosted checkout at the top level, in a focused single-method view.\n//\n// Nothing here is Apple-Pay-specific, and since the router published a\n// per-connector capability catalogue nothing here is Stripe-specific either:\n// the feature is \"which of a connector's payment methods render as a pane, and\n// how they look\".\n//\n// This module serves SDK consumers: merchants configuring\n// `metadata.native_panes` on a merchant connector account programmatically\n// (codec), reading the resolved `native_panes` off a checkout payload\n// ({@link PaneView}), or building the focused single-method link that goes\n// behind their own button ({@link focusedCheckoutUrl}).\n//\n// The wire shapes are owned by the API — `native_panes` in\n// the metadata key, the field names and the enum values are contracts with it\n// and with links already in buyers' hands, so the identifiers here were renamed\n// off \"native pane\" and the wire was not.\n//\n// Capability (which connector may publish which method, on which rail) comes\n// from the router at runtime through `connectors.getPanesCatalog()`, not from a\n// table here.\n\n// Type-only, so this module still emits no imports and can be executed\n// standalone. `types.ts` owns the catalogue's wire shapes because they are\n// generated-spec-paired (`scripts/validate-types.ts`); it imports nothing from\n// here, so the dependency runs one way.\nimport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n PaneNativeElement,\n} from './types';\n\nexport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n};\n\n// --- Wire types ---------------------------------------------------------\n\n/**\n * The values {@link decodePanes} recognises. Anything else — a value written by\n * a dashboard newer than this SDK — degrades to `always` rather than throwing\n * or dropping the row: an older SDK reading a newer blob is a normal state\n * during a rollout, and a hard failure there takes out a merchant's whole\n * connector config rather than one tile.\n */\nconst PANE_VISIBILITIES: readonly PaneVisibility[] = ['always', 'embedded_only', 'external_only'];\n\n/**\n * `same_page` and `popup` are kept as written; anything else — including the\n * absent key — is the default `tab`, as it always was.\n */\nfunction parseOpenTarget(raw: unknown): PaneOpenTarget {\n return raw === 'popup' || raw === 'same_page' ? raw : 'tab';\n}\n\nfunction parseVisibility(raw: unknown): PaneVisibility {\n return PANE_VISIBILITIES.find((value) => value === raw) ?? 'always';\n}\n\nconst PANE_NATIVE_ELEMENTS: readonly PaneNativeElement[] = [\n 'everywhere',\n 'embedded_only',\n 'external_only',\n];\n\n/**\n * Read a stored row's native-element choice, tolerantly.\n *\n * Absent decodes to `everywhere`, because that is what the router decodes a\n * missing key to (`admin::NativePaneNativeElement` defaults to it): a row\n * written before the field existed means \"the wallet's own button wherever\n * this pane is offered\", which is what the tile was always a stand-in for. An\n * unknown word degrades the same way rather than dropping the row — the\n * router's own decode is lenient for the same rolling-deploy reason.\n */\nfunction parseNativeElement(raw: unknown): PaneNativeElement {\n return PANE_NATIVE_ELEMENTS.find((value) => value === raw) ?? 'everywhere';\n}\n\n/**\n * One pane exactly as the merchant configures it. Persisted (JSON) under\n * `metadata.native_panes` on the merchant connector account.\n *\n * Field names are the wire contract — renaming one is a migration. The router\n * decodes strictly row by row: a row that fails strict decoding (e.g. a\n * wrong-typed field like `display_order: \"3\"`) is dropped whole with a server\n * log, and the remaining rows still render. This SDK's {@link decodePanes} is\n * additionally per-property tolerant — including clamping `display_order` into\n * the router's `i32` range — so a decode→encode round-trip through the SDK\n * repairs a blob the router would partially drop.\n */\nexport interface Pane {\n /** Catalogue key of the promoted method — see {@link paneMethodInfo}. */\n method: string;\n /** Disabled rows keep their tuning but never reach a buyer. */\n enabled: boolean;\n /** Default-language tile label. Empty falls back to the catalogue name. */\n label: string;\n /** Per-locale overrides of `label`, keyed by checkout locale (`de`, `de-AT`). */\n labelTranslations: Record<string, string>;\n /**\n * Secondary line under the label. `null` means \"use the catalogue default\";\n * an empty string means the merchant deliberately hid the line. That\n * distinction is the whole reason this is nullable and `label` is not.\n */\n sublabel: string | null;\n /** Per-locale overrides of `sublabel`. */\n sublabelTranslations: Record<string, string>;\n /** Section the tile groups under. Empty falls back to the catalogue category. */\n category: string;\n /** Built-in icon key — see {@link PANE_ICON_KEYS}. */\n icon: string;\n /** Custom inline SVG. Sanitized server-side before it reaches a buyer; a\n * rejected payload falls back to the built-in `icon`. */\n iconSvg: string;\n /** Lower renders first; ties break on catalogue order. */\n displayOrder: number;\n /** Where the tile is offered — see {@link PaneVisibility}. */\n visibility: PaneVisibility;\n /** How the embedded checkout opens the focused view — see {@link PaneOpenTarget}. */\n openIn: PaneOpenTarget;\n /**\n * Where the wallet's own button replaces this tile — see\n * {@link PaneNativeElement}. Only meaningful on a method whose catalogue\n * entry says {@link PaneCapability.supports_native_element}; the router\n * ignores it elsewhere. `everywhere` is the default and what a row stored\n * before the field existed decodes to.\n */\n nativeElement: PaneNativeElement;\n /** A shipped look instead of the icon (`paypal`, `card`); `''` or absent = none.\n * Optional because a `Pane` built before the field existed must still encode. */\n preset?: string;\n /** The preset's style; `''` or absent = the preset's default. */\n style?: string;\n}\n\n/**\n * Read a resolved tile's placement rule, across every payload version.\n *\n * Prefer this to touching either field. They are independent on the wire — a\n * payload may carry either, both or neither — and each alone loses a placement\n * rule: `embedded_only` cannot express `external_only`, so an `external_only`\n * tile read through it renders inside the merchant iframe the merchant asked\n * to keep it out of; `visibility` is absent on a router that predates it, so\n * an `embedded_only` tile read through it alone renders at top level too,\n * duplicating a method Stripe's own form already offers there.\n *\n * A recognised `visibility` wins. Otherwise the legacy boolean answers: absent\n * (old router) it carries the only placement that router could express, and\n * unrecognised (newer router) the router still sets it under its own fixed\n * rule. Neither path throws, and both degrade toward showing a tile — losing a\n * placement rule, never stranding a method.\n */\nexport function paneViewVisibility(\n view: Pick<PaneView, 'visibility' | 'embedded_only'>,\n): PaneVisibility {\n const declared = PANE_VISIBILITIES.find((value) => value === view.visibility);\n if (declared) return declared;\n return view.embedded_only === true ? 'embedded_only' : 'always';\n}\n\n// --- Catalogue ----------------------------------------------------------\n\n/**\n * A method the frozen Stripe fallback table knows, with the compiled copy the\n * router shipped for it at the time.\n *\n * Only {@link STRIPE_FALLBACK_PANE_METHODS} is typed with this. The live\n * catalogue (`connectors.getPanesCatalog()`) carries capability facts and no\n * copy at all, by design — see {@link PaneCapability}.\n */\nexport interface PaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethod: string;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethodType: string;\n /** The focused checkout has to collect a billing country to confirm this. */\n requiresBillingCountry: boolean;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * What this SDK assumes when the router cannot answer.\n *\n * The capability endpoint does not exist on an older router, which answers\n * `connectors.getPanesCatalog()` with a 404.\n * Rather than leaving a caller with nothing, the pane helpers default to\n * exactly the behaviour they had before that endpoint existed: panes on the\n * Stripe connector only, with the method set the router's Stripe catalogue had\n * at the time.\n *\n * **This is a degradation path, not a mirror. Do not keep it in sync by hand,\n * and do not add a connector or a method to it** — that is what this table was\n * before the capability endpoint, and adding to it would quietly rebuild the mirror. A\n * connector the router serves panes for arrives through the endpoint and needs\n * no entry here; a connector that needs an entry here to appear is a connector\n * the router will not deliver panes for anyway.\n *\n * The only reason to touch this list is to correct what Stripe's catalogue\n * looked like *before* the endpoint existed, and that is history, so there is\n * no such reason. Once the endpoint is reachable it is never consulted for a\n * connector the router answered for.\n *\n * The redirect-rail set is deliberately narrow — every entry is a variant the\n * Stripe connector accepts and that needs no extra buyer input beyond a\n * billing country. `eps` / `p24` / `bancontact` are absent because Stripe\n * hard-requires billing fields the focused checkout never collects (a full\n * name for EPS and Bancontact, an email for Przelewy24), so their tiles could\n * never succeed.\n *\n * `defaultLabel` / `defaultSublabel` are the copy the router compiled at that\n * time and are frozen with the rest of the table. Copy for a method the live\n * catalogue reports belongs to the consumer's own locale files, keyed by\n * `key` — the router ships none.\n */\nexport const STRIPE_FALLBACK_PANE_METHODS: readonly PaneMethodInfo[] = [\n {\n key: 'apple_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'apple_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Apple Pay',\n defaultSublabel: 'Pay with Apple Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'apple',\n },\n {\n key: 'google_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'google_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Google Pay',\n defaultSublabel: 'Pay with Google Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'google',\n },\n {\n key: 'link',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'link',\n requiresBillingCountry: false,\n defaultLabel: 'Link',\n defaultSublabel: 'Pay with saved details',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'klarna',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'klarna',\n // Stripe's Klarna needs the buyer's country echoed into the confirm body.\n requiresBillingCountry: true,\n defaultLabel: 'Klarna',\n // NOT the router's current \"Pay later or in 3 instalments\". This table is\n // what a router predating the capability endpoint renders, and that copy\n // only gained the \"3\" in the same release that added the endpoint.\n // Restating the new string here\n // would put copy no reachable router emits in front of a merchant, and\n // would change what the deprecated `nativePaneMethodInfo` has returned\n // since 0.106.0.\n defaultSublabel: 'Pay later or in instalments',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'affirm',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'affirm',\n requiresBillingCountry: false,\n defaultLabel: 'Affirm',\n defaultSublabel: 'Pay over time',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'ideal',\n rail: 'redirect',\n paymentMethod: 'bank_redirect',\n paymentMethodType: 'ideal',\n requiresBillingCountry: false,\n defaultLabel: 'iDEAL',\n defaultSublabel: 'Pay from your bank',\n defaultCategory: 'bank_redirect',\n defaultIcon: 'bank',\n },\n {\n key: 'alipay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'ali_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Alipay',\n defaultSublabel: 'Pay with Alipay',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'revolut_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'revolut_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Revolut Pay',\n defaultSublabel: 'Pay with Revolut',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'amazon_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'amazon_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Amazon Pay',\n defaultSublabel: 'Pay with Amazon',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n];\n\n/**\n * {@link STRIPE_FALLBACK_PANE_METHODS} in the shape the live endpoint returns,\n * so every helper below takes one type of catalogue and the degradation path\n * is not a second code path. Derived, not written out: two spellings of one\n * table is exactly the drift this design removes.\n */\nexport const STRIPE_FALLBACK_PANE_CATALOG: PanesConnectorCatalog = {\n connector: 'stripe',\n allowed_rails: ['wallet', 'redirect'],\n methods: STRIPE_FALLBACK_PANE_METHODS.map((info) => ({\n key: info.key,\n rail: info.rail,\n payment_method: info.paymentMethod,\n payment_method_type: info.paymentMethodType,\n requires_billing_country: info.requiresBillingCountry,\n })),\n};\n\n/**\n * An empty catalogue — a connector the router does not offer panes for.\n * Exported so callers can express \"asked, and the answer was no\" without\n * reaching for `null` in the middle of a computation.\n */\nexport function emptyPaneCatalog(connector: string): PanesConnectorCatalog {\n return { connector, allowed_rails: [], methods: [] };\n}\n\n/**\n * Pull one connector's entry out of a `connectors.getPanesCatalog()` response.\n *\n * Returns {@link emptyPaneCatalog} for a connector the response does not name:\n * \"the router knows this connector and publishes no panes for it\" and \"the\n * router has never heard of it\" are the same answer to a caller building an\n * editor, and both mean \"offer nothing\".\n */\nexport function paneCatalogFor(\n response: PanesCatalogResponse,\n connector: string,\n): PanesConnectorCatalog {\n return (\n response.connectors.find((entry) => entry.connector === connector) ??\n emptyPaneCatalog(connector)\n );\n}\n\n/**\n * Built-in tile icon keys the buyer-facing checkout ships a glyph for.\n *\n * Reconciled against both ends: every key here has a branch in the checkout's\n * `NativePaneIcon.svelte`, and every `default_icon` the router's catalogue\n * publishes is in this list. An icon key the checkout does not ship falls\n * through to `wallet` there, so a key that drifts in renders as the wrong\n * glyph rather than as nothing.\n */\nexport const PANE_ICON_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n // Brand marks, not category glyphs: the checkout draws PayPal's monogram,\n // Klarna's squircle-K and the Bitcoin mark for these, the same logos the\n // bespoke panes they replace already drew. Listed here so a merchant's own\n // dashboard can offer them; the router decides which one a tile *defaults*\n // to, and a router predating them simply keeps sending the old default.\n 'paypal',\n 'klarna',\n 'crypto',\n];\n\n/**\n * Section keys a pane's tile may group under.\n *\n * Reconciled against the router's actual `default_category` values rather than\n * against what the Stripe table happened to need. `crypto` and `game_items`\n * are router defaults (the Cryptomus/NowPayments and Skinsback catalogues) and\n * were missing here, so a merchant configuring one of those panes was shown a\n * category their editor did not recognise.\n *\n * A custom value is allowed and renders as its own section under that literal\n * text. The buyer-facing checkout translates a subset of these into a section\n * header and falls through to the raw key for the rest — `crypto` and\n * `game_items` are the two it has yet to add.\n */\nexport const PANE_CATEGORY_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bnpl',\n 'bank_redirect',\n 'bank_transfer',\n 'crypto',\n 'game_items',\n 'cash',\n];\n\n/**\n * Mirror of the router's per-connector cap. Counted differently on each side:\n * {@link decodePanes} stops after 12 *decoded* rows (entries with a usable,\n * non-duplicate `method` — junk and duplicate entries don't consume a slot),\n * while the router caps *accepted* panes (enabled, known, deduplicated) at 12\n * — so an oversized hand-written blob may render a pane this decoder drops.\n * Blobs the SDK itself encodes never exceed the cap.\n */\nexport const PANES_MAX = 12;\n\n/**\n * Look a method up in one connector's catalogue.\n *\n * Pass the entry for the connector being configured, from\n * `connectors.getPanesCatalog()` via {@link paneCatalogFor}. The default is\n * the degradation path and only correct for Stripe on a router that predates\n * the endpoint — see {@link STRIPE_FALLBACK_PANE_CATALOG}.\n */\nexport function paneMethodInfo(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneCapability | undefined {\n return catalog.methods.find((info) => info.key === method);\n}\n\n/** Whether this connector may declare a pane on `rail` at all. A wallet pane\n * on a connector outside its `allowed_rails` is refused at save time — the\n * wallet rail rides on Stripe's Express Checkout Element charging the *same*\n * payment intent the embedded checkout holds, which does not generalise. */\nexport function paneRailAllowed(rail: PaneRail, catalog: PanesConnectorCatalog): boolean {\n return catalog.allowed_rails.includes(rail);\n}\n\n/**\n * The methods a caller may actually offer for this connector: the catalogue's\n * own list, minus anything on a rail the connector does not allow.\n *\n * The router should not report such a pair in the first place, but the two\n * fields are independent in the response and a save that crosses them is\n * refused at the API with an error naming the connector and the method. Filter\n * rather than trust, so a merchant never configures a tile the save will\n * bounce.\n */\nexport function offerablePaneMethods(catalog: PanesConnectorCatalog): PaneCapability[] {\n return catalog.methods.filter((info) => paneRailAllowed(info.rail, catalog));\n}\n\n/** Non-copy display defaults for a tile: which built-in glyph and which\n * section heading a new pane starts on. */\nexport interface PaneDisplayDefaults {\n icon: string;\n category: string;\n}\n\n/**\n * Per-method overrides, for the handful whose brand glyph is not what their\n * payment method would suggest. Everything else is derived from the catalogue\n * entry's `payment_method` below, so a connector the SDK has never heard of\n * still gets a sensible tile rather than a blank one.\n *\n * These have to be keyed by method and not by `payment_method`: `wallet` also\n * routes Link, Alipay, Revolut Pay and Amazon Pay, and `pay_later` also routes\n * Affirm — none of which the SDK has a mark for. Getting this wrong is not a\n * cosmetic slip that the next release fixes, because {@link defaultPane}\n * materialises the value and {@link encodePanes} writes it to\n * `metadata.native_panes`, where a stored `icon` outranks the router's\n * `default_icon` for the life of the pane.\n */\nconst DISPLAY_DEFAULTS_BY_KEY: Readonly<Record<string, PaneDisplayDefaults>> = {\n apple_pay: { icon: 'apple', category: 'wallet' },\n google_pay: { icon: 'google', category: 'wallet' },\n paypal: { icon: 'paypal', category: 'wallet' },\n // Both the Klarna connector's own tile and Stripe's Klarna. Affirm stays on\n // the generic `bnpl` glyph — same rail, no mark of its own.\n klarna: { icon: 'klarna', category: 'bnpl' },\n};\n\n/**\n * Derived from the `payment_method` half of the catalogue's routing pair.\n * Every value here reproduces the router's own `default_icon` /\n * `default_category` for the methods it publishes today, so a tile the SDK\n * lays out and a tile the router lays out agree.\n */\nconst DISPLAY_DEFAULTS_BY_PAYMENT_METHOD: Readonly<Record<string, PaneDisplayDefaults>> = {\n wallet: { icon: 'wallet', category: 'wallet' },\n card: { icon: 'card', category: 'card' },\n card_redirect: { icon: 'card', category: 'card' },\n pay_later: { icon: 'bnpl', category: 'bnpl' },\n bank_redirect: { icon: 'bank', category: 'bank_redirect' },\n bank_transfer: { icon: 'bank', category: 'bank_transfer' },\n bank_debit: { icon: 'bank', category: 'bank_transfer' },\n // Cryptomus and NowPayments publish the same `crypto` key on this rail, and\n // the router defaults both to the Bitcoin mark.\n crypto: { icon: 'crypto', category: 'crypto' },\n // Skinsback, which has no mark: the router defaults it to `wallet` too.\n game_items: { icon: 'wallet', category: 'game_items' },\n cash: { icon: 'cash', category: 'cash' },\n voucher: { icon: 'cash', category: 'cash' },\n};\n\nconst DISPLAY_DEFAULTS_FALLBACK: PaneDisplayDefaults = { icon: 'wallet', category: 'wallet' };\n\n/**\n * What a new tile looks like before the merchant designs it.\n *\n * The router serves capability, not presentation, so the glyph and the section\n * come from here and the accompanying text comes from the caller's own locale\n * files. A method with no entry at all still resolves — that is the point of\n * deriving from `payment_method`: a connector added to the router's catalogue\n * tomorrow needs no SDK release to be designable today.\n */\nexport function paneDisplayDefaults(info: PaneCapability | undefined): PaneDisplayDefaults {\n if (!info) return DISPLAY_DEFAULTS_FALLBACK;\n return (\n DISPLAY_DEFAULTS_BY_KEY[info.key] ??\n DISPLAY_DEFAULTS_BY_PAYMENT_METHOD[info.payment_method] ??\n DISPLAY_DEFAULTS_FALLBACK\n );\n}\n\n// --- Validation ---------------------------------------------------------\n\n/**\n * Why a configured pane would not survive a save or a render.\n *\n * - `method_unknown` — the connector's catalogue does not publish this key, so\n * the router drops the row at render.\n * - `rail_not_allowed` — the method's rail is not in the connector's\n * `allowed_rails`; the API refuses this at save time.\n * - `over_cap` — past the router's per-connector cap of {@link PANES_MAX}; the\n * row is stored but never rendered.\n * - `duplicate_method` — an earlier enabled row already claims this method.\n * The router skips disabled rows and then dedupes, so the first *enabled*\n * row renders and every later one is dropped in silence. Reported on the\n * losing rows, never on the one that survives.\n */\nexport type PaneIssueCode = 'method_unknown' | 'rail_not_allowed' | 'over_cap' | 'duplicate_method';\n\nexport interface PaneIssue {\n /** Index into the list handed to {@link validatePanes}. */\n index: number;\n method: string;\n code: PaneIssueCode;\n}\n\n/**\n * Check a configured list against one connector's catalogue, before writing it\n * to `metadata.native_panes`.\n *\n * The API applies the same rules at save time, so this changes where the\n * merchant finds out, not whether they do — and an SDK caller building an\n * editor would otherwise learn it from a bounced request with no row to point\n * at. An empty result means nothing here will be refused or silently dropped.\n */\nexport function validatePanes(\n panes: readonly Pane[],\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneIssue[] {\n const issues: PaneIssue[] = [];\n // Keyed on the catalogue's own key rather than the raw string, because that\n // is what the router dedupes on. Only enabled rows are recorded: a disabled\n // row never reaches the router's `seen` set, so it neither claims a method\n // nor loses to one.\n const claimedBy = new Set<string>();\n panes.forEach((pane, index) => {\n const info = paneMethodInfo(pane.method, catalog);\n if (!info) {\n issues.push({ index, method: pane.method, code: 'method_unknown' });\n } else if (!paneRailAllowed(info.rail, catalog)) {\n issues.push({ index, method: pane.method, code: 'rail_not_allowed' });\n } else if (pane.enabled) {\n // Unknown and rail-refused rows are dropped before the router dedupes,\n // so they cannot claim a key — and reporting two codes for one row would\n // point the merchant at the wrong repair.\n if (claimedBy.has(info.key)) {\n issues.push({ index, method: pane.method, code: 'duplicate_method' });\n } else {\n claimedBy.add(info.key);\n }\n }\n if (index >= PANES_MAX) issues.push({ index, method: pane.method, code: 'over_cap' });\n });\n return issues;\n}\n\n// --- Codec --------------------------------------------------------------\n\n/**\n * A new pane for `method`, with its glyph and section resolved from the\n * connector's catalogue entry rather than from a Stripe-keyed table — so\n * `defaultPane('creem_checkout', catalog)` is a designed tile and not a blank\n * one.\n *\n * Pass the catalogue entry for the connector being configured; the default is\n * the degradation path (see {@link STRIPE_FALLBACK_PANE_CATALOG}). Labels are\n * deliberately left empty: empty means \"use the catalogue default\", which the\n * router resolves at render, and the router ships no copy for a caller to\n * mirror.\n */\nexport function defaultPane(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): Pane {\n const defaults = paneDisplayDefaults(paneMethodInfo(method, catalog));\n return {\n method,\n enabled: true,\n label: '',\n labelTranslations: {},\n sublabel: null,\n sublabelTranslations: {},\n category: defaults.category,\n icon: defaults.icon,\n iconSvg: '',\n displayOrder: 0,\n visibility: 'always',\n openIn: 'tab',\n nativeElement: 'everywhere',\n preset: '',\n style: '',\n };\n}\n\nexport function clonePane(pane: Pane): Pane {\n return {\n ...pane,\n labelTranslations: { ...pane.labelTranslations },\n sublabelTranslations: { ...pane.sublabelTranslations },\n };\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction parseTranslations(raw: unknown): Record<string, string> {\n if (!isObject(raw)) return {};\n const out: Record<string, string> = {};\n for (const [locale, value] of Object.entries(raw)) {\n if (typeof value === 'string' && value.length > 0) out[locale] = value;\n }\n return out;\n}\n\nfunction str(raw: unknown): string {\n return typeof raw === 'string' ? raw : '';\n}\n\n// `display_order` is a 32-bit signed integer on the wire, and a\n// fractional or out-of-range value fails its strict row decode — dropping the\n// whole row server-side while an SDK round-trip would keep the blob looking\n// healthy. Clamped on BOTH decode and encode so this codec never emits a\n// value the router rejects, regardless of where the number came from.\nconst DISPLAY_ORDER_MIN = -2147483648;\nconst DISPLAY_ORDER_MAX = 2147483647;\n\nfunction clampDisplayOrder(raw: number): number {\n if (!Number.isFinite(raw)) return 0;\n return Math.min(DISPLAY_ORDER_MAX, Math.max(DISPLAY_ORDER_MIN, Math.trunc(raw)));\n}\n\n/**\n * Decode the stored `metadata.native_panes` blob into editor rows.\n *\n * Tolerant like the branding codecs: anything malformed falls back per\n * property, rows without a usable `method` are dropped, duplicates keep the\n * first occurrence — except that an enabled row wins over an earlier disabled\n * one for the same method, because that is the row the router renders — and\n * decoding stops after {@link PANES_MAX} decoded rows (dropped junk/duplicate\n * entries don't consume a slot). That is more forgiving than the router, which\n * drops a strict-decode-failing row whole (keeping the rest) and caps accepted\n * panes rather than decoded rows — see {@link Pane} and {@link PANES_MAX}.\n * Returns `null` when the input is not an array so the caller can distinguish\n * \"never configured\" from \"cleared\".\n */\nexport function decodePanes(raw: unknown): Pane[] | null {\n if (!Array.isArray(raw)) return null;\n const decodeRow = (entry: Record<string, unknown>, method: string): Pane => ({\n method,\n enabled: entry['enabled'] !== false,\n label: str(entry['label']),\n labelTranslations: parseTranslations(entry['label_translations']),\n sublabel: typeof entry['sublabel'] === 'string' ? entry['sublabel'] : null,\n sublabelTranslations: parseTranslations(entry['sublabel_translations']),\n category: str(entry['category']),\n icon: str(entry['icon']),\n iconSvg: str(entry['icon_svg']),\n displayOrder: clampDisplayOrder(Number(entry['display_order'])),\n // Anything unrecognised degrades to `always` rather than dropping the row.\n visibility: parseVisibility(entry['visibility']),\n // Same tolerance: an unknown value degrades to the default `tab`.\n openIn: parseOpenTarget(entry['open_in']),\n nativeElement: parseNativeElement(entry['native_element']),\n preset: str(entry['preset']),\n style: str(entry['style']),\n });\n\n const indexByMethod = new Map<string, number>();\n const out: Pane[] = [];\n for (const entry of raw) {\n if (out.length >= PANES_MAX) break;\n if (!isObject(entry)) continue;\n const method = str(entry['method']).trim();\n if (!method) continue;\n const kept = indexByMethod.get(method);\n if (kept !== undefined) {\n // Duplicate method. Keep the row the ROUTER would render: it skips\n // disabled rows BEFORE deduping, so where a blob\n // holds both a disabled and an enabled row for one method, buyers see\n // the enabled one. Keeping the disabled row here would show the merchant\n // a pane that is off while it is live, and persist that on the next save.\n const enabled = entry['enabled'] !== false;\n const existing = out[kept];\n if (enabled && existing && !existing.enabled) out[kept] = decodeRow(entry, method);\n continue;\n }\n indexByMethod.set(method, out.length);\n out.push(decodeRow(entry, method));\n }\n return out;\n}\n\n/**\n * Encode editor rows back into the snake_case blob the connector account\n * stores. Empty optional strings are omitted so the metadata stays small and a\n * merchant who typed nothing round-trips as \"use the catalogue default\" rather\n * than as an explicit empty override.\n *\n * `sublabel` is the exception: an explicitly-empty value is preserved (as `\"\"`)\n * because that is how a merchant hides the second line.\n */\nexport function encodePanes(panes: Pane[]): Record<string, unknown>[] {\n const nonEmpty = (map: Record<string, string>): Record<string, string> | undefined => {\n const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n };\n return panes.slice(0, PANES_MAX).map((pane) => {\n const labelTranslations = nonEmpty(pane.labelTranslations);\n const sublabelTranslations = nonEmpty(pane.sublabelTranslations);\n return {\n method: pane.method,\n enabled: pane.enabled,\n ...(pane.label.trim() ? { label: pane.label.trim() } : {}),\n ...(labelTranslations ? { label_translations: labelTranslations } : {}),\n // `null` omits the key entirely (catalogue default wins); `''` is sent\n // as-is because that is how the merchant hides the second line.\n ...(pane.sublabel !== null ? { sublabel: pane.sublabel } : {}),\n ...(sublabelTranslations ? { sublabel_translations: sublabelTranslations } : {}),\n ...(pane.category.trim() ? { category: pane.category.trim() } : {}),\n ...(pane.icon.trim() ? { icon: pane.icon.trim() } : {}),\n ...(pane.iconSvg.trim() ? { icon_svg: pane.iconSvg.trim() } : {}),\n // Clamped on encode too, not only decode: the router's strict i32 row\n // decode drops a row whole for a fractional or out-of-range value, so\n // writing e.g. 3.5 or Date.now() verbatim would silently delete the\n // pane at render while every read surface shows it healthy.\n display_order: clampDisplayOrder(pane.displayOrder),\n // Normalised on encode for the same reason `display_order` is clamped:\n // the router's strict row decode drops a row whole on a value outside\n // its enum, and a caller who built a `Pane` by hand (or in plain JS)\n // never went through `decodePanes`. A decoded pane always holds a valid\n // value, so this is a no-op on the round-trip path.\n visibility: parseVisibility(pane.visibility),\n open_in: parseOpenTarget(pane.openIn),\n // Omitted at the default: `everywhere` is what the router decodes an\n // absent key to, so leaving it out changes nothing — and keeps a blob\n // stored before the field existed byte-identical on re-encode, which\n // is what the wire-compatibility test pins.\n ...(parseNativeElement(pane.nativeElement) === 'everywhere'\n ? {}\n : { native_element: parseNativeElement(pane.nativeElement) }),\n // Absent and blank both mean \"no look\": a pane shaped before the fields\n // existed encodes exactly as it always did.\n ...((pane.preset ?? '').trim() ? { preset: (pane.preset ?? '').trim() } : {}),\n ...((pane.style ?? '').trim() ? { style: (pane.style ?? '').trim() } : {}),\n };\n });\n}\n\n// --- Focused checkout URL ----------------------------------------------\n\n/**\n * A payment link id the hosted checkout serves on its own, as\n * `/pay/{payment_link_id}`: the lowercase, hyphenated UUID the API issues.\n */\nconst OPAQUE_PAYMENT_LINK_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\nexport interface FocusedCheckoutUrlParams {\n /** Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`. */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /**\n * The payment's `payment_link.payment_link_id`. When it is the opaque id the\n * API issues (a lowercase, hyphenated UUID), the link is\n * `/pay/{payment_link_id}`, which names neither the merchant nor the\n * payment. Omitted, or an older `plink_` id, keeps\n * `/pay/{merchantId}/{paymentId}`, which the checkout still serves.\n */\n paymentLinkId?: string | null;\n /** Pane method key to focus on (`apple_pay`, `klarna`, …). */\n method: string;\n /**\n * Connector that owns the tile, forwarded as `connector=`.\n *\n * A bare `pane=` resolves to the **first payable match in server-sorted\n * order**, which is unambiguous only while one connector publishes a given\n * key. Stripe publishes `klarna` and so does the Klarna connector, so a deep\n * link that names neither charges through whichever tile happens to sort\n * first. Name the connector whenever you know it.\n *\n * Optional because links minted before this parameter existed are already in\n * merchants' pages and still have to resolve.\n */\n connector?: string;\n /**\n * Merchant connector ACCOUNT that owns the tile, forwarded as `mca=`.\n *\n * Needed for the same reason `connector` is, one level down: a profile may\n * hold two enabled accounts of one connector, each publishing its own tile,\n * and the two links would otherwise be identical. Only meaningful alongside\n * `connector`.\n */\n merchantConnectorId?: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n /**\n * Set when the merchant's checkout-custom-field answers are already\n * persisted on the payment — forwarded as `cf=1` so the focused view skips\n * asking a second time. Purely a UI hint: the values live on the intent\n * either way, and the backend only accepts the merchant's configured field\n * keys from a client, so a wrongly-set flag can at worst skip an\n * informational prompt. This is the same hint the embedded pane sets when\n * it opens the focused view.\n */\n customFieldsCollected?: boolean;\n}\n\n/**\n * Build the link to the **focused single-method checkout**: the DeloPay hosted\n * checkout rendered with one payment method, one button, no picker.\n *\n * Two callers:\n * - the embedded checkout, which opens this in a new tab when a buyer clicks\n * a pane tile, and\n * - a merchant running their own checkout, who puts it behind their own\n * button — the same mechanism without an iframe.\n *\n * `method` is not limited to configured panes. A configured pane gets the\n * focused one-button view; `card`, `paypal`, `crypto_currency` and the\n * local-methods catalogs (by method key or vendor code) open the checkout\n * pinned to that method. Methods that exist only as a tab inside a connector's\n * own embedded form — iDEAL, Bancontact, P24 and the like, unless promoted to\n * a pane — cannot be isolated, because the connector owns that surface. An\n * unknown or unavailable method is never a dead end: the checkout shows a\n * notice with a visible \"show all payment methods\" action.\n *\n * Pass {@link FocusedCheckoutUrlParams.connector} (and\n * {@link FocusedCheckoutUrlParams.merchantConnectorId}) whenever you know\n * them. Without them the method key alone picks the first payable match, and\n * more than one connector can publish the same key. Omitting them produces\n * exactly the URL this function has always produced, so links already minted\n * are unaffected.\n *\n * Open it **at the top level** (a new tab or a full-page navigation). The whole\n * point is that the top-level domain is the registered payment method domain;\n * rendering it in an iframe puts you back where you started.\n *\n * If you open it with `window.open`, call that **synchronously inside the click\n * handler** or the popup blocker will eat it, and make sure any iframe you\n * render DeloPay in permits popups (`allow-popups`, plus\n * `allow-popups-to-escape-sandbox` under a restrictive `sandbox`).\n */\nexport function focusedCheckoutUrl(params: FocusedCheckoutUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ pane: params.method });\n // Parameter order matches the embedded checkout's own `focusedUrl`\n // (`NativePanesPane.svelte`), so a merchant's deep link and a tile click\n // produce the same string for the same tile. A blank value is treated as\n // absent rather than emitted empty: `connector=` would otherwise read as a\n // connector named \"\" instead of as \"not specified\".\n const connector = params.connector?.trim();\n if (connector) query.set('connector', connector);\n const merchantConnectorId = params.merchantConnectorId?.trim();\n if (merchantConnectorId) query.set('mca', merchantConnectorId);\n if (params.locale) query.set('locale', params.locale);\n if (params.customFieldsCollected) query.set('cf', '1');\n return `${path}?${query.toString()}`;\n}\n\n// --- Checkout entries --------------------------------------------------\n\nexport interface CheckoutEntryUrlParams {\n /** Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`. */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /** The payment's `payment_link.payment_link_id`; see {@link FocusedCheckoutUrlParams.paymentLinkId}. */\n paymentLinkId?: string | null;\n /** The entry's `key`, as configured on the shop (`CheckoutEntry.key`). */\n entry: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n}\n\n/**\n * The link to one of the shop's **checkout entries** for a payment: the hosted\n * checkout with `?entry=<key>`, showing only that entry's methods in its\n * named look. Every entry of one payment charges the same payment, so the\n * buyer can move between them and still pays once.\n *\n * A `card` entry is meant for an iframe in your own page\n * (`<iframe src={checkoutEntryUrl(...)} allow=\"payment\">`, with your page's\n * origin in the shop's iframe origins). Its \"Other payment methods\" action\n * opens the entry the shop configured in a new tab, and also posts\n * {@link CheckoutOpenEntryMessage} to your page, so you can navigate yourself\n * instead. Give a sandboxed iframe `allow-popups` and\n * `allow-popups-to-escape-sandbox`, or the tab is refused and the buyer gets\n * a plain link. Open a `methods` entry at the top level.\n *\n * An entry key the shop does not have, and an entry with nothing for this\n * payment, show an explanation and no methods: an entry never falls back to\n * the full checkout.\n */\nexport function checkoutEntryUrl(params: CheckoutEntryUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ entry: params.entry.trim() });\n if (params.locale) query.set('locale', params.locale);\n return `${path}?${query.toString()}`;\n}\n\n/**\n * What an embedded card entry posts to your page when the buyer presses\n * \"Other payment methods\": the payment, the entry the shop configured and its\n * link. Sent only to the shop's iframe origins. `source` names the sending\n * checkout and follows the deployment's branding, so match on `type`.\n */\nexport interface CheckoutOpenEntryMessage {\n source: string;\n type: 'open_entry';\n payment_id: string;\n entry: string;\n url: string;\n}\n\n/** Whether a `message` event's `data` is a {@link CheckoutOpenEntryMessage}. */\nexport function isCheckoutOpenEntryMessage(data: unknown): data is CheckoutOpenEntryMessage {\n if (typeof data !== 'object' || data === null) return false;\n const message = data as Record<string, unknown>;\n return (\n message.type === 'open_entry' &&\n typeof message.source === 'string' &&\n typeof message.payment_id === 'string' &&\n typeof message.entry === 'string' &&\n typeof message.url === 'string'\n );\n}\n\n// --- Buyer-side checkout events ----------------------------------------\n\n/**\n * The closed vocabulary of buyer-side checkout events recorded on the payment's\n * status timeline. Written through\n * `POST /payment-link/{merchant_id}/{payment_id}/checkout-events`, authorized\n * with the payment's `client_secret` as a bearer token.\n *\n * The `native_pane_` prefix is the router's enum on the wire and does not move\n * with the rename — see the module header.\n */\nexport const CHECKOUT_EVENT_KINDS = [\n 'native_pane_selected',\n 'native_pane_tab_opened',\n 'native_pane_tab_blocked',\n 'native_pane_abandoned',\n 'native_pane_returned',\n 'checkout_cancelled',\n] as const;\n\nexport type CheckoutEventKind = (typeof CHECKOUT_EVENT_KINDS)[number];\n\n// --- Deprecated aliases -------------------------------------------------\n//\n// The pre-0.109.0 names, kept so an external `@delopay/sdk` consumer upgrades\n// on their own schedule rather than on ours. **Scheduled for removal in\n// 0.112.0** — see CHANGELOG.md. Nothing in this repo uses them.\n\n/** @deprecated Renamed to {@link Pane}. Removed in 0.112.0. */\nexport type StripeNativePane = Pane;\n/** @deprecated Renamed to {@link PaneView}. Removed in 0.112.0. */\nexport type NativePaneView = PaneView;\n/** @deprecated Renamed to {@link PaneVisibility}. Removed in 0.112.0. */\nexport type NativePaneVisibility = PaneVisibility;\n/** @deprecated Renamed to {@link PaneOpenTarget}. Removed in 0.112.0. */\nexport type NativePaneOpenTarget = PaneOpenTarget;\n/** @deprecated Spelt {@link PaneNativeElement} on the SDK side. Removed in 0.112.0. */\nexport type NativePaneNativeElement = PaneNativeElement;\n/**\n * @deprecated Superseded by {@link PaneMethodInfo}. Removed in 0.112.0.\n *\n * Deliberately **not** an alias of `PaneMethodInfo`: that type gained three\n * required routing fields (`paymentMethod`, `paymentMethodType`,\n * `requiresBillingCountry`), and a consumer who wrote an object literal or a\n * function return against the 0.108 shape would stop compiling on a deprecated\n * name that promises the opposite. This stays the six fields that shape had.\n *\n * `PaneMethodInfo` is structurally assignable to it, so everything this SDK\n * hands back — including {@link nativePaneMethodInfo} — still satisfies it.\n */\nexport interface NativePaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * @deprecated Renamed to {@link STRIPE_FALLBACK_PANE_METHODS}, which is a\n * degradation path and not a catalogue mirror. Removed in 0.112.0.\n */\nexport const STRIPE_NATIVE_PANE_METHODS = STRIPE_FALLBACK_PANE_METHODS;\n/** @deprecated Renamed to {@link PANE_ICON_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_ICON_KEYS = PANE_ICON_KEYS;\n/** @deprecated Renamed to {@link PANE_CATEGORY_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_CATEGORY_KEYS = PANE_CATEGORY_KEYS;\n/** @deprecated Renamed to {@link PANES_MAX}. Removed in 0.112.0. */\nexport const NATIVE_PANES_MAX = PANES_MAX;\n\n/**\n * @deprecated Superseded by {@link paneMethodInfo}, which takes the connector's\n * catalogue and answers for every connector rather than only for Stripe.\n * Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old return type: it answers out of the frozen Stripe table and carries that\n * table's compiled copy, which the live catalogue deliberately does not have.\n */\nexport function nativePaneMethodInfo(method: string): PaneMethodInfo | undefined {\n return STRIPE_FALLBACK_PANE_METHODS.find((info) => info.key === method);\n}\n\n/**\n * @deprecated Superseded by {@link defaultPane}. Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old behaviour: it leaves `category` empty and resolves `icon` out of the\n * frozen Stripe table only. `defaultPane` fills both from the connector's\n * catalogue, which is the fix — but a caller on the old name encodes whatever\n * it is handed, and quietly turning a blank field into a stored override is\n * not something a deprecated alias should do to a merchant's saved config.\n */\nexport function defaultNativePane(method: string): Pane {\n const info = nativePaneMethodInfo(method);\n return {\n ...defaultPane(method),\n category: '',\n icon: info?.defaultIcon ?? '',\n };\n}\n\n/** @deprecated Renamed to {@link clonePane}. Removed in 0.112.0. */\nexport const cloneNativePane = clonePane;\n/** @deprecated Renamed to {@link decodePanes}. Removed in 0.112.0. */\nexport const decodeNativePanes = decodePanes;\n/** @deprecated Renamed to {@link encodePanes}. Removed in 0.112.0. */\nexport const encodeNativePanes = encodePanes;\n"]}
1
+ {"version":3,"sources":["/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-YJQPKT6W.cjs","../src/panes.ts"],"names":[],"mappings":"AAAA;ACqEA,IAAM,kBAAA,EAA+C,CAAC,QAAA,EAAU,eAAA,EAAiB,eAAe,CAAA;AAMhG,SAAS,eAAA,CAAgB,GAAA,EAA8B;AACrD,EAAA,OAAO,IAAA,IAAQ,QAAA,GAAW,IAAA,IAAQ,YAAA,EAAc,IAAA,EAAM,KAAA;AACxD;AAEA,SAAS,eAAA,CAAgB,GAAA,EAA8B;AACrD,EAAA,wBAAO,iBAAA,CAAkB,IAAA,CAAK,CAAC,KAA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AAM,KAAA,EAAO,MAAA,CAAO,eAAA,CAAgB,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAA;AACtD,EAAA,MAAM,KAAA,EACJ,MAAA,CAAO,cAAA,GAAiB,sBAAA,CAAuB,IAAA,CAAK,MAAA,CAAO,aAAa,EAAA,EACpE,CAAA,EAAA;AAES,IAAA;AACR,EAAA;AACkD,EAAA;AAMhB,EAAA;AACM,EAAA;AACc,EAAA;AACA,EAAA;AACT,EAAA;AACC,EAAA;AACnB,EAAA;AACpC;AAoCyE;AACjB,EAAA;AAGhD,EAAA;AAES,IAAA;AACR,EAAA;AACyD,EAAA;AACZ,EAAA;AAClB,EAAA;AACpC;AAiB4F;AACpC,EAAA;AACtC,EAAA;AAIP,EAAA;AAIX;AAaoC;AAClC,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACA,EAAA;AACF;AAiD0C;AAEL;AAEI;AAET;AAWiD;AACT,EAAA;AACxE;AAYwD;AACd,EAAA;AACjC,EAAA;AACgB,IAAA;AACX,IAAA;AACiB,IAAA;AAC7B,EAAA;AACF;AAG+B;AAEE;AAEA;AD7sB2D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/tmp/w1-sdkpub.a2EQ/sdk/dist/chunk-YJQPKT6W.cjs","sourcesContent":[null,"// **Payment panes** — merchant-configured payment methods that render as\n// DeloPay-drawn tiles in the embedded checkout instead of inside a connector's\n// own embedded form.\n//\n// Why they exist: Stripe only offers Apple Pay / Google Pay / Link when the\n// *top-level* document's domain is registered as a payment method domain on the\n// merchant's Stripe account. In an embedded iframe that domain is the\n// merchant's shop, not the DeloPay checkout — so the wallet silently\n// disappears. A pane replaces it with our own tile that opens the DeloPay\n// hosted checkout at the top level, in a focused single-method view.\n//\n// Nothing here is Apple-Pay-specific, and since the router published a\n// per-connector capability catalogue nothing here is Stripe-specific either:\n// the feature is \"which of a connector's payment methods render as a pane, and\n// how they look\".\n//\n// This module serves SDK consumers: merchants configuring\n// `metadata.native_panes` on a merchant connector account programmatically\n// (codec), reading the resolved `native_panes` off a checkout payload\n// ({@link PaneView}), or building the focused single-method link that goes\n// behind their own button ({@link focusedCheckoutUrl}).\n//\n// The wire shapes are owned by the API — `native_panes` in\n// the metadata key, the field names and the enum values are contracts with it\n// and with links already in buyers' hands, so the identifiers here were renamed\n// off \"native pane\" and the wire was not.\n//\n// Capability (which connector may publish which method, on which rail) comes\n// from the router at runtime through `connectors.getPanesCatalog()`, not from a\n// table here.\n\n// Type-only, so this module still emits no imports and can be executed\n// standalone. `types.ts` owns the catalogue's wire shapes because they are\n// generated-spec-paired (`scripts/validate-types.ts`); it imports nothing from\n// here, so the dependency runs one way.\nimport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n PaneNativeElement,\n} from './types';\n\nexport type {\n PaneCapability,\n PaneRail,\n PanesCatalogResponse,\n PanesConnectorCatalog,\n PaneSurcharge,\n PaneView,\n PaneVisibility,\n PaneOpenTarget,\n SurchargeDirection,\n};\n\n// --- Wire types ---------------------------------------------------------\n\n/**\n * The values {@link decodePanes} recognises. Anything else — a value written by\n * a dashboard newer than this SDK — degrades to `always` rather than throwing\n * or dropping the row: an older SDK reading a newer blob is a normal state\n * during a rollout, and a hard failure there takes out a merchant's whole\n * connector config rather than one tile.\n */\nconst PANE_VISIBILITIES: readonly PaneVisibility[] = ['always', 'embedded_only', 'external_only'];\n\n/**\n * `same_page` and `popup` are kept as written; anything else — including the\n * absent key — is the default `tab`, as it always was.\n */\nfunction parseOpenTarget(raw: unknown): PaneOpenTarget {\n return raw === 'popup' || raw === 'same_page' ? raw : 'tab';\n}\n\nfunction parseVisibility(raw: unknown): PaneVisibility {\n return PANE_VISIBILITIES.find((value) => value === raw) ?? 'always';\n}\n\nconst PANE_NATIVE_ELEMENTS: readonly PaneNativeElement[] = [\n 'everywhere',\n 'embedded_only',\n 'external_only',\n];\n\n/**\n * Read a stored row's native-element choice, tolerantly.\n *\n * Absent decodes to `everywhere`, because that is what the router decodes a\n * missing key to (`admin::NativePaneNativeElement` defaults to it): a row\n * written before the field existed means \"the wallet's own button wherever\n * this pane is offered\", which is what the tile was always a stand-in for. An\n * unknown word degrades the same way rather than dropping the row — the\n * router's own decode is lenient for the same rolling-deploy reason.\n */\nfunction parseNativeElement(raw: unknown): PaneNativeElement {\n return PANE_NATIVE_ELEMENTS.find((value) => value === raw) ?? 'everywhere';\n}\n\n/**\n * One pane exactly as the merchant configures it. Persisted (JSON) under\n * `metadata.native_panes` on the merchant connector account.\n *\n * Field names are the wire contract — renaming one is a migration. The router\n * decodes strictly row by row: a row that fails strict decoding (e.g. a\n * wrong-typed field like `display_order: \"3\"`) is dropped whole with a server\n * log, and the remaining rows still render. This SDK's {@link decodePanes} is\n * additionally per-property tolerant — including clamping `display_order` into\n * the router's `i32` range — so a decode→encode round-trip through the SDK\n * repairs a blob the router would partially drop.\n */\nexport interface Pane {\n /** Catalogue key of the promoted method — see {@link paneMethodInfo}. */\n method: string;\n /** Disabled rows keep their tuning but never reach a buyer. */\n enabled: boolean;\n /** Default-language tile label. Empty falls back to the catalogue name. */\n label: string;\n /** Per-locale overrides of `label`, keyed by checkout locale (`de`, `de-AT`). */\n labelTranslations: Record<string, string>;\n /**\n * Secondary line under the label. `null` means \"use the catalogue default\";\n * an empty string means the merchant deliberately hid the line. That\n * distinction is the whole reason this is nullable and `label` is not.\n */\n sublabel: string | null;\n /** Per-locale overrides of `sublabel`. */\n sublabelTranslations: Record<string, string>;\n /** Section the tile groups under. Empty falls back to the catalogue category. */\n category: string;\n /** Built-in icon key — see {@link PANE_ICON_KEYS}. */\n icon: string;\n /** Custom inline SVG. Sanitized server-side before it reaches a buyer; a\n * rejected payload falls back to the built-in `icon`. */\n iconSvg: string;\n /** Lower renders first; ties break on catalogue order. */\n displayOrder: number;\n /** Where the tile is offered — see {@link PaneVisibility}. */\n visibility: PaneVisibility;\n /** How the embedded checkout opens the focused view — see {@link PaneOpenTarget}. */\n openIn: PaneOpenTarget;\n /**\n * Where the wallet's own button replaces this tile — see\n * {@link PaneNativeElement}. Only meaningful on a method whose catalogue\n * entry says {@link PaneCapability.supports_native_element}; the router\n * ignores it elsewhere. `everywhere` is the default and what a row stored\n * before the field existed decodes to.\n */\n nativeElement: PaneNativeElement;\n /** A shipped look instead of the icon (`paypal`, `card`); `''` or absent = none.\n * Optional because a `Pane` built before the field existed must still encode. */\n preset?: string;\n /** The preset's style; `''` or absent = the preset's default. */\n style?: string;\n}\n\n/**\n * Read a resolved tile's placement rule, across every payload version.\n *\n * Prefer this to touching either field. They are independent on the wire — a\n * payload may carry either, both or neither — and each alone loses a placement\n * rule: `embedded_only` cannot express `external_only`, so an `external_only`\n * tile read through it renders inside the merchant iframe the merchant asked\n * to keep it out of; `visibility` is absent on a router that predates it, so\n * an `embedded_only` tile read through it alone renders at top level too,\n * duplicating a method Stripe's own form already offers there.\n *\n * A recognised `visibility` wins. Otherwise the legacy boolean answers: absent\n * (old router) it carries the only placement that router could express, and\n * unrecognised (newer router) the router still sets it under its own fixed\n * rule. Neither path throws, and both degrade toward showing a tile — losing a\n * placement rule, never stranding a method.\n */\nexport function paneViewVisibility(\n view: Pick<PaneView, 'visibility' | 'embedded_only'>,\n): PaneVisibility {\n const declared = PANE_VISIBILITIES.find((value) => value === view.visibility);\n if (declared) return declared;\n return view.embedded_only === true ? 'embedded_only' : 'always';\n}\n\n// --- Catalogue ----------------------------------------------------------\n\n/**\n * A method the frozen Stripe fallback table knows, with the compiled copy the\n * router shipped for it at the time.\n *\n * Only {@link STRIPE_FALLBACK_PANE_METHODS} is typed with this. The live\n * catalogue (`connectors.getPanesCatalog()`) carries capability facts and no\n * copy at all, by design — see {@link PaneCapability}.\n */\nexport interface PaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethod: string;\n /** Confirm routing key. Pass through verbatim; never derive it. */\n paymentMethodType: string;\n /** The focused checkout has to collect a billing country to confirm this. */\n requiresBillingCountry: boolean;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * What this SDK assumes when the router cannot answer.\n *\n * The capability endpoint does not exist on an older router, which answers\n * `connectors.getPanesCatalog()` with a 404.\n * Rather than leaving a caller with nothing, the pane helpers default to\n * exactly the behaviour they had before that endpoint existed: panes on the\n * Stripe connector only, with the method set the router's Stripe catalogue had\n * at the time.\n *\n * **This is a degradation path, not a mirror. Do not keep it in sync by hand,\n * and do not add a connector or a method to it** — that is what this table was\n * before the capability endpoint, and adding to it would quietly rebuild the mirror. A\n * connector the router serves panes for arrives through the endpoint and needs\n * no entry here; a connector that needs an entry here to appear is a connector\n * the router will not deliver panes for anyway.\n *\n * The only reason to touch this list is to correct what Stripe's catalogue\n * looked like *before* the endpoint existed, and that is history, so there is\n * no such reason. Once the endpoint is reachable it is never consulted for a\n * connector the router answered for.\n *\n * The redirect-rail set is deliberately narrow — every entry is a variant the\n * Stripe connector accepts and that needs no extra buyer input beyond a\n * billing country. `eps` / `p24` / `bancontact` are absent because Stripe\n * hard-requires billing fields the focused checkout never collects (a full\n * name for EPS and Bancontact, an email for Przelewy24), so their tiles could\n * never succeed.\n *\n * `defaultLabel` / `defaultSublabel` are the copy the router compiled at that\n * time and are frozen with the rest of the table. Copy for a method the live\n * catalogue reports belongs to the consumer's own locale files, keyed by\n * `key` — the router ships none.\n */\nexport const STRIPE_FALLBACK_PANE_METHODS: readonly PaneMethodInfo[] = [\n {\n key: 'apple_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'apple_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Apple Pay',\n defaultSublabel: 'Pay with Apple Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'apple',\n },\n {\n key: 'google_pay',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'google_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Google Pay',\n defaultSublabel: 'Pay with Google Pay',\n defaultCategory: 'wallet',\n defaultIcon: 'google',\n },\n {\n key: 'link',\n rail: 'wallet',\n paymentMethod: 'wallet',\n paymentMethodType: 'link',\n requiresBillingCountry: false,\n defaultLabel: 'Link',\n defaultSublabel: 'Pay with saved details',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'klarna',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'klarna',\n // Stripe's Klarna needs the buyer's country echoed into the confirm body.\n requiresBillingCountry: true,\n defaultLabel: 'Klarna',\n // NOT the router's current \"Pay later or in 3 instalments\". This table is\n // what a router predating the capability endpoint renders, and that copy\n // only gained the \"3\" in the same release that added the endpoint.\n // Restating the new string here\n // would put copy no reachable router emits in front of a merchant, and\n // would change what the deprecated `nativePaneMethodInfo` has returned\n // since 0.106.0.\n defaultSublabel: 'Pay later or in instalments',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'affirm',\n rail: 'redirect',\n paymentMethod: 'pay_later',\n paymentMethodType: 'affirm',\n requiresBillingCountry: false,\n defaultLabel: 'Affirm',\n defaultSublabel: 'Pay over time',\n defaultCategory: 'bnpl',\n defaultIcon: 'bnpl',\n },\n {\n key: 'ideal',\n rail: 'redirect',\n paymentMethod: 'bank_redirect',\n paymentMethodType: 'ideal',\n requiresBillingCountry: false,\n defaultLabel: 'iDEAL',\n defaultSublabel: 'Pay from your bank',\n defaultCategory: 'bank_redirect',\n defaultIcon: 'bank',\n },\n {\n key: 'alipay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'ali_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Alipay',\n defaultSublabel: 'Pay with Alipay',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'revolut_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'revolut_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Revolut Pay',\n defaultSublabel: 'Pay with Revolut',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n {\n key: 'amazon_pay',\n rail: 'redirect',\n paymentMethod: 'wallet',\n paymentMethodType: 'amazon_pay',\n requiresBillingCountry: false,\n defaultLabel: 'Amazon Pay',\n defaultSublabel: 'Pay with Amazon',\n defaultCategory: 'wallet',\n defaultIcon: 'wallet',\n },\n];\n\n/**\n * {@link STRIPE_FALLBACK_PANE_METHODS} in the shape the live endpoint returns,\n * so every helper below takes one type of catalogue and the degradation path\n * is not a second code path. Derived, not written out: two spellings of one\n * table is exactly the drift this design removes.\n */\nexport const STRIPE_FALLBACK_PANE_CATALOG: PanesConnectorCatalog = {\n connector: 'stripe',\n allowed_rails: ['wallet', 'redirect'],\n methods: STRIPE_FALLBACK_PANE_METHODS.map((info) => ({\n key: info.key,\n rail: info.rail,\n payment_method: info.paymentMethod,\n payment_method_type: info.paymentMethodType,\n requires_billing_country: info.requiresBillingCountry,\n })),\n};\n\n/**\n * An empty catalogue — a connector the router does not offer panes for.\n * Exported so callers can express \"asked, and the answer was no\" without\n * reaching for `null` in the middle of a computation.\n */\nexport function emptyPaneCatalog(connector: string): PanesConnectorCatalog {\n return { connector, allowed_rails: [], methods: [] };\n}\n\n/**\n * Pull one connector's entry out of a `connectors.getPanesCatalog()` response.\n *\n * Returns {@link emptyPaneCatalog} for a connector the response does not name:\n * \"the router knows this connector and publishes no panes for it\" and \"the\n * router has never heard of it\" are the same answer to a caller building an\n * editor, and both mean \"offer nothing\".\n */\nexport function paneCatalogFor(\n response: PanesCatalogResponse,\n connector: string,\n): PanesConnectorCatalog {\n return (\n response.connectors.find((entry) => entry.connector === connector) ??\n emptyPaneCatalog(connector)\n );\n}\n\n/**\n * Built-in tile icon keys the buyer-facing checkout ships a glyph for.\n *\n * Reconciled against both ends: every key here has a branch in the checkout's\n * `NativePaneIcon.svelte`, and every `default_icon` the router's catalogue\n * publishes is in this list. An icon key the checkout does not ship falls\n * through to `wallet` there, so a key that drifts in renders as the wrong\n * glyph rather than as nothing.\n */\nexport const PANE_ICON_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bank',\n 'apple',\n 'google',\n 'bnpl',\n 'cash',\n // Brand marks, not category glyphs: the checkout draws PayPal's monogram,\n // Klarna's squircle-K and the Bitcoin mark for these, the same logos the\n // bespoke panes they replace already drew. Listed here so a merchant's own\n // dashboard can offer them; the router decides which one a tile *defaults*\n // to, and a router predating them simply keeps sending the old default.\n 'paypal',\n 'klarna',\n 'crypto',\n];\n\n/**\n * Section keys a pane's tile may group under.\n *\n * Reconciled against the router's actual `default_category` values rather than\n * against what the Stripe table happened to need. `crypto` and `game_items`\n * are router defaults (the Cryptomus/NowPayments and Skinsback catalogues) and\n * were missing here, so a merchant configuring one of those panes was shown a\n * category their editor did not recognise.\n *\n * A custom value is allowed and renders as its own section under that literal\n * text. The buyer-facing checkout translates a subset of these into a section\n * header and falls through to the raw key for the rest — `crypto` and\n * `game_items` are the two it has yet to add.\n */\nexport const PANE_CATEGORY_KEYS: readonly string[] = [\n 'wallet',\n 'card',\n 'bnpl',\n 'bank_redirect',\n 'bank_transfer',\n 'crypto',\n 'game_items',\n 'cash',\n];\n\n/**\n * Mirror of the router's per-connector cap. Counted differently on each side:\n * {@link decodePanes} stops after 12 *decoded* rows (entries with a usable,\n * non-duplicate `method` — junk and duplicate entries don't consume a slot),\n * while the router caps *accepted* panes (enabled, known, deduplicated) at 12\n * — so an oversized hand-written blob may render a pane this decoder drops.\n * Blobs the SDK itself encodes never exceed the cap.\n */\nexport const PANES_MAX = 12;\n\n/**\n * Look a method up in one connector's catalogue.\n *\n * Pass the entry for the connector being configured, from\n * `connectors.getPanesCatalog()` via {@link paneCatalogFor}. The default is\n * the degradation path and only correct for Stripe on a router that predates\n * the endpoint — see {@link STRIPE_FALLBACK_PANE_CATALOG}.\n */\nexport function paneMethodInfo(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneCapability | undefined {\n return catalog.methods.find((info) => info.key === method);\n}\n\n/** Whether this connector may declare a pane on `rail` at all. A wallet pane\n * on a connector outside its `allowed_rails` is refused at save time — the\n * wallet rail rides on Stripe's Express Checkout Element charging the *same*\n * payment intent the embedded checkout holds, which does not generalise. */\nexport function paneRailAllowed(rail: PaneRail, catalog: PanesConnectorCatalog): boolean {\n return catalog.allowed_rails.includes(rail);\n}\n\n/**\n * The methods a caller may actually offer for this connector: the catalogue's\n * own list, minus anything on a rail the connector does not allow.\n *\n * The router should not report such a pair in the first place, but the two\n * fields are independent in the response and a save that crosses them is\n * refused at the API with an error naming the connector and the method. Filter\n * rather than trust, so a merchant never configures a tile the save will\n * bounce.\n */\nexport function offerablePaneMethods(catalog: PanesConnectorCatalog): PaneCapability[] {\n return catalog.methods.filter((info) => paneRailAllowed(info.rail, catalog));\n}\n\n/** Non-copy display defaults for a tile: which built-in glyph and which\n * section heading a new pane starts on. */\nexport interface PaneDisplayDefaults {\n icon: string;\n category: string;\n}\n\n/**\n * Per-method overrides, for the handful whose brand glyph is not what their\n * payment method would suggest. Everything else is derived from the catalogue\n * entry's `payment_method` below, so a connector the SDK has never heard of\n * still gets a sensible tile rather than a blank one.\n *\n * These have to be keyed by method and not by `payment_method`: `wallet` also\n * routes Link, Alipay, Revolut Pay and Amazon Pay, and `pay_later` also routes\n * Affirm — none of which the SDK has a mark for. Getting this wrong is not a\n * cosmetic slip that the next release fixes, because {@link defaultPane}\n * materialises the value and {@link encodePanes} writes it to\n * `metadata.native_panes`, where a stored `icon` outranks the router's\n * `default_icon` for the life of the pane.\n */\nconst DISPLAY_DEFAULTS_BY_KEY: Readonly<Record<string, PaneDisplayDefaults>> = {\n apple_pay: { icon: 'apple', category: 'wallet' },\n google_pay: { icon: 'google', category: 'wallet' },\n paypal: { icon: 'paypal', category: 'wallet' },\n // Both the Klarna connector's own tile and Stripe's Klarna. Affirm stays on\n // the generic `bnpl` glyph — same rail, no mark of its own.\n klarna: { icon: 'klarna', category: 'bnpl' },\n};\n\n/**\n * Derived from the `payment_method` half of the catalogue's routing pair.\n * Every value here reproduces the router's own `default_icon` /\n * `default_category` for the methods it publishes today, so a tile the SDK\n * lays out and a tile the router lays out agree.\n */\nconst DISPLAY_DEFAULTS_BY_PAYMENT_METHOD: Readonly<Record<string, PaneDisplayDefaults>> = {\n wallet: { icon: 'wallet', category: 'wallet' },\n card: { icon: 'card', category: 'card' },\n card_redirect: { icon: 'card', category: 'card' },\n pay_later: { icon: 'bnpl', category: 'bnpl' },\n bank_redirect: { icon: 'bank', category: 'bank_redirect' },\n bank_transfer: { icon: 'bank', category: 'bank_transfer' },\n bank_debit: { icon: 'bank', category: 'bank_transfer' },\n // Cryptomus and NowPayments publish the same `crypto` key on this rail, and\n // the router defaults both to the Bitcoin mark.\n crypto: { icon: 'crypto', category: 'crypto' },\n // Skinsback, which has no mark: the router defaults it to `wallet` too.\n game_items: { icon: 'wallet', category: 'game_items' },\n cash: { icon: 'cash', category: 'cash' },\n voucher: { icon: 'cash', category: 'cash' },\n};\n\nconst DISPLAY_DEFAULTS_FALLBACK: PaneDisplayDefaults = { icon: 'wallet', category: 'wallet' };\n\n/**\n * What a new tile looks like before the merchant designs it.\n *\n * The router serves capability, not presentation, so the glyph and the section\n * come from here and the accompanying text comes from the caller's own locale\n * files. A method with no entry at all still resolves — that is the point of\n * deriving from `payment_method`: a connector added to the router's catalogue\n * tomorrow needs no SDK release to be designable today.\n */\nexport function paneDisplayDefaults(info: PaneCapability | undefined): PaneDisplayDefaults {\n if (!info) return DISPLAY_DEFAULTS_FALLBACK;\n return (\n DISPLAY_DEFAULTS_BY_KEY[info.key] ??\n DISPLAY_DEFAULTS_BY_PAYMENT_METHOD[info.payment_method] ??\n DISPLAY_DEFAULTS_FALLBACK\n );\n}\n\n// --- Validation ---------------------------------------------------------\n\n/**\n * Why a configured pane would not survive a save or a render.\n *\n * - `method_unknown` — the connector's catalogue does not publish this key, so\n * the router drops the row at render.\n * - `rail_not_allowed` — the method's rail is not in the connector's\n * `allowed_rails`; the API refuses this at save time.\n * - `over_cap` — past the router's per-connector cap of {@link PANES_MAX}; the\n * row is stored but never rendered.\n * - `duplicate_method` — an earlier enabled row already claims this method.\n * The router skips disabled rows and then dedupes, so the first *enabled*\n * row renders and every later one is dropped in silence. Reported on the\n * losing rows, never on the one that survives.\n */\nexport type PaneIssueCode = 'method_unknown' | 'rail_not_allowed' | 'over_cap' | 'duplicate_method';\n\nexport interface PaneIssue {\n /** Index into the list handed to {@link validatePanes}. */\n index: number;\n method: string;\n code: PaneIssueCode;\n}\n\n/**\n * Check a configured list against one connector's catalogue, before writing it\n * to `metadata.native_panes`.\n *\n * The API applies the same rules at save time, so this changes where the\n * merchant finds out, not whether they do — and an SDK caller building an\n * editor would otherwise learn it from a bounced request with no row to point\n * at. An empty result means nothing here will be refused or silently dropped.\n */\nexport function validatePanes(\n panes: readonly Pane[],\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): PaneIssue[] {\n const issues: PaneIssue[] = [];\n // Keyed on the catalogue's own key rather than the raw string, because that\n // is what the router dedupes on. Only enabled rows are recorded: a disabled\n // row never reaches the router's `seen` set, so it neither claims a method\n // nor loses to one.\n const claimedBy = new Set<string>();\n panes.forEach((pane, index) => {\n const info = paneMethodInfo(pane.method, catalog);\n if (!info) {\n issues.push({ index, method: pane.method, code: 'method_unknown' });\n } else if (!paneRailAllowed(info.rail, catalog)) {\n issues.push({ index, method: pane.method, code: 'rail_not_allowed' });\n } else if (pane.enabled) {\n // Unknown and rail-refused rows are dropped before the router dedupes,\n // so they cannot claim a key — and reporting two codes for one row would\n // point the merchant at the wrong repair.\n if (claimedBy.has(info.key)) {\n issues.push({ index, method: pane.method, code: 'duplicate_method' });\n } else {\n claimedBy.add(info.key);\n }\n }\n if (index >= PANES_MAX) issues.push({ index, method: pane.method, code: 'over_cap' });\n });\n return issues;\n}\n\n// --- Codec --------------------------------------------------------------\n\n/**\n * A new pane for `method`, with its glyph and section resolved from the\n * connector's catalogue entry rather than from a Stripe-keyed table — so\n * `defaultPane('creem_checkout', catalog)` is a designed tile and not a blank\n * one.\n *\n * Pass the catalogue entry for the connector being configured; the default is\n * the degradation path (see {@link STRIPE_FALLBACK_PANE_CATALOG}). Labels are\n * deliberately left empty: empty means \"use the catalogue default\", which the\n * router resolves at render, and the router ships no copy for a caller to\n * mirror.\n */\nexport function defaultPane(\n method: string,\n catalog: PanesConnectorCatalog = STRIPE_FALLBACK_PANE_CATALOG,\n): Pane {\n const defaults = paneDisplayDefaults(paneMethodInfo(method, catalog));\n return {\n method,\n enabled: true,\n label: '',\n labelTranslations: {},\n sublabel: null,\n sublabelTranslations: {},\n category: defaults.category,\n icon: defaults.icon,\n iconSvg: '',\n displayOrder: 0,\n visibility: 'always',\n openIn: 'tab',\n nativeElement: 'everywhere',\n preset: '',\n style: '',\n };\n}\n\nexport function clonePane(pane: Pane): Pane {\n return {\n ...pane,\n labelTranslations: { ...pane.labelTranslations },\n sublabelTranslations: { ...pane.sublabelTranslations },\n };\n}\n\nfunction isObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction parseTranslations(raw: unknown): Record<string, string> {\n if (!isObject(raw)) return {};\n const out: Record<string, string> = {};\n for (const [locale, value] of Object.entries(raw)) {\n if (typeof value === 'string' && value.length > 0) out[locale] = value;\n }\n return out;\n}\n\nfunction str(raw: unknown): string {\n return typeof raw === 'string' ? raw : '';\n}\n\n// `display_order` is a 32-bit signed integer on the wire, and a\n// fractional or out-of-range value fails its strict row decode — dropping the\n// whole row server-side while an SDK round-trip would keep the blob looking\n// healthy. Clamped on BOTH decode and encode so this codec never emits a\n// value the router rejects, regardless of where the number came from.\nconst DISPLAY_ORDER_MIN = -2147483648;\nconst DISPLAY_ORDER_MAX = 2147483647;\n\nfunction clampDisplayOrder(raw: number): number {\n if (!Number.isFinite(raw)) return 0;\n return Math.min(DISPLAY_ORDER_MAX, Math.max(DISPLAY_ORDER_MIN, Math.trunc(raw)));\n}\n\n/**\n * Decode the stored `metadata.native_panes` blob into editor rows.\n *\n * Tolerant like the branding codecs: anything malformed falls back per\n * property, rows without a usable `method` are dropped, duplicates keep the\n * first occurrence — except that an enabled row wins over an earlier disabled\n * one for the same method, because that is the row the router renders — and\n * decoding stops after {@link PANES_MAX} decoded rows (dropped junk/duplicate\n * entries don't consume a slot). That is more forgiving than the router, which\n * drops a strict-decode-failing row whole (keeping the rest) and caps accepted\n * panes rather than decoded rows — see {@link Pane} and {@link PANES_MAX}.\n * Returns `null` when the input is not an array so the caller can distinguish\n * \"never configured\" from \"cleared\".\n */\nexport function decodePanes(raw: unknown): Pane[] | null {\n if (!Array.isArray(raw)) return null;\n const decodeRow = (entry: Record<string, unknown>, method: string): Pane => ({\n method,\n enabled: entry['enabled'] !== false,\n label: str(entry['label']),\n labelTranslations: parseTranslations(entry['label_translations']),\n sublabel: typeof entry['sublabel'] === 'string' ? entry['sublabel'] : null,\n sublabelTranslations: parseTranslations(entry['sublabel_translations']),\n category: str(entry['category']),\n icon: str(entry['icon']),\n iconSvg: str(entry['icon_svg']),\n displayOrder: clampDisplayOrder(Number(entry['display_order'])),\n // Anything unrecognised degrades to `always` rather than dropping the row.\n visibility: parseVisibility(entry['visibility']),\n // Same tolerance: an unknown value degrades to the default `tab`.\n openIn: parseOpenTarget(entry['open_in']),\n nativeElement: parseNativeElement(entry['native_element']),\n preset: str(entry['preset']),\n style: str(entry['style']),\n });\n\n const indexByMethod = new Map<string, number>();\n const out: Pane[] = [];\n for (const entry of raw) {\n if (out.length >= PANES_MAX) break;\n if (!isObject(entry)) continue;\n const method = str(entry['method']).trim();\n if (!method) continue;\n const kept = indexByMethod.get(method);\n if (kept !== undefined) {\n // Duplicate method. Keep the row the ROUTER would render: it skips\n // disabled rows BEFORE deduping, so where a blob\n // holds both a disabled and an enabled row for one method, buyers see\n // the enabled one. Keeping the disabled row here would show the merchant\n // a pane that is off while it is live, and persist that on the next save.\n const enabled = entry['enabled'] !== false;\n const existing = out[kept];\n if (enabled && existing && !existing.enabled) out[kept] = decodeRow(entry, method);\n continue;\n }\n indexByMethod.set(method, out.length);\n out.push(decodeRow(entry, method));\n }\n return out;\n}\n\n/**\n * Encode editor rows back into the snake_case blob the connector account\n * stores. Empty optional strings are omitted so the metadata stays small and a\n * merchant who typed nothing round-trips as \"use the catalogue default\" rather\n * than as an explicit empty override.\n *\n * `sublabel` is the exception: an explicitly-empty value is preserved (as `\"\"`)\n * because that is how a merchant hides the second line.\n */\nexport function encodePanes(panes: Pane[]): Record<string, unknown>[] {\n const nonEmpty = (map: Record<string, string>): Record<string, string> | undefined => {\n const entries = Object.entries(map).filter(([, v]) => v.trim().length > 0);\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n };\n return panes.slice(0, PANES_MAX).map((pane) => {\n const labelTranslations = nonEmpty(pane.labelTranslations);\n const sublabelTranslations = nonEmpty(pane.sublabelTranslations);\n return {\n method: pane.method,\n enabled: pane.enabled,\n ...(pane.label.trim() ? { label: pane.label.trim() } : {}),\n ...(labelTranslations ? { label_translations: labelTranslations } : {}),\n // `null` omits the key entirely (catalogue default wins); `''` is sent\n // as-is because that is how the merchant hides the second line.\n ...(pane.sublabel !== null ? { sublabel: pane.sublabel } : {}),\n ...(sublabelTranslations ? { sublabel_translations: sublabelTranslations } : {}),\n ...(pane.category.trim() ? { category: pane.category.trim() } : {}),\n ...(pane.icon.trim() ? { icon: pane.icon.trim() } : {}),\n ...(pane.iconSvg.trim() ? { icon_svg: pane.iconSvg.trim() } : {}),\n // Clamped on encode too, not only decode: the router's strict i32 row\n // decode drops a row whole for a fractional or out-of-range value, so\n // writing e.g. 3.5 or Date.now() verbatim would silently delete the\n // pane at render while every read surface shows it healthy.\n display_order: clampDisplayOrder(pane.displayOrder),\n // Normalised on encode for the same reason `display_order` is clamped:\n // the router's strict row decode drops a row whole on a value outside\n // its enum, and a caller who built a `Pane` by hand (or in plain JS)\n // never went through `decodePanes`. A decoded pane always holds a valid\n // value, so this is a no-op on the round-trip path.\n visibility: parseVisibility(pane.visibility),\n open_in: parseOpenTarget(pane.openIn),\n // Omitted at the default: `everywhere` is what the router decodes an\n // absent key to, so leaving it out changes nothing — and keeps a blob\n // stored before the field existed byte-identical on re-encode, which\n // is what the wire-compatibility test pins.\n ...(parseNativeElement(pane.nativeElement) === 'everywhere'\n ? {}\n : { native_element: parseNativeElement(pane.nativeElement) }),\n // Absent and blank both mean \"no look\": a pane shaped before the fields\n // existed encodes exactly as it always did.\n ...((pane.preset ?? '').trim() ? { preset: (pane.preset ?? '').trim() } : {}),\n ...((pane.style ?? '').trim() ? { style: (pane.style ?? '').trim() } : {}),\n };\n });\n}\n\n// --- Focused checkout URL ----------------------------------------------\n\n/**\n * A payment link id the hosted checkout serves on its own, as\n * `/pay/{payment_link_id}`: the lowercase, hyphenated UUID the API issues.\n */\nconst OPAQUE_PAYMENT_LINK_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;\n\nexport interface FocusedCheckoutUrlParams {\n /** Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`. */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /**\n * The payment's `payment_link.payment_link_id`. When it is the opaque id the\n * API issues (a lowercase, hyphenated UUID), the link is\n * `/pay/{payment_link_id}`, which names neither the merchant nor the\n * payment. Omitted, or an older `plink_` id, keeps\n * `/pay/{merchantId}/{paymentId}`, which the checkout still serves.\n */\n paymentLinkId?: string | null;\n /** Pane method key to focus on (`apple_pay`, `klarna`, …). */\n method: string;\n /**\n * Connector that owns the tile, forwarded as `connector=`.\n *\n * A bare `pane=` resolves to the **first payable match in server-sorted\n * order**, which is unambiguous only while one connector publishes a given\n * key. Stripe publishes `klarna` and so does the Klarna connector, so a deep\n * link that names neither charges through whichever tile happens to sort\n * first. Name the connector whenever you know it.\n *\n * Optional because links minted before this parameter existed are already in\n * merchants' pages and still have to resolve.\n */\n connector?: string;\n /**\n * Merchant connector ACCOUNT that owns the tile, forwarded as `mca=`.\n *\n * Needed for the same reason `connector` is, one level down: a profile may\n * hold two enabled accounts of one connector, each publishing its own tile,\n * and the two links would otherwise be identical. Only meaningful alongside\n * `connector`.\n */\n merchantConnectorId?: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n /**\n * Set when the merchant's checkout-custom-field answers are already\n * persisted on the payment — forwarded as `cf=1` so the focused view skips\n * asking a second time. Purely a UI hint: the values live on the intent\n * either way, and the backend only accepts the merchant's configured field\n * keys from a client, so a wrongly-set flag can at worst skip an\n * informational prompt. This is the same hint the embedded pane sets when\n * it opens the focused view.\n */\n customFieldsCollected?: boolean;\n}\n\n/**\n * Build the link to the **focused single-method checkout**: the DeloPay hosted\n * checkout rendered with one payment method, one button, no picker.\n *\n * Two callers:\n * - the embedded checkout, which opens this in a new tab when a buyer clicks\n * a pane tile, and\n * - a merchant running their own checkout, who puts it behind their own\n * button — the same mechanism without an iframe.\n *\n * `method` is not limited to configured panes. A configured pane gets the\n * focused one-button view; `card`, `paypal`, `crypto_currency` and the\n * local-methods catalogs (by method key or vendor code) open the checkout\n * pinned to that method. Methods that exist only as a tab inside a connector's\n * own embedded form — iDEAL, Bancontact, P24 and the like, unless promoted to\n * a pane — cannot be isolated, because the connector owns that surface. An\n * unknown or unavailable method is never a dead end: the checkout shows a\n * notice with a visible \"show all payment methods\" action.\n *\n * Pass {@link FocusedCheckoutUrlParams.connector} (and\n * {@link FocusedCheckoutUrlParams.merchantConnectorId}) whenever you know\n * them. Without them the method key alone picks the first payable match, and\n * more than one connector can publish the same key. Omitting them produces\n * exactly the URL this function has always produced, so links already minted\n * are unaffected.\n *\n * Open it **at the top level** (a new tab or a full-page navigation). The whole\n * point is that the top-level domain is the registered payment method domain;\n * rendering it in an iframe puts you back where you started.\n *\n * If you open it with `window.open`, call that **synchronously inside the click\n * handler** or the popup blocker will eat it, and make sure any iframe you\n * render DeloPay in permits popups (`allow-popups`, plus\n * `allow-popups-to-escape-sandbox` under a restrictive `sandbox`).\n */\nexport function focusedCheckoutUrl(params: FocusedCheckoutUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ pane: params.method });\n // Parameter order matches the embedded checkout's own `focusedUrl`\n // (`NativePanesPane.svelte`), so a merchant's deep link and a tile click\n // produce the same string for the same tile. A blank value is treated as\n // absent rather than emitted empty: `connector=` would otherwise read as a\n // connector named \"\" instead of as \"not specified\".\n const connector = params.connector?.trim();\n if (connector) query.set('connector', connector);\n const merchantConnectorId = params.merchantConnectorId?.trim();\n if (merchantConnectorId) query.set('mca', merchantConnectorId);\n if (params.locale) query.set('locale', params.locale);\n if (params.customFieldsCollected) query.set('cf', '1');\n return `${path}?${query.toString()}`;\n}\n\n// --- Checkout entries --------------------------------------------------\n\nexport interface CheckoutEntryUrlParams {\n /** Base URL of the DeloPay hosted checkout, e.g. `https://checkout.delopay.net`. */\n checkoutBaseUrl: string;\n merchantId: string;\n paymentId: string;\n /** The payment's `payment_link.payment_link_id`; see {@link FocusedCheckoutUrlParams.paymentLinkId}. */\n paymentLinkId?: string | null;\n /** The entry's `key`, as configured on the shop (`CheckoutEntry.key`). */\n entry: string;\n /** Optional buyer locale, forwarded as `?locale=`. */\n locale?: string;\n}\n\n/**\n * The link to one of the shop's **checkout entries** for a payment: the hosted\n * checkout with `?entry=<key>`, showing only that entry's methods in its\n * named look. Every entry of one payment charges the same payment, so the\n * buyer can move between them and still pays once.\n *\n * A `card` entry is meant for an iframe in your own page\n * (`<iframe src={checkoutEntryUrl(...)} allow=\"payment\">`, with your page's\n * origin in the shop's iframe origins). Its \"Other payment methods\" action\n * opens the entry the shop configured in a new tab, and also posts\n * {@link CheckoutOpenEntryMessage} to your page, so you can navigate yourself\n * instead. Give a sandboxed iframe `allow-popups` and\n * `allow-popups-to-escape-sandbox`, or the tab is refused and the buyer gets\n * a plain link. Open a `methods` entry at the top level.\n *\n * An entry key the shop does not have, and an entry with nothing for this\n * payment, show an explanation and no methods: an entry never falls back to\n * the full checkout.\n */\nexport function checkoutEntryUrl(params: CheckoutEntryUrlParams): string {\n const base = params.checkoutBaseUrl.replace(/\\/+$/, '');\n const path =\n params.paymentLinkId && OPAQUE_PAYMENT_LINK_ID.test(params.paymentLinkId)\n ? `${base}/pay/${params.paymentLinkId}`\n : `${base}/pay/${encodeURIComponent(params.merchantId)}/${encodeURIComponent(\n params.paymentId,\n )}`;\n const query = new URLSearchParams({ entry: params.entry.trim() });\n if (params.locale) query.set('locale', params.locale);\n return `${path}?${query.toString()}`;\n}\n\n/**\n * What an embedded card entry posts to your page when the buyer presses\n * \"Other payment methods\": the payment, the entry the shop configured and its\n * link. Sent only to the shop's iframe origins. `source` names the sending\n * checkout and follows the deployment's branding, so match on `type`.\n */\nexport interface CheckoutOpenEntryMessage {\n source: string;\n type: 'open_entry';\n payment_id: string;\n entry: string;\n url: string;\n}\n\n/** Whether a `message` event's `data` is a {@link CheckoutOpenEntryMessage}. */\nexport function isCheckoutOpenEntryMessage(data: unknown): data is CheckoutOpenEntryMessage {\n if (typeof data !== 'object' || data === null) return false;\n const message = data as Record<string, unknown>;\n return (\n message.type === 'open_entry' &&\n typeof message.source === 'string' &&\n typeof message.payment_id === 'string' &&\n typeof message.entry === 'string' &&\n typeof message.url === 'string'\n );\n}\n\n// --- Buyer-side checkout events ----------------------------------------\n\n/**\n * The closed vocabulary of buyer-side checkout events recorded on the payment's\n * status timeline. Written through\n * `POST /payment-link/{merchant_id}/{payment_id}/checkout-events`, authorized\n * with the payment's `client_secret` as a bearer token.\n *\n * The `native_pane_` prefix is the router's enum on the wire and does not move\n * with the rename — see the module header.\n */\nexport const CHECKOUT_EVENT_KINDS = [\n 'native_pane_selected',\n 'native_pane_tab_opened',\n 'native_pane_tab_blocked',\n 'native_pane_abandoned',\n 'native_pane_returned',\n 'checkout_cancelled',\n] as const;\n\nexport type CheckoutEventKind = (typeof CHECKOUT_EVENT_KINDS)[number];\n\n// --- Deprecated aliases -------------------------------------------------\n//\n// The pre-0.109.0 names, kept so an external `@delopay/sdk` consumer upgrades\n// on their own schedule rather than on ours. **Scheduled for removal in\n// 0.112.0** — see CHANGELOG.md. Nothing in this repo uses them.\n\n/** @deprecated Renamed to {@link Pane}. Removed in 0.112.0. */\nexport type StripeNativePane = Pane;\n/** @deprecated Renamed to {@link PaneView}. Removed in 0.112.0. */\nexport type NativePaneView = PaneView;\n/** @deprecated Renamed to {@link PaneVisibility}. Removed in 0.112.0. */\nexport type NativePaneVisibility = PaneVisibility;\n/** @deprecated Renamed to {@link PaneOpenTarget}. Removed in 0.112.0. */\nexport type NativePaneOpenTarget = PaneOpenTarget;\n/** @deprecated Spelt {@link PaneNativeElement} on the SDK side. Removed in 0.112.0. */\nexport type NativePaneNativeElement = PaneNativeElement;\n/**\n * @deprecated Superseded by {@link PaneMethodInfo}. Removed in 0.112.0.\n *\n * Deliberately **not** an alias of `PaneMethodInfo`: that type gained three\n * required routing fields (`paymentMethod`, `paymentMethodType`,\n * `requiresBillingCountry`), and a consumer who wrote an object literal or a\n * function return against the 0.108 shape would stop compiling on a deprecated\n * name that promises the opposite. This stays the six fields that shape had.\n *\n * `PaneMethodInfo` is structurally assignable to it, so everything this SDK\n * hands back — including {@link nativePaneMethodInfo} — still satisfies it.\n */\nexport interface NativePaneMethodInfo {\n key: string;\n rail: PaneRail;\n /** Catalogue default label, shown as the editor's placeholder. */\n defaultLabel: string;\n /** Catalogue default sub-text. */\n defaultSublabel: string;\n /** Catalogue default section. */\n defaultCategory: string;\n /** Catalogue default icon key. */\n defaultIcon: string;\n}\n\n/**\n * @deprecated Renamed to {@link STRIPE_FALLBACK_PANE_METHODS}, which is a\n * degradation path and not a catalogue mirror. Removed in 0.112.0.\n */\nexport const STRIPE_NATIVE_PANE_METHODS = STRIPE_FALLBACK_PANE_METHODS;\n/** @deprecated Renamed to {@link PANE_ICON_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_ICON_KEYS = PANE_ICON_KEYS;\n/** @deprecated Renamed to {@link PANE_CATEGORY_KEYS}. Removed in 0.112.0. */\nexport const NATIVE_PANE_CATEGORY_KEYS = PANE_CATEGORY_KEYS;\n/** @deprecated Renamed to {@link PANES_MAX}. Removed in 0.112.0. */\nexport const NATIVE_PANES_MAX = PANES_MAX;\n\n/**\n * @deprecated Superseded by {@link paneMethodInfo}, which takes the connector's\n * catalogue and answers for every connector rather than only for Stripe.\n * Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old return type: it answers out of the frozen Stripe table and carries that\n * table's compiled copy, which the live catalogue deliberately does not have.\n */\nexport function nativePaneMethodInfo(method: string): PaneMethodInfo | undefined {\n return STRIPE_FALLBACK_PANE_METHODS.find((info) => info.key === method);\n}\n\n/**\n * @deprecated Superseded by {@link defaultPane}. Removed in 0.112.0.\n *\n * Kept as its own function rather than as an alias because it must keep its\n * old behaviour: it leaves `category` empty and resolves `icon` out of the\n * frozen Stripe table only. `defaultPane` fills both from the connector's\n * catalogue, which is the fix — but a caller on the old name encodes whatever\n * it is handed, and quietly turning a blank field into a stored override is\n * not something a deprecated alias should do to a merchant's saved config.\n */\nexport function defaultNativePane(method: string): Pane {\n const info = nativePaneMethodInfo(method);\n return {\n ...defaultPane(method),\n category: '',\n icon: info?.defaultIcon ?? '',\n };\n}\n\n/** @deprecated Renamed to {@link clonePane}. Removed in 0.112.0. */\nexport const cloneNativePane = clonePane;\n/** @deprecated Renamed to {@link decodePanes}. Removed in 0.112.0. */\nexport const decodeNativePanes = decodePanes;\n/** @deprecated Renamed to {@link encodePanes}. Removed in 0.112.0. */\nexport const encodeNativePanes = encodePanes;\n"]}