@nylas/react 1.0.2-prealpha1 → 1.1.0-canary.11
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.
- package/dist/add-circle-icon_21.entry-71e60262.js +1755 -0
- package/dist/add-circle-icon_21.entry-95dda099.cjs +1 -0
- package/dist/{archive-icon_7.entry-84d70dbf.cjs → archive-icon_7.entry-24f31e46.cjs} +1 -1
- package/dist/{archive-icon_7.entry-91aaa1aa.js → archive-icon_7.entry-3c5e3ccf.js} +19 -19
- package/dist/{arrow-icon.entry-400a08fa.cjs → arrow-icon.entry-562eb541.cjs} +1 -1
- package/dist/{arrow-icon.entry-8b2e96a6.js → arrow-icon.entry-813bffe9.js} +2 -2
- package/dist/{bold-icon_3.entry-4b2798a8.js → bold-icon_3.entry-c0e7d524.js} +4 -4
- package/dist/{bold-icon_3.entry-9ad35153.cjs → bold-icon_3.entry-e8b034fe.cjs} +1 -1
- package/dist/{calendar-cancel-icon.entry-83ba884a.js → calendar-cancel-icon.entry-0b0219cb.js} +5 -5
- package/dist/{calendar-cancel-icon.entry-fcb66929.cjs → calendar-cancel-icon.entry-7d4fdb1b.cjs} +1 -1
- package/dist/calendar-check-icon_2.entry-6ecd2faa.js +25 -0
- package/dist/calendar-check-icon_2.entry-88025f63.cjs +1 -0
- package/dist/{calendar-icon.entry-8f38af4a.js → calendar-icon.entry-34d8ef69.js} +5 -5
- package/dist/{calendar-icon.entry-7bae38d7.cjs → calendar-icon.entry-b753520f.cjs} +1 -1
- package/dist/chevron-icon_3.entry-0aeb4cfa.cjs +1 -0
- package/dist/chevron-icon_3.entry-ae55fd65.js +117 -0
- package/dist/close-icon.entry-ae66c827.js +15 -0
- package/dist/close-icon.entry-c80da833.cjs +1 -0
- package/dist/{nylas-booked-event-card_10.entry-ed515326.cjs → constants-f34b9c6e-b9f975af.cjs} +6 -6
- package/dist/{nylas-booked-event-card_10.entry-7e66a648.js → constants-f34b9c6e-d0f5cd19.js} +1665 -2374
- package/dist/document-refresh-icon.entry-36405467.cjs +1 -0
- package/dist/{document-refresh-icon.entry-9083a2e9.js → document-refresh-icon.entry-7d370f85.js} +5 -5
- package/dist/elements/index.d.ts +32 -2
- package/dist/{elements-dc5b338e-81a0319c.cjs → elements-dc5b338e-0dbb4f67.cjs} +1 -1
- package/dist/{elements-dc5b338e-fb5dbfb5.js → elements-dc5b338e-524cb111.js} +1 -1
- package/dist/{focus-visible-e8093c16-28fc08a0.js → focus-visible-e8093c16-17ab1557.js} +5 -3
- package/dist/focus-visible-e8093c16-7e94a4f3.cjs +1 -0
- package/dist/{forward-icon_6.entry-b60fcb35.js → forward-icon_6.entry-384cc3c5.js} +83 -85
- package/dist/forward-icon_6.entry-a479b39e.cjs +3 -0
- package/dist/{globe-icon.entry-8325e73e.cjs → globe-icon.entry-0c848856.cjs} +1 -1
- package/dist/{globe-icon.entry-e3fd373f.js → globe-icon.entry-58b9f3fc.js} +4 -4
- package/dist/google-logo-icon_4.entry-3dce1b83.js +388 -0
- package/dist/google-logo-icon_4.entry-e1e63fd0.cjs +1 -0
- package/dist/index-20ea5b0c.js +4042 -0
- package/dist/index-33f74306.cjs +37 -0
- package/dist/index.d.ts +3 -1
- package/dist/{index-b30d446a-a90f84b2.js → index.es-be19d2df-c2fdca63.js} +945 -1041
- package/dist/index.es-be19d2df-f732308a.cjs +7 -0
- package/dist/info-icon_2.entry-98965833.js +34 -0
- package/dist/info-icon_2.entry-dd0a0633.cjs +1 -0
- package/dist/{loading-icon.entry-b2096d2b.cjs → loading-icon.entry-46821f18.cjs} +1 -1
- package/dist/{loading-icon.entry-27410cf8.js → loading-icon.entry-abd81cea.js} +2 -2
- package/dist/mailbox-store-76540d24-7bf14e45.cjs +1 -0
- package/dist/{mailbox-store-19f0c6c9-e3e8b4e5.js → mailbox-store-76540d24-dfb53045.js} +2 -2
- package/dist/nylas-additional-participants.entry-d35d7af5.cjs +1 -0
- package/dist/nylas-additional-participants.entry-f6ed34d6.js +81 -0
- package/dist/nylas-booked-event-card_10.entry-534e587c.cjs +1 -0
- package/dist/nylas-booked-event-card_10.entry-8efe8335.js +805 -0
- package/dist/nylas-custom-booking-flow.entry-0e7b605d.js +106 -0
- package/dist/nylas-custom-booking-flow.entry-12d09496.cjs +1 -0
- package/dist/nylas-form-card.entry-7dd86dde.js +54 -0
- package/dist/nylas-form-card.entry-94579d1d.cjs +1 -0
- package/dist/nylas-if-state.entry-32ea90ea.cjs +1 -0
- package/dist/nylas-if-state.entry-92cbc0b9.js +94 -0
- package/dist/nylas-list-folders.entry-8595a9b7.cjs +1 -0
- package/dist/{nylas-list-folders.entry-a5437201.js → nylas-list-folders.entry-cab222c9.js} +10 -11
- package/dist/nylas-list-threads.entry-3fef6316.cjs +1 -0
- package/dist/{nylas-list-threads.entry-fd6cda61.js → nylas-list-threads.entry-8e9294a3.js} +5 -6
- package/dist/nylas-login.entry-bc885e04.cjs +1 -0
- package/dist/nylas-login.entry-bd1d5b6f.js +73 -0
- package/dist/{nylas-mailbox-pagination.entry-988214bc.js → nylas-mailbox-pagination.entry-58657a09.js} +7 -8
- package/dist/nylas-mailbox-pagination.entry-74d3b376.cjs +1 -0
- package/dist/nylas-mailbox-toolbar-button.entry-8b73b9f4.cjs +1 -0
- package/dist/{nylas-mailbox-toolbar-button.entry-c720e22a.js → nylas-mailbox-toolbar-button.entry-d7817b46.js} +15 -16
- package/dist/nylas-mailbox.entry-0bddc2fd.js +134 -0
- package/dist/nylas-mailbox.entry-762f5062.cjs +1 -0
- package/dist/{nylas-provider.entry-70721009.js → nylas-provider.entry-2e24192d.js} +40 -29
- package/dist/nylas-provider.entry-f8ba7a6e.cjs +1 -0
- package/dist/nylas-scheduler-editor.entry-8189b099.js +2269 -0
- package/dist/nylas-scheduler-editor.entry-a642f833.cjs +7 -0
- package/dist/nylas-scheduling.entry-13087b5f.cjs +1 -0
- package/dist/nylas-scheduling.entry-3f170361.js +248 -0
- package/dist/nylas-threads-refresh.entry-3b9f57c3.cjs +1 -0
- package/dist/{nylas-threads-refresh.entry-b7f9e93f.js → nylas-threads-refresh.entry-f2967405.js} +4 -5
- package/dist/nylas-threads-search.entry-3e0b4fdc.cjs +1 -0
- package/dist/{nylas-threads-search.entry-95afea9c.js → nylas-threads-search.entry-e70bbf70.js} +4 -5
- package/dist/{nylas-view-thread.entry-165173b1.js → nylas-view-thread.entry-4f39f045.js} +10 -11
- package/dist/nylas-view-thread.entry-b23080b7.cjs +1 -0
- package/dist/people-icon.entry-15cd7d77.cjs +1 -0
- package/dist/people-icon.entry-7f3b95e9.js +15 -0
- package/dist/play-icon_2.entry-13065065.js +25 -0
- package/dist/play-icon_2.entry-2172886a.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +94 -62
- package/dist/{refresh-icon.entry-601cac89.cjs → refresh-icon.entry-61067a7f.cjs} +1 -1
- package/dist/{refresh-icon.entry-e48a338f.js → refresh-icon.entry-fbfa185e.js} +5 -5
- package/dist/register-component-83e24412-445c6ad9.cjs +1 -0
- package/dist/{register-component-152c6ad2-a06f58c2.js → register-component-83e24412-b666e56b.js} +37 -33
- package/dist/scheduler-config-store-ec3b6190-8bde49c6.cjs +1 -0
- package/dist/scheduler-config-store-ec3b6190-fa81c492.js +23 -0
- package/dist/scheduler-store-8ca9003d-57b3f7a7.cjs +1 -0
- package/dist/scheduler-store-8ca9003d-8da2c12d.js +321 -0
- package/dist/time-period-selector.entry-5e083fd3.js +76 -0
- package/dist/time-period-selector.entry-febf55eb.cjs +1 -0
- package/dist/translate-icon.entry-10db7d36.js +15 -0
- package/dist/translate-icon.entry-8ce0a713.cjs +1 -0
- package/dist/warning-icon.entry-470e449d.js +15 -0
- package/dist/warning-icon.entry-b8217553.cjs +1 -0
- package/package.json +7 -4
- package/dist/_commonjsHelpers-57e89916-4a3ae7d8.cjs +0 -1
- package/dist/_commonjsHelpers-57e89916-af061c86.js +0 -19
- package/dist/add-circle-icon.entry-2ccb238b.cjs +0 -1
- package/dist/add-circle-icon.entry-35d6aa07.js +0 -15
- package/dist/calendar-check-icon_3.entry-903e2d82.js +0 -35
- package/dist/calendar-check-icon_3.entry-a16ce05e.cjs +0 -1
- package/dist/chevron-icon.entry-58366662.cjs +0 -1
- package/dist/chevron-icon.entry-5e11cef5.js +0 -15
- package/dist/close-icon_2.entry-011d9cf4.js +0 -25
- package/dist/close-icon_2.entry-83088b9a.cjs +0 -1
- package/dist/document-refresh-icon.entry-071ffd66.cjs +0 -1
- package/dist/duration-bddc4a13-05d3e3e2.cjs +0 -1
- package/dist/duration-bddc4a13-179ce826.js +0 -41
- package/dist/focus-visible-e8093c16-f380b705.cjs +0 -1
- package/dist/forward-icon_6.entry-3345af84.cjs +0 -3
- package/dist/index-3b6f5cd5.cjs +0 -30
- package/dist/index-630f4e87.js +0 -1498
- package/dist/index-b30d446a-cbbef925.cjs +0 -7
- package/dist/mailbox-store-19f0c6c9-a0cbfa97.cjs +0 -1
- package/dist/nylas-if-state_3.entry-504be976.cjs +0 -1
- package/dist/nylas-if-state_3.entry-e96d01f1.js +0 -291
- package/dist/nylas-list-folders.entry-866361cc.cjs +0 -1
- package/dist/nylas-list-threads.entry-04989295.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-e0bd4aef.cjs +0 -1
- package/dist/nylas-mailbox-toolbar-button.entry-3d772b26.cjs +0 -1
- package/dist/nylas-open-hours-picker.entry-6bdc7c73.js +0 -186
- package/dist/nylas-open-hours-picker.entry-881b6db7.cjs +0 -1
- package/dist/nylas-provider.entry-8d9a844b.cjs +0 -1
- package/dist/nylas-scheduler.entry-7321e18f.js +0 -230
- package/dist/nylas-scheduler.entry-e82977fb.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-477e68e4.cjs +0 -1
- package/dist/nylas-threads-search.entry-c5854641.cjs +0 -1
- package/dist/nylas-view-thread.entry-8b72cbdb.cjs +0 -1
- package/dist/play-icon_2.entry-ed5877e3.js +0 -25
- package/dist/play-icon_2.entry-f23ed6c1.cjs +0 -1
- package/dist/register-component-152c6ad2-0df7215b.cjs +0 -1
- package/dist/scheduler-store-7d48e682-0c0c3991.js +0 -289
- package/dist/scheduler-store-7d48e682-674705ef.cjs +0 -1
- package/dist/search-icon_3.entry-292138c3.js +0 -101
- package/dist/search-icon_3.entry-8e555357.cjs +0 -1
- package/dist/utils-5074a070-ce33ee6b.js +0 -119
- package/dist/utils-5074a070-d5ba6add.cjs +0 -2
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { r as ne, h as g, c as We, H as $e, g as Rt,
|
|
2
|
-
import {
|
|
3
|
-
import { R as _n } from "./register-component-152c6ad2-a06f58c2.js";
|
|
4
|
-
import { c as wn } from "./_commonjsHelpers-57e89916-af061c86.js";
|
|
1
|
+
import { r as ne, h as g, c as We, d as T, H as $e, g as Rt, i as yn, o as bn, p as En, q as Tn, F as An, s as _n } from "./index-20ea5b0c.js";
|
|
2
|
+
import { R as wn } from "./register-component-83e24412-b666e56b.js";
|
|
5
3
|
import "react";
|
|
6
4
|
import "react-dom";
|
|
7
5
|
const vn = ".sc-forward-icon-h{display:flex}", Sn = vn, Cn = class {
|
|
@@ -9,7 +7,7 @@ const vn = ".sc-forward-icon-h{display:flex}", Sn = vn, Cn = class {
|
|
|
9
7
|
ne(this, t), this.width = "15", this.height = "15";
|
|
10
8
|
}
|
|
11
9
|
render() {
|
|
12
|
-
return g("svg", { key: "
|
|
10
|
+
return g("svg", { key: "c3c406f225989a53006d7deef67a2dd8dd3d5d81", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, g("path", { key: "be9eae8233d00a07dd1501d7daf45f51d6049908", d: "m1246.246 64-90.496 90.496 477.952 477.952h-590.848C467.878 632.448.038 1100.416.038 1675.392v109.056h128v-109.056c0-504.576 410.368-914.944 914.816-914.944h590.848l-477.952 478.08 90.496 90.496 632.448-632.576L1246.246 64Z", "fill-rule": "evenodd" }));
|
|
13
11
|
}
|
|
14
12
|
};
|
|
15
13
|
Cn.style = Sn;
|
|
@@ -58,20 +56,20 @@ const Ln = ':host{display:grid;color:var(--nylas-color-primary-900)}.editor{posi
|
|
|
58
56
|
T("no selection");
|
|
59
57
|
return;
|
|
60
58
|
}
|
|
61
|
-
const
|
|
59
|
+
const m = s.getRangeAt(0), a = s.toString();
|
|
62
60
|
if (!a) {
|
|
63
61
|
o.style.display = "none";
|
|
64
62
|
return;
|
|
65
63
|
}
|
|
66
|
-
const
|
|
67
|
-
if (!
|
|
64
|
+
const f = t.querySelector(".message-body");
|
|
65
|
+
if (!f) {
|
|
68
66
|
T("no message body");
|
|
69
67
|
return;
|
|
70
68
|
}
|
|
71
|
-
const l =
|
|
69
|
+
const l = m.commonAncestorContainer.parentElement;
|
|
72
70
|
if (!l)
|
|
73
71
|
return;
|
|
74
|
-
const E =
|
|
72
|
+
const E = f.getBoundingClientRect();
|
|
75
73
|
T("messageBodyRect", { messageBodyRect: E });
|
|
76
74
|
const _ = l.getBoundingClientRect();
|
|
77
75
|
T("foundRect", { foundRect: _ });
|
|
@@ -85,22 +83,22 @@ const Ln = ':host{display:grid;color:var(--nylas-color-primary-900)}.editor{posi
|
|
|
85
83
|
T("no editor element");
|
|
86
84
|
return;
|
|
87
85
|
}
|
|
88
|
-
this.editorEl.querySelectorAll(".message-body").forEach((
|
|
86
|
+
this.editorEl.querySelectorAll(".message-body").forEach((f) => f.remove());
|
|
89
87
|
const o = document.createElement("div");
|
|
90
88
|
o.classList.add("message-body");
|
|
91
89
|
const u = document.createElement("p");
|
|
92
90
|
u.innerHTML = " ", o.appendChild(u);
|
|
93
91
|
const s = document.createElement("br");
|
|
94
92
|
o.appendChild(s);
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
|
|
93
|
+
const m = document.createElement("div");
|
|
94
|
+
if (m.classList.add("reply-text"), m.innerText = `On ${new Date(t.date * 1e3).toLocaleDateString(void 0, { dateStyle: "full" })} <${(a = t.from) == null ? void 0 : a.map((f) => f.name || f.email).join(", ")}> wrote:`, o.appendChild(m), t.body) {
|
|
95
|
+
const f = document.createElement("html");
|
|
96
|
+
f.innerHTML = t.body;
|
|
99
97
|
const i = document.createElement("blockquote");
|
|
100
|
-
i.classList.add("collapsed"), i.classList.add("gmail_quote"), i.innerHTML =
|
|
98
|
+
i.classList.add("collapsed"), i.classList.add("gmail_quote"), i.innerHTML = f.innerHTML, o.appendChild(i), T("replyContainer", { replyContainer: i });
|
|
101
99
|
}
|
|
102
|
-
this.editorEl.appendChild(o), this.editorEl.querySelectorAll("blockquote.collapsed").forEach((
|
|
103
|
-
|
|
100
|
+
this.editorEl.appendChild(o), this.editorEl.querySelectorAll("blockquote.collapsed").forEach((f) => {
|
|
101
|
+
f.addEventListener("click", function(i) {
|
|
104
102
|
i.preventDefault();
|
|
105
103
|
const l = i.target;
|
|
106
104
|
l.classList.remove("collapsed"), l.classList.add("expanded");
|
|
@@ -108,7 +106,7 @@ const Ln = ':host{display:grid;color:var(--nylas-color-primary-900)}.editor{posi
|
|
|
108
106
|
}), this.editorEl.focus();
|
|
109
107
|
}
|
|
110
108
|
render() {
|
|
111
|
-
return g($e, { key: "
|
|
109
|
+
return g($e, { key: "8d7f9c145099757c2a8dc48f1d2a223831f82cda" }, g("sp-theme", { key: "e92e457e86701838f55d97b3f2c1c0f70f14bf59", scale: "medium", color: "dark" }, g("div", { key: "50eba2b6ee0c84d8eeb392385872604b74b11025", class: "editor", contentEditable: !0, ref: (t) => this.editorEl = t }, g("div", { key: "38bdd2ec58e62699e2c604b1b2c586cb5ecf105a", class: "toolbar", ref: (t) => this.toolbarEl = t, contentEditable: !1 }, g("sp-button", { key: "6415e5f9910a2d9798e7c85162329f359e500aeb", quiet: !0, onClick: () => document.execCommand("bold") }, g("div", { key: "e03cfe0f5736836f64aa350165fa519508e212f7", slot: "icon" }, g("bold-icon", { key: "1ad03230cff2f0843d6da22153716c3818ed04f7" })), g("div", { key: "d90c50aff88b9ac7774d6792b91ea3ced21f4419", slot: "label" }, "Bold")), g("sp-button", { key: "466621fcdf2e8e1e85b613bba82b948ed2177a88", quiet: !0, onClick: () => document.execCommand("underline") }, g("div", { key: "6be0737cf685b02f3ee8ef7c34fd18674793af00", slot: "icon" }, g("underline-icon", { key: "278b1b79d3aec25ab2c2181c3e5c631063b04e29" })), g("div", { key: "169d3039815082e208eb476b4490181f7eb54ee6", slot: "label" }, "Underline")), g("sp-button", { key: "92c20b2d03b709f08c63af3a1e88b10e407243d7", quiet: !0, onClick: () => document.execCommand("italic") }, g("div", { key: "67eb3d5b5a2118d90bfb81c7b51d52c41b5ab2a2", slot: "icon" }, g("italic-icon", { key: "35ac96f9ff3f3f0c38c7e486092f42dc9451eb63" })), g("div", { key: "f29fe84363cca6e178a3651a1c8e56929ebb3e32", slot: "label" }, "Italic")))), g("div", { key: "3d89b191642ab291fc338ffd66be16fe999950b1", class: "buttons" }, g("sp-button", { key: "f78c122acf4c69c788d411d2dcfd49649c99919e", onClick: this.sendComposer, class: "send" }, "Send"), g("sp-button", { key: "b46873c911cb796e9af22eb7d19bf6e1cd2cd1be", onClick: this.closeComposer, class: "close" }, "Close"))));
|
|
112
110
|
}
|
|
113
111
|
get host() {
|
|
114
112
|
return Rt(this);
|
|
@@ -122,13 +120,13 @@ const Ln = ':host{display:grid;color:var(--nylas-color-primary-900)}.editor{posi
|
|
|
122
120
|
kn.style = Rn;
|
|
123
121
|
const Mn = ":host{display:block}sp-button{padding:0;border:0;border-radius:var(--nylas-border-radius);min-block-size:50%;min-inline-size:2rem;background-color:var(--nylas-color-primary-300);fill:var(--nylas-color-primary-800)}sp-button:hover{background-color:var(--nylas-color-primary-400)}.summarize-button.stopped{animation:none}.summarize-button.playing{animation:pulse 2s infinite}.summarize-button.loading{display:flex;align-content:center;height:1.5rem;width:2rem;vertical-align:middle;animation:pulse 2s infinite;flex-wrap:wrap}.summarize-button.loading loading-icon{--dot-color:var(--nylas-color-primary-600)}@keyframes pulse{0%{transform:scale(1);box-shadow:0 0 0 0 var(--nylas-color-primary-300)}70%{transform:scale(1.05);box-shadow:0 0 0 10px rgba(255, 69, 0, 0)}100%{transform:scale(1);box-shadow:0 0 0 0 rgba(255, 69, 0, 0)}}@keyframes wave{0%{transform:translateX(0)}50%{transform:translateX(100%)}100%{transform:translateX(0)}}", Nn = Mn;
|
|
124
122
|
var xn = function(t, o, u, s) {
|
|
125
|
-
var
|
|
123
|
+
var m = arguments.length, a = m < 3 ? o : s === null ? s = Object.getOwnPropertyDescriptor(o, u) : s, f;
|
|
126
124
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
127
125
|
a = Reflect.decorate(t, o, u, s);
|
|
128
126
|
else
|
|
129
127
|
for (var i = t.length - 1; i >= 0; i--)
|
|
130
|
-
(
|
|
131
|
-
return
|
|
128
|
+
(f = t[i]) && (a = (m < 3 ? f(a) : m > 3 ? f(o, u, a) : f(o, u)) || a);
|
|
129
|
+
return m > 3 && a && Object.defineProperty(o, u, a), a;
|
|
132
130
|
}, Be = function(t, o) {
|
|
133
131
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
134
132
|
return Reflect.metadata(t, o);
|
|
@@ -182,17 +180,17 @@ const kt = class {
|
|
|
182
180
|
return;
|
|
183
181
|
}
|
|
184
182
|
const u = new MediaSource();
|
|
185
|
-
let s,
|
|
183
|
+
let s, m = !1;
|
|
186
184
|
o.src = URL.createObjectURL(u), u.addEventListener("sourceopen", a);
|
|
187
185
|
async function a() {
|
|
188
|
-
s = u.addSourceBuffer("audio/mpeg"), s.addEventListener("updateend",
|
|
186
|
+
s = u.addSourceBuffer("audio/mpeg"), s.addEventListener("updateend", f);
|
|
189
187
|
const i = await t;
|
|
190
188
|
if (i == null)
|
|
191
189
|
throw new Error("ReadableStream not yet supported in this browser.");
|
|
192
190
|
const l = i.getReader(), E = () => {
|
|
193
191
|
l.read().then(({ done: _, value: N }) => {
|
|
194
192
|
if (_) {
|
|
195
|
-
|
|
193
|
+
m = !0;
|
|
196
194
|
return;
|
|
197
195
|
}
|
|
198
196
|
s.updating || s.appendBuffer(N), E();
|
|
@@ -202,11 +200,11 @@ const kt = class {
|
|
|
202
200
|
};
|
|
203
201
|
E(), o.paused && o.play().catch((_) => console.error("Error playing audio:", _));
|
|
204
202
|
}
|
|
205
|
-
function
|
|
206
|
-
if (
|
|
203
|
+
function f() {
|
|
204
|
+
if (m) {
|
|
207
205
|
u.endOfStream(), u.removeEventListener("sourceopen", a), u.removeEventListener("sourceclose", () => {
|
|
208
206
|
T("[nylas-summarize-message-button] Source closed");
|
|
209
|
-
}), s.removeEventListener("updateend",
|
|
207
|
+
}), s.removeEventListener("updateend", f);
|
|
210
208
|
return;
|
|
211
209
|
}
|
|
212
210
|
}
|
|
@@ -215,25 +213,25 @@ const kt = class {
|
|
|
215
213
|
return t.read().then(({ done: u, value: s }) => u ? o : (o.push(s), this.readChunk(t, o)));
|
|
216
214
|
}
|
|
217
215
|
render() {
|
|
218
|
-
return g($e, { key: "
|
|
216
|
+
return g($e, { key: "09d693158ce9480c000957afe31566d47f6fb5f2" }, g("sp-theme", { key: "21f246783a3d5786c1cee8f438e89947ee5f574d", scale: "medium", color: "dark" }, g("sp-button", { key: "7ef9c60895da162d3b521ddc7c070ff463e51094", label: "Summarize email", "icon-only": !0, onClickCapture: this.onClick, class: {
|
|
219
217
|
"summarize-button": !0,
|
|
220
218
|
stopped: this.state === "stopped",
|
|
221
219
|
loading: this.state === "loading",
|
|
222
220
|
playing: this.state === "playing"
|
|
223
|
-
} }, this.state === "stopped" && g("play-icon", null), this.state === "loading" && g("loading-icon", null), this.state === "playing" && g("stop-icon", null)), g("audio", { key: "
|
|
221
|
+
} }, this.state === "stopped" && g("play-icon", null), this.state === "loading" && g("loading-icon", null), this.state === "playing" && g("stop-icon", null)), g("audio", { key: "7481ceeb62b6eb21c627d0e04be0e0e7a9e986ec", ref: (t) => this.audioRef = t, autoPlay: !0, onPlaying: () => this.state = "playing", onPause: () => this.state = "stopped", onEnded: () => {
|
|
224
222
|
this.state = "stopped", T("[nylas-summarize-message-button] Audio ended");
|
|
225
223
|
} })));
|
|
226
224
|
}
|
|
227
225
|
};
|
|
228
226
|
xn([
|
|
229
|
-
|
|
227
|
+
wn({
|
|
230
228
|
name: "nylas-summarize-message-button",
|
|
231
229
|
eventToProps: {
|
|
232
230
|
summarize: async (t, o) => {
|
|
233
|
-
const { playAudio: u, updateState: s, abortController:
|
|
231
|
+
const { playAudio: u, updateState: s, abortController: m, message: a } = t.detail, f = _n(a.body || "");
|
|
234
232
|
await s("loading");
|
|
235
233
|
try {
|
|
236
|
-
const i = await o.messages.summarizeText(
|
|
234
|
+
const i = await o.messages.summarizeText(f), l = o.messages.textToSpeech(i, m);
|
|
237
235
|
await u(l);
|
|
238
236
|
} catch (i) {
|
|
239
237
|
await s("stopped"), console.error("Error summarizing message:", i);
|
|
@@ -260,16 +258,16 @@ function Mt(t) {
|
|
|
260
258
|
const o = (a = t.match(/\d+/g)) == null ? void 0 : a.map(Number);
|
|
261
259
|
if (!o)
|
|
262
260
|
return t;
|
|
263
|
-
const [u, s,
|
|
264
|
-
return `rgb(${255 - u}, ${255 - s}, ${255 -
|
|
261
|
+
const [u, s, m] = o;
|
|
262
|
+
return `rgb(${255 - u}, ${255 - s}, ${255 - m})`;
|
|
265
263
|
}
|
|
266
264
|
function On(t) {
|
|
267
265
|
var a;
|
|
268
266
|
const o = (a = t.match(/\d+\.?\d*/g)) == null ? void 0 : a.map(Number);
|
|
269
267
|
if (!o)
|
|
270
268
|
return t;
|
|
271
|
-
const [u, s,
|
|
272
|
-
return `hsl(${u}, ${s}%, ${100 -
|
|
269
|
+
const [u, s, m] = o;
|
|
270
|
+
return `hsl(${u}, ${s}%, ${100 - m}%)`;
|
|
273
271
|
}
|
|
274
272
|
function In(t) {
|
|
275
273
|
return /^[a-z]+$/i.test(t);
|
|
@@ -297,9 +295,9 @@ function Lt(t) {
|
|
|
297
295
|
const l = i[0].trim(), E = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), [_, N, U] = i[1].split(" ");
|
|
298
296
|
o = o.replaceAll(E, l.replace(U, P(U)));
|
|
299
297
|
}
|
|
300
|
-
const
|
|
301
|
-
if (
|
|
302
|
-
for (const i of
|
|
298
|
+
const m = o.matchAll(/background-color:\s*([^;]+)/g);
|
|
299
|
+
if (m)
|
|
300
|
+
for (const i of m) {
|
|
303
301
|
const [l, E] = i, _ = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
304
302
|
o = o.replaceAll(_, l.replace(E, P(E))), T("backgroundColor", { fullMatch: l, replace: l.replace(E, P(E)), color: E, invertColor: P(E) });
|
|
305
303
|
}
|
|
@@ -309,9 +307,9 @@ function Lt(t) {
|
|
|
309
307
|
const l = i[0].trim(), E = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), [_, N, U] = i[1].split(" ");
|
|
310
308
|
o = o.replaceAll(E, l.replace(U, P(U)));
|
|
311
309
|
}
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
314
|
-
for (const i of
|
|
310
|
+
const f = o.matchAll(/color:\s*([^;]+)/g);
|
|
311
|
+
if (f)
|
|
312
|
+
for (const i of f) {
|
|
315
313
|
const [l, E] = i, _ = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
316
314
|
o = o.replaceAll(_, l.replace(E, P(E)));
|
|
317
315
|
}
|
|
@@ -319,8 +317,8 @@ function Lt(t) {
|
|
|
319
317
|
}
|
|
320
318
|
}
|
|
321
319
|
if (t instanceof HTMLElement) {
|
|
322
|
-
const o = window.getComputedStyle(t), u = o.color || t.style.color, s = o.backgroundColor || t.style.backgroundColor,
|
|
323
|
-
u && !s ? t.style.color = "" : u && s ? (t.style.color = P(u), t.style.backgroundColor = P(s), T("element", t), T("computedStyle.color", u), T("computedStyle.backgroundColor", s), T("invertColor(color)", P(u)), T("invertColor(backgroundColor)", P(s))) : !u && s && (t.style.backgroundColor = ""),
|
|
320
|
+
const o = window.getComputedStyle(t), u = o.color || t.style.color, s = o.backgroundColor || t.style.backgroundColor, m = o.borderColor || t.style.borderColor;
|
|
321
|
+
u && !s ? t.style.color = "" : u && s ? (t.style.color = P(u), t.style.backgroundColor = P(s), T("element", t), T("computedStyle.color", u), T("computedStyle.backgroundColor", s), T("invertColor(color)", P(u)), T("invertColor(backgroundColor)", P(s))) : !u && s && (t.style.backgroundColor = ""), m && (T("borderColor", m), t.style.borderColor = P(m)), t.hasAttribute("bgcolor") && t.removeAttribute("bgcolor");
|
|
324
322
|
}
|
|
325
323
|
}
|
|
326
324
|
function zn(t) {
|
|
@@ -331,13 +329,13 @@ var Nt = { exports: {} };
|
|
|
331
329
|
(function(t, o) {
|
|
332
330
|
(function(u, s) {
|
|
333
331
|
t.exports = s();
|
|
334
|
-
})(
|
|
332
|
+
})(yn, function() {
|
|
335
333
|
const {
|
|
336
334
|
entries: u,
|
|
337
335
|
setPrototypeOf: s,
|
|
338
|
-
isFrozen:
|
|
336
|
+
isFrozen: m,
|
|
339
337
|
getPrototypeOf: a,
|
|
340
|
-
getOwnPropertyDescriptor:
|
|
338
|
+
getOwnPropertyDescriptor: f
|
|
341
339
|
} = Object;
|
|
342
340
|
let {
|
|
343
341
|
freeze: i,
|
|
@@ -379,7 +377,7 @@ var Nt = { exports: {} };
|
|
|
379
377
|
let k = c[h];
|
|
380
378
|
if (typeof k == "string") {
|
|
381
379
|
const F = b(k);
|
|
382
|
-
F !== k && (
|
|
380
|
+
F !== k && (m(c) || (c[h] = F), k = F);
|
|
383
381
|
}
|
|
384
382
|
y[k] = !0;
|
|
385
383
|
}
|
|
@@ -387,18 +385,18 @@ var Nt = { exports: {} };
|
|
|
387
385
|
}
|
|
388
386
|
function It(y) {
|
|
389
387
|
for (let c = 0; c < y.length; c++)
|
|
390
|
-
|
|
388
|
+
f(y, c) === void 0 && (y[c] = null);
|
|
391
389
|
return y;
|
|
392
390
|
}
|
|
393
391
|
function $(y) {
|
|
394
392
|
const c = E(null);
|
|
395
393
|
for (const [b, h] of u(y))
|
|
396
|
-
|
|
394
|
+
f(y, b) !== void 0 && (Array.isArray(h) ? c[b] = It(h) : h && typeof h == "object" && h.constructor === Object ? c[b] = $(h) : c[b] = h);
|
|
397
395
|
return c;
|
|
398
396
|
}
|
|
399
397
|
function ue(y, c) {
|
|
400
398
|
for (; y !== null; ) {
|
|
401
|
-
const h =
|
|
399
|
+
const h = f(y, c);
|
|
402
400
|
if (h) {
|
|
403
401
|
if (h.get)
|
|
404
402
|
return I(h.get);
|
|
@@ -412,7 +410,7 @@ var Nt = { exports: {} };
|
|
|
412
410
|
}
|
|
413
411
|
return b;
|
|
414
412
|
}
|
|
415
|
-
const qe = i(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Te = i(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ae = i(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Pt = i(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), _e = i(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ut = i(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ye = i(["#text"]), je = i(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]), we = i(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Xe = i(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]),
|
|
413
|
+
const qe = i(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Te = i(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Ae = i(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), Pt = i(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), _e = i(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), Ut = i(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), Ye = i(["#text"]), je = i(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "xmlns", "slot"]), we = i(["accent-height", "accumulate", "additive", "alignment-baseline", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), Xe = i(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), fe = i(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), zt = l(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Ft = l(/<%[\w\W]*|[\w\W]*%>/gm), Ht = l(/\${[\w\W]*}/gm), Bt = l(/^data-[\-\w.\u00B7-\uFFFF]/), Wt = l(/^aria-[\-\w]+$/), Ve = l(
|
|
416
414
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
417
415
|
// eslint-disable-line no-useless-escape
|
|
418
416
|
), Gt = l(/^(?:\w+script|data):/i), $t = l(
|
|
@@ -470,7 +468,7 @@ var Nt = { exports: {} };
|
|
|
470
468
|
NamedNodeMap: Xt = y.NamedNodeMap || y.MozNamedAttrMap,
|
|
471
469
|
HTMLFormElement: Vt,
|
|
472
470
|
DOMParser: Zt,
|
|
473
|
-
trustedTypes:
|
|
471
|
+
trustedTypes: me
|
|
474
472
|
} = y, pe = Je.prototype, Kt = ue(pe, "cloneNode"), Qt = ue(pe, "nextSibling"), Jt = ue(pe, "childNodes"), Ce = ue(pe, "parentNode");
|
|
475
473
|
if (typeof V == "function") {
|
|
476
474
|
const d = b.createElement("template");
|
|
@@ -501,7 +499,7 @@ var Nt = { exports: {} };
|
|
|
501
499
|
} = Ke, v = null;
|
|
502
500
|
const nt = p({}, [...qe, ...Te, ...Ae, ..._e, ...Ye]);
|
|
503
501
|
let S = null;
|
|
504
|
-
const ot = p({}, [...je, ...we, ...Xe, ...
|
|
502
|
+
const ot = p({}, [...je, ...we, ...Xe, ...fe]);
|
|
505
503
|
let w = Object.seal(E(null, {
|
|
506
504
|
tagNameCheck: {
|
|
507
505
|
writable: !0,
|
|
@@ -528,50 +526,50 @@ var Nt = { exports: {} };
|
|
|
528
526
|
let dt = null;
|
|
529
527
|
const ut = p({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
530
528
|
let Pe = null;
|
|
531
|
-
const
|
|
529
|
+
const ft = p({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), ye = "http://www.w3.org/1998/Math/MathML", be = "http://www.w3.org/2000/svg", H = "http://www.w3.org/1999/xhtml";
|
|
532
530
|
let ee = H, Ue = !1, ze = null;
|
|
533
531
|
const cn = p({}, [ye, be, H], oe);
|
|
534
532
|
let le = null;
|
|
535
533
|
const dn = ["application/xhtml+xml", "text/html"], un = "text/html";
|
|
536
534
|
let C = null, te = null;
|
|
537
|
-
const
|
|
535
|
+
const fn = b.createElement("form"), mt = function(e) {
|
|
538
536
|
return e instanceof RegExp || e instanceof Function;
|
|
539
537
|
}, Fe = function() {
|
|
540
538
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
541
539
|
if (!(te && te === e)) {
|
|
542
540
|
if ((!e || typeof e != "object") && (e = {}), e = $(e), le = // eslint-disable-next-line unicorn/prefer-includes
|
|
543
541
|
dn.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? un : e.PARSER_MEDIA_TYPE, C = le === "application/xhtml+xml" ? oe : X, v = "ALLOWED_TAGS" in e ? p({}, e.ALLOWED_TAGS, C) : nt, S = "ALLOWED_ATTR" in e ? p({}, e.ALLOWED_ATTR, C) : ot, ze = "ALLOWED_NAMESPACES" in e ? p({}, e.ALLOWED_NAMESPACES, oe) : cn, Pe = "ADD_URI_SAFE_ATTR" in e ? p(
|
|
544
|
-
$(
|
|
542
|
+
$(ft),
|
|
545
543
|
// eslint-disable-line indent
|
|
546
544
|
e.ADD_URI_SAFE_ATTR,
|
|
547
545
|
// eslint-disable-line indent
|
|
548
546
|
C
|
|
549
547
|
// eslint-disable-line indent
|
|
550
|
-
) :
|
|
548
|
+
) : ft, dt = "ADD_DATA_URI_TAGS" in e ? p(
|
|
551
549
|
$(ut),
|
|
552
550
|
// eslint-disable-line indent
|
|
553
551
|
e.ADD_DATA_URI_TAGS,
|
|
554
552
|
// eslint-disable-line indent
|
|
555
553
|
C
|
|
556
554
|
// eslint-disable-line indent
|
|
557
|
-
) : ut, J = "FORBID_CONTENTS" in e ? p({}, e.FORBID_CONTENTS, C) : ct, re = "FORBID_TAGS" in e ? p({}, e.FORBID_TAGS, C) : {}, Ne = "FORBID_ATTR" in e ? p({}, e.FORBID_ATTR, C) : {}, Q = "USE_PROFILES" in e ? e.USE_PROFILES : !1, it = e.ALLOW_ARIA_ATTR !== !1, xe = e.ALLOW_DATA_ATTR !== !1, at = e.ALLOW_UNKNOWN_PROTOCOLS || !1, rt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = e.SAFE_FOR_TEMPLATES || !1, q = e.WHOLE_DOCUMENT || !1, K = e.RETURN_DOM || !1, he = e.RETURN_DOM_FRAGMENT || !1, ge = e.RETURN_TRUSTED_TYPE || !1, Oe = e.FORCE_BODY || !1, st = e.SANITIZE_DOM !== !1, lt = e.SANITIZE_NAMED_PROPS || !1, Ie = e.KEEP_CONTENT !== !1, se = e.IN_PLACE || !1, tt = e.ALLOWED_URI_REGEXP || Ve, ee = e.NAMESPACE || H, w = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING &&
|
|
555
|
+
) : ut, J = "FORBID_CONTENTS" in e ? p({}, e.FORBID_CONTENTS, C) : ct, re = "FORBID_TAGS" in e ? p({}, e.FORBID_TAGS, C) : {}, Ne = "FORBID_ATTR" in e ? p({}, e.FORBID_ATTR, C) : {}, Q = "USE_PROFILES" in e ? e.USE_PROFILES : !1, it = e.ALLOW_ARIA_ATTR !== !1, xe = e.ALLOW_DATA_ATTR !== !1, at = e.ALLOW_UNKNOWN_PROTOCOLS || !1, rt = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Z = e.SAFE_FOR_TEMPLATES || !1, q = e.WHOLE_DOCUMENT || !1, K = e.RETURN_DOM || !1, he = e.RETURN_DOM_FRAGMENT || !1, ge = e.RETURN_TRUSTED_TYPE || !1, Oe = e.FORCE_BODY || !1, st = e.SANITIZE_DOM !== !1, lt = e.SANITIZE_NAMED_PROPS || !1, Ie = e.KEEP_CONTENT !== !1, se = e.IN_PLACE || !1, tt = e.ALLOWED_URI_REGEXP || Ve, ee = e.NAMESPACE || H, w = e.CUSTOM_ELEMENT_HANDLING || {}, e.CUSTOM_ELEMENT_HANDLING && mt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (w.tagNameCheck = e.CUSTOM_ELEMENT_HANDLING.tagNameCheck), e.CUSTOM_ELEMENT_HANDLING && mt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (w.attributeNameCheck = e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), Z && (xe = !1), he && (K = !0), Q && (v = p({}, Ye), S = [], Q.html === !0 && (p(v, qe), p(S, je)), Q.svg === !0 && (p(v, Te), p(S, we), p(S, fe)), Q.svgFilters === !0 && (p(v, Ae), p(S, we), p(S, fe)), Q.mathMl === !0 && (p(v, _e), p(S, Xe), p(S, fe))), e.ADD_TAGS && (v === nt && (v = $(v)), p(v, e.ADD_TAGS, C)), e.ADD_ATTR && (S === ot && (S = $(S)), p(S, e.ADD_ATTR, C)), e.ADD_URI_SAFE_ATTR && p(Pe, e.ADD_URI_SAFE_ATTR, C), e.FORBID_CONTENTS && (J === ct && (J = $(J)), p(J, e.FORBID_CONTENTS, C)), Ie && (v["#text"] = !0), q && p(v, ["html", "head", "body"]), v.table && (p(v, ["tbody"]), delete re.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
558
556
|
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
559
557
|
throw ie('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
560
558
|
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
561
559
|
throw ie('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
562
560
|
M = e.TRUSTED_TYPES_POLICY, ae = M.createHTML("");
|
|
563
561
|
} else
|
|
564
|
-
M === void 0 && (M = Yt(
|
|
562
|
+
M === void 0 && (M = Yt(me, k)), M !== null && typeof ae == "string" && (ae = M.createHTML(""));
|
|
565
563
|
i && i(e), te = e;
|
|
566
564
|
}
|
|
567
|
-
}, pt = p({}, ["mi", "mo", "mn", "ms", "mtext"]), ht = p({}, ["foreignobject", "desc", "title", "annotation-xml"]),
|
|
565
|
+
}, pt = p({}, ["mi", "mo", "mn", "ms", "mtext"]), ht = p({}, ["foreignobject", "desc", "title", "annotation-xml"]), mn = p({}, ["title", "style", "font", "a", "script"]), gt = p({}, [...Te, ...Ae, ...Pt]), yt = p({}, [..._e, ...Ut]), pn = function(e) {
|
|
568
566
|
let n = Ce(e);
|
|
569
567
|
(!n || !n.tagName) && (n = {
|
|
570
568
|
namespaceURI: ee,
|
|
571
569
|
tagName: "template"
|
|
572
570
|
});
|
|
573
571
|
const r = X(e.tagName), A = X(n.tagName);
|
|
574
|
-
return ze[e.namespaceURI] ? e.namespaceURI === be ? n.namespaceURI === H ? r === "svg" : n.namespaceURI === ye ? r === "svg" && (A === "annotation-xml" || pt[A]) : !!gt[r] : e.namespaceURI === ye ? n.namespaceURI === H ? r === "math" : n.namespaceURI === be ? r === "math" && ht[A] : !!yt[r] : e.namespaceURI === H ? n.namespaceURI === be && !ht[A] || n.namespaceURI === ye && !pt[A] ? !1 : !yt[r] && (
|
|
572
|
+
return ze[e.namespaceURI] ? e.namespaceURI === be ? n.namespaceURI === H ? r === "svg" : n.namespaceURI === ye ? r === "svg" && (A === "annotation-xml" || pt[A]) : !!gt[r] : e.namespaceURI === ye ? n.namespaceURI === H ? r === "math" : n.namespaceURI === be ? r === "math" && ht[A] : !!yt[r] : e.namespaceURI === H ? n.namespaceURI === be && !ht[A] || n.namespaceURI === ye && !pt[A] ? !1 : !yt[r] && (mn[r] || !gt[r]) : !!(le === "application/xhtml+xml" && ze[e.namespaceURI]) : !1;
|
|
575
573
|
}, Y = function(e) {
|
|
576
574
|
G(c.removed, {
|
|
577
575
|
element: e
|
|
@@ -673,7 +671,7 @@ var Nt = { exports: {} };
|
|
|
673
671
|
element: e.cloneNode()
|
|
674
672
|
}), e.textContent = n)), B("afterSanitizeElements", e, null), !1);
|
|
675
673
|
}, _t = function(e, n, r) {
|
|
676
|
-
if (st && (n === "id" || n === "name") && (r in b || r in
|
|
674
|
+
if (st && (n === "id" || n === "name") && (r in b || r in fn))
|
|
677
675
|
return !1;
|
|
678
676
|
if (!(xe && !Ne[n] && O(an, n))) {
|
|
679
677
|
if (!(it && O(rn, n))) {
|
|
@@ -734,8 +732,8 @@ var Nt = { exports: {} };
|
|
|
734
732
|
});
|
|
735
733
|
const St = C(e.nodeName);
|
|
736
734
|
if (_t(St, ce, D)) {
|
|
737
|
-
if (lt && (ce === "id" || ce === "name") && (He(R, e), D = ln + D), M && typeof
|
|
738
|
-
switch (
|
|
735
|
+
if (lt && (ce === "id" || ce === "name") && (He(R, e), D = ln + D), M && typeof me == "object" && typeof me.getAttributeType == "function" && !x)
|
|
736
|
+
switch (me.getAttributeType(St, ce)) {
|
|
739
737
|
case "TrustedHTML": {
|
|
740
738
|
D = M.createHTML(D);
|
|
741
739
|
break;
|
|
@@ -834,21 +832,21 @@ Ge.addHook("afterSanitizeAttributes", function(t) {
|
|
|
834
832
|
const Bn = class {
|
|
835
833
|
constructor(t) {
|
|
836
834
|
ne(this, t), this.htmlElement = document.createElement("html"), this.setBody = (o) => {
|
|
837
|
-
var
|
|
835
|
+
var m;
|
|
838
836
|
this.state = "loading", this.styles = [], this.hoistedFontURLs = /* @__PURE__ */ new Map(), this.sanitizedBody = "", document.querySelectorAll(".nylas-view-email-font").forEach((a) => {
|
|
839
837
|
a.remove();
|
|
840
838
|
}), (this.message ? bn(this.message) : En(o)) || (o = `<html><body>${Tn(o)}</body></html>`), this.htmlElement.innerHTML = o, this.detectDarkMode && zn(this.htmlElement), this.htmlElement.querySelectorAll("link").forEach((a) => {
|
|
841
839
|
if (console.debug(`[nylas-view-email] Hoisting link: ${a.getAttribute("href")}`), a.getAttribute("rel") === "stylesheet" && a.getAttribute("href")) {
|
|
842
|
-
const
|
|
843
|
-
if (
|
|
844
|
-
const i = new URL(
|
|
840
|
+
const f = a.getAttribute("href");
|
|
841
|
+
if (f) {
|
|
842
|
+
const i = new URL(f, window.location.href);
|
|
845
843
|
(i.protocol === "https:" || i.protocol === "http:") && this.hoistedFontURLs.set(i.href, i.href);
|
|
846
844
|
}
|
|
847
845
|
}
|
|
848
846
|
}), this.htmlElement.querySelectorAll("style").forEach((a) => {
|
|
849
847
|
a.innerHTML.split(`
|
|
850
|
-
`).forEach((
|
|
851
|
-
const i =
|
|
848
|
+
`).forEach((f) => {
|
|
849
|
+
const i = f.match(/@import url\((.*)\)/);
|
|
852
850
|
if (i) {
|
|
853
851
|
const l = new URL(i[1], window.location.href);
|
|
854
852
|
(l.protocol === "https:" || l.protocol === "http:") && this.hoistedFontURLs.set(l.href, l.href);
|
|
@@ -860,25 +858,25 @@ const Bn = class {
|
|
|
860
858
|
const s = this.htmlElement.querySelector(".gmail_quote");
|
|
861
859
|
if (s) {
|
|
862
860
|
const a = document.createElement("button");
|
|
863
|
-
a.classList.add("nylas-view-email-toggle-button"), a.setAttribute("aria-label", "Show quoted text"), a.innerText = "...", (
|
|
861
|
+
a.classList.add("nylas-view-email-toggle-button"), a.setAttribute("aria-label", "Show quoted text"), a.innerText = "...", (m = s.parentElement) == null || m.insertBefore(a, s);
|
|
864
862
|
}
|
|
865
|
-
this.sanitizedBody = Ge.sanitize(this.htmlElement.innerHTML), this.hoistedFontURLs.forEach((a,
|
|
863
|
+
this.sanitizedBody = Ge.sanitize(this.htmlElement.innerHTML), this.hoistedFontURLs.forEach((a, f) => {
|
|
866
864
|
const i = document.createElement("link");
|
|
867
865
|
i.setAttribute("rel", "stylesheet"), i.setAttribute("href", a), i.classList.add("nylas-view-email-font"), document.head.appendChild(i);
|
|
868
866
|
}), this.state = "ready";
|
|
869
867
|
}, this.handleMobileSize = () => {
|
|
870
|
-
var u, s,
|
|
868
|
+
var u, s, m, a;
|
|
871
869
|
const o = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
|
872
870
|
if (o <= 768) {
|
|
873
|
-
const
|
|
874
|
-
if (
|
|
871
|
+
const f = (u = this.viewEmailElement) == null ? void 0 : u.getBoundingClientRect();
|
|
872
|
+
if (f && this.viewEmailElement && this.parent && f.width > o) {
|
|
875
873
|
const i = this.parent, l = i == null ? void 0 : i.getBoundingClientRect();
|
|
876
874
|
T("Parent width:", l == null ? void 0 : l.width, "Parent height:", l == null ? void 0 : l.height), T("Parent client width:", i.clientWidth, "Parent client height:", i.clientHeight);
|
|
877
|
-
const E = l.width /
|
|
878
|
-
T("Scale:", N), this.viewEmailElement.style.setProperty("transform", `scale(${N})`), this.viewEmailElement.style.setProperty("transform-origin", "top left"), this.viewEmailElement.style.setProperty("height", `${
|
|
875
|
+
const E = l.width / f.width, _ = l.height / f.height, N = Math.min(E, _);
|
|
876
|
+
T("Scale:", N), this.viewEmailElement.style.setProperty("transform", `scale(${N})`), this.viewEmailElement.style.setProperty("transform-origin", "top left"), this.viewEmailElement.style.setProperty("height", `${f.height * N}px`);
|
|
879
877
|
}
|
|
880
878
|
} else
|
|
881
|
-
(s = this.viewEmailElement) == null || s.style.removeProperty("transform"), (
|
|
879
|
+
(s = this.viewEmailElement) == null || s.style.removeProperty("transform"), (m = this.viewEmailElement) == null || m.style.removeProperty("transform-origin"), (a = this.viewEmailElement) == null || a.style.removeProperty("height");
|
|
882
880
|
}, this.message = void 0, this.parent = void 0, this.attachments = [], this.detectDarkMode = !0, this.state = "loading", this.sanitizedBody = "", this.styles = [], this.viewEmailElement = void 0, this.hoistedFontURLs = /* @__PURE__ */ new Map();
|
|
883
881
|
}
|
|
884
882
|
connectedCallback() {
|
|
@@ -907,14 +905,14 @@ const Bn = class {
|
|
|
907
905
|
const t = (o = this.viewEmailElement) == null ? void 0 : o.querySelectorAll(".nylas-view-email-toggle-button");
|
|
908
906
|
t && t.forEach((u) => {
|
|
909
907
|
u.addEventListener("click", () => {
|
|
910
|
-
var
|
|
911
|
-
const s = (
|
|
908
|
+
var m;
|
|
909
|
+
const s = (m = this.viewEmailElement) == null ? void 0 : m.querySelector(".gmail_quote");
|
|
912
910
|
s && s.classList.toggle("show");
|
|
913
911
|
});
|
|
914
912
|
});
|
|
915
913
|
}
|
|
916
914
|
render() {
|
|
917
|
-
return console.debug("[nylas-view-email] render", { hoistedFontURLs: this.hoistedFontURLs }), g($e, { key: "
|
|
915
|
+
return console.debug("[nylas-view-email] render", { hoistedFontURLs: this.hoistedFontURLs }), g($e, { key: "fe606c06674789e63156056d8b71a5cb2202cf47" }, this.state === "loading" && g("div", null, "Loading..."), this.state === "ready" && g(An, null, this.styles.map((t) => g("style", null, Ge.sanitize(t.innerHTML))), g("div", { class: "view-email", part: "view-email", innerHTML: this.sanitizedBody, ref: (t) => this.viewEmailElement = t })));
|
|
918
916
|
}
|
|
919
917
|
get host() {
|
|
920
918
|
return Rt(this);
|
|
@@ -932,7 +930,7 @@ const Wn = ".sc-reply-all-icon-h{display:flex}", Gn = Wn, $n = class {
|
|
|
932
930
|
ne(this, t), this.width = "15", this.height = "15";
|
|
933
931
|
}
|
|
934
932
|
render() {
|
|
935
|
-
return g("svg", { key: "
|
|
933
|
+
return g("svg", { key: "2baf5fdfb4309e039a9a4e66ecacbf4481c2d7ca", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, g("path", { key: "d7f1586f9af096cb3a1876b681ba408387899788", d: "m1030.975 188 81.249 81.249-429.228 429.228h300.747c516.223 0 936.257 420.034 936.257 936.257v98.028h-114.92v-98.028c0-452.901-368.436-821.337-821.337-821.337H682.996l429.228 429.229-81.25 81.248-567.936-567.937L1030.975 188Zm-463.038.011 81.249 81.25-486.688 486.688 486.688 486.688-81.249 81.249L0 755.949 567.937 188.01Z", "fill-rule": "evenodd" }));
|
|
936
934
|
}
|
|
937
935
|
};
|
|
938
936
|
$n.style = Gn;
|
|
@@ -941,7 +939,7 @@ const qn = ".sc-reply-icon-h{display:flex}", Yn = qn, jn = class {
|
|
|
941
939
|
ne(this, t), this.width = "15", this.height = "15";
|
|
942
940
|
}
|
|
943
941
|
render() {
|
|
944
|
-
return g("svg", { key: "
|
|
942
|
+
return g("svg", { key: "07034b975afd3fa950dec8be4e28c16775b5a49e", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, g("path", { key: "5601b12fa1dde6412985fa2f701eeb3f9e2b07b4", d: "M835.942 632.563H244.966l478.08-478.08-90.496-90.496L-.026 696.563 632.55 1329.14l90.496-90.496-478.08-478.08h590.976c504.448 0 914.816 410.368 914.816 914.816v109.184h128V1675.38c0-574.976-467.84-1042.816-1042.816-1042.816", "fill-rule": "evenodd" }));
|
|
945
943
|
}
|
|
946
944
|
};
|
|
947
945
|
jn.style = Yn;
|