@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
@@ -0,0 +1,65 @@
1
+ /**
2
+ * ClaimReminder, trigger plug-in #1: a card that reminds the user of their newest
3
+ * open claim, and on tap opens the Encore sheet for its use case and placement,
4
+ * where that offer is still listed. Behaviour is the cross-platform contract
5
+ * (contract.md, "Trigger behaviour"); the drawing is the served SDUI tree, fed by
6
+ * bindings.ts (trigger SDUI vocabulary contract §2). Everything every
7
+ * trigger shares (the config request, events, visibility, dismiss storage, identity
8
+ * re-runs, the sheet's presentation id) is the host's (triggers/host/TriggerHost.ts).
9
+ */
10
+ import type { UseCase } from '../../types';
11
+ import type { SheetCheck, TriggerPlugin } from '../host/types';
12
+ import { type ReminderConfig } from './config';
13
+ import type { ClaimReminderSource, ReminderClaim } from './source';
14
+ import { type TriggerSduiModel } from '../host/sduiView';
15
+ export declare const CLAIM_REMINDER_ID: "claimReminder";
16
+ /** What the gate found: the open claims, and the campaigns the sheet holds for the tap. */
17
+ export interface ReminderContent {
18
+ useCase: UseCase;
19
+ /** The open claims the sheet still holds; empty when only a completion is left. */
20
+ claims: ReminderClaim[];
21
+ campaignIds: ReadonlySet<string>;
22
+ /**
23
+ * No claim to remind about, and an offer finished today that was not thanked yet (the
24
+ * request's `completed` state): its claim's id. Encore answers with the thanks look or
25
+ * nothing, as the look's behavior says.
26
+ */
27
+ completion?: string;
28
+ /** The reminder window the gate used (the one last served here), in hours. */
29
+ windowHours?: number;
30
+ }
31
+ /** What one render of the card shows: the served tree and what it binds. */
32
+ export interface ReminderModel extends TriggerSduiModel {
33
+ useCase: UseCase;
34
+ placement: string | undefined;
35
+ /** The thanks look is drawn: a tap opens the sheet and ends it. */
36
+ thanks?: true;
37
+ }
38
+ export interface ClaimReminderDeps {
39
+ /**
40
+ * The claims adapter, read at call time. The SDK's is never null: this browser's claim
41
+ * log, merged with the claims bank once one is bound. Null renders nothing.
42
+ */
43
+ source(): ClaimReminderSource | null;
44
+ /**
45
+ * Whether the sheet for `useCase` at `placement` would open with offers, and which
46
+ * campaigns it holds (the same gate as GiftsButton's). `fresh` skips the held search.
47
+ */
48
+ checkSheet(useCase: UseCase, placement: string | undefined, fresh: boolean): Promise<SheetCheck>;
49
+ /**
50
+ * A tap about to open the sheet: false when the shown claim is known to have ended
51
+ * (synchronous: the sheet opens inside the click). Absent: always open.
52
+ */
53
+ claimTapped?(transactionId: string): boolean;
54
+ /**
55
+ * An offer finished today with none claimed since, not thanked yet: its claim's id
56
+ * (the `completed` state). Absent or null: none.
57
+ */
58
+ thanksFor?(): string | null;
59
+ /** The thanks look was tapped: it ends for the user's latest completion. */
60
+ thanksTapped?(): void;
61
+ /** Device storage for the window last served at each placement. Absent: the 24 hour default. */
62
+ storage?(): Storage | null;
63
+ }
64
+ export declare function claimReminderPlugin(deps: ClaimReminderDeps): TriggerPlugin<ReminderContent, ReminderConfig, ReminderModel>;
65
+ //# sourceMappingURL=ClaimReminder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClaimReminder.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/ClaimReminder.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAM3C,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAqB,MAAM,eAAe,CAAC;AAElF,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,UA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AAC,CAwO/D"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * What the claim reminder hands the SDUI engine (trigger SDUI contract §2.2 to
3
+ * §2.5): its values, its two time keys and its lists, built from the eligible
4
+ * claims. The served tree draws them; nothing here draws.
5
+ */
6
+ import type { TriggerIconValues } from '../host/theme';
7
+ import type { SduiHostListItem } from '../../sdui/context';
8
+ import type { ReminderCopy } from './config';
9
+ import type { ReminderClaim } from './source';
10
+ export interface ReminderBindings {
11
+ values: Record<string, string>;
12
+ times: {
13
+ start: number;
14
+ deadline: number;
15
+ };
16
+ lists: Record<string, SduiHostListItem[]>;
17
+ }
18
+ export interface ReminderBindingInput {
19
+ copy: ReminderCopy;
20
+ windowHours: number;
21
+ /** The served layout name, exposed as `${layout}`. */
22
+ layout: string;
23
+ /** The icon the look draws, exposed as `${icon}` and `${appIconUrl}`. */
24
+ icon: TriggerIconValues;
25
+ /** Every string the served look declares (`template.strings`), each exposed as a value. */
26
+ lookStrings?: Readonly<Record<string, string>>;
27
+ /** The look's value defaults with the mount's values over them, for `${values.K}`. */
28
+ lookValues?: Readonly<Record<string, string>>;
29
+ /**
30
+ * The string the look's headline text slot names (`textSlots.headline`), already holding
31
+ * the app's headline when it set one: the spoken title on a named claim, as the card draws it.
32
+ */
33
+ headlineKey?: string | null;
34
+ }
35
+ /**
36
+ * The bindings for the newest eligible claim. `eligible` is newest first, as
37
+ * `eligibleClaims` returns it, and not empty.
38
+ */
39
+ export declare function reminderBindings(eligible: readonly ReminderClaim[], input: ReminderBindingInput): ReminderBindings;
40
+ //# sourceMappingURL=bindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/bindings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQ9C,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,IAAI,EAAE,iBAAiB,CAAC;IACxB,2FAA2F;IAC3F,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,sFAAsF;IACtF,UAAU,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC9C;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAsDD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,KAAK,EAAE,oBAAoB,GAC1B,gBAAgB,CAqFlB"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Reading the claim reminder's served template. The host has already checked the
3
+ * envelope (`template.trigger == 'claimReminder'`) and owns the variant ids and the
4
+ * served locale.
5
+ *
6
+ * The variant is an SDUI tree plus the keys the host reads (trigger SDUI
7
+ * vocabulary contract §1):
8
+ *
9
+ * { trigger: 'claimReminder', layout, windowHours, dismissible, colors, strings, root }
10
+ *
11
+ * `root` is drawn by the engine; `layout` is only a label (events, `${layout}`).
12
+ * Everything here is tolerant: a missing or malformed field takes its default.
13
+ */
14
+ import type { TriggerColors } from '../host/theme';
15
+ /** The copy the trigger draws. `${advertiserName}` is filled at render. */
16
+ export interface ReminderCopy {
17
+ title: string;
18
+ subtitle: string;
19
+ /** The open control's accessible name; the designs show no CTA text. */
20
+ cta: string;
21
+ /** The close control's accessible name. */
22
+ dismiss: string;
23
+ hours: string;
24
+ minutes: string;
25
+ seconds: string;
26
+ /** The title naming the claim's advertiser: "Finish your ${advertiserName} gift". */
27
+ offerTitle: string;
28
+ /** logoMarquee's title for several claims: "${claimCount} gifts still waiting". */
29
+ titleMany: string;
30
+ /** The word after the featured look's countdown: "23:32 left". */
31
+ left: string;
32
+ }
33
+ /**
34
+ * Built-in English, used per key when the template lacks one. Pinned across every
35
+ * platform to the backend fixture's values. The tone stays true for a reader who has
36
+ * already finished, and never says the offer ends or is lost.
37
+ */
38
+ export declare const DEFAULT_REMINDER_COPY: Readonly<ReminderCopy>;
39
+ export type ReminderColors = TriggerColors;
40
+ export interface ReminderConfig {
41
+ /** The look's light colours (`lightColors`), used in the light scheme. */
42
+ lightColors: ReminderColors;
43
+ /** The served template, drawn by the SDUI engine. */
44
+ template: Record<string, unknown>;
45
+ /** The served layout name: a label, never a code path. */
46
+ layout: string;
47
+ windowHours: number;
48
+ dismissible: boolean;
49
+ colors: ReminderColors;
50
+ copy: ReminderCopy;
51
+ }
52
+ type Dict = Record<string, unknown>;
53
+ /** The config to draw from the served `ui.template`. */
54
+ export declare function decodeReminderTemplate(template: Dict): ReminderConfig;
55
+ export {};
56
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,UAAU,EAAE,MAAM,CAAC;IACnB,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,YAAY,CAWvD,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,aAAa,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,0EAA0E;IAC1E,WAAW,EAAE,cAAc,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,YAAY,CAAC;CACpB;AAGD,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAoBpC,wDAAwD;AACxD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,IAAI,GAAG,cAAc,CAUrE"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Which claims the reminder may show (contract.md, behaviour 2).
3
+ *
4
+ * Eligible = available, inside the reminder window, with an advertiser to name, and
5
+ * not dismissed on this device. The window is the REMINDER's, not the offer's: when
6
+ * it ends the banner hides and the claim itself is untouched.
7
+ */
8
+ import type { ReminderClaim } from './source';
9
+ /**
10
+ * How far ahead of this device's clock a claim time may be: the server stamps it, and
11
+ * a device clock running up to this far behind must still show a claim just made.
12
+ */
13
+ export declare const CLOCK_SKEW_MS: number;
14
+ /** When the reminder for this claim hides. NaN for an unparseable claim time. */
15
+ export declare function reminderEndsAt(claim: ReminderClaim, windowHours: number): number;
16
+ /** The eligible claims, newest first. The first one is the one to show. */
17
+ export declare function eligibleClaims(claims: readonly ReminderClaim[], windowHours: number, nowMs: number, dismissed: {
18
+ has(transactionId: string): boolean;
19
+ }): ReminderClaim[];
20
+ /** The longest reminder window any variant may serve (the backend validates 1..720). */
21
+ export declare const MAX_WINDOW_HOURS = 720;
22
+ /**
23
+ * Whether any claim could be shown: the gate before the config request, which assigns
24
+ * the experiment arm. Same rules as eligibility, under `windowHours`, the window last
25
+ * served at this placement (servedWindow.ts), capped at the longest any variant serves.
26
+ */
27
+ export declare function hasReminderCandidate(claims: readonly ReminderClaim[], nowMs: number, dismissed: {
28
+ has(transactionId: string): boolean;
29
+ }, windowHours: number): boolean;
30
+ /**
31
+ * When `hasReminderCandidate` next turns false by the clock alone: the first epoch ms past
32
+ * the window of the claim that leaves it first. Null when no claim is in it.
33
+ */
34
+ export declare function reminderCandidateEnds(claims: readonly ReminderClaim[], nowMs: number, dismissed: {
35
+ has(transactionId: string): boolean;
36
+ }, windowHours: number): number | null;
37
+ //# sourceMappingURL=eligibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eligibility.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/eligibility.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAgB,CAAC;AAM3C,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED,2EAA2E;AAC3E,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE;IAAE,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACjD,aAAa,EAAE,CAYjB;AAED,wFAAwF;AACxF,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE;IAAE,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAClD,WAAW,EAAE,MAAM,GAClB,OAAO,CAWT;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,SAAS,aAAa,EAAE,EAChC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE;IAAE,GAAG,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAClD,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CASf"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The reminder window last served at each placement, kept on the device so it outlives
3
+ * a reload: an open claim asks for the reminder (`state=claimOpen`) only inside it. The
4
+ * window is only known from a served look, so before one is served here it is the
5
+ * 24 hour default. Storage that fails, or holds anything but a window of 1..720 hours,
6
+ * reads as that default; nothing here throws.
7
+ */
8
+ export declare const SERVED_WINDOW_KEY = "encore.trigger.claimReminder.window";
9
+ /** Before any window was served at a placement (also the decoder's default). */
10
+ export declare const DEFAULT_WINDOW_HOURS = 24;
11
+ /** The window last served at `placement` on this device, else the 24 hour default. */
12
+ export declare function servedWindowHours(storage: Storage | null, placement: string | undefined): number;
13
+ /** Keep the window a look at `placement` was served with. */
14
+ export declare function rememberServedWindow(storage: Storage | null, placement: string | undefined, hours: number): void;
15
+ //# sourceMappingURL=servedWindow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"servedWindow.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/servedWindow.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,eAAO,MAAM,iBAAiB,wCAAwC,CAAC;AAEvE,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAqBvC,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAEhG;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAWhH"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The claim reminder's view of the user's claims. INTERNAL.
3
+ *
4
+ * The trigger never reads the claims bank directly. It reads this adapter, so the
5
+ * trigger can be built and tested before the bank's `claims()` lands on main, and so
6
+ * the binding to it is one thin mapper (contract.md, "Dependency strategy"). The SDK's
7
+ * source is the claim log (the claims this browser saw), merged with the claims bank
8
+ * once one is bound (core/claimLog.ts).
9
+ *
10
+ * The same adapter exists on iOS and Android. A tap opens the Encore sheet, so
11
+ * the adapter only reads; nothing here reopens a claim.
12
+ */
13
+ /** One open claim, reduced to what the reminder needs. */
14
+ export interface ReminderClaim {
15
+ transactionId: string;
16
+ campaignId: string;
17
+ advertiserName: string;
18
+ advertiserLogoUrl?: string | null;
19
+ /** The claimed offer's perk ("3 months free"), when known. */
20
+ perk?: string;
21
+ /** ISO-8601. The latest claim time when the server exposes it, else the creation time. */
22
+ claimedAt: string;
23
+ availability: 'available' | 'unavailable';
24
+ }
25
+ export interface ClaimReminderSource {
26
+ /** The user's open claims, freshly read. Rejects when the read fails. */
27
+ openClaims(): Promise<ReminderClaim[]>;
28
+ }
29
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/triggers/claimReminder/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,8DAA8D;IAC9D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0FAA0F;IAC1F,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,WAAW,GAAG,aAAa,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,UAAU,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;CACxC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * GiftsButton, trigger plug-in #2: a button the app shows at a reward moment instead
3
+ * of popping the Encore sheet itself. A tap opens the sheet for the mount's use case and
4
+ * placement.
5
+ *
6
+ * Opening by itself is the served look's (`behavior.autoOpen: on`, an experiment arm
7
+ * only), on a mount that may (`mayOpenByItself`: it neither said `autoOpen: 'off'` nor
8
+ * pinned a layout). Such a look draws nothing until it pops the sheet, once per mount and
9
+ * at most once per placement per local day across mounts, then draws itself, its events
10
+ * keeping its own layout and ids. Every look is its served SDUI tree (host/sduiView.ts).
11
+ * Everything every trigger shares is the host's.
12
+ */
13
+ import type { UseCase } from '../../types';
14
+ import type { SduiHostListItem } from '../../sdui/context';
15
+ import type { TriggerMountState, SheetCheck, TriggerPlugin } from '../host/types';
16
+ import { type TriggerRequest } from '../request';
17
+ import { type TriggerSduiModel } from '../host/sduiView';
18
+ import { type GiftsButtonConfig } from './config';
19
+ export declare const GIFTS_BUTTON_ID: "giftsButton";
20
+ export { AUTO_POP_STORAGE_KEY, forgetAutoPops } from '../host/autoPops';
21
+ /**
22
+ * A spot drew another look (the reminder, a thanks look) on a mount that may open the
23
+ * sheet by itself: it never pops after that, so its one decision is spent as given up and
24
+ * it draws its own look when it is the gifts button again.
25
+ */
26
+ export declare function giveUpAutoOpen(mountState: TriggerMountState, request: TriggerRequest): void;
27
+ export interface GiftsButtonDeps {
28
+ /**
29
+ * Whether the sheet for `useCase` at `placement` would open with offers, by the SDK's
30
+ * own path: the sheet's config (`sheet_unavailable` when it has nothing to serve),
31
+ * then an offer search sent with the sheet's variant and `purpose: 'prefetch'`, held
32
+ * for the tap. `fresh` skips the held search (after a claim). `none` for no offers or
33
+ * any failure.
34
+ */
35
+ checkSheet(useCase: UseCase, placement: string | undefined, fresh: boolean): Promise<SheetCheck>;
36
+ storage(): Storage | null;
37
+ /** The thanks look was tapped: it ends for the user's latest completion. */
38
+ thanksTapped?(): void;
39
+ }
40
+ interface GiftsButtonContent {
41
+ useCase: UseCase;
42
+ /** The held offers' logos, for `offerLogos`. */
43
+ offerLogos: readonly SduiHostListItem[];
44
+ /**
45
+ * A completion today, not yet thanked (the request's `completed` state): its claim's id.
46
+ * The thanks look, when Encore serves it for this state, is keyed by it, so each
47
+ * completion counts its own view.
48
+ */
49
+ thanks?: string;
50
+ }
51
+ /** One render: a served look and what it binds, or nothing (`template` null). */
52
+ export interface GiftsButtonModel extends Omit<TriggerSduiModel, 'template'> {
53
+ useCase: UseCase;
54
+ placement: string | undefined;
55
+ template: Record<string, unknown> | null;
56
+ /** The thanks look is drawn: a tap on it ends the thanks state. */
57
+ thanks?: true;
58
+ }
59
+ export declare function giftsButtonPlugin(deps: GiftsButtonDeps): TriggerPlugin<GiftsButtonContent, GiftsButtonConfig, GiftsButtonModel>;
60
+ //# sourceMappingURL=GiftsButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GiftsButton.d.ts","sourceRoot":"","sources":["../../../src/triggers/giftsButton/GiftsButton.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAA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GACpB,aAAa,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,CAAC,CAmMxE"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Reading GiftsButton's served template. The host has already checked the envelope
3
+ * (`template.trigger == 'giftsButton'`), run the strict pre-check, and owns the variant
4
+ * ids and the served locale.
5
+ *
6
+ * { trigger: 'giftsButton', version, layout, colors, strings: { title, subtitle, cta }, root }
7
+ *
8
+ * `root` is drawn by the SDUI engine; `layout` is a label (events, `${layout}`). Whether
9
+ * the look opens the sheet by itself is its `behavior.autoOpen` (§2.8), never its layout.
10
+ */
11
+ import type { TriggerColors } from '../host/theme';
12
+ export interface GiftsButtonStrings {
13
+ title?: string;
14
+ subtitle?: string;
15
+ cta?: string;
16
+ offersTitle?: string;
17
+ }
18
+ export interface GiftsButtonConfig {
19
+ /** The served template, drawn by the SDUI engine. */
20
+ template: Record<string, unknown>;
21
+ /** The served layout name: a label, never a code path. */
22
+ layout: string;
23
+ /** The look's dark colours (`colors`). */
24
+ colors: TriggerColors;
25
+ /** The look's light colours (`lightColors`), used in the light scheme. */
26
+ lightColors: TriggerColors;
27
+ /** Only the served, non-blank strings; the look's own English fills the rest. */
28
+ strings: GiftsButtonStrings;
29
+ /**
30
+ * The look's `behavior.autoOpen` is `on`: it opens the sheet once by itself, then draws
31
+ * itself. Applied only on a mount that may (`mayOpenByItself`), within the device's bounds.
32
+ */
33
+ autoOpen: boolean;
34
+ }
35
+ export declare function decodeGiftsButtonTemplate(template: Record<string, unknown>): GiftsButtonConfig;
36
+ /** The copy one look binds. */
37
+ export interface GiftsButtonCopy {
38
+ title: string;
39
+ subtitle: string;
40
+ cta: string;
41
+ /** The title over the held offers' logos (offerMarquee). */
42
+ offersTitle: string;
43
+ }
44
+ /** The built-in English for `offersTitle`, on every look. */
45
+ export declare const DEFAULT_OFFERS_TITLE = "Pick a gift, on us";
46
+ /**
47
+ * Built-in English per look, used per key when the variant has none. Never names a
48
+ * reward, an amount, "free" or an expiry; no dash punctuation. A look this table does
49
+ * not name takes the card's.
50
+ */
51
+ export declare const GIFTS_BUTTON_COPY: Readonly<Record<string, Omit<GiftsButtonCopy, 'offersTitle'>>>;
52
+ export declare function giftsButtonCopy(layout: string, strings: GiftsButtonStrings): GiftsButtonCopy;
53
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/triggers/giftsButton/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAInD,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,MAAM,EAAE,aAAa,CAAC;IACtB,0EAA0E;IAC1E,WAAW,EAAE,aAAa,CAAC;IAC3B,iFAAiF;IACjF,OAAO,EAAE,kBAAkB,CAAC;IAC5B;;;OAGG;IACH,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAe9F;AAED,+BAA+B;AAC/B,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,6DAA6D;AAC7D,eAAO,MAAM,oBAAoB,uBAAuB,CAAC;AAEzD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,eAAe,EAAE,aAAa,CAAC,CAAC,CAM3F,CAAC;AAEH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,eAAe,CAU5F"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * A GiftsButton spot: one mount, one `/config` request, and whatever look Encore answers
3
+ * it with (§2.8). The spot tells Encore what happened on the device (`state`): a claim
4
+ * the reminder could show (`claimOpen`) or an offer finished today and not yet thanked
5
+ * (`completed`). The served look's behavior decides the step, so the answer may be the
6
+ * gifts button, its thanks look, nothing, or the claim reminder's look
7
+ * (`ui.template.trigger` claimReminder). This plug-in draws whichever arrives with the
8
+ * GiftsButton or ClaimReminder plug-in, so the two are one spot with one request.
9
+ */
10
+ import type { ReminderConfig } from '../claimReminder/config';
11
+ import type { ReminderContent, ReminderModel } from '../claimReminder/ClaimReminder';
12
+ import type { TriggerPlugin } from '../host/types';
13
+ type Plugin<C, F, M> = TriggerPlugin<C, F, M>;
14
+ export interface GiftsSpotDeps {
15
+ /**
16
+ * Ask the server whether the claims the reminder would draw ended (bounded, cached),
17
+ * before the spot says what happened. `dismissed`: the reminder's dismissed claims,
18
+ * never asked about. Absent: the claim log alone decides.
19
+ */
20
+ checkClaims?(dismissed: (transactionId: string) => boolean): Promise<void>;
21
+ /** An offer finished today, none claimed since, not thanked yet: its claim's id. */
22
+ thanksFor?(): string | null;
23
+ }
24
+ export interface GiftsSpotContent<G> {
25
+ /** The gifts button's content (its offers), with the completion when there is one. */
26
+ gifts: G;
27
+ /** The reminder's content, when the user has a claim it could show. */
28
+ reminder: ReminderContent | null;
29
+ /** The completion the `completed` state is about, when there is no claim to show. */
30
+ completion: string | null;
31
+ }
32
+ export type GiftsSpotConfig<F> = {
33
+ of: 'gifts';
34
+ config: F;
35
+ } | {
36
+ of: 'reminder';
37
+ config: ReminderConfig;
38
+ };
39
+ export type GiftsSpotModel<M> = {
40
+ of: 'gifts';
41
+ model: M;
42
+ } | {
43
+ of: 'reminder';
44
+ model: ReminderModel;
45
+ };
46
+ /**
47
+ * The spot over the two plug-ins. `gifts` is the GiftsButton plug-in (its content takes
48
+ * an optional `thanks` completion), `reminder` the ClaimReminder plug-in.
49
+ */
50
+ export declare function giftsSpotPlugin<G extends {
51
+ thanks?: string;
52
+ }, F, M>(gifts: Plugin<G, F, M>, reminder: Plugin<ReminderContent, ReminderConfig, ReminderModel>, deps: GiftsSpotDeps): Plugin<GiftsSpotContent<G>, GiftsSpotConfig<F>, GiftsSpotModel<M>>;
53
+ export {};
54
+ //# sourceMappingURL=spot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spot.d.ts","sourceRoot":"","sources":["../../../src/triggers/giftsButton/spot.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,eAAe,CAAC;AAMhE,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9C,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,WAAW,CAAC,CAAC,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,oFAAoF;IACpF,SAAS,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,sFAAsF;IACtF,KAAK,EAAE,CAAC,CAAC;IACT,uEAAuE;IACvE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAC;IACjC,qFAAqF;IACrF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,CAAC;AAEzG,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,CAAC;AAErG;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,EAAE,CAAC,EACjE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACtB,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAE,cAAc,EAAE,aAAa,CAAC,EAChE,IAAI,EAAE,aAAa,GAClB,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAyHpE"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * The one trigger host: mounts any registered trigger plug-in into an element.
3
+ *
4
+ * Owns everything triggers share (generic-contract.md, "Host responsibilities"):
5
+ * the pre-config gate (`prepare`), `/config?trigger=<id>&useCase=<real>` once per
6
+ * identity, the envelope check, decode, present, the served locale, visibility and the
7
+ * `sdk_trigger_*` events with their common fields, one tap at a time, the
8
+ * per-trigger dismiss store, foreground re-prepare, and a full re-run on identity
9
+ * or language change (`reload()`).
10
+ *
11
+ * It never throws into the host page and renders nothing (no element, so zero height)
12
+ * whenever there is nothing to show.
13
+ */
14
+ import type { AnalyticsEvent } from '../../analytics/models';
15
+ import type { EncoreAlignment, TriggerHandle, TriggerMountOptions, ShowResult } from '../../types';
16
+ import { type TriggerRequest } from '../request';
17
+ import type { TriggerPortalTheme } from './theme';
18
+ import type { AnyTriggerPlugin, TriggerEntry, HostSheetRequest } from './types';
19
+ /** What the host needs from the SDK. Encore builds one per mount. */
20
+ export interface TriggerHostDeps {
21
+ /** `GET /config?trigger=<id>&useCase=…` for this placement and request. Rejects on failure. */
22
+ fetchConfig(triggerId: string, placementId: string | undefined, request: TriggerRequest): Promise<unknown>;
23
+ track(build: (distinctId: string) => AnalyticsEvent): void;
24
+ /** Where dismissals persist. May throw (blocked storage) or return null. */
25
+ storage(): Storage | null;
26
+ /** The SDK's sheet, for a plug-in whose tap presents it. Absent: resolves unavailable. */
27
+ presentSheet?(request: HostSheetRequest): Promise<ShowResult>;
28
+ /** Whether a sheet the app opened itself is up now. An automatic tap waits while it is. */
29
+ sheetBusy?(): boolean;
30
+ }
31
+ /** What a reload starts over for: another person, or the same person in another language. */
32
+ export type ReloadScope = 'identity' | 'language';
33
+ /** The public handle, plus the SDK's own hook for an identity or language change. */
34
+ export interface HostHandle extends TriggerHandle {
35
+ /** The mounted trigger's id. */
36
+ readonly triggerId: string;
37
+ /**
38
+ * INTERNAL: start over (fresh prepare and /config). Encore calls it from reset() and
39
+ * identify() (`identity`), and from setLanguage() and clearLanguage() (`language`).
40
+ */
41
+ reload(scope?: ReloadScope): void;
42
+ /** INTERNAL: read the content again, keeping the variant (targeting attributes changed). */
43
+ refresh(): void;
44
+ }
45
+ export declare const NOOP_HANDLE: HostHandle;
46
+ /** A handle that does nothing, for a mount that never started. */
47
+ export declare function noopHandle(): TriggerHandle;
48
+ /** The alignment a mount asked for; anything else is the default, centre. */
49
+ export declare function triggerAlignmentOf(value: unknown): EncoreAlignment;
50
+ /** What the served response says, once checked. */
51
+ interface Served {
52
+ config: unknown;
53
+ variantId?: string;
54
+ experimentId?: string;
55
+ /** The step a look's behavior chose this for (`ui.step`), with the experiment that decided it. */
56
+ step?: 'afterClaim' | 'afterComplete';
57
+ stepExperimentId?: string | null;
58
+ locale?: string;
59
+ /** The app's theme from the portal (`ui.values`). */
60
+ portal?: TriggerPortalTheme;
61
+ /** The text slots this mount's text replaced in the served look, sorted. */
62
+ textSlots?: readonly string[];
63
+ }
64
+ /**
65
+ * A sheet the app opened itself ended in a claim: a pop held behind it is dropped, as
66
+ * after a trigger's own sheet. Encore calls it, once the host is loaded.
67
+ */
68
+ export declare function appSheetClaimed(): void;
69
+ /**
70
+ * A custom claim handle's tap (`Encore.claim`) takes the same page-wide lock as a
71
+ * trigger's: one sheet at a time. Null when another tap is in flight.
72
+ */
73
+ export declare function takePageTap(): symbol | null;
74
+ /**
75
+ * The sheet a custom handle's tap opened closed: release the lock as a trigger's tap
76
+ * does (a held pop is dropped after a claim, else the first one runs), and every
77
+ * mounted trigger reads again, afresh after a claim.
78
+ */
79
+ export declare function settlePageTap(token: symbol, claimed: boolean): void;
80
+ /** Hear every dismiss in a trigger mount. Returns an unsubscribe. */
81
+ export declare function onTriggerDismissed(listener: (triggerId: string) => void): () => void;
82
+ /**
83
+ * A custom handle dismissed `triggerId`'s content: every mount that draws it (its own, or a
84
+ * spot drawing its look) catches up, and every other custom handle hears it. `source`, the
85
+ * handle's own listener, is not told again.
86
+ */
87
+ export declare function dismissedByCustom(triggerId: string, source?: (triggerId: string) => void): void;
88
+ /** Test hook: forget a tap a previous test left in flight. */
89
+ export declare function forgetPageTap(): void;
90
+ type Dict = Record<string, unknown>;
91
+ /**
92
+ * The served config for `triggerId`, or null to render nothing: no template (the
93
+ * holdout, or no experiment), or a template for another trigger (a server that does
94
+ * not know `trigger` answers with the sheet's own config, which names none).
95
+ */
96
+ export declare function readTriggerResponse(response: unknown,
97
+ /** The triggers whose looks may answer: the mounted one first, then those it may render. */
98
+ drawable: string | readonly string[], decode: (template: Dict) => unknown): Served | null;
99
+ /** The fade when the spot switches between its components (the gifts button and its reminder). */
100
+ export declare const SWITCH_FADE_MS = 200;
101
+ /**
102
+ * Whether `key` (placement and reason) was already reported today for this trigger,
103
+ * marking it reported if not. localStorage when it works, a page-wide record always.
104
+ * Only today's entries are kept.
105
+ */
106
+ export declare function claimNotShownToday(storage: Storage | null, triggerId: string, key: string): boolean;
107
+ /**
108
+ * Mount a trigger (a plug-in, or a registry entry that loads it) into `element`.
109
+ * `deps` is null when the SDK is not configured, which renders nothing. Never throws.
110
+ */
111
+ export declare function mountTrigger(trigger: AnyTriggerPlugin | TriggerEntry, element: HTMLElement | null | undefined, options: TriggerMountOptions, deps: TriggerHostDeps | null,
112
+ /** Called once when the mount is torn down by any path, including the host removing it. */
113
+ onReleased?: () => void): HostHandle;
114
+ /**
115
+ * reset(): forget what this page holds for the previous person beside storage: the
116
+ * dismissals and the day's not-shown reports kept while storage could not take them.
117
+ */
118
+ export declare function forgetTriggerMemory(): void;
119
+ /**
120
+ * The user's claims changed (a claim just happened, a completion landed, or the claims
121
+ * API was bound): every mount reads again, afresh. Its device state may have changed
122
+ * (a GiftsButton spot now has a claim to remind about, or a completed one to thank for),
123
+ * and a held set may still list the claimed offer. Encore calls it.
124
+ */
125
+ export declare function claimsChanged(): void;
126
+ export {};
127
+ //# sourceMappingURL=TriggerHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TriggerHost.d.ts","sourceRoot":"","sources":["../../../src/triggers/host/TriggerHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAMnG,OAAO,EAA0C,KAAK,cAAc,EAAqB,MAAM,YAAY,CAAC;AAK5G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,KAAK,EACV,gBAAgB,EAChB,YAAY,EAGZ,gBAAgB,EAMjB,MAAM,SAAS,CA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Y,EACxC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACvC,OAAO,EAAE,mBAAmB,EAC5B,IAAI,EAAE,eAAe,GAAG,IAAI;AAC5B,2FAA2F;AAC3F,UAAU,CAAC,EAAE,MAAM,IAAI,GACtB,UAAU,CA4BZ;AAgBD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The device's one pop a day per placement: a GiftsButton look and an `Encore.claim`
3
+ * view whose rules open the sheet by themselves share it, so a placement opens by itself
4
+ * at most once per local day whichever drew it.
5
+ */
6
+ /** Where the pops are remembered: `{ [placement]: 'YYYY-MM-DD' }`, local days. */
7
+ export declare const AUTO_POP_STORAGE_KEY = "encore.trigger.giftsButton.autoPopped";
8
+ /** Forget the page-wide pops: reset(), and tests. */
9
+ export declare function forgetAutoPops(): void;
10
+ export declare function localDay(ms: number): string;
11
+ /** The pop store over `storage` (read at each call; null or throwing falls back to the page). */
12
+ export declare function autoPops(storage: () => Storage | null): {
13
+ reservePop: (placement: string | undefined, now: number) => boolean;
14
+ releasePop: (placement: string | undefined, day: string) => void;
15
+ };
16
+ //# sourceMappingURL=autoPops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoPops.d.ts","sourceRoot":"","sources":["../../../src/triggers/host/autoPops.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,0CAA0C,CAAC;AAU5E,qDAAqD;AACrD,wBAAgB,cAAc,IAAI,IAAI,CAGrC;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAI3C;AAuBD,iGAAiG;AACjG,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,GAAG,IAAI,GAAG;IACvD,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACpE,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CAClE,CA2DA"}