@encorekit/web-sdk 2.3.0 → 2.4.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 (265) hide show
  1. package/README.md +66 -1
  2. package/dist/cjs/index.cjs +1 -1
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/preview.cjs +2 -0
  5. package/dist/cjs/preview.cjs.map +1 -0
  6. package/dist/cjs/react.cjs +1 -1
  7. package/dist/cjs/react.cjs.map +1 -1
  8. package/dist/esm/chunks/ClaimReminder-DFyrm5bJ.js +2 -0
  9. package/dist/esm/chunks/ClaimReminder-DFyrm5bJ.js.map +1 -0
  10. package/dist/esm/chunks/GiftsButton-B0lVB463.js +2 -0
  11. package/dist/esm/chunks/GiftsButton-B0lVB463.js.map +1 -0
  12. package/dist/esm/chunks/TriggerHost-CNTiNrTH.js +2 -0
  13. package/dist/esm/chunks/TriggerHost-CNTiNrTH.js.map +1 -0
  14. package/dist/esm/chunks/autoPops-CngtK_R0.js +2 -0
  15. package/dist/esm/chunks/autoPops-CngtK_R0.js.map +1 -0
  16. package/dist/esm/chunks/customClaim-B4uj-aOc.js +2 -0
  17. package/dist/esm/chunks/customClaim-B4uj-aOc.js.map +1 -0
  18. package/dist/esm/chunks/eligibility-BY7fL8Ve.js +2 -0
  19. package/dist/esm/chunks/eligibility-BY7fL8Ve.js.map +1 -0
  20. package/dist/esm/chunks/index-CaBSqauy.js +2 -0
  21. package/dist/esm/chunks/index-CaBSqauy.js.map +1 -0
  22. package/dist/esm/chunks/lookValues-B9z2VWpH.js +2 -0
  23. package/dist/esm/chunks/lookValues-B9z2VWpH.js.map +1 -0
  24. package/dist/esm/chunks/sduiView-Ds7QtFId.js +2 -0
  25. package/dist/esm/chunks/sduiView-Ds7QtFId.js.map +1 -0
  26. package/dist/esm/chunks/spot-DkKMLpB-.js +2 -0
  27. package/dist/esm/chunks/spot-DkKMLpB-.js.map +1 -0
  28. package/dist/esm/chunks/template-B9p4CbPD.js +2 -0
  29. package/dist/esm/chunks/template-B9p4CbPD.js.map +1 -0
  30. package/dist/esm/chunks/textSlots-BnwxUg9V.js +2 -0
  31. package/dist/esm/chunks/textSlots-BnwxUg9V.js.map +1 -0
  32. package/dist/esm/chunks/timers-Bva4yoGM.js +2 -0
  33. package/dist/esm/chunks/timers-Bva4yoGM.js.map +1 -0
  34. package/dist/esm/index.js +1 -1
  35. package/dist/esm/index.js.map +1 -1
  36. package/dist/esm/preview.js +2 -0
  37. package/dist/esm/preview.js.map +1 -0
  38. package/dist/esm/react.js +1 -1
  39. package/dist/esm/react.js.map +1 -1
  40. package/dist/umd/encore.min.js +1 -1
  41. package/dist/umd/encore.min.js.map +1 -1
  42. package/package.json +9 -1
  43. package/types/analytics/DiagnosticsOutbox.d.ts +1 -0
  44. package/types/analytics/DiagnosticsOutbox.d.ts.map +1 -1
  45. package/types/analytics/events.d.ts +105 -5
  46. package/types/analytics/events.d.ts.map +1 -1
  47. package/types/analytics/models.d.ts +2 -0
  48. package/types/analytics/models.d.ts.map +1 -1
  49. package/types/analytics/transport.d.ts +6 -0
  50. package/types/analytics/transport.d.ts.map +1 -1
  51. package/types/api/APIClient.d.ts +58 -3
  52. package/types/api/APIClient.d.ts.map +1 -1
  53. package/types/api/contract.d.ts +4 -1
  54. package/types/api/contract.d.ts.map +1 -1
  55. package/types/api/generated/types.d.ts +420 -39
  56. package/types/api/generated/types.d.ts.map +1 -1
  57. package/types/api/models.d.ts +18 -2
  58. package/types/api/models.d.ts.map +1 -1
  59. package/types/api/offerBuilder.d.ts +10 -4
  60. package/types/api/offerBuilder.d.ts.map +1 -1
  61. package/types/core/Encore.d.ts +145 -3
  62. package/types/core/Encore.d.ts.map +1 -1
  63. package/types/core/OfferManager.d.ts +25 -3
  64. package/types/core/OfferManager.d.ts.map +1 -1
  65. package/types/core/PlacementBuilder.d.ts +6 -1
  66. package/types/core/PlacementBuilder.d.ts.map +1 -1
  67. package/types/core/SignalManager.d.ts.map +1 -1
  68. package/types/core/StorageManager.d.ts +3 -2
  69. package/types/core/StorageManager.d.ts.map +1 -1
  70. package/types/core/StrictUnlockReconciler.d.ts +1 -1
  71. package/types/core/StrictUnlockReconciler.d.ts.map +1 -1
  72. package/types/core/claimHandle.d.ts +44 -0
  73. package/types/core/claimHandle.d.ts.map +1 -0
  74. package/types/core/claimLog.d.ts +102 -0
  75. package/types/core/claimLog.d.ts.map +1 -0
  76. package/types/core/claimRefusal.d.ts +3 -0
  77. package/types/core/claimRefusal.d.ts.map +1 -0
  78. package/types/core/claimStatusCheck.d.ts +62 -0
  79. package/types/core/claimStatusCheck.d.ts.map +1 -0
  80. package/types/core/giftVariant.d.ts +5 -0
  81. package/types/core/giftVariant.d.ts.map +1 -1
  82. package/types/core/hostDisplay.d.ts +9 -2
  83. package/types/core/hostDisplay.d.ts.map +1 -1
  84. package/types/core/sduiVariables.d.ts +20 -0
  85. package/types/core/sduiVariables.d.ts.map +1 -0
  86. package/types/core/strings.d.ts +114 -0
  87. package/types/core/strings.d.ts.map +1 -0
  88. package/types/core/unlockCode.d.ts +8 -1
  89. package/types/core/unlockCode.d.ts.map +1 -1
  90. package/types/core/userKeys.d.ts +7 -0
  91. package/types/core/userKeys.d.ts.map +1 -0
  92. package/types/core/version.d.ts +1 -1
  93. package/types/experiments/ExposureOutbox.d.ts +1 -0
  94. package/types/experiments/ExposureOutbox.d.ts.map +1 -1
  95. package/types/preview.d.ts +51 -0
  96. package/types/preview.d.ts.map +1 -0
  97. package/types/react.d.ts +53 -1
  98. package/types/react.d.ts.map +1 -1
  99. package/types/sdui/actions.d.ts +93 -0
  100. package/types/sdui/actions.d.ts.map +1 -0
  101. package/types/sdui/bindings.d.ts +63 -0
  102. package/types/sdui/bindings.d.ts.map +1 -0
  103. package/types/sdui/compile.d.ts +88 -0
  104. package/types/sdui/compile.d.ts.map +1 -0
  105. package/types/sdui/conditions.d.ts +22 -0
  106. package/types/sdui/conditions.d.ts.map +1 -0
  107. package/types/sdui/context.d.ts +132 -0
  108. package/types/sdui/context.d.ts.map +1 -0
  109. package/types/sdui/countdown.d.ts +31 -0
  110. package/types/sdui/countdown.d.ts.map +1 -0
  111. package/types/sdui/decode.d.ts +35 -0
  112. package/types/sdui/decode.d.ts.map +1 -0
  113. package/types/sdui/deps.d.ts +43 -0
  114. package/types/sdui/deps.d.ts.map +1 -0
  115. package/types/sdui/dominantColor.d.ts +24 -0
  116. package/types/sdui/dominantColor.d.ts.map +1 -0
  117. package/types/sdui/elements/confetti.d.ts +38 -0
  118. package/types/sdui/elements/confetti.d.ts.map +1 -0
  119. package/types/sdui/elements/content.d.ts +27 -0
  120. package/types/sdui/elements/content.d.ts.map +1 -0
  121. package/types/sdui/elements/interactive.d.ts +48 -0
  122. package/types/sdui/elements/interactive.d.ts.map +1 -0
  123. package/types/sdui/elements/layout.d.ts +41 -0
  124. package/types/sdui/elements/layout.d.ts.map +1 -0
  125. package/types/sdui/elements/marquee.d.ts +17 -0
  126. package/types/sdui/elements/marquee.d.ts.map +1 -0
  127. package/types/sdui/elements/progress.d.ts +10 -0
  128. package/types/sdui/elements/progress.d.ts.map +1 -0
  129. package/types/sdui/elements/shared.d.ts +138 -0
  130. package/types/sdui/elements/shared.d.ts.map +1 -0
  131. package/types/sdui/elements/symbols.d.ts +22 -0
  132. package/types/sdui/elements/symbols.d.ts.map +1 -0
  133. package/types/sdui/elements/triggerText.d.ts +55 -0
  134. package/types/sdui/elements/triggerText.d.ts.map +1 -0
  135. package/types/sdui/host.d.ts +274 -0
  136. package/types/sdui/host.d.ts.map +1 -0
  137. package/types/sdui/inlineMarkup.d.ts +22 -0
  138. package/types/sdui/inlineMarkup.d.ts.map +1 -0
  139. package/types/sdui/lookValues.d.ts +50 -0
  140. package/types/sdui/lookValues.d.ts.map +1 -0
  141. package/types/sdui/model.d.ts +130 -0
  142. package/types/sdui/model.d.ts.map +1 -0
  143. package/types/sdui/motion.d.ts +37 -0
  144. package/types/sdui/motion.d.ts.map +1 -0
  145. package/types/sdui/precheck.d.ts +94 -0
  146. package/types/sdui/precheck.d.ts.map +1 -0
  147. package/types/sdui/scrollMath.d.ts +32 -0
  148. package/types/sdui/scrollMath.d.ts.map +1 -0
  149. package/types/sdui/style.d.ts +99 -0
  150. package/types/sdui/style.d.ts.map +1 -0
  151. package/types/sdui/triggerKit.d.ts +24 -0
  152. package/types/sdui/triggerKit.d.ts.map +1 -0
  153. package/types/sdui/unrunnable.d.ts +11 -0
  154. package/types/sdui/unrunnable.d.ts.map +1 -0
  155. package/types/sdui/vocabulary.d.ts +119 -0
  156. package/types/sdui/vocabulary.d.ts.map +1 -0
  157. package/types/triggers/claimReminder/ClaimReminder.d.ts +65 -0
  158. package/types/triggers/claimReminder/ClaimReminder.d.ts.map +1 -0
  159. package/types/triggers/claimReminder/bindings.d.ts +40 -0
  160. package/types/triggers/claimReminder/bindings.d.ts.map +1 -0
  161. package/types/triggers/claimReminder/config.d.ts +56 -0
  162. package/types/triggers/claimReminder/config.d.ts.map +1 -0
  163. package/types/triggers/claimReminder/eligibility.d.ts +37 -0
  164. package/types/triggers/claimReminder/eligibility.d.ts.map +1 -0
  165. package/types/triggers/claimReminder/servedWindow.d.ts +15 -0
  166. package/types/triggers/claimReminder/servedWindow.d.ts.map +1 -0
  167. package/types/triggers/claimReminder/source.d.ts +29 -0
  168. package/types/triggers/claimReminder/source.d.ts.map +1 -0
  169. package/types/triggers/giftsButton/GiftsButton.d.ts +60 -0
  170. package/types/triggers/giftsButton/GiftsButton.d.ts.map +1 -0
  171. package/types/triggers/giftsButton/config.d.ts +53 -0
  172. package/types/triggers/giftsButton/config.d.ts.map +1 -0
  173. package/types/triggers/giftsButton/spot.d.ts +54 -0
  174. package/types/triggers/giftsButton/spot.d.ts.map +1 -0
  175. package/types/triggers/host/TriggerHost.d.ts +127 -0
  176. package/types/triggers/host/TriggerHost.d.ts.map +1 -0
  177. package/types/triggers/host/autoPops.d.ts +16 -0
  178. package/types/triggers/host/autoPops.d.ts.map +1 -0
  179. package/types/triggers/host/configCache.d.ts +29 -0
  180. package/types/triggers/host/configCache.d.ts.map +1 -0
  181. package/types/triggers/host/customClaim.d.ts +85 -0
  182. package/types/triggers/host/customClaim.d.ts.map +1 -0
  183. package/types/triggers/host/dismissStore.d.ts +37 -0
  184. package/types/triggers/host/dismissStore.d.ts.map +1 -0
  185. package/types/triggers/host/readThrottle.d.ts +15 -0
  186. package/types/triggers/host/readThrottle.d.ts.map +1 -0
  187. package/types/triggers/host/registry.d.ts +17 -0
  188. package/types/triggers/host/registry.d.ts.map +1 -0
  189. package/types/triggers/host/sduiView.d.ts +31 -0
  190. package/types/triggers/host/sduiView.d.ts.map +1 -0
  191. package/types/triggers/host/template.d.ts +28 -0
  192. package/types/triggers/host/template.d.ts.map +1 -0
  193. package/types/triggers/host/textSlots.d.ts +35 -0
  194. package/types/triggers/host/textSlots.d.ts.map +1 -0
  195. package/types/triggers/host/theme.d.ts +87 -0
  196. package/types/triggers/host/theme.d.ts.map +1 -0
  197. package/types/triggers/host/timers.d.ts +11 -0
  198. package/types/triggers/host/timers.d.ts.map +1 -0
  199. package/types/triggers/host/types.d.ts +278 -0
  200. package/types/triggers/host/types.d.ts.map +1 -0
  201. package/types/triggers/host/wire.d.ts +55 -0
  202. package/types/triggers/host/wire.d.ts.map +1 -0
  203. package/types/triggers/preview.d.ts +78 -0
  204. package/types/triggers/preview.d.ts.map +1 -0
  205. package/types/triggers/request.d.ts +53 -0
  206. package/types/triggers/request.d.ts.map +1 -0
  207. package/types/types.d.ts +329 -1
  208. package/types/types.d.ts.map +1 -1
  209. package/types/ui/ClaimScreen.d.ts +1 -1
  210. package/types/ui/ClaimScreen.d.ts.map +1 -1
  211. package/types/ui/CodeUnlock.d.ts +12 -2
  212. package/types/ui/CodeUnlock.d.ts.map +1 -1
  213. package/types/ui/GiftHero.d.ts.map +1 -1
  214. package/types/ui/GiftList.d.ts.map +1 -1
  215. package/types/ui/GiftPicker.d.ts.map +1 -1
  216. package/types/ui/GiftPickerHero.d.ts.map +1 -1
  217. package/types/ui/GiftReveal.d.ts.map +1 -1
  218. package/types/ui/GiftSheet.d.ts +5 -5
  219. package/types/ui/GiftSheet.d.ts.map +1 -1
  220. package/types/ui/GiftUnwrap.d.ts.map +1 -1
  221. package/types/ui/OfferCard.d.ts.map +1 -1
  222. package/types/ui/OfferCarousel.d.ts.map +1 -1
  223. package/types/ui/OfferModal.d.ts +31 -0
  224. package/types/ui/OfferModal.d.ts.map +1 -1
  225. package/types/ui/PrimerScreen.d.ts +2 -0
  226. package/types/ui/PrimerScreen.d.ts.map +1 -1
  227. package/types/ui/RedemptionScreen.d.ts +5 -0
  228. package/types/ui/RedemptionScreen.d.ts.map +1 -1
  229. package/types/ui/RewardActions.d.ts.map +1 -1
  230. package/types/ui/RewardCard.d.ts.map +1 -1
  231. package/types/ui/SduiRewardSurface.d.ts +145 -0
  232. package/types/ui/SduiRewardSurface.d.ts.map +1 -0
  233. package/types/ui/Tooltip.d.ts.map +1 -1
  234. package/types/ui/brandComponents.d.ts.map +1 -1
  235. package/types/ui/brandTint.d.ts.map +1 -1
  236. package/types/ui/colorScheme.d.ts +15 -0
  237. package/types/ui/colorScheme.d.ts.map +1 -0
  238. package/types/ui/covered.d.ts +12 -0
  239. package/types/ui/covered.d.ts.map +1 -0
  240. package/types/ui/giftCategoryGroups.d.ts +13 -0
  241. package/types/ui/giftCategoryGroups.d.ts.map +1 -1
  242. package/types/ui/giftCopy.d.ts +14 -9
  243. package/types/ui/giftCopy.d.ts.map +1 -1
  244. package/types/ui/giftUnwrapCopy.d.ts.map +1 -1
  245. package/types/ui/imageURL.d.ts +44 -0
  246. package/types/ui/imageURL.d.ts.map +1 -0
  247. package/types/ui/impressionGate.d.ts +9 -0
  248. package/types/ui/impressionGate.d.ts.map +1 -1
  249. package/types/ui/offerBadge.d.ts.map +1 -1
  250. package/types/ui/rewardSurface.d.ts +11 -1
  251. package/types/ui/rewardSurface.d.ts.map +1 -1
  252. package/types/ui/sduiTheme.d.ts +48 -0
  253. package/types/ui/sduiTheme.d.ts.map +1 -0
  254. package/types/ui/sheetDetents.d.ts +28 -0
  255. package/types/ui/sheetDetents.d.ts.map +1 -0
  256. package/types/ui/styles.d.ts +11 -8
  257. package/types/ui/styles.d.ts.map +1 -1
  258. package/types/ui/termsLine.d.ts +3 -3
  259. package/types/ui/termsLine.d.ts.map +1 -1
  260. package/types/ui/toast.d.ts +11 -0
  261. package/types/ui/toast.d.ts.map +1 -0
  262. package/types/utils/logger.d.ts +10 -0
  263. package/types/utils/logger.d.ts.map +1 -1
  264. package/types/utils/text.d.ts +17 -0
  265. package/types/utils/text.d.ts.map +1 -1
@@ -3,6 +3,7 @@
3
3
  * Base modal container with backdrop, close button, and event handling
4
4
  */
5
5
  import type { ThemeVariables } from './styles';
6
+ import type { SheetDetentOptions } from './sheetDetents';
6
7
  interface ModalEventMap extends Record<string, unknown> {
7
8
  close: void;
8
9
  backdropClick: void;
@@ -27,6 +28,17 @@ export interface OfferModalOptions {
27
28
  * remain on every composition.
28
29
  */
29
30
  showCloseButton?: boolean;
31
+ /**
32
+ * The sheet hosts a served SDUI variant, which is a SCREEN rather than a
33
+ * dialog: it is authored against a phone frame and sizes itself with detents.
34
+ * Above a tablet there is no device shape to honour, so this gives it one
35
+ * standard stage, a large square on its own canvas colour, instead of the wide short dialog
36
+ * that cut a full-screen design in half. Below that the viewport is already
37
+ * the frame and this changes nothing.
38
+ */
39
+ sdui?: boolean;
40
+ /** A served variant's detents, which make it a bottom sheet on phones. */
41
+ sheet?: Omit<SheetDetentOptions, 'onDismiss'>;
30
42
  /**
31
43
  * Whether the sheet can be dismissed AT ALL. Defaults to `true`, which is
32
44
  * every integration that does not deliberately ask otherwise.
@@ -68,6 +80,13 @@ export interface OfferModalOptions {
68
80
  * bug in it can never trap the user on the sheet.
69
81
  */
70
82
  interceptDismiss?: (gesture: 'close' | 'escape' | 'backdrop') => boolean;
83
+ /**
84
+ * 🔴 INTERNAL, render-only preview (`@encorekit/web-sdk/preview`). Mounts the sheet
85
+ * INLINE in this element: no backdrop, no body scroll lock, no document listeners, no
86
+ * focus moves, and no way to dismiss it from the UI (`hide()` is a no-op); only
87
+ * `destroy()` removes it.
88
+ */
89
+ mount?: HTMLElement | ShadowRoot;
71
90
  }
72
91
  export declare class OfferModal {
73
92
  #private;
@@ -86,6 +105,18 @@ export declare class OfferModal {
86
105
  * Called at once with `true` when subscribing to a sheet that is already on screen.
87
106
  */
88
107
  onVisibilityChange(handler: (visible: boolean) => void): () => void;
108
+ /** The colour a served variant's desktop backdrop takes: its own canvas. */
109
+ setBackdropTint(css: string): void;
110
+ /**
111
+ * A served variant's frame: the sheet in its `background` token, as iOS's
112
+ * `presentationBackground`, the backdrop in the same colour until the variant's
113
+ * canvas is read, and the scheme the browser draws its own controls in.
114
+ */
115
+ setSduiFrame(background: string | undefined, scheme: 'light' | 'dark'): void;
116
+ /** A claim is the way out a non-dismissible sheet allows, so its closes return. */
117
+ unlockClose(): void;
118
+ /** Re-read the detents, as a served variant's state change can move them. */
119
+ refreshSheet(): void;
89
120
  /**
90
121
  * Check if modal is currently visible
91
122
  */
@@ -1 +1 @@
1
- {"version":3,"file":"OfferModal.d.ts","sourceRoot":"","sources":["../../src/ui/OfferModal.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAI/C,UAAU,aAAc,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrD,KAAK,EAAE,IAAI,CAAC;IACZ,aAAa,EAAE,IAAI,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;;OAcG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;;;;;;;;;;;;;;OAkBG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAI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IAInB,6EAA6E;IAC7E,YAAY,IAAI,IAAI;IAIpB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAI/B;;;;;OAKG;IACH,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,IAAI;IAS3C,2EAA2E;IAC3E,cAAc,IAAI,iBAAiB,GAAG,IAAI;IAe1C;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IA8BtC;;OAEG;IACH,EAAE,CAAC,CAAC,SAAS,MAAM,aAAa,EAC9B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,IAAI,GAC3C,MAAM,IAAI;IAoMb;;OAEG;IACH,OAAO,IAAI,IAAI;CAoBhB"}
@@ -24,6 +24,8 @@ export interface PrimerScreenConfig {
24
24
  name?: string;
25
25
  logoUrl?: string;
26
26
  imageUrl?: string;
27
+ /** The claimed offer is a KNOWN free trial; gates the holding story's no-charge line. */
28
+ freeTrial?: boolean;
27
29
  };
28
30
  }
29
31
  interface PrimerScreenEventMap extends Record<string, unknown> {
@@ -1 +1 @@
1
- {"version":3,"file":"PrimerScreen.d.ts","sourceRoot":"","sources":["../../src/ui/PrimerScreen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGpE,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,SAAS,CAAC;AAErD,MAAM,WAAW,kBAAkB;IACjC,oFAAoF;IACpF,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,iEAAiE;IACjE,OAAO,EAAE,WAAW,CAAC;IACrB,oDAAoD;IACpD,OAAO,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,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OAAO,EAAE,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,IAAI,GAClD,MAAM,IAAI;IAIb,OAAO,IAAI,IAAI;CAQhB"}
@@ -37,6 +37,11 @@ export interface RedemptionScreenConfig {
37
37
  };
38
38
  /** Optional CTA override; the default is exactly "Claim your reward". */
39
39
  buttonText?: string;
40
+ /**
41
+ * The claimed offer is a KNOWN free trial. Only then does the note promise "no
42
+ * payment now, cancel anytime"; otherwise it names the destination and nothing more.
43
+ */
44
+ freeTrial?: boolean;
40
45
  }
41
46
  interface RedemptionScreenEventMap extends Record<string, unknown> {
42
47
  /** The user tapped the claim CTA — the caller fires the advertiser redirect. */
@@ -1 +1 @@
1
- {"version":3,"file":"RedemptionScreen.d.ts","sourceRoot":"","sources":["../../src/ui/RedemptionScreen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,QAAQ,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,gFAAgF;IAChF,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,8CAA8C;QAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,gEAAgE;QAChE,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,wBAAyB,SAAQ,MAAM,CA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;;;;;GAmBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,UAAU;;gBAMT,OAAO,GAAE,iBAAsB;IAI3C,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW;IA2GjC,OAAO,IAAI,IAAI;CAKhB"}
1
+ {"version":3,"file":"RewardCard.d.ts","sourceRoot":"","sources":["../../src/ui/RewardCard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AAQzD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,WAAW,iBAAiB;IAChC,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qBAAa,UAAU;;gBAMT,OAAO,GAAE,iBAAsB;IAI3C,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW;IA2GjC,OAAO,IAAI,IAAI;CAKhB"}
@@ -0,0 +1,145 @@
1
+ /**
2
+ * The SDUI engine, as a `RewardSurface`.
3
+ *
4
+ * The other four surfaces are hand-written compositions chosen by variant NAME
5
+ * (`core/giftVariant.ts`), so every new design costs a release. This one renders
6
+ * whatever the backend served, which is the whole point of SDUI, and it is the
7
+ * same division of labour iOS and Android use: the engine draws and owns the
8
+ * state machine, the host owns the claim.
9
+ *
10
+ * 🔴 IT STILL DOES NOT CLAIM. `RewardSurface`'s contract is that a surface emits
11
+ * `offerClaim` and `Encore.#runOfferFlow` does the rest, so the transaction, the
12
+ * funnel events and the advertiser handoff stay on one path for all five
13
+ * surfaces. A variant's `claimOffer` action lands here and becomes that event;
14
+ * it never reaches the network from inside the engine.
15
+ *
16
+ * What it does NOT implement is as load bearing:
17
+ *
18
+ * - `scroll` is never emitted. Nothing in the engine moves `currentIndex` when a
19
+ * carousel settles, so it does not know which card a user scrolled to. Emitting
20
+ * a position it guessed would be worse than emitting nothing.
21
+ * - `complete` is never emitted. That means "the carousel ran out of cards", and
22
+ * an SDUI variant has no last card: it has states, and its own `close` action
23
+ * is the way out.
24
+ */
25
+ import { ImpressionGate } from './impressionGate';
26
+ import type { ShareDestinationValue, ShareFailureReasonValue } from '../analytics/events';
27
+ import type { HostOffer, SduiAnalyticsEvent } from '../sdui/host';
28
+ import type { OfferModel as Offer } from '../api/models';
29
+ import type { RewardSurface, RewardSurfaceEventMap } from './rewardSurface';
30
+ /** A share's facts, for the host to stamp and report as the `sdk_offer_share_*` events. */
31
+ export type SduiShareEvent = {
32
+ offer: Offer;
33
+ index: number;
34
+ } & ({
35
+ kind: 'tapped';
36
+ } | {
37
+ kind: 'failed';
38
+ reason: ShareFailureReasonValue;
39
+ } | {
40
+ kind: 'completed';
41
+ completed: boolean;
42
+ destination?: ShareDestinationValue;
43
+ });
44
+ export interface SduiRewardSurfaceOptions {
45
+ /** The tree `Encore.ts` cached from `/config`, exactly as served. */
46
+ readonly template: unknown;
47
+ /** Resolves an SDUI colour operand; see `ui/sduiTheme.ts`. */
48
+ readonly color: (raw: unknown) => string | undefined;
49
+ /** `${token}` copy: the remote config text plus the backend-resolved variables. */
50
+ readonly variables: Readonly<Record<string, string>>;
51
+ /** Stamped and forwarded by the host; see `sdui/host.ts` for why the engine reports facts. */
52
+ readonly analytics?: (event: SduiAnalyticsEvent) => void;
53
+ /** Disables the claim path without hiding the control, as the other surfaces do. */
54
+ readonly claimEnabled?: boolean;
55
+ /** The presentation's impression gate; see `impressionGate.ts`. */
56
+ readonly impressions?: ImpressionGate;
57
+ /** The colour scheme `color` was built for; see `colorScheme.ts`. Light when absent. */
58
+ readonly scheme?: 'light' | 'dark';
59
+ }
60
+ /**
61
+ * Map the SDK's offer onto the engine's.
62
+ *
63
+ * `title` and `description` are the CREATIVE's, which is what every binding in
64
+ * every served variant reads. `advertiserUrl`, `campaignId` and `creativeId` are
65
+ * deliberately not carried: a variant cannot address them, and the claim flow
66
+ * reads them off the real `Offer` it was handed rather than off the engine.
67
+ */
68
+ export declare function toHostOffer(offer: Offer): HostOffer;
69
+ export declare class SduiRewardSurface implements RewardSurface {
70
+ #private;
71
+ private constructor();
72
+ /**
73
+ * Mount the served template, or hand back undefined.
74
+ *
75
+ * A factory rather than a constructor because mounting can FAIL: a variant
76
+ * naming an element, condition or enum value this build does not know fails the
77
+ * whole config by design, and the caller then falls back to the hand-written
78
+ * surface. A constructor would have to throw into the presentation path to say
79
+ * so, and the one thing this must never do is take the sheet down with it.
80
+ */
81
+ static create(offers: readonly Offer[], options: SduiRewardSurfaceOptions): SduiRewardSurface | undefined;
82
+ /** Internal, for the action host's closures. */
83
+ private emit;
84
+ private setSelectedIndex;
85
+ on<E extends keyof RewardSurfaceEventMap>(event: E, handler: (payload: RewardSurfaceEventMap[E]) => void): () => void;
86
+ render(): HTMLElement;
87
+ /**
88
+ * The variant's canvas colour: the topmost opaque background that covers most
89
+ * of the root, or undefined. Read after layout, for the desktop backdrop.
90
+ */
91
+ canvasColor(): string | undefined;
92
+ /**
93
+ * What the frame around the variant paints: its `background` token, as iOS's
94
+ * `presentationBackground` is, and the scheme for the browser's own controls.
95
+ */
96
+ frame(): {
97
+ background: string | undefined;
98
+ scheme: 'light' | 'dark';
99
+ };
100
+ getTotalOffers(): number;
101
+ getCurrentIndex(): number;
102
+ getSelectedOffer(): Offer | undefined;
103
+ selectOffer(index: number): void;
104
+ next(): void;
105
+ claimSelected(): void;
106
+ /**
107
+ * Ask the host to dismiss. SDUI only, so it is NOT on `RewardSurface`.
108
+ *
109
+ * The other four surfaces have no dismissal control of their own: the modal
110
+ * owns the floating ×. A served tree draws its own, and a variant also ends
111
+ * itself by transitioning to the state named `close`. Putting this on the
112
+ * shared seam would give four surfaces an event they can never emit.
113
+ */
114
+ onRequestClose(handler: () => void): void;
115
+ requestClose(): void;
116
+ /** The variant's current state, which picks its per-state detents. */
117
+ get currentState(): string | undefined;
118
+ /** Hear every state change, from the variant or from the host. */
119
+ onStateChange(handler: (state: string) => void): void;
120
+ /** @internal The action host's hook; the host calls `setState`. */
121
+ notifyStateChange(state: string): void;
122
+ /** Report share facts to the host. SDUI only, like `onRequestClose`. */
123
+ onShare(handler: (event: SduiShareEvent) => void): void;
124
+ /**
125
+ * Share an offer's minted link, as Swift's `handleShare` does.
126
+ *
127
+ * One at a time. Every tap ends in `completed` or `failed`, so the funnel can
128
+ * tell "no link" from "cancelled". A cancel changes nothing on the sheet; a
129
+ * completed share moves to `onSuccessState`, where `close` ends the sheet.
130
+ */
131
+ share(offerId: string | undefined, onSuccessState?: string): Promise<void>;
132
+ /** The variant's own state machine, for the host's post-claim transitions. */
133
+ setState(state: string): void;
134
+ /**
135
+ * Move to `target`, where the state named `close` means END THE SHEET.
136
+ *
137
+ * That convention is the variant's, not this SDK's: `close` is authored as a
138
+ * state and iOS dismisses on it rather than setting it
139
+ * (`OfferSheetViewModel.applyTransition`). Setting it instead would leave the
140
+ * sheet on a state no branch renders, which is a blank sheet.
141
+ */
142
+ applyTransition(target: string): void;
143
+ destroy(): void;
144
+ }
145
+ //# sourceMappingURL=SduiRewardSurface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SduiRewardSurface.d.ts","sourceRoot":"","sources":["../../src/ui/SduiRewardSurface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAeH,OAAO,EAAE,cAAc,EAAmB,MAAM,kBAAkB,CAAC;AAGnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAe,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE5E,2FAA2F;AAC3F,MAAM,MAAM,cAAc,G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GAAG,IAAI;IAQrC,OAAO,IAAI,IAAI;CAWhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/ui/Tooltip.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,OAAO;;gBAWN,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc;IA8K/D;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAQpC;;OAEG;IACH,OAAO,IAAI,IAAI;CA4BhB"}
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../src/ui/Tooltip.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,OAAO;;gBAaN,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc;IA6L/D;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAQpC;;OAEG;IACH,OAAO,IAAI,IAAI;CA8BhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"brandComponents.d.ts","sourceRoot":"","sources":["../../src/ui/brandComponents.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AA8CD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAA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ED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,IAAI,GAClB,iBAAiB,CAOnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"brandTint.d.ts","sourceRoot":"","sources":["../../src/ui/brandTint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,kFAAkF;AAClF,eAAO,MAAM,eAAe,MAAM,CAAC;AA2InC;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD;AA4BD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAuC9E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAmC9E"}
1
+ {"version":3,"file":"brandTint.d.ts","sourceRoot":"","sources":["../../src/ui/brandTint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,kFAAkF;AAClF,eAAO,MAAM,eAAe,MAAM,CAAC;AA2InC;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGjD;AA4BD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CAuC9E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoC9E"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The colour scheme a served variant renders in, as iOS picks it: the server's
3
+ * `values.appearance.mode` when it says `light` or `dark`, else the device.
4
+ *
5
+ * iOS's `auto` follows the device only for an app that supports dark mode; one
6
+ * that declares light only keeps its sheets light. A web page says the same with
7
+ * CSS `color-scheme` or `<meta name="color-scheme">`, so `auto` goes dark only
8
+ * when the page supports dark AND the device prefers it. A light-only site never
9
+ * opens a dark sheet.
10
+ */
11
+ export type ColorScheme = 'light' | 'dark';
12
+ export declare function sduiColorScheme(serverMode: unknown, doc?: Document): ColorScheme;
13
+ /** Whether the page declares that it supports a dark scheme. */
14
+ export declare function pageSupportsDark(doc: Document): boolean;
15
+ //# sourceMappingURL=colorScheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorScheme.d.ts","sourceRoot":"","sources":["../../src/ui/colorScheme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3C,wBAAgB,eAAe,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,GAAE,QAAmB,GAAG,WAAW,CAG1F;AAUD,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAWvD"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Whether something the app put on screen sits over a trigger: a modal, a dialog, an
3
+ * overlay, anything presented above it, not only an Encore sheet. Asked at the trigger's
4
+ * centre, the way a tap would land: the top element there must be the trigger or inside
5
+ * it. Inside shadow roots the document only reports the outermost shadow host, so each
6
+ * shadow root down to the trigger's is asked in turn.
7
+ *
8
+ * Unknowable is not covered: no area, a centre off screen, nothing at the point, or a
9
+ * browser without `elementFromPoint`. Visibility and the observed ratio decide those.
10
+ */
11
+ export declare function isCovered(root: Element): boolean;
12
+ //# sourceMappingURL=covered.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"covered.d.ts","sourceRoot":"","sources":["../../src/ui/covered.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CA+BhD"}
@@ -18,4 +18,17 @@ export declare const DEFAULT_GIFT_CATEGORY_GROUP: GiftCategoryGroup;
18
18
  export declare const GIFT_CATEGORY_GROUP_BY_TAXONOMY: Readonly<Record<string, GiftCategoryGroup>>;
19
19
  /** The tab for a served category. Absent, blank and unknown all file under Everyday. */
20
20
  export declare function giftCategoryGroup(category: string | null | undefined): GiftCategoryGroup;
21
+ /**
22
+ * The tab for an offer: the server's `categoryGroup` when it names one of the tabs,
23
+ * else its `category` mapped here (an older backend, or a group this SDK predates).
24
+ */
25
+ export declare function offerCategoryGroup(offer: {
26
+ category?: string;
27
+ categoryGroup?: string;
28
+ } | undefined): GiftCategoryGroup;
29
+ /**
30
+ * The tab label for a group: the served `gift.category*` string, else the server's
31
+ * display name for the group from `/offers/search`, else the English.
32
+ */
33
+ export declare function giftCategoryLabel(group: GiftCategoryGroup, displayName?: string): string;
21
34
  //# sourceMappingURL=giftCategoryGroups.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"giftCategoryGroups.d.ts","sourceRoot":"","sources":["../../src/ui/giftCategoryGroups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,mDAAmD;AACnD,eAAO,MAAM,oBAAoB,kDAAmD,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,2DAA2D;AAC3D,eAAO,MAAM,2BAA2B,EAAE,iBAA8B,CAAC;AAEzE,8EAA8E;AAC9E,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAmBvF,CAAC;AAYF,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,iBAAiB,CAaxF"}
1
+ {"version":3,"file":"giftCategoryGroups.d.ts","sourceRoot":"","sources":["../../src/ui/giftCategoryGroups.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,mDAAmD;AACnD,eAAO,MAAM,oBAAoB,kDAAmD,CAAC;AAErF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,2DAA2D;AAC3D,eAAO,MAAM,2BAA2B,EAAE,iBAA8B,CAAC;AAEzE,8EAA8E;AAC9E,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAmBvF,CAAC;AAYF,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,iBAAiB,CAaxF;AASD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAC/D,iBAAiB,CAGnB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAExF"}
@@ -23,6 +23,9 @@ import type { OfferModel as Offer } from '../api/models';
23
23
  /**
24
24
  * Copy the gift presentation hard-codes, mirroring `RewardActions`' REWARD_COPY.
25
25
  * Named so tests can assert by symbol rather than by literal.
26
+ *
27
+ * Every key reads through the strings provider as `gift.<key>`, with the English
28
+ * below as the fallback (see `core/strings.ts`).
26
29
  */
27
30
  export declare const GIFT_COPY: {
28
31
  /** Row / CTA fallback when the offer carries no usable name at all. */
@@ -72,19 +75,19 @@ export declare const GIFT_COPY: {
72
75
  readonly sheetTitle: "Other gifts";
73
76
  /** Under the CTA. A middot separator, matching the artifact. */
74
77
  readonly terms: "One gift per person · Offer terms";
75
- /** `giftPicker`: the same sentence split into lead and link, so "Offer terms" can link. */
76
- readonly pickerTermsLead: "One gift per person ·";
78
+ /** `giftPicker`: the same sentence as ONE template, `${link}` holding "Offer terms". */
79
+ readonly pickerTermsLine: "One gift per person · ${link}";
77
80
  readonly pickerTermsLink: "Offer terms";
78
81
  /** `giftPicker`: the underlined link above the CTA that opens the other-gifts sheet. */
79
82
  readonly moreGifts: "More gifts";
80
83
  /** `giftPicker`'s CTA fallback when nothing about the gift fits the label. */
81
84
  readonly getFallback: "Get your gift";
82
85
  /**
83
- * The `giftList` / `giftUnwrap` terms line, in two parts because the second is the
84
- * link: "By proceeding you agree to our offer terms". Rendered by `ui/termsLine.ts`,
85
- * which supplies the space between them.
86
+ * The `giftList` / `giftUnwrap` terms line, ONE template whose `${link}` is the
87
+ * link run (`termsLink`), so a translation places the link where its grammar puts
88
+ * it. Rendered by `ui/termsLine.ts`.
86
89
  */
87
- readonly termsLead: "By proceeding you agree to our";
90
+ readonly termsLine: "By proceeding you agree to our ${link}";
88
91
  readonly termsLink: "offer terms";
89
92
  /** The gift radio group's accessible name. Screen-reader copy is still copy. */
90
93
  readonly chooseLabel: "Choose your gift";
@@ -93,10 +96,12 @@ export declare const GIFT_COPY: {
93
96
  /** The sheet's category tab strip, for assistive tech. Only rendered with 2+ tabs. */
94
97
  readonly sheetCategoriesLabel: "Gift categories";
95
98
  /**
96
- * `giftList`: the word beside the host app's icon above the headline, so the pair
97
- * reads "{icon} Presents". The icon IS the subject; without one the row is omitted.
99
+ * `giftList`: the row above the headline, ONE template whose `${logo}` is the host
100
+ * app's icon, so a translation places the icon where its grammar puts it. The icon IS
101
+ * the subject; without one the row is omitted. Spacing comes from the row's gap, so
102
+ * whitespace around the slot is ignored. Rendered by `GiftList.renderHero`.
98
103
  */
99
- readonly presents: "Presents";
104
+ readonly presents: "${logo} Presents";
100
105
  /** `giftList`: the link under the rows that opens the "Other gifts" sheet. */
101
106
  readonly showMore: "Show more gifts";
102
107
  };
@@ -1 +1 @@
1
- {"version":3,"file":"giftCopy.d.ts","sourceRoot":"","sources":["../../src/ui/giftCopy.ts"],"names":[],"mappings":"AAAA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,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAoBnF;AAED,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAavF;AAYD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAenF"}
@@ -1 +1 @@
1
- {"version":3,"file":"giftUnwrapCopy.d.ts","sourceRoot":"","sources":["../../src/ui/giftUnwrapCopy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AAIzD,eAAO,MAAM,WAAW;IACtB,0DAA0D;;IAE1D,uEAAuE;;IAEvE;yDACqD;;IAErD,kEAAkE;;;CAG1D,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAKvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAGrD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CAiBzD;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;IAGrB,kFAAkF;;IAElF,yFAAyF;;IAEzF,gFAAgF;;CAExE,CAAC;AAEX;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAG3D"}
1
+ {"version":3,"file":"giftUnwrapCopy.d.ts","sourceRoot":"","sources":["../../src/ui/giftUnwrapCopy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AAKzD,eAAO,MAAM,WAAW;IACtB,0DAA0D;;IAE1D,uEAAuE;;IAEvE;yDACqD;;IAErD,kEAAkE;;;CAGzD,CAAC;AAEZ;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAOvD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAGrD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CA2BzD;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU;;;IAGrB,kFAAkF;;IAElF,yFAAyF;;IAEzF,gFAAgF;;CAEvE,CAAC;AAEZ;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAG3D"}
@@ -0,0 +1,44 @@
1
+ import type { OfferModel } from '../api/models';
2
+ /** Widths the asset CDN serves at `/w/{W}/{path}`. */
3
+ export declare const IMAGE_WIDTH_LADDER: readonly [320, 640, 960, 1280];
4
+ /**
5
+ * Must match PUBLIC_ROOTS in the backend. A prefix missing here fails nowhere:
6
+ * the image is just fetched at full size forever. 256 of the 320 bucket-hosted
7
+ * creative logos are under /organizations/.
8
+ */
9
+ export declare const LADDER_PATH_PREFIXES: string[];
10
+ /** Rendered CSS width of the offer card banner, the largest image the SDK draws. */
11
+ export declare const OFFER_BANNER_CSS_WIDTH = 460;
12
+ /** Width every logo and icon resolves at (Swift `logoWidthPoints`); all draw at 96px or less. */
13
+ export declare const LOGO_CSS_WIDTH = 96;
14
+ /** Width SDUI pictures resolve at (Swift `defaultCardWidthPoints`): the 720px stage, or the viewport. */
15
+ export declare function cardCssWidth(): number;
16
+ /** Smallest ladder width at least `renderedWidthCssPx * devicePixelRatio`, capped at the largest. */
17
+ export declare function resolveImageURL(url: string, renderedWidthCssPx: number, devicePixelRatio: number): string;
18
+ /** `srcset` over the whole ladder, or undefined for hosts without variants. */
19
+ export declare function ladderSrcset(url: string): string | undefined;
20
+ /** The original a ladder URL was resolved from, for when its variant cannot be served. Swift: `originalURL(fromLadder:)`. */
21
+ export declare function originalFromLadder(url: string): string | undefined;
22
+ /**
23
+ * Point `img` at a safe `src` sized for `cssWidth`. Pass `lazy: false` for images
24
+ * that load while detached or hidden (a lazy image there does not load until shown).
25
+ * `recordDraw: false` is for a preload, which is not a view the impression can wait on.
26
+ */
27
+ export declare function setImageSource(img: HTMLImageElement, src: string, cssWidth: number, lazy?: boolean, recordDraw?: boolean): void;
28
+ /** Lets `imageCacheHit` see an image the SDK draws as a CSS background. */
29
+ export declare function trackBackgroundImage(url: string): void;
30
+ /** Test seam: how many background probes are still held. */
31
+ export declare function pendingBackgroundProbes(): number;
32
+ /** Test seam: forgets every recorded draw, load, failure and probe. */
33
+ export declare function resetImageReadinessForTesting(): void;
34
+ /** Drop the ladder candidates so a fallback `src` (placeholder) actually shows. */
35
+ export declare function clearImageSource(img: HTMLImageElement): void;
36
+ /** Warm the browser cache for one image, choosing the same candidate the render will. */
37
+ export declare function preloadImage(url: string | undefined, cssWidth: number): void;
38
+ /**
39
+ * `image_cache_hit`, ready when shown, with Swift's rule: only the picture counts, the creative
40
+ * else the logo. First, whether it was already loaded when the SDK drew it. With no draw yet,
41
+ * what the page shows now, then a successful earlier load. Undefined when it cannot tell.
42
+ */
43
+ export declare function imageCacheHit(offer: Pick<OfferModel, 'imageUrl' | 'logoUrl'>): boolean | undefined;
44
+ //# sourceMappingURL=imageURL.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imageURL.d.ts","sourceRoot":"","sources":["../../src/ui/imageURL.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,sDAAsD;AACtD,eAAO,MAAM,kBAAkB,gCAAiC,CAAC;AAIjE;;;;GAIG;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20
20
  /** The share of an element that must be inside the viewport for it to count as seen. */
21
21
  export declare const IMPRESSION_VISIBLE_RATIO = 0.5;
22
+ /**
23
+ * The ratios the observer reports at.
24
+ *
25
+ * A single `0.5` threshold only delivers a callback when the ELEMENT ratio crosses one
26
+ * half, which an element larger than the viewport never does — so the moment it comes
27
+ * to fill the screen would arrive unannounced. The ramp costs a handful of extra
28
+ * callbacks and makes that moment observable to within a tenth of the element.
29
+ */
30
+ export declare const OBSERVER_THRESHOLDS: number[];
22
31
  /**
23
32
  * How much of an element counts as on screen, as a share of the SMALLER of the element
24
33
  * and the viewport.
@@ -1 +1 @@
1
- {"version":3,"file":"impressionGate.d.ts","sourceRoot":"","sources":["../../src/ui/impressionGate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,wFAAwF;AACxF,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAuB5C;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,MAAM,CAWrE;AAED,MAAM,WAAW,6BAA6B;IAC5C,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC;CAC1B;AASD,qBAAa,cAAc;;gBAgBb,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO;IAIhD;;;OAGG;IACH,QAAQ,CACN,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,IAAI,EACnB,OAAO,GAAE,6BAAkC,GAC1C,MAAM,IAAI;IAwBb,gFAAgF;IAChF,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAM3C,6EAA6E;IAC7E,OAAO,IAAI,IAAI;IAKf,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI9B,OAAO,IAAI,IAAI;CAmNhB;AAED;;;GAGG;AACH,qBAAa,eAAe;;gBAId,IAAI,EAAE,cAAc;IAIhC,QAAQ,CACN,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,IAAI,EACnB,OAAO,CAAC,EAAE,6BAA6B,GACtC,IAAI;IAIP,KAAK,IAAI,IAAI;CAKd"}
1
+ {"version":3,"file":"impressionGate.d.ts","sourceRoot":"","sources":["../../src/ui/impressionGate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,wFAAwF;AACxF,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,UAAsD,CAAC;AAavF;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,yBAAyB,GAAG,MAAM,CAarE;AAED,MAAM,WAAW,6BAA6B;IAC5C,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC;CAC1B;AASD,qBAAa,cAAc;;gBAmBb,OAAO,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAO;IAIhD;;;OAGG;IACH,QAAQ,CACN,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,IAAI,EACnB,OAAO,GAAE,6BAAkC,GAC1C,MAAM,IAAI;IAwBb,gFAAgF;IAChF,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAM3C,6EAA6E;IAC7E,OAAO,IAAI,IAAI;IAOf,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI9B,OAAO,IAAI,IAAI;CA+OhB;AAED;;;GAGG;AACH,qBAAa,eAAe;;gBAId,IAAI,EAAE,cAAc;IAIhC,QAAQ,CACN,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,IAAI,EACnB,OAAO,CAAC,EAAE,6BAA6B,GACtC,IAAI;IAIP,KAAK,IAAI,IAAI;CAKd"}
@@ -1 +1 @@
1
- {"version":3,"file":"offerBadge.d.ts","sourceRoot":"","sources":["../../src/ui/offerBadge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD;;;;;;;;GAQG;AACH,KAAK,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;AA2C9F;;;;;GAKG;AACH,eAAO,MAAM,aAAa,cAAc,CAAC;AAEzC,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CASrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAExE"}
1
+ {"version":3,"file":"offerBadge.d.ts","sourceRoot":"","sources":["../../src/ui/offerBadge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD;;;;;;;;GAQG;AACH,KAAK,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;AA8D9F;;;;;GAKG;AACH,eAAO,MAAM,aAAa,cAAc,CAAC;AAGzC,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CASrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,OAAO,CAExE"}
@@ -39,10 +39,20 @@ import type { OfferModel as Offer } from '../api/models';
39
39
  * way to express that distinction, so it is disabled here specifically.
40
40
  */
41
41
  export type RewardSurfaceEventMap = {
42
- /** The user asked to claim the given offer. The ONLY entry point to the claim flow. */
42
+ /**
43
+ * The user asked to claim the given offer. The ONLY entry point to the claim flow.
44
+ *
45
+ * `successState` is the served variant's `onSuccessState`, and only the SDUI
46
+ * surface ever sets it: the four hand-written surfaces author no post-claim
47
+ * screen. When it is present the flow keeps the sheet up and moves the variant
48
+ * to that state instead of dismissing, which is what iOS does in
49
+ * `OfferSheetViewModel.finishClaimFlow`. Delivery then happens on the sheet's
50
+ * close, through the claim latch every dismissal path already reads.
51
+ */
43
52
  offerClaim: {
44
53
  offer: Offer;
45
54
  index: number;
55
+ successState?: string;
46
56
  };
47
57
  /** An impression: this offer was seen. Grain differs per surface — see GiftReveal. */
48
58
  offerView: {
@@ -1 +1 @@
1
- {"version":3,"file":"rewardSurface.d.ts","sourceRoot":"","sources":["../../src/ui/rewardSurface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;AAEzD;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,qBAAqB,GAAG;IAClC,uFAAuF;IACvF,UAAU,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,sFAAsF;IACtF,SAAS,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,sEAAsE;IACtE,WAAW,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,qBAAqB;IACrB,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,2DAA2D;IAC3D,MAAM,EAAE;QAAE,IAAI,EAAE,YAAY,GAAG,UAAU,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,uEAAuE;IACvE,QAAQ,EAAE;QAAE,OAAO,EAAE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AU,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,uEAAuE;IACvE,QAAQ,EAAE;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CAChC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,CAAC,SAAS,MAAM,qBAAqB,EACtC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,CAAC,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,IAAI,GACnD,MAAM,IAAI,CAAC;IACd,MAAM,IAAI,WAAW,CAAC;IACtB,OAAO,IAAI,IAAI,CAAC;IAChB,uFAAuF;IACvF,aAAa,IAAI,IAAI,CAAC;IACtB,cAAc,IAAI,MAAM,CAAC;IACzB,eAAe,IAAI,MAAM,CAAC;IAC1B,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,IAAI,IAAI,IAAI,CAAC;CACd"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The host half of an SDUI colour: a variant names a token, this says what it is.
3
+ *
4
+ * A served variant never carries a palette. It names `{"appearance": "accent"}` or
5
+ * `{"semantic": "secondaryLabel"}` and the HOST decides, which is how one template
6
+ * renders in a publisher's own colours. iOS does the same in `Appearance(from:
7
+ * uiValues, overrides:)`.
8
+ *
9
+ * Every token resolves to something. A token the host leaves out resolves to
10
+ * nothing and simply does not paint, and a missing
11
+ * `secondarySystemGroupedBackground` costs the offer rows their card backgrounds,
12
+ * which reads as an engine layout bug rather than a gap here. The defaults below
13
+ * are iOS light mode, so the floor is a sheet that looks like the native one.
14
+ *
15
+ * `binding` and the `lighten` / `darken` / `opacity` transforms are NOT handled
16
+ * here: the engine resolves those against its own values dictionary and calls
17
+ * this only for the base operand.
18
+ */
19
+ /** What a publisher can override, which is the same three the surfaces take. */
20
+ export interface SduiThemeOverrides {
21
+ /** `appearance.accentColor`: buttons, selection rings, the highlighted run. */
22
+ accent?: string;
23
+ /** `appearance.backgroundColor`: the sheet behind the cards. */
24
+ background?: string;
25
+ /** `appearance.textColor`: the primary label colour. */
26
+ text?: string;
27
+ /** The server's `values.appearance.accentColor`, below a publisher's `accent`. */
28
+ serverAccent?: string | null | undefined;
29
+ /** The server's `values.appearance.accentTitleColor`. */
30
+ serverAccentTitle?: string | null | undefined;
31
+ /** The presentation's colour scheme; see `ui/colorScheme.ts`. Light when absent. */
32
+ scheme?: 'light' | 'dark' | undefined;
33
+ }
34
+ /**
35
+ * Resolve an SDUI colour operand for this presentation.
36
+ *
37
+ * The accents resolve as Swift's `Appearance(from:)` does, from the server's
38
+ * values, with a publisher's own `accent` on top because only web has one. An
39
+ * override reaches more than the token it names: `text` moves the three label
40
+ * tokens that ARE the primary label.
41
+ */
42
+ export declare function createSduiColorResolver(overrides?: SduiThemeOverrides): (raw: unknown) => string | undefined;
43
+ /**
44
+ * A hex as Swift's `Color(hex:)` reads it: `#` optional, and 8 digits are AARRGGBB,
45
+ * where CSS reads RRGGBBAA. Anything else is dropped.
46
+ */
47
+ export declare function swiftHex(raw: string): string | undefined;
48
+ //# sourceMappingURL=sduiTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sduiTheme.d.ts","sourceRoot":"","sources":["../../src/ui/sduiTheme.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,gFAAgF;AAChF,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,yDAAyD;IACzD,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9C,oFAAoF;IACpF,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CACvC;AAiDD;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,GAAE,kBAAuB,GACjC,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAmDtC;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIxD"}