@whooshbang/sdk 6.0.0 → 7.0.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 (54) hide show
  1. package/dist/client.d.ts +31 -1
  2. package/dist/client.js +87 -1
  3. package/dist/client.js.map +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/recipient/digest-section.d.ts +29 -0
  7. package/dist/recipient/digest-section.js +400 -0
  8. package/dist/recipient/digest-section.js.map +1 -0
  9. package/dist/recipient/element.js +153 -10
  10. package/dist/recipient/element.js.map +1 -1
  11. package/dist/recipient/i18n/ar.js +37 -0
  12. package/dist/recipient/i18n/ar.js.map +1 -1
  13. package/dist/recipient/i18n/catalog.d.ts +38 -0
  14. package/dist/recipient/i18n/catalog.js.map +1 -1
  15. package/dist/recipient/i18n/de.js +37 -0
  16. package/dist/recipient/i18n/de.js.map +1 -1
  17. package/dist/recipient/i18n/en.js +37 -0
  18. package/dist/recipient/i18n/en.js.map +1 -1
  19. package/dist/recipient/i18n/es.js +37 -0
  20. package/dist/recipient/i18n/es.js.map +1 -1
  21. package/dist/recipient/i18n/fa.js +37 -0
  22. package/dist/recipient/i18n/fa.js.map +1 -1
  23. package/dist/recipient/i18n/fr.js +37 -0
  24. package/dist/recipient/i18n/fr.js.map +1 -1
  25. package/dist/recipient/i18n/hi.js +37 -0
  26. package/dist/recipient/i18n/hi.js.map +1 -1
  27. package/dist/recipient/i18n/id.js +37 -0
  28. package/dist/recipient/i18n/id.js.map +1 -1
  29. package/dist/recipient/i18n/it.js +37 -0
  30. package/dist/recipient/i18n/it.js.map +1 -1
  31. package/dist/recipient/i18n/nl.js +37 -0
  32. package/dist/recipient/i18n/nl.js.map +1 -1
  33. package/dist/recipient/i18n/pl.js +37 -0
  34. package/dist/recipient/i18n/pl.js.map +1 -1
  35. package/dist/recipient/i18n/pt-BR.js +37 -0
  36. package/dist/recipient/i18n/pt-BR.js.map +1 -1
  37. package/dist/recipient/i18n/ru.js +37 -0
  38. package/dist/recipient/i18n/ru.js.map +1 -1
  39. package/dist/recipient/i18n/tr.js +37 -0
  40. package/dist/recipient/i18n/tr.js.map +1 -1
  41. package/dist/recipient/i18n/uk.js +37 -0
  42. package/dist/recipient/i18n/uk.js.map +1 -1
  43. package/dist/recipient/i18n/zh-Hans.js +37 -0
  44. package/dist/recipient/i18n/zh-Hans.js.map +1 -1
  45. package/dist/recipient/mount.d.ts +5 -0
  46. package/dist/recipient/mount.js +2 -0
  47. package/dist/recipient/mount.js.map +1 -1
  48. package/dist/recipient/quiet-section.d.ts +7 -3
  49. package/dist/recipient/quiet-section.js +134 -7
  50. package/dist/recipient/quiet-section.js.map +1 -1
  51. package/dist/recipient/quiet-view.d.ts +20 -0
  52. package/dist/recipient/quiet-view.js +54 -0
  53. package/dist/recipient/quiet-view.js.map +1 -1
  54. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -10,6 +10,6 @@ export type { WhooshBangTransportReason, WhooshBangValidationIssue, } from "./er
10
10
  export type { ConfirmInteractionInput, InputInteractionInput, InteractionOptionInput, InteractionOutcome, SelectInteractionInput, } from "./interactions.js";
11
11
  export type { MachineCredentialPair } from "./machine.js";
12
12
  export type { RejectedWhooshBangEvent, VerifiedWhooshBangEvent, WhooshBangEventVerification, } from "./webhooks.js";
13
- export type { OrganizationCredential, OrganizationCredentialCollection, OrganizationCredentialRotation, OrganizationCredentialScope, OrganizationCredentialSecretReveal, OrganizationClosureProviderAction, OrganizationClosureResult, OrganizationProjection, BillingProjectSlots, BillingPromotions, BillingPromotion, RedeemBillingPromotionRequest, AssignBillingProjectSlotsRequest, BillingEntitlements, SubscriptionSelection, SubscriptionChange, ConfirmSubscriptionChangeRequest, ProjectAttribution, UpdateProjectAttributionRequest, BillingAccount, BillingCard, CardSetup, CreateCreditPurchaseRequest, CreditPurchase, BillingInvoice, BillingInvoiceCollection, UpdateBillingReceiptEmailRequest, ApiCredential, ApiCredentialCollection, ApiCredentialRotation, ApiCredentialSecretReveal, SubscriberChannelSettings, AcknowledgeEmailRemediationRequest, SharedEmailStatus, EmailVerificationSummary, ChannelConnection, ChannelConnectionCollection, ChannelConnectionMode, ChannelConnectionProvider, ChannelConnectionSetup, ChannelConnectionSetupStatus, ChannelConnectionStatus, ConfirmInteractionRequest, ConfirmInteractionSendRequest, ConnectionProviderCollection, CreateGroupBroadcastRequest, CloseOrganizationRequest, CreateOrganizationCredentialRequest, CreateApiCredentialRequest, CreateChannelConnectionRequest, CreateCustomerEndpointRequest, CreateMachineClientRequest, CreateMessageRequest, CreateProjectRequest, UpdateProjectRequest, PrivacyMode, CreateProviderHandoffRequest, CreateSubscriberGroupRequest, CreateRecipientSessionRequest, CreateRecipientSessionResponse, CreateSubscriberRequest, CreateSubscriptionLinkRequest, CustomerEndpoint, CustomerEndpointAttemptCollection, CustomerEndpointCollection, CustomerEndpointMutationResult, CustomerEndpointStatus, CustomerEventType, InputInteractionRequest, InputInteractionSendRequest, InteractionRequest, InteractionSendRequest, InteractionResponse, InteractionState, InteractionSummary, MachineClient, MachineCredential, MachineCredentialCrypto, MachineEventAckRequest, MachineEventAckResponse, MachineEventPollResponse, Message, Escalation, EscalationSummary, EscalationRequest, EscalationStageRequest, EscalationRecipientRef, EscalationPathStep, EscalationOutcome, EscalationAttemptState, EscalationSkipReason, EscalationAttempt, EscalationRecipient, EscalationCursor, EscalationStage, EscalationResponse, EscalationCancellation, EscalationTiming, CancelEscalationRequest, CancelEscalationByKeyRequest, EscalationPathPreview, EscalationOrder, EscalationOrderAvailableBinding, EscalationOrderCollection, EscalationOrderStep, EscalationOrderStepInput, SaveEscalationOrderRequest, QuietHours, QuietHoursBehaviour, QuietHoursChannelOptions, QuietHoursChannels, QuietHoursNow, QuietHoursQuietChannel, QuietHoursQuietChannelOption, QuietHoursWhenWithheld, QuietHoursWindow, QuietHoursWindowInput, SaveQuietHoursRequest, EscalationPathPreviewAttempt, EscalationPolicy, EscalationPolicyCollection, EscalationPolicyLevel, EscalationPolicyStep, UpdateEscalationPolicyRequest, MessageListPage, MessageDeliveryHistory, MessageNotificationImage, InteractionTimeline, UpdateEmailSenderRequest, CustomerEventDeliveryHistory, CustomerEventDeliveryAttempt, DeliveryHolds, MachineClientOperationsList, RecipientCopyCatalogue, MessageListEntry, MessageDeliveryTimelineEntry, RetainedMessageContent, InteractionTimelineEntry, MachineClientOperations, UsageReport, UsageGrouping, NotificationImage, NotificationImageAsset, NotificationImageAssetId, GroupBroadcast, PreferredBinding, Problem, Project, ProjectCollection, ProjectRecipientExperience, ProviderHandoff, RecipientCopyKey, RecipientCopyOverride, RecipientCopyOverrideCollection, RecipientLanguage, SubscriberGroup, SubscriberGroupCollection, SubscriberGroupMembership, SubscriberGroupMembershipCollection, RecipientHandoffCompletion, RecipientSession, RecipientSessionCapability, SetPreferredBindingRequest, Subscriber, SubscriberDataExport, UpdateSubscriberRequest, SubscriberCollection, ProviderCapabilitiesCollection, EmailDomain, EmailDomainCapabilities, EmailDomainCapabilityState, EmailDomainCollection, EmailDomainGuide, EmailDomainLifecycle, CreateEmailDomainRequest, ProviderHealthState, RegisterMachineCredentialRequest, RotateOrganizationCredentialRequest, RotateApiCredentialRequest, RotateChannelConnectionCredentialRequest, RotateCustomerEndpointRequest, SelectInteractionRequest, SelectInteractionSendRequest, SubscriptionConnectionSummary, SubscriptionLink, SuggestedBotUsername, UpdateChannelConnectionRequest, UpdateEnvironmentRecipientExperienceRequest, UpdateProjectRecipientExperienceRequest, UpdateSubscriberGroupRequest, UpdateRecipientCopyOverrideRequest, EnvironmentRecipientExperience, VerifyWebhookSignatureOptions, WebhookHeaders, WebhookSignatureVerification, WebhookVerificationFailureReason, WhooshBangEventV1ContractDocument, } from "@whooshbang/contracts";
13
+ export type { OrganizationCredential, OrganizationCredentialCollection, OrganizationCredentialRotation, OrganizationCredentialScope, OrganizationCredentialSecretReveal, OrganizationClosureProviderAction, OrganizationClosureResult, OrganizationProjection, BillingProjectSlots, BillingPromotions, BillingPromotion, RedeemBillingPromotionRequest, AssignBillingProjectSlotsRequest, BillingEntitlements, SubscriptionSelection, SubscriptionChange, ConfirmSubscriptionChangeRequest, ProjectAttribution, UpdateProjectAttributionRequest, BillingAccount, BillingCard, CardSetup, CreateCreditPurchaseRequest, CreditPurchase, BillingInvoice, BillingInvoiceCollection, UpdateBillingReceiptEmailRequest, ApiCredential, ApiCredentialCollection, ApiCredentialRotation, ApiCredentialSecretReveal, SubscriberChannelSettings, AcknowledgeEmailRemediationRequest, SharedEmailStatus, EmailVerificationSummary, ChannelConnection, ChannelConnectionCollection, ChannelConnectionMode, ChannelConnectionProvider, ChannelConnectionSetup, ChannelConnectionSetupStatus, ChannelConnectionStatus, ConfirmInteractionRequest, ConfirmInteractionSendRequest, ConnectionProviderCollection, CreateGroupBroadcastRequest, CloseOrganizationRequest, CreateOrganizationCredentialRequest, CreateApiCredentialRequest, CreateChannelConnectionRequest, CreateCustomerEndpointRequest, CreateMachineClientRequest, CreateMessageRequest, CreateProjectRequest, UpdateProjectRequest, PrivacyMode, CreateProviderHandoffRequest, CreateSubscriberGroupRequest, CreateRecipientSessionRequest, CreateRecipientSessionResponse, CreateSubscriberRequest, CreateSubscriptionLinkRequest, CustomerEndpoint, CustomerEndpointAttemptCollection, CustomerEndpointCollection, CustomerEndpointMutationResult, CustomerEndpointStatus, CustomerEventType, InputInteractionRequest, InputInteractionSendRequest, InteractionRequest, InteractionSendRequest, InteractionResponse, InteractionState, InteractionSummary, MachineClient, MachineCredential, MachineCredentialCrypto, MachineEventAckRequest, MachineEventAckResponse, MachineEventPollResponse, Message, Escalation, EscalationSummary, EscalationRequest, EscalationStageRequest, EscalationRecipientRef, EscalationPathStep, EscalationOutcome, EscalationAttemptState, EscalationSkipReason, EscalationAttempt, EscalationRecipient, EscalationCursor, EscalationStage, EscalationResponse, EscalationCancellation, EscalationTiming, CancelEscalationRequest, CancelEscalationByKeyRequest, EscalationPathPreview, EscalationOrder, EscalationOrderAvailableBinding, EscalationOrderCollection, EscalationOrderStep, EscalationOrderStepInput, SaveEscalationOrderRequest, QuietHours, QuietHoursBehaviour, QuietHoursChannelOptions, QuietHoursChannels, QuietHoursNow, QuietHoursQuietChannel, QuietHoursQuietChannelOption, QuietHoursWhenWithheld, QuietHoursWindow, QuietHoursWindowInput, SaveQuietHoursRequest, DigestDelegation, DigestPreference, DigestSchedulePreset, OwnerSubscriberDigestSetting, SetDigestPreferenceRequest, SetSubscriberDigestSettingRequest, SubscriberDigestSettings, EscalationPathPreviewAttempt, EscalationPolicy, EscalationPolicyCollection, EscalationPolicyLevel, EscalationPolicyStep, UpdateEscalationPolicyRequest, MessageListPage, MessageDeliveryHistory, MessageNotificationImage, InteractionTimeline, UpdateEmailSenderRequest, CustomerEventDeliveryHistory, CustomerEventDeliveryAttempt, DeliveryHolds, MachineClientOperationsList, RecipientCopyCatalogue, MessageListEntry, MessageDeliveryTimelineEntry, RetainedMessageContent, InteractionTimelineEntry, MachineClientOperations, UsageReport, UsageGrouping, NotificationImage, NotificationImageAsset, NotificationImageAssetId, GroupBroadcast, PreferredBinding, Problem, Project, ProjectCollection, ProjectRecipientExperience, ProviderHandoff, RecipientCopyKey, RecipientCopyOverride, RecipientCopyOverrideCollection, RecipientLanguage, SubscriberGroup, SubscriberGroupCollection, SubscriberGroupMembership, SubscriberGroupMembershipCollection, RecipientHandoffCompletion, RecipientSession, RecipientSessionCapability, SetPreferredBindingRequest, Subscriber, SubscriberDataExport, UpdateSubscriberRequest, SubscriberCollection, ProviderCapabilitiesCollection, EmailDomain, EmailDomainCapabilities, EmailDomainCapabilityState, EmailDomainCollection, EmailDomainGuide, EmailDomainLifecycle, CreateEmailDomainRequest, ProviderHealthState, RegisterMachineCredentialRequest, RotateOrganizationCredentialRequest, RotateApiCredentialRequest, RotateChannelConnectionCredentialRequest, RotateCustomerEndpointRequest, SelectInteractionRequest, SelectInteractionSendRequest, SubscriptionConnectionSummary, SubscriptionLink, SuggestedBotUsername, UpdateChannelConnectionRequest, UpdateEnvironmentRecipientExperienceRequest, UpdateProjectRecipientExperienceRequest, UpdateSubscriberGroupRequest, UpdateRecipientCopyOverrideRequest, EnvironmentRecipientExperience, VerifyWebhookSignatureOptions, WebhookHeaders, WebhookSignatureVerification, WebhookVerificationFailureReason, WhooshBangEventV1ContractDocument, } from "@whooshbang/contracts";
14
14
  export { parseCredentialConfirmation, encryptCredentialResult, decryptCredentialResult, credentialConfirmationDigest, validConfirmedCredentialResult, type ConfirmedCredentialResult, type CredentialConfirmation, } from "./browser-confirmation.js";
15
15
  export type { AssertEmailConsentRequest } from "@whooshbang/contracts";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,gBAAgB,EAChB,gCAAgC,GACjC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,2CAA2C,EAC3C,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC;AA0PF,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,GAG/B,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,gBAAgB,EAChB,gCAAgC,GACjC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,2CAA2C,EAC3C,mBAAmB,EACnB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC;AAiQF,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,GAG/B,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { DigestPreference, SubscriberDigestSettings } from "@whooshbang/contracts";
2
+ import type { RecipientPanelCopy } from "./i18n/catalog.js";
3
+ /**
4
+ * "Digests" (FXO-3729): how often each category reaches the recipient, where
5
+ * the owner lets them choose. Only what the owner offers is a control; a
6
+ * setting chosen for them is shown, not offered. The Default applies to every
7
+ * category that follows it, unless they chose otherwise for that category.
8
+ *
9
+ * Native selects and a time input, so it works by keyboard, touch and screen
10
+ * reader. Every value reaches the DOM through `textContent` or a typed
11
+ * property.
12
+ */
13
+ export declare const DIGEST_SECTION_STYLES = "\n.digests .intro { line-height: 1.45; margin: 0 0 1rem; opacity: .85; }\n.digests .entry {\n border: 1px solid color-mix(in srgb, currentColor 22%, transparent);\n border-radius: .5rem;\n display: flex;\n flex-direction: column;\n gap: .5rem;\n margin-bottom: .75rem;\n padding: .75rem;\n}\n.digests .entry h3 { font-size: 1rem; margin: 0; }\n.digests .note { font-size: .85rem; margin: 0; opacity: .75; }\n.digests .fields { display: flex; flex-wrap: wrap; gap: .5rem .75rem; }\n.digests label { display: flex; flex-direction: column; font-size: .85rem; gap: .25rem; }\n.digests select, .digests input[type=\"time\"] {\n background: Field;\n border: 1px solid color-mix(in srgb, currentColor 35%, transparent);\n border-radius: .375rem;\n box-sizing: border-box;\n color: inherit;\n font: inherit;\n min-height: 2.75rem;\n padding: 0 .5rem;\n}\n.digests select:focus-visible, .digests input:focus-visible, .digests button:focus-visible {\n outline: 2px solid var(--whooshbang-accent, #EB001B);\n outline-offset: 2px;\n}\n.digests button.link {\n align-self: flex-start;\n background: transparent;\n border: 0;\n color: var(--whooshbang-accent, #EB001B);\n min-height: 2.75rem;\n padding: 0;\n text-decoration: underline;\n}\n";
14
+ export interface DigestSectionInput {
15
+ readonly settings: SubscriberDigestSettings;
16
+ readonly copy: RecipientPanelCopy;
17
+ readonly locale: string;
18
+ readonly timeZone: string;
19
+ readonly disabled: boolean;
20
+ /** Show only this category, as an embedded control bound to it. */
21
+ readonly onlyCategory?: string | undefined;
22
+ readonly status: HTMLParagraphElement;
23
+ /** `key` is a category key, or `*` for the Default; null clears. */
24
+ readonly save: (key: string, preference: DigestPreference | null) => void;
25
+ }
26
+ /** The Digests tab, or the single bound control. */
27
+ export declare function renderDigestSection(input: DigestSectionInput): HTMLElement;
28
+ /** Whether there is anything for the recipient to see. */
29
+ export declare function digestSectionOffered(settings: SubscriberDigestSettings | null, onlyCategory: string | undefined): boolean;
@@ -0,0 +1,400 @@
1
+ /**
2
+ * "Digests" (FXO-3729): how often each category reaches the recipient, where
3
+ * the owner lets them choose. Only what the owner offers is a control; a
4
+ * setting chosen for them is shown, not offered. The Default applies to every
5
+ * category that follows it, unless they chose otherwise for that category.
6
+ *
7
+ * Native selects and a time input, so it works by keyboard, touch and screen
8
+ * reader. Every value reaches the DOM through `textContent` or a typed
9
+ * property.
10
+ */
11
+ export const DIGEST_SECTION_STYLES = `
12
+ .digests .intro { line-height: 1.45; margin: 0 0 1rem; opacity: .85; }
13
+ .digests .entry {
14
+ border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
15
+ border-radius: .5rem;
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: .5rem;
19
+ margin-bottom: .75rem;
20
+ padding: .75rem;
21
+ }
22
+ .digests .entry h3 { font-size: 1rem; margin: 0; }
23
+ .digests .note { font-size: .85rem; margin: 0; opacity: .75; }
24
+ .digests .fields { display: flex; flex-wrap: wrap; gap: .5rem .75rem; }
25
+ .digests label { display: flex; flex-direction: column; font-size: .85rem; gap: .25rem; }
26
+ .digests select, .digests input[type="time"] {
27
+ background: Field;
28
+ border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
29
+ border-radius: .375rem;
30
+ box-sizing: border-box;
31
+ color: inherit;
32
+ font: inherit;
33
+ min-height: 2.75rem;
34
+ padding: 0 .5rem;
35
+ }
36
+ .digests select:focus-visible, .digests input:focus-visible, .digests button:focus-visible {
37
+ outline: 2px solid var(--whooshbang-accent, #EB001B);
38
+ outline-offset: 2px;
39
+ }
40
+ .digests button.link {
41
+ align-self: flex-start;
42
+ background: transparent;
43
+ border: 0;
44
+ color: var(--whooshbang-accent, #EB001B);
45
+ min-height: 2.75rem;
46
+ padding: 0;
47
+ text-decoration: underline;
48
+ }
49
+ `;
50
+ function modeLabel(copy, mode) {
51
+ return mode === "immediate"
52
+ ? copy.digestModeImmediate
53
+ : mode === "reactive"
54
+ ? copy.digestModeReactive
55
+ : copy.digestModeScheduled;
56
+ }
57
+ function presetLabel(copy, preset) {
58
+ return preset === "hourly"
59
+ ? copy.digestHourly
60
+ : preset === "daily"
61
+ ? copy.digestDaily
62
+ : preset === "weekly"
63
+ ? copy.digestWeekly
64
+ : copy.digestMonthly;
65
+ }
66
+ function select(label, action, options, value, disabled, change,
67
+ /** What is in effect when it isn't one of the choices, shown but not
68
+ * choosable, so the control never reads blank. */
69
+ inEffect) {
70
+ const wrapper = document.createElement("label");
71
+ wrapper.append(label);
72
+ const control = document.createElement("select");
73
+ control.dataset["action"] = action;
74
+ control.disabled = disabled;
75
+ if (inEffect !== undefined &&
76
+ !options.some((option) => option.value === value)) {
77
+ const current = document.createElement("option");
78
+ current.value = "";
79
+ current.disabled = true;
80
+ current.textContent = inEffect;
81
+ control.append(current);
82
+ }
83
+ for (const option of options) {
84
+ const element = document.createElement("option");
85
+ element.value = option.value;
86
+ element.textContent = option.label;
87
+ control.append(element);
88
+ }
89
+ control.value = options.some((option) => option.value === value)
90
+ ? (value ?? "")
91
+ : inEffect !== undefined
92
+ ? ""
93
+ : (options[0]?.value ?? "");
94
+ control.addEventListener("change", () => {
95
+ change(control.value);
96
+ });
97
+ wrapper.append(control);
98
+ return wrapper;
99
+ }
100
+ function entries(settings, onlyCategory) {
101
+ const list = [];
102
+ // The Default entry is hidden for now (owner walkthrough, 2026-11-04):
103
+ // each category shows its own choice. A Default saved through the API
104
+ // still applies, and its notes and reset still show.
105
+ for (const category of settings.categories) {
106
+ if (onlyCategory !== undefined && category.key !== onlyCategory)
107
+ continue;
108
+ list.push({
109
+ category,
110
+ choices: category.choices,
111
+ key: category.key,
112
+ name: category.name,
113
+ preference: category.preference,
114
+ });
115
+ }
116
+ return list;
117
+ }
118
+ /** The preset a calendar schedule in effect matches, if it is one. */
119
+ function presetInEffect(schedule) {
120
+ if (schedule?.kind !== "calendar")
121
+ return undefined;
122
+ const [minute, hour, day, month, weekday] = schedule.cron.split(/\s+/u);
123
+ const number = (value) => value !== undefined && /^\d+$/u.test(value);
124
+ if (!number(minute) || month !== "*")
125
+ return undefined;
126
+ const time = `${String(hour).padStart(2, "0")}:${String(minute).padStart(2, "0")}`;
127
+ // No zone: a change the subscriber makes is saved in their own zone.
128
+ const zone = {};
129
+ if (hour === "*" && day === "*" && weekday === "*")
130
+ return {
131
+ preset: "hourly",
132
+ time: `00:${String(minute).padStart(2, "0")}`,
133
+ ...zone,
134
+ };
135
+ if (!number(hour))
136
+ return undefined;
137
+ if (day === "*" && weekday === "*")
138
+ return { preset: "daily", time, ...zone };
139
+ if (day === "*" && number(weekday))
140
+ return {
141
+ preset: "weekly",
142
+ time,
143
+ weekday: Number(weekday) % 7 || 7,
144
+ ...zone,
145
+ };
146
+ if (number(day) && Number(day) <= 28 && weekday === "*")
147
+ return { day_of_month: Number(day), preset: "monthly", time, ...zone };
148
+ return undefined;
149
+ }
150
+ /** The current choice of one entry, as shown: the subscriber's own, or
151
+ * what is in effect. */
152
+ function shown(entry) {
153
+ const fields = entry.category?.fields;
154
+ // A locked setting is what they get, whatever they saved.
155
+ const locked = (field) => fields?.[field].source === "owner_locked";
156
+ const mode = locked("mode")
157
+ ? fields?.mode.value
158
+ : (entry.preference?.mode ?? fields?.mode.value);
159
+ const preset = entry.preference?.schedule ??
160
+ presetInEffect(fields?.schedule.value) ?? {
161
+ preset: entry.choices.schedules?.[0] ?? "daily",
162
+ };
163
+ return {
164
+ detail: locked("detail")
165
+ ? fields?.detail.value
166
+ : (entry.preference?.detail ?? fields?.detail.value),
167
+ mode,
168
+ preset,
169
+ strategy: locked("strategy")
170
+ ? fields?.strategy.value
171
+ : (entry.preference?.strategy ?? fields?.strategy.value),
172
+ };
173
+ }
174
+ /**
175
+ * The subscriber's saved choice with one change: only fields they chose,
176
+ * and only values on offer. A value merely in effect (from the category,
177
+ * the owner or their Default) is never written into their choice.
178
+ */
179
+ function nextPreference(entry, change, timeZone) {
180
+ const merged = { ...entry.preference, ...change };
181
+ const { choices } = entry;
182
+ // Never a field the owner locked for them: the server refuses it, and
183
+ // their saved choice for it is kept apart until the lock is lifted.
184
+ const unlocked = (field) => entry.category?.fields[field].editable !== false;
185
+ const offered = (list, value) => value !== undefined && list?.includes(value) === true;
186
+ // Choosing a schedule-based delivery names the cadence shown with it.
187
+ const schedule = merged.schedule ??
188
+ (change.mode === "scheduled" && choices.schedules !== undefined
189
+ ? { preset: choices.schedules[0], time_zone: timeZone }
190
+ : undefined);
191
+ return {
192
+ ...(unlocked("mode") && offered(choices.modes, merged.mode)
193
+ ? { mode: merged.mode }
194
+ : {}),
195
+ ...(unlocked("schedule") &&
196
+ schedule !== undefined &&
197
+ offered(choices.schedules, schedule.preset)
198
+ ? { schedule: { time_zone: timeZone, ...schedule } }
199
+ : {}),
200
+ ...(unlocked("detail") && offered(choices.details, merged.detail)
201
+ ? { detail: merged.detail }
202
+ : {}),
203
+ ...(unlocked("strategy") && offered(choices.strategies, merged.strategy)
204
+ ? { strategy: merged.strategy }
205
+ : {}),
206
+ };
207
+ }
208
+ /** The Digests tab, or the single bound control. */
209
+ export function renderDigestSection(input) {
210
+ const { copy, settings } = input;
211
+ const section = document.createElement("div");
212
+ section.className = "digests";
213
+ if (input.onlyCategory === undefined) {
214
+ const intro = document.createElement("p");
215
+ intro.className = "intro";
216
+ intro.textContent = copy.digestsIntro;
217
+ section.append(intro);
218
+ }
219
+ if (!settings.available) {
220
+ const unavailable = document.createElement("p");
221
+ unavailable.className = "note";
222
+ unavailable.textContent = copy.digestUnavailable;
223
+ section.append(unavailable);
224
+ }
225
+ const time = new Intl.DateTimeFormat(input.locale, {
226
+ hour: "2-digit",
227
+ minute: "2-digit",
228
+ month: "short",
229
+ day: "numeric",
230
+ });
231
+ const weekdays = new Intl.DateTimeFormat(input.locale, { weekday: "long" });
232
+ const disabled = input.disabled || !settings.available;
233
+ for (const entry of entries(settings, input.onlyCategory)) {
234
+ const box = document.createElement("section");
235
+ box.className = "entry";
236
+ const heading = document.createElement("h3");
237
+ heading.textContent = entry.name;
238
+ box.append(heading);
239
+ const fields = entry.category?.fields;
240
+ const editable = (field) => entry.category === undefined
241
+ ? (field === "mode"
242
+ ? entry.choices.modes
243
+ : field === "schedule"
244
+ ? entry.choices.schedules
245
+ : field === "strategy"
246
+ ? entry.choices.strategies
247
+ : entry.choices.details) !== undefined
248
+ : fields?.[field].editable === true;
249
+ const notes = [];
250
+ if (fields?.mode.source === "owner_locked")
251
+ notes.push(copy.digestLocked);
252
+ else if (fields?.mode.source === "subscriber_default")
253
+ notes.push(copy.digestFollowsDefault);
254
+ if (entry.category?.default_unavailable === true)
255
+ notes.push(copy.digestDefaultUnavailable);
256
+ if (entry.category !== undefined &&
257
+ entry.category.pending_count > 0 &&
258
+ entry.category.next_delivery_at !== undefined)
259
+ notes.push(copy.digestPending(String(entry.category.pending_count), time.format(new Date(entry.category.next_delivery_at))));
260
+ if (!editable("mode") && entry.category !== undefined)
261
+ notes.unshift(modeLabel(copy, entry.category.fields.mode.value ?? "immediate"));
262
+ for (const text of notes) {
263
+ const note = document.createElement("p");
264
+ note.className = "note";
265
+ note.textContent = text;
266
+ box.append(note);
267
+ }
268
+ const current = shown(entry);
269
+ const save = (change) => {
270
+ input.save(entry.key, nextPreference(entry, change, input.timeZone));
271
+ };
272
+ const row = document.createElement("div");
273
+ row.className = "fields";
274
+ const modes = entry.choices.modes;
275
+ if (editable("mode") && modes !== undefined)
276
+ row.append(select(copy.digestModeLabel, `digest:${entry.key}:mode`, modes.map((mode) => ({ label: modeLabel(copy, mode), value: mode })), current.mode, disabled, (value) => {
277
+ save({ mode: value });
278
+ }, current.mode === undefined
279
+ ? undefined
280
+ : modeLabel(copy, current.mode)));
281
+ const presets = entry.choices.schedules;
282
+ if (editable("schedule") &&
283
+ presets !== undefined &&
284
+ current.mode === "scheduled") {
285
+ const preset = current.preset;
286
+ row.append(select(copy.digestScheduleLabel, `digest:${entry.key}:preset`, presets.map((value) => ({
287
+ label: presetLabel(copy, value),
288
+ value,
289
+ })), preset.preset, disabled, (value) => {
290
+ save({ schedule: { ...preset, preset: value } });
291
+ }, presetLabel(copy, preset.preset)));
292
+ const timeLabel = document.createElement("label");
293
+ timeLabel.append(copy.digestTimeLabel);
294
+ const timeInput = document.createElement("input");
295
+ timeInput.type = "time";
296
+ timeInput.dataset["action"] = `digest:${entry.key}:time`;
297
+ timeInput.value = preset.time ?? "09:00";
298
+ timeInput.disabled = disabled;
299
+ timeInput.addEventListener("change", () => {
300
+ if (/^\d{2}:\d{2}$/u.test(timeInput.value))
301
+ save({ schedule: { ...preset, time: timeInput.value } });
302
+ });
303
+ timeLabel.append(timeInput);
304
+ row.append(timeLabel);
305
+ if (preset.preset === "weekly")
306
+ row.append(select(copy.digestWeekdayLabel, `digest:${entry.key}:weekday`, [1, 2, 3, 4, 5, 6, 7].map((day) => ({
307
+ // 2024-01-01 was a Monday.
308
+ label: weekdays.format(new Date(Date.UTC(2024, 0, day, 12))),
309
+ value: String(day),
310
+ })), String(preset.weekday ?? 1), disabled, (value) => {
311
+ save({ schedule: { ...preset, weekday: Number(value) } });
312
+ }));
313
+ if (preset.preset === "monthly")
314
+ row.append(select(copy.digestDayLabel, `digest:${entry.key}:day`, Array.from({ length: 28 }, (_, index) => ({
315
+ label: String(index + 1),
316
+ value: String(index + 1),
317
+ })), String(preset.day_of_month ?? 1), disabled, (value) => {
318
+ save({ schedule: { ...preset, day_of_month: Number(value) } });
319
+ }));
320
+ }
321
+ const details = entry.choices.details;
322
+ if (editable("detail") &&
323
+ details !== undefined &&
324
+ current.mode !== "immediate")
325
+ row.append(select(copy.digestDetailLabel, `digest:${entry.key}:detail`, details.map((value) => ({
326
+ label: value === "titles"
327
+ ? copy.digestDetailTitles
328
+ : value === "titles_and_previews"
329
+ ? copy.digestDetailPreviews
330
+ : copy.digestDetailFull,
331
+ value,
332
+ })), current.detail, disabled, (value) => {
333
+ save({ detail: value });
334
+ }, current.detail === undefined
335
+ ? undefined
336
+ : current.detail === "titles"
337
+ ? copy.digestDetailTitles
338
+ : current.detail === "titles_and_previews"
339
+ ? copy.digestDetailPreviews
340
+ : copy.digestDetailFull));
341
+ const strategies = entry.choices.strategies;
342
+ if (editable("strategy") &&
343
+ strategies !== undefined &&
344
+ current.mode !== "immediate")
345
+ row.append(select(copy.digestStrategyLabel, `digest:${entry.key}:strategy`, strategies.map((value) => ({
346
+ label: value === "auto"
347
+ ? copy.digestStrategyAuto
348
+ : value === "count_first"
349
+ ? copy.digestStrategyCountFirst
350
+ : value === "inbox"
351
+ ? copy.digestStrategyInbox
352
+ : copy.digestStrategyBundle,
353
+ value,
354
+ })), current.strategy, disabled, (value) => {
355
+ save({
356
+ strategy: value,
357
+ });
358
+ }, current.strategy === undefined
359
+ ? undefined
360
+ : current.strategy === "auto"
361
+ ? copy.digestStrategyAuto
362
+ : current.strategy === "count_first"
363
+ ? copy.digestStrategyCountFirst
364
+ : current.strategy === "inbox"
365
+ ? copy.digestStrategyInbox
366
+ : copy.digestStrategyBundle));
367
+ if (row.childElementCount > 0)
368
+ box.append(row);
369
+ if (entry.key !== "*" &&
370
+ entry.preference !== null &&
371
+ settings.default.offered &&
372
+ settings.default.preference !== null) {
373
+ const reset = document.createElement("button");
374
+ reset.type = "button";
375
+ reset.className = "link";
376
+ reset.dataset["action"] = `digest:${entry.key}:default`;
377
+ reset.textContent = copy.digestUseDefault;
378
+ reset.disabled = disabled;
379
+ reset.addEventListener("click", () => {
380
+ input.save(entry.key, null);
381
+ });
382
+ box.append(reset);
383
+ }
384
+ section.append(box);
385
+ }
386
+ input.status.className = "digest-status";
387
+ input.status.setAttribute("role", "status");
388
+ input.status.setAttribute("aria-live", "polite");
389
+ section.append(input.status);
390
+ return section;
391
+ }
392
+ /** Whether there is anything for the recipient to see. */
393
+ export function digestSectionOffered(settings, onlyCategory) {
394
+ if (settings === null)
395
+ return false;
396
+ if (onlyCategory !== undefined)
397
+ return settings.categories.some((category) => category.key === onlyCategory);
398
+ return settings.default.offered || settings.categories.length > 0;
399
+ }
400
+ //# sourceMappingURL=digest-section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"digest-section.js","sourceRoot":"","sources":["../../src/recipient/digest-section.ts"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCpC,CAAC;AA6BF,SAAS,SAAS,CAA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