@aglyn/plugins-commerce 1.0.0-beta.285 → 1.0.0-beta.288

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 (430) hide show
  1. package/README.md +1 -1
  2. package/package.json +13 -13
  3. package/src/lib/components/cart.js +25 -12
  4. package/src/lib/components/cart.js.map +1 -1
  5. package/src/lib/components/commerce-console-page.js +70 -13
  6. package/src/lib/components/commerce-console-page.js.map +1 -1
  7. package/src/lib/components/console/order-detail-dialog.component.js +2 -1
  8. package/src/lib/components/console/order-detail-dialog.component.js.map +1 -1
  9. package/src/lib/components/console/order-webhooks-card.component.js +1 -1
  10. package/src/lib/components/console/order-webhooks-card.component.js.map +1 -1
  11. package/src/lib/components/console/payment-methods-card.component.js +1 -1
  12. package/src/lib/components/console/payment-methods-card.component.js.map +1 -1
  13. package/src/lib/components/console/pos/pos-cart-panel.component.d.ts +5 -0
  14. package/src/lib/components/console/pos/pos-cart-panel.component.js +18 -12
  15. package/src/lib/components/console/pos/pos-cart-panel.component.js.map +1 -1
  16. package/src/lib/components/console/pos/pos-hardware-api.d.ts +76 -5
  17. package/src/lib/components/console/pos/pos-hardware-api.js +53 -11
  18. package/src/lib/components/console/pos/pos-hardware-api.js.map +1 -1
  19. package/src/lib/components/console/pos/pos-hardware-buyer.component.d.ts +18 -0
  20. package/src/lib/components/console/pos/pos-hardware-buyer.component.js +629 -0
  21. package/src/lib/components/console/pos/pos-hardware-buyer.component.js.map +1 -0
  22. package/src/lib/components/console/pos/pos-hardware-sale-api.d.ts +162 -0
  23. package/src/lib/components/console/pos/pos-hardware-sale-api.js +122 -0
  24. package/src/lib/components/console/pos/pos-hardware-sale-api.js.map +1 -0
  25. package/src/lib/components/console/pos/pos-hardware-sale-terms.component.d.ts +39 -0
  26. package/src/lib/components/console/pos/pos-hardware-sale-terms.component.js +251 -0
  27. package/src/lib/components/console/pos/pos-hardware-sale-terms.component.js.map +1 -0
  28. package/src/lib/components/console/pos/use-pos-display.js +50 -0
  29. package/src/lib/components/console/pos/use-pos-display.js.map +1 -1
  30. package/src/lib/components/console/pos-cellular-control.component.d.ts +41 -0
  31. package/src/lib/components/console/pos-cellular-control.component.js +211 -0
  32. package/src/lib/components/console/pos-cellular-control.component.js.map +1 -0
  33. package/src/lib/components/console/pos-devices-card.component.d.ts +9 -1
  34. package/src/lib/components/console/pos-devices-card.component.js +47 -15
  35. package/src/lib/components/console/pos-devices-card.component.js.map +1 -1
  36. package/src/lib/components/console/pos-display/pos-display-api.d.ts +6 -0
  37. package/src/lib/components/console/pos-display/pos-display-api.js +8 -1
  38. package/src/lib/components/console/pos-display/pos-display-api.js.map +1 -1
  39. package/src/lib/components/console/pos-display-page.component.d.ts +13 -0
  40. package/src/lib/components/console/pos-display-page.component.js +44 -2
  41. package/src/lib/components/console/pos-display-page.component.js.map +1 -1
  42. package/src/lib/components/console/pos-hardware-card.component.d.ts +12 -4
  43. package/src/lib/components/console/pos-hardware-card.component.js +157 -36
  44. package/src/lib/components/console/pos-hardware-card.component.js.map +1 -1
  45. package/src/lib/components/console/pos-hardware-orders-staff-page.component.js +360 -80
  46. package/src/lib/components/console/pos-hardware-orders-staff-page.component.js.map +1 -1
  47. package/src/lib/components/console/pos-hardware-terms-page.component.d.ts +34 -0
  48. package/src/lib/components/console/pos-hardware-terms-page.component.js +257 -0
  49. package/src/lib/components/console/pos-hardware-terms-page.component.js.map +1 -0
  50. package/src/lib/components/console/pos-hardware-terms-sign-page.component.d.ts +27 -0
  51. package/src/lib/components/console/pos-hardware-terms-sign-page.component.js +104 -0
  52. package/src/lib/components/console/pos-hardware-terms-sign-page.component.js.map +1 -0
  53. package/src/lib/components/console/pos-hardware-waiting-card.component.d.ts +24 -0
  54. package/src/lib/components/console/pos-hardware-waiting-card.component.js +205 -0
  55. package/src/lib/components/console/pos-hardware-waiting-card.component.js.map +1 -0
  56. package/src/lib/components/console/pos-ops/pos-check-in-dialog.component.js +297 -201
  57. package/src/lib/components/console/pos-ops/pos-check-in-dialog.component.js.map +1 -1
  58. package/src/lib/components/console/pos-ops/pos-check-ins-card.component.d.ts +3 -0
  59. package/src/lib/components/console/pos-ops/pos-check-ins-card.component.js +260 -92
  60. package/src/lib/components/console/pos-ops/pos-check-ins-card.component.js.map +1 -1
  61. package/src/lib/components/console/pos-ops/pos-operations-bar.component.d.ts +9 -0
  62. package/src/lib/components/console/pos-ops/pos-operations-bar.component.js +15 -6
  63. package/src/lib/components/console/pos-ops/pos-operations-bar.component.js.map +1 -1
  64. package/src/lib/components/console/pos-ops/pos-rain-check-dialog.component.d.ts +25 -0
  65. package/src/lib/components/console/pos-ops/pos-rain-check-dialog.component.js +136 -0
  66. package/src/lib/components/console/pos-ops/pos-rain-check-dialog.component.js.map +1 -0
  67. package/src/lib/components/console/pos-ops/pos-shift-panel.component.d.ts +6 -0
  68. package/src/lib/components/console/pos-ops/pos-shift-panel.component.js +48 -31
  69. package/src/lib/components/console/pos-ops/pos-shift-panel.component.js.map +1 -1
  70. package/src/lib/components/console/pos-page.component.d.ts +1 -1
  71. package/src/lib/components/console/pos-page.component.js +63 -12
  72. package/src/lib/components/console/pos-page.component.js.map +1 -1
  73. package/src/lib/components/console/pos-reader-splash-setting.component.js +1 -1
  74. package/src/lib/components/console/pos-reader-splash-setting.component.js.map +1 -1
  75. package/src/lib/components/console/product-check-in-fields.component.d.ts +4 -2
  76. package/src/lib/components/console/product-check-in-fields.component.js +60 -14
  77. package/src/lib/components/console/product-check-in-fields.component.js.map +1 -1
  78. package/src/lib/components/console/product-editor-dialog.component.js +44 -1
  79. package/src/lib/components/console/product-editor-dialog.component.js.map +1 -1
  80. package/src/lib/components/console/product-hardware-sku-field.component.d.ts +19 -0
  81. package/src/lib/components/console/product-hardware-sku-field.component.js +92 -0
  82. package/src/lib/components/console/product-hardware-sku-field.component.js.map +1 -0
  83. package/src/lib/components/console/product-kiosk-offer-field.component.d.ts +22 -0
  84. package/src/lib/components/console/product-kiosk-offer-field.component.js +94 -0
  85. package/src/lib/components/console/product-kiosk-offer-field.component.js.map +1 -0
  86. package/src/lib/components/console/product-register-fields.component.d.ts +4 -0
  87. package/src/lib/components/console/product-register-fields.component.js +31 -2
  88. package/src/lib/components/console/product-register-fields.component.js.map +1 -1
  89. package/src/lib/components/console/products-hub-card.component.js +11 -2
  90. package/src/lib/components/console/products-hub-card.component.js.map +1 -1
  91. package/src/lib/components/console/register-hardware-card.component.d.ts +11 -0
  92. package/src/lib/components/console/register-hardware-card.component.js +56 -27
  93. package/src/lib/components/console/register-hardware-card.component.js.map +1 -1
  94. package/src/lib/components/console/reservation-guests-dialog.component.d.ts +28 -0
  95. package/src/lib/components/console/reservation-guests-dialog.component.js +189 -0
  96. package/src/lib/components/console/reservation-guests-dialog.component.js.map +1 -0
  97. package/src/lib/components/console/reservations-card.component.d.ts +9 -0
  98. package/src/lib/components/console/reservations-card.component.js +158 -23
  99. package/src/lib/components/console/reservations-card.component.js.map +1 -1
  100. package/src/lib/components/console/shippingeasy-card.component.js +1 -1
  101. package/src/lib/components/console/shippingeasy-card.component.js.map +1 -1
  102. package/src/lib/components/console/shipstation-card.component.d.ts +1 -1
  103. package/src/lib/components/console/shipstation-card.component.js +3 -3
  104. package/src/lib/components/console/shipstation-card.component.js.map +1 -1
  105. package/src/lib/components/product-detail.d.ts +4 -0
  106. package/src/lib/components/product-detail.js +40 -5
  107. package/src/lib/components/product-detail.js.map +1 -1
  108. package/src/lib/components/product-reviews.js +28 -11
  109. package/src/lib/components/product-reviews.js.map +1 -1
  110. package/src/lib/components/reservation-widget.js +28 -5
  111. package/src/lib/components/reservation-widget.js.map +1 -1
  112. package/src/lib/components/use-day-picker.d.ts +25 -0
  113. package/src/lib/components/use-day-picker.js +57 -0
  114. package/src/lib/components/use-day-picker.js.map +1 -0
  115. package/src/lib/constants/operator-alerts.d.ts +55 -0
  116. package/src/lib/constants/operator-alerts.js +156 -1
  117. package/src/lib/constants/operator-alerts.js.map +1 -1
  118. package/src/lib/declarations.console-server.js +54 -1
  119. package/src/lib/declarations.console-server.js.map +1 -1
  120. package/src/lib/declarations.d.ts +4 -2
  121. package/src/lib/declarations.js +15 -4
  122. package/src/lib/declarations.js.map +1 -1
  123. package/src/lib/declarations.server.js +9 -0
  124. package/src/lib/declarations.server.js.map +1 -1
  125. package/src/lib/model/commerce-cart.d.ts +9 -1
  126. package/src/lib/model/commerce-cart.js +4 -3
  127. package/src/lib/model/commerce-cart.js.map +1 -1
  128. package/src/lib/model/commerce-check-in-product.d.ts +26 -0
  129. package/src/lib/model/commerce-check-in-product.js +64 -2
  130. package/src/lib/model/commerce-check-in-product.js.map +1 -1
  131. package/src/lib/model/commerce-check-in-record.d.ts +127 -0
  132. package/src/lib/model/commerce-check-in-record.js +36 -0
  133. package/src/lib/model/commerce-check-in-record.js.map +1 -0
  134. package/src/lib/model/commerce-check-in.d.ts +91 -87
  135. package/src/lib/model/commerce-check-in.js +186 -62
  136. package/src/lib/model/commerce-check-in.js.map +1 -1
  137. package/src/lib/model/commerce-kiosk-offer.d.ts +31 -0
  138. package/src/lib/model/commerce-kiosk-offer.js +35 -0
  139. package/src/lib/model/commerce-kiosk-offer.js.map +1 -0
  140. package/src/lib/model/commerce-orders.d.ts +76 -0
  141. package/src/lib/model/commerce-orders.js +6 -0
  142. package/src/lib/model/commerce-orders.js.map +1 -1
  143. package/src/lib/model/commerce-pos-day-report.d.ts +54 -1
  144. package/src/lib/model/commerce-pos-day-report.js +39 -2
  145. package/src/lib/model/commerce-pos-day-report.js.map +1 -1
  146. package/src/lib/model/commerce-pos-offline.d.ts +1 -1
  147. package/src/lib/model/commerce-pos-offline.js +6 -1
  148. package/src/lib/model/commerce-pos-offline.js.map +1 -1
  149. package/src/lib/model/commerce-pos-ops.js +3 -2
  150. package/src/lib/model/commerce-pos-ops.js.map +1 -1
  151. package/src/lib/model/commerce-pos.d.ts +36 -3
  152. package/src/lib/model/commerce-pos.js +14 -6
  153. package/src/lib/model/commerce-pos.js.map +1 -1
  154. package/src/lib/model/commerce-receipt.js +3 -2
  155. package/src/lib/model/commerce-receipt.js.map +1 -1
  156. package/src/lib/model/commerce-reservations.d.ts +69 -4
  157. package/src/lib/model/commerce-reservations.js +57 -5
  158. package/src/lib/model/commerce-reservations.js.map +1 -1
  159. package/src/lib/model/commerce.d.ts +66 -0
  160. package/src/lib/model/commerce.js +15 -0
  161. package/src/lib/model/commerce.js.map +1 -1
  162. package/src/lib/model/order-list-fields.d.ts +11 -0
  163. package/src/lib/model/order-list-fields.js +17 -1
  164. package/src/lib/model/order-list-fields.js.map +1 -1
  165. package/src/lib/model/own-store-tax-summary.d.ts +152 -0
  166. package/src/lib/model/own-store-tax-summary.js +288 -0
  167. package/src/lib/model/own-store-tax-summary.js.map +1 -0
  168. package/src/lib/model/plugin-permissions.d.ts +74 -0
  169. package/src/lib/model/plugin-permissions.js +224 -7
  170. package/src/lib/model/plugin-permissions.js.map +1 -1
  171. package/src/lib/model/pos-cellular.d.ts +223 -0
  172. package/src/lib/model/pos-cellular.js +293 -0
  173. package/src/lib/model/pos-cellular.js.map +1 -0
  174. package/src/lib/model/pos-hardware-in-person.d.ts +98 -0
  175. package/src/lib/model/pos-hardware-in-person.js +224 -0
  176. package/src/lib/model/pos-hardware-in-person.js.map +1 -0
  177. package/src/lib/model/pos-hardware-tax-summary.d.ts +166 -0
  178. package/src/lib/model/pos-hardware-tax-summary.js +225 -0
  179. package/src/lib/model/pos-hardware-tax-summary.js.map +1 -0
  180. package/src/lib/model/pos-hardware-terms.d.ts +74 -0
  181. package/src/lib/model/pos-hardware-terms.js +115 -0
  182. package/src/lib/model/pos-hardware-terms.js.map +1 -0
  183. package/src/lib/model/pos-hardware.d.ts +349 -7
  184. package/src/lib/model/pos-hardware.js +291 -20
  185. package/src/lib/model/pos-hardware.js.map +1 -1
  186. package/src/lib/model/product-write.d.ts +10 -0
  187. package/src/lib/model/product-write.js +4 -2
  188. package/src/lib/model/product-write.js.map +1 -1
  189. package/src/lib/model/workspace-site-permissions.d.ts +26 -0
  190. package/src/lib/model/workspace-site-permissions.js +81 -0
  191. package/src/lib/model/workspace-site-permissions.js.map +1 -0
  192. package/src/lib/plugin.js +16 -0
  193. package/src/lib/plugin.js.map +1 -1
  194. package/src/lib/server/billing-webhook.js +25 -1
  195. package/src/lib/server/billing-webhook.js.map +1 -1
  196. package/src/lib/server/cancel-order.js +7 -5
  197. package/src/lib/server/cancel-order.js.map +1 -1
  198. package/src/lib/server/cart-checkout.js +20 -8
  199. package/src/lib/server/cart-checkout.js.map +1 -1
  200. package/src/lib/server/cart.js +29 -0
  201. package/src/lib/server/cart.js.map +1 -1
  202. package/src/lib/server/checkout.js +42 -13
  203. package/src/lib/server/checkout.js.map +1 -1
  204. package/src/lib/server/collection-membership.d.ts +4 -0
  205. package/src/lib/server/collection-membership.js +5 -10
  206. package/src/lib/server/collection-membership.js.map +1 -1
  207. package/src/lib/server/commerce-site-keys.d.ts +48 -0
  208. package/src/lib/server/commerce-site-keys.js +61 -0
  209. package/src/lib/server/commerce-site-keys.js.map +1 -0
  210. package/src/lib/server/draft-order.js +8 -5
  211. package/src/lib/server/draft-order.js.map +1 -1
  212. package/src/lib/server/fulfill-order.js +7 -5
  213. package/src/lib/server/fulfill-order.js.map +1 -1
  214. package/src/lib/server/gift-cards.js +8 -5
  215. package/src/lib/server/gift-cards.js.map +1 -1
  216. package/src/lib/server/local-fulfillment-status.js +9 -6
  217. package/src/lib/server/local-fulfillment-status.js.map +1 -1
  218. package/src/lib/server/member-post.js +6 -5
  219. package/src/lib/server/member-post.js.map +1 -1
  220. package/src/lib/server/membership-admin-password.d.ts +4 -2
  221. package/src/lib/server/membership-admin-password.js +10 -8
  222. package/src/lib/server/membership-admin-password.js.map +1 -1
  223. package/src/lib/server/membership-admin-remove.d.ts +7 -5
  224. package/src/lib/server/membership-admin-remove.js +9 -9
  225. package/src/lib/server/membership-admin-remove.js.map +1 -1
  226. package/src/lib/server/order-notifications.js +5 -2
  227. package/src/lib/server/order-notifications.js.map +1 -1
  228. package/src/lib/server/order-print.js +7 -5
  229. package/src/lib/server/order-print.js.map +1 -1
  230. package/src/lib/server/order-receipt-send.js +8 -5
  231. package/src/lib/server/order-receipt-send.js.map +1 -1
  232. package/src/lib/server/order-webhooks.js +8 -8
  233. package/src/lib/server/order-webhooks.js.map +1 -1
  234. package/src/lib/server/orders-shipping-prepare.js +9 -6
  235. package/src/lib/server/orders-shipping-prepare.js.map +1 -1
  236. package/src/lib/server/own-store-tax-return-source.d.ts +47 -0
  237. package/src/lib/server/own-store-tax-return-source.js +312 -0
  238. package/src/lib/server/own-store-tax-return-source.js.map +1 -0
  239. package/src/lib/server/payment-methods.js +13 -9
  240. package/src/lib/server/payment-methods.js.map +1 -1
  241. package/src/lib/server/pos-auth.d.ts +37 -6
  242. package/src/lib/server/pos-auth.js +40 -15
  243. package/src/lib/server/pos-auth.js.map +1 -1
  244. package/src/lib/server/pos-cellular-billing.d.ts +81 -0
  245. package/src/lib/server/pos-cellular-billing.js +711 -0
  246. package/src/lib/server/pos-cellular-billing.js.map +1 -0
  247. package/src/lib/server/pos-cellular-notify.d.ts +47 -0
  248. package/src/lib/server/pos-cellular-notify.js +150 -0
  249. package/src/lib/server/pos-cellular-notify.js.map +1 -0
  250. package/src/lib/server/pos-cellular.d.ts +88 -0
  251. package/src/lib/server/pos-cellular.js +339 -0
  252. package/src/lib/server/pos-cellular.js.map +1 -0
  253. package/src/lib/server/pos-check-in.d.ts +5 -1
  254. package/src/lib/server/pos-check-in.js +296 -28
  255. package/src/lib/server/pos-check-in.js.map +1 -1
  256. package/src/lib/server/pos-day-report.js +29 -3
  257. package/src/lib/server/pos-day-report.js.map +1 -1
  258. package/src/lib/server/pos-display.d.ts +16 -0
  259. package/src/lib/server/pos-display.js +129 -2
  260. package/src/lib/server/pos-display.js.map +1 -1
  261. package/src/lib/server/pos-hardware-admin.d.ts +10 -1
  262. package/src/lib/server/pos-hardware-admin.js +250 -84
  263. package/src/lib/server/pos-hardware-admin.js.map +1 -1
  264. package/src/lib/server/pos-hardware-attach.d.ts +105 -0
  265. package/src/lib/server/pos-hardware-attach.js +443 -0
  266. package/src/lib/server/pos-hardware-attach.js.map +1 -0
  267. package/src/lib/server/pos-hardware-buyer-lookup.d.ts +58 -0
  268. package/src/lib/server/pos-hardware-buyer-lookup.js +180 -0
  269. package/src/lib/server/pos-hardware-buyer-lookup.js.map +1 -0
  270. package/src/lib/server/pos-hardware-buyer-record.d.ts +29 -0
  271. package/src/lib/server/pos-hardware-buyer-record.js +86 -0
  272. package/src/lib/server/pos-hardware-buyer-record.js.map +1 -0
  273. package/src/lib/server/pos-hardware-cancel.d.ts +58 -0
  274. package/src/lib/server/pos-hardware-cancel.js +147 -0
  275. package/src/lib/server/pos-hardware-cancel.js.map +1 -0
  276. package/src/lib/server/pos-hardware-closure-notices.d.ts +27 -0
  277. package/src/lib/server/pos-hardware-closure-notices.js +85 -0
  278. package/src/lib/server/pos-hardware-closure-notices.js.map +1 -0
  279. package/src/lib/server/pos-hardware-closure.d.ts +60 -0
  280. package/src/lib/server/pos-hardware-closure.js +153 -0
  281. package/src/lib/server/pos-hardware-closure.js.map +1 -0
  282. package/src/lib/server/pos-hardware-in-person.d.ts +61 -0
  283. package/src/lib/server/pos-hardware-in-person.js +236 -0
  284. package/src/lib/server/pos-hardware-in-person.js.map +1 -0
  285. package/src/lib/server/pos-hardware-notify.d.ts +40 -2
  286. package/src/lib/server/pos-hardware-notify.js +195 -14
  287. package/src/lib/server/pos-hardware-notify.js.map +1 -1
  288. package/src/lib/server/pos-hardware-readers.d.ts +115 -0
  289. package/src/lib/server/pos-hardware-readers.js +430 -0
  290. package/src/lib/server/pos-hardware-readers.js.map +1 -0
  291. package/src/lib/server/pos-hardware-returns.d.ts +116 -0
  292. package/src/lib/server/pos-hardware-returns.js +502 -0
  293. package/src/lib/server/pos-hardware-returns.js.map +1 -0
  294. package/src/lib/server/pos-hardware-sale-fields.d.ts +28 -0
  295. package/src/lib/server/pos-hardware-sale-fields.js +44 -0
  296. package/src/lib/server/pos-hardware-sale-fields.js.map +1 -0
  297. package/src/lib/server/pos-hardware-sale.d.ts +54 -0
  298. package/src/lib/server/pos-hardware-sale.js +369 -0
  299. package/src/lib/server/pos-hardware-sale.js.map +1 -0
  300. package/src/lib/server/pos-hardware-tax-return-source.d.ts +99 -0
  301. package/src/lib/server/pos-hardware-tax-return-source.js +462 -0
  302. package/src/lib/server/pos-hardware-tax-return-source.js.map +1 -0
  303. package/src/lib/server/pos-hardware-terms.d.ts +64 -0
  304. package/src/lib/server/pos-hardware-terms.js +154 -0
  305. package/src/lib/server/pos-hardware-terms.js.map +1 -0
  306. package/src/lib/server/pos-hardware-user-eraser.d.ts +3 -0
  307. package/src/lib/server/pos-hardware-user-eraser.js +31 -7
  308. package/src/lib/server/pos-hardware-user-eraser.js.map +1 -1
  309. package/src/lib/server/pos-hardware-webhook.d.ts +5 -0
  310. package/src/lib/server/pos-hardware-webhook.js +51 -6
  311. package/src/lib/server/pos-hardware-webhook.js.map +1 -1
  312. package/src/lib/server/pos-hardware.d.ts +74 -1
  313. package/src/lib/server/pos-hardware.js +175 -10
  314. package/src/lib/server/pos-hardware.js.map +1 -1
  315. package/src/lib/server/pos-kiosk.d.ts +2 -0
  316. package/src/lib/server/pos-kiosk.js +17 -12
  317. package/src/lib/server/pos-kiosk.js.map +1 -1
  318. package/src/lib/server/pos-offline-card-order.d.ts +64 -0
  319. package/src/lib/server/pos-offline-card-order.js +102 -0
  320. package/src/lib/server/pos-offline-card-order.js.map +1 -0
  321. package/src/lib/server/pos-offline-card-reconcile.d.ts +67 -1
  322. package/src/lib/server/pos-offline-card-reconcile.js +215 -18
  323. package/src/lib/server/pos-offline-card-reconcile.js.map +1 -1
  324. package/src/lib/server/pos-offline-sync.d.ts +39 -0
  325. package/src/lib/server/pos-offline-sync.js +190 -55
  326. package/src/lib/server/pos-offline-sync.js.map +1 -1
  327. package/src/lib/server/pos-ops-gate.d.ts +28 -9
  328. package/src/lib/server/pos-ops-gate.js +50 -19
  329. package/src/lib/server/pos-ops-gate.js.map +1 -1
  330. package/src/lib/server/pos-ops-routes.js +24 -0
  331. package/src/lib/server/pos-ops-routes.js.map +1 -1
  332. package/src/lib/server/pos-order-refund-ids.d.ts +28 -0
  333. package/src/lib/server/pos-order-refund-ids.js +31 -0
  334. package/src/lib/server/pos-order-refund-ids.js.map +1 -0
  335. package/src/lib/server/pos-order.js +52 -49
  336. package/src/lib/server/pos-order.js.map +1 -1
  337. package/src/lib/server/pos-payment.js +1 -1
  338. package/src/lib/server/pos-payment.js.map +1 -1
  339. package/src/lib/server/pos-reader-splash-admin.js +30 -32
  340. package/src/lib/server/pos-reader-splash-admin.js.map +1 -1
  341. package/src/lib/server/pos-reader-splash-images-route.d.ts +17 -0
  342. package/src/lib/server/pos-reader-splash-images-route.js +113 -0
  343. package/src/lib/server/pos-reader-splash-images-route.js.map +1 -0
  344. package/src/lib/server/pos-reader-splash-images.d.ts +51 -0
  345. package/src/lib/server/pos-reader-splash-images.js +123 -0
  346. package/src/lib/server/pos-reader-splash-images.js.map +1 -0
  347. package/src/lib/server/pos-reader-splash.d.ts +68 -1
  348. package/src/lib/server/pos-reader-splash.js +182 -11
  349. package/src/lib/server/pos-reader-splash.js.map +1 -1
  350. package/src/lib/server/pos-readers.d.ts +29 -0
  351. package/src/lib/server/pos-readers.js +134 -35
  352. package/src/lib/server/pos-readers.js.map +1 -1
  353. package/src/lib/server/pos-refund-authority.d.ts +3 -1
  354. package/src/lib/server/pos-refund-authority.js +3 -2
  355. package/src/lib/server/pos-refund-authority.js.map +1 -1
  356. package/src/lib/server/pos-return.d.ts +10 -0
  357. package/src/lib/server/pos-return.js +29 -7
  358. package/src/lib/server/pos-return.js.map +1 -1
  359. package/src/lib/server/pos-sale.js +6 -1
  360. package/src/lib/server/pos-sale.js.map +1 -1
  361. package/src/lib/server/pos-shift.js +11 -0
  362. package/src/lib/server/pos-shift.js.map +1 -1
  363. package/src/lib/server/pos-staff-pin.js +29 -24
  364. package/src/lib/server/pos-staff-pin.js.map +1 -1
  365. package/src/lib/server/pos-terminal.d.ts +14 -4
  366. package/src/lib/server/pos-terminal.js +34 -38
  367. package/src/lib/server/pos-terminal.js.map +1 -1
  368. package/src/lib/server/printers.d.ts +7 -3
  369. package/src/lib/server/printers.js +18 -12
  370. package/src/lib/server/printers.js.map +1 -1
  371. package/src/lib/server/product-drafts.d.ts +11 -1
  372. package/src/lib/server/product-drafts.js +12 -8
  373. package/src/lib/server/product-drafts.js.map +1 -1
  374. package/src/lib/server/product.d.ts +15 -1
  375. package/src/lib/server/product.js +16 -3
  376. package/src/lib/server/product.js.map +1 -1
  377. package/src/lib/server/products-write.d.ts +26 -2
  378. package/src/lib/server/products-write.js +19 -7
  379. package/src/lib/server/products-write.js.map +1 -1
  380. package/src/lib/server/refund.js +55 -42
  381. package/src/lib/server/refund.js.map +1 -1
  382. package/src/lib/server/reservation-availability-query.d.ts +8 -0
  383. package/src/lib/server/reservation-availability-query.js +11 -1
  384. package/src/lib/server/reservation-availability-query.js.map +1 -1
  385. package/src/lib/server/reservation-availability.d.ts +1 -1
  386. package/src/lib/server/reservation-availability.js +7 -2
  387. package/src/lib/server/reservation-availability.js.map +1 -1
  388. package/src/lib/server/reservation-guests.d.ts +32 -0
  389. package/src/lib/server/reservation-guests.js +285 -0
  390. package/src/lib/server/reservation-guests.js.map +1 -0
  391. package/src/lib/server/reservation-walk-in.d.ts +11 -1
  392. package/src/lib/server/reservation-walk-in.js +56 -12
  393. package/src/lib/server/reservation-walk-in.js.map +1 -1
  394. package/src/lib/server/reserve.js +18 -5
  395. package/src/lib/server/reserve.js.map +1 -1
  396. package/src/lib/server/returns.js +9 -6
  397. package/src/lib/server/returns.js.map +1 -1
  398. package/src/lib/server/reviews.d.ts +22 -2
  399. package/src/lib/server/reviews.js +88 -20
  400. package/src/lib/server/reviews.js.map +1 -1
  401. package/src/lib/server/shipping-connectors.js +10 -11
  402. package/src/lib/server/shipping-connectors.js.map +1 -1
  403. package/src/lib/server/site-page-resolver.js +20 -3
  404. package/src/lib/server/site-page-resolver.js.map +1 -1
  405. package/src/lib/server/store-day.d.ts +33 -0
  406. package/src/lib/server/store-day.js +46 -0
  407. package/src/lib/server/store-day.js.map +1 -0
  408. package/src/lib/server/store-setup-ai-writer.d.ts +2 -1
  409. package/src/lib/server/store-setup-ai-writer.js +5 -6
  410. package/src/lib/server/store-setup-ai-writer.js.map +1 -1
  411. package/src/lib/server/storefront-tax.d.ts +13 -0
  412. package/src/lib/server/storefront-tax.js +8 -1
  413. package/src/lib/server/storefront-tax.js.map +1 -1
  414. package/src/lib/server/tax-return-source.d.ts +32 -3
  415. package/src/lib/server/tax-return-source.js +99 -20
  416. package/src/lib/server/tax-return-source.js.map +1 -1
  417. package/src/lib/server.js +100 -2
  418. package/src/lib/server.js.map +1 -1
  419. package/src/lib/testing/fake-firestore.js +58 -16
  420. package/src/lib/testing/fake-firestore.js.map +1 -1
  421. package/src/lib/testing/pos-ops-memory-firestore.js +18 -4
  422. package/src/lib/testing/pos-ops-memory-firestore.js.map +1 -1
  423. package/src/lib/testing/site-register-permissions.d.ts +29 -0
  424. package/src/lib/testing/site-register-permissions.js +38 -0
  425. package/src/lib/testing/site-register-permissions.js.map +1 -0
  426. package/src/lib/transfer/tracking.server.js +8 -5
  427. package/src/lib/transfer/tracking.server.js.map +1 -1
  428. package/src/lib/utils/add-to-cart.d.ts +2 -0
  429. package/src/lib/utils/add-to-cart.js +6 -3
  430. package/src/lib/utils/add-to-cart.js.map +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../libs/plugins/commerce/src/lib/components/console/pos/pos-hardware-buyer.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport {\n Alert,\n Box,\n Button,\n Chip,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n FormControlLabel,\n List,\n ListItem,\n ListItemText,\n Radio,\n RadioGroup,\n Stack,\n TextField,\n Typography,\n} from '@mui/material'\nimport { useEffect, useState, type FormEvent } from 'react'\nimport { formatPosHardwareCents } from '../../../model/pos-hardware'\nimport { PosHardwareRequestError } from './pos-hardware-api'\nimport { PosHardwareSaleTerms } from './pos-hardware-sale-terms.component'\nimport {\n posHardwareAttach,\n posHardwareFindBuyer,\n posHardwareRegisterAtBooth,\n posHardwareSaleStatus,\n posHardwareSerials,\n posHardwareToAttach,\n type BoothStoreAddress,\n type BuyerChoice,\n type BuyerFindResult,\n type BuyerWorkspace,\n type ToAttachRow,\n} from './pos-hardware-sale-api'\n\ntype User = Parameters<typeof posHardwareSaleStatus>[0]\ntype Notify = (message: string, variant: 'success' | 'info' | 'warning' | 'error') => void\n\nexport interface PosHardwareBuyerProps {\n user: User\n hostId: string\n /** The sale open (or just paid) on this register, when it has a card reader. */\n saleOrderId: string | null\n notify: Notify\n}\n\n/** One choice of where the hardware goes, keyed for the radio group. */\ninterface Option {\n key: string\n label: string\n detail: string | null\n choice: BuyerChoice\n /** A store chosen with no card reader location yet: the booth asks for its address. */\n needsAddress?: boolean\n}\n\n/** Where the attached sale's readers go, as the register needs to know it. */\ninterface AttachedStore {\n /** A store was chosen, so a reader can be registered to it here. */\n chosen: boolean\n /** That store has no card reader location yet, so registering asks for its address. */\n needsAddress: boolean\n}\n\n/** No store chosen yet: nothing to register a reader to here. */\nconst NO_STORE: AttachedStore = { chosen: false, needsAddress: false }\n\n/** The address form's start, as the POS devices card starts it. */\nconst EMPTY_ADDRESS: BoothStoreAddress = { line1: '', city: '', state: '', postalCode: '', country: 'US' }\n\nfunction newKey(): string {\n return `attach-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`\n}\n\n/** The ways one workspace can take the hardware: each store, or the store chosen at setup. */\nfunction workspaceOptions(uid: string, workspace: BuyerWorkspace, who: string): Option[] {\n const plan = workspace.posPlan ? null : 'No point of sale plan yet: they add it when they set the reader up'\n return [\n ...workspace.stores.map((store) => ({\n key: `${uid}:${workspace.orgId}:${store.hostId}`,\n label: `${who} · ${workspace.name} · ${store.name}`,\n detail:\n [plan, store.hasLocation ? null : 'No card reader location on this store yet: you can enter its address here'].filter(Boolean).join('. ') ||\n null,\n choice: { uid, orgId: workspace.orgId, hostId: store.hostId },\n needsAddress: !store.hasLocation,\n })),\n {\n key: `${uid}:${workspace.orgId}:`,\n label: `${who} · ${workspace.name} · choose the store at setup`,\n detail: plan,\n choice: { uid, orgId: workspace.orgId },\n },\n ]\n}\n\n/** Every option an answer offers, people first. */\nfunction optionsOf(found: BuyerFindResult): Option[] {\n const options: Option[] = []\n for (const person of found.people) {\n const who = `${person.name || 'No name'} (${person.email})`\n if (!person.workspaces.length) {\n options.push({\n key: `${person.uid}::`,\n label: `${who} · no workspace yet`,\n detail: 'It joins the workspace they create.',\n choice: { uid: person.uid },\n })\n }\n for (const workspace of person.workspaces) options.push(...workspaceOptions(person.uid, workspace, who))\n }\n for (const workspace of found.workspaces) {\n if (!workspace.owner) continue\n const who = `${workspace.owner.name || 'Owner'} (${workspace.owner.email})`\n for (const option of workspaceOptions(workspace.owner.uid, workspace, who)) {\n if (!options.some((held) => held.key === option.key)) options.push(option)\n }\n }\n return options\n}\n\n/**\n * Finding the buyer and saying whose the card reader is (AGL-4038): by an\n * exact email, a person's name or a workspace's name. Shows the least that\n * picks the right person — a name, their whole email address, each workspace\n * and its stores, and what each still needs — and, for an address with no\n * account, offers to sell anyway and invite them.\n */\nfunction AttachDialog(props: {\n user: User\n hostId: string\n target: { registerOrderId: string } | { orderId: string; row: ToAttachRow }\n onClose: () => void\n onAttached: (message: string, store: AttachedStore) => void\n notify: Notify\n}) {\n const { user, hostId, target, onClose, onAttached, notify } = props\n const [query, setQuery] = useState('')\n const [found, setFound] = useState<BuyerFindResult | null>(null)\n const [searched, setSearched] = useState('')\n const [chosen, setChosen] = useState('')\n const [busy, setBusy] = useState(false)\n const [attemptKey] = useState(newKey)\n const options = found ? optionsOf(found) : []\n\n const search = async (event?: FormEvent) => {\n event?.preventDefault()\n const text = query.trim()\n if (text.length < 2) return\n setBusy(true)\n try {\n setFound(await posHardwareFindBuyer(user, hostId, text))\n setSearched(text)\n setChosen('')\n } catch (caught) {\n notify(caught instanceof PosHardwareRequestError ? caught.message : 'The lookup did not answer', 'warning')\n } finally {\n setBusy(false)\n }\n }\n\n const attach = async (choice: BuyerChoice, needsAddress = false) => {\n setBusy(true)\n try {\n const answer = await posHardwareAttach(user, attemptKey, {\n hostId,\n buyer: choice,\n ...('registerOrderId' in target ? { registerOrderId: target.registerOrderId } : { orderId: target.orderId }),\n })\n onAttached(\n answer.outcome === 'waiting'\n ? 'Buyer attached. The card reader joins their workspace as soon as the sale is paid.'\n : answer.outcome === 'attached'\n ? 'Card reader attached to the buyer’s workspace.'\n : 'email' in choice\n ? 'Invitation sent. The card reader joins their workspace when they sign up.'\n : 'Attached to their account. It joins the workspace they create.',\n { chosen: 'hostId' in choice && Boolean(choice.hostId), needsAddress },\n )\n } catch (caught) {\n notify(caught instanceof PosHardwareRequestError ? caught.message : 'The card reader could not be attached', 'warning')\n } finally {\n setBusy(false)\n }\n }\n\n const option = options.find((candidate) => candidate.key === chosen)\n return (\n <Dialog open onClose={onClose} maxWidth=\"sm\" fullWidth>\n <DialogTitle>{'Who is the card reader for?'}</DialogTitle>\n <DialogContent sx={{ display: 'flex', flexDirection: 'column', gap: 2 }}>\n {'row' in target ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {`${target.row.lines.map((line) => `${line.quantity} × ${line.name}`).join(', ')} · ${formatPosHardwareCents(target.row.totalCents)}`}\n </Typography>\n ) : null}\n <Stack component=\"form\" direction=\"row\" spacing={1} onSubmit={search} sx={{ mt: 1 }}>\n <TextField\n label=\"Email, name or workspace\"\n size=\"small\"\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n sx={{ flex: 1 }}\n autoFocus\n />\n <Button type=\"submit\" variant=\"outlined\" disabled={busy || query.trim().length < 2}>\n {'Search'}\n </Button>\n </Stack>\n {found?.noAccount ? (\n <Alert\n severity=\"info\"\n action={\n <Button disabled={busy} onClick={() => void attach({ email: searched })}>\n {'Invite them'}\n </Button>\n }\n >\n {`No account uses ${searched}. Sell anyway: we email them an invitation, and the card reader joins their workspace when they sign up.`}\n </Alert>\n ) : null}\n {found && !found.noAccount && !options.length ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Nobody matches. Try their exact email address.'}\n </Typography>\n ) : null}\n {options.length ? (\n <RadioGroup value={chosen} onChange={(event) => setChosen(event.target.value)} aria-label=\"Buyer\">\n {options.map((candidate) => (\n <FormControlLabel\n key={candidate.key}\n value={candidate.key}\n control={<Radio size=\"small\" />}\n label={\n <Stack>\n <Typography variant=\"body2\">{candidate.label}</Typography>\n {candidate.detail ? (\n <Typography variant=\"caption\" color=\"text.secondary\">\n {candidate.detail}\n </Typography>\n ) : null}\n </Stack>\n }\n />\n ))}\n </RadioGroup>\n ) : null}\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Every lookup is recorded. Ask the buyer before you search for them.'}\n </Typography>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose}>{'Cancel'}</Button>\n <Button\n variant=\"contained\"\n disabled={busy || !option}\n onClick={() => option && void attach(option.choice, Boolean(option.needsAddress))}\n >\n {'Attach'}\n </Button>\n </DialogActions>\n </Dialog>\n )\n}\n\n/**\n * The To attach list (AGL-4038): card readers sold here that nobody has said\n * whose they are yet — at the kiosk, while the register was offline, or to a\n * buyer with no account or no workspace yet — newest first.\n */\nfunction ToAttachDialog(props: {\n user: User\n hostId: string\n onClose: () => void\n onPick: (row: ToAttachRow) => void\n notify: Notify\n}) {\n const { user, hostId, onClose, onPick, notify } = props\n const [rows, setRows] = useState<ToAttachRow[] | null>(null)\n useEffect(() => {\n let live = true\n posHardwareToAttach(user, hostId)\n .then((answer) => live && setRows(answer.orders))\n .catch((caught) => {\n if (!live) return\n setRows([])\n notify(caught instanceof PosHardwareRequestError ? caught.message : 'The list could not be read', 'warning')\n })\n return () => {\n live = false\n }\n }, [user, hostId, notify])\n return (\n <Dialog open onClose={onClose} maxWidth=\"sm\" fullWidth>\n <DialogTitle>{'Card reader sales to attach'}</DialogTitle>\n <DialogContent>\n {rows && !rows.length ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Every card reader sold here is attached to its buyer.'}\n </Typography>\n ) : null}\n <List dense>\n {(rows ?? []).map((row) => (\n <ListItem\n key={row.id}\n secondaryAction={\n <Button size=\"small\" onClick={() => onPick(row)}>\n {'Attach'}\n </Button>\n }\n >\n <ListItemText\n primary={`${row.lines.map((line) => `${line.quantity} × ${line.name}`).join(', ')} · ${formatPosHardwareCents(row.totalCents)}`}\n secondary={[\n row.registerNumber ? `Sale #${row.registerNumber}` : row.number,\n new Date(row.createdAtMs).toLocaleString(),\n row.kiosk ? 'at the kiosk' : null,\n row.offline ? 'rung offline' : null,\n row.invited ? `invited ${row.contactEmail ?? ''}`.trim() : row.contactEmail,\n row.awaitingWorkspace ? 'has an account, no workspace yet' : null,\n ]\n .filter(Boolean)\n .join(' · ')}\n />\n </ListItem>\n ))}\n </List>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose}>{'Close'}</Button>\n </DialogActions>\n </Dialog>\n )\n}\n\n/**\n * The sale's readers onto the buyer's store (AGL-4038): their serial numbers,\n * scanned or typed, so each sets itself up when the buyer adds it; and, with\n * the buyer there and their store chosen, registering it to that store now\n * by the code it shows.\n */\nfunction SaleReaders(props: {\n user: User\n hostId: string\n saleOrderId: string\n store: AttachedStore\n notify: Notify\n}) {\n const { user, hostId, saleOrderId, store, notify } = props\n const [serials, setSerials] = useState('')\n const [code, setCode] = useState('')\n const [busy, setBusy] = useState(false)\n const [attemptKey, setAttemptKey] = useState(newKey)\n // The buyer's store address (AGL-4038), asked for when their store has no\n // card reader location yet: from the lookup, or when the route says so.\n const [askAddress, setAskAddress] = useState(store.needsAddress)\n const [address, setAddress] = useState<BoothStoreAddress>(EMPTY_ADDRESS)\n useEffect(() => setAskAddress(store.needsAddress), [store.needsAddress])\n const addressComplete =\n Boolean(address.line1.trim() && address.city.trim() && address.postalCode.trim()) &&\n /^[A-Z]{2}$/.test(address.country)\n const run = async (work: () => Promise<string>) => {\n setBusy(true)\n try {\n notify(await work(), 'success')\n } catch (caught) {\n if (caught instanceof PosHardwareRequestError && caught.reason === 'needs-address') {\n setAskAddress(true)\n // A new attempt: the request with the address is a different one.\n setAttemptKey(newKey())\n }\n notify(caught instanceof PosHardwareRequestError ? caught.message : 'That did not work. Try again.', 'warning')\n } finally {\n setBusy(false)\n }\n }\n const list = serials\n .split(/[\\s,;]+/)\n .map((serial) => serial.trim())\n .filter(Boolean)\n return (\n <Stack spacing={1}>\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'flex-start' }}>\n <TextField\n size=\"small\"\n label=\"Reader serial numbers\"\n helperText=\"Scan or type each reader's serial. It sets itself up when the buyer adds it.\"\n value={serials}\n onChange={(event) => setSerials(event.target.value)}\n sx={{ flex: 1 }}\n />\n <Button\n disabled={busy || !list.length}\n onClick={() =>\n void run(async () => {\n await posHardwareSerials(user, { hostId, registerOrderId: saleOrderId, serials: list })\n return list.length === 1 ? 'Serial number saved' : 'Serial numbers saved'\n })\n }\n >\n {'Save'}\n </Button>\n </Stack>\n {store.chosen && askAddress ? (\n <Box sx={{ display: 'grid', gap: 1, gridTemplateColumns: { xs: '1fr', sm: '1fr 1fr' } }}>\n <Typography variant=\"body2\" color=\"text.secondary\" sx={{ gridColumn: '1 / -1' }}>\n {'Their store has no address for card readers yet. Enter it with the buyer to register the reader now: ' +\n 'Stripe sets the reader up for this country. Or leave it, and they add it on their POS devices card.'}\n </Typography>\n <TextField\n size=\"small\"\n label=\"Street\"\n required\n value={address.line1}\n onChange={(event) => setAddress({ ...address, line1: event.target.value })}\n sx={{ gridColumn: '1 / -1' }}\n />\n <TextField\n size=\"small\"\n label=\"City\"\n required\n value={address.city}\n onChange={(event) => setAddress({ ...address, city: event.target.value })}\n />\n <TextField\n size=\"small\"\n label=\"State\"\n value={address.state}\n onChange={(event) => setAddress({ ...address, state: event.target.value })}\n />\n <TextField\n size=\"small\"\n label=\"Postal code\"\n required\n value={address.postalCode}\n onChange={(event) => setAddress({ ...address, postalCode: event.target.value })}\n />\n <TextField\n size=\"small\"\n label=\"Country\"\n required\n helperText=\"Two letters, like US\"\n value={address.country}\n onChange={(event) => setAddress({ ...address, country: event.target.value.toUpperCase().slice(0, 2) })}\n />\n </Box>\n ) : null}\n {store.chosen ? (\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'flex-start' }}>\n <TextField\n size=\"small\"\n label=\"Code on the reader\"\n helperText=\"Register it to the buyer's store now, while they are here.\"\n value={code}\n onChange={(event) => setCode(event.target.value)}\n sx={{ flex: 1 }}\n />\n <Button\n disabled={busy || code.trim().length < 3 || (askAddress && !addressComplete)}\n onClick={() =>\n void run(async () => {\n const answer = await posHardwareRegisterAtBooth(user, attemptKey, {\n hostId,\n registerOrderId: saleOrderId,\n registrationCode: code.trim(),\n ...(askAddress ? { address } : {}),\n })\n setCode('')\n setAttemptKey(newKey())\n if (answer.storeAddressSaved) setAskAddress(false)\n return answer.storeAddressSaved\n ? 'Reader registered to their store, and the store’s address saved'\n : 'Reader registered to their store'\n })\n }\n >\n {'Register'}\n </Button>\n </Stack>\n ) : null}\n </Stack>\n )\n}\n\n/**\n * Selling a card reader at the platform's own store's register (AGL-4038):\n * on a sale that has one, the buyer is attached here, and every reader sold\n * without one waits on the To attach list. Draws nothing on any store but\n * the platform's own hardware seller. Loaded on its own, by the register.\n */\nfunction PosHardwareBuyer(props: PosHardwareBuyerProps) {\n const { user, hostId, saleOrderId, notify } = props\n const [seller, setSeller] = useState(false)\n const [dialog, setDialog] = useState<\n null | { kind: 'list' } | { kind: 'sale' } | { kind: 'entry'; row: ToAttachRow }\n >(null)\n const [attached, setAttached] = useState<{ orderId: string; message: string; store: AttachedStore } | null>(\n null,\n )\n\n useEffect(() => {\n let live = true\n posHardwareSaleStatus(user, hostId)\n .then((status) => live && setSeller(status.seller))\n .catch(() => undefined)\n return () => {\n live = false\n }\n }, [user, hostId])\n\n if (!seller) return null\n const attachedHere = attached && attached.orderId === saleOrderId ? attached : null\n return (\n <Stack spacing={1} sx={{ mt: 1 }}>\n {saleOrderId ? (\n <Alert\n severity={attachedHere ? 'success' : 'info'}\n action={\n <Button size=\"small\" onClick={() => setDialog({ kind: 'sale' })}>\n {attachedHere ? 'Change' : 'Attach buyer'}\n </Button>\n }\n >\n {attachedHere?.message ?? 'This sale has a card reader. Attach it to the buyer’s workspace.'}\n </Alert>\n ) : null}\n {saleOrderId ? (\n // The terms of sale, accepted before paying (AGL-4038, Terms 4.28).\n <PosHardwareSaleTerms user={user} hostId={hostId} saleOrderId={saleOrderId} notify={notify} />\n ) : null}\n {saleOrderId ? (\n <SaleReaders\n user={user}\n hostId={hostId}\n saleOrderId={saleOrderId}\n store={attachedHere?.store ?? NO_STORE}\n notify={notify}\n />\n ) : null}\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <Chip size=\"small\" variant=\"outlined\" label=\"Card reader sales\" />\n <Button size=\"small\" onClick={() => setDialog({ kind: 'list' })}>\n {'To attach'}\n </Button>\n </Stack>\n {dialog?.kind === 'list' ? (\n <ToAttachDialog\n user={user}\n hostId={hostId}\n notify={notify}\n onClose={() => setDialog(null)}\n onPick={(row) => setDialog({ kind: 'entry', row })}\n />\n ) : null}\n {dialog?.kind === 'sale' && saleOrderId ? (\n <AttachDialog\n user={user}\n hostId={hostId}\n target={{ registerOrderId: saleOrderId }}\n notify={notify}\n onClose={() => setDialog(null)}\n onAttached={(message, store) => {\n setAttached({ orderId: saleOrderId, message, store })\n setDialog(null)\n notify(message, 'success')\n }}\n />\n ) : null}\n {dialog?.kind === 'entry' ? (\n <AttachDialog\n user={user}\n hostId={hostId}\n target={{ orderId: dialog.row.id, row: dialog.row }}\n notify={notify}\n onClose={() => setDialog(null)}\n onAttached={(message) => {\n setDialog({ kind: 'list' })\n notify(message, 'success')\n }}\n />\n ) : null}\n </Stack>\n )\n}\n\nexport default PosHardwareBuyer\n"],"names":["Alert","Box","Button","Chip","Dialog","DialogActions","DialogContent","DialogTitle","FormControlLabel","List","ListItem","ListItemText","Radio","RadioGroup","Stack","TextField","Typography","useEffect","useState","formatPosHardwareCents","PosHardwareRequestError","PosHardwareSaleTerms","posHardwareAttach","posHardwareFindBuyer","posHardwareRegisterAtBooth","posHardwareSaleStatus","posHardwareSerials","posHardwareToAttach","NO_STORE","chosen","needsAddress","EMPTY_ADDRESS","line1","city","state","postalCode","country","newKey","Date","now","toString","Math","random","slice","workspaceOptions","uid","workspace","who","plan","posPlan","stores","map","store","key","orgId","hostId","label","name","detail","hasLocation","filter","Boolean","join","choice","optionsOf","found","options","person","people","email","workspaces","length","push","owner","option","some","held","AttachDialog","props","user","target","onClose","onAttached","notify","query","setQuery","setFound","searched","setSearched","setChosen","busy","setBusy","attemptKey","search","event","preventDefault","text","trim","caught","message","attach","answer","buyer","registerOrderId","orderId","outcome","find","candidate","open","maxWidth","fullWidth","sx","display","flexDirection","gap","variant","color","row","lines","line","quantity","totalCents","component","direction","spacing","onSubmit","mt","size","value","onChange","flex","autoFocus","type","disabled","noAccount","severity","action","onClick","aria-label","control","ToAttachDialog","onPick","rows","setRows","live","then","orders","catch","dense","secondaryAction","primary","secondary","registerNumber","number","createdAtMs","toLocaleString","kiosk","offline","invited","contactEmail","awaitingWorkspace","id","SaleReaders","saleOrderId","serials","setSerials","code","setCode","setAttemptKey","askAddress","setAskAddress","address","setAddress","addressComplete","test","run","work","reason","list","split","serial","alignItems","helperText","gridTemplateColumns","xs","sm","gridColumn","required","toUpperCase","registrationCode","storeAddressSaved","PosHardwareBuyer","seller","setSeller","dialog","setDialog","attached","setAttached","status","undefined","attachedHere","kind"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SACEA,KAAK,EACLC,GAAG,EACHC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,aAAa,EACbC,aAAa,EACbC,WAAW,EACXC,gBAAgB,EAChBC,IAAI,EACJC,QAAQ,EACRC,YAAY,EACZC,KAAK,EACLC,UAAU,EACVC,KAAK,EACLC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,SAAS,EAAEC,QAAQ,QAAwB,QAAO;AAC3D,SAASC,sBAAsB,QAAQ,iCAA6B;AACpE,SAASC,uBAAuB,QAAQ,wBAAoB;AAC5D,SAASC,oBAAoB,QAAQ,yCAAqC;AAC1E,SACEC,iBAAiB,EACjBC,oBAAoB,EACpBC,0BAA0B,EAC1BC,qBAAqB,EACrBC,kBAAkB,EAClBC,mBAAmB,QAMd,6BAAyB;AA+BhC,+DAA+D,GAC/D,MAAMC,WAA0B;IAAEC,QAAQ;IAAOC,cAAc;AAAM;AAErE,iEAAiE,GACjE,MAAMC,gBAAmC;IAAEC,OAAO;IAAIC,MAAM;IAAIC,OAAO;IAAIC,YAAY;IAAIC,SAAS;AAAK;AAEzG,SAASC;IACP,OAAO,CAAC,OAAO,EAAEC,KAAKC,GAAG,GAAGC,QAAQ,CAAC,IAAI,CAAC,EAAEC,KAAKC,MAAM,GAAGF,QAAQ,CAAC,IAAIG,KAAK,CAAC,GAAG,KAAK;AACvF;AAEA,4FAA4F,GAC5F,SAASC,iBAAiBC,GAAW,EAAEC,SAAyB,EAAEC,GAAW;IAC3E,MAAMC,OAAOF,UAAUG,OAAO,GAAG,OAAO;IACxC,OAAO;WACFH,UAAUI,MAAM,CAACC,GAAG,CAAC,CAACC,QAAW,CAAA;gBAClCC,KAAK,GAAGR,IAAI,CAAC,EAAEC,UAAUQ,KAAK,CAAC,CAAC,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;wBAAahE;wBAAS/C;oBAAM;oBACnD+I,UAAU;oBACVhH,OAAOgB,SAAS;gBAClB;iBAEA;YACH+F,CAAAA,0BAAAA,OAAQO,IAAI,MAAK,wBAChB,KAAC5H;gBACCE,MAAMA;gBACNxB,QAAQA;gBACRyB,QAAQ;oBAAEwB,SAAS0F,OAAO7E,GAAG,CAAC4C,EAAE;oBAAE5C,KAAK6E,OAAO7E,GAAG;gBAAC;gBAClDlC,QAAQA;gBACRF,SAAS,IAAMkH,UAAU;gBACzBjH,YAAY,CAACiB;oBACXgG,UAAU;wBAAEM,MAAM;oBAAO;oBACzBtH,OAAOgB,SAAS;gBAClB;iBAEA;;;AAGV;AAEA,eAAe4F,iBAAgB"}
@@ -0,0 +1,162 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import type { PosHardwareSku, PosHardwareSkuId } from '../../../model/pos-hardware';
18
+ import { sendPosHardwareRequest } from './pos-hardware-api';
19
+ type User = Parameters<typeof sendPosHardwareRequest>[0];
20
+ export type PosHardwareSaleStatus = {
21
+ seller: false;
22
+ } | {
23
+ seller: true;
24
+ items: Array<{
25
+ sku: PosHardwareSkuId;
26
+ name: string;
27
+ kind: PosHardwareSku['kind'];
28
+ }>;
29
+ };
30
+ export declare function posHardwareSaleStatus(user: User, hostId: string): Promise<PosHardwareSaleStatus>;
31
+ /** A sale on the To attach list, as `pending` and `attach` answer it. */
32
+ export interface ToAttachRow {
33
+ id: string;
34
+ number: string;
35
+ registerOrderId: string | null;
36
+ registerNumber: number | null;
37
+ kiosk: boolean;
38
+ offline: boolean;
39
+ lines: Array<{
40
+ sku: PosHardwareSkuId;
41
+ name: string;
42
+ quantity: number;
43
+ }>;
44
+ totalCents: number;
45
+ createdAtMs: number;
46
+ contactEmail: string | null;
47
+ attached: boolean;
48
+ storeChosen: boolean;
49
+ readers: number;
50
+ serialsTaken: number;
51
+ readersSetUp: number;
52
+ awaitingWorkspace: boolean;
53
+ invited: boolean;
54
+ }
55
+ export interface BuyerStore {
56
+ hostId: string;
57
+ name: string;
58
+ hasLocation: boolean;
59
+ }
60
+ export interface BuyerWorkspace {
61
+ orgId: string;
62
+ name: string;
63
+ posPlan: boolean;
64
+ stores: BuyerStore[];
65
+ }
66
+ export interface BuyerPerson {
67
+ uid: string;
68
+ name: string;
69
+ email: string;
70
+ workspaces: BuyerWorkspace[];
71
+ }
72
+ export interface BuyerFindResult {
73
+ kind: 'email' | 'name';
74
+ people: BuyerPerson[];
75
+ workspaces: Array<BuyerWorkspace & {
76
+ owner: Omit<BuyerPerson, 'workspaces'> | null;
77
+ }>;
78
+ noAccount: boolean;
79
+ }
80
+ /** Who the register says the buyer is. */
81
+ export type BuyerChoice = {
82
+ uid: string;
83
+ orgId?: string;
84
+ hostId?: string;
85
+ } | {
86
+ email: string;
87
+ };
88
+ export declare function posHardwareToAttach(user: User, hostId: string): Promise<{
89
+ orders: ToAttachRow[];
90
+ }>;
91
+ export declare function posHardwareFindBuyer(user: User, hostId: string, query: string): Promise<BuyerFindResult>;
92
+ export declare function posHardwareAttach(user: User, attemptKey: string, body: {
93
+ hostId: string;
94
+ buyer: BuyerChoice;
95
+ registerOrderId?: string;
96
+ orderId?: string;
97
+ }): Promise<{
98
+ outcome: "waiting";
99
+ } | {
100
+ outcome: "attached" | "pending";
101
+ order: ToAttachRow;
102
+ }>;
103
+ /** Saves the serial numbers of a sale's readers, taken at the sale. */
104
+ export declare function posHardwareSerials(user: User, body: {
105
+ hostId: string;
106
+ serials: string[];
107
+ registerOrderId?: string;
108
+ orderId?: string;
109
+ }): Promise<{
110
+ ok: true;
111
+ serials: string[];
112
+ recorded: boolean;
113
+ }>;
114
+ /** Registers a reader to the buyer's chosen store, by its code, at the booth. */
115
+ /** The buyer's store address, typed at the booth for a store with no card reader location yet. */
116
+ export interface BoothStoreAddress {
117
+ line1: string;
118
+ city: string;
119
+ state: string;
120
+ postalCode: string;
121
+ country: string;
122
+ }
123
+ export declare function posHardwareRegisterAtBooth(user: User, attemptKey: string, body: {
124
+ hostId: string;
125
+ registrationCode: string;
126
+ registerOrderId?: string;
127
+ orderId?: string;
128
+ address?: BoothStoreAddress;
129
+ }): Promise<{
130
+ ok: true;
131
+ readerId: string;
132
+ storeAddressSaved: boolean;
133
+ order: ToAttachRow;
134
+ }>;
135
+ /** The terms of sale the buyer accepts before paying (AGL-4038). */
136
+ export interface PosHardwareTermsView {
137
+ version: string;
138
+ sections: string;
139
+ url: string;
140
+ summary: string[];
141
+ }
142
+ /** How and when the buyer accepted, as the route answers it. */
143
+ export interface PosHardwareTermsAcceptanceView {
144
+ version: string;
145
+ sections: string;
146
+ method: 'tablet' | 'display' | 'notice';
147
+ atMs: number;
148
+ }
149
+ export declare function posHardwareTerms(user: User, hostId: string): Promise<PosHardwareTermsView>;
150
+ export declare function posHardwareTermsStatus(user: User, hostId: string, registerOrderId: string): Promise<{
151
+ acceptance: PosHardwareTermsAcceptanceView | null;
152
+ }>;
153
+ /** Notes who is putting the terms on the display, before the register shows them there. */
154
+ export declare function posHardwareTermsOnDisplay(user: User, hostId: string, registerOrderId: string): Promise<{
155
+ ok: true;
156
+ }>;
157
+ /** The buyer accepted on the register tablet handed to them. */
158
+ export declare function posHardwareAcceptTerms(user: User, hostId: string, registerOrderId: string): Promise<{
159
+ ok: true;
160
+ acceptance: PosHardwareTermsAcceptanceView;
161
+ }>;
162
+ export {};
@@ -0,0 +1,122 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */ import { _ as _extends } from "@swc/helpers/_/_extends";
17
+ import { sendPosHardwareRequest } from "./pos-hardware-api.js";
18
+ const SALE = '/api/commerce/pos-hardware-sale';
19
+ /** Whether a store is the platform's own hardware seller, once per store per session. */ const statusByHost = new Map();
20
+ export function posHardwareSaleStatus(user, hostId) {
21
+ const cached = statusByHost.get(hostId);
22
+ if (cached) return cached;
23
+ const asked = sendPosHardwareRequest(user, SALE, {
24
+ method: 'POST',
25
+ body: {
26
+ action: 'status',
27
+ hostId
28
+ }
29
+ }).catch((error)=>{
30
+ // A refusal is not remembered: the next editor that opens asks again.
31
+ statusByHost.delete(hostId);
32
+ throw error;
33
+ });
34
+ statusByHost.set(hostId, asked);
35
+ return asked;
36
+ }
37
+ export function posHardwareToAttach(user, hostId) {
38
+ return sendPosHardwareRequest(user, SALE, {
39
+ method: 'POST',
40
+ body: {
41
+ action: 'pending',
42
+ hostId
43
+ }
44
+ });
45
+ }
46
+ export function posHardwareFindBuyer(user, hostId, query) {
47
+ return sendPosHardwareRequest(user, SALE, {
48
+ method: 'POST',
49
+ body: {
50
+ action: 'find',
51
+ hostId,
52
+ query
53
+ }
54
+ });
55
+ }
56
+ export function posHardwareAttach(user, attemptKey, body) {
57
+ return sendPosHardwareRequest(user, SALE, {
58
+ method: 'POST',
59
+ body: _extends({}, body, {
60
+ action: 'attach'
61
+ }),
62
+ attemptKey
63
+ });
64
+ }
65
+ /** Saves the serial numbers of a sale's readers, taken at the sale. */ export function posHardwareSerials(user, body) {
66
+ return sendPosHardwareRequest(user, SALE, {
67
+ method: 'POST',
68
+ body: _extends({}, body, {
69
+ action: 'serials'
70
+ })
71
+ });
72
+ }
73
+ export function posHardwareRegisterAtBooth(user, attemptKey, body) {
74
+ return sendPosHardwareRequest(user, SALE, {
75
+ method: 'POST',
76
+ body: _extends({}, body, {
77
+ action: 'register-at-booth'
78
+ }),
79
+ attemptKey
80
+ });
81
+ }
82
+ export function posHardwareTerms(user, hostId) {
83
+ return sendPosHardwareRequest(user, SALE, {
84
+ method: 'POST',
85
+ body: {
86
+ action: 'terms',
87
+ hostId
88
+ }
89
+ });
90
+ }
91
+ export function posHardwareTermsStatus(user, hostId, registerOrderId) {
92
+ return sendPosHardwareRequest(user, SALE, {
93
+ method: 'POST',
94
+ body: {
95
+ action: 'terms-status',
96
+ hostId,
97
+ registerOrderId
98
+ }
99
+ });
100
+ }
101
+ /** Notes who is putting the terms on the display, before the register shows them there. */ export function posHardwareTermsOnDisplay(user, hostId, registerOrderId) {
102
+ return sendPosHardwareRequest(user, SALE, {
103
+ method: 'POST',
104
+ body: {
105
+ action: 'terms-on-display',
106
+ hostId,
107
+ registerOrderId
108
+ }
109
+ });
110
+ }
111
+ /** The buyer accepted on the register tablet handed to them. */ export function posHardwareAcceptTerms(user, hostId, registerOrderId) {
112
+ return sendPosHardwareRequest(user, SALE, {
113
+ method: 'POST',
114
+ body: {
115
+ action: 'accept-terms',
116
+ hostId,
117
+ registerOrderId
118
+ }
119
+ });
120
+ }
121
+
122
+ //# sourceMappingURL=pos-hardware-sale-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../libs/plugins/commerce/src/lib/components/console/pos/pos-hardware-sale-api.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { PosHardwareSku, PosHardwareSkuId } from '../../../model/pos-hardware'\nimport { sendPosHardwareRequest } from './pos-hardware-api'\n\n/*\n * Selling a card reader in person (AGL-4038), the client half of\n * `/api/commerce/pos-hardware-sale`, so no component builds a request by hand.\n */\n\ntype User = Parameters<typeof sendPosHardwareRequest>[0]\n\nconst SALE = '/api/commerce/pos-hardware-sale'\n\nexport type PosHardwareSaleStatus =\n | { seller: false }\n | { seller: true; items: Array<{ sku: PosHardwareSkuId; name: string; kind: PosHardwareSku['kind'] }> }\n\n/** Whether a store is the platform's own hardware seller, once per store per session. */\nconst statusByHost = new Map<string, Promise<PosHardwareSaleStatus>>()\n\nexport function posHardwareSaleStatus(user: User, hostId: string): Promise<PosHardwareSaleStatus> {\n const cached = statusByHost.get(hostId)\n if (cached) return cached\n const asked = sendPosHardwareRequest<PosHardwareSaleStatus>(user, SALE, {\n method: 'POST',\n body: { action: 'status', hostId },\n }).catch((error: unknown) => {\n // A refusal is not remembered: the next editor that opens asks again.\n statusByHost.delete(hostId)\n throw error\n })\n statusByHost.set(hostId, asked)\n return asked\n}\n\n/** A sale on the To attach list, as `pending` and `attach` answer it. */\nexport interface ToAttachRow {\n id: string\n number: string\n registerOrderId: string | null\n registerNumber: number | null\n kiosk: boolean\n offline: boolean\n lines: Array<{ sku: PosHardwareSkuId; name: string; quantity: number }>\n totalCents: number\n createdAtMs: number\n contactEmail: string | null\n attached: boolean\n storeChosen: boolean\n readers: number\n serialsTaken: number\n readersSetUp: number\n awaitingWorkspace: boolean\n invited: boolean\n}\n\nexport interface BuyerStore {\n hostId: string\n name: string\n hasLocation: boolean\n}\n\nexport interface BuyerWorkspace {\n orgId: string\n name: string\n posPlan: boolean\n stores: BuyerStore[]\n}\n\nexport interface BuyerPerson {\n uid: string\n name: string\n email: string\n workspaces: BuyerWorkspace[]\n}\n\nexport interface BuyerFindResult {\n kind: 'email' | 'name'\n people: BuyerPerson[]\n workspaces: Array<BuyerWorkspace & { owner: Omit<BuyerPerson, 'workspaces'> | null }>\n noAccount: boolean\n}\n\n/** Who the register says the buyer is. */\nexport type BuyerChoice = { uid: string; orgId?: string; hostId?: string } | { email: string }\n\nexport function posHardwareToAttach(user: User, hostId: string) {\n return sendPosHardwareRequest<{ orders: ToAttachRow[] }>(user, SALE, {\n method: 'POST',\n body: { action: 'pending', hostId },\n })\n}\n\nexport function posHardwareFindBuyer(user: User, hostId: string, query: string) {\n return sendPosHardwareRequest<BuyerFindResult>(user, SALE, {\n method: 'POST',\n body: { action: 'find', hostId, query },\n })\n}\n\nexport function posHardwareAttach(\n user: User,\n attemptKey: string,\n body: { hostId: string; buyer: BuyerChoice; registerOrderId?: string; orderId?: string },\n) {\n return sendPosHardwareRequest<{ outcome: 'waiting' } | { outcome: 'attached' | 'pending'; order: ToAttachRow }>(\n user,\n SALE,\n { method: 'POST', body: { ...body, action: 'attach' }, attemptKey },\n )\n}\n\n/** Saves the serial numbers of a sale's readers, taken at the sale. */\nexport function posHardwareSerials(\n user: User,\n body: { hostId: string; serials: string[]; registerOrderId?: string; orderId?: string },\n) {\n return sendPosHardwareRequest<{ ok: true; serials: string[]; recorded: boolean }>(user, SALE, {\n method: 'POST',\n body: { ...body, action: 'serials' },\n })\n}\n\n/** Registers a reader to the buyer's chosen store, by its code, at the booth. */\n/** The buyer's store address, typed at the booth for a store with no card reader location yet. */\nexport interface BoothStoreAddress {\n line1: string\n city: string\n state: string\n postalCode: string\n country: string\n}\n\nexport function posHardwareRegisterAtBooth(\n user: User,\n attemptKey: string,\n body: {\n hostId: string\n registrationCode: string\n registerOrderId?: string\n orderId?: string\n address?: BoothStoreAddress\n },\n) {\n return sendPosHardwareRequest<{ ok: true; readerId: string; storeAddressSaved: boolean; order: ToAttachRow }>(user, SALE, {\n method: 'POST',\n body: { ...body, action: 'register-at-booth' },\n attemptKey,\n })\n}\n\n/** The terms of sale the buyer accepts before paying (AGL-4038). */\nexport interface PosHardwareTermsView {\n version: string\n sections: string\n url: string\n summary: string[]\n}\n\n/** How and when the buyer accepted, as the route answers it. */\nexport interface PosHardwareTermsAcceptanceView {\n version: string\n sections: string\n method: 'tablet' | 'display' | 'notice'\n atMs: number\n}\n\nexport function posHardwareTerms(user: User, hostId: string) {\n return sendPosHardwareRequest<PosHardwareTermsView>(user, SALE, { method: 'POST', body: { action: 'terms', hostId } })\n}\n\nexport function posHardwareTermsStatus(user: User, hostId: string, registerOrderId: string) {\n return sendPosHardwareRequest<{ acceptance: PosHardwareTermsAcceptanceView | null }>(user, SALE, {\n method: 'POST',\n body: { action: 'terms-status', hostId, registerOrderId },\n })\n}\n\n/** Notes who is putting the terms on the display, before the register shows them there. */\nexport function posHardwareTermsOnDisplay(user: User, hostId: string, registerOrderId: string) {\n return sendPosHardwareRequest<{ ok: true }>(user, SALE, {\n method: 'POST',\n body: { action: 'terms-on-display', hostId, registerOrderId },\n })\n}\n\n/** The buyer accepted on the register tablet handed to them. */\nexport function posHardwareAcceptTerms(user: User, hostId: string, registerOrderId: string) {\n return sendPosHardwareRequest<{ ok: true; acceptance: PosHardwareTermsAcceptanceView }>(user, SALE, {\n method: 'POST',\n body: { action: 'accept-terms', hostId, registerOrderId },\n })\n}\n"],"names":["sendPosHardwareRequest","SALE","statusByHost","Map","posHardwareSaleStatus","user","hostId","cached","get","asked","method","body","action","catch","error","delete","set","posHardwareToAttach","posHardwareFindBuyer","query","posHardwareAttach","attemptKey","posHardwareSerials","posHardwareRegisterAtBooth","posHardwareTerms","posHardwareTermsStatus","registerOrderId","posHardwareTermsOnDisplay","posHardwareAcceptTerms"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC;AAGD,SAASA,sBAAsB,QAAQ,wBAAoB;AAS3D,MAAMC,OAAO;AAMb,uFAAuF,GACvF,MAAMC,eAAe,IAAIC;AAEzB,OAAO,SAASC,sBAAsBC,IAAU,EA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MAAM;YAAEC,QAAQ;YAASN;QAAO;IAAE;AACtH;AAEA,OAAO,SAASmB,uBAAuBpB,IAAU,EAAEC,MAAc,EAAEoB,eAAuB;IACxF,OAAO1B,uBAA8EK,MAAMJ,MAAM;QAC/FS,QAAQ;QACRC,MAAM;YAAEC,QAAQ;YAAgBN;YAAQoB;QAAgB;IAC1D;AACF;AAEA,yFAAyF,GACzF,OAAO,SAASC,0BAA0BtB,IAAU,EAAEC,MAAc,EAAEoB,eAAuB;IAC3F,OAAO1B,uBAAqCK,MAAMJ,MAAM;QACtDS,QAAQ;QACRC,MAAM;YAAEC,QAAQ;YAAoBN;YAAQoB;QAAgB;IAC9D;AACF;AAEA,8DAA8D,GAC9D,OAAO,SAASE,uBAAuBvB,IAAU,EAAEC,MAAc,EAAEoB,eAAuB;IACxF,OAAO1B,uBAAiFK,MAAMJ,MAAM;QAClGS,QAAQ;QACRC,MAAM;YAAEC,QAAQ;YAAgBN;YAAQoB;QAAgB;IAC1D;AACF"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Aglyn LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { posHardwareTerms } from './pos-hardware-sale-api';
18
+ type User = Parameters<typeof posHardwareTerms>[0];
19
+ type Notify = (message: string, variant: 'success' | 'info' | 'warning' | 'error') => void;
20
+ /** The display page the terms open at, beneath `/kiosk/commerce` (`server/pos-display.ts`). */
21
+ export declare const POS_HARDWARE_TERMS_SCREEN_PATH = "/hardware-terms";
22
+ /** The printable booth sign, a public page of this plugin. */
23
+ export declare const POS_HARDWARE_TERMS_SIGN_HREF = "/kiosk/commerce/hardware-terms-sign";
24
+ /** How often the register asks whether the buyer accepted on the display. */
25
+ export declare const POS_HARDWARE_TERMS_POLL_MS = 2500;
26
+ /**
27
+ * The buyer accepts the terms of sale before paying (AGL-4038, Terms 4.28):
28
+ * on the customer display, which the register shows them on through core's
29
+ * display seam, or on this tablet, handed to them. Where neither can be
30
+ * used, every receipt of the sale and the booth sign state the terms, and
31
+ * paying is agreeing; the sign prints from here.
32
+ */
33
+ export declare function PosHardwareSaleTerms(props: {
34
+ user: User;
35
+ hostId: string;
36
+ saleOrderId: string;
37
+ notify: Notify;
38
+ }): import("react").JSX.Element;
39
+ export default PosHardwareSaleTerms;