@trycourier/courier-ui-inbox 1.0.4-beta → 1.0.5-beta

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 (3) hide show
  1. package/dist/index.js +69 -199
  2. package/dist/index.mjs +820 -1722
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,910 +1,8 @@
1
- var qo = Object.defineProperty;
2
- var Vo = (h, t, e) => t in h ? qo(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
3
- var a = (h, t, e) => Vo(h, typeof t != "symbol" ? t + "" : t, e);
4
- var jo = Object.defineProperty, Zo = (h, t, e) => t in h ? jo(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, T = (h, t, e) => Zo(h, typeof t != "symbol" ? t + "" : t, e);
5
- const ko = class wo {
6
- constructor(t, e) {
7
- T(this, "webSocket", null), T(this, "pingInterval", null), T(this, "onOpen"), T(this, "onMessageReceived"), T(this, "onClose"), T(this, "onError"), T(this, "url"), T(this, "options"), this.url = t, this.options = e;
8
- }
9
- /**
10
- * Dynamically checks if the WebSocket is connected
11
- */
12
- get isConnected() {
13
- return this.webSocket !== null;
14
- }
15
- async connect() {
16
- return this.disconnect(), new Promise((t, e) => {
17
- try {
18
- this.webSocket = new WebSocket(this.url), this.webSocket.onopen = () => {
19
- var i;
20
- (i = this.onOpen) == null || i.call(this), t();
21
- }, this.webSocket.onmessage = (i) => {
22
- var s;
23
- (s = this.onMessageReceived) == null || s.call(this, i.data);
24
- }, this.webSocket.onclose = (i) => {
25
- var s;
26
- this.webSocket = null, (s = this.onClose) == null || s.call(this, i.code, i.reason);
27
- }, this.webSocket.onerror = (i) => {
28
- var s;
29
- this.webSocket = null;
30
- const o = new Error("Courier Socket connection failed");
31
- o.originalEvent = i, (s = this.onError) == null || s.call(this, o), e(o);
32
- };
33
- } catch (i) {
34
- this.webSocket = null, e(i);
35
- }
36
- });
37
- }
38
- disconnect() {
39
- this.stopPing(), this.webSocket && (this.webSocket.close(wo.NORMAL_CLOSURE_STATUS), this.webSocket = null);
40
- }
41
- async send(t) {
42
- if (!this.webSocket)
43
- return !1;
44
- const e = JSON.stringify(t);
45
- return this.webSocket.send(e) !== void 0;
46
- }
47
- keepAlive(t) {
48
- this.stopPing(), this.pingInterval = setInterval(async () => {
49
- var e;
50
- try {
51
- await this.send({ action: "keepAlive" });
52
- } catch (i) {
53
- (e = this.options.logger) == null || e.error("Error occurred on Keep Alive:", i);
54
- }
55
- }, (t == null ? void 0 : t.intervalInMillis) ?? 3e5);
56
- }
57
- stopPing() {
58
- this.pingInterval && (clearInterval(this.pingInterval), this.pingInterval = null);
59
- }
60
- };
61
- T(ko, "NORMAL_CLOSURE_STATUS", 1e3);
62
- let Jo = ko;
63
- const yo = (h) => ({
64
- courier: {
65
- rest: (h == null ? void 0 : h.courier.rest) || "https://api.courier.com",
66
- graphql: (h == null ? void 0 : h.courier.graphql) || "https://api.courier.com/client/q"
67
- },
68
- inbox: {
69
- graphql: (h == null ? void 0 : h.inbox.graphql) || "https://inbox.courier.com/q",
70
- webSocket: (h == null ? void 0 : h.inbox.webSocket) || "wss://realtime.courier.com"
71
- }
72
- });
73
- class Go {
74
- constructor(t) {
75
- T(this, "PREFIX", "[COURIER]"), this.showLogs = t;
76
- }
77
- warn(t, ...e) {
78
- this.showLogs && console.warn(`${this.PREFIX} ${t}`, ...e);
79
- }
80
- log(t, ...e) {
81
- this.showLogs && console.log(`${this.PREFIX} ${t}`, ...e);
82
- }
83
- error(t, ...e) {
84
- this.showLogs && console.error(`${this.PREFIX} ${t}`, ...e);
85
- }
86
- debug(t, ...e) {
87
- this.showLogs && console.debug(`${this.PREFIX} ${t}`, ...e);
88
- }
89
- info(t, ...e) {
90
- this.showLogs && console.info(`${this.PREFIX} ${t}`, ...e);
91
- }
92
- }
93
- class Ae {
94
- static generate(t) {
95
- const e = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
96
- return t ? t + e : e;
97
- }
98
- }
99
- class Pe extends Error {
100
- constructor(t, e, i) {
101
- super(e), this.code = t, this.type = i, this.name = "CourierRequestError";
102
- }
103
- }
104
- function So(h, t, e, i) {
105
- h.log(`
106
- 📡 New Courier ${e} Request: ${t}
107
- URL: ${i.url}
108
- ${i.method ? `Method: ${i.method}` : ""}
109
- ${i.query ? `Query: ${i.query}` : ""}
110
- ${i.variables ? `Variables: ${JSON.stringify(i.variables, null, 2)}` : ""}
111
- Headers: ${JSON.stringify(i.headers, null, 2)}
112
- Body: ${i.body ? JSON.stringify(i.body, null, 2) : "Empty"}
113
- `);
114
- }
115
- function Io(h, t, e, i) {
116
- h.log(`
117
- 📡 New Courier ${e} Response: ${t}
118
- Status Code: ${i.status}
119
- Response JSON: ${JSON.stringify(i.response, null, 2)}
120
- `);
121
- }
122
- async function K(h) {
123
- const t = h.validCodes ?? [200], e = h.options.showLogs ? Ae.generate() : void 0, i = new Request(h.url, {
124
- method: h.method,
125
- headers: {
126
- "Content-Type": "application/json",
127
- ...h.headers
128
- },
129
- body: h.body ? JSON.stringify(h.body) : void 0
130
- });
131
- e && So(h.options.logger, e, "HTTP", {
132
- url: i.url,
133
- method: i.method,
134
- headers: Object.fromEntries(i.headers.entries()),
135
- body: h.body
136
- });
137
- const s = await fetch(i);
138
- if (s.status === 204)
139
- return;
140
- let o;
141
- try {
142
- o = await s.json();
143
- } catch {
144
- if (s.status === 200)
145
- return;
146
- throw new Pe(
147
- s.status,
148
- "Failed to parse response as JSON",
149
- "PARSE_ERROR"
150
- );
151
- }
152
- if (e && Io(h.options.logger, e, "HTTP", {
153
- status: s.status,
154
- response: o
155
- }), !t.includes(s.status))
156
- throw new Pe(
157
- s.status,
158
- (o == null ? void 0 : o.message) || "Unknown Error",
159
- o == null ? void 0 : o.type
160
- );
161
- return o;
162
- }
163
- async function Z(h) {
164
- const t = h.options.showLogs ? Ae.generate() : void 0;
165
- t && So(h.options.logger, t, "GraphQL", {
166
- url: h.url,
167
- headers: h.headers,
168
- query: h.query,
169
- variables: h.variables
170
- });
171
- const e = await fetch(h.url, {
172
- method: "POST",
173
- headers: {
174
- "Content-Type": "application/json",
175
- ...h.headers
176
- },
177
- body: JSON.stringify({
178
- query: h.query,
179
- variables: h.variables
180
- })
181
- });
182
- let i;
183
- try {
184
- i = await e.json();
185
- } catch {
186
- throw new Pe(
187
- e.status,
188
- "Failed to parse response as JSON",
189
- "PARSE_ERROR"
190
- );
191
- }
192
- if (t && Io(h.options.logger, t, "GraphQL", {
193
- status: e.status,
194
- response: i
195
- }), !e.ok)
196
- throw new Pe(
197
- e.status,
198
- (i == null ? void 0 : i.message) || "Unknown Error",
199
- i == null ? void 0 : i.type
200
- );
201
- return i;
202
- }
203
- class re {
204
- constructor(t) {
205
- this.options = t;
206
- }
207
- }
208
- class Wo extends re {
209
- /**
210
- * Get a brand by ID using GraphQL
211
- * @param brandId - The ID of the brand to retrieve
212
- * @returns Promise resolving to the requested brand
213
- */
214
- async getBrand(t) {
215
- const e = `
216
- query GetBrand {
217
- brand(brandId: "${t.brandId}") {
218
- settings {
219
- colors {
220
- primary
221
- secondary
222
- tertiary
223
- }
224
- inapp {
225
- borderRadius
226
- disableCourierFooter
227
- }
228
- }
229
- }
230
- }
231
- `;
232
- return (await Z({
233
- options: this.options,
234
- url: this.options.apiUrls.courier.graphql,
235
- headers: {
236
- "x-courier-user-id": this.options.userId,
237
- "x-courier-client-key": "empty",
238
- // Empty for now. Will be removed in future.
239
- Authorization: `Bearer ${this.options.accessToken}`
240
- },
241
- query: e,
242
- variables: { brandId: t.brandId }
243
- })).data.brand;
244
- }
245
- }
246
- class ze extends Jo {
247
- constructor(t) {
248
- const e = ze.buildUrl(t);
249
- super(e, t), T(this, "receivedMessage"), T(this, "receivedMessageEvent"), this.onMessageReceived = (i) => this.convertToType(i);
250
- }
251
- convertToType(t) {
252
- var e, i, s, o;
253
- try {
254
- switch (JSON.parse(t).type) {
255
- case "event":
256
- const c = JSON.parse(t);
257
- (e = this.receivedMessageEvent) == null || e.call(this, c);
258
- break;
259
- case "message":
260
- const d = JSON.parse(t);
261
- (i = this.receivedMessage) == null || i.call(this, d);
262
- break;
263
- }
264
- } catch (n) {
265
- (s = this.options.logger) == null || s.error("Error parsing socket message", n), n instanceof Error && ((o = this.onError) == null || o.call(this, n));
266
- }
267
- }
268
- async sendSubscribe(t) {
269
- var e;
270
- const i = {
271
- action: "subscribe",
272
- data: {
273
- userAgent: "courier-js",
274
- // TODO: Equivalent to Courier.agent.value()
275
- channel: this.options.userId,
276
- event: "*",
277
- version: (t == null ? void 0 : t.version) ?? 5
278
- }
279
- };
280
- this.options.connectionId && (i.data.clientSourceId = this.options.connectionId), this.options.tenantId && (i.data.accountId = this.options.tenantId), (e = this.options.logger) == null || e.debug("Sending subscribe request", i), await this.send(i);
281
- }
282
- static buildUrl(t) {
283
- var e;
284
- let i = ((e = t.apiUrls) == null ? void 0 : e.inbox.webSocket) ?? "";
285
- return t.accessToken && (i += `/?auth=${t.accessToken}`), i;
286
- }
287
- }
288
- class Ko extends re {
289
- constructor(t) {
290
- super(t), T(this, "socket"), this.socket = new ze(t);
291
- }
292
- /**
293
- * Get paginated messages
294
- * @param paginationLimit - Number of messages to return per page (default: 24)
295
- * @param startCursor - Cursor for pagination
296
- * @returns Promise resolving to paginated messages response
297
- */
298
- async getMessages(t) {
299
- const e = `
300
- query GetInboxMessages(
301
- $params: FilterParamsInput = { ${this.options.tenantId ? `accountId: "${this.options.tenantId}"` : ""} }
302
- $limit: Int = ${(t == null ? void 0 : t.paginationLimit) ?? 24}
303
- $after: String ${t != null && t.startCursor ? `= "${t.startCursor}"` : ""}
304
- ) {
305
- count(params: $params)
306
- messages(params: $params, limit: $limit, after: $after) {
307
- totalCount
308
- pageInfo {
309
- startCursor
310
- hasNextPage
311
- }
312
- nodes {
313
- messageId
314
- read
315
- archived
316
- created
317
- opened
318
- title
319
- preview
320
- data
321
- tags
322
- trackingIds {
323
- clickTrackingId
324
- }
325
- actions {
326
- content
327
- data
328
- href
329
- }
330
- }
331
- }
332
- }
333
- `;
334
- return await Z({
335
- options: this.options,
336
- query: e,
337
- headers: {
338
- "x-courier-user-id": this.options.userId,
339
- Authorization: `Bearer ${this.options.accessToken}`
340
- },
341
- url: this.options.apiUrls.inbox.graphql
342
- });
343
- }
344
- /**
345
- * Get paginated archived messages
346
- * @param paginationLimit - Number of messages to return per page (default: 24)
347
- * @param startCursor - Cursor for pagination
348
- * @returns Promise resolving to paginated archived messages response
349
- */
350
- async getArchivedMessages(t) {
351
- const e = `
352
- query GetInboxMessages(
353
- $params: FilterParamsInput = { ${this.options.tenantId ? `accountId: "${this.options.tenantId}"` : ""}, archived: true }
354
- $limit: Int = ${(t == null ? void 0 : t.paginationLimit) ?? 24}
355
- $after: String ${t != null && t.startCursor ? `= "${t.startCursor}"` : ""}
356
- ) {
357
- count(params: $params)
358
- messages(params: $params, limit: $limit, after: $after) {
359
- totalCount
360
- pageInfo {
361
- startCursor
362
- hasNextPage
363
- }
364
- nodes {
365
- messageId
366
- read
367
- archived
368
- created
369
- opened
370
- title
371
- preview
372
- data
373
- tags
374
- trackingIds {
375
- clickTrackingId
376
- }
377
- actions {
378
- content
379
- data
380
- href
381
- }
382
- }
383
- }
384
- }
385
- `;
386
- return Z({
387
- options: this.options,
388
- query: e,
389
- headers: {
390
- "x-courier-user-id": this.options.userId,
391
- Authorization: `Bearer ${this.options.accessToken}`
392
- },
393
- url: this.options.apiUrls.inbox.graphql
394
- });
395
- }
396
- /**
397
- * Get unread message count
398
- * @returns Promise resolving to number of unread messages
399
- */
400
- async getUnreadMessageCount() {
401
- var t;
402
- const e = `
403
- query GetMessages {
404
- count(params: { status: "unread" ${this.options.tenantId ? `, accountId: "${this.options.tenantId}"` : ""} })
405
- }
406
- `;
407
- return ((t = (await Z({
408
- options: this.options,
409
- query: e,
410
- headers: {
411
- "x-courier-user-id": this.options.userId,
412
- Authorization: `Bearer ${this.options.accessToken}`
413
- },
414
- url: this.options.apiUrls.inbox.graphql
415
- })).data) == null ? void 0 : t.count) ?? 0;
416
- }
417
- /**
418
- * Track a click event
419
- * @param messageId - ID of the message
420
- * @param trackingId - ID for tracking the click
421
- * @returns Promise resolving when click is tracked
422
- */
423
- async click(t) {
424
- const e = `
425
- mutation TrackEvent {
426
- clicked(messageId: "${t.messageId}", trackingId: "${t.trackingId}")
427
- }
428
- `, i = {
429
- "x-courier-user-id": this.options.userId,
430
- Authorization: `Bearer ${this.options.accessToken}`
431
- };
432
- this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
433
- options: this.options,
434
- query: e,
435
- headers: i,
436
- url: this.options.apiUrls.inbox.graphql
437
- });
438
- }
439
- /**
440
- * Mark a message as read
441
- * @param messageId - ID of the message to mark as read
442
- * @returns Promise resolving when message is marked as read
443
- */
444
- async read(t) {
445
- const e = `
446
- mutation TrackEvent {
447
- read(messageId: "${t.messageId}")
448
- }
449
- `, i = {
450
- "x-courier-user-id": this.options.userId,
451
- Authorization: `Bearer ${this.options.accessToken}`
452
- };
453
- this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
454
- options: this.options,
455
- query: e,
456
- headers: i,
457
- url: this.options.apiUrls.inbox.graphql
458
- });
459
- }
460
- /**
461
- * Mark a message as unread
462
- * @param messageId - ID of the message to mark as unread
463
- * @returns Promise resolving when message is marked as unread
464
- */
465
- async unread(t) {
466
- const e = `
467
- mutation TrackEvent {
468
- unread(messageId: "${t.messageId}")
469
- }
470
- `, i = {
471
- "x-courier-user-id": this.options.userId,
472
- Authorization: `Bearer ${this.options.accessToken}`
473
- };
474
- this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
475
- options: this.options,
476
- query: e,
477
- headers: i,
478
- url: this.options.apiUrls.inbox.graphql
479
- });
480
- }
481
- /**
482
- * Mark all messages as read
483
- * @returns Promise resolving when all messages are marked as read
484
- */
485
- async readAll() {
486
- const t = `
487
- mutation TrackEvent {
488
- markAllRead
489
- }
490
- `, e = {
491
- "x-courier-user-id": this.options.userId,
492
- Authorization: `Bearer ${this.options.accessToken}`
493
- };
494
- this.options.connectionId && (e["x-courier-client-source-id"] = this.options.connectionId), await Z({
495
- options: this.options,
496
- query: t,
497
- headers: e,
498
- url: this.options.apiUrls.inbox.graphql
499
- });
500
- }
501
- /**
502
- * Mark a message as opened
503
- * @param messageId - ID of the message to mark as opened
504
- * @returns Promise resolving when message is marked as opened
505
- */
506
- async open(t) {
507
- const e = `
508
- mutation TrackEvent {
509
- opened(messageId: "${t.messageId}")
510
- }
511
- `, i = {
512
- "x-courier-user-id": this.options.userId,
513
- Authorization: `Bearer ${this.options.accessToken}`
514
- };
515
- this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
516
- options: this.options,
517
- query: e,
518
- headers: i,
519
- url: this.options.apiUrls.inbox.graphql
520
- });
521
- }
522
- /**
523
- * Archive a message
524
- * @param messageId - ID of the message to archive
525
- * @returns Promise resolving when message is archived
526
- */
527
- async archive(t) {
528
- const e = `
529
- mutation TrackEvent {
530
- archive(messageId: "${t.messageId}")
531
- }
532
- `, i = {
533
- "x-courier-user-id": this.options.userId,
534
- Authorization: `Bearer ${this.options.accessToken}`
535
- };
536
- this.options.connectionId && (i["x-courier-client-source-id"] = this.options.connectionId), await Z({
537
- options: this.options,
538
- query: e,
539
- headers: i,
540
- url: this.options.apiUrls.inbox.graphql
541
- });
542
- }
543
- /**
544
- * Archive all read messages.
545
- */
546
- async archiveRead() {
547
- const t = `
548
- mutation TrackEvent {
549
- archiveRead
550
- }
551
- `, e = {
552
- "x-courier-user-id": this.options.userId,
553
- Authorization: `Bearer ${this.options.accessToken}`
554
- };
555
- this.options.connectionId && (e["x-courier-client-source-id"] = this.options.connectionId), await Z({
556
- options: this.options,
557
- query: t,
558
- headers: e,
559
- url: this.options.apiUrls.inbox.graphql
560
- });
561
- }
562
- }
563
- class Xo {
564
- /**
565
- * Transforms a single API response item to the CourierUserPreferencesTopic type
566
- * @param item - The API response item
567
- * @returns A CourierUserPreferencesTopic object
568
- */
569
- transformItem(t) {
570
- return {
571
- topicId: t.topic_id,
572
- topicName: t.topic_name,
573
- sectionId: t.section_id,
574
- sectionName: t.section_name,
575
- status: t.status,
576
- defaultStatus: t.default_status,
577
- hasCustomRouting: t.has_custom_routing,
578
- customRouting: t.custom_routing || []
579
- };
580
- }
581
- /**
582
- * Transforms an array of API response items to CourierUserPreferencesTopic objects
583
- * @param items - The API response items
584
- * @returns A generator of CourierUserPreferencesTopic objects
585
- */
586
- *transform(t) {
587
- for (const e of t)
588
- yield this.transformItem(e);
589
- }
590
- }
591
- function Qo(h) {
592
- const t = atob(h), e = new Uint8Array(t.length);
593
- for (let i = 0; i < t.length; i++)
594
- e[i] = t.charCodeAt(i);
595
- return String.fromCharCode(...e);
596
- }
597
- function Yo(h) {
598
- const t = new Uint8Array(h.length);
599
- for (let e = 0; e < h.length; e++)
600
- t[e] = h.charCodeAt(e);
601
- return btoa(String.fromCharCode(...t));
602
- }
603
- class en extends re {
604
- constructor() {
605
- super(...arguments), T(this, "transformer", new Xo());
606
- }
607
- /**
608
- * Get all preferences for a user
609
- * @param paginationCursor - Optional cursor for pagination
610
- * @returns Promise resolving to user preferences
611
- * @see https://www.courier.com/docs/reference/user-preferences/list-all-user-preferences
612
- */
613
- async getUserPreferences(t) {
614
- let e = `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/preferences`;
615
- t != null && t.paginationCursor && (e += `?cursor=${t.paginationCursor}`);
616
- const s = await K({
617
- options: this.options,
618
- url: e,
619
- method: "GET",
620
- headers: {
621
- Authorization: `Bearer ${this.options.accessToken}`
622
- }
623
- });
624
- return {
625
- items: [...this.transformer.transform(s.items)],
626
- paging: s.paging
627
- };
628
- }
629
- /**
630
- * Get preferences for a specific topic
631
- * @param topicId - The ID of the topic to get preferences for
632
- * @returns Promise resolving to topic preferences
633
- * @see https://www.courier.com/docs/reference/user-preferences/get-subscription-topic-preferences
634
- */
635
- async getUserPreferenceTopic(t) {
636
- const i = await K({
637
- options: this.options,
638
- url: `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/preferences/${t.topicId}`,
639
- method: "GET",
640
- headers: {
641
- Authorization: `Bearer ${this.options.accessToken}`
642
- }
643
- });
644
- return this.transformer.transformItem(i.topic);
645
- }
646
- /**
647
- * Update preferences for a specific topic
648
- * @param topicId - The ID of the topic to update preferences for
649
- * @param status - The new status for the topic
650
- * @param hasCustomRouting - Whether the topic has custom routing
651
- * @param customRouting - The custom routing channels for the topic
652
- * @returns Promise resolving when update is complete
653
- * @see https://www.courier.com/docs/reference/user-preferences/update-subscription-topic-preferences
654
- */
655
- async putUserPreferenceTopic(t) {
656
- const e = {
657
- topic: {
658
- status: t.status,
659
- has_custom_routing: t.hasCustomRouting,
660
- custom_routing: t.customRouting
661
- }
662
- };
663
- await K({
664
- options: this.options,
665
- url: `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/preferences/${t.topicId}`,
666
- method: "PUT",
667
- headers: {
668
- Authorization: `Bearer ${this.options.accessToken}`
669
- },
670
- body: e
671
- });
672
- }
673
- /**
674
- * Get the notification center URL
675
- * @param clientKey - The client key to use for the URL
676
- * @returns The notification center URL
677
- */
678
- getNotificationCenterUrl(t) {
679
- const e = Qo(t.clientKey);
680
- return `https://view.notificationcenter.app/p/${Yo(`${e}#${this.options.userId}${this.options.tenantId ? `#${this.options.tenantId}` : ""}#false`)}`;
681
- }
682
- }
683
- class tn extends re {
684
- /**
685
- * Store a push notification token for a user
686
- * @param token - The push notification token
687
- * @param provider - The provider of the token
688
- * @param device - The device information
689
- * @see https://www.courier.com/docs/reference/token-management/put-token
690
- */
691
- async putUserToken(t) {
692
- const e = {
693
- provider_key: t.provider,
694
- ...t.device && {
695
- device: {
696
- app_id: t.device.appId,
697
- ad_id: t.device.adId,
698
- device_id: t.device.deviceId,
699
- platform: t.device.platform,
700
- manufacturer: t.device.manufacturer,
701
- model: t.device.model
702
- }
703
- }
704
- };
705
- await K({
706
- options: this.options,
707
- url: `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/tokens/${t.token}`,
708
- method: "PUT",
709
- headers: {
710
- Authorization: `Bearer ${this.options.accessToken}`
711
- },
712
- body: e,
713
- validCodes: [200, 204]
714
- });
715
- }
716
- /**
717
- * Delete a push notification token for a user
718
- * @param token - The push notification token
719
- * @returns Promise resolving when token is deleted
720
- */
721
- async deleteUserToken(t) {
722
- await K({
723
- options: this.options,
724
- url: `${this.options.apiUrls.courier.rest}/users/${this.options.userId}/tokens/${t.token}`,
725
- method: "DELETE",
726
- headers: {
727
- Authorization: `Bearer ${this.options.accessToken}`
728
- },
729
- validCodes: [200, 204]
730
- });
731
- }
732
- }
733
- class sn extends re {
734
- /**
735
- * Subscribe a user to a list
736
- * @param listId - The ID of the list to subscribe to
737
- * @returns Promise resolving when subscription is complete
738
- * @see https://www.courier.com/docs/reference/lists/recipient-subscribe
739
- */
740
- async putSubscription(t) {
741
- return await K({
742
- url: `${this.options.apiUrls.courier.rest}/lists/${t.listId}/subscriptions/${this.options.userId}`,
743
- options: this.options,
744
- method: "PUT",
745
- headers: {
746
- Authorization: `Bearer ${this.options.accessToken}`
747
- }
748
- });
749
- }
750
- /**
751
- * Unsubscribe a user from a list
752
- * @param listId - The ID of the list to unsubscribe from
753
- * @returns Promise resolving when unsubscription is complete
754
- * @see https://www.courier.com/docs/reference/lists/delete-subscription
755
- */
756
- async deleteSubscription(t) {
757
- return await K({
758
- url: `${this.options.apiUrls.courier.rest}/lists/${t.listId}/subscriptions/${this.options.userId}`,
759
- options: this.options,
760
- method: "DELETE",
761
- headers: {
762
- Authorization: `Bearer ${this.options.accessToken}`
763
- }
764
- });
765
- }
766
- }
767
- class on extends re {
768
- /**
769
- * Post an inbound courier event
770
- * @param event - The event type: Example: "New Order Placed"
771
- * @param messageId - The message ID
772
- * @param type - The type of event: Available options: "track"
773
- * @param properties - The properties of the event
774
- * @returns Promise resolving to the message ID
775
- * @see https://www.courier.com/docs/reference/inbound/courier-track-event
776
- */
777
- async postInboundCourier(t) {
778
- return await K({
779
- url: `${this.options.apiUrls.courier.rest}/inbound/courier`,
780
- options: this.options,
781
- method: "POST",
782
- headers: {
783
- Authorization: `Bearer ${this.options.accessToken}`
784
- },
785
- body: {
786
- ...t,
787
- userId: this.options.userId
788
- },
789
- validCodes: [200, 202]
790
- });
791
- }
792
- /**
793
- * Post a tracking URL event
794
- * These urls are found in messages sent from Courier
795
- * @param url - The URL to post the event to
796
- * @param event - The event type: Available options: "click", "open", "unsubscribe"
797
- * @returns Promise resolving when the event is posted
798
- */
799
- async postTrackingUrl(t) {
800
- return await K({
801
- url: t.url,
802
- options: this.options,
803
- method: "POST",
804
- body: {
805
- event: t.event
806
- }
807
- });
808
- }
809
- }
810
- class nn extends re {
811
- constructor(t) {
812
- var e, i;
813
- const s = t.showLogs !== void 0 ? t.showLogs : process.env.NODE_ENV === "development", o = {
814
- ...t,
815
- showLogs: s,
816
- apiUrls: t.apiUrls || yo(),
817
- accessToken: t.jwt ?? t.publicApiKey
818
- };
819
- super({
820
- ...o,
821
- logger: new Go(o.showLogs),
822
- apiUrls: yo(o.apiUrls)
823
- }), T(this, "tokens"), T(this, "brands"), T(this, "preferences"), T(this, "inbox"), T(this, "lists"), T(this, "tracking"), this.tokens = new tn(this.options), this.brands = new Wo(this.options), this.preferences = new en(this.options), this.inbox = new Ko(this.options), this.lists = new sn(this.options), this.tracking = new on(this.options), !this.options.jwt && !this.options.publicApiKey && this.options.logger.warn("Courier Client initialized with no authentication method. Please provide a JWT or public API key."), this.options.publicApiKey && ((e = this.options.logger) == null || e.warn(
824
- `Courier Warning: Public API Keys are for testing only. Please use JWTs for production.
825
- You can generate a JWT with this endpoint: https://www.courier.com/docs/reference/auth/issue-token
826
- This endpoint should be called from your backend server, not the SDK.`
827
- )), this.options.jwt && this.options.publicApiKey && ((i = this.options.logger) == null || i.warn(
828
- "Courier Warning: Both a JWT and a Public API Key were provided. The Public API Key will be ignored."
829
- ));
830
- }
831
- }
832
- class rn {
833
- constructor(t) {
834
- T(this, "callback"), this.callback = t;
835
- }
836
- remove() {
837
- v.shared.removeAuthenticationListener(this);
838
- }
839
- }
840
- const Eo = class Me {
841
- constructor() {
842
- T(this, "id", Ae.generate()), T(this, "instanceClient"), T(this, "_paginationLimit", 24), T(this, "authenticationListeners", []);
843
- }
844
- get paginationLimit() {
845
- return this._paginationLimit;
846
- }
847
- set paginationLimit(t) {
848
- this._paginationLimit = Math.min(Math.max(t, 1), 100);
849
- }
850
- /**
851
- * Get the Courier client instance
852
- * @returns The Courier client instance or undefined if not signed in
853
- */
854
- get client() {
855
- return this.instanceClient;
856
- }
857
- /**
858
- * Get the shared Courier instance
859
- * @returns The shared Courier instance
860
- */
861
- static get shared() {
862
- return Me.instance || (Me.instance = new Me()), Me.instance;
863
- }
864
- /**
865
- * Sign in to Courier
866
- * @param options - The options for the Courier client
867
- */
868
- signIn(t) {
869
- const e = t.connectionId ?? Ae.generate();
870
- this.instanceClient = new nn({ ...t, connectionId: e }), this.notifyAuthenticationListeners({ userId: t.userId });
871
- }
872
- /**
873
- * Sign out of Courier
874
- */
875
- signOut() {
876
- this.instanceClient = void 0, this.notifyAuthenticationListeners({ userId: void 0 });
877
- }
878
- /**
879
- * Register a callback to be notified of authentication state changes
880
- * @param callback - Function to be called when authentication state changes
881
- * @returns AuthenticationListener instance that can be used to remove the listener
882
- */
883
- addAuthenticationListener(t) {
884
- var e;
885
- (e = this.instanceClient) == null || e.options.logger.info("Adding authentication listener");
886
- const i = new rn(t);
887
- return this.authenticationListeners.push(i), i;
888
- }
889
- /**
890
- * Unregister an authentication state change listener
891
- * @param listener - The AuthenticationListener instance to remove
892
- */
893
- removeAuthenticationListener(t) {
894
- var e;
895
- (e = this.instanceClient) == null || e.options.logger.info("Removing authentication listener"), this.authenticationListeners = this.authenticationListeners.filter((i) => i !== t);
896
- }
897
- /**
898
- * Notify all authentication listeners
899
- * @param props - The props to notify the listeners with
900
- */
901
- notifyAuthenticationListeners(t) {
902
- this.authenticationListeners.forEach((e) => e.callback(t));
903
- }
904
- };
905
- T(Eo, "instance");
906
- let v = Eo;
907
- var an = Object.defineProperty, hn = (h, t, e) => t in h ? an(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, $ = (h, t, e) => hn(h, typeof t != "symbol" ? t + "" : t, e);
1
+ var Lo = Object.defineProperty;
2
+ var To = (g, i, e) => i in g ? Lo(g, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : g[i] = e;
3
+ var a = (g, i, e) => To(g, typeof i != "symbol" ? i + "" : i, e);
4
+ import { Courier as C } from "@trycourier/courier-js";
5
+ var Bo = Object.defineProperty, Ao = (g, i, e) => i in g ? Bo(g, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : g[i] = e, L = (g, i, e) => Ao(g, typeof i != "symbol" ? i + "" : i, e);
908
6
  const r = {
909
7
  black: {
910
8
  500: "#171717",
@@ -926,7 +24,7 @@ const r = {
926
24
  400: "#60A5FA",
927
25
  500: "#2563EB"
928
26
  }
929
- }, W = {
27
+ }, G = {
930
28
  light: {
931
29
  colors: {
932
30
  primary: r.black[500],
@@ -951,21 +49,21 @@ const r = {
951
49
  cornerRadius: "4px"
952
50
  }
953
51
  }
954
- }, Mo = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", To = (h) => {
52
+ }, go = () => typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", mo = (g) => {
955
53
  if (typeof window > "u")
956
54
  return () => {
957
55
  };
958
- const t = window.matchMedia("(prefers-color-scheme: dark)"), e = (i) => {
959
- h(i.matches ? "dark" : "light");
56
+ const i = window.matchMedia("(prefers-color-scheme: dark)"), e = (t) => {
57
+ g(t.matches ? "dark" : "light");
960
58
  };
961
- return t.addEventListener("change", e), () => {
962
- t.removeEventListener("change", e);
59
+ return i.addEventListener("change", e), () => {
60
+ i.removeEventListener("change", e);
963
61
  };
964
62
  };
965
- class $o extends HTMLElement {
63
+ class bo extends HTMLElement {
966
64
  constructor() {
967
- super(), $(this, "_currentSystemTheme"), $(this, "_systemThemeCleanup"), this._currentSystemTheme = Mo(), this._systemThemeCleanup = To((t) => {
968
- this._currentSystemTheme = t, this.onSystemThemeChange(t);
65
+ super(), L(this, "_currentSystemTheme"), L(this, "_systemThemeCleanup"), this._currentSystemTheme = go(), this._systemThemeCleanup = mo((i) => {
66
+ this._currentSystemTheme = i, this.onSystemThemeChange(i);
969
67
  });
970
68
  }
971
69
  get currentSystemTheme() {
@@ -974,47 +72,47 @@ class $o extends HTMLElement {
974
72
  disconnectedCallback() {
975
73
  this._systemThemeCleanup && this._systemThemeCleanup();
976
74
  }
977
- onSystemThemeChange(t) {
75
+ onSystemThemeChange(i) {
978
76
  }
979
77
  }
980
- const Fe = {
78
+ const Te = {
981
79
  borderRadius: "4px",
982
80
  fontSize: "14px"
983
- }, se = {
984
- primary: (h) => ({
985
- ...Fe,
986
- backgroundColor: W[h].colors.primary,
987
- textColor: W[h].colors.secondary,
81
+ }, ee = {
82
+ primary: (g) => ({
83
+ ...Te,
84
+ backgroundColor: G[g].colors.primary,
85
+ textColor: G[g].colors.secondary,
988
86
  fontWeight: "500",
989
87
  shadow: "none"
990
88
  }),
991
- secondary: (h) => ({
992
- ...Fe,
993
- backgroundColor: W[h].colors.secondary,
994
- textColor: W[h].colors.primary,
89
+ secondary: (g) => ({
90
+ ...Te,
91
+ backgroundColor: G[g].colors.secondary,
92
+ textColor: G[g].colors.primary,
995
93
  fontWeight: "500",
996
- border: `1px solid ${W[h].colors.border}`,
997
- shadow: h === "light" ? "0px 1px 2px 0px rgba(0, 0, 0, 0.06)" : "0px 1px 2px 0px rgba(255, 255, 255, 0.1)"
94
+ border: `1px solid ${G[g].colors.border}`,
95
+ shadow: g === "light" ? "0px 1px 2px 0px rgba(0, 0, 0, 0.06)" : "0px 1px 2px 0px rgba(255, 255, 255, 0.1)"
998
96
  }),
999
- tertiary: (h) => ({
1000
- ...Fe,
1001
- backgroundColor: W[h].colors.border,
1002
- textColor: W[h].colors.primary,
97
+ tertiary: (g) => ({
98
+ ...Te,
99
+ backgroundColor: G[g].colors.border,
100
+ textColor: G[g].colors.primary,
1003
101
  fontWeight: "500",
1004
102
  border: "none",
1005
103
  shadow: "none"
1006
104
  })
1007
105
  };
1008
- class Re extends $o {
1009
- constructor(t) {
1010
- super(), $(this, "_button"), $(this, "_style");
106
+ class Ie extends bo {
107
+ constructor(i) {
108
+ super(), L(this, "_button"), L(this, "_style");
1011
109
  const e = this.attachShadow({ mode: "open" });
1012
- this._button = document.createElement("button"), this._button.setAttribute("part", "button"), this._style = document.createElement("style"), this._style.textContent = this.getStyles(t), e.appendChild(this._style), e.appendChild(this._button), this.updateButton(t), this._button.addEventListener("click", (i) => {
1013
- i.preventDefault(), i.stopPropagation(), t.onClick && t.onClick();
110
+ this._button = document.createElement("button"), this._button.setAttribute("part", "button"), this._style = document.createElement("style"), this._style.textContent = this.getStyles(i), e.appendChild(this._style), e.appendChild(this._button), this.updateButton(i), this._button.addEventListener("click", (t) => {
111
+ t.preventDefault(), t.stopPropagation(), i.onClick && i.onClick();
1014
112
  });
1015
113
  }
1016
- getStyles(t) {
1017
- const e = () => se.secondary(this.currentSystemTheme).textColor, i = () => se.secondary(this.currentSystemTheme).backgroundColor, s = () => se.secondary(this.currentSystemTheme).border, o = () => se.secondary(this.currentSystemTheme).shadow, n = () => se.secondary(this.currentSystemTheme).borderRadius, c = () => se.secondary(this.currentSystemTheme).fontSize, d = () => se.secondary(this.currentSystemTheme).fontWeight;
114
+ getStyles(i) {
115
+ const e = () => ee.secondary(this.currentSystemTheme).textColor, t = () => ee.secondary(this.currentSystemTheme).backgroundColor, s = () => ee.secondary(this.currentSystemTheme).border, o = () => ee.secondary(this.currentSystemTheme).shadow, n = () => ee.secondary(this.currentSystemTheme).borderRadius, h = () => ee.secondary(this.currentSystemTheme).fontSize, d = () => ee.secondary(this.currentSystemTheme).fontWeight;
1018
116
  return `
1019
117
  :host {
1020
118
  display: inline-block;
@@ -1022,27 +120,27 @@ class Re extends $o {
1022
120
 
1023
121
  button {
1024
122
  border: none;
1025
- border-radius: ${t.borderRadius ?? n()};
1026
- font-weight: ${t.fontWeight ?? d()};
1027
- font-family: ${t.fontFamily ?? "inherit"};
1028
- font-size: ${t.fontSize ?? c()};
123
+ border-radius: ${i.borderRadius ?? n()};
124
+ font-weight: ${i.fontWeight ?? d()};
125
+ font-family: ${i.fontFamily ?? "inherit"};
126
+ font-size: ${i.fontSize ?? h()};
1029
127
  padding: 6px 10px;
1030
128
  cursor: pointer;
1031
129
  width: 100%;
1032
130
  height: 100%;
1033
- background-color: ${t.backgroundColor ?? i()};
1034
- color: ${t.textColor ?? e()};
1035
- border: ${t.border ?? s()};
1036
- box-shadow: ${t.shadow ?? o()};
131
+ background-color: ${i.backgroundColor ?? t()};
132
+ color: ${i.textColor ?? e()};
133
+ border: ${i.border ?? s()};
134
+ box-shadow: ${i.shadow ?? o()};
1037
135
  touch-action: manipulation;
1038
136
  }
1039
137
 
1040
138
  button:hover {
1041
- ${t.hoverBackgroundColor ? `background-color: ${t.hoverBackgroundColor};` : "filter: brightness(0.9);"}
139
+ ${i.hoverBackgroundColor ? `background-color: ${i.hoverBackgroundColor};` : "filter: brightness(0.9);"}
1042
140
  }
1043
141
 
1044
142
  button:active {
1045
- ${t.activeBackgroundColor ? `background-color: ${t.activeBackgroundColor};` : "filter: brightness(0.8);"}
143
+ ${i.activeBackgroundColor ? `background-color: ${i.activeBackgroundColor};` : "filter: brightness(0.8);"}
1046
144
  }
1047
145
 
1048
146
  button:disabled {
@@ -1051,12 +149,12 @@ class Re extends $o {
1051
149
  }
1052
150
  `;
1053
151
  }
1054
- updateButton(t) {
1055
- t.text && (this._button.textContent = t.text), this._style.textContent = this.getStyles(t);
152
+ updateButton(i) {
153
+ i.text && (this._button.textContent = i.text), this._style.textContent = this.getStyles(i);
1056
154
  }
1057
155
  }
1058
- customElements.get("courier-button") || customElements.define("courier-button", Re);
1059
- const x = {
156
+ customElements.get("courier-button") || customElements.define("courier-button", Ie);
157
+ const f = {
1060
158
  inbox: `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
1061
159
  <path d="M5.5 14.5V17C5.5 17.2812 5.71875 17.5 6 17.5H18C18.25 17.5 18.5 17.2812 18.5 17V14.5H15.9375L15.2812 15.8125C15.0938 16.25 14.6562 16.5 14.1875 16.5H9.78125C9.3125 16.5 8.875 16.25 8.6875 15.8125L8.03125 14.5H5.5ZM18.1875 13L16.6562 6.90625C16.5938 6.65625 16.4062 6.5 16.1875 6.5H7.8125C7.5625 6.5 7.375 6.65625 7.3125 6.90625L5.78125 13H8.1875C8.65625 13 9.09375 13.2812 9.3125 13.7188L9.9375 15H14.0312L14.6875 13.7188C14.875 13.2812 15.3125 13 15.7812 13H18.1875ZM4 14.25C4 14.0938 4 13.9375 4.03125 13.7812L5.84375 6.53125C6.09375 5.625 6.875 5 7.8125 5H16.1875C17.0938 5 17.9062 5.625 18.125 6.53125L19.9375 13.7812C19.9688 13.9375 20 14.0938 20 14.25V17C20 18.125 19.0938 19 18 19H6C4.875 19 4 18.125 4 17V14.25Z" fill="currentColor"/>
1062
160
  </svg>`,
@@ -1085,13 +183,13 @@ const x = {
1085
183
  <path d="M5.5 11C5.0625 11 4.75 10.6875 4.75 10.25V5.75C4.75 5.34375 5.0625 5 5.5 5C5.90625 5 6.25 5.34375 6.25 5.75V8.28125L6.875 7.53125C8.15625 6 10.0625 5 12.25 5C16.0938 5 19.25 8.15625 19.25 12C19.25 15.875 16.0938 19 12.25 19C10.6562 19 9.21875 18.5 8.03125 17.625C7.71875 17.375 7.625 16.9062 7.875 16.5625C8.125 16.2188 8.59375 16.1562 8.9375 16.4062C9.84375 17.0938 11 17.5 12.25 17.5C15.2812 17.5 17.75 15.0625 17.75 12C17.75 8.96875 15.2812 6.5 12.25 6.5C10.5312 6.5 9.03125 7.28125 8 8.5L7.15625 9.5H10C10.4062 9.5 10.75 9.84375 10.75 10.25C10.75 10.6875 10.4062 11 10 11H5.5Z" fill="currentColor"/>
1086
184
  </svg>`
1087
185
  };
1088
- class ne extends HTMLElement {
1089
- constructor(t, e) {
1090
- super(), $(this, "_color"), $(this, "_svg"), $(this, "_iconContainer"), $(this, "_style"), this._color = t ?? r.black[500], this._svg = e;
1091
- const i = this.attachShadow({ mode: "open" });
1092
- this._iconContainer = document.createElement("div"), i.appendChild(this._iconContainer), this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._color), i.appendChild(this._style), this.refresh();
186
+ class ie extends HTMLElement {
187
+ constructor(i, e) {
188
+ super(), L(this, "_color"), L(this, "_svg"), L(this, "_iconContainer"), L(this, "_style"), this._color = i ?? r.black[500], this._svg = e;
189
+ const t = this.attachShadow({ mode: "open" });
190
+ this._iconContainer = document.createElement("div"), t.appendChild(this._iconContainer), this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._color), t.appendChild(this._style), this.refresh();
1093
191
  }
1094
- getStyles(t) {
192
+ getStyles(i) {
1095
193
  return `
1096
194
  :host {
1097
195
  display: inline-block;
@@ -1104,25 +202,25 @@ class ne extends HTMLElement {
1104
202
  svg {
1105
203
  width: 24px;
1106
204
  height: 24px;
1107
- color: ${t};
205
+ color: ${i};
1108
206
  }
1109
207
  `;
1110
208
  }
1111
209
  refresh() {
1112
210
  this._svg && (this._iconContainer.innerHTML = this._svg), this._color && (this._style.textContent = this.getStyles(this._color));
1113
211
  }
1114
- updateColor(t) {
1115
- this._color = t, this.refresh();
212
+ updateColor(i) {
213
+ this._color = i, this.refresh();
1116
214
  }
1117
- updateSVG(t) {
1118
- this._svg = t, this.refresh();
215
+ updateSVG(i) {
216
+ this._svg = i, this.refresh();
1119
217
  }
1120
218
  }
1121
- customElements.get("courier-icon") || customElements.define("courier-icon", ne);
1122
- class Ue extends HTMLElement {
219
+ customElements.get("courier-icon") || customElements.define("courier-icon", ie);
220
+ class De extends HTMLElement {
1123
221
  constructor() {
1124
- super(), $(this, "link");
1125
- const t = this.attachShadow({ mode: "open" });
222
+ super(), L(this, "link");
223
+ const i = this.attachShadow({ mode: "open" });
1126
224
  this.link = document.createElement("a"), this.link.setAttribute("part", "link");
1127
225
  const e = document.createElement("style");
1128
226
  e.textContent = `
@@ -1142,7 +240,7 @@ class Ue extends HTMLElement {
1142
240
 
1143
241
  /* Variants */
1144
242
  a[data-variant="primary"][data-mode="light"] {
1145
- color: var(--courier-link-color, ${W.light.colors.link});
243
+ color: var(--courier-link-color, ${G.light.colors.link});
1146
244
  }
1147
245
 
1148
246
  a[data-variant="primary"][data-mode="light"]:hover {
@@ -1154,7 +252,7 @@ class Ue extends HTMLElement {
1154
252
  }
1155
253
 
1156
254
  a[data-variant="primary"][data-mode="dark"] {
1157
- color: var(--courier-link-color, ${W.dark.colors.link});
255
+ color: var(--courier-link-color, ${G.dark.colors.link});
1158
256
  }
1159
257
 
1160
258
  a[data-variant="primary"][data-mode="dark"]:hover {
@@ -1174,15 +272,15 @@ class Ue extends HTMLElement {
1174
272
  cursor: not-allowed;
1175
273
  pointer-events: none;
1176
274
  }
1177
- `, t.appendChild(e), t.appendChild(this.link), this.updateVariant(), this.updateUnderline(), this.updateMode();
275
+ `, i.appendChild(e), i.appendChild(this.link), this.updateVariant(), this.updateUnderline(), this.updateMode();
1178
276
  }
1179
277
  connectedCallback() {
1180
- const t = document.createElement("slot");
1181
- this.link.appendChild(t), this.updateHref();
278
+ const i = document.createElement("slot");
279
+ this.link.appendChild(i), this.updateHref();
1182
280
  }
1183
- attributeChangedCallback(t, e, i) {
1184
- if (e !== i)
1185
- switch (t) {
281
+ attributeChangedCallback(i, e, t) {
282
+ if (e !== t)
283
+ switch (i) {
1186
284
  case "href":
1187
285
  this.updateHref();
1188
286
  break;
@@ -1211,39 +309,39 @@ class Ue extends HTMLElement {
1211
309
  }
1212
310
  }
1213
311
  updateHref() {
1214
- const t = this.getAttribute("href");
1215
- t && (this.link.href = t);
312
+ const i = this.getAttribute("href");
313
+ i && (this.link.href = i);
1216
314
  }
1217
315
  updateVariant() {
1218
- const t = this.getAttribute("variant") || "primary", e = this.getAttribute("mode") || "light";
1219
- this.link.setAttribute("data-variant", t), this.link.setAttribute("data-mode", e);
316
+ const i = this.getAttribute("variant") || "primary", e = this.getAttribute("mode") || "light";
317
+ this.link.setAttribute("data-variant", i), this.link.setAttribute("data-mode", e);
1220
318
  }
1221
319
  updateColor() {
1222
- const t = this.getAttribute("color");
1223
- t ? this.link.style.setProperty("--courier-link-color", t) : this.link.style.removeProperty("--courier-link-color");
320
+ const i = this.getAttribute("color");
321
+ i ? this.link.style.setProperty("--courier-link-color", i) : this.link.style.removeProperty("--courier-link-color");
1224
322
  }
1225
323
  updateUnderline() {
1226
- const t = this.getAttribute("underline") === "true";
1227
- this.link.setAttribute("data-underline", t.toString());
324
+ const i = this.getAttribute("underline") === "true";
325
+ this.link.setAttribute("data-underline", i.toString());
1228
326
  }
1229
327
  updateMode() {
1230
- const t = this.getAttribute("mode") || "light";
1231
- this.link.setAttribute("data-mode", t);
328
+ const i = this.getAttribute("mode") || "light";
329
+ this.link.setAttribute("data-mode", i);
1232
330
  }
1233
331
  updateTarget() {
1234
- const t = this.getAttribute("target");
1235
- t && (this.link.target = t);
332
+ const i = this.getAttribute("target");
333
+ i && (this.link.target = i);
1236
334
  }
1237
335
  updateFontFamily() {
1238
- const t = this.getAttribute("font-family");
1239
- t ? this.link.style.setProperty("--courier-link-font-family", t) : this.link.style.removeProperty("--courier-link-font-family");
336
+ const i = this.getAttribute("font-family");
337
+ i ? this.link.style.setProperty("--courier-link-font-family", i) : this.link.style.removeProperty("--courier-link-font-family");
1240
338
  }
1241
339
  updateFontSize() {
1242
- const t = this.getAttribute("font-size");
1243
- t ? this.link.style.setProperty("--courier-link-font-size", t) : this.link.style.removeProperty("--courier-link-font-size");
340
+ const i = this.getAttribute("font-size");
341
+ i ? this.link.style.setProperty("--courier-link-font-size", i) : this.link.style.removeProperty("--courier-link-font-size");
1244
342
  }
1245
343
  }
1246
- $(Ue, "observedAttributes", [
344
+ L(De, "observedAttributes", [
1247
345
  "href",
1248
346
  "variant",
1249
347
  "disabled",
@@ -1254,46 +352,46 @@ $(Ue, "observedAttributes", [
1254
352
  "font-family",
1255
353
  "font-size"
1256
354
  ]);
1257
- customElements.get("courier-link") || customElements.define("courier-link", Ue);
1258
- class De extends $o {
355
+ customElements.get("courier-link") || customElements.define("courier-link", De);
356
+ class Le extends bo {
1259
357
  constructor() {
1260
- super(), $(this, "shadow"), this.shadow = this.attachShadow({ mode: "open" });
358
+ super(), L(this, "shadow"), this.shadow = this.attachShadow({ mode: "open" });
1261
359
  }
1262
360
  // Build the element with a factory function
1263
- build(t) {
1264
- if (t === null) {
361
+ build(i) {
362
+ if (i === null) {
1265
363
  this.shadow.replaceChildren();
1266
364
  return;
1267
365
  }
1268
- const e = t ?? this.defaultElement();
366
+ const e = i ?? this.defaultElement();
1269
367
  this.shadow.replaceChildren(e);
1270
368
  }
1271
369
  // Default element to be used if no factory is provided
1272
370
  defaultElement() {
1273
- const t = document.createElement("div");
1274
- return t.textContent = "Default Element Factory", t.style.cssText = `
371
+ const i = document.createElement("div");
372
+ return i.textContent = "Default Element Factory", i.style.cssText = `
1275
373
  background-color: red;
1276
374
  text-align: center;
1277
375
  padding: 12px;
1278
- `, t;
376
+ `, i;
1279
377
  }
1280
378
  }
1281
- class Be extends De {
1282
- constructor(t) {
1283
- super(), $(this, "_props"), $(this, "_title"), $(this, "_button"), $(this, "_style"), $(this, "_buttonClickCallback", null), this._props = t;
379
+ class Ee extends Le {
380
+ constructor(i) {
381
+ super(), L(this, "_props"), L(this, "_title"), L(this, "_button"), L(this, "_style"), L(this, "_buttonClickCallback", null), this._props = i;
1284
382
  }
1285
383
  defaultElement() {
1286
- var t, e;
1287
- const i = document.createElement("div");
1288
- return this._title = document.createElement("h2"), (t = this._props.title) != null && t.text && (this._title.textContent = this._props.title.text), this._button = new Re(this._props.button ?? se.secondary(this.currentSystemTheme)), this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._props), i.className = "container", i.appendChild(this._style), i.appendChild(this._title), i.appendChild(this._button), this.shadow.appendChild(i), (e = this._button) == null || e.addEventListener("click", () => {
384
+ var i, e;
385
+ const t = document.createElement("div");
386
+ return this._title = document.createElement("h2"), (i = this._props.title) != null && i.text && (this._title.textContent = this._props.title.text), this._button = new Ie(this._props.button ?? ee.secondary(this.currentSystemTheme)), this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._props), t.className = "container", t.appendChild(this._style), t.appendChild(this._title), t.appendChild(this._button), this.shadow.appendChild(t), (e = this._button) == null || e.addEventListener("click", () => {
1289
387
  this._buttonClickCallback && this._buttonClickCallback();
1290
- }), i;
388
+ }), t;
1291
389
  }
1292
- onSystemThemeChange(t) {
390
+ onSystemThemeChange(i) {
1293
391
  this.updateStyles(this._props);
1294
392
  }
1295
- getStyles(t) {
1296
- var e, i, s, o;
393
+ getStyles(i) {
394
+ var e, t, s, o;
1297
395
  return `
1298
396
  :host {
1299
397
  display: flex;
@@ -1315,26 +413,26 @@ class Be extends De {
1315
413
 
1316
414
  .container h2 {
1317
415
  margin: 0;
1318
- color: ${((e = t.title) == null ? void 0 : e.textColor) ?? "red"};
1319
- font-size: ${((i = t.title) == null ? void 0 : i.fontSize) ?? "16px"};
1320
- font-weight: ${((s = t.title) == null ? void 0 : s.fontWeight) ?? "500"};
1321
- font-family: ${((o = t.title) == null ? void 0 : o.fontFamily) ?? "inherit"};
416
+ color: ${((e = i.title) == null ? void 0 : e.textColor) ?? "red"};
417
+ font-size: ${((t = i.title) == null ? void 0 : t.fontSize) ?? "16px"};
418
+ font-weight: ${((s = i.title) == null ? void 0 : s.fontWeight) ?? "500"};
419
+ font-family: ${((o = i.title) == null ? void 0 : o.fontFamily) ?? "inherit"};
1322
420
  }
1323
421
  `;
1324
422
  }
1325
- updateStyles(t) {
1326
- this._props = t, this._style && (this._style.textContent = this.getStyles(t)), this._button && this._button.updateButton(t.button);
423
+ updateStyles(i) {
424
+ this._props = i, this._style && (this._style.textContent = this.getStyles(i)), this._button && this._button.updateButton(i.button);
1327
425
  }
1328
- setButtonClickCallback(t) {
1329
- this._buttonClickCallback = t;
426
+ setButtonClickCallback(i) {
427
+ this._buttonClickCallback = i;
1330
428
  }
1331
429
  }
1332
- customElements.get("courier-info-state") || customElements.define("courier-info-state", Be);
1333
- class $e extends HTMLElement {
1334
- constructor(t, e, i, s, o, n, c, d) {
1335
- super(), $(this, "_backgroundColor"), $(this, "_hoverBackgroundColor"), $(this, "_activeBackgroundColor"), $(this, "_borderRadius"), $(this, "_height"), $(this, "_width"), $(this, "_style"), $(this, "_button"), $(this, "_icon"), this._borderRadius = n, this._backgroundColor = i, this._hoverBackgroundColor = s, this._activeBackgroundColor = o, this._height = c, this._width = d;
1336
- const l = this.attachShadow({ mode: "open" });
1337
- this._button = document.createElement("button"), this._button.setAttribute("part", "button"), this._icon = new ne(e, t), this._style = document.createElement("style"), this.refresh(), l.appendChild(this._style), this._button.appendChild(this._icon), l.appendChild(this._button);
430
+ customElements.get("courier-info-state") || customElements.define("courier-info-state", Ee);
431
+ class Se extends HTMLElement {
432
+ constructor(i, e, t, s, o, n, h, d) {
433
+ super(), L(this, "_backgroundColor"), L(this, "_hoverBackgroundColor"), L(this, "_activeBackgroundColor"), L(this, "_borderRadius"), L(this, "_height"), L(this, "_width"), L(this, "_style"), L(this, "_button"), L(this, "_icon"), this._borderRadius = n, this._backgroundColor = t, this._hoverBackgroundColor = s, this._activeBackgroundColor = o, this._height = h, this._width = d;
434
+ const c = this.attachShadow({ mode: "open" });
435
+ this._button = document.createElement("button"), this._button.setAttribute("part", "button"), this._icon = new ie(e, i), this._style = document.createElement("style"), this.refresh(), c.appendChild(this._style), this._button.appendChild(this._icon), c.appendChild(this._button);
1338
436
  }
1339
437
  refresh() {
1340
438
  this._style.textContent = this.getStyles();
@@ -1382,34 +480,34 @@ class $e extends HTMLElement {
1382
480
  }
1383
481
  `;
1384
482
  }
1385
- updateIconColor(t) {
1386
- this._icon.updateColor(t);
483
+ updateIconColor(i) {
484
+ this._icon.updateColor(i);
1387
485
  }
1388
- updateIconSVG(t) {
1389
- this._icon.updateSVG(t);
486
+ updateIconSVG(i) {
487
+ this._icon.updateSVG(i);
1390
488
  }
1391
- updateBackgroundColor(t) {
1392
- this._backgroundColor = t, this.refresh();
489
+ updateBackgroundColor(i) {
490
+ this._backgroundColor = i, this.refresh();
1393
491
  }
1394
- updateHoverBackgroundColor(t) {
1395
- this._hoverBackgroundColor = t, this.refresh();
492
+ updateHoverBackgroundColor(i) {
493
+ this._hoverBackgroundColor = i, this.refresh();
1396
494
  }
1397
- updateActiveBackgroundColor(t) {
1398
- this._activeBackgroundColor = t, this.refresh();
495
+ updateActiveBackgroundColor(i) {
496
+ this._activeBackgroundColor = i, this.refresh();
1399
497
  }
1400
498
  }
1401
- customElements.get("courier-icon-button") || customElements.define("courier-icon-button", $e);
1402
- const cn = [
1403
- { name: "courier-button", class: Re },
1404
- { name: "courier-icon", class: ne },
1405
- { name: "courier-link", class: Ue },
1406
- { name: "courier-info-state", class: Be },
1407
- { name: "courier-icon-button", class: $e }
499
+ customElements.get("courier-icon-button") || customElements.define("courier-icon-button", Se);
500
+ const Do = [
501
+ { name: "courier-button", class: Ie },
502
+ { name: "courier-icon", class: ie },
503
+ { name: "courier-link", class: De },
504
+ { name: "courier-info-state", class: Ee },
505
+ { name: "courier-icon-button", class: Se }
1408
506
  ];
1409
- cn.forEach(({ name: h, class: t }) => {
1410
- customElements.get(h) || customElements.define(h, t);
507
+ Do.forEach(({ name: g, class: i }) => {
508
+ customElements.get(g) || customElements.define(g, i);
1411
509
  });
1412
- const oe = class oe {
510
+ const te = class te {
1413
511
  constructor() {
1414
512
  a(this, "_inboxDataSet");
1415
513
  a(this, "_archiveDataSet");
@@ -1419,7 +517,7 @@ const oe = class oe {
1419
517
  a(this, "isPaginatingArchive", !1);
1420
518
  }
1421
519
  static get shared() {
1422
- return oe.instance || (oe.instance = new oe()), oe.instance;
520
+ return te.instance || (te.instance = new te()), te.instance;
1423
521
  }
1424
522
  get unreadCount() {
1425
523
  return this._unreadCount ?? 0;
@@ -1430,16 +528,16 @@ const oe = class oe {
1430
528
  get archiveDataSet() {
1431
529
  return this._archiveDataSet ?? { messages: [], canPaginate: !1, paginationCursor: null };
1432
530
  }
1433
- addDataStoreListener(t) {
1434
- this._dataStoreListeners.push(t);
531
+ addDataStoreListener(i) {
532
+ this._dataStoreListeners.push(i);
1435
533
  }
1436
- removeDataStoreListener(t) {
1437
- this._dataStoreListeners = this._dataStoreListeners.filter((e) => e !== t);
534
+ removeDataStoreListener(i) {
535
+ this._dataStoreListeners = this._dataStoreListeners.filter((e) => e !== i);
1438
536
  }
1439
- async fetchDataSet(t) {
1440
- var i, s, o, n, c, d, l, p, m, g;
1441
- if (t.canUseCache)
1442
- switch (t.feedType) {
537
+ async fetchDataSet(i) {
538
+ var t, s, o, n, h, d, c, u, m, p;
539
+ if (i.canUseCache)
540
+ switch (i.feedType) {
1443
541
  case "inbox":
1444
542
  if (this._inboxDataSet)
1445
543
  return this._inboxDataSet;
@@ -1449,23 +547,23 @@ const oe = class oe {
1449
547
  return this._archiveDataSet;
1450
548
  break;
1451
549
  }
1452
- const e = t.feedType === "inbox" ? await ((i = v.shared.client) == null ? void 0 : i.inbox.getMessages()) : await ((s = v.shared.client) == null ? void 0 : s.inbox.getArchivedMessages());
550
+ const e = i.feedType === "inbox" ? await ((t = C.shared.client) == null ? void 0 : t.inbox.getMessages()) : await ((s = C.shared.client) == null ? void 0 : s.inbox.getArchivedMessages());
1453
551
  return {
1454
552
  messages: ((n = (o = e == null ? void 0 : e.data) == null ? void 0 : o.messages) == null ? void 0 : n.nodes) ?? [],
1455
- canPaginate: ((l = (d = (c = e == null ? void 0 : e.data) == null ? void 0 : c.messages) == null ? void 0 : d.pageInfo) == null ? void 0 : l.hasNextPage) ?? !1,
1456
- paginationCursor: ((g = (m = (p = e == null ? void 0 : e.data) == null ? void 0 : p.messages) == null ? void 0 : m.pageInfo) == null ? void 0 : g.startCursor) ?? null
553
+ canPaginate: ((c = (d = (h = e == null ? void 0 : e.data) == null ? void 0 : h.messages) == null ? void 0 : d.pageInfo) == null ? void 0 : c.hasNextPage) ?? !1,
554
+ paginationCursor: ((p = (m = (u = e == null ? void 0 : e.data) == null ? void 0 : u.messages) == null ? void 0 : m.pageInfo) == null ? void 0 : p.startCursor) ?? null
1457
555
  };
1458
556
  }
1459
- async fetchUnreadCount(t) {
1460
- var i;
1461
- return t.canUseCache && this._unreadCount !== void 0 ? this._unreadCount : await ((i = v.shared.client) == null ? void 0 : i.inbox.getUnreadMessageCount()) ?? 0;
557
+ async fetchUnreadCount(i) {
558
+ var t;
559
+ return i.canUseCache && this._unreadCount !== void 0 ? this._unreadCount : await ((t = C.shared.client) == null ? void 0 : t.inbox.getUnreadMessageCount()) ?? 0;
1462
560
  }
1463
- async load(t) {
1464
- var e, i, s;
561
+ async load(i) {
562
+ var e, t, s;
1465
563
  try {
1466
- if (!((e = v.shared.client) != null && e.options.userId))
564
+ if (!((e = C.shared.client) != null && e.options.userId))
1467
565
  throw new Error("User is not signed in");
1468
- const o = t ?? { feedType: "inbox", canUseCache: !0 }, [n, c] = await Promise.all([
566
+ const o = i ?? { feedType: "inbox", canUseCache: !0 }, [n, h] = await Promise.all([
1469
567
  this.fetchDataSet(o),
1470
568
  this.fetchUnreadCount(o)
1471
569
  ]);
@@ -1477,32 +575,32 @@ const oe = class oe {
1477
575
  this._archiveDataSet = n;
1478
576
  break;
1479
577
  }
1480
- this._unreadCount = c, this._dataStoreListeners.forEach((d) => {
1481
- var l, p, m, g;
1482
- (p = (l = d.events).onDataSetChange) == null || p.call(l, n, o.feedType), (g = (m = d.events).onUnreadCountChange) == null || g.call(m, this._unreadCount ?? 0);
578
+ this._unreadCount = h, this._dataStoreListeners.forEach((d) => {
579
+ var c, u, m, p;
580
+ (u = (c = d.events).onDataSetChange) == null || u.call(c, n, o.feedType), (p = (m = d.events).onUnreadCountChange) == null || p.call(m, this._unreadCount ?? 0);
1483
581
  }), await this.connectSocket();
1484
582
  } catch (o) {
1485
- (s = (i = v.shared.client) == null ? void 0 : i.options.logger) == null || s.error("Error loading inbox:", o), this._dataStoreListeners.forEach((n) => {
1486
- var c, d;
1487
- (d = (c = n.events).onError) == null || d.call(c, o);
583
+ (s = (t = C.shared.client) == null ? void 0 : t.options.logger) == null || s.error("Error loading inbox:", o), this._dataStoreListeners.forEach((n) => {
584
+ var h, d;
585
+ (d = (h = n.events).onError) == null || d.call(h, o);
1488
586
  });
1489
587
  }
1490
588
  }
1491
589
  async connectSocket() {
1492
- var e, i, s, o, n, c, d, l, p, m, g, f;
1493
- const t = (e = v.shared.client) == null ? void 0 : e.inbox.socket;
590
+ var e, t, s, o, n, h, d, c, u, m, p, x;
591
+ const i = (e = C.shared.client) == null ? void 0 : e.inbox.socket;
1494
592
  try {
1495
- if (!t) {
1496
- (s = (i = v.shared.client) == null ? void 0 : i.options.logger) == null || s.info("CourierInbox socket not available");
593
+ if (!i) {
594
+ (s = (t = C.shared.client) == null ? void 0 : t.options.logger) == null || s.info("CourierInbox socket not available");
1497
595
  return;
1498
596
  }
1499
- if ((c = (o = v.shared.client) == null ? void 0 : o.options.logger) == null || c.info("CourierInbox socket connectionId:", (n = v.shared.client) == null ? void 0 : n.options.connectionId), t.isConnected) {
1500
- (l = (d = v.shared.client) == null ? void 0 : d.options.logger) == null || l.info("CourierInbox socket already connected. Socket will not attempt reconnection.");
597
+ if ((h = (o = C.shared.client) == null ? void 0 : o.options.logger) == null || h.info("CourierInbox socket connectionId:", (n = C.shared.client) == null ? void 0 : n.options.connectionId), i.isConnected) {
598
+ (c = (d = C.shared.client) == null ? void 0 : d.options.logger) == null || c.info("CourierInbox socket already connected. Socket will not attempt reconnection.");
1501
599
  return;
1502
600
  }
1503
- t.receivedMessage = (_) => {
601
+ i.receivedMessage = (_) => {
1504
602
  this.addMessage(_, 0, "inbox");
1505
- }, t.receivedMessageEvent = (_) => {
603
+ }, i.receivedMessageEvent = (_) => {
1506
604
  let b;
1507
605
  switch (_.messageId && (b = this.getMessage({ messageId: _.messageId })), _.event) {
1508
606
  case "mark-all-read":
@@ -1530,35 +628,35 @@ const oe = class oe {
1530
628
  case "unarchive":
1531
629
  break;
1532
630
  }
1533
- }, await t.connect(), await t.sendSubscribe(), t.keepAlive(), (m = (p = v.shared.client) == null ? void 0 : p.options.logger) == null || m.info("CourierInbox socket connected");
631
+ }, await i.connect(), await i.sendSubscribe(), i.keepAlive(), (m = (u = C.shared.client) == null ? void 0 : u.options.logger) == null || m.info("CourierInbox socket connected");
1534
632
  } catch (_) {
1535
- (f = (g = v.shared.client) == null ? void 0 : g.options.logger) == null || f.error("Failed to connect socket:", _);
633
+ (x = (p = C.shared.client) == null ? void 0 : p.options.logger) == null || x.error("Failed to connect socket:", _);
1536
634
  }
1537
635
  }
1538
- getMessage(t) {
1539
- var e, i;
1540
- return ((e = this._inboxDataSet) == null ? void 0 : e.messages.find((s) => s.messageId === t.messageId)) ?? ((i = this._archiveDataSet) == null ? void 0 : i.messages.find((s) => s.messageId === t.messageId));
636
+ getMessage(i) {
637
+ var e, t;
638
+ return ((e = this._inboxDataSet) == null ? void 0 : e.messages.find((s) => s.messageId === i.messageId)) ?? ((t = this._archiveDataSet) == null ? void 0 : t.messages.find((s) => s.messageId === i.messageId));
1541
639
  }
1542
- async fetchNextPageOfMessages(t) {
1543
- var e, i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D;
1544
- switch (t.feedType) {
640
+ async fetchNextPageOfMessages(i) {
641
+ var e, t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M, E, I, T, P, $;
642
+ switch (i.feedType) {
1545
643
  case "inbox":
1546
644
  if (this.isPaginatingInbox)
1547
645
  return null;
1548
646
  if ((e = this._inboxDataSet) != null && e.canPaginate && this._inboxDataSet.paginationCursor)
1549
647
  try {
1550
648
  this.isPaginatingInbox = !0;
1551
- const y = await ((i = v.shared.client) == null ? void 0 : i.inbox.getMessages({
1552
- paginationLimit: v.shared.paginationLimit,
649
+ const y = await ((t = C.shared.client) == null ? void 0 : t.inbox.getMessages({
650
+ paginationLimit: C.shared.paginationLimit,
1553
651
  startCursor: this._inboxDataSet.paginationCursor
1554
- })), A = {
652
+ })), B = {
1555
653
  messages: ((o = (s = y == null ? void 0 : y.data) == null ? void 0 : s.messages) == null ? void 0 : o.nodes) ?? [],
1556
- canPaginate: ((d = (c = (n = y == null ? void 0 : y.data) == null ? void 0 : n.messages) == null ? void 0 : c.pageInfo) == null ? void 0 : d.hasNextPage) ?? !1,
1557
- paginationCursor: ((m = (p = (l = y == null ? void 0 : y.data) == null ? void 0 : l.messages) == null ? void 0 : p.pageInfo) == null ? void 0 : m.startCursor) ?? null
654
+ canPaginate: ((d = (h = (n = y == null ? void 0 : y.data) == null ? void 0 : n.messages) == null ? void 0 : h.pageInfo) == null ? void 0 : d.hasNextPage) ?? !1,
655
+ paginationCursor: ((m = (u = (c = y == null ? void 0 : y.data) == null ? void 0 : c.messages) == null ? void 0 : u.pageInfo) == null ? void 0 : m.startCursor) ?? null
1558
656
  };
1559
- return this.addPage(A, "inbox"), A;
657
+ return this.addPage(B, "inbox"), B;
1560
658
  } catch (y) {
1561
- return (f = (g = v.shared.client) == null ? void 0 : g.options.logger) == null || f.error("Error fetching next page of inbox messages:", y), null;
659
+ return (x = (p = C.shared.client) == null ? void 0 : p.options.logger) == null || x.error("Error fetching next page of inbox messages:", y), null;
1562
660
  } finally {
1563
661
  this.isPaginatingInbox = !1;
1564
662
  }
@@ -1569,17 +667,17 @@ const oe = class oe {
1569
667
  if ((_ = this._archiveDataSet) != null && _.canPaginate && this._archiveDataSet.paginationCursor)
1570
668
  try {
1571
669
  this.isPaginatingArchive = !0;
1572
- const y = await ((b = v.shared.client) == null ? void 0 : b.inbox.getArchivedMessages({
1573
- paginationLimit: v.shared.paginationLimit,
670
+ const y = await ((b = C.shared.client) == null ? void 0 : b.inbox.getArchivedMessages({
671
+ paginationLimit: C.shared.paginationLimit,
1574
672
  startCursor: this._archiveDataSet.paginationCursor
1575
- })), A = {
1576
- messages: ((k = (C = y == null ? void 0 : y.data) == null ? void 0 : C.messages) == null ? void 0 : k.nodes) ?? [],
1577
- canPaginate: ((I = (S = (w = y == null ? void 0 : y.data) == null ? void 0 : w.messages) == null ? void 0 : S.pageInfo) == null ? void 0 : I.hasNextPage) ?? !1,
1578
- paginationCursor: ((L = (M = (E = y == null ? void 0 : y.data) == null ? void 0 : E.messages) == null ? void 0 : M.pageInfo) == null ? void 0 : L.startCursor) ?? null
673
+ })), B = {
674
+ messages: ((k = (v = y == null ? void 0 : y.data) == null ? void 0 : v.messages) == null ? void 0 : k.nodes) ?? [],
675
+ canPaginate: ((M = (S = (w = y == null ? void 0 : y.data) == null ? void 0 : w.messages) == null ? void 0 : S.pageInfo) == null ? void 0 : M.hasNextPage) ?? !1,
676
+ paginationCursor: ((T = (I = (E = y == null ? void 0 : y.data) == null ? void 0 : E.messages) == null ? void 0 : I.pageInfo) == null ? void 0 : T.startCursor) ?? null
1579
677
  };
1580
- return this.addPage(A, "archive"), A;
678
+ return this.addPage(B, "archive"), B;
1581
679
  } catch (y) {
1582
- return (D = (R = v.shared.client) == null ? void 0 : R.options.logger) == null || D.error("Error fetching next page of archived messages:", y), null;
680
+ return ($ = (P = C.shared.client) == null ? void 0 : P.options.logger) == null || $.error("Error fetching next page of archived messages:", y), null;
1583
681
  } finally {
1584
682
  this.isPaginatingArchive = !1;
1585
683
  }
@@ -1587,227 +685,227 @@ const oe = class oe {
1587
685
  }
1588
686
  return null;
1589
687
  }
1590
- applyLocalMessageChange(t, e) {
1591
- for (const [i, s] of Object.entries(e))
1592
- s !== void 0 && this.updateMessage(t, s, i);
688
+ applyLocalMessageChange(i, e) {
689
+ for (const [t, s] of Object.entries(e))
690
+ s !== void 0 && this.updateMessage(i, s, t);
1593
691
  }
1594
- async readMessage({ message: t, canCallApi: e = !0 }) {
1595
- var o, n, c, d;
1596
- if (!v.shared.client)
692
+ async readMessage({ message: i, canCallApi: e = !0 }) {
693
+ var o, n, h, d;
694
+ if (!C.shared.client)
1597
695
  return;
1598
- const i = t;
1599
- if (i.read)
696
+ const t = i;
697
+ if (t.read)
1600
698
  return;
1601
699
  const s = {
1602
- inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((l) => l.messageId === t.messageId),
1603
- archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((l) => l.messageId === t.messageId)
700
+ inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((c) => c.messageId === i.messageId),
701
+ archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((c) => c.messageId === i.messageId)
1604
702
  };
1605
703
  try {
1606
- t.read = (/* @__PURE__ */ new Date()).toISOString(), this.applyLocalMessageChange(t, s), e && await v.shared.client.inbox.read({ messageId: t.messageId });
1607
- } catch (l) {
1608
- this.applyLocalMessageChange(i, s), (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Error reading message:", l);
704
+ i.read = (/* @__PURE__ */ new Date()).toISOString(), this.applyLocalMessageChange(i, s), e && await C.shared.client.inbox.read({ messageId: i.messageId });
705
+ } catch (c) {
706
+ this.applyLocalMessageChange(t, s), (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Error reading message:", c);
1609
707
  }
1610
708
  }
1611
- async unreadMessage({ message: t, canCallApi: e = !0 }) {
1612
- var o, n, c, d;
1613
- if (!v.shared.client)
709
+ async unreadMessage({ message: i, canCallApi: e = !0 }) {
710
+ var o, n, h, d;
711
+ if (!C.shared.client)
1614
712
  return;
1615
- const i = t;
1616
- if (!i.read)
713
+ const t = i;
714
+ if (!t.read)
1617
715
  return;
1618
716
  const s = {
1619
- inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((l) => l.messageId === t.messageId),
1620
- archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((l) => l.messageId === t.messageId)
717
+ inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((c) => c.messageId === i.messageId),
718
+ archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((c) => c.messageId === i.messageId)
1621
719
  };
1622
720
  try {
1623
- t.read = void 0, this.applyLocalMessageChange(t, s), e && await v.shared.client.inbox.unread({ messageId: t.messageId });
1624
- } catch (l) {
1625
- this.applyLocalMessageChange(i, s), (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Error unreading message:", l);
721
+ i.read = void 0, this.applyLocalMessageChange(i, s), e && await C.shared.client.inbox.unread({ messageId: i.messageId });
722
+ } catch (c) {
723
+ this.applyLocalMessageChange(t, s), (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Error unreading message:", c);
1626
724
  }
1627
725
  }
1628
- async openMessage({ message: t, canCallApi: e = !0 }) {
1629
- var o, n, c, d;
1630
- if (!v.shared.client)
726
+ async openMessage({ message: i, canCallApi: e = !0 }) {
727
+ var o, n, h, d;
728
+ if (!C.shared.client)
1631
729
  return;
1632
- const i = t, s = {
1633
- inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((l) => l.messageId === t.messageId),
1634
- archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((l) => l.messageId === t.messageId)
730
+ const t = i, s = {
731
+ inbox: (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((c) => c.messageId === i.messageId),
732
+ archive: (n = this._archiveDataSet) == null ? void 0 : n.messages.findIndex((c) => c.messageId === i.messageId)
1635
733
  };
1636
- if (!(!s.inbox && !s.archive) && !i.opened)
734
+ if (!(!s.inbox && !s.archive) && !t.opened)
1637
735
  try {
1638
- t.opened = (/* @__PURE__ */ new Date()).toISOString(), this.applyLocalMessageChange(t, s), e && await v.shared.client.inbox.open({ messageId: t.messageId });
1639
- } catch (l) {
1640
- this.applyLocalMessageChange(i, s), (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Error opening message:", l);
736
+ i.opened = (/* @__PURE__ */ new Date()).toISOString(), this.applyLocalMessageChange(i, s), e && await C.shared.client.inbox.open({ messageId: i.messageId });
737
+ } catch (c) {
738
+ this.applyLocalMessageChange(t, s), (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Error opening message:", c);
1641
739
  }
1642
740
  }
1643
- async clickMessage({ message: t, canCallApi: e = !0 }) {
1644
- var i, s, o, n;
1645
- if (v.shared.client)
741
+ async clickMessage({ message: i, canCallApi: e = !0 }) {
742
+ var t, s, o, n;
743
+ if (C.shared.client)
1646
744
  try {
1647
- (i = t.trackingIds) != null && i.clickTrackingId && e && await v.shared.client.inbox.click({
1648
- messageId: t.messageId,
1649
- trackingId: (s = t.trackingIds) == null ? void 0 : s.clickTrackingId
745
+ (t = i.trackingIds) != null && t.clickTrackingId && e && await C.shared.client.inbox.click({
746
+ messageId: i.messageId,
747
+ trackingId: (s = i.trackingIds) == null ? void 0 : s.clickTrackingId
1650
748
  });
1651
- } catch (c) {
1652
- (n = (o = v.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Error clicking message:", c);
749
+ } catch (h) {
750
+ (n = (o = C.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Error clicking message:", h);
1653
751
  }
1654
752
  }
1655
- async archiveMessage({ message: t, canCallApi: e = !0 }) {
753
+ async archiveMessage({ message: i, canCallApi: e = !0 }) {
1656
754
  var o, n;
1657
- if (!v.shared.client)
755
+ if (!C.shared.client)
1658
756
  return;
1659
- const i = t, s = (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((c) => c.messageId === t.messageId);
757
+ const t = i, s = (o = this._inboxDataSet) == null ? void 0 : o.messages.findIndex((h) => h.messageId === i.messageId);
1660
758
  if (s !== void 0)
1661
759
  try {
1662
- if (this.removeMessage(t, s, "inbox"), (n = this._archiveDataSet) != null && n.messages) {
1663
- const c = this.findInsertIndex(t, this._archiveDataSet.messages);
1664
- t.archived = (/* @__PURE__ */ new Date()).toISOString(), this.addMessage(t, c, "archive");
760
+ if (this.removeMessage(i, s, "inbox"), (n = this._archiveDataSet) != null && n.messages) {
761
+ const h = this.findInsertIndex(i, this._archiveDataSet.messages);
762
+ i.archived = (/* @__PURE__ */ new Date()).toISOString(), this.addMessage(i, h, "archive");
1665
763
  }
1666
- e && await v.shared.client.inbox.archive({ messageId: t.messageId });
764
+ e && await C.shared.client.inbox.archive({ messageId: i.messageId });
1667
765
  } catch {
1668
- this.addMessage(i, s, "inbox"), t.archived = void 0, this.removeMessage(t, s, "archive");
766
+ this.addMessage(t, s, "inbox"), i.archived = void 0, this.removeMessage(i, s, "archive");
1669
767
  }
1670
768
  }
1671
- async archiveReadMessages({ canCallApi: t = !0 } = {}) {
769
+ async archiveReadMessages({ canCallApi: i = !0 } = {}) {
1672
770
  var s;
1673
- if (!v.shared.client)
771
+ if (!C.shared.client)
1674
772
  return;
1675
- const e = this._inboxDataSet, i = this._archiveDataSet;
773
+ const e = this._inboxDataSet, t = this._archiveDataSet;
1676
774
  try {
1677
775
  (s = this._inboxDataSet) == null || s.messages.forEach((o) => {
1678
- var c, d;
776
+ var h, d;
1679
777
  if (!o.read)
1680
778
  return;
1681
- const n = (c = this._inboxDataSet) == null ? void 0 : c.messages.findIndex((l) => l.messageId === o.messageId);
779
+ const n = (h = this._inboxDataSet) == null ? void 0 : h.messages.findIndex((c) => c.messageId === o.messageId);
1682
780
  if (n !== void 0 && (this.removeMessage(o, n, "inbox"), (d = this._archiveDataSet) != null && d.messages)) {
1683
- const l = this.findInsertIndex(o, this._archiveDataSet.messages);
1684
- o.archived = (/* @__PURE__ */ new Date()).toISOString(), this.addMessage(o, l, "archive");
781
+ const c = this.findInsertIndex(o, this._archiveDataSet.messages);
782
+ o.archived = (/* @__PURE__ */ new Date()).toISOString(), this.addMessage(o, c, "archive");
1685
783
  }
1686
784
  }), this._dataStoreListeners.forEach((o) => {
1687
- var n, c, d, l;
1688
- this._inboxDataSet && ((c = (n = o.events).onDataSetChange) == null || c.call(n, this._inboxDataSet, "inbox")), this._archiveDataSet && ((l = (d = o.events).onDataSetChange) == null || l.call(d, this._archiveDataSet, "archive"));
1689
- }), t && await v.shared.client.inbox.archiveRead();
785
+ var n, h, d, c;
786
+ this._inboxDataSet && ((h = (n = o.events).onDataSetChange) == null || h.call(n, this._inboxDataSet, "inbox")), this._archiveDataSet && ((c = (d = o.events).onDataSetChange) == null || c.call(d, this._archiveDataSet, "archive"));
787
+ }), i && await C.shared.client.inbox.archiveRead();
1690
788
  } catch (o) {
1691
- console.error("Error archiving read messages:", o), this._inboxDataSet && e && (this._inboxDataSet.messages = e.messages), this._archiveDataSet && i && (this._archiveDataSet.messages = i.messages), this._dataStoreListeners.forEach((n) => {
1692
- var c, d, l, p;
1693
- this._inboxDataSet && ((d = (c = n.events).onDataSetChange) == null || d.call(c, this._inboxDataSet, "inbox")), this._archiveDataSet && ((p = (l = n.events).onDataSetChange) == null || p.call(l, this._archiveDataSet, "archive"));
789
+ console.error("Error archiving read messages:", o), this._inboxDataSet && e && (this._inboxDataSet.messages = e.messages), this._archiveDataSet && t && (this._archiveDataSet.messages = t.messages), this._dataStoreListeners.forEach((n) => {
790
+ var h, d, c, u;
791
+ this._inboxDataSet && ((d = (h = n.events).onDataSetChange) == null || d.call(h, this._inboxDataSet, "inbox")), this._archiveDataSet && ((u = (c = n.events).onDataSetChange) == null || u.call(c, this._archiveDataSet, "archive"));
1694
792
  });
1695
793
  }
1696
794
  }
1697
- async readAllMessages({ canCallApi: t = !0 } = {}) {
1698
- var o, n, c, d;
1699
- if (!v.shared.client)
795
+ async readAllMessages({ canCallApi: i = !0 } = {}) {
796
+ var o, n, h, d;
797
+ if (!C.shared.client)
1700
798
  return;
1701
- const e = this._inboxDataSet, i = this._archiveDataSet, s = this._unreadCount;
799
+ const e = this._inboxDataSet, t = this._archiveDataSet, s = this._unreadCount;
1702
800
  try {
1703
- (o = this._inboxDataSet) == null || o.messages.forEach((l) => {
1704
- l.read || (l.read = (/* @__PURE__ */ new Date()).toISOString());
1705
- }), (n = this._archiveDataSet) == null || n.messages.forEach((l) => {
1706
- l.read || (l.read = (/* @__PURE__ */ new Date()).toISOString());
1707
- }), this._unreadCount = 0, this._dataStoreListeners.forEach((l) => {
1708
- var p, m, g, f, _, b;
1709
- this._inboxDataSet && ((m = (p = l.events).onDataSetChange) == null || m.call(p, this._inboxDataSet, "inbox")), this._archiveDataSet && ((f = (g = l.events).onDataSetChange) == null || f.call(g, this._archiveDataSet, "archive")), (b = (_ = l.events).onUnreadCountChange) == null || b.call(_, this._unreadCount);
1710
- }), t && await v.shared.client.inbox.readAll();
1711
- } catch (l) {
1712
- (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Error reading all messages:", l), this._inboxDataSet && e && (this._inboxDataSet.messages = e.messages), this._archiveDataSet && i && (this._archiveDataSet.messages = i.messages), this._unreadCount = s, this._dataStoreListeners.forEach((p) => {
1713
- var m, g, f, _, b, C;
1714
- this._inboxDataSet && ((g = (m = p.events).onDataSetChange) == null || g.call(m, this._inboxDataSet, "inbox")), this._archiveDataSet && ((_ = (f = p.events).onDataSetChange) == null || _.call(f, this._archiveDataSet, "archive")), (C = (b = p.events).onUnreadCountChange) == null || C.call(b, this._unreadCount);
801
+ (o = this._inboxDataSet) == null || o.messages.forEach((c) => {
802
+ c.read || (c.read = (/* @__PURE__ */ new Date()).toISOString());
803
+ }), (n = this._archiveDataSet) == null || n.messages.forEach((c) => {
804
+ c.read || (c.read = (/* @__PURE__ */ new Date()).toISOString());
805
+ }), this._unreadCount = 0, this._dataStoreListeners.forEach((c) => {
806
+ var u, m, p, x, _, b;
807
+ this._inboxDataSet && ((m = (u = c.events).onDataSetChange) == null || m.call(u, this._inboxDataSet, "inbox")), this._archiveDataSet && ((x = (p = c.events).onDataSetChange) == null || x.call(p, this._archiveDataSet, "archive")), (b = (_ = c.events).onUnreadCountChange) == null || b.call(_, this._unreadCount);
808
+ }), i && await C.shared.client.inbox.readAll();
809
+ } catch (c) {
810
+ (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Error reading all messages:", c), this._inboxDataSet && e && (this._inboxDataSet.messages = e.messages), this._archiveDataSet && t && (this._archiveDataSet.messages = t.messages), this._unreadCount = s, this._dataStoreListeners.forEach((u) => {
811
+ var m, p, x, _, b, v;
812
+ this._inboxDataSet && ((p = (m = u.events).onDataSetChange) == null || p.call(m, this._inboxDataSet, "inbox")), this._archiveDataSet && ((_ = (x = u.events).onDataSetChange) == null || _.call(x, this._archiveDataSet, "archive")), (v = (b = u.events).onUnreadCountChange) == null || v.call(b, this._unreadCount);
1715
813
  });
1716
814
  }
1717
815
  }
1718
- findInsertIndex(t, e) {
1719
- const i = [...e];
1720
- i.push(t), i.sort((o, n) => {
1721
- const c = new Date(o.created ?? Date.now()).getTime();
1722
- return new Date(n.created ?? Date.now()).getTime() - c;
816
+ findInsertIndex(i, e) {
817
+ const t = [...e];
818
+ t.push(i), t.sort((o, n) => {
819
+ const h = new Date(o.created ?? Date.now()).getTime();
820
+ return new Date(n.created ?? Date.now()).getTime() - h;
1723
821
  });
1724
- const s = i.findIndex((o) => o.messageId === t.messageId);
822
+ const s = t.findIndex((o) => o.messageId === i.messageId);
1725
823
  return Math.max(s - 1, 0);
1726
824
  }
1727
- addPage(t, e) {
825
+ addPage(i, e) {
1728
826
  switch (e) {
1729
827
  case "inbox":
1730
- this._inboxDataSet && (this._inboxDataSet.canPaginate = t.canPaginate, this._inboxDataSet.paginationCursor = t.paginationCursor, this._inboxDataSet.messages = [...this._inboxDataSet.messages, ...t.messages]);
828
+ this._inboxDataSet && (this._inboxDataSet.canPaginate = i.canPaginate, this._inboxDataSet.paginationCursor = i.paginationCursor, this._inboxDataSet.messages = [...this._inboxDataSet.messages, ...i.messages]);
1731
829
  break;
1732
830
  case "archive":
1733
- this._archiveDataSet && (this._archiveDataSet.canPaginate = t.canPaginate, this._archiveDataSet.paginationCursor = t.paginationCursor, this._archiveDataSet.messages = [...this._archiveDataSet.messages, ...t.messages]);
831
+ this._archiveDataSet && (this._archiveDataSet.canPaginate = i.canPaginate, this._archiveDataSet.paginationCursor = i.paginationCursor, this._archiveDataSet.messages = [...this._archiveDataSet.messages, ...i.messages]);
1734
832
  break;
1735
833
  }
1736
834
  this._dataStoreListeners.forEach(
1737
- (i) => {
835
+ (t) => {
1738
836
  var s, o;
1739
- return (o = (s = i.events).onPageAdded) == null ? void 0 : o.call(s, t, e);
837
+ return (o = (s = t.events).onPageAdded) == null ? void 0 : o.call(s, i, e);
1740
838
  }
1741
839
  );
1742
840
  }
1743
- addMessage(t, e, i) {
841
+ addMessage(i, e, t) {
1744
842
  var s, o;
1745
- switch (i) {
843
+ switch (t) {
1746
844
  case "inbox":
1747
- !t.read && this._unreadCount !== void 0 && (this._unreadCount = this._unreadCount + 1), (s = this._inboxDataSet) == null || s.messages.splice(e, 0, t);
845
+ !i.read && this._unreadCount !== void 0 && (this._unreadCount = this._unreadCount + 1), (s = this._inboxDataSet) == null || s.messages.splice(e, 0, i);
1748
846
  break;
1749
847
  case "archive":
1750
- (o = this._archiveDataSet) == null || o.messages.splice(e, 0, t);
848
+ (o = this._archiveDataSet) == null || o.messages.splice(e, 0, i);
1751
849
  break;
1752
850
  }
1753
851
  this._dataStoreListeners.forEach((n) => {
1754
- var c, d, l, p;
1755
- (d = (c = n.events).onMessageAdd) == null || d.call(c, t, e, i), (p = (l = n.events).onUnreadCountChange) == null || p.call(l, this._unreadCount ?? 0);
852
+ var h, d, c, u;
853
+ (d = (h = n.events).onMessageAdd) == null || d.call(h, i, e, t), (u = (c = n.events).onUnreadCountChange) == null || u.call(c, this._unreadCount ?? 0);
1756
854
  });
1757
855
  }
1758
- removeMessage(t, e, i) {
856
+ removeMessage(i, e, t) {
1759
857
  var s, o;
1760
- switch (i) {
858
+ switch (t) {
1761
859
  case "inbox":
1762
- !t.read && this._unreadCount !== void 0 && (this._unreadCount = this._unreadCount - 1), (s = this._inboxDataSet) == null || s.messages.splice(e, 1);
860
+ !i.read && this._unreadCount !== void 0 && (this._unreadCount = this._unreadCount - 1), (s = this._inboxDataSet) == null || s.messages.splice(e, 1);
1763
861
  break;
1764
862
  case "archive":
1765
863
  (o = this._archiveDataSet) == null || o.messages.splice(e, 1);
1766
864
  break;
1767
865
  }
1768
866
  this._dataStoreListeners.forEach((n) => {
1769
- var c, d, l, p;
1770
- (d = (c = n.events).onMessageRemove) == null || d.call(c, t, e, i), (p = (l = n.events).onUnreadCountChange) == null || p.call(l, this._unreadCount ?? 0);
867
+ var h, d, c, u;
868
+ (d = (h = n.events).onMessageRemove) == null || d.call(h, i, e, t), (u = (c = n.events).onUnreadCountChange) == null || u.call(c, this._unreadCount ?? 0);
1771
869
  });
1772
870
  }
1773
- updateMessage(t, e, i) {
1774
- switch (i) {
871
+ updateMessage(i, e, t) {
872
+ switch (t) {
1775
873
  case "inbox":
1776
- this._unreadCount !== void 0 && !t.archived && (t.read && (this._unreadCount = Math.max(0, this._unreadCount - 1)), t.read || (this._unreadCount = this._unreadCount + 1)), this._inboxDataSet && (this._inboxDataSet.messages[e] = t);
874
+ this._unreadCount !== void 0 && !i.archived && (i.read && (this._unreadCount = Math.max(0, this._unreadCount - 1)), i.read || (this._unreadCount = this._unreadCount + 1)), this._inboxDataSet && (this._inboxDataSet.messages[e] = i);
1777
875
  break;
1778
876
  case "archive":
1779
- this._archiveDataSet && (this._archiveDataSet.messages[e] = t);
877
+ this._archiveDataSet && (this._archiveDataSet.messages[e] = i);
1780
878
  break;
1781
879
  }
1782
880
  this._dataStoreListeners.forEach((s) => {
1783
- var o, n, c, d;
1784
- (n = (o = s.events).onMessageUpdate) == null || n.call(o, t, e, i), (d = (c = s.events).onUnreadCountChange) == null || d.call(c, this._unreadCount ?? 0);
881
+ var o, n, h, d;
882
+ (n = (o = s.events).onMessageUpdate) == null || n.call(o, i, e, t), (d = (h = s.events).onUnreadCountChange) == null || d.call(h, this._unreadCount ?? 0);
1785
883
  });
1786
884
  }
1787
885
  };
1788
- a(oe, "instance");
1789
- let P = oe;
1790
- function gn(h) {
1791
- return P.shared.readMessage({ message: h });
886
+ a(te, "instance");
887
+ let A = te;
888
+ function zo(g) {
889
+ return A.shared.readMessage({ message: g });
1792
890
  }
1793
- function mn(h) {
1794
- return P.shared.unreadMessage({ message: h });
891
+ function Oo(g) {
892
+ return A.shared.unreadMessage({ message: g });
1795
893
  }
1796
- function bn(h) {
1797
- return P.shared.clickMessage({ message: h });
894
+ function No(g) {
895
+ return A.shared.clickMessage({ message: g });
1798
896
  }
1799
- function _n(h) {
1800
- return P.shared.archiveMessage({ message: h });
897
+ function Uo(g) {
898
+ return A.shared.archiveMessage({ message: g });
1801
899
  }
1802
- function fn(h) {
1803
- return P.shared.openMessage({ message: h });
900
+ function Vo(g) {
901
+ return A.shared.openMessage({ message: g });
1804
902
  }
1805
- function ln(h) {
1806
- if (!h.created) return "Now";
1807
- const t = /* @__PURE__ */ new Date(), e = new Date(h.created), i = Math.floor((t.getTime() - e.getTime()) / 1e3);
1808
- return i < 60 ? `${i}s` : i < 3600 ? `${Math.floor(i / 60)}m` : i < 86400 ? `${Math.floor(i / 3600)}h` : i < 604800 ? `${Math.floor(i / 86400)}d` : i < 31536e3 ? `${Math.floor(i / 604800)}w` : `${Math.floor(i / 31536e3)}y`;
903
+ function Po(g) {
904
+ if (!g.created) return "Now";
905
+ const i = /* @__PURE__ */ new Date(), e = new Date(g.created), t = Math.floor((i.getTime() - e.getTime()) / 1e3);
906
+ return t < 60 ? `${t}s` : t < 3600 ? `${Math.floor(t / 60)}m` : t < 86400 ? `${Math.floor(t / 3600)}h` : t < 604800 ? `${Math.floor(t / 86400)}d` : t < 31536e3 ? `${Math.floor(t / 604800)}w` : `${Math.floor(t / 31536e3)}y`;
1809
907
  }
1810
- class Lo extends HTMLElement {
908
+ class _o extends HTMLElement {
1811
909
  constructor(e) {
1812
910
  super();
1813
911
  // State
@@ -1816,14 +914,14 @@ class Lo extends HTMLElement {
1816
914
  // Components
1817
915
  a(this, "_style");
1818
916
  this._theme = e;
1819
- const i = this.attachShadow({ mode: "open" });
1820
- this._style = document.createElement("style"), this._style.textContent = this.getStyles(), i.appendChild(this._style);
917
+ const t = this.attachShadow({ mode: "open" });
918
+ this._style = document.createElement("style"), this._style.textContent = this.getStyles(), t.appendChild(this._style);
1821
919
  const s = document.createElement("ul");
1822
- s.className = "menu", i.appendChild(s);
920
+ s.className = "menu", t.appendChild(s);
1823
921
  }
1824
922
  getStyles() {
1825
- var i, s, o;
1826
- const e = (o = (s = (i = this._theme.inbox) == null ? void 0 : i.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
923
+ var t, s, o;
924
+ const e = (o = (s = (t = this._theme.inbox) == null ? void 0 : t.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1827
925
  return `
1828
926
  :host {
1829
927
  display: block;
@@ -1866,19 +964,19 @@ class Lo extends HTMLElement {
1866
964
  this._options = e, this.renderMenu();
1867
965
  }
1868
966
  renderMenu() {
1869
- var o, n, c, d;
967
+ var o, n, h, d;
1870
968
  const e = (o = this.shadowRoot) == null ? void 0 : o.querySelector("ul.menu");
1871
969
  if (!e) return;
1872
970
  e.innerHTML = "";
1873
- const i = (d = (c = (n = this._theme.inbox) == null ? void 0 : n.list) == null ? void 0 : c.item) == null ? void 0 : d.menu, s = (l) => {
1874
- l.stopPropagation(), l.preventDefault();
971
+ const t = (d = (h = (n = this._theme.inbox) == null ? void 0 : n.list) == null ? void 0 : h.item) == null ? void 0 : d.menu, s = (c) => {
972
+ c.stopPropagation(), c.preventDefault();
1875
973
  };
1876
- this._options.forEach((l) => {
1877
- var g, f, _;
1878
- const p = new $e(l.icon.svg, l.icon.color, i == null ? void 0 : i.backgroundColor, (g = i == null ? void 0 : i.item) == null ? void 0 : g.hoverBackgroundColor, (f = i == null ? void 0 : i.item) == null ? void 0 : f.activeBackgroundColor, (_ = i == null ? void 0 : i.item) == null ? void 0 : _.borderRadius), m = (b) => {
1879
- s(b), l.onClick();
974
+ this._options.forEach((c) => {
975
+ var p, x, _;
976
+ const u = new Se(c.icon.svg, c.icon.color, t == null ? void 0 : t.backgroundColor, (p = t == null ? void 0 : t.item) == null ? void 0 : p.hoverBackgroundColor, (x = t == null ? void 0 : t.item) == null ? void 0 : x.activeBackgroundColor, (_ = t == null ? void 0 : t.item) == null ? void 0 : _.borderRadius), m = (b) => {
977
+ s(b), c.onClick();
1880
978
  };
1881
- p.addEventListener("click", m), p.addEventListener("touchstart", s), p.addEventListener("touchend", m), p.addEventListener("touchmove", s), p.addEventListener("mousedown", s), p.addEventListener("mouseup", s), e.appendChild(p);
979
+ u.addEventListener("click", m), u.addEventListener("touchstart", s), u.addEventListener("touchend", m), u.addEventListener("touchmove", s), u.addEventListener("mousedown", s), u.addEventListener("mouseup", s), e.appendChild(u);
1882
980
  });
1883
981
  }
1884
982
  show() {
@@ -1888,8 +986,8 @@ class Lo extends HTMLElement {
1888
986
  this.classList.remove("visible");
1889
987
  }
1890
988
  }
1891
- customElements.get("courier-list-item-menu") || customElements.define("courier-list-item-menu", Lo);
1892
- class Ao extends HTMLElement {
989
+ customElements.get("courier-list-item-menu") || customElements.define("courier-list-item-menu", _o);
990
+ class xo extends HTMLElement {
1893
991
  constructor(e) {
1894
992
  super();
1895
993
  // State
@@ -1913,13 +1011,13 @@ class Ao extends HTMLElement {
1913
1011
  a(this, "onItemLongPress", null);
1914
1012
  a(this, "onItemActionClick", null);
1915
1013
  this._theme = e, this._isMobile = "ontouchstart" in window;
1916
- const i = this.attachShadow({ mode: "open" }), s = document.createElement("div");
1917
- s.className = "content-container", this._titleElement = document.createElement("p"), this._titleElement.setAttribute("part", "title"), this._subtitleElement = document.createElement("p"), this._subtitleElement.setAttribute("part", "subtitle"), this._actionsContainer = document.createElement("div"), this._actionsContainer.className = "actions-container", s.appendChild(this._titleElement), s.appendChild(this._subtitleElement), s.appendChild(this._actionsContainer), this._timeElement = document.createElement("p"), this._timeElement.setAttribute("part", "time"), this._unreadIndicator = document.createElement("div"), this._unreadIndicator.className = "unread-indicator", this._style = document.createElement("style"), this._refreshStyles(), this._menu = new Lo(this._theme), this._menu.setOptions(this._getMenuOptions()), i.append(this._style, this._unreadIndicator, s, this._timeElement, this._menu);
1014
+ const t = this.attachShadow({ mode: "open" }), s = document.createElement("div");
1015
+ s.className = "content-container", this._titleElement = document.createElement("p"), this._titleElement.setAttribute("part", "title"), this._subtitleElement = document.createElement("p"), this._subtitleElement.setAttribute("part", "subtitle"), this._actionsContainer = document.createElement("div"), this._actionsContainer.className = "actions-container", s.appendChild(this._titleElement), s.appendChild(this._subtitleElement), s.appendChild(this._actionsContainer), this._timeElement = document.createElement("p"), this._timeElement.setAttribute("part", "time"), this._unreadIndicator = document.createElement("div"), this._unreadIndicator.className = "unread-indicator", this._style = document.createElement("style"), this._refreshStyles(), this._menu = new _o(this._theme), this._menu.setOptions(this._getMenuOptions()), t.append(this._style, this._unreadIndicator, s, this._timeElement, this._menu);
1918
1016
  const o = (n) => {
1919
1017
  n.stopPropagation(), n.preventDefault();
1920
1018
  };
1921
1019
  this._menu.addEventListener("mousedown", o), this._menu.addEventListener("pointerdown", o), this._menu.addEventListener("click", o), this.addEventListener("click", (n) => {
1922
- this._menu.contains(n.target) || n.composedPath().includes(this._menu) || this._message && this.onItemClick && !(n.target instanceof ne) && !this._isLongPress && this.onItemClick(this._message);
1020
+ this._menu.contains(n.target) || n.composedPath().includes(this._menu) || this._message && this.onItemClick && !(n.target instanceof ie) && !this._isLongPress && this.onItemClick(this._message);
1923
1021
  }), this._setupHoverBehavior(), this._setupLongPressBehavior();
1924
1022
  }
1925
1023
  _setupHoverBehavior() {
@@ -1932,14 +1030,14 @@ class Ao extends HTMLElement {
1932
1030
  const e = (n = (o = (s = this._theme.inbox) == null ? void 0 : s.list) == null ? void 0 : o.item) == null ? void 0 : n.menu;
1933
1031
  if (!(e != null && e.enabled))
1934
1032
  return;
1935
- const i = e.longPress;
1033
+ const t = e.longPress;
1936
1034
  this.addEventListener(
1937
1035
  "touchstart",
1938
1036
  () => {
1939
1037
  this._longPressTimeout = window.setTimeout(() => {
1940
- this._isLongPress = !0, this._showMenu(), this._message && this.onItemLongPress && (this.onItemLongPress(this._message), navigator.vibrate && navigator.vibrate((i == null ? void 0 : i.vibrationDuration) ?? 50)), setTimeout(() => {
1038
+ this._isLongPress = !0, this._showMenu(), this._message && this.onItemLongPress && (this.onItemLongPress(this._message), navigator.vibrate && navigator.vibrate((t == null ? void 0 : t.vibrationDuration) ?? 50)), setTimeout(() => {
1941
1039
  this._hideMenu(), this._isLongPress = !1;
1942
- }, (i == null ? void 0 : i.displayDuration) ?? 2e3);
1040
+ }, (t == null ? void 0 : t.displayDuration) ?? 2e3);
1943
1041
  }, 650);
1944
1042
  },
1945
1043
  { passive: !0 }
@@ -1952,43 +1050,43 @@ class Ao extends HTMLElement {
1952
1050
  }
1953
1051
  // Helpers
1954
1052
  _getMenuOptions() {
1955
- var s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M;
1956
- const e = (c = (n = (o = (s = this._theme.inbox) == null ? void 0 : s.list) == null ? void 0 : o.item) == null ? void 0 : n.menu) == null ? void 0 : c.item;
1957
- let i = [];
1958
- return (d = this._message) != null && d.archived || i.push({
1959
- id: (l = this._message) != null && l.read ? "unread" : "read",
1053
+ var s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M, E, I;
1054
+ const e = (h = (n = (o = (s = this._theme.inbox) == null ? void 0 : s.list) == null ? void 0 : o.item) == null ? void 0 : n.menu) == null ? void 0 : h.item;
1055
+ let t = [];
1056
+ return (d = this._message) != null && d.archived || t.push({
1057
+ id: (c = this._message) != null && c.read ? "unread" : "read",
1960
1058
  icon: {
1961
- svg: (p = this._message) != null && p.read ? (m = e == null ? void 0 : e.unread) == null ? void 0 : m.svg : (g = e == null ? void 0 : e.read) == null ? void 0 : g.svg,
1962
- color: (f = this._message) != null && f.read ? (_ = e == null ? void 0 : e.unread) == null ? void 0 : _.color : ((b = e == null ? void 0 : e.read) == null ? void 0 : b.color) ?? "red"
1059
+ svg: (u = this._message) != null && u.read ? (m = e == null ? void 0 : e.unread) == null ? void 0 : m.svg : (p = e == null ? void 0 : e.read) == null ? void 0 : p.svg,
1060
+ color: (x = this._message) != null && x.read ? (_ = e == null ? void 0 : e.unread) == null ? void 0 : _.color : ((b = e == null ? void 0 : e.read) == null ? void 0 : b.color) ?? "red"
1963
1061
  },
1964
1062
  onClick: () => {
1965
- this._message && (this._message.read ? P.shared.unreadMessage({ message: this._message }) : P.shared.readMessage({ message: this._message }));
1063
+ this._message && (this._message.read ? A.shared.unreadMessage({ message: this._message }) : A.shared.readMessage({ message: this._message }));
1966
1064
  }
1967
- }), i.push({
1968
- id: (C = this._message) != null && C.archived ? "unarchive" : "archive",
1065
+ }), t.push({
1066
+ id: (v = this._message) != null && v.archived ? "unarchive" : "archive",
1969
1067
  icon: {
1970
1068
  svg: (k = this._message) != null && k.archived ? (w = e == null ? void 0 : e.unarchive) == null ? void 0 : w.svg : (S = e == null ? void 0 : e.archive) == null ? void 0 : S.svg,
1971
- color: (I = this._message) != null && I.archived ? (E = e == null ? void 0 : e.unarchive) == null ? void 0 : E.color : ((M = e == null ? void 0 : e.archive) == null ? void 0 : M.color) ?? "red"
1069
+ color: (M = this._message) != null && M.archived ? (E = e == null ? void 0 : e.unarchive) == null ? void 0 : E.color : ((I = e == null ? void 0 : e.archive) == null ? void 0 : I.color) ?? "red"
1972
1070
  },
1973
1071
  onClick: () => {
1974
- this._message && (this._message.archived ? alert("unarchive") : P.shared.archiveMessage({ message: this._message }));
1072
+ this._message && (this._message.archived ? alert("unarchive") : A.shared.archiveMessage({ message: this._message }));
1975
1073
  }
1976
- }), i;
1074
+ }), t;
1977
1075
  }
1978
1076
  // Menu visibility helpers
1979
1077
  _showMenu() {
1980
- var i, s, o;
1981
- const e = (o = (s = (i = this._theme.inbox) == null ? void 0 : i.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1078
+ var t, s, o;
1079
+ const e = (o = (s = (t = this._theme.inbox) == null ? void 0 : t.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1982
1080
  e && e.enabled && (this._menu.setOptions(this._getMenuOptions()), this._menu.style.display = "block", this._menu.show(), this._timeElement.style.opacity = "0");
1983
1081
  }
1984
1082
  _hideMenu() {
1985
- var i, s, o;
1986
- const e = (o = (s = (i = this._theme.inbox) == null ? void 0 : i.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1083
+ var t, s, o;
1084
+ const e = (o = (s = (t = this._theme.inbox) == null ? void 0 : t.list) == null ? void 0 : s.item) == null ? void 0 : o.menu;
1987
1085
  e && e.enabled && (this._menu.hide(), this._menu.style.display = "none", this._timeElement.style.opacity = "1");
1988
1086
  }
1989
1087
  _getStyles() {
1990
- var i, s, o, n, c, d, l, p, m, g, f;
1991
- const e = (s = (i = this._theme.inbox) == null ? void 0 : i.list) == null ? void 0 : s.item;
1088
+ var t, s, o, n, h, d, c, u, m, p, x;
1089
+ const e = (s = (t = this._theme.inbox) == null ? void 0 : t.list) == null ? void 0 : s.item;
1992
1090
  return `
1993
1091
  :host {
1994
1092
  display: flex;
@@ -2074,20 +1172,20 @@ class Ao extends HTMLElement {
2074
1172
  p[part='title'] {
2075
1173
  font-family: ${((o = e == null ? void 0 : e.title) == null ? void 0 : o.family) ?? "inherit"};
2076
1174
  font-size: ${((n = e == null ? void 0 : e.title) == null ? void 0 : n.size) ?? "14px"};
2077
- color: ${((c = e == null ? void 0 : e.title) == null ? void 0 : c.color) ?? "red"};
1175
+ color: ${((h = e == null ? void 0 : e.title) == null ? void 0 : h.color) ?? "red"};
2078
1176
  margin-bottom: 4px;
2079
1177
  }
2080
1178
 
2081
1179
  p[part='subtitle'] {
2082
1180
  font-family: ${((d = e == null ? void 0 : e.subtitle) == null ? void 0 : d.family) ?? "inherit"};
2083
- font-size: ${((l = e == null ? void 0 : e.subtitle) == null ? void 0 : l.size) ?? "14px"};
2084
- color: ${((p = e == null ? void 0 : e.subtitle) == null ? void 0 : p.color) ?? "red"};
1181
+ font-size: ${((c = e == null ? void 0 : e.subtitle) == null ? void 0 : c.size) ?? "14px"};
1182
+ color: ${((u = e == null ? void 0 : e.subtitle) == null ? void 0 : u.color) ?? "red"};
2085
1183
  }
2086
1184
 
2087
1185
  p[part='time'] {
2088
1186
  font-family: ${((m = e == null ? void 0 : e.time) == null ? void 0 : m.family) ?? "inherit"};
2089
- font-size: ${((g = e == null ? void 0 : e.time) == null ? void 0 : g.size) ?? "14px"};
2090
- color: ${((f = e == null ? void 0 : e.time) == null ? void 0 : f.color) ?? "red"};
1187
+ font-size: ${((p = e == null ? void 0 : e.time) == null ? void 0 : p.size) ?? "14px"};
1188
+ color: ${((x = e == null ? void 0 : e.time) == null ? void 0 : x.color) ?? "red"};
2091
1189
  text-align: right;
2092
1190
  white-space: nowrap;
2093
1191
  }
@@ -2118,17 +1216,17 @@ class Ao extends HTMLElement {
2118
1216
  // Lifecycle hooks
2119
1217
  connectedCallback() {
2120
1218
  var s, o;
2121
- const e = this.getAttribute("message"), i = this.getAttribute("feed-type");
2122
- if (i && (this._feedType = i), e)
1219
+ const e = this.getAttribute("message"), t = this.getAttribute("feed-type");
1220
+ if (t && (this._feedType = t), e)
2123
1221
  try {
2124
1222
  this._message = JSON.parse(e), this._updateContent();
2125
1223
  } catch (n) {
2126
- (o = (s = v.shared.client) == null ? void 0 : s.options.logger) == null || o.error("CourierListItem – failed to parse message:", n);
1224
+ (o = (s = C.shared.client) == null ? void 0 : s.options.logger) == null || o.error("CourierListItem – failed to parse message:", n);
2127
1225
  }
2128
1226
  }
2129
1227
  // Public API
2130
- setMessage(e, i) {
2131
- this._message = e, this._feedType = i, this._updateContent();
1228
+ setMessage(e, t) {
1229
+ this._message = e, this._feedType = t, this._updateContent();
2132
1230
  }
2133
1231
  setOnItemClick(e) {
2134
1232
  this.onItemClick = e;
@@ -2141,49 +1239,49 @@ class Ao extends HTMLElement {
2141
1239
  }
2142
1240
  // Content rendering
2143
1241
  _updateContent() {
2144
- var s, o, n, c, d, l;
1242
+ var s, o, n, h, d, c;
2145
1243
  if (!this._message) {
2146
1244
  this._titleElement.textContent = "", this._subtitleElement.textContent = "";
2147
1245
  return;
2148
1246
  }
2149
- this.classList.toggle("unread", !this._message.read && this._feedType !== "archive"), this._titleElement.textContent = this._message.title || "Untitled Message", this._subtitleElement.textContent = this._message.preview || this._message.body || "", this._timeElement.textContent = ln(this._message), this._menu.setOptions(this._getMenuOptions());
1247
+ this.classList.toggle("unread", !this._message.read && this._feedType !== "archive"), this._titleElement.textContent = this._message.title || "Untitled Message", this._subtitleElement.textContent = this._message.preview || this._message.body || "", this._timeElement.textContent = Po(this._message), this._menu.setOptions(this._getMenuOptions());
2150
1248
  const e = ((s = this._message) == null ? void 0 : s.actions) && this._message.actions.length > 0;
2151
1249
  this._actionsContainer.style.display = e ? "flex" : "none";
2152
- const i = (c = (n = (o = this._theme.inbox) == null ? void 0 : o.list) == null ? void 0 : n.item) == null ? void 0 : c.actions;
2153
- (l = (d = this._message) == null ? void 0 : d.actions) == null || l.forEach((p) => {
2154
- var g, f, _, b;
2155
- const m = new Re({
2156
- text: p.content,
1250
+ const t = (h = (n = (o = this._theme.inbox) == null ? void 0 : o.list) == null ? void 0 : n.item) == null ? void 0 : h.actions;
1251
+ (c = (d = this._message) == null ? void 0 : d.actions) == null || c.forEach((u) => {
1252
+ var p, x, _, b;
1253
+ const m = new Ie({
1254
+ text: u.content,
2157
1255
  variant: "secondary",
2158
- backgroundColor: i == null ? void 0 : i.backgroundColor,
2159
- hoverBackgroundColor: i == null ? void 0 : i.hoverBackgroundColor,
2160
- activeBackgroundColor: i == null ? void 0 : i.activeBackgroundColor,
2161
- border: i == null ? void 0 : i.border,
2162
- borderRadius: i == null ? void 0 : i.borderRadius,
2163
- shadow: i == null ? void 0 : i.shadow,
2164
- fontFamily: (g = i == null ? void 0 : i.font) == null ? void 0 : g.family,
2165
- fontSize: (f = i == null ? void 0 : i.font) == null ? void 0 : f.size,
2166
- fontWeight: (_ = i == null ? void 0 : i.font) == null ? void 0 : _.weight,
2167
- textColor: (b = i == null ? void 0 : i.font) == null ? void 0 : b.color,
1256
+ backgroundColor: t == null ? void 0 : t.backgroundColor,
1257
+ hoverBackgroundColor: t == null ? void 0 : t.hoverBackgroundColor,
1258
+ activeBackgroundColor: t == null ? void 0 : t.activeBackgroundColor,
1259
+ border: t == null ? void 0 : t.border,
1260
+ borderRadius: t == null ? void 0 : t.borderRadius,
1261
+ shadow: t == null ? void 0 : t.shadow,
1262
+ fontFamily: (p = t == null ? void 0 : t.font) == null ? void 0 : p.family,
1263
+ fontSize: (x = t == null ? void 0 : t.font) == null ? void 0 : x.size,
1264
+ fontWeight: (_ = t == null ? void 0 : t.font) == null ? void 0 : _.weight,
1265
+ textColor: (b = t == null ? void 0 : t.font) == null ? void 0 : b.color,
2168
1266
  onClick: () => {
2169
- this._message && this.onItemActionClick && this.onItemActionClick(this._message, p);
1267
+ this._message && this.onItemActionClick && this.onItemActionClick(this._message, u);
2170
1268
  }
2171
1269
  });
2172
1270
  this._actionsContainer.appendChild(m);
2173
1271
  });
2174
1272
  }
2175
1273
  }
2176
- customElements.get("courier-list-item") || customElements.define("courier-list-item", Ao);
2177
- class Po extends HTMLElement {
2178
- constructor(e, i) {
1274
+ customElements.get("courier-list-item") || customElements.define("courier-list-item", xo);
1275
+ class fo extends HTMLElement {
1276
+ constructor(e, t) {
2179
1277
  super();
2180
1278
  // Shadow root
2181
1279
  a(this, "_shadow");
2182
1280
  this._shadow = this.attachShadow({ mode: "open" });
2183
1281
  const s = document.createElement("style");
2184
- s.textContent = this.getStyles(i), this._shadow.appendChild(s);
2185
- const o = new Le(e, 35), n = new Le(e, 100), c = new Le(e, 82);
2186
- this._shadow.appendChild(o), this._shadow.appendChild(n), this._shadow.appendChild(c);
1282
+ s.textContent = this.getStyles(t), this._shadow.appendChild(s);
1283
+ const o = new Me(e, 35), n = new Me(e, 100), h = new Me(e, 82);
1284
+ this._shadow.appendChild(o), this._shadow.appendChild(n), this._shadow.appendChild(h);
2187
1285
  }
2188
1286
  getStyles(e) {
2189
1287
  return `
@@ -2199,41 +1297,41 @@ class Po extends HTMLElement {
2199
1297
  `;
2200
1298
  }
2201
1299
  }
2202
- customElements.get("courier-inbox-skeleton-list-item") || customElements.define("courier-inbox-skeleton-list-item", Po);
2203
- class Le extends HTMLElement {
2204
- constructor(e, i) {
1300
+ customElements.get("courier-inbox-skeleton-list-item") || customElements.define("courier-inbox-skeleton-list-item", fo);
1301
+ class Me extends HTMLElement {
1302
+ constructor(e, t) {
2205
1303
  super();
2206
1304
  a(this, "_shadow");
2207
1305
  this._shadow = this.attachShadow({ mode: "open" });
2208
1306
  const s = document.createElement("style");
2209
- s.textContent = this.getStyles(e, i), this._shadow.appendChild(s);
1307
+ s.textContent = this.getStyles(e, t), this._shadow.appendChild(s);
2210
1308
  const o = document.createElement("div");
2211
1309
  o.className = "skeleton-item", this._shadow.appendChild(o);
2212
1310
  }
2213
- getStyles(e, i) {
2214
- var m, g, f, _, b, C, k, w, S, I, E, M;
2215
- const s = ((f = (g = (m = e.inbox) == null ? void 0 : m.loading) == null ? void 0 : g.animation) == null ? void 0 : f.barColor) ?? "#000", o = s.length === 4 ? `#${s[1]}${s[1]}${s[2]}${s[2]}${s[3]}${s[3]}` : s, n = parseInt(o.slice(1, 3), 16), c = parseInt(o.slice(3, 5), 16), d = parseInt(o.slice(5, 7), 16), l = `rgba(${n}, ${c}, ${d}, 0.8)`, p = `rgba(${n}, ${c}, ${d}, 0.4)`;
1311
+ getStyles(e, t) {
1312
+ var m, p, x, _, b, v, k, w, S, M, E, I;
1313
+ const s = ((x = (p = (m = e.inbox) == null ? void 0 : m.loading) == null ? void 0 : p.animation) == null ? void 0 : x.barColor) ?? "#000", o = s.length === 4 ? `#${s[1]}${s[1]}${s[2]}${s[2]}${s[3]}${s[3]}` : s, n = parseInt(o.slice(1, 3), 16), h = parseInt(o.slice(3, 5), 16), d = parseInt(o.slice(5, 7), 16), c = `rgba(${n}, ${h}, ${d}, 0.8)`, u = `rgba(${n}, ${h}, ${d}, 0.4)`;
2216
1314
  return `
2217
1315
  :host {
2218
1316
  display: flex;
2219
1317
  height: 100%;
2220
- width: ${i}%;
1318
+ width: ${t}%;
2221
1319
  align-items: flex-start;
2222
1320
  justify-content: flex-start;
2223
1321
  }
2224
1322
 
2225
1323
  .skeleton-item {
2226
- height: ${((C = (b = (_ = e.inbox) == null ? void 0 : _.loading) == null ? void 0 : b.animation) == null ? void 0 : C.barHeight) ?? "14px"};
1324
+ height: ${((v = (b = (_ = e.inbox) == null ? void 0 : _.loading) == null ? void 0 : b.animation) == null ? void 0 : v.barHeight) ?? "14px"};
2227
1325
  width: 100%;
2228
1326
  background: linear-gradient(
2229
1327
  90deg,
2230
- ${l} 25%,
2231
- ${p} 50%,
2232
- ${l} 75%
1328
+ ${c} 25%,
1329
+ ${u} 50%,
1330
+ ${c} 75%
2233
1331
  );
2234
1332
  background-size: 200% 100%;
2235
1333
  animation: shimmer ${((S = (w = (k = e.inbox) == null ? void 0 : k.loading) == null ? void 0 : w.animation) == null ? void 0 : S.duration) ?? "2s"} ease-in-out infinite;
2236
- border-radius: ${((M = (E = (I = e.inbox) == null ? void 0 : I.loading) == null ? void 0 : E.animation) == null ? void 0 : M.barBorderRadius) ?? "14px"};
1334
+ border-radius: ${((I = (E = (M = e.inbox) == null ? void 0 : M.loading) == null ? void 0 : E.animation) == null ? void 0 : I.barBorderRadius) ?? "14px"};
2237
1335
  }
2238
1336
 
2239
1337
  @keyframes shimmer {
@@ -2247,8 +1345,8 @@ class Le extends HTMLElement {
2247
1345
  `;
2248
1346
  }
2249
1347
  }
2250
- customElements.get("courier-skeleton-animated-row") || customElements.define("courier-skeleton-animated-row", Le);
2251
- class Ne extends De {
1348
+ customElements.get("courier-skeleton-animated-row") || customElements.define("courier-skeleton-animated-row", Me);
1349
+ class Pe extends Le {
2252
1350
  constructor(e) {
2253
1351
  super();
2254
1352
  a(this, "_theme");
@@ -2257,16 +1355,16 @@ class Ne extends De {
2257
1355
  defaultElement() {
2258
1356
  const e = document.createElement("div");
2259
1357
  e.className = "list";
2260
- const i = document.createElement("style");
2261
- i.textContent = this.getStyles(), e.appendChild(i);
1358
+ const t = document.createElement("style");
1359
+ t.textContent = this.getStyles(), e.appendChild(t);
2262
1360
  for (let s = 0; s < 3; s++) {
2263
- const o = new Po(this._theme, 1 / (s + 1));
1361
+ const o = new fo(this._theme, 1 / (s + 1));
2264
1362
  e.appendChild(o);
2265
1363
  }
2266
1364
  return this.shadow.appendChild(e), e;
2267
1365
  }
2268
1366
  getStyles() {
2269
- var e, i;
1367
+ var e, t;
2270
1368
  return `
2271
1369
  :host {
2272
1370
  display: flex;
@@ -2286,7 +1384,7 @@ class Ne extends De {
2286
1384
  }
2287
1385
 
2288
1386
  .list > * {
2289
- border-bottom: ${((i = (e = this._theme.inbox) == null ? void 0 : e.loading) == null ? void 0 : i.divider) ?? "1px solid red"};
1387
+ border-bottom: ${((t = (e = this._theme.inbox) == null ? void 0 : e.loading) == null ? void 0 : t.divider) ?? "1px solid red"};
2290
1388
  }
2291
1389
 
2292
1390
  .list > *:last-child {
@@ -2295,8 +1393,8 @@ class Ne extends De {
2295
1393
  `;
2296
1394
  }
2297
1395
  }
2298
- customElements.get("courier-inbox-skeleton-list") || customElements.define("courier-inbox-skeleton-list", Ne);
2299
- class Bo extends HTMLElement {
1396
+ customElements.get("courier-inbox-skeleton-list") || customElements.define("courier-inbox-skeleton-list", Pe);
1397
+ class Co extends HTMLElement {
2300
1398
  constructor(e) {
2301
1399
  super();
2302
1400
  // Components
@@ -2306,12 +1404,12 @@ class Bo extends HTMLElement {
2306
1404
  // Handlers
2307
1405
  a(this, "onPaginationTrigger");
2308
1406
  this.onPaginationTrigger = e.onPaginationTrigger, this.customItem = e.customItem;
2309
- const i = this.attachShadow({ mode: "open" }), s = document.createElement("style");
2310
- if (s.textContent = this.getStyles(), i.appendChild(s), this.customItem)
2311
- i.appendChild(this.customItem);
1407
+ const t = this.attachShadow({ mode: "open" }), s = document.createElement("style");
1408
+ if (s.textContent = this.getStyles(), t.appendChild(s), this.customItem)
1409
+ t.appendChild(this.customItem);
2312
1410
  else {
2313
1411
  const o = document.createElement("div");
2314
- o.className = "skeleton-container", this.skeletonLoadingList = new Ne(e.theme), this.skeletonLoadingList.build(void 0), o.appendChild(this.skeletonLoadingList), i.appendChild(o);
1412
+ o.className = "skeleton-container", this.skeletonLoadingList = new Pe(e.theme), this.skeletonLoadingList.build(void 0), o.appendChild(this.skeletonLoadingList), t.appendChild(o);
2315
1413
  }
2316
1414
  this.observer = new IntersectionObserver((o) => {
2317
1415
  o.forEach((n) => {
@@ -2336,8 +1434,8 @@ class Bo extends HTMLElement {
2336
1434
  this.observer.disconnect();
2337
1435
  }
2338
1436
  }
2339
- customElements.get("courier-inbox-pagination-list-item") || customElements.define("courier-inbox-pagination-list-item", Bo);
2340
- class Ro extends HTMLElement {
1437
+ customElements.get("courier-inbox-pagination-list-item") || customElements.define("courier-inbox-pagination-list-item", Co);
1438
+ class vo extends HTMLElement {
2341
1439
  constructor(e) {
2342
1440
  super();
2343
1441
  // Theme
@@ -2363,16 +1461,16 @@ class Ro extends HTMLElement {
2363
1461
  this._themeSubscription = e.themeManager.subscribe((o) => {
2364
1462
  this.refreshTheme();
2365
1463
  }), this._onRefresh = e.onRefresh, this._onPaginationTrigger = e.onPaginationTrigger, this._onMessageClick = e.onMessageClick, this._onMessageActionClick = e.onMessageActionClick, this._onMessageLongPress = e.onMessageLongPress;
2366
- const i = this.attachShadow({ mode: "open" }), s = document.createElement("style");
2367
- s.textContent = this.getStyles(), i.appendChild(s);
1464
+ const t = this.attachShadow({ mode: "open" }), s = document.createElement("style");
1465
+ s.textContent = this.getStyles(), t.appendChild(s);
2368
1466
  }
2369
1467
  // Getters
2370
1468
  get messages() {
2371
1469
  return this._messages;
2372
1470
  }
2373
1471
  getStyles() {
2374
- var i;
2375
- const e = (i = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : i.list;
1472
+ var t;
1473
+ const e = (t = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : t.list;
2376
1474
  return `
2377
1475
  :host {
2378
1476
  flex: 1;
@@ -2389,8 +1487,8 @@ class Ro extends HTMLElement {
2389
1487
  `;
2390
1488
  }
2391
1489
  reset() {
2392
- var i, s;
2393
- for (; (i = this.shadowRoot) != null && i.firstChild; )
1490
+ var t, s;
1491
+ for (; (t = this.shadowRoot) != null && t.firstChild; )
2394
1492
  this.shadowRoot.removeChild(this.shadowRoot.firstChild);
2395
1493
  const e = document.createElement("style");
2396
1494
  e.textContent = this.getStyles(), (s = this.shadowRoot) == null || s.appendChild(e);
@@ -2401,14 +1499,14 @@ class Ro extends HTMLElement {
2401
1499
  addPage(e) {
2402
1500
  this._messages = [...this._messages, ...e.messages], this._canPaginate = !!e.canPaginate, this._error = null, this._isLoading = !1, this.render();
2403
1501
  }
2404
- addMessage(e, i = 0) {
2405
- this._messages.splice(i, 0, e), this.render();
1502
+ addMessage(e, t = 0) {
1503
+ this._messages.splice(t, 0, e), this.render();
2406
1504
  }
2407
1505
  removeMessage(e = 0) {
2408
1506
  this._messages.splice(e, 1), this.render();
2409
1507
  }
2410
- updateMessage(e, i = 0) {
2411
- this._messages[i] = e, this.render();
1508
+ updateMessage(e, t = 0) {
1509
+ this._messages[t] = e, this.render();
2412
1510
  }
2413
1511
  setFeedType(e) {
2414
1512
  this._feedType = e, this._error = null, this._isLoading = !0, this.render();
@@ -2429,93 +1527,93 @@ class Ro extends HTMLElement {
2429
1527
  this._onRefresh();
2430
1528
  }
2431
1529
  render() {
2432
- var s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O, z, U, N, q, V, j, X, Q, Y, ee, G, ae, he, ce, le, de, ue, pe, ge, me, be, _e, fe, xe, ve, Ce, ye, ke, we, Se, Ie;
1530
+ var s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M, E, I, T, P, $, y, B, F, H, R, z, O, N, U, V, Z, J, q, X, Y, j, se, oe, ne, re, ae, he, ce, le, de, ue, pe, ge, me, be, _e, xe, fe, Ce, ve, ye;
2433
1531
  this.reset();
2434
1532
  const e = this._themeSubscription.manager.getTheme();
2435
1533
  if (this._error) {
2436
- const u = (s = e.inbox) == null ? void 0 : s.error, B = new Be({
1534
+ const l = (s = e.inbox) == null ? void 0 : s.error, D = new Ee({
2437
1535
  title: {
2438
- text: ((o = u == null ? void 0 : u.title) == null ? void 0 : o.text) ?? this._error.message,
2439
- textColor: (c = (n = u == null ? void 0 : u.title) == null ? void 0 : n.font) == null ? void 0 : c.color,
2440
- fontFamily: (l = (d = u == null ? void 0 : u.title) == null ? void 0 : d.font) == null ? void 0 : l.family,
2441
- fontSize: (m = (p = u == null ? void 0 : u.title) == null ? void 0 : p.font) == null ? void 0 : m.size,
2442
- fontWeight: (f = (g = u == null ? void 0 : u.title) == null ? void 0 : g.font) == null ? void 0 : f.weight
1536
+ text: ((o = l == null ? void 0 : l.title) == null ? void 0 : o.text) ?? this._error.message,
1537
+ textColor: (h = (n = l == null ? void 0 : l.title) == null ? void 0 : n.font) == null ? void 0 : h.color,
1538
+ fontFamily: (c = (d = l == null ? void 0 : l.title) == null ? void 0 : d.font) == null ? void 0 : c.family,
1539
+ fontSize: (m = (u = l == null ? void 0 : l.title) == null ? void 0 : u.font) == null ? void 0 : m.size,
1540
+ fontWeight: (x = (p = l == null ? void 0 : l.title) == null ? void 0 : p.font) == null ? void 0 : x.weight
2443
1541
  },
2444
1542
  button: {
2445
- text: (_ = u == null ? void 0 : u.button) == null ? void 0 : _.text,
2446
- backgroundColor: (b = u == null ? void 0 : u.button) == null ? void 0 : b.backgroundColor,
2447
- hoverBackgroundColor: (C = u == null ? void 0 : u.button) == null ? void 0 : C.hoverBackgroundColor,
2448
- activeBackgroundColor: (k = u == null ? void 0 : u.button) == null ? void 0 : k.activeBackgroundColor,
2449
- textColor: (S = (w = u == null ? void 0 : u.button) == null ? void 0 : w.font) == null ? void 0 : S.color,
2450
- fontFamily: (E = (I = u == null ? void 0 : u.button) == null ? void 0 : I.font) == null ? void 0 : E.family,
2451
- fontSize: (L = (M = u == null ? void 0 : u.button) == null ? void 0 : M.font) == null ? void 0 : L.size,
2452
- fontWeight: (D = (R = u == null ? void 0 : u.button) == null ? void 0 : R.font) == null ? void 0 : D.weight,
2453
- shadow: (y = u == null ? void 0 : u.button) == null ? void 0 : y.shadow,
2454
- border: (A = u == null ? void 0 : u.button) == null ? void 0 : A.border,
2455
- borderRadius: (F = u == null ? void 0 : u.button) == null ? void 0 : F.borderRadius
1543
+ text: (_ = l == null ? void 0 : l.button) == null ? void 0 : _.text,
1544
+ backgroundColor: (b = l == null ? void 0 : l.button) == null ? void 0 : b.backgroundColor,
1545
+ hoverBackgroundColor: (v = l == null ? void 0 : l.button) == null ? void 0 : v.hoverBackgroundColor,
1546
+ activeBackgroundColor: (k = l == null ? void 0 : l.button) == null ? void 0 : k.activeBackgroundColor,
1547
+ textColor: (S = (w = l == null ? void 0 : l.button) == null ? void 0 : w.font) == null ? void 0 : S.color,
1548
+ fontFamily: (E = (M = l == null ? void 0 : l.button) == null ? void 0 : M.font) == null ? void 0 : E.family,
1549
+ fontSize: (T = (I = l == null ? void 0 : l.button) == null ? void 0 : I.font) == null ? void 0 : T.size,
1550
+ fontWeight: ($ = (P = l == null ? void 0 : l.button) == null ? void 0 : P.font) == null ? void 0 : $.weight,
1551
+ shadow: (y = l == null ? void 0 : l.button) == null ? void 0 : y.shadow,
1552
+ border: (B = l == null ? void 0 : l.button) == null ? void 0 : B.border,
1553
+ borderRadius: (F = l == null ? void 0 : l.button) == null ? void 0 : F.borderRadius
2456
1554
  }
2457
1555
  });
2458
- B.build((H = this._errorStateFactory) == null ? void 0 : H.call(this, { feedType: this._feedType, error: this._error })), B.setButtonClickCallback(() => this.handleRetry()), (O = this.shadowRoot) == null || O.appendChild(B);
1556
+ D.build((H = this._errorStateFactory) == null ? void 0 : H.call(this, { feedType: this._feedType, error: this._error })), D.setButtonClickCallback(() => this.handleRetry()), (R = this.shadowRoot) == null || R.appendChild(D);
2459
1557
  return;
2460
1558
  }
2461
1559
  if (this._isLoading) {
2462
- const u = new Ne(e);
2463
- u.build((z = this._loadingStateFactory) == null ? void 0 : z.call(this, { feedType: this._feedType })), (U = this.shadowRoot) == null || U.appendChild(u);
1560
+ const l = new Pe(e);
1561
+ l.build((z = this._loadingStateFactory) == null ? void 0 : z.call(this, { feedType: this._feedType })), (O = this.shadowRoot) == null || O.appendChild(l);
2464
1562
  return;
2465
1563
  }
2466
1564
  if (this._messages.length === 0) {
2467
- const u = (N = e.inbox) == null ? void 0 : N.empty, B = new Be({
1565
+ const l = (N = e.inbox) == null ? void 0 : N.empty, D = new Ee({
2468
1566
  title: {
2469
- text: ((q = u == null ? void 0 : u.title) == null ? void 0 : q.text) ?? `No ${this._feedType} messages yet`,
2470
- textColor: (j = (V = u == null ? void 0 : u.title) == null ? void 0 : V.font) == null ? void 0 : j.color,
2471
- fontFamily: (Q = (X = u == null ? void 0 : u.title) == null ? void 0 : X.font) == null ? void 0 : Q.family,
2472
- fontSize: (ee = (Y = u == null ? void 0 : u.title) == null ? void 0 : Y.font) == null ? void 0 : ee.size,
2473
- fontWeight: (ae = (G = u == null ? void 0 : u.title) == null ? void 0 : G.font) == null ? void 0 : ae.weight
1567
+ text: ((U = l == null ? void 0 : l.title) == null ? void 0 : U.text) ?? `No ${this._feedType} messages yet`,
1568
+ textColor: (Z = (V = l == null ? void 0 : l.title) == null ? void 0 : V.font) == null ? void 0 : Z.color,
1569
+ fontFamily: (q = (J = l == null ? void 0 : l.title) == null ? void 0 : J.font) == null ? void 0 : q.family,
1570
+ fontSize: (Y = (X = l == null ? void 0 : l.title) == null ? void 0 : X.font) == null ? void 0 : Y.size,
1571
+ fontWeight: (se = (j = l == null ? void 0 : l.title) == null ? void 0 : j.font) == null ? void 0 : se.weight
2474
1572
  },
2475
1573
  button: {
2476
- text: (he = u == null ? void 0 : u.button) == null ? void 0 : he.text,
2477
- backgroundColor: (ce = u == null ? void 0 : u.button) == null ? void 0 : ce.backgroundColor,
2478
- hoverBackgroundColor: (le = u == null ? void 0 : u.button) == null ? void 0 : le.hoverBackgroundColor,
2479
- activeBackgroundColor: (de = u == null ? void 0 : u.button) == null ? void 0 : de.activeBackgroundColor,
2480
- textColor: (pe = (ue = u == null ? void 0 : u.button) == null ? void 0 : ue.font) == null ? void 0 : pe.color,
2481
- fontFamily: (me = (ge = u == null ? void 0 : u.button) == null ? void 0 : ge.font) == null ? void 0 : me.family,
2482
- fontSize: (_e = (be = u == null ? void 0 : u.button) == null ? void 0 : be.font) == null ? void 0 : _e.size,
2483
- fontWeight: (xe = (fe = u == null ? void 0 : u.button) == null ? void 0 : fe.font) == null ? void 0 : xe.weight,
2484
- shadow: (ve = u == null ? void 0 : u.button) == null ? void 0 : ve.shadow,
2485
- border: (Ce = u == null ? void 0 : u.button) == null ? void 0 : Ce.border,
2486
- borderRadius: (ye = u == null ? void 0 : u.button) == null ? void 0 : ye.borderRadius
1574
+ text: (oe = l == null ? void 0 : l.button) == null ? void 0 : oe.text,
1575
+ backgroundColor: (ne = l == null ? void 0 : l.button) == null ? void 0 : ne.backgroundColor,
1576
+ hoverBackgroundColor: (re = l == null ? void 0 : l.button) == null ? void 0 : re.hoverBackgroundColor,
1577
+ activeBackgroundColor: (ae = l == null ? void 0 : l.button) == null ? void 0 : ae.activeBackgroundColor,
1578
+ textColor: (ce = (he = l == null ? void 0 : l.button) == null ? void 0 : he.font) == null ? void 0 : ce.color,
1579
+ fontFamily: (de = (le = l == null ? void 0 : l.button) == null ? void 0 : le.font) == null ? void 0 : de.family,
1580
+ fontSize: (pe = (ue = l == null ? void 0 : l.button) == null ? void 0 : ue.font) == null ? void 0 : pe.size,
1581
+ fontWeight: (me = (ge = l == null ? void 0 : l.button) == null ? void 0 : ge.font) == null ? void 0 : me.weight,
1582
+ shadow: (be = l == null ? void 0 : l.button) == null ? void 0 : be.shadow,
1583
+ border: (_e = l == null ? void 0 : l.button) == null ? void 0 : _e.border,
1584
+ borderRadius: (xe = l == null ? void 0 : l.button) == null ? void 0 : xe.borderRadius
2487
1585
  }
2488
1586
  });
2489
- B.build((ke = this._emptyStateFactory) == null ? void 0 : ke.call(this, { feedType: this._feedType })), B.setButtonClickCallback(() => this.handleRefresh()), (we = this.shadowRoot) == null || we.appendChild(B);
1587
+ D.build((fe = this._emptyStateFactory) == null ? void 0 : fe.call(this, { feedType: this._feedType })), D.setButtonClickCallback(() => this.handleRefresh()), (Ce = this.shadowRoot) == null || Ce.appendChild(D);
2490
1588
  return;
2491
1589
  }
2492
- const i = document.createElement("ul");
2493
- if ((Se = this.shadowRoot) == null || Se.appendChild(i), this._messages.forEach((u, B) => {
1590
+ const t = document.createElement("ul");
1591
+ if ((ve = this.shadowRoot) == null || ve.appendChild(t), this._messages.forEach((l, D) => {
2494
1592
  if (this._listItemFactory) {
2495
- i.appendChild(this._listItemFactory({ message: u, index: B }));
1593
+ t.appendChild(this._listItemFactory({ message: l, index: D }));
2496
1594
  return;
2497
1595
  }
2498
- const te = new Ao(e);
2499
- te.setMessage(u, this._feedType), te.setOnItemClick((ie) => {
2500
- var J;
2501
- return (J = this._onMessageClick) == null ? void 0 : J.call(this, ie, B);
2502
- }), te.setOnItemActionClick((ie, J) => {
2503
- var Ee;
2504
- return (Ee = this._onMessageActionClick) == null ? void 0 : Ee.call(this, ie, J, B);
2505
- }), te.setOnItemLongPress((ie) => {
2506
- var J;
2507
- return (J = this._onMessageLongPress) == null ? void 0 : J.call(this, ie, B);
2508
- }), i.appendChild(te);
1596
+ const K = new xo(e);
1597
+ K.setMessage(l, this._feedType), K.setOnItemClick((Q) => {
1598
+ var W;
1599
+ return (W = this._onMessageClick) == null ? void 0 : W.call(this, Q, D);
1600
+ }), K.setOnItemActionClick((Q, W) => {
1601
+ var ke;
1602
+ return (ke = this._onMessageActionClick) == null ? void 0 : ke.call(this, Q, W, D);
1603
+ }), K.setOnItemLongPress((Q) => {
1604
+ var W;
1605
+ return (W = this._onMessageLongPress) == null ? void 0 : W.call(this, Q, D);
1606
+ }), t.appendChild(K);
2509
1607
  }), this._canPaginate) {
2510
- const u = new Bo({
1608
+ const l = new Co({
2511
1609
  theme: e,
2512
- customItem: (Ie = this._paginationItemFactory) == null ? void 0 : Ie.call(this, { feedType: this._feedType }),
1610
+ customItem: (ye = this._paginationItemFactory) == null ? void 0 : ye.call(this, { feedType: this._feedType }),
2513
1611
  onPaginationTrigger: () => {
2514
- var B;
2515
- return (B = this._onPaginationTrigger) == null ? void 0 : B.call(this, this._feedType);
1612
+ var D;
1613
+ return (D = this._onPaginationTrigger) == null ? void 0 : D.call(this, this._feedType);
2516
1614
  }
2517
1615
  });
2518
- i.appendChild(u);
1616
+ t.appendChild(l);
2519
1617
  }
2520
1618
  }
2521
1619
  // Factories
@@ -2542,8 +1640,8 @@ class Ro extends HTMLElement {
2542
1640
  this._themeSubscription.unsubscribe();
2543
1641
  }
2544
1642
  }
2545
- customElements.get("courier-inbox-list") || customElements.define("courier-inbox-list", Ro);
2546
- class Do extends HTMLElement {
1643
+ customElements.get("courier-inbox-list") || customElements.define("courier-inbox-list", vo);
1644
+ class yo extends HTMLElement {
2547
1645
  constructor(e) {
2548
1646
  super();
2549
1647
  // State
@@ -2558,13 +1656,13 @@ class Do extends HTMLElement {
2558
1656
  // Theme
2559
1657
  a(this, "_themeManager");
2560
1658
  this._option = e.option, this._isSelected = e.isSelected, this._themeManager = e.themeManager;
2561
- const i = this.attachShadow({ mode: "open" });
2562
- this._style = document.createElement("style"), this._content = document.createElement("div"), this._content.className = "menu-item", this._itemIcon = new ne(this._option.icon.svg ?? x.inbox), this._itemIcon.setAttribute("size", "16"), this._title = document.createElement("p"), this._title.textContent = this._option.text;
1659
+ const t = this.attachShadow({ mode: "open" });
1660
+ this._style = document.createElement("style"), this._content = document.createElement("div"), this._content.className = "menu-item", this._itemIcon = new ie(this._option.icon.svg ?? f.inbox), this._itemIcon.setAttribute("size", "16"), this._title = document.createElement("p"), this._title.textContent = this._option.text;
2563
1661
  const s = document.createElement("div");
2564
- s.className = "spacer", this._selectionIcon = new ne(x.check), this._content.appendChild(this._itemIcon), this._content.appendChild(this._title), this._content.appendChild(s), e.selectable && this._content.appendChild(this._selectionIcon), i.appendChild(this._style), i.appendChild(this._content), this._selectionIcon.style.display = this._isSelected ? "block" : "none", this.refreshTheme();
1662
+ s.className = "spacer", this._selectionIcon = new ie(f.check), this._content.appendChild(this._itemIcon), this._content.appendChild(this._title), this._content.appendChild(s), e.selectable && this._content.appendChild(this._selectionIcon), t.appendChild(this._style), t.appendChild(this._content), this._selectionIcon.style.display = this._isSelected ? "block" : "none", this.refreshTheme();
2565
1663
  }
2566
1664
  getStyles() {
2567
- var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O, z, U, N, q, V, j;
1665
+ var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M, E, I, T, P, $, y, B, F, H, R, z, O, N, U, V, Z;
2568
1666
  const e = this._themeManager.getTheme();
2569
1667
  return `
2570
1668
  :host {
@@ -2575,11 +1673,11 @@ class Do extends HTMLElement {
2575
1673
  }
2576
1674
 
2577
1675
  :host(:hover) {
2578
- background-color: ${((c = (n = (o = (s = (i = e.inbox) == null ? void 0 : i.header) == null ? void 0 : s.menus) == null ? void 0 : o.popup) == null ? void 0 : n.list) == null ? void 0 : c.hoverBackgroundColor) ?? "red"};
1676
+ background-color: ${((h = (n = (o = (s = (t = e.inbox) == null ? void 0 : t.header) == null ? void 0 : s.menus) == null ? void 0 : o.popup) == null ? void 0 : n.list) == null ? void 0 : h.hoverBackgroundColor) ?? "red"};
2579
1677
  }
2580
1678
 
2581
1679
  :host(:active) {
2582
- background-color: ${((g = (m = (p = (l = (d = e.inbox) == null ? void 0 : d.header) == null ? void 0 : l.menus) == null ? void 0 : p.popup) == null ? void 0 : m.list) == null ? void 0 : g.activeBackgroundColor) ?? "red"};
1680
+ background-color: ${((p = (m = (u = (c = (d = e.inbox) == null ? void 0 : d.header) == null ? void 0 : c.menus) == null ? void 0 : u.popup) == null ? void 0 : m.list) == null ? void 0 : p.activeBackgroundColor) ?? "red"};
2583
1681
  }
2584
1682
 
2585
1683
  .menu-item {
@@ -2595,10 +1693,10 @@ class Do extends HTMLElement {
2595
1693
 
2596
1694
  p {
2597
1695
  margin: 0;
2598
- font-family: ${((w = (k = (C = (b = (_ = (f = e.inbox) == null ? void 0 : f.header) == null ? void 0 : _.menus) == null ? void 0 : b.popup) == null ? void 0 : C.list) == null ? void 0 : k.font) == null ? void 0 : w.family) ?? "inherit"};
2599
- font-weight: ${((R = (L = (M = (E = (I = (S = e.inbox) == null ? void 0 : S.header) == null ? void 0 : I.menus) == null ? void 0 : E.popup) == null ? void 0 : M.list) == null ? void 0 : L.font) == null ? void 0 : R.weight) ?? "inherit"};
2600
- font-size: ${((O = (H = (F = (A = (y = (D = e.inbox) == null ? void 0 : D.header) == null ? void 0 : y.menus) == null ? void 0 : A.popup) == null ? void 0 : F.list) == null ? void 0 : H.font) == null ? void 0 : O.size) ?? "14px"};
2601
- color: ${((j = (V = (q = (N = (U = (z = e.inbox) == null ? void 0 : z.header) == null ? void 0 : U.menus) == null ? void 0 : N.popup) == null ? void 0 : q.list) == null ? void 0 : V.font) == null ? void 0 : j.color) ?? "red"};
1696
+ font-family: ${((w = (k = (v = (b = (_ = (x = e.inbox) == null ? void 0 : x.header) == null ? void 0 : _.menus) == null ? void 0 : b.popup) == null ? void 0 : v.list) == null ? void 0 : k.font) == null ? void 0 : w.family) ?? "inherit"};
1697
+ font-weight: ${((P = (T = (I = (E = (M = (S = e.inbox) == null ? void 0 : S.header) == null ? void 0 : M.menus) == null ? void 0 : E.popup) == null ? void 0 : I.list) == null ? void 0 : T.font) == null ? void 0 : P.weight) ?? "inherit"};
1698
+ font-size: ${((R = (H = (F = (B = (y = ($ = e.inbox) == null ? void 0 : $.header) == null ? void 0 : y.menus) == null ? void 0 : B.popup) == null ? void 0 : F.list) == null ? void 0 : H.font) == null ? void 0 : R.size) ?? "14px"};
1699
+ color: ${((Z = (V = (U = (N = (O = (z = e.inbox) == null ? void 0 : z.header) == null ? void 0 : O.menus) == null ? void 0 : N.popup) == null ? void 0 : U.list) == null ? void 0 : V.font) == null ? void 0 : Z.color) ?? "red"};
2602
1700
  white-space: nowrap;
2603
1701
  }
2604
1702
 
@@ -2608,13 +1706,13 @@ class Do extends HTMLElement {
2608
1706
  `;
2609
1707
  }
2610
1708
  refreshTheme() {
2611
- var e, i, s, o;
2612
- this._style.textContent = this.getStyles(), this._selectionIcon.updateColor(((e = this._option.selectionIcon) == null ? void 0 : e.color) ?? "red"), this._selectionIcon.updateSVG(((i = this._option.selectionIcon) == null ? void 0 : i.svg) ?? x.check), this._title.textContent = this._option.text ?? "Missing Text", this._itemIcon.updateColor(((s = this._option.icon) == null ? void 0 : s.color) ?? "red"), this._itemIcon.updateSVG(((o = this._option.icon) == null ? void 0 : o.svg) ?? x.inbox);
1709
+ var e, t, s, o;
1710
+ this._style.textContent = this.getStyles(), this._selectionIcon.updateColor(((e = this._option.selectionIcon) == null ? void 0 : e.color) ?? "red"), this._selectionIcon.updateSVG(((t = this._option.selectionIcon) == null ? void 0 : t.svg) ?? f.check), this._title.textContent = this._option.text ?? "Missing Text", this._itemIcon.updateColor(((s = this._option.icon) == null ? void 0 : s.color) ?? "red"), this._itemIcon.updateSVG(((o = this._option.icon) == null ? void 0 : o.svg) ?? f.inbox);
2613
1711
  }
2614
1712
  }
2615
- customElements.get("courier-inbox-filter-menu-item") || customElements.define("courier-inbox-filter-menu-item", Do);
2616
- class He extends HTMLElement {
2617
- constructor(e, i, s, o, n) {
1713
+ customElements.get("courier-inbox-filter-menu-item") || customElements.define("courier-inbox-filter-menu-item", yo);
1714
+ class Be extends HTMLElement {
1715
+ constructor(e, t, s, o, n) {
2618
1716
  super();
2619
1717
  // Theme
2620
1718
  a(this, "_themeSubscription");
@@ -2628,14 +1726,14 @@ class He extends HTMLElement {
2628
1726
  a(this, "_menuButton");
2629
1727
  a(this, "_menu");
2630
1728
  a(this, "_style");
2631
- this._type = i, this._selectable = s, this._options = o, this._selectedIndex = 0, this._onMenuOpen = n;
2632
- const c = this.attachShadow({ mode: "open" });
2633
- this._menuButton = new $e(i === "filters" ? x.filter : x.overflow), this._menu = document.createElement("div"), this._menu.className = `menu ${i}`, this._style = document.createElement("style"), c.appendChild(this._style), c.appendChild(this._menuButton), c.appendChild(this._menu), this._menuButton.addEventListener("click", this.toggleMenu.bind(this)), document.addEventListener("click", this.handleOutsideClick.bind(this)), this._themeSubscription = e.subscribe((d) => {
1729
+ this._type = t, this._selectable = s, this._options = o, this._selectedIndex = 0, this._onMenuOpen = n;
1730
+ const h = this.attachShadow({ mode: "open" });
1731
+ this._menuButton = new Se(t === "filters" ? f.filter : f.overflow), this._menu = document.createElement("div"), this._menu.className = `menu ${t}`, this._style = document.createElement("style"), h.appendChild(this._style), h.appendChild(this._menuButton), h.appendChild(this._menu), this._menuButton.addEventListener("click", this.toggleMenu.bind(this)), document.addEventListener("click", this.handleOutsideClick.bind(this)), this._themeSubscription = e.subscribe((d) => {
2634
1732
  this.refreshTheme();
2635
1733
  }), this.refreshTheme();
2636
1734
  }
2637
1735
  getStyles() {
2638
- var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L;
1736
+ var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M, E, I, T;
2639
1737
  const e = this._themeSubscription.manager.getTheme();
2640
1738
  return `
2641
1739
  :host {
@@ -2648,10 +1746,10 @@ class He extends HTMLElement {
2648
1746
  position: absolute;
2649
1747
  top: 42px;
2650
1748
  right: -6px;
2651
- border-radius: ${((n = (o = (s = (i = e.inbox) == null ? void 0 : i.header) == null ? void 0 : s.menus) == null ? void 0 : o.popup) == null ? void 0 : n.borderRadius) ?? "6px"};
2652
- border: ${((p = (l = (d = (c = e.inbox) == null ? void 0 : c.header) == null ? void 0 : d.menus) == null ? void 0 : l.popup) == null ? void 0 : p.border) ?? "1px solid red"};
2653
- background: ${((_ = (f = (g = (m = e.inbox) == null ? void 0 : m.header) == null ? void 0 : g.menus) == null ? void 0 : f.popup) == null ? void 0 : _.backgroundColor) ?? "red"};
2654
- box-shadow: ${((w = (k = (C = (b = e.inbox) == null ? void 0 : b.header) == null ? void 0 : C.menus) == null ? void 0 : k.popup) == null ? void 0 : w.shadow) ?? "0 4px 12px 0 red"};
1749
+ border-radius: ${((n = (o = (s = (t = e.inbox) == null ? void 0 : t.header) == null ? void 0 : s.menus) == null ? void 0 : o.popup) == null ? void 0 : n.borderRadius) ?? "6px"};
1750
+ border: ${((u = (c = (d = (h = e.inbox) == null ? void 0 : h.header) == null ? void 0 : d.menus) == null ? void 0 : c.popup) == null ? void 0 : u.border) ?? "1px solid red"};
1751
+ background: ${((_ = (x = (p = (m = e.inbox) == null ? void 0 : m.header) == null ? void 0 : p.menus) == null ? void 0 : x.popup) == null ? void 0 : _.backgroundColor) ?? "red"};
1752
+ box-shadow: ${((w = (k = (v = (b = e.inbox) == null ? void 0 : b.header) == null ? void 0 : v.menus) == null ? void 0 : k.popup) == null ? void 0 : w.shadow) ?? "0 4px 12px 0 red"};
2655
1753
  z-index: 1000;
2656
1754
  min-width: 200px;
2657
1755
  overflow: hidden;
@@ -2659,7 +1757,7 @@ class He extends HTMLElement {
2659
1757
  }
2660
1758
 
2661
1759
  courier-inbox-filter-menu-item {
2662
- border-bottom: ${((L = (M = (E = (I = (S = e.inbox) == null ? void 0 : S.header) == null ? void 0 : I.menus) == null ? void 0 : E.popup) == null ? void 0 : M.list) == null ? void 0 : L.divider) ?? "none"};
1760
+ border-bottom: ${((T = (I = (E = (M = (S = e.inbox) == null ? void 0 : S.header) == null ? void 0 : M.menus) == null ? void 0 : E.popup) == null ? void 0 : I.list) == null ? void 0 : T.divider) ?? "none"};
2663
1761
  }
2664
1762
 
2665
1763
  courier-inbox-filter-menu-item:last-child {
@@ -2668,31 +1766,31 @@ class He extends HTMLElement {
2668
1766
  `;
2669
1767
  }
2670
1768
  refreshTheme() {
2671
- var c, d, l, p, m, g;
1769
+ var h, d, c, u, m, p;
2672
1770
  this._style.textContent = this.getStyles();
2673
- const i = (d = (c = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : c.header) == null ? void 0 : d.menus, s = this._type === "filters", o = s ? (l = i == null ? void 0 : i.filters) == null ? void 0 : l.button : (p = i == null ? void 0 : i.actions) == null ? void 0 : p.button, n = s ? x.filter : x.overflow;
2674
- this._menuButton.updateIconSVG(((m = o == null ? void 0 : o.icon) == null ? void 0 : m.svg) ?? n), this._menuButton.updateIconColor(((g = o == null ? void 0 : o.icon) == null ? void 0 : g.color) ?? "red"), this._menuButton.updateBackgroundColor((o == null ? void 0 : o.backgroundColor) ?? "transparent"), this._menuButton.updateHoverBackgroundColor((o == null ? void 0 : o.hoverBackgroundColor) ?? "red"), this._menuButton.updateActiveBackgroundColor((o == null ? void 0 : o.activeBackgroundColor) ?? "red"), this.refreshMenuItems();
1771
+ const t = (d = (h = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : h.header) == null ? void 0 : d.menus, s = this._type === "filters", o = s ? (c = t == null ? void 0 : t.filters) == null ? void 0 : c.button : (u = t == null ? void 0 : t.actions) == null ? void 0 : u.button, n = s ? f.filter : f.overflow;
1772
+ this._menuButton.updateIconSVG(((m = o == null ? void 0 : o.icon) == null ? void 0 : m.svg) ?? n), this._menuButton.updateIconColor(((p = o == null ? void 0 : o.icon) == null ? void 0 : p.color) ?? "red"), this._menuButton.updateBackgroundColor((o == null ? void 0 : o.backgroundColor) ?? "transparent"), this._menuButton.updateHoverBackgroundColor((o == null ? void 0 : o.hoverBackgroundColor) ?? "red"), this._menuButton.updateActiveBackgroundColor((o == null ? void 0 : o.activeBackgroundColor) ?? "red"), this.refreshMenuItems();
2675
1773
  }
2676
1774
  setOptions(e) {
2677
1775
  this._options = e, this.refreshMenuItems();
2678
1776
  }
2679
1777
  refreshMenuItems() {
2680
- this._menu.innerHTML = "", this._options.forEach((e, i) => {
2681
- const s = new Do({
1778
+ this._menu.innerHTML = "", this._options.forEach((e, t) => {
1779
+ const s = new yo({
2682
1780
  option: e,
2683
1781
  selectable: this._selectable,
2684
- isSelected: this._selectedIndex === i,
1782
+ isSelected: this._selectedIndex === t,
2685
1783
  themeManager: this._themeSubscription.manager
2686
1784
  });
2687
1785
  s.addEventListener("click", () => {
2688
- this._selectedIndex = i, e.onClick(e), this.refreshMenuItems(), this.closeMenu();
1786
+ this._selectedIndex = t, e.onClick(e), this.refreshMenuItems(), this.closeMenu();
2689
1787
  }), this._menu.appendChild(s);
2690
1788
  });
2691
1789
  }
2692
1790
  toggleMenu(e) {
2693
1791
  e.stopPropagation();
2694
- const i = this._menu.style.display !== "block";
2695
- this._menu.style.display = i ? "block" : "none", i && this._onMenuOpen();
1792
+ const t = this._menu.style.display !== "block";
1793
+ this._menu.style.display = t ? "block" : "none", t && this._onMenuOpen();
2696
1794
  }
2697
1795
  handleOutsideClick(e) {
2698
1796
  this.contains(e.target) || this.closeMenu();
@@ -2701,14 +1799,14 @@ class He extends HTMLElement {
2701
1799
  this._menu.style.display = "none";
2702
1800
  }
2703
1801
  selectOption(e) {
2704
- this._selectedIndex = this._options.findIndex((i) => i.id === e.id), this.refreshMenuItems();
1802
+ this._selectedIndex = this._options.findIndex((t) => t.id === e.id), this.refreshMenuItems();
2705
1803
  }
2706
1804
  disconnectedCallback() {
2707
1805
  this._themeSubscription.unsubscribe();
2708
1806
  }
2709
1807
  }
2710
- customElements.get("courier-inbox-option-menu") || customElements.define("courier-inbox-option-menu", He);
2711
- class qe extends HTMLElement {
1808
+ customElements.get("courier-inbox-option-menu") || customElements.define("courier-inbox-option-menu", Be);
1809
+ class $e extends HTMLElement {
2712
1810
  constructor(e) {
2713
1811
  super();
2714
1812
  // Theme
@@ -2722,12 +1820,12 @@ class qe extends HTMLElement {
2722
1820
  this._location = e.location, this._themeSubscription = e.themeBus.subscribe((s) => {
2723
1821
  this.refreshTheme(this._location);
2724
1822
  });
2725
- const i = this.attachShadow({ mode: "open" });
2726
- this._badge = document.createElement("span"), this._badge.className = "unread-badge", this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._location), i.appendChild(this._style), i.appendChild(this._badge);
1823
+ const t = this.attachShadow({ mode: "open" });
1824
+ this._badge = document.createElement("span"), this._badge.className = "unread-badge", this._style = document.createElement("style"), this._style.textContent = this.getStyles(this._location), t.appendChild(this._style), t.appendChild(this._badge);
2727
1825
  }
2728
1826
  getStyles(e) {
2729
- var l, p, m, g, f, _, b;
2730
- const i = this._themeSubscription.manager.getTheme(), s = e === "button" ? (p = (l = i.popup) == null ? void 0 : l.button) == null ? void 0 : p.unreadIndicator : (f = (g = (m = i.inbox) == null ? void 0 : m.header) == null ? void 0 : g.filters) == null ? void 0 : f.unreadIndicator, o = s == null ? void 0 : s.backgroundColor, n = s == null ? void 0 : s.borderRadius, c = (_ = s == null ? void 0 : s.font) == null ? void 0 : _.color, d = (b = s == null ? void 0 : s.font) == null ? void 0 : b.size;
1827
+ var c, u, m, p, x, _, b;
1828
+ const t = this._themeSubscription.manager.getTheme(), s = e === "button" ? (u = (c = t.popup) == null ? void 0 : c.button) == null ? void 0 : u.unreadIndicator : (x = (p = (m = t.inbox) == null ? void 0 : m.header) == null ? void 0 : p.filters) == null ? void 0 : x.unreadIndicator, o = s == null ? void 0 : s.backgroundColor, n = s == null ? void 0 : s.borderRadius, h = (_ = s == null ? void 0 : s.font) == null ? void 0 : _.color, d = (b = s == null ? void 0 : s.font) == null ? void 0 : b.size;
2731
1829
  return `
2732
1830
  :host {
2733
1831
  display: inline-block;
@@ -2735,7 +1833,7 @@ class qe extends HTMLElement {
2735
1833
 
2736
1834
  .unread-badge {
2737
1835
  background-color: ${o};
2738
- color: ${c};
1836
+ color: ${h};
2739
1837
  border-radius: ${n};
2740
1838
  padding: 4px 8px;
2741
1839
  font-size: ${d};
@@ -2758,9 +1856,9 @@ class qe extends HTMLElement {
2758
1856
  this._themeSubscription.unsubscribe();
2759
1857
  }
2760
1858
  }
2761
- customElements.get("courier-unread-count-badge") || customElements.define("courier-unread-count-badge", qe);
2762
- class Fo extends HTMLElement {
2763
- constructor(e, i) {
1859
+ customElements.get("courier-unread-count-badge") || customElements.define("courier-unread-count-badge", $e);
1860
+ class ko extends HTMLElement {
1861
+ constructor(e, t) {
2764
1862
  super();
2765
1863
  // Theme
2766
1864
  a(this, "_themeSubscription");
@@ -2773,9 +1871,9 @@ class Fo extends HTMLElement {
2773
1871
  a(this, "_unreadBadge");
2774
1872
  a(this, "_container");
2775
1873
  a(this, "_style");
2776
- this._option = i;
1874
+ this._option = t;
2777
1875
  const s = this.attachShadow({ mode: "open" });
2778
- this._style = document.createElement("style"), this._container = document.createElement("div"), this._container.className = "title-section", this._iconElement = new ne(void 0, this._option.icon.svg), this._titleElement = document.createElement("h2"), this._unreadBadge = new qe({
1876
+ this._style = document.createElement("style"), this._container = document.createElement("div"), this._container.className = "title-section", this._iconElement = new ie(void 0, this._option.icon.svg), this._titleElement = document.createElement("h2"), this._unreadBadge = new $e({
2779
1877
  themeBus: e,
2780
1878
  location: "header"
2781
1879
  }), this._container.appendChild(this._iconElement), this._container.appendChild(this._titleElement), this._container.appendChild(this._unreadBadge), s.appendChild(this._style), s.appendChild(this._container), this._themeSubscription = e.subscribe((o) => {
@@ -2783,7 +1881,7 @@ class Fo extends HTMLElement {
2783
1881
  }), this.refreshTheme(this._feedType ?? "inbox");
2784
1882
  }
2785
1883
  getStyles() {
2786
- var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w;
1884
+ var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w;
2787
1885
  const e = this._themeSubscription.manager.getTheme();
2788
1886
  return `
2789
1887
  .title-section {
@@ -2800,10 +1898,10 @@ class Fo extends HTMLElement {
2800
1898
 
2801
1899
  h2 {
2802
1900
  margin: 0;
2803
- font-family: ${((n = (o = (s = (i = e.inbox) == null ? void 0 : i.header) == null ? void 0 : s.filters) == null ? void 0 : o.font) == null ? void 0 : n.family) ?? "inherit"};
2804
- font-size: ${((p = (l = (d = (c = e.inbox) == null ? void 0 : c.header) == null ? void 0 : d.filters) == null ? void 0 : l.font) == null ? void 0 : p.size) ?? "18px"};
2805
- font-weight: ${((_ = (f = (g = (m = e.inbox) == null ? void 0 : m.header) == null ? void 0 : g.filters) == null ? void 0 : f.font) == null ? void 0 : _.weight) ?? "500"};
2806
- color: ${((w = (k = (C = (b = e.inbox) == null ? void 0 : b.header) == null ? void 0 : C.filters) == null ? void 0 : k.font) == null ? void 0 : w.color) ?? "red"};
1901
+ font-family: ${((n = (o = (s = (t = e.inbox) == null ? void 0 : t.header) == null ? void 0 : s.filters) == null ? void 0 : o.font) == null ? void 0 : n.family) ?? "inherit"};
1902
+ font-size: ${((u = (c = (d = (h = e.inbox) == null ? void 0 : h.header) == null ? void 0 : d.filters) == null ? void 0 : c.font) == null ? void 0 : u.size) ?? "18px"};
1903
+ font-weight: ${((_ = (x = (p = (m = e.inbox) == null ? void 0 : m.header) == null ? void 0 : p.filters) == null ? void 0 : x.font) == null ? void 0 : _.weight) ?? "500"};
1904
+ color: ${((w = (k = (v = (b = e.inbox) == null ? void 0 : b.header) == null ? void 0 : v.filters) == null ? void 0 : k.font) == null ? void 0 : w.color) ?? "red"};
2807
1905
  }
2808
1906
 
2809
1907
  courier-unread-count-badge {
@@ -2814,18 +1912,18 @@ class Fo extends HTMLElement {
2814
1912
  refreshTheme(e) {
2815
1913
  this._feedType = e, this._style.textContent = this.getStyles(), this._unreadBadge.refreshTheme("header"), this.updateFilter();
2816
1914
  }
2817
- updateSelectedOption(e, i, s) {
2818
- this._option = e, this._feedType = i, this._unreadBadge.setCount(s), this.updateFilter();
1915
+ updateSelectedOption(e, t, s) {
1916
+ this._option = e, this._feedType = t, this._unreadBadge.setCount(s), this.updateFilter();
2819
1917
  }
2820
1918
  updateFilter() {
2821
- var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O;
1919
+ var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M, E, I, T, P, $, y, B, F, H, R;
2822
1920
  const e = this._themeSubscription.manager.getTheme();
2823
1921
  switch (this._feedType) {
2824
1922
  case "inbox":
2825
- this._titleElement.textContent = ((n = (o = (s = (i = e.inbox) == null ? void 0 : i.header) == null ? void 0 : s.filters) == null ? void 0 : o.inbox) == null ? void 0 : n.text) ?? "Inbox", this._iconElement.updateSVG(((m = (p = (l = (d = (c = e.inbox) == null ? void 0 : c.header) == null ? void 0 : d.filters) == null ? void 0 : l.inbox) == null ? void 0 : p.icon) == null ? void 0 : m.svg) ?? x.inbox), this._iconElement.updateColor(((C = (b = (_ = (f = (g = e.inbox) == null ? void 0 : g.header) == null ? void 0 : f.filters) == null ? void 0 : _.inbox) == null ? void 0 : b.icon) == null ? void 0 : C.color) ?? "red");
1923
+ this._titleElement.textContent = ((n = (o = (s = (t = e.inbox) == null ? void 0 : t.header) == null ? void 0 : s.filters) == null ? void 0 : o.inbox) == null ? void 0 : n.text) ?? "Inbox", this._iconElement.updateSVG(((m = (u = (c = (d = (h = e.inbox) == null ? void 0 : h.header) == null ? void 0 : d.filters) == null ? void 0 : c.inbox) == null ? void 0 : u.icon) == null ? void 0 : m.svg) ?? f.inbox), this._iconElement.updateColor(((v = (b = (_ = (x = (p = e.inbox) == null ? void 0 : p.header) == null ? void 0 : x.filters) == null ? void 0 : _.inbox) == null ? void 0 : b.icon) == null ? void 0 : v.color) ?? "red");
2826
1924
  break;
2827
1925
  case "archive":
2828
- this._titleElement.textContent = ((I = (S = (w = (k = e.inbox) == null ? void 0 : k.header) == null ? void 0 : w.filters) == null ? void 0 : S.archive) == null ? void 0 : I.text) ?? "Archive", this._iconElement.updateSVG(((D = (R = (L = (M = (E = e.inbox) == null ? void 0 : E.header) == null ? void 0 : M.filters) == null ? void 0 : L.archive) == null ? void 0 : R.icon) == null ? void 0 : D.svg) ?? x.archive), this._iconElement.updateColor(((O = (H = (F = (A = (y = e.inbox) == null ? void 0 : y.header) == null ? void 0 : A.filters) == null ? void 0 : F.archive) == null ? void 0 : H.icon) == null ? void 0 : O.color) ?? "red");
1926
+ this._titleElement.textContent = ((M = (S = (w = (k = e.inbox) == null ? void 0 : k.header) == null ? void 0 : w.filters) == null ? void 0 : S.archive) == null ? void 0 : M.text) ?? "Archive", this._iconElement.updateSVG((($ = (P = (T = (I = (E = e.inbox) == null ? void 0 : E.header) == null ? void 0 : I.filters) == null ? void 0 : T.archive) == null ? void 0 : P.icon) == null ? void 0 : $.svg) ?? f.archive), this._iconElement.updateColor(((R = (H = (F = (B = (y = e.inbox) == null ? void 0 : y.header) == null ? void 0 : B.filters) == null ? void 0 : F.archive) == null ? void 0 : H.icon) == null ? void 0 : R.color) ?? "red");
2829
1927
  break;
2830
1928
  }
2831
1929
  }
@@ -2834,8 +1932,8 @@ class Fo extends HTMLElement {
2834
1932
  this._themeSubscription.unsubscribe();
2835
1933
  }
2836
1934
  }
2837
- customElements.get("courier-inbox-header-title") || customElements.define("courier-inbox-header-title", Fo);
2838
- class Ho extends De {
1935
+ customElements.get("courier-inbox-header-title") || customElements.define("courier-inbox-header-title", ko);
1936
+ class wo extends Le {
2839
1937
  constructor(e) {
2840
1938
  super();
2841
1939
  // Theme
@@ -2850,86 +1948,86 @@ class Ho extends De {
2850
1948
  a(this, "_style");
2851
1949
  // Callbacks
2852
1950
  a(this, "_onFeedTypeChange");
2853
- this._themeSubscription = e.themeManager.subscribe((i) => {
1951
+ this._themeSubscription = e.themeManager.subscribe((t) => {
2854
1952
  this.refreshTheme();
2855
1953
  }), this._onFeedTypeChange = e.onFeedTypeChange;
2856
1954
  }
2857
1955
  // Menu options
2858
1956
  getFilterOptions() {
2859
- var s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O, z, U, N, q, V, j, X, Q, Y, ee;
2860
- const e = this._themeSubscription.manager.getTheme(), i = (n = (o = (s = e.inbox) == null ? void 0 : s.header) == null ? void 0 : o.menus) == null ? void 0 : n.filters;
1957
+ var s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M, E, I, T, P, $, y, B, F, H, R, z, O, N, U, V, Z, J, q, X, Y;
1958
+ const e = this._themeSubscription.manager.getTheme(), t = (n = (o = (s = e.inbox) == null ? void 0 : s.header) == null ? void 0 : o.menus) == null ? void 0 : n.filters;
2861
1959
  return [
2862
1960
  {
2863
1961
  id: "inbox",
2864
- text: ((c = i == null ? void 0 : i.inbox) == null ? void 0 : c.text) ?? "Inbox",
1962
+ text: ((h = t == null ? void 0 : t.inbox) == null ? void 0 : h.text) ?? "Inbox",
2865
1963
  icon: {
2866
- color: ((l = (d = i == null ? void 0 : i.inbox) == null ? void 0 : d.icon) == null ? void 0 : l.color) ?? "red",
2867
- svg: ((m = (p = i == null ? void 0 : i.inbox) == null ? void 0 : p.icon) == null ? void 0 : m.svg) ?? x.inbox
1964
+ color: ((c = (d = t == null ? void 0 : t.inbox) == null ? void 0 : d.icon) == null ? void 0 : c.color) ?? "red",
1965
+ svg: ((m = (u = t == null ? void 0 : t.inbox) == null ? void 0 : u.icon) == null ? void 0 : m.svg) ?? f.inbox
2868
1966
  },
2869
1967
  selectionIcon: {
2870
- color: ((k = (C = (b = (_ = (f = (g = e.inbox) == null ? void 0 : g.header) == null ? void 0 : f.menus) == null ? void 0 : _.popup) == null ? void 0 : b.list) == null ? void 0 : C.selectionIcon) == null ? void 0 : k.color) ?? "red",
2871
- svg: ((L = (M = (E = (I = (S = (w = e.inbox) == null ? void 0 : w.header) == null ? void 0 : S.menus) == null ? void 0 : I.popup) == null ? void 0 : E.list) == null ? void 0 : M.selectionIcon) == null ? void 0 : L.svg) ?? x.check
1968
+ color: ((k = (v = (b = (_ = (x = (p = e.inbox) == null ? void 0 : p.header) == null ? void 0 : x.menus) == null ? void 0 : _.popup) == null ? void 0 : b.list) == null ? void 0 : v.selectionIcon) == null ? void 0 : k.color) ?? "red",
1969
+ svg: ((T = (I = (E = (M = (S = (w = e.inbox) == null ? void 0 : w.header) == null ? void 0 : S.menus) == null ? void 0 : M.popup) == null ? void 0 : E.list) == null ? void 0 : I.selectionIcon) == null ? void 0 : T.svg) ?? f.check
2872
1970
  },
2873
- onClick: (G) => {
2874
- this.handleOptionMenuItemClick("inbox", G);
1971
+ onClick: (j) => {
1972
+ this.handleOptionMenuItemClick("inbox", j);
2875
1973
  }
2876
1974
  },
2877
1975
  {
2878
1976
  id: "archive",
2879
- text: ((R = i == null ? void 0 : i.archive) == null ? void 0 : R.text) ?? "Archive",
1977
+ text: ((P = t == null ? void 0 : t.archive) == null ? void 0 : P.text) ?? "Archive",
2880
1978
  icon: {
2881
- color: ((y = (D = i == null ? void 0 : i.archive) == null ? void 0 : D.icon) == null ? void 0 : y.color) ?? "red",
2882
- svg: ((F = (A = i == null ? void 0 : i.archive) == null ? void 0 : A.icon) == null ? void 0 : F.svg) ?? x.archive
1979
+ color: ((y = ($ = t == null ? void 0 : t.archive) == null ? void 0 : $.icon) == null ? void 0 : y.color) ?? "red",
1980
+ svg: ((F = (B = t == null ? void 0 : t.archive) == null ? void 0 : B.icon) == null ? void 0 : F.svg) ?? f.archive
2883
1981
  },
2884
1982
  selectionIcon: {
2885
- color: ((q = (N = (U = (z = (O = (H = e.inbox) == null ? void 0 : H.header) == null ? void 0 : O.menus) == null ? void 0 : z.popup) == null ? void 0 : U.list) == null ? void 0 : N.selectionIcon) == null ? void 0 : q.color) ?? "red",
2886
- svg: ((ee = (Y = (Q = (X = (j = (V = e.inbox) == null ? void 0 : V.header) == null ? void 0 : j.menus) == null ? void 0 : X.popup) == null ? void 0 : Q.list) == null ? void 0 : Y.selectionIcon) == null ? void 0 : ee.svg) ?? x.check
1983
+ color: ((U = (N = (O = (z = (R = (H = e.inbox) == null ? void 0 : H.header) == null ? void 0 : R.menus) == null ? void 0 : z.popup) == null ? void 0 : O.list) == null ? void 0 : N.selectionIcon) == null ? void 0 : U.color) ?? "red",
1984
+ svg: ((Y = (X = (q = (J = (Z = (V = e.inbox) == null ? void 0 : V.header) == null ? void 0 : Z.menus) == null ? void 0 : J.popup) == null ? void 0 : q.list) == null ? void 0 : X.selectionIcon) == null ? void 0 : Y.svg) ?? f.check
2887
1985
  },
2888
- onClick: (G) => {
2889
- this.handleOptionMenuItemClick("archive", G);
1986
+ onClick: (j) => {
1987
+ this.handleOptionMenuItemClick("archive", j);
2890
1988
  }
2891
1989
  }
2892
1990
  ];
2893
1991
  }
2894
1992
  getActionOptions() {
2895
- var s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E;
2896
- const i = (n = (o = (s = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : s.header) == null ? void 0 : o.menus) == null ? void 0 : n.actions;
1993
+ var s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M, E;
1994
+ const t = (n = (o = (s = this._themeSubscription.manager.getTheme().inbox) == null ? void 0 : s.header) == null ? void 0 : o.menus) == null ? void 0 : n.actions;
2897
1995
  return [
2898
1996
  {
2899
1997
  id: "markAllRead",
2900
- text: ((c = i == null ? void 0 : i.markAllRead) == null ? void 0 : c.text) ?? "Mark All as Read",
1998
+ text: ((h = t == null ? void 0 : t.markAllRead) == null ? void 0 : h.text) ?? "Mark All as Read",
2901
1999
  icon: {
2902
- color: ((l = (d = i == null ? void 0 : i.markAllRead) == null ? void 0 : d.icon) == null ? void 0 : l.color) ?? "red",
2903
- svg: ((m = (p = i == null ? void 0 : i.markAllRead) == null ? void 0 : p.icon) == null ? void 0 : m.svg) ?? x.inbox
2000
+ color: ((c = (d = t == null ? void 0 : t.markAllRead) == null ? void 0 : d.icon) == null ? void 0 : c.color) ?? "red",
2001
+ svg: ((m = (u = t == null ? void 0 : t.markAllRead) == null ? void 0 : u.icon) == null ? void 0 : m.svg) ?? f.inbox
2904
2002
  },
2905
2003
  selectionIcon: null,
2906
- onClick: (M) => {
2907
- P.shared.readAllMessages({ canCallApi: !0 });
2004
+ onClick: (I) => {
2005
+ A.shared.readAllMessages({ canCallApi: !0 });
2908
2006
  }
2909
2007
  },
2910
2008
  {
2911
2009
  id: "archiveAll",
2912
- text: ((g = i == null ? void 0 : i.archiveAll) == null ? void 0 : g.text) ?? "Archive All",
2010
+ text: ((p = t == null ? void 0 : t.archiveAll) == null ? void 0 : p.text) ?? "Archive All",
2913
2011
  icon: {
2914
- color: ((_ = (f = i == null ? void 0 : i.archiveAll) == null ? void 0 : f.icon) == null ? void 0 : _.color) ?? "red",
2915
- svg: ((C = (b = i == null ? void 0 : i.archiveAll) == null ? void 0 : b.icon) == null ? void 0 : C.svg) ?? x.archive
2012
+ color: ((_ = (x = t == null ? void 0 : t.archiveAll) == null ? void 0 : x.icon) == null ? void 0 : _.color) ?? "red",
2013
+ svg: ((v = (b = t == null ? void 0 : t.archiveAll) == null ? void 0 : b.icon) == null ? void 0 : v.svg) ?? f.archive
2916
2014
  },
2917
2015
  selectionIcon: null,
2918
- onClick: (M) => {
2919
- var L;
2920
- alert(JSON.stringify((L = v.shared.client) == null ? void 0 : L.options));
2016
+ onClick: (I) => {
2017
+ var T;
2018
+ alert(JSON.stringify((T = C.shared.client) == null ? void 0 : T.options));
2921
2019
  }
2922
2020
  },
2923
2021
  {
2924
2022
  id: "archiveRead",
2925
- text: ((k = i == null ? void 0 : i.archiveRead) == null ? void 0 : k.text) ?? "Archive Read",
2023
+ text: ((k = t == null ? void 0 : t.archiveRead) == null ? void 0 : k.text) ?? "Archive Read",
2926
2024
  icon: {
2927
- color: ((S = (w = i == null ? void 0 : i.archiveRead) == null ? void 0 : w.icon) == null ? void 0 : S.color) ?? "red",
2928
- svg: ((E = (I = i == null ? void 0 : i.archiveRead) == null ? void 0 : I.icon) == null ? void 0 : E.svg) ?? x.archive
2025
+ color: ((S = (w = t == null ? void 0 : t.archiveRead) == null ? void 0 : w.icon) == null ? void 0 : S.color) ?? "red",
2026
+ svg: ((E = (M = t == null ? void 0 : t.archiveRead) == null ? void 0 : M.icon) == null ? void 0 : E.svg) ?? f.archive
2929
2027
  },
2930
2028
  selectionIcon: null,
2931
- onClick: (M) => {
2932
- P.shared.archiveReadMessages({ canCallApi: !0 });
2029
+ onClick: (I) => {
2030
+ A.shared.archiveReadMessages({ canCallApi: !0 });
2933
2031
  }
2934
2032
  }
2935
2033
  ];
@@ -2938,40 +2036,40 @@ class Ho extends De {
2938
2036
  return ["icon", "title", "feed-type"];
2939
2037
  }
2940
2038
  refreshTheme() {
2941
- var s, o, n, c, d, l, p;
2942
- const e = this._themeSubscription.manager.getTheme(), i = (s = this.shadow) == null ? void 0 : s.querySelector(".courier-inbox-header");
2943
- i && (i.style.backgroundColor = ((n = (o = e.inbox) == null ? void 0 : o.header) == null ? void 0 : n.backgroundColor) ?? r.white[500], i.style.boxShadow = ((d = (c = e.inbox) == null ? void 0 : c.header) == null ? void 0 : d.shadow) ?? `0px 1px 0px 0px ${r.gray[500]}`), (l = this._filterMenu) == null || l.setOptions(this.getFilterOptions()), (p = this._actionMenu) == null || p.setOptions(this.getActionOptions());
2039
+ var s, o, n, h, d, c, u;
2040
+ const e = this._themeSubscription.manager.getTheme(), t = (s = this.shadow) == null ? void 0 : s.querySelector(".courier-inbox-header");
2041
+ t && (t.style.backgroundColor = ((n = (o = e.inbox) == null ? void 0 : o.header) == null ? void 0 : n.backgroundColor) ?? r.white[500], t.style.boxShadow = ((d = (h = e.inbox) == null ? void 0 : h.header) == null ? void 0 : d.shadow) ?? `0px 1px 0px 0px ${r.gray[500]}`), (c = this._filterMenu) == null || c.setOptions(this.getFilterOptions()), (u = this._actionMenu) == null || u.setOptions(this.getActionOptions());
2944
2042
  }
2945
- handleOptionMenuItemClick(e, i) {
2946
- this._feedType = e, this._titleSection && this._titleSection.updateSelectedOption(i, this._feedType, this._feedType === "inbox" ? this._unreadCount : 0), this._onFeedTypeChange(e);
2043
+ handleOptionMenuItemClick(e, t) {
2044
+ this._feedType = e, this._titleSection && this._titleSection.updateSelectedOption(t, this._feedType, this._feedType === "inbox" ? this._unreadCount : 0), this._onFeedTypeChange(e);
2947
2045
  }
2948
2046
  render(e) {
2949
2047
  this._feedType = e.feedType, this._unreadCount = e.unreadCount, this.refreshTitleSection();
2950
2048
  }
2951
2049
  refreshTitleSection() {
2952
- var i, s;
2050
+ var t, s;
2953
2051
  const e = this.getFilterOptions().find((o) => ["inbox", "archive"].includes(o.id) && o.id === this._feedType);
2954
- e && ((i = this._titleSection) == null || i.updateSelectedOption(e, this._feedType, this._feedType === "inbox" ? this._unreadCount : 0), (s = this._filterMenu) == null || s.selectOption(e));
2052
+ e && ((t = this._titleSection) == null || t.updateSelectedOption(e, this._feedType, this._feedType === "inbox" ? this._unreadCount : 0), (s = this._filterMenu) == null || s.selectOption(e));
2955
2053
  }
2956
2054
  build(e) {
2957
- var i;
2958
- super.build(e), this._style = document.createElement("style"), this._style.textContent = this.getStyles(), (i = this.shadow) == null || i.appendChild(this._style), this.refreshTheme();
2055
+ var t;
2056
+ super.build(e), this._style = document.createElement("style"), this._style.textContent = this.getStyles(), (t = this.shadow) == null || t.appendChild(this._style), this.refreshTheme();
2959
2057
  }
2960
2058
  defaultElement() {
2961
2059
  const e = this.getFilterOptions();
2962
- this._titleSection = new Fo(this._themeSubscription.manager, e[0]), this._filterMenu = new He(this._themeSubscription.manager, "filters", !0, e, () => {
2060
+ this._titleSection = new ko(this._themeSubscription.manager, e[0]), this._filterMenu = new Be(this._themeSubscription.manager, "filters", !0, e, () => {
2963
2061
  var n;
2964
2062
  (n = this._actionMenu) == null || n.closeMenu();
2965
- }), this._actionMenu = new He(this._themeSubscription.manager, "actions", !1, this.getActionOptions(), () => {
2063
+ }), this._actionMenu = new Be(this._themeSubscription.manager, "actions", !1, this.getActionOptions(), () => {
2966
2064
  var n;
2967
2065
  (n = this._filterMenu) == null || n.closeMenu();
2968
2066
  }), this._filterMenu.selectOption(e[0]);
2969
- const i = document.createElement("div");
2970
- i.className = "spacer";
2067
+ const t = document.createElement("div");
2068
+ t.className = "spacer";
2971
2069
  const s = document.createElement("div");
2972
2070
  s.className = "actions", s.appendChild(this._filterMenu), s.appendChild(this._actionMenu);
2973
2071
  const o = document.createElement("div");
2974
- return o.className = "courier-inbox-header", o.appendChild(this._titleSection), o.appendChild(i), o.appendChild(s), o;
2072
+ return o.className = "courier-inbox-header", o.appendChild(this._titleSection), o.appendChild(t), o.appendChild(s), o;
2975
2073
  }
2976
2074
  getStyles() {
2977
2075
  return `
@@ -3010,22 +2108,22 @@ class Ho extends De {
3010
2108
  this._themeSubscription.unsubscribe();
3011
2109
  }
3012
2110
  }
3013
- customElements.get("courier-inbox-header") || customElements.define("courier-inbox-header", Ho);
3014
- class Oo {
3015
- constructor(t) {
2111
+ customElements.get("courier-inbox-header") || customElements.define("courier-inbox-header", wo);
2112
+ class So {
2113
+ constructor(i) {
3016
2114
  a(this, "events");
3017
- this.events = t;
2115
+ this.events = i;
3018
2116
  }
3019
2117
  remove() {
3020
- P.shared.removeDataStoreListener(this);
2118
+ A.shared.removeDataStoreListener(this);
3021
2119
  }
3022
2120
  }
3023
- const Te = {
2121
+ const we = {
3024
2122
  popup: {
3025
2123
  button: {
3026
2124
  icon: {
3027
2125
  color: r.black[500],
3028
- svg: x.inbox
2126
+ svg: f.inbox
3029
2127
  },
3030
2128
  backgroundColor: "transparent",
3031
2129
  hoverBackgroundColor: r.black[50010],
@@ -3061,14 +2159,14 @@ const Te = {
3061
2159
  inbox: {
3062
2160
  icon: {
3063
2161
  color: r.black[500],
3064
- svg: x.inbox
2162
+ svg: f.inbox
3065
2163
  },
3066
2164
  text: "Inbox"
3067
2165
  },
3068
2166
  archive: {
3069
2167
  icon: {
3070
2168
  color: r.black[500],
3071
- svg: x.archive
2169
+ svg: f.archive
3072
2170
  },
3073
2171
  text: "Archive"
3074
2172
  },
@@ -3099,7 +2197,7 @@ const Te = {
3099
2197
  },
3100
2198
  selectionIcon: {
3101
2199
  color: r.black[500],
3102
- svg: x.check
2200
+ svg: f.check
3103
2201
  }
3104
2202
  }
3105
2203
  },
@@ -3107,7 +2205,7 @@ const Te = {
3107
2205
  button: {
3108
2206
  icon: {
3109
2207
  color: r.black[500],
3110
- svg: x.filter
2208
+ svg: f.filter
3111
2209
  },
3112
2210
  backgroundColor: "transparent",
3113
2211
  hoverBackgroundColor: r.black[50010],
@@ -3116,14 +2214,14 @@ const Te = {
3116
2214
  inbox: {
3117
2215
  icon: {
3118
2216
  color: r.black[500],
3119
- svg: x.inbox
2217
+ svg: f.inbox
3120
2218
  },
3121
2219
  text: "Inbox"
3122
2220
  },
3123
2221
  archive: {
3124
2222
  icon: {
3125
2223
  color: r.black[500],
3126
- svg: x.archive
2224
+ svg: f.archive
3127
2225
  },
3128
2226
  text: "Archive"
3129
2227
  }
@@ -3132,7 +2230,7 @@ const Te = {
3132
2230
  button: {
3133
2231
  icon: {
3134
2232
  color: r.black[500],
3135
- svg: x.overflow
2233
+ svg: f.overflow
3136
2234
  },
3137
2235
  backgroundColor: "transparent",
3138
2236
  hoverBackgroundColor: r.black[50010],
@@ -3141,21 +2239,21 @@ const Te = {
3141
2239
  markAllRead: {
3142
2240
  icon: {
3143
2241
  color: r.black[500],
3144
- svg: x.read
2242
+ svg: f.read
3145
2243
  },
3146
2244
  text: "Mark All as Read"
3147
2245
  },
3148
2246
  archiveAll: {
3149
2247
  icon: {
3150
2248
  color: r.black[500],
3151
- svg: x.archive
2249
+ svg: f.archive
3152
2250
  },
3153
2251
  text: "Archive All"
3154
2252
  },
3155
2253
  archiveRead: {
3156
2254
  icon: {
3157
2255
  color: r.black[500],
3158
- svg: x.archiveRead
2256
+ svg: f.archiveRead
3159
2257
  },
3160
2258
  text: "Archive Read"
3161
2259
  }
@@ -3214,19 +2312,19 @@ const Te = {
3214
2312
  borderRadius: "0px",
3215
2313
  read: {
3216
2314
  color: r.black[500],
3217
- svg: x.read
2315
+ svg: f.read
3218
2316
  },
3219
2317
  unread: {
3220
2318
  color: r.black[500],
3221
- svg: x.unread
2319
+ svg: f.unread
3222
2320
  },
3223
2321
  archive: {
3224
2322
  color: r.black[500],
3225
- svg: x.archive
2323
+ svg: f.archive
3226
2324
  },
3227
2325
  unarchive: {
3228
2326
  color: r.black[500],
3229
- svg: x.unarchive
2327
+ svg: f.unarchive
3230
2328
  }
3231
2329
  }
3232
2330
  }
@@ -3266,12 +2364,12 @@ const Te = {
3266
2364
  }
3267
2365
  }
3268
2366
  }
3269
- }, Oe = {
2367
+ }, Ae = {
3270
2368
  popup: {
3271
2369
  button: {
3272
2370
  icon: {
3273
2371
  color: r.white[500],
3274
- svg: x.inbox
2372
+ svg: f.inbox
3275
2373
  },
3276
2374
  backgroundColor: "transparent",
3277
2375
  hoverBackgroundColor: r.white[50010],
@@ -3307,14 +2405,14 @@ const Te = {
3307
2405
  inbox: {
3308
2406
  icon: {
3309
2407
  color: r.white[500],
3310
- svg: x.inbox
2408
+ svg: f.inbox
3311
2409
  },
3312
2410
  text: "Inbox"
3313
2411
  },
3314
2412
  archive: {
3315
2413
  icon: {
3316
2414
  color: r.white[500],
3317
- svg: x.archive
2415
+ svg: f.archive
3318
2416
  },
3319
2417
  text: "Archive"
3320
2418
  },
@@ -3345,7 +2443,7 @@ const Te = {
3345
2443
  },
3346
2444
  selectionIcon: {
3347
2445
  color: r.white[500],
3348
- svg: x.check
2446
+ svg: f.check
3349
2447
  }
3350
2448
  }
3351
2449
  },
@@ -3353,7 +2451,7 @@ const Te = {
3353
2451
  button: {
3354
2452
  icon: {
3355
2453
  color: r.white[500],
3356
- svg: x.filter
2454
+ svg: f.filter
3357
2455
  },
3358
2456
  backgroundColor: "transparent",
3359
2457
  hoverBackgroundColor: r.white[50010],
@@ -3362,14 +2460,14 @@ const Te = {
3362
2460
  inbox: {
3363
2461
  icon: {
3364
2462
  color: r.white[500],
3365
- svg: x.inbox
2463
+ svg: f.inbox
3366
2464
  },
3367
2465
  text: "Inbox"
3368
2466
  },
3369
2467
  archive: {
3370
2468
  icon: {
3371
2469
  color: r.white[500],
3372
- svg: x.archive
2470
+ svg: f.archive
3373
2471
  },
3374
2472
  text: "Archive"
3375
2473
  }
@@ -3378,7 +2476,7 @@ const Te = {
3378
2476
  button: {
3379
2477
  icon: {
3380
2478
  color: r.white[500],
3381
- svg: x.overflow
2479
+ svg: f.overflow
3382
2480
  },
3383
2481
  backgroundColor: "transparent",
3384
2482
  hoverBackgroundColor: r.white[50010],
@@ -3387,21 +2485,21 @@ const Te = {
3387
2485
  markAllRead: {
3388
2486
  icon: {
3389
2487
  color: r.white[500],
3390
- svg: x.read
2488
+ svg: f.read
3391
2489
  },
3392
2490
  text: "Mark All as Read"
3393
2491
  },
3394
2492
  archiveAll: {
3395
2493
  icon: {
3396
2494
  color: r.white[500],
3397
- svg: x.archive
2495
+ svg: f.archive
3398
2496
  },
3399
2497
  text: "Archive All"
3400
2498
  },
3401
2499
  archiveRead: {
3402
2500
  icon: {
3403
2501
  color: r.white[500],
3404
- svg: x.archiveRead
2502
+ svg: f.archiveRead
3405
2503
  },
3406
2504
  text: "Archive Read"
3407
2505
  }
@@ -3460,19 +2558,19 @@ const Te = {
3460
2558
  borderRadius: "0px",
3461
2559
  read: {
3462
2560
  color: r.white[500],
3463
- svg: x.read
2561
+ svg: f.read
3464
2562
  },
3465
2563
  unread: {
3466
2564
  color: r.white[500],
3467
- svg: x.unread
2565
+ svg: f.unread
3468
2566
  },
3469
2567
  archive: {
3470
2568
  color: r.white[500],
3471
- svg: x.archive
2569
+ svg: f.archive
3472
2570
  },
3473
2571
  unarchive: {
3474
2572
  color: r.white[500],
3475
- svg: x.unarchive
2573
+ svg: f.unarchive
3476
2574
  }
3477
2575
  }
3478
2576
  }
@@ -3512,195 +2610,195 @@ const Te = {
3512
2610
  }
3513
2611
  }
3514
2612
  }
3515
- }, dn = (h, t) => {
3516
- var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I, E, M, L, R, D, y, A, F, H, O, z, U, N, q, V, j, X, Q, Y, ee, G, ae, he, ce, le, de, ue, pe, ge, me, be, _e, fe, xe, ve, Ce, ye, ke, we, Se, Ie, u, B, te, ie, J, Ee, Ve, je, Ze, Je, Ge, We, Ke, Xe, Qe, Ye, et, tt, it, st, ot, nt, rt, at, ht, ct, lt, dt, ut, pt, gt, mt, bt, _t, ft, xt, vt, Ct, yt, kt, wt, St, It, Et, Mt, Tt, $t, Lt, At, Pt, Bt, Rt, Dt, Ft, Ht, Ot, zt, Ut, Nt, qt, Vt, jt, Zt, Jt, Gt, Wt, Kt, Xt, Qt, Yt, ei, ti, ii, si, oi, ni, ri, ai, hi, ci, li, di, ui, pi, gi, mi, bi, _i, fi, xi, vi, Ci, yi, ki, wi, Si, Ii, Ei, Mi, Ti, $i, Li, Ai, Pi, Bi, Ri, Di, Fi, Hi, Oi, zi, Ui, Ni, qi, Vi, ji, Zi, Ji, Gi, Wi, Ki, Xi, Qi, Yi, es, ts, is, ss, os, ns, rs, as, hs, cs, ls, ds, us, ps, gs, ms, bs, _s, fs, xs, vs, Cs, ys, ks, ws, Ss, Is, Es, Ms, Ts, $s, Ls, As, Ps, Bs, Rs, Ds, Fs, Hs, Os, zs, Us, Ns, qs, Vs, js, Zs, Js, Gs, Ws, Ks, Xs, Qs, Ys, eo, to, io, so, oo, no, ro, ao, ho, co, lo, uo, po, go, mo, bo, _o, fo, xo, vo, Co;
3517
- const e = h === "light" ? Te : Oe;
2613
+ }, $o = (g, i) => {
2614
+ var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M, E, I, T, P, $, y, B, F, H, R, z, O, N, U, V, Z, J, q, X, Y, j, se, oe, ne, re, ae, he, ce, le, de, ue, pe, ge, me, be, _e, xe, fe, Ce, ve, ye, l, D, K, Q, W, ke, Fe, He, Re, ze, Oe, Ne, Ue, Ve, Ze, We, je, Ge, Je, qe, Xe, Ye, Ke, Qe, et, tt, it, st, ot, nt, rt, at, ht, ct, lt, dt, ut, pt, gt, mt, bt, _t, xt, ft, Ct, vt, yt, kt, wt, St, Mt, Et, It, Lt, Tt, Bt, At, Dt, Pt, $t, Ft, Ht, Rt, zt, Ot, Nt, Ut, Vt, Zt, Wt, jt, Gt, Jt, qt, Xt, Yt, Kt, Qt, ei, ti, ii, si, oi, ni, ri, ai, hi, ci, li, di, ui, pi, gi, mi, bi, _i, xi, fi, Ci, vi, yi, ki, wi, Si, Mi, Ei, Ii, Li, Ti, Bi, Ai, Di, Pi, $i, Fi, Hi, Ri, zi, Oi, Ni, Ui, Vi, Zi, Wi, ji, Gi, Ji, qi, Xi, Yi, Ki, Qi, es, ts, is, ss, os, ns, rs, as, hs, cs, ls, ds, us, ps, gs, ms, bs, _s, xs, fs, Cs, vs, ys, ks, ws, Ss, Ms, Es, Is, Ls, Ts, Bs, As, Ds, Ps, $s, Fs, Hs, Rs, zs, Os, Ns, Us, Vs, Zs, Ws, js, Gs, Js, qs, Xs, Ys, Ks, Qs, eo, to, io, so, oo, no, ro, ao, ho, co, lo, uo, po;
2615
+ const e = g === "light" ? we : Ae;
3518
2616
  return {
3519
2617
  popup: {
3520
2618
  button: {
3521
- ...(i = e.popup) == null ? void 0 : i.button,
3522
- ...(s = t.popup) == null ? void 0 : s.button,
2619
+ ...(t = e.popup) == null ? void 0 : t.button,
2620
+ ...(s = i.popup) == null ? void 0 : s.button,
3523
2621
  icon: {
3524
2622
  ...(n = (o = e.popup) == null ? void 0 : o.button) == null ? void 0 : n.icon,
3525
- ...(d = (c = t.popup) == null ? void 0 : c.button) == null ? void 0 : d.icon
2623
+ ...(d = (h = i.popup) == null ? void 0 : h.button) == null ? void 0 : d.icon
3526
2624
  },
3527
2625
  unreadIndicator: {
3528
- ...(p = (l = e.popup) == null ? void 0 : l.button) == null ? void 0 : p.unreadIndicator,
3529
- ...(g = (m = t.popup) == null ? void 0 : m.button) == null ? void 0 : g.unreadIndicator
2626
+ ...(u = (c = e.popup) == null ? void 0 : c.button) == null ? void 0 : u.unreadIndicator,
2627
+ ...(p = (m = i.popup) == null ? void 0 : m.button) == null ? void 0 : p.unreadIndicator
3530
2628
  }
3531
2629
  },
3532
2630
  window: {
3533
- ...(f = e.popup) == null ? void 0 : f.window,
3534
- ...(_ = t.popup) == null ? void 0 : _.window
2631
+ ...(x = e.popup) == null ? void 0 : x.window,
2632
+ ...(_ = i.popup) == null ? void 0 : _.window
3535
2633
  }
3536
2634
  },
3537
2635
  inbox: {
3538
2636
  header: {
3539
2637
  ...(b = e.inbox) == null ? void 0 : b.header,
3540
- ...(C = t.inbox) == null ? void 0 : C.header,
2638
+ ...(v = i.inbox) == null ? void 0 : v.header,
3541
2639
  filters: {
3542
2640
  ...(w = (k = e.inbox) == null ? void 0 : k.header) == null ? void 0 : w.filters,
3543
- ...(I = (S = t.inbox) == null ? void 0 : S.header) == null ? void 0 : I.filters,
2641
+ ...(M = (S = i.inbox) == null ? void 0 : S.header) == null ? void 0 : M.filters,
3544
2642
  inbox: {
3545
- ...(L = (M = (E = e.inbox) == null ? void 0 : E.header) == null ? void 0 : M.filters) == null ? void 0 : L.inbox,
3546
- ...(y = (D = (R = t.inbox) == null ? void 0 : R.header) == null ? void 0 : D.filters) == null ? void 0 : y.inbox,
2643
+ ...(T = (I = (E = e.inbox) == null ? void 0 : E.header) == null ? void 0 : I.filters) == null ? void 0 : T.inbox,
2644
+ ...(y = ($ = (P = i.inbox) == null ? void 0 : P.header) == null ? void 0 : $.filters) == null ? void 0 : y.inbox,
3547
2645
  icon: {
3548
- ...(O = (H = (F = (A = e.inbox) == null ? void 0 : A.header) == null ? void 0 : F.filters) == null ? void 0 : H.inbox) == null ? void 0 : O.icon,
3549
- ...(q = (N = (U = (z = t.inbox) == null ? void 0 : z.header) == null ? void 0 : U.filters) == null ? void 0 : N.inbox) == null ? void 0 : q.icon
2646
+ ...(R = (H = (F = (B = e.inbox) == null ? void 0 : B.header) == null ? void 0 : F.filters) == null ? void 0 : H.inbox) == null ? void 0 : R.icon,
2647
+ ...(U = (N = (O = (z = i.inbox) == null ? void 0 : z.header) == null ? void 0 : O.filters) == null ? void 0 : N.inbox) == null ? void 0 : U.icon
3550
2648
  }
3551
2649
  },
3552
2650
  archive: {
3553
- ...(X = (j = (V = e.inbox) == null ? void 0 : V.header) == null ? void 0 : j.filters) == null ? void 0 : X.archive,
3554
- ...(ee = (Y = (Q = t.inbox) == null ? void 0 : Q.header) == null ? void 0 : Y.filters) == null ? void 0 : ee.archive,
2651
+ ...(J = (Z = (V = e.inbox) == null ? void 0 : V.header) == null ? void 0 : Z.filters) == null ? void 0 : J.archive,
2652
+ ...(Y = (X = (q = i.inbox) == null ? void 0 : q.header) == null ? void 0 : X.filters) == null ? void 0 : Y.archive,
3555
2653
  icon: {
3556
- ...(ce = (he = (ae = (G = e.inbox) == null ? void 0 : G.header) == null ? void 0 : ae.filters) == null ? void 0 : he.archive) == null ? void 0 : ce.icon,
3557
- ...(pe = (ue = (de = (le = t.inbox) == null ? void 0 : le.header) == null ? void 0 : de.filters) == null ? void 0 : ue.archive) == null ? void 0 : pe.icon
2654
+ ...(ne = (oe = (se = (j = e.inbox) == null ? void 0 : j.header) == null ? void 0 : se.filters) == null ? void 0 : oe.archive) == null ? void 0 : ne.icon,
2655
+ ...(ce = (he = (ae = (re = i.inbox) == null ? void 0 : re.header) == null ? void 0 : ae.filters) == null ? void 0 : he.archive) == null ? void 0 : ce.icon
3558
2656
  }
3559
2657
  },
3560
2658
  unreadIndicator: {
3561
- ...(be = (me = (ge = e.inbox) == null ? void 0 : ge.header) == null ? void 0 : me.filters) == null ? void 0 : be.unreadIndicator,
3562
- ...(xe = (fe = (_e = t.inbox) == null ? void 0 : _e.header) == null ? void 0 : fe.filters) == null ? void 0 : xe.unreadIndicator
2659
+ ...(ue = (de = (le = e.inbox) == null ? void 0 : le.header) == null ? void 0 : de.filters) == null ? void 0 : ue.unreadIndicator,
2660
+ ...(me = (ge = (pe = i.inbox) == null ? void 0 : pe.header) == null ? void 0 : ge.filters) == null ? void 0 : me.unreadIndicator
3563
2661
  }
3564
2662
  },
3565
2663
  menus: {
3566
- ...(Ce = (ve = e.inbox) == null ? void 0 : ve.header) == null ? void 0 : Ce.menus,
3567
- ...(ke = (ye = t.inbox) == null ? void 0 : ye.header) == null ? void 0 : ke.menus,
2664
+ ...(_e = (be = e.inbox) == null ? void 0 : be.header) == null ? void 0 : _e.menus,
2665
+ ...(fe = (xe = i.inbox) == null ? void 0 : xe.header) == null ? void 0 : fe.menus,
3568
2666
  popup: {
3569
- ...(Ie = (Se = (we = e.inbox) == null ? void 0 : we.header) == null ? void 0 : Se.menus) == null ? void 0 : Ie.popup,
3570
- ...(te = (B = (u = t.inbox) == null ? void 0 : u.header) == null ? void 0 : B.menus) == null ? void 0 : te.popup,
2667
+ ...(ye = (ve = (Ce = e.inbox) == null ? void 0 : Ce.header) == null ? void 0 : ve.menus) == null ? void 0 : ye.popup,
2668
+ ...(K = (D = (l = i.inbox) == null ? void 0 : l.header) == null ? void 0 : D.menus) == null ? void 0 : K.popup,
3571
2669
  list: {
3572
- ...(Ve = (Ee = (J = (ie = e.inbox) == null ? void 0 : ie.header) == null ? void 0 : J.menus) == null ? void 0 : Ee.popup) == null ? void 0 : Ve.list,
3573
- ...(Ge = (Je = (Ze = (je = t.inbox) == null ? void 0 : je.header) == null ? void 0 : Ze.menus) == null ? void 0 : Je.popup) == null ? void 0 : Ge.list,
2670
+ ...(Fe = (ke = (W = (Q = e.inbox) == null ? void 0 : Q.header) == null ? void 0 : W.menus) == null ? void 0 : ke.popup) == null ? void 0 : Fe.list,
2671
+ ...(Oe = (ze = (Re = (He = i.inbox) == null ? void 0 : He.header) == null ? void 0 : Re.menus) == null ? void 0 : ze.popup) == null ? void 0 : Oe.list,
3574
2672
  font: {
3575
- ...(Ye = (Qe = (Xe = (Ke = (We = e.inbox) == null ? void 0 : We.header) == null ? void 0 : Ke.menus) == null ? void 0 : Xe.popup) == null ? void 0 : Qe.list) == null ? void 0 : Ye.font,
3576
- ...(ot = (st = (it = (tt = (et = t.inbox) == null ? void 0 : et.header) == null ? void 0 : tt.menus) == null ? void 0 : it.popup) == null ? void 0 : st.list) == null ? void 0 : ot.font
2673
+ ...(We = (Ze = (Ve = (Ue = (Ne = e.inbox) == null ? void 0 : Ne.header) == null ? void 0 : Ue.menus) == null ? void 0 : Ve.popup) == null ? void 0 : Ze.list) == null ? void 0 : We.font,
2674
+ ...(Xe = (qe = (Je = (Ge = (je = i.inbox) == null ? void 0 : je.header) == null ? void 0 : Ge.menus) == null ? void 0 : Je.popup) == null ? void 0 : qe.list) == null ? void 0 : Xe.font
3577
2675
  },
3578
2676
  selectionIcon: {
3579
- ...(ct = (ht = (at = (rt = (nt = e.inbox) == null ? void 0 : nt.header) == null ? void 0 : rt.menus) == null ? void 0 : at.popup) == null ? void 0 : ht.list) == null ? void 0 : ct.selectionIcon,
3580
- ...(gt = (pt = (ut = (dt = (lt = t.inbox) == null ? void 0 : lt.header) == null ? void 0 : dt.menus) == null ? void 0 : ut.popup) == null ? void 0 : pt.list) == null ? void 0 : gt.selectionIcon
2677
+ ...(tt = (et = (Qe = (Ke = (Ye = e.inbox) == null ? void 0 : Ye.header) == null ? void 0 : Ke.menus) == null ? void 0 : Qe.popup) == null ? void 0 : et.list) == null ? void 0 : tt.selectionIcon,
2678
+ ...(rt = (nt = (ot = (st = (it = i.inbox) == null ? void 0 : it.header) == null ? void 0 : st.menus) == null ? void 0 : ot.popup) == null ? void 0 : nt.list) == null ? void 0 : rt.selectionIcon
3581
2679
  }
3582
2680
  }
3583
2681
  },
3584
2682
  filters: {
3585
- ...(_t = (bt = (mt = e.inbox) == null ? void 0 : mt.header) == null ? void 0 : bt.menus) == null ? void 0 : _t.filters,
3586
- ...(vt = (xt = (ft = t.inbox) == null ? void 0 : ft.header) == null ? void 0 : xt.menus) == null ? void 0 : vt.filters,
2683
+ ...(ct = (ht = (at = e.inbox) == null ? void 0 : at.header) == null ? void 0 : ht.menus) == null ? void 0 : ct.filters,
2684
+ ...(ut = (dt = (lt = i.inbox) == null ? void 0 : lt.header) == null ? void 0 : dt.menus) == null ? void 0 : ut.filters,
3587
2685
  inbox: {
3588
- ...(wt = (kt = (yt = (Ct = e.inbox) == null ? void 0 : Ct.header) == null ? void 0 : yt.menus) == null ? void 0 : kt.filters) == null ? void 0 : wt.inbox,
3589
- ...(Mt = (Et = (It = (St = t.inbox) == null ? void 0 : St.header) == null ? void 0 : It.menus) == null ? void 0 : Et.filters) == null ? void 0 : Mt.inbox,
2686
+ ...(bt = (mt = (gt = (pt = e.inbox) == null ? void 0 : pt.header) == null ? void 0 : gt.menus) == null ? void 0 : mt.filters) == null ? void 0 : bt.inbox,
2687
+ ...(Ct = (ft = (xt = (_t = i.inbox) == null ? void 0 : _t.header) == null ? void 0 : xt.menus) == null ? void 0 : ft.filters) == null ? void 0 : Ct.inbox,
3590
2688
  icon: {
3591
- ...(Pt = (At = (Lt = ($t = (Tt = e.inbox) == null ? void 0 : Tt.header) == null ? void 0 : $t.menus) == null ? void 0 : Lt.filters) == null ? void 0 : At.inbox) == null ? void 0 : Pt.icon,
3592
- ...(Ht = (Ft = (Dt = (Rt = (Bt = t.inbox) == null ? void 0 : Bt.header) == null ? void 0 : Rt.menus) == null ? void 0 : Dt.filters) == null ? void 0 : Ft.inbox) == null ? void 0 : Ht.icon
2689
+ ...(St = (wt = (kt = (yt = (vt = e.inbox) == null ? void 0 : vt.header) == null ? void 0 : yt.menus) == null ? void 0 : kt.filters) == null ? void 0 : wt.inbox) == null ? void 0 : St.icon,
2690
+ ...(Tt = (Lt = (It = (Et = (Mt = i.inbox) == null ? void 0 : Mt.header) == null ? void 0 : Et.menus) == null ? void 0 : It.filters) == null ? void 0 : Lt.inbox) == null ? void 0 : Tt.icon
3593
2691
  }
3594
2692
  },
3595
2693
  archive: {
3596
- ...(Nt = (Ut = (zt = (Ot = e.inbox) == null ? void 0 : Ot.header) == null ? void 0 : zt.menus) == null ? void 0 : Ut.filters) == null ? void 0 : Nt.archive,
3597
- ...(Zt = (jt = (Vt = (qt = t.inbox) == null ? void 0 : qt.header) == null ? void 0 : Vt.menus) == null ? void 0 : jt.filters) == null ? void 0 : Zt.archive,
2694
+ ...(Pt = (Dt = (At = (Bt = e.inbox) == null ? void 0 : Bt.header) == null ? void 0 : At.menus) == null ? void 0 : Dt.filters) == null ? void 0 : Pt.archive,
2695
+ ...(Rt = (Ht = (Ft = ($t = i.inbox) == null ? void 0 : $t.header) == null ? void 0 : Ft.menus) == null ? void 0 : Ht.filters) == null ? void 0 : Rt.archive,
3598
2696
  icon: {
3599
- ...(Xt = (Kt = (Wt = (Gt = (Jt = e.inbox) == null ? void 0 : Jt.header) == null ? void 0 : Gt.menus) == null ? void 0 : Wt.filters) == null ? void 0 : Kt.archive) == null ? void 0 : Xt.icon,
3600
- ...(ii = (ti = (ei = (Yt = (Qt = t.inbox) == null ? void 0 : Qt.header) == null ? void 0 : Yt.menus) == null ? void 0 : ei.filters) == null ? void 0 : ti.archive) == null ? void 0 : ii.icon
2697
+ ...(Vt = (Ut = (Nt = (Ot = (zt = e.inbox) == null ? void 0 : zt.header) == null ? void 0 : Ot.menus) == null ? void 0 : Nt.filters) == null ? void 0 : Ut.archive) == null ? void 0 : Vt.icon,
2698
+ ...(Jt = (Gt = (jt = (Wt = (Zt = i.inbox) == null ? void 0 : Zt.header) == null ? void 0 : Wt.menus) == null ? void 0 : jt.filters) == null ? void 0 : Gt.archive) == null ? void 0 : Jt.icon
3601
2699
  }
3602
2700
  }
3603
2701
  },
3604
2702
  actions: {
3605
- ...(ni = (oi = (si = e.inbox) == null ? void 0 : si.header) == null ? void 0 : oi.menus) == null ? void 0 : ni.actions,
3606
- ...(hi = (ai = (ri = t.inbox) == null ? void 0 : ri.header) == null ? void 0 : ai.menus) == null ? void 0 : hi.actions,
2703
+ ...(Yt = (Xt = (qt = e.inbox) == null ? void 0 : qt.header) == null ? void 0 : Xt.menus) == null ? void 0 : Yt.actions,
2704
+ ...(ei = (Qt = (Kt = i.inbox) == null ? void 0 : Kt.header) == null ? void 0 : Qt.menus) == null ? void 0 : ei.actions,
3607
2705
  markAllRead: {
3608
- ...(ui = (di = (li = (ci = e.inbox) == null ? void 0 : ci.header) == null ? void 0 : li.menus) == null ? void 0 : di.actions) == null ? void 0 : ui.markAllRead,
3609
- ...(bi = (mi = (gi = (pi = t.inbox) == null ? void 0 : pi.header) == null ? void 0 : gi.menus) == null ? void 0 : mi.actions) == null ? void 0 : bi.markAllRead,
2706
+ ...(oi = (si = (ii = (ti = e.inbox) == null ? void 0 : ti.header) == null ? void 0 : ii.menus) == null ? void 0 : si.actions) == null ? void 0 : oi.markAllRead,
2707
+ ...(hi = (ai = (ri = (ni = i.inbox) == null ? void 0 : ni.header) == null ? void 0 : ri.menus) == null ? void 0 : ai.actions) == null ? void 0 : hi.markAllRead,
3610
2708
  icon: {
3611
- ...(Ci = (vi = (xi = (fi = (_i = e.inbox) == null ? void 0 : _i.header) == null ? void 0 : fi.menus) == null ? void 0 : xi.actions) == null ? void 0 : vi.markAllRead) == null ? void 0 : Ci.icon,
3612
- ...(Ii = (Si = (wi = (ki = (yi = t.inbox) == null ? void 0 : yi.header) == null ? void 0 : ki.menus) == null ? void 0 : wi.actions) == null ? void 0 : Si.markAllRead) == null ? void 0 : Ii.icon
2709
+ ...(pi = (ui = (di = (li = (ci = e.inbox) == null ? void 0 : ci.header) == null ? void 0 : li.menus) == null ? void 0 : di.actions) == null ? void 0 : ui.markAllRead) == null ? void 0 : pi.icon,
2710
+ ...(xi = (_i = (bi = (mi = (gi = i.inbox) == null ? void 0 : gi.header) == null ? void 0 : mi.menus) == null ? void 0 : bi.actions) == null ? void 0 : _i.markAllRead) == null ? void 0 : xi.icon
3613
2711
  }
3614
2712
  },
3615
2713
  archiveAll: {
3616
- ...($i = (Ti = (Mi = (Ei = e.inbox) == null ? void 0 : Ei.header) == null ? void 0 : Mi.menus) == null ? void 0 : Ti.actions) == null ? void 0 : $i.archiveAll,
3617
- ...(Bi = (Pi = (Ai = (Li = t.inbox) == null ? void 0 : Li.header) == null ? void 0 : Ai.menus) == null ? void 0 : Pi.actions) == null ? void 0 : Bi.archiveAll,
2714
+ ...(yi = (vi = (Ci = (fi = e.inbox) == null ? void 0 : fi.header) == null ? void 0 : Ci.menus) == null ? void 0 : vi.actions) == null ? void 0 : yi.archiveAll,
2715
+ ...(Mi = (Si = (wi = (ki = i.inbox) == null ? void 0 : ki.header) == null ? void 0 : wi.menus) == null ? void 0 : Si.actions) == null ? void 0 : Mi.archiveAll,
3618
2716
  icon: {
3619
- ...(Oi = (Hi = (Fi = (Di = (Ri = e.inbox) == null ? void 0 : Ri.header) == null ? void 0 : Di.menus) == null ? void 0 : Fi.actions) == null ? void 0 : Hi.archiveAll) == null ? void 0 : Oi.icon,
3620
- ...(Vi = (qi = (Ni = (Ui = (zi = t.inbox) == null ? void 0 : zi.header) == null ? void 0 : Ui.menus) == null ? void 0 : Ni.actions) == null ? void 0 : qi.archiveAll) == null ? void 0 : Vi.icon
2717
+ ...(Bi = (Ti = (Li = (Ii = (Ei = e.inbox) == null ? void 0 : Ei.header) == null ? void 0 : Ii.menus) == null ? void 0 : Li.actions) == null ? void 0 : Ti.archiveAll) == null ? void 0 : Bi.icon,
2718
+ ...(Fi = ($i = (Pi = (Di = (Ai = i.inbox) == null ? void 0 : Ai.header) == null ? void 0 : Di.menus) == null ? void 0 : Pi.actions) == null ? void 0 : $i.archiveAll) == null ? void 0 : Fi.icon
3621
2719
  }
3622
2720
  },
3623
2721
  archiveRead: {
3624
- ...(Gi = (Ji = (Zi = (ji = e.inbox) == null ? void 0 : ji.header) == null ? void 0 : Zi.menus) == null ? void 0 : Ji.actions) == null ? void 0 : Gi.archiveRead,
3625
- ...(Qi = (Xi = (Ki = (Wi = t.inbox) == null ? void 0 : Wi.header) == null ? void 0 : Ki.menus) == null ? void 0 : Xi.actions) == null ? void 0 : Qi.archiveRead,
2722
+ ...(Oi = (zi = (Ri = (Hi = e.inbox) == null ? void 0 : Hi.header) == null ? void 0 : Ri.menus) == null ? void 0 : zi.actions) == null ? void 0 : Oi.archiveRead,
2723
+ ...(Zi = (Vi = (Ui = (Ni = i.inbox) == null ? void 0 : Ni.header) == null ? void 0 : Ui.menus) == null ? void 0 : Vi.actions) == null ? void 0 : Zi.archiveRead,
3626
2724
  icon: {
3627
- ...(ss = (is = (ts = (es = (Yi = e.inbox) == null ? void 0 : Yi.header) == null ? void 0 : es.menus) == null ? void 0 : ts.actions) == null ? void 0 : is.archiveRead) == null ? void 0 : ss.icon,
3628
- ...(hs = (as = (rs = (ns = (os = t.inbox) == null ? void 0 : os.header) == null ? void 0 : ns.menus) == null ? void 0 : rs.actions) == null ? void 0 : as.archiveRead) == null ? void 0 : hs.icon
2725
+ ...(qi = (Ji = (Gi = (ji = (Wi = e.inbox) == null ? void 0 : Wi.header) == null ? void 0 : ji.menus) == null ? void 0 : Gi.actions) == null ? void 0 : Ji.archiveRead) == null ? void 0 : qi.icon,
2726
+ ...(es = (Qi = (Ki = (Yi = (Xi = i.inbox) == null ? void 0 : Xi.header) == null ? void 0 : Yi.menus) == null ? void 0 : Ki.actions) == null ? void 0 : Qi.archiveRead) == null ? void 0 : es.icon
3629
2727
  }
3630
2728
  }
3631
2729
  }
3632
2730
  }
3633
2731
  },
3634
2732
  list: {
3635
- ...(cs = e.inbox) == null ? void 0 : cs.list,
3636
- ...(ls = t.inbox) == null ? void 0 : ls.list,
2733
+ ...(ts = e.inbox) == null ? void 0 : ts.list,
2734
+ ...(is = i.inbox) == null ? void 0 : is.list,
3637
2735
  item: {
3638
- ...(us = (ds = e.inbox) == null ? void 0 : ds.list) == null ? void 0 : us.item,
3639
- ...(gs = (ps = t.inbox) == null ? void 0 : ps.list) == null ? void 0 : gs.item,
2736
+ ...(os = (ss = e.inbox) == null ? void 0 : ss.list) == null ? void 0 : os.item,
2737
+ ...(rs = (ns = i.inbox) == null ? void 0 : ns.list) == null ? void 0 : rs.item,
3640
2738
  menu: {
3641
- ...(_s = (bs = (ms = e.inbox) == null ? void 0 : ms.list) == null ? void 0 : bs.item) == null ? void 0 : _s.menu,
3642
- ...(vs = (xs = (fs = t.inbox) == null ? void 0 : fs.list) == null ? void 0 : xs.item) == null ? void 0 : vs.menu,
2739
+ ...(cs = (hs = (as = e.inbox) == null ? void 0 : as.list) == null ? void 0 : hs.item) == null ? void 0 : cs.menu,
2740
+ ...(us = (ds = (ls = i.inbox) == null ? void 0 : ls.list) == null ? void 0 : ds.item) == null ? void 0 : us.menu,
3643
2741
  item: {
3644
- ...(ws = (ks = (ys = (Cs = e.inbox) == null ? void 0 : Cs.list) == null ? void 0 : ys.item) == null ? void 0 : ks.menu) == null ? void 0 : ws.item,
3645
- ...(Ms = (Es = (Is = (Ss = t.inbox) == null ? void 0 : Ss.list) == null ? void 0 : Is.item) == null ? void 0 : Es.menu) == null ? void 0 : Ms.item,
2742
+ ...(bs = (ms = (gs = (ps = e.inbox) == null ? void 0 : ps.list) == null ? void 0 : gs.item) == null ? void 0 : ms.menu) == null ? void 0 : bs.item,
2743
+ ...(Cs = (fs = (xs = (_s = i.inbox) == null ? void 0 : _s.list) == null ? void 0 : xs.item) == null ? void 0 : fs.menu) == null ? void 0 : Cs.item,
3646
2744
  read: {
3647
- ...(Ps = (As = (Ls = ($s = (Ts = e.inbox) == null ? void 0 : Ts.list) == null ? void 0 : $s.item) == null ? void 0 : Ls.menu) == null ? void 0 : As.item) == null ? void 0 : Ps.read,
3648
- ...(Hs = (Fs = (Ds = (Rs = (Bs = t.inbox) == null ? void 0 : Bs.list) == null ? void 0 : Rs.item) == null ? void 0 : Ds.menu) == null ? void 0 : Fs.item) == null ? void 0 : Hs.read
2745
+ ...(Ss = (ws = (ks = (ys = (vs = e.inbox) == null ? void 0 : vs.list) == null ? void 0 : ys.item) == null ? void 0 : ks.menu) == null ? void 0 : ws.item) == null ? void 0 : Ss.read,
2746
+ ...(Ts = (Ls = (Is = (Es = (Ms = i.inbox) == null ? void 0 : Ms.list) == null ? void 0 : Es.item) == null ? void 0 : Is.menu) == null ? void 0 : Ls.item) == null ? void 0 : Ts.read
3649
2747
  },
3650
2748
  unread: {
3651
- ...(qs = (Ns = (Us = (zs = (Os = e.inbox) == null ? void 0 : Os.list) == null ? void 0 : zs.item) == null ? void 0 : Us.menu) == null ? void 0 : Ns.item) == null ? void 0 : qs.unread,
3652
- ...(Gs = (Js = (Zs = (js = (Vs = t.inbox) == null ? void 0 : Vs.list) == null ? void 0 : js.item) == null ? void 0 : Zs.menu) == null ? void 0 : Js.item) == null ? void 0 : Gs.unread
2749
+ ...($s = (Ps = (Ds = (As = (Bs = e.inbox) == null ? void 0 : Bs.list) == null ? void 0 : As.item) == null ? void 0 : Ds.menu) == null ? void 0 : Ps.item) == null ? void 0 : $s.unread,
2750
+ ...(Os = (zs = (Rs = (Hs = (Fs = i.inbox) == null ? void 0 : Fs.list) == null ? void 0 : Hs.item) == null ? void 0 : Rs.menu) == null ? void 0 : zs.item) == null ? void 0 : Os.unread
3653
2751
  },
3654
2752
  archive: {
3655
- ...(Ys = (Qs = (Xs = (Ks = (Ws = e.inbox) == null ? void 0 : Ws.list) == null ? void 0 : Ks.item) == null ? void 0 : Xs.menu) == null ? void 0 : Qs.item) == null ? void 0 : Ys.archive,
3656
- ...(oo = (so = (io = (to = (eo = t.inbox) == null ? void 0 : eo.list) == null ? void 0 : to.item) == null ? void 0 : io.menu) == null ? void 0 : so.item) == null ? void 0 : oo.archive
2753
+ ...(Ws = (Zs = (Vs = (Us = (Ns = e.inbox) == null ? void 0 : Ns.list) == null ? void 0 : Us.item) == null ? void 0 : Vs.menu) == null ? void 0 : Zs.item) == null ? void 0 : Ws.archive,
2754
+ ...(Xs = (qs = (Js = (Gs = (js = i.inbox) == null ? void 0 : js.list) == null ? void 0 : Gs.item) == null ? void 0 : Js.menu) == null ? void 0 : qs.item) == null ? void 0 : Xs.archive
3657
2755
  },
3658
2756
  unarchive: {
3659
- ...(co = (ho = (ao = (ro = (no = e.inbox) == null ? void 0 : no.list) == null ? void 0 : ro.item) == null ? void 0 : ao.menu) == null ? void 0 : ho.item) == null ? void 0 : co.unarchive,
3660
- ...(mo = (go = (po = (uo = (lo = t.inbox) == null ? void 0 : lo.list) == null ? void 0 : uo.item) == null ? void 0 : po.menu) == null ? void 0 : go.item) == null ? void 0 : mo.unarchive
2757
+ ...(to = (eo = (Qs = (Ks = (Ys = e.inbox) == null ? void 0 : Ys.list) == null ? void 0 : Ks.item) == null ? void 0 : Qs.menu) == null ? void 0 : eo.item) == null ? void 0 : to.unarchive,
2758
+ ...(ro = (no = (oo = (so = (io = i.inbox) == null ? void 0 : io.list) == null ? void 0 : so.item) == null ? void 0 : oo.menu) == null ? void 0 : no.item) == null ? void 0 : ro.unarchive
3661
2759
  }
3662
2760
  }
3663
2761
  }
3664
2762
  }
3665
2763
  },
3666
2764
  loading: {
3667
- ...(bo = e.inbox) == null ? void 0 : bo.loading,
3668
- ...(_o = t.inbox) == null ? void 0 : _o.loading
2765
+ ...(ao = e.inbox) == null ? void 0 : ao.loading,
2766
+ ...(ho = i.inbox) == null ? void 0 : ho.loading
3669
2767
  },
3670
2768
  empty: {
3671
- ...(fo = e.inbox) == null ? void 0 : fo.empty,
3672
- ...(xo = t.inbox) == null ? void 0 : xo.empty
2769
+ ...(co = e.inbox) == null ? void 0 : co.empty,
2770
+ ...(lo = i.inbox) == null ? void 0 : lo.empty
3673
2771
  },
3674
2772
  error: {
3675
- ...(vo = e.inbox) == null ? void 0 : vo.error,
3676
- ...(Co = t.inbox) == null ? void 0 : Co.error
2773
+ ...(uo = e.inbox) == null ? void 0 : uo.error,
2774
+ ...(po = i.inbox) == null ? void 0 : po.error
3677
2775
  }
3678
2776
  }
3679
2777
  };
3680
2778
  };
3681
- class zo {
3682
- constructor(t) {
2779
+ class Mo {
2780
+ constructor(i) {
3683
2781
  // Event IDs
3684
2782
  a(this, "THEME_CHANGE_EVENT", "courier_inbox_theme_change");
3685
2783
  // State
3686
2784
  a(this, "_theme");
3687
- a(this, "_lightTheme", Te);
3688
- a(this, "_darkTheme", Oe);
2785
+ a(this, "_lightTheme", we);
2786
+ a(this, "_darkTheme", Ae);
3689
2787
  a(this, "_target");
3690
2788
  a(this, "_subscriptions", []);
3691
2789
  // System theme
3692
2790
  a(this, "_userMode");
3693
2791
  a(this, "_systemMode");
3694
2792
  a(this, "_systemThemeCleanup");
3695
- this._theme = t, this._target = new EventTarget(), this._userMode = "system", this._systemMode = Mo(), this.setLightTheme(Te), this.setDarkTheme(Oe), this._systemThemeCleanup = To((e) => {
2793
+ this._theme = i, this._target = new EventTarget(), this._userMode = "system", this._systemMode = go(), this.setLightTheme(we), this.setDarkTheme(Ae), this._systemThemeCleanup = mo((e) => {
3696
2794
  this._systemMode = e, this.updateTheme();
3697
2795
  });
3698
2796
  }
3699
- setLightTheme(t) {
3700
- this._lightTheme = t, this._systemMode === "light" && this.updateTheme();
2797
+ setLightTheme(i) {
2798
+ this._lightTheme = i, this._systemMode === "light" && this.updateTheme();
3701
2799
  }
3702
- setDarkTheme(t) {
3703
- this._darkTheme = t, this._systemMode === "dark" && this.updateTheme();
2800
+ setDarkTheme(i) {
2801
+ this._darkTheme = i, this._systemMode === "dark" && this.updateTheme();
3704
2802
  }
3705
2803
  /**
3706
2804
  * Get the current system theme
@@ -3718,53 +2816,53 @@ class zo {
3718
2816
  * Update the theme
3719
2817
  */
3720
2818
  updateTheme() {
3721
- const t = this._userMode === "system" ? this._systemMode : this._userMode, e = t === "light" ? this._lightTheme : this._darkTheme, i = dn(t, e);
3722
- this.setTheme(i);
2819
+ const i = this._userMode === "system" ? this._systemMode : this._userMode, e = i === "light" ? this._lightTheme : this._darkTheme, t = $o(i, e);
2820
+ this.setTheme(t);
3723
2821
  }
3724
2822
  /**
3725
2823
  * Set the theme and notify all listeners
3726
2824
  */
3727
- setTheme(t) {
3728
- t !== this._theme && (this._theme = t, this._target.dispatchEvent(new CustomEvent(this.THEME_CHANGE_EVENT, {
3729
- detail: { theme: t }
2825
+ setTheme(i) {
2826
+ i !== this._theme && (this._theme = i, this._target.dispatchEvent(new CustomEvent(this.THEME_CHANGE_EVENT, {
2827
+ detail: { theme: i }
3730
2828
  })));
3731
2829
  }
3732
2830
  /**
3733
2831
  * Set the mode and notify all listeners
3734
2832
  */
3735
- setMode(t) {
3736
- this._userMode = t, this.updateTheme();
2833
+ setMode(i) {
2834
+ this._userMode = i, this.updateTheme();
3737
2835
  }
3738
2836
  /**
3739
2837
  * Subscribe to theme changes
3740
2838
  * @param {Function} callback - Function to run when the theme changes
3741
2839
  * @returns {CourierInboxThemeSubscription} - Object with remove method to stop listening
3742
2840
  */
3743
- subscribe(t) {
2841
+ subscribe(i) {
3744
2842
  const e = new AbortController();
3745
2843
  this._target.addEventListener(this.THEME_CHANGE_EVENT, (s) => {
3746
- t(s.detail.theme);
2844
+ i(s.detail.theme);
3747
2845
  }, { signal: e.signal });
3748
- const i = {
2846
+ const t = {
3749
2847
  manager: this,
3750
2848
  unsubscribe: () => {
3751
2849
  e.abort();
3752
- const s = this._subscriptions.indexOf(i);
2850
+ const s = this._subscriptions.indexOf(t);
3753
2851
  s > -1 && this._subscriptions.splice(s, 1);
3754
2852
  }
3755
2853
  };
3756
- return this._subscriptions.push(i), i;
2854
+ return this._subscriptions.push(t), t;
3757
2855
  }
3758
2856
  /**
3759
2857
  * Clean up event listeners
3760
2858
  */
3761
2859
  cleanup() {
3762
- this._systemThemeCleanup && this._systemThemeCleanup(), this._subscriptions.forEach((t) => t.unsubscribe()), this._subscriptions = [];
2860
+ this._systemThemeCleanup && this._systemThemeCleanup(), this._subscriptions.forEach((i) => i.unsubscribe()), this._subscriptions = [];
3763
2861
  }
3764
2862
  }
3765
- class Uo extends HTMLElement {
2863
+ class Eo extends HTMLElement {
3766
2864
  constructor(e) {
3767
- var i;
2865
+ var t;
3768
2866
  super();
3769
2867
  // State
3770
2868
  a(this, "_currentFeed", "inbox");
@@ -3786,16 +2884,16 @@ class Uo extends HTMLElement {
3786
2884
  // Default props
3787
2885
  a(this, "_defaultProps", {
3788
2886
  title: "Inbox",
3789
- icon: x.inbox,
2887
+ icon: f.inbox,
3790
2888
  feedType: this._currentFeed,
3791
2889
  height: "768px"
3792
2890
  });
3793
- this._shadow = this.attachShadow({ mode: "open" }), this._themeManager = e ?? new zo(Te), this._header = new Ho({
2891
+ this._shadow = this.attachShadow({ mode: "open" }), this._themeManager = e ?? new Mo(we), this._header = new wo({
3794
2892
  themeManager: this._themeManager,
3795
2893
  onFeedTypeChange: (s) => {
3796
2894
  this.setFeedType(s);
3797
2895
  }
3798
- }), this._header.build(void 0), this._shadow.appendChild(this._header), this._list = new Ro({
2896
+ }), this._header.build(void 0), this._shadow.appendChild(this._header), this._list = new vo({
3799
2897
  themeManager: this._themeManager,
3800
2898
  onRefresh: () => {
3801
2899
  this.refresh();
@@ -3803,28 +2901,28 @@ class Uo extends HTMLElement {
3803
2901
  onPaginationTrigger: async (s) => {
3804
2902
  var o, n;
3805
2903
  try {
3806
- await P.shared.fetchNextPageOfMessages({
2904
+ await A.shared.fetchNextPageOfMessages({
3807
2905
  feedType: s
3808
2906
  });
3809
- } catch (c) {
3810
- (n = (o = v.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Failed to fetch next page of messages:", c);
2907
+ } catch (h) {
2908
+ (n = (o = C.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Failed to fetch next page of messages:", h);
3811
2909
  }
3812
2910
  },
3813
2911
  onMessageClick: (s, o) => {
3814
2912
  var n;
3815
- P.shared.clickMessage({ message: s }), this.dispatchEvent(new CustomEvent("message-click", {
2913
+ A.shared.clickMessage({ message: s }), this.dispatchEvent(new CustomEvent("message-click", {
3816
2914
  detail: { message: s, index: o },
3817
2915
  bubbles: !0,
3818
2916
  composed: !0
3819
2917
  })), (n = this._onMessageClick) == null || n.call(this, { message: s, index: o });
3820
2918
  },
3821
2919
  onMessageActionClick: (s, o, n) => {
3822
- var c;
2920
+ var h;
3823
2921
  this.dispatchEvent(new CustomEvent("message-action-click", {
3824
2922
  detail: { message: s, action: o, index: n },
3825
2923
  bubbles: !0,
3826
2924
  composed: !0
3827
- })), (c = this._onMessageActionClick) == null || c.call(this, { message: s, action: o, index: n });
2925
+ })), (h = this._onMessageActionClick) == null || h.call(this, { message: s, action: o, index: n });
3828
2926
  },
3829
2927
  onMessageLongPress: (s, o) => {
3830
2928
  var n;
@@ -3834,7 +2932,7 @@ class Uo extends HTMLElement {
3834
2932
  composed: !0
3835
2933
  })), (n = this._onMessageLongPress) == null || n.call(this, { message: s, index: o });
3836
2934
  }
3837
- }), this._style = document.createElement("style"), this.refreshTheme(), this._shadow.appendChild(this._style), this._shadow.appendChild(this._list), this._datastoreListener = new Oo({
2935
+ }), this._style = document.createElement("style"), this.refreshTheme(), this._shadow.appendChild(this._style), this._shadow.appendChild(this._list), this._datastoreListener = new So({
3838
2936
  onError: (s) => {
3839
2937
  this._list.setError(s);
3840
2938
  },
@@ -3856,11 +2954,11 @@ class Uo extends HTMLElement {
3856
2954
  onUnreadCountChange: (s) => {
3857
2955
  this.updateHeader();
3858
2956
  }
3859
- }), P.shared.addDataStoreListener(this._datastoreListener), this._themeManager.subscribe((s) => {
2957
+ }), A.shared.addDataStoreListener(this._datastoreListener), this._themeManager.subscribe((s) => {
3860
2958
  this.refreshTheme();
3861
- }), this._authListener = v.shared.addAuthenticationListener((s) => {
2959
+ }), this._authListener = C.shared.addAuthenticationListener((s) => {
3862
2960
  this.refresh();
3863
- }), (i = v.shared.client) != null && i.options.userId && this.refresh();
2961
+ }), (t = C.shared.client) != null && t.options.userId && this.refresh();
3864
2962
  }
3865
2963
  get theme() {
3866
2964
  return this._themeManager.getTheme();
@@ -3936,7 +3034,7 @@ class Uo extends HTMLElement {
3936
3034
  updateHeader() {
3937
3035
  const e = {
3938
3036
  feedType: this._currentFeed,
3939
- unreadCount: P.shared.unreadCount,
3037
+ unreadCount: A.shared.unreadCount,
3940
3038
  messageCount: this._list.messages.length
3941
3039
  };
3942
3040
  switch (this._headerFactory) {
@@ -3947,13 +3045,13 @@ class Uo extends HTMLElement {
3947
3045
  this._header.build(null);
3948
3046
  break;
3949
3047
  default:
3950
- const i = this._headerFactory(e);
3951
- this._header.build(i);
3048
+ const t = this._headerFactory(e);
3049
+ this._header.build(t);
3952
3050
  break;
3953
3051
  }
3954
3052
  }
3955
3053
  async load(e) {
3956
- await P.shared.load(e);
3054
+ await A.shared.load(e);
3957
3055
  }
3958
3056
  refresh() {
3959
3057
  this.load({
@@ -3965,12 +3063,12 @@ class Uo extends HTMLElement {
3965
3063
  this.refresh();
3966
3064
  }
3967
3065
  disconnectedCallback() {
3968
- var e, i;
3969
- this._themeManager.cleanup(), (e = this._datastoreListener) == null || e.remove(), (i = this._authListener) == null || i.remove();
3066
+ var e, t;
3067
+ this._themeManager.cleanup(), (e = this._datastoreListener) == null || e.remove(), (t = this._authListener) == null || t.remove();
3970
3068
  }
3971
- attributeChangedCallback(e, i, s) {
3972
- var o, n, c, d, l, p;
3973
- if (i !== s)
3069
+ attributeChangedCallback(e, t, s) {
3070
+ var o, n, h, d, c, u;
3071
+ if (t !== s)
3974
3072
  switch (e) {
3975
3073
  case "height":
3976
3074
  const m = s || this._defaultProps.height;
@@ -3980,8 +3078,8 @@ class Uo extends HTMLElement {
3980
3078
  if (s)
3981
3079
  try {
3982
3080
  this._onMessageClick = new Function("props", s);
3983
- } catch (g) {
3984
- (n = (o = v.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Failed to parse message-click handler:", g);
3081
+ } catch (p) {
3082
+ (n = (o = C.shared.client) == null ? void 0 : o.options.logger) == null || n.error("Failed to parse message-click handler:", p);
3985
3083
  }
3986
3084
  else
3987
3085
  this._onMessageClick = void 0;
@@ -3990,8 +3088,8 @@ class Uo extends HTMLElement {
3990
3088
  if (s)
3991
3089
  try {
3992
3090
  this._onMessageActionClick = new Function("props", s);
3993
- } catch (g) {
3994
- (d = (c = v.shared.client) == null ? void 0 : c.options.logger) == null || d.error("Failed to parse message-action-click handler:", g);
3091
+ } catch (p) {
3092
+ (d = (h = C.shared.client) == null ? void 0 : h.options.logger) == null || d.error("Failed to parse message-action-click handler:", p);
3995
3093
  }
3996
3094
  else
3997
3095
  this._onMessageActionClick = void 0;
@@ -4000,8 +3098,8 @@ class Uo extends HTMLElement {
4000
3098
  if (s)
4001
3099
  try {
4002
3100
  this._onMessageLongPress = new Function("props", s);
4003
- } catch (g) {
4004
- (p = (l = v.shared.client) == null ? void 0 : l.options.logger) == null || p.error("Failed to parse message-long-press handler:", g);
3101
+ } catch (p) {
3102
+ (u = (c = C.shared.client) == null ? void 0 : c.options.logger) == null || u.error("Failed to parse message-long-press handler:", p);
4005
3103
  }
4006
3104
  else
4007
3105
  this._onMessageLongPress = void 0;
@@ -4018,8 +3116,8 @@ class Uo extends HTMLElement {
4018
3116
  }
4019
3117
  }
4020
3118
  }
4021
- customElements.get("courier-inbox") || customElements.define("courier-inbox", Uo);
4022
- class No extends De {
3119
+ customElements.get("courier-inbox") || customElements.define("courier-inbox", Eo);
3120
+ class Io extends Le {
4023
3121
  constructor(e) {
4024
3122
  super();
4025
3123
  // Theme
@@ -4028,12 +3126,12 @@ class No extends De {
4028
3126
  a(this, "_container");
4029
3127
  a(this, "_triggerButton");
4030
3128
  a(this, "_unreadCountBadge");
4031
- this._themeSubscription = e.subscribe((i) => {
3129
+ this._themeSubscription = e.subscribe((t) => {
4032
3130
  this.updateTheme();
4033
3131
  });
4034
3132
  }
4035
3133
  defaultElement() {
4036
- this._container = document.createElement("div"), this._container.className = "menu-button-container", this._triggerButton = new $e(x.inbox), this._unreadCountBadge = new qe({
3134
+ this._container = document.createElement("div"), this._container.className = "menu-button-container", this._triggerButton = new Se(f.inbox), this._unreadCountBadge = new $e({
4037
3135
  themeBus: this._themeSubscription.manager,
4038
3136
  location: "button"
4039
3137
  }), this._unreadCountBadge.id = "unread-badge";
@@ -4056,20 +3154,20 @@ class No extends De {
4056
3154
  `;
4057
3155
  }
4058
3156
  onUnreadCountChange(e) {
4059
- var i;
4060
- (i = this._unreadCountBadge) == null || i.setCount(e), this.updateTheme();
3157
+ var t;
3158
+ (t = this._unreadCountBadge) == null || t.setCount(e), this.updateTheme();
4061
3159
  }
4062
3160
  updateTheme() {
4063
- var i, s, o, n, c, d, l, p, m, g, f, _, b, C, k, w, S, I;
3161
+ var t, s, o, n, h, d, c, u, m, p, x, _, b, v, k, w, S, M;
4064
3162
  const e = this._themeSubscription.manager.getTheme();
4065
- (n = this._triggerButton) == null || n.updateIconColor(((o = (s = (i = e == null ? void 0 : e.popup) == null ? void 0 : i.button) == null ? void 0 : s.icon) == null ? void 0 : o.color) ?? r.black[500]), (p = this._triggerButton) == null || p.updateIconSVG(((l = (d = (c = e == null ? void 0 : e.popup) == null ? void 0 : c.button) == null ? void 0 : d.icon) == null ? void 0 : l.svg) ?? x.inbox), (f = this._triggerButton) == null || f.updateBackgroundColor(((g = (m = e == null ? void 0 : e.popup) == null ? void 0 : m.button) == null ? void 0 : g.backgroundColor) ?? "transparent"), (C = this._triggerButton) == null || C.updateHoverBackgroundColor(((b = (_ = e == null ? void 0 : e.popup) == null ? void 0 : _.button) == null ? void 0 : b.hoverBackgroundColor) ?? r.black[50010]), (S = this._triggerButton) == null || S.updateActiveBackgroundColor(((w = (k = e == null ? void 0 : e.popup) == null ? void 0 : k.button) == null ? void 0 : w.activeBackgroundColor) ?? r.black[50020]), (I = this._unreadCountBadge) == null || I.refreshTheme("button");
3163
+ (n = this._triggerButton) == null || n.updateIconColor(((o = (s = (t = e == null ? void 0 : e.popup) == null ? void 0 : t.button) == null ? void 0 : s.icon) == null ? void 0 : o.color) ?? r.black[500]), (u = this._triggerButton) == null || u.updateIconSVG(((c = (d = (h = e == null ? void 0 : e.popup) == null ? void 0 : h.button) == null ? void 0 : d.icon) == null ? void 0 : c.svg) ?? f.inbox), (x = this._triggerButton) == null || x.updateBackgroundColor(((p = (m = e == null ? void 0 : e.popup) == null ? void 0 : m.button) == null ? void 0 : p.backgroundColor) ?? "transparent"), (v = this._triggerButton) == null || v.updateHoverBackgroundColor(((b = (_ = e == null ? void 0 : e.popup) == null ? void 0 : _.button) == null ? void 0 : b.hoverBackgroundColor) ?? r.black[50010]), (S = this._triggerButton) == null || S.updateActiveBackgroundColor(((w = (k = e == null ? void 0 : e.popup) == null ? void 0 : k.button) == null ? void 0 : w.activeBackgroundColor) ?? r.black[50020]), (M = this._unreadCountBadge) == null || M.refreshTheme("button");
4066
3164
  }
4067
3165
  disconnectedCallback() {
4068
3166
  this._themeSubscription.unsubscribe();
4069
3167
  }
4070
3168
  }
4071
- customElements.get("courier-inbox-menu-button") || customElements.define("courier-inbox-menu-button", No);
4072
- class un extends HTMLElement {
3169
+ customElements.get("courier-inbox-menu-button") || customElements.define("courier-inbox-menu-button", Io);
3170
+ class Fo extends HTMLElement {
4073
3171
  constructor() {
4074
3172
  super();
4075
3173
  // State
@@ -4081,7 +3179,7 @@ class un extends HTMLElement {
4081
3179
  a(this, "_bottom", "40px");
4082
3180
  a(this, "_left", "0");
4083
3181
  // Theming
4084
- a(this, "_themeManager", new zo(Te));
3182
+ a(this, "_themeManager", new Mo(we));
4085
3183
  // Components
4086
3184
  a(this, "_triggerButton");
4087
3185
  a(this, "_popup");
@@ -4092,7 +3190,7 @@ class un extends HTMLElement {
4092
3190
  // Factories
4093
3191
  a(this, "_popupMenuButtonFactory");
4094
3192
  const e = this.attachShadow({ mode: "open" });
4095
- this._triggerButton = new No(this._themeManager), this._triggerButton.build(void 0), this._popup = document.createElement("div"), this._popup.className = "popup", this._inbox = new Uo(this._themeManager), this._inbox.setAttribute("height", "100%"), this._style = document.createElement("style"), this.refreshTheme(), e.appendChild(this._style), e.appendChild(this._triggerButton), e.appendChild(this._popup), this._popup.appendChild(this._inbox), this._triggerButton.addEventListener("click", this.togglePopup.bind(this)), document.addEventListener("click", this.handleOutsideClick.bind(this)), this.updatePopupPosition(), this._datastoreListener = new Oo(this), P.shared.addDataStoreListener(this._datastoreListener), this._themeManager.subscribe((i) => {
3193
+ this._triggerButton = new Io(this._themeManager), this._triggerButton.build(void 0), this._popup = document.createElement("div"), this._popup.className = "popup", this._inbox = new Eo(this._themeManager), this._inbox.setAttribute("height", "100%"), this._style = document.createElement("style"), this.refreshTheme(), e.appendChild(this._style), e.appendChild(this._triggerButton), e.appendChild(this._popup), this._popup.appendChild(this._inbox), this._triggerButton.addEventListener("click", this.togglePopup.bind(this)), document.addEventListener("click", this.handleOutsideClick.bind(this)), this.updatePopupPosition(), this._datastoreListener = new So(this), A.shared.addDataStoreListener(this._datastoreListener), this._themeManager.subscribe((t) => {
4096
3194
  this.refreshTheme();
4097
3195
  });
4098
3196
  }
@@ -4112,7 +3210,7 @@ class un extends HTMLElement {
4112
3210
  this._style.textContent = this.getStyles();
4113
3211
  }
4114
3212
  getStyles() {
4115
- var e, i, s, o, n, c, d, l;
3213
+ var e, t, s, o, n, h, d, c;
4116
3214
  return `
4117
3215
  :host {
4118
3216
  display: inline-block;
@@ -4127,10 +3225,10 @@ class un extends HTMLElement {
4127
3225
  .popup {
4128
3226
  display: none;
4129
3227
  position: absolute;
4130
- background: ${((i = (e = this.theme.popup) == null ? void 0 : e.window) == null ? void 0 : i.backgroundColor) ?? "red"};
3228
+ background: ${((t = (e = this.theme.popup) == null ? void 0 : e.window) == null ? void 0 : t.backgroundColor) ?? "red"};
4131
3229
  border-radius: ${((o = (s = this.theme.popup) == null ? void 0 : s.window) == null ? void 0 : o.borderRadius) ?? "8px"};
4132
- border: ${((c = (n = this.theme.popup) == null ? void 0 : n.window) == null ? void 0 : c.border) ?? "1px solid red"};
4133
- box-shadow: ${((l = (d = this.theme.popup) == null ? void 0 : d.window) == null ? void 0 : l.shadow) ?? "0px 8px 16px -4px red"};
3230
+ border: ${((h = (n = this.theme.popup) == null ? void 0 : n.window) == null ? void 0 : h.border) ?? "1px solid red"};
3231
+ box-shadow: ${((c = (d = this.theme.popup) == null ? void 0 : d.window) == null ? void 0 : c.shadow) ?? "0px 8px 16px -4px red"};
4134
3232
  z-index: 1000;
4135
3233
  width: ${this._width};
4136
3234
  height: ${this._height};
@@ -4151,7 +3249,7 @@ class un extends HTMLElement {
4151
3249
  }
4152
3250
  `;
4153
3251
  }
4154
- attributeChangedCallback(e, i, s) {
3252
+ attributeChangedCallback(e, t, s) {
4155
3253
  switch (e) {
4156
3254
  case "popup-alignment":
4157
3255
  this.isValidPosition(s) && (this._popupAlignment = s, this.updatePopupPosition());
@@ -4250,12 +3348,12 @@ class un extends HTMLElement {
4250
3348
  setContent(e) {
4251
3349
  this._inbox.innerHTML = "", this._inbox.appendChild(e);
4252
3350
  }
4253
- setSize(e, i) {
4254
- this._width = e, this._height = i, this._popup.style.width = e, this._popup.style.height = i;
3351
+ setSize(e, t) {
3352
+ this._width = e, this._height = t, this._popup.style.width = e, this._popup.style.height = t;
4255
3353
  }
4256
3354
  setPosition(e) {
4257
- var i, s;
4258
- this.isValidPosition(e) ? (this._popupAlignment = e, this.updatePopupPosition()) : (s = (i = v.shared.client) == null ? void 0 : i.options.logger) == null || s.error(`Invalid position: ${e}`);
3355
+ var t, s;
3356
+ this.isValidPosition(e) ? (this._popupAlignment = e, this.updatePopupPosition()) : (s = (t = C.shared.client) == null ? void 0 : t.options.logger) == null || s.error(`Invalid position: ${e}`);
4259
3357
  }
4260
3358
  setFeedType(e) {
4261
3359
  this._inbox.setFeedType(e);
@@ -4286,15 +3384,15 @@ class un extends HTMLElement {
4286
3384
  this._popupMenuButtonFactory = e, this.render();
4287
3385
  }
4288
3386
  render() {
4289
- const e = P.shared.unreadCount;
3387
+ const e = A.shared.unreadCount;
4290
3388
  switch (this._popupMenuButtonFactory) {
4291
3389
  case void 0:
4292
3390
  case null:
4293
3391
  this._triggerButton.build(void 0), this._triggerButton.onUnreadCountChange(e);
4294
3392
  break;
4295
3393
  default:
4296
- const i = this._popupMenuButtonFactory({ unreadCount: e });
4297
- this._triggerButton.build(i);
3394
+ const t = this._popupMenuButtonFactory({ unreadCount: e });
3395
+ this._triggerButton.build(t);
4298
3396
  break;
4299
3397
  }
4300
3398
  }
@@ -4303,39 +3401,39 @@ class un extends HTMLElement {
4303
3401
  (e = this._datastoreListener) == null || e.remove(), this._themeManager.cleanup();
4304
3402
  }
4305
3403
  }
4306
- customElements.get("courier-inbox-menu") || customElements.define("courier-inbox-menu", un);
4307
- class xn {
4308
- onDataSetChange(t, e) {
3404
+ customElements.get("courier-inbox-menu") || customElements.define("courier-inbox-menu", Fo);
3405
+ class Zo {
3406
+ onDataSetChange(i, e) {
4309
3407
  }
4310
- onPageAdded(t, e) {
3408
+ onPageAdded(i, e) {
4311
3409
  }
4312
- onUnreadCountChange(t) {
3410
+ onUnreadCountChange(i) {
4313
3411
  }
4314
- onMessageAdd(t, e, i) {
3412
+ onMessageAdd(i, e, t) {
4315
3413
  }
4316
- onMessageRemove(t, e, i) {
3414
+ onMessageRemove(i, e, t) {
4317
3415
  }
4318
- onMessageUpdate(t, e, i) {
3416
+ onMessageUpdate(i, e, t) {
4319
3417
  }
4320
- onError(t) {
3418
+ onError(i) {
4321
3419
  }
4322
3420
  }
4323
3421
  export {
4324
- Uo as CourierInbox,
4325
- Oo as CourierInboxDataStoreListener,
4326
- P as CourierInboxDatastore,
4327
- xn as CourierInboxDatastoreEvents,
4328
- Ho as CourierInboxHeader,
4329
- un as CourierInboxMenu,
4330
- zo as CourierInboxThemeManager,
4331
- Ao as CourierListItem,
4332
- _n as archiveMessage,
4333
- bn as clickMessage,
4334
- Oe as defaultDarkTheme,
4335
- Te as defaultLightTheme,
4336
- ln as getMessageTime,
4337
- gn as markAsRead,
4338
- mn as markAsUnread,
4339
- dn as mergeTheme,
4340
- fn as openMessage
3422
+ Eo as CourierInbox,
3423
+ So as CourierInboxDataStoreListener,
3424
+ A as CourierInboxDatastore,
3425
+ Zo as CourierInboxDatastoreEvents,
3426
+ wo as CourierInboxHeader,
3427
+ Fo as CourierInboxMenu,
3428
+ Mo as CourierInboxThemeManager,
3429
+ xo as CourierListItem,
3430
+ Uo as archiveMessage,
3431
+ No as clickMessage,
3432
+ Ae as defaultDarkTheme,
3433
+ we as defaultLightTheme,
3434
+ Po as getMessageTime,
3435
+ zo as markAsRead,
3436
+ Oo as markAsUnread,
3437
+ $o as mergeTheme,
3438
+ Vo as openMessage
4341
3439
  };