@nylas/react 1.1.3 → 1.1.5
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_2.entry-1e899552.js +25 -0
- package/dist/add-circle-icon_2.entry-31acee1d.cjs +1 -0
- package/dist/archive-icon.entry-b5f307e8.js +15 -0
- package/dist/archive-icon.entry-e932c9e6.cjs +1 -0
- package/dist/arrow-icon.entry-aae2e22d.js +15 -0
- package/dist/{arrow-icon.entry-2dfd8319.cjs → arrow-icon.entry-e35a6cad.cjs} +1 -1
- package/dist/bold-icon.entry-1e3c9b1f.cjs +1 -0
- package/dist/bold-icon.entry-d5d86b3f.js +15 -0
- package/dist/{button-component_2.entry-697bf5ac.js → button-component_2.entry-5284316e.js} +6 -6
- package/dist/{button-component_2.entry-27a504d9.cjs → button-component_2.entry-a86f8dca.cjs} +1 -1
- package/dist/{calendar-agenda-fill-icon_51.entry-52b5bf31.js → calendar-agenda-fill-icon_54.entry-5672c589.js} +1944 -1639
- package/dist/calendar-agenda-fill-icon_54.entry-702b29cc.cjs +10 -0
- package/dist/{calendar-cancel-icon.entry-e6a433a2.js → calendar-cancel-icon.entry-7f81de9d.js} +4 -4
- package/dist/{calendar-cancel-icon.entry-c6e2eed6.cjs → calendar-cancel-icon.entry-e9792eaa.cjs} +1 -1
- package/dist/{calendar-check-icon_2.entry-d88307d6.js → calendar-check-icon_2.entry-84db1700.js} +3 -3
- package/dist/{calendar-check-icon_2.entry-45cad6f1.cjs → calendar-check-icon_2.entry-ad055b37.cjs} +1 -1
- package/dist/{calendar-icon.entry-b2fffd21.cjs → calendar-icon.entry-019f7feb.cjs} +1 -1
- package/dist/{calendar-icon.entry-2badc962.js → calendar-icon.entry-45db1630.js} +4 -4
- package/dist/{checkbox-component_2.entry-3926b644.cjs → checkbox-component_2.entry-8325ff88.cjs} +1 -1
- package/dist/{checkbox-component_2.entry-5ab55050.js → checkbox-component_2.entry-84a053ff.js} +3 -3
- package/dist/{chevron-icon_3.entry-1fe5d097.cjs → chevron-icon_3.entry-0edde2a6.cjs} +1 -1
- package/dist/{chevron-icon_3.entry-664fae5d.js → chevron-icon_3.entry-ec894a13.js} +4 -4
- package/dist/{clock-icon_4.entry-f11f9dad.js → clock-icon_4.entry-8ec9c29b.js} +15 -15
- package/dist/{clock-icon_4.entry-efec2c08.cjs → clock-icon_4.entry-935fe48d.cjs} +1 -1
- package/dist/constants-c549b12b-7ea4c7f5.js +763 -0
- package/dist/constants-c549b12b-c85413b1.cjs +1 -0
- package/dist/copy-icon.entry-5a2030da.cjs +1 -0
- package/dist/{copy-icon.entry-70131e8e.js → copy-icon.entry-d9405510.js} +6 -6
- package/dist/{delete-icon.entry-e003695d.js → delete-icon.entry-1b0a3ba4.js} +4 -4
- package/dist/{delete-icon.entry-5d067fef.cjs → delete-icon.entry-3f3d1ffb.cjs} +1 -1
- package/dist/document-refresh-icon.entry-59a18097.cjs +1 -0
- package/dist/document-refresh-icon.entry-fab58d33.js +15 -0
- package/dist/elements/index.d.ts +0 -11
- package/dist/feedbackSync-b56b29ed-7a1f1f75.js +6035 -0
- package/dist/feedbackSync-b56b29ed-b6f352f3.cjs +448 -0
- package/dist/folder-icon.entry-b5a123d0.js +15 -0
- package/dist/folder-icon.entry-e85383b6.cjs +1 -0
- package/dist/forward-icon.entry-7c8ed4c3.cjs +1 -0
- package/dist/forward-icon.entry-88ab1a85.js +15 -0
- package/dist/{globe-icon.entry-6fc456c7.js → globe-icon.entry-6fb414ca.js} +5 -5
- package/dist/{globe-icon.entry-8c3c9e48.cjs → globe-icon.entry-b1253516.cjs} +1 -1
- package/dist/google-logo-icon_4.entry-ae09d065.cjs +1 -0
- package/dist/{google-logo-icon_4.entry-d6e0c4c0.js → google-logo-icon_4.entry-fe627741.js} +221 -207
- package/dist/inbox-icon.entry-7dce836e.cjs +1 -0
- package/dist/inbox-icon.entry-cec35da1.js +15 -0
- package/dist/{index-a282e817.js → index-3fd31877.js} +4194 -4123
- package/dist/index-bd6fdc8c.cjs +81 -0
- package/dist/index.d.ts +1 -1
- package/dist/{index.es-ab9affcc-18263b66.cjs → index.es-c7ca1bad-0a324dca.cjs} +5 -5
- package/dist/{index.es-ab9affcc-30461b18.js → index.es-c7ca1bad-b895d84b.js} +125 -131
- package/dist/{info-icon_2.entry-e582ac10.cjs → info-icon_2.entry-1dab6311.cjs} +1 -1
- package/dist/{info-icon_2.entry-d20b975c.js → info-icon_2.entry-f7e6b4aa.js} +3 -3
- package/dist/{input-color-picker.entry-27f4288f.js → input-color-picker.entry-30cda4e2.js} +3 -3
- package/dist/{input-color-picker.entry-c6a28671.cjs → input-color-picker.entry-b6e53c29.cjs} +1 -1
- package/dist/{input-component.entry-744fcec1.cjs → input-component.entry-1f1f8e00.cjs} +1 -1
- package/dist/{input-component.entry-b6f1c417.js → input-component.entry-7a04bc8b.js} +3 -3
- package/dist/{input-dropdown.entry-f13234d7.cjs → input-dropdown.entry-5e5b67be.cjs} +1 -1
- package/dist/{input-dropdown.entry-18744def.js → input-dropdown.entry-abf134a8.js} +2 -2
- package/dist/italic-icon.entry-4631c594.js +15 -0
- package/dist/italic-icon.entry-c793243b.cjs +1 -0
- package/dist/{multi-select-dropdown.entry-dde671d7.cjs → multi-select-dropdown.entry-2b8728d5.cjs} +1 -1
- package/dist/{multi-select-dropdown.entry-924809e1.js → multi-select-dropdown.entry-9a93da56.js} +2 -2
- package/dist/nylas-booked-event-card_12.entry-8d502a3c.cjs +1 -0
- package/dist/{nylas-booked-event-card_12.entry-52c3111d.js → nylas-booked-event-card_12.entry-f13f3f54.js} +294 -288
- package/dist/{nylas-form-card.entry-b0a2403f.js → nylas-form-card.entry-862519b4.js} +20 -20
- package/dist/nylas-form-card.entry-af179b96.cjs +1 -0
- package/dist/{nylas-if-state.entry-523fdc6b.js → nylas-if-state.entry-8803a762.js} +3 -3
- package/dist/{nylas-if-state.entry-53883c36.cjs → nylas-if-state.entry-c1c1282d.cjs} +1 -1
- package/dist/{nylas-login.entry-d9bf3974.js → nylas-login.entry-3e12f747.js} +3 -3
- package/dist/{nylas-login.entry-05e1df3e.cjs → nylas-login.entry-65f8f046.cjs} +1 -1
- package/dist/nylas-provider.entry-9626b113.cjs +1 -0
- package/dist/nylas-provider.entry-e3501bd1.js +264 -0
- package/dist/{nylas-scheduler-editor.entry-1a2f3ee0.cjs → nylas-scheduler-editor.entry-17cd1514.cjs} +2 -2
- package/dist/{nylas-scheduler-editor.entry-b434b526.js → nylas-scheduler-editor.entry-6df45b05.js} +25 -25
- package/dist/{nylas-scheduling.entry-b71080c8.js → nylas-scheduling.entry-08051ba3.js} +136 -124
- package/dist/nylas-scheduling.entry-b1fafd91.cjs +1 -0
- package/dist/{nylas-time-window-picker.entry-a6d1c648.cjs → nylas-time-window-picker.entry-4989d421.cjs} +1 -1
- package/dist/{nylas-time-window-picker.entry-c1ee860a.js → nylas-time-window-picker.entry-bdc8c6ea.js} +16 -16
- package/dist/{person-icon.entry-8833e3cc.js → person-icon.entry-d62a16b4.js} +2 -2
- package/dist/{person-icon.entry-80c9022e.cjs → person-icon.entry-fb7efa8f.cjs} +1 -1
- package/dist/play-icon.entry-01b95392.js +15 -0
- package/dist/play-icon.entry-f485a2c8.cjs +1 -0
- package/dist/react.cjs +1 -1
- package/dist/react.js +92 -103
- package/dist/{refresh-icon.entry-4d6791bd.js → refresh-icon.entry-1ff4b39f.js} +4 -4
- package/dist/{refresh-icon.entry-d4cc16b7.cjs → refresh-icon.entry-5f997e86.cjs} +1 -1
- package/dist/{register-component-a7ea27ad-fa2c4b17.js → register-component-3444af44-854971ad.js} +1 -1
- package/dist/{register-component-a7ea27ad-2343f3df.cjs → register-component-3444af44-9053e8c3.cjs} +1 -1
- package/dist/reply-all-icon.entry-1dad6514.cjs +1 -0
- package/dist/reply-all-icon.entry-cbafb8a0.js +15 -0
- package/dist/reply-icon.entry-162d9945.cjs +1 -0
- package/dist/reply-icon.entry-a43bc252.js +15 -0
- package/dist/{scheduler-config-store-2a3b403d-5176cd45.js → scheduler-config-store-ed4a8dfd-22db9285.js} +1 -2
- package/dist/scheduler-config-store-ed4a8dfd-eeaeaa50.cjs +1 -0
- package/dist/{scheduler-store-33ab8dea-9801357a.js → scheduler-store-d4784b24-9a5f5734.js} +134 -126
- package/dist/scheduler-store-d4784b24-aed474e8.cjs +1 -0
- package/dist/sent-icon.entry-a05486d5.js +15 -0
- package/dist/sent-icon.entry-a1aec7e9.cjs +1 -0
- package/dist/spam-icon.entry-473f11af.js +15 -0
- package/dist/spam-icon.entry-b481a04b.cjs +1 -0
- package/dist/star-icon.entry-12fdc345.js +15 -0
- package/dist/star-icon.entry-6b1fe3cf.cjs +1 -0
- package/dist/stop-icon.entry-4bd609f7.js +15 -0
- package/dist/stop-icon.entry-72481153.cjs +1 -0
- package/dist/{textarea-component.entry-174089bc.js → textarea-component.entry-47e1b2e6.js} +2 -2
- package/dist/{textarea-component.entry-019e75d0.cjs → textarea-component.entry-f330a755.cjs} +1 -1
- package/dist/{time-period-selector.entry-62c854d1.js → time-period-selector.entry-a4899368.js} +4 -4
- package/dist/{time-period-selector.entry-8466d0f2.cjs → time-period-selector.entry-c7611563.cjs} +1 -1
- package/dist/{translate-icon.entry-7d5cf4b8.cjs → translate-icon.entry-40dfa8c9.cjs} +1 -1
- package/dist/{translate-icon.entry-73f7127b.js → translate-icon.entry-4517838d.js} +2 -2
- package/dist/trash-fill-icon.entry-86ca3055.cjs +1 -0
- package/dist/trash-fill-icon.entry-d7e960eb.js +15 -0
- package/dist/underline-icon.entry-352970f5.js +15 -0
- package/dist/underline-icon.entry-f16d4943.cjs +1 -0
- package/dist/{warning-icon.entry-abf896c3.js → warning-icon.entry-63987dad.js} +5 -5
- package/dist/{warning-icon.entry-92638eeb.cjs → warning-icon.entry-79ef75b2.cjs} +1 -1
- package/package.json +3 -3
- package/dist/add-circle-icon_2.entry-b77120e5.cjs +0 -1
- package/dist/add-circle-icon_2.entry-fbc1e82b.js +0 -25
- package/dist/archive-icon_7.entry-30962e70.js +0 -75
- package/dist/archive-icon_7.entry-dd8c7642.cjs +0 -1
- package/dist/arrow-icon.entry-5b436054.js +0 -15
- package/dist/bold-icon_3.entry-5120a9c8.js +0 -35
- package/dist/bold-icon_3.entry-da2d1270.cjs +0 -1
- package/dist/calendar-agenda-fill-icon_51.entry-a25262b3.cjs +0 -7
- package/dist/constants-50c3e067-33cf0ffe.js +0 -3883
- package/dist/constants-50c3e067-5ec3f879.cjs +0 -15
- package/dist/copy-icon.entry-3965f206.cjs +0 -1
- package/dist/document-refresh-icon.entry-30c974df.cjs +0 -1
- package/dist/document-refresh-icon.entry-b4e01cd4.js +0 -15
- package/dist/elements-dc5b338e-55823d00.js +0 -28031
- package/dist/elements-dc5b338e-6883a39e.cjs +0 -16516
- package/dist/feedbackSync-81d4c4d8-dd4d2e32.js +0 -11735
- package/dist/feedbackSync-81d4c4d8-f4e78902.cjs +0 -455
- package/dist/flow-40ff9cea-6f8c30e2.cjs +0 -9
- package/dist/flow-40ff9cea-ee70fdf5.js +0 -505
- package/dist/focus-visible-e8093c16-431bbe59.cjs +0 -1
- package/dist/focus-visible-e8093c16-f403fee8.js +0 -84
- package/dist/forward-icon_6.entry-3bb91d58.js +0 -953
- package/dist/forward-icon_6.entry-ceec2371.cjs +0 -3
- package/dist/google-logo-icon_4.entry-4eb16cd2.cjs +0 -1
- package/dist/index-11f33e47.cjs +0 -82
- package/dist/mailbox-store-affca6de-9451094e.cjs +0 -1
- package/dist/mailbox-store-affca6de-d601dc6b.js +0 -380
- package/dist/nylas-booked-event-card_12.entry-d89c1f9d.cjs +0 -1
- package/dist/nylas-form-card.entry-ab61fdc5.cjs +0 -1
- package/dist/nylas-list-folders.entry-4ef6cb3d.cjs +0 -1
- package/dist/nylas-list-folders.entry-e37d069f.js +0 -120
- package/dist/nylas-list-threads.entry-3be623e9.cjs +0 -1
- package/dist/nylas-list-threads.entry-8ba62db8.js +0 -70
- package/dist/nylas-mailbox-pagination.entry-3dd05cf4.cjs +0 -1
- package/dist/nylas-mailbox-pagination.entry-50d9d9e3.js +0 -101
- package/dist/nylas-mailbox-toolbar-button.entry-9a77d137.js +0 -82
- package/dist/nylas-mailbox-toolbar-button.entry-d87b55de.cjs +0 -1
- package/dist/nylas-mailbox.entry-cb7d1031.js +0 -134
- package/dist/nylas-mailbox.entry-f7db9aa8.cjs +0 -1
- package/dist/nylas-provider.entry-1716bf48.cjs +0 -1
- package/dist/nylas-provider.entry-7aa46ea2.js +0 -145
- package/dist/nylas-reminder-emails.entry-88a862cd.cjs +0 -4
- package/dist/nylas-reminder-emails.entry-a86231b7.js +0 -129
- package/dist/nylas-reminder-time_2.entry-9589d5f2.js +0 -105
- package/dist/nylas-reminder-time_2.entry-bc76d4ab.cjs +0 -1
- package/dist/nylas-scheduling.entry-59e5e8c1.cjs +0 -1
- package/dist/nylas-threads-refresh.entry-544ca90a.js +0 -74
- package/dist/nylas-threads-refresh.entry-7ada7b2d.cjs +0 -1
- package/dist/nylas-threads-search.entry-181ba46a.js +0 -69
- package/dist/nylas-threads-search.entry-f1cb19e4.cjs +0 -1
- package/dist/nylas-view-thread.entry-6ae8dd64.cjs +0 -1
- package/dist/nylas-view-thread.entry-c066f522.js +0 -203
- package/dist/play-icon_2.entry-801c85bc.cjs +0 -1
- package/dist/play-icon_2.entry-efca8f00.js +0 -25
- package/dist/scheduler-config-store-2a3b403d-2263f999.cjs +0 -1
- package/dist/scheduler-store-33ab8dea-a0b39d36.cjs +0 -1
|
@@ -1,953 +0,0 @@
|
|
|
1
|
-
import { r as ne, h as g, c as We, d as T, H as $e, g as Rt, i as yn, w as bn, x as En, y as Tn, F as An, z as _n } from "./index-a282e817.js";
|
|
2
|
-
import { R as wn } from "./register-component-a7ea27ad-fa2c4b17.js";
|
|
3
|
-
import "react";
|
|
4
|
-
import "react-dom";
|
|
5
|
-
const vn = ".sc-forward-icon-h{display:flex}", Sn = vn, Cn = class {
|
|
6
|
-
constructor(t) {
|
|
7
|
-
ne(this, t), this.width = "15", this.height = "15";
|
|
8
|
-
}
|
|
9
|
-
render() {
|
|
10
|
-
return g("svg", { key: "8891f1f7567438e738b083764c02ff4b138c8016", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, g("path", { key: "ceedaaf7f76d5d43a9ac800672893d9ae244e880", 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" }));
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
Cn.style = Sn;
|
|
14
|
-
const Ln = ':host{display:grid;color:var(--nylas-color-primary-900)}.editor{position:relative;display:block;max-height:300px;overflow:auto;padding:1rem;border:1px solid var(--nylas-color-primary-300)}.editor blockquote{visibility:hidden;overflow:hidden;position:relative;transition:height 0.3s ease;margin:0}.editor blockquote::before{content:"...";visibility:visible;opacity:1;position:absolute;top:0;left:0;background-color:var(--nylas-color-primary-300);width:20px;text-align:center;color:var(--nylas-color-primary-800);vertical-align:middle;display:flex;justify-content:center;align-items:center;align-self:center;cursor:pointer}.editor .collapsed{height:20px}.editor .expanded{visibility:visible;opacity:1;height:auto;margin:0px 0px 0px 0.8ex;border-left:1px solid var(--nylas-color-primary-300);padding-left:1rem}.editor .expanded::before{display:none;}.buttons{display:flex;margin-top:1rem;justify-content:space-between}.buttons sp-button{border-radius:var(--nylas-border-radius);background-color:var(--nylas-color-primary-400);color:var(--nylas-color-primary-900);fill:var(--nylas-color-primary-900)}.buttons sp-button:hover{background-color:var(--nylas-color-primary-500)}.buttons sp-button:disabled{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);cursor:not-allowed}.buttons sp-button chevron-icon{display:inline-block}.buttons .close{justify-self:end}.toolbar{position:absolute;display:none;background-color:var(--nylas-color-primary-200);border-radius:var(--nylas-border-radius);z-index:1}.toolbar sp-button{border:0}', Rn = Ln, kn = class {
|
|
15
|
-
constructor(t) {
|
|
16
|
-
ne(this, t), this.close = We(this, "close", 7), this.send = We(this, "send", 7), this.closeComposer = (o) => {
|
|
17
|
-
this.close.emit(o);
|
|
18
|
-
}, this.sendComposer = (o) => {
|
|
19
|
-
var s;
|
|
20
|
-
if (!this.editorEl) {
|
|
21
|
-
T("no editor element");
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const u = this.editorEl.querySelector(".message-body");
|
|
25
|
-
if (!u) {
|
|
26
|
-
T("no message body");
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
this.message && (this.send.emit({
|
|
30
|
-
message: this.message,
|
|
31
|
-
replyBody: ((s = u.querySelector(".message-body")) == null ? void 0 : s.innerHTML) || ""
|
|
32
|
-
}), this.close.emit(o), this.editorEl.innerHTML = "");
|
|
33
|
-
}, this.message = void 0, this.viewEmailElement = void 0;
|
|
34
|
-
}
|
|
35
|
-
connectedCallback() {
|
|
36
|
-
}
|
|
37
|
-
disconnectedCallback() {
|
|
38
|
-
this.editorEl && (this.editorEl.innerHTML = "");
|
|
39
|
-
}
|
|
40
|
-
componentWillLoad() {
|
|
41
|
-
}
|
|
42
|
-
async componentDidLoad() {
|
|
43
|
-
if (this.message && this.watchBody(this.message), !this.editorEl) {
|
|
44
|
-
T("[connectedCallback] no editor element");
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
if (!this.toolbarEl) {
|
|
48
|
-
T("[connectedCallback] no toolbar element");
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const t = this.editorEl, o = this.toolbarEl;
|
|
52
|
-
t.addEventListener("mouseup", (u) => {
|
|
53
|
-
var W;
|
|
54
|
-
const s = (W = this.host.shadowRoot) == null ? void 0 : W.getSelection();
|
|
55
|
-
if (!s) {
|
|
56
|
-
T("no selection");
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const m = s.getRangeAt(0), a = s.toString();
|
|
60
|
-
if (!a) {
|
|
61
|
-
o.style.display = "none";
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const f = t.querySelector(".message-body");
|
|
65
|
-
if (!f) {
|
|
66
|
-
T("no message body");
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
const l = m.commonAncestorContainer.parentElement;
|
|
70
|
-
if (!l)
|
|
71
|
-
return;
|
|
72
|
-
const E = f.getBoundingClientRect();
|
|
73
|
-
T("messageBodyRect", { messageBodyRect: E });
|
|
74
|
-
const _ = l.getBoundingClientRect();
|
|
75
|
-
T("foundRect", { foundRect: _ });
|
|
76
|
-
const de = (l.childNodes[0].textContent || "").indexOf(a), G = window.getComputedStyle(l).fontSize, X = parseInt(G.replace("px", ""), 10), oe = _.top - E.top - o.clientHeight, Ee = de * (1 / X) * 100;
|
|
77
|
-
o.style.top = `${oe}px`, o.style.left = `${Ee}px`, o.style.display = "block";
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
watchBody(t) {
|
|
81
|
-
var a;
|
|
82
|
-
if (!this.editorEl) {
|
|
83
|
-
T("no editor element");
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
this.editorEl.querySelectorAll(".message-body").forEach((f) => f.remove());
|
|
87
|
-
const o = document.createElement("div");
|
|
88
|
-
o.classList.add("message-body");
|
|
89
|
-
const u = document.createElement("p");
|
|
90
|
-
u.innerHTML = " ", o.appendChild(u);
|
|
91
|
-
const s = document.createElement("br");
|
|
92
|
-
o.appendChild(s);
|
|
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;
|
|
97
|
-
const i = document.createElement("blockquote");
|
|
98
|
-
i.classList.add("collapsed"), i.classList.add("gmail_quote"), i.innerHTML = f.innerHTML, o.appendChild(i), T("replyContainer", { replyContainer: i });
|
|
99
|
-
}
|
|
100
|
-
this.editorEl.appendChild(o), this.editorEl.querySelectorAll("blockquote.collapsed").forEach((f) => {
|
|
101
|
-
f.addEventListener("click", function(i) {
|
|
102
|
-
i.preventDefault();
|
|
103
|
-
const l = i.target;
|
|
104
|
-
l.classList.remove("collapsed"), l.classList.add("expanded");
|
|
105
|
-
}, { once: !0 });
|
|
106
|
-
}), this.editorEl.focus();
|
|
107
|
-
}
|
|
108
|
-
render() {
|
|
109
|
-
return g($e, { key: "d16b0075c18f863cb92c2400dab68bd1766c7f51" }, g("sp-theme", { key: "9c4297144cac6dd42ae17739e6f8b80efda182a1", scale: "medium", color: "dark" }, g("div", { key: "b8bee5814ffa98861e57e7afac186c3d69bbbb28", class: "editor", contentEditable: !0, ref: (t) => this.editorEl = t }, g("div", { key: "028cf6ba47103b496eecbb98eab737f9bc97cdae", class: "toolbar", ref: (t) => this.toolbarEl = t, contentEditable: !1 }, g("sp-button", { key: "c7c53aa50a292ca4f3a846c3d5a9c8960dfb64f2", quiet: !0, onClick: () => document.execCommand("bold") }, g("div", { key: "6a65f5bc23b70ac9497c7a276828a6a45a9f2b4c", slot: "icon" }, g("bold-icon", { key: "4905ebd7af96f4720b65d8eb4351071cd764f242" })), g("div", { key: "fd72b3f9d240cdf35db6d582b23e06e245c82e30", slot: "label" }, "Bold")), g("sp-button", { key: "8a976df1ae0e585168fef8b33893e98138507f91", quiet: !0, onClick: () => document.execCommand("underline") }, g("div", { key: "e64bea813d183d1281ea08e009a9ca96df90e2e9", slot: "icon" }, g("underline-icon", { key: "07a7303588679f51a354cd921880e9788677e516" })), g("div", { key: "8c9d28c29b4d683ca98a1c96baa378b648f6fb3c", slot: "label" }, "Underline")), g("sp-button", { key: "524ac7ef259da9e9d7e906724bba1c853db6f2e4", quiet: !0, onClick: () => document.execCommand("italic") }, g("div", { key: "3ccf78e2199b75ebc997bb812e9c4cda39a19858", slot: "icon" }, g("italic-icon", { key: "b116d9b36519feb9d5a3cf226c0a59921f30b1a7" })), g("div", { key: "eddf79cba307cd309c6e9d63d245b4f65114f7c4", slot: "label" }, "Italic")))), g("div", { key: "bbf5547108af923b21724e39f23603dad4baddd6", class: "buttons" }, g("sp-button", { key: "1d23daa6a60873e5be87eb0d44d6695839c8c982", onClick: this.sendComposer, class: "send" }, "Send"), g("sp-button", { key: "5351ffc23700fd9827659d331514f2eee70b8bf9", onClick: this.closeComposer, class: "close" }, "Close"))));
|
|
110
|
-
}
|
|
111
|
-
get host() {
|
|
112
|
-
return Rt(this);
|
|
113
|
-
}
|
|
114
|
-
static get watchers() {
|
|
115
|
-
return {
|
|
116
|
-
message: ["watchBody"]
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
kn.style = Rn;
|
|
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;
|
|
122
|
-
var xn = function(t, o, u, s) {
|
|
123
|
-
var m = arguments.length, a = m < 3 ? o : s === null ? s = Object.getOwnPropertyDescriptor(o, u) : s, f;
|
|
124
|
-
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
125
|
-
a = Reflect.decorate(t, o, u, s);
|
|
126
|
-
else
|
|
127
|
-
for (var i = t.length - 1; i >= 0; i--)
|
|
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;
|
|
130
|
-
}, Be = function(t, o) {
|
|
131
|
-
if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
|
|
132
|
-
return Reflect.metadata(t, o);
|
|
133
|
-
};
|
|
134
|
-
const kt = class {
|
|
135
|
-
constructor(t) {
|
|
136
|
-
ne(this, t), this.summarize = We(this, "summarize", 7), this.abortController = new AbortController(), this.onClick = async (o) => {
|
|
137
|
-
var u, s;
|
|
138
|
-
o.preventDefault(), o.stopPropagation(), this.state === "stopped" ? this.message && (this.abortController = new AbortController(), this.summarize.emit({
|
|
139
|
-
abortController: this.abortController,
|
|
140
|
-
playAudio: this.playAudio,
|
|
141
|
-
message: this.message,
|
|
142
|
-
updateState: this.updateState
|
|
143
|
-
}).defaultPrevented || (T("[nylas-summarize-message-button] Default event not prevented, summarizing message"), this.audioRef && (await this.audioRef.play().then(() => {
|
|
144
|
-
var a;
|
|
145
|
-
return (a = this.audioRef) == null ? void 0 : a.pause();
|
|
146
|
-
}).catch((a) => console.error("Error playing audio:", a)), await this.audioRef.play().catch((a) => console.error("Error playing audio:", a))))) : this.state === "playing" ? ((u = this.abortController) == null || u.abort(), (s = this.audioRef) == null || s.pause()) : this.state = "stopped";
|
|
147
|
-
}, this.message = void 0, this.state = "stopped", this.playAudio = this.playAudio.bind(this), this.updateState = this.updateState.bind(this);
|
|
148
|
-
}
|
|
149
|
-
connectedCallback() {
|
|
150
|
-
}
|
|
151
|
-
disconnectedCallback() {
|
|
152
|
-
}
|
|
153
|
-
async componentWillLoad() {
|
|
154
|
-
T("[nylas-summarize-message-button] Component will load");
|
|
155
|
-
}
|
|
156
|
-
async componentDidLoad() {
|
|
157
|
-
T("[nylas-summarize-message-button] Component did load");
|
|
158
|
-
}
|
|
159
|
-
async updateState(t) {
|
|
160
|
-
this.state = t;
|
|
161
|
-
}
|
|
162
|
-
async playAudio(t) {
|
|
163
|
-
if (!this.audioRef) {
|
|
164
|
-
this.state = "stopped";
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
if (!t) {
|
|
168
|
-
this.state = "stopped";
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
const o = this.audioRef;
|
|
172
|
-
if (!("MediaSource" in window)) {
|
|
173
|
-
const i = await t;
|
|
174
|
-
if (i == null)
|
|
175
|
-
throw new Error("ReadableStream not yet supported in this browser.");
|
|
176
|
-
const l = i.getReader(), E = [];
|
|
177
|
-
await this.readChunk(l, E);
|
|
178
|
-
const _ = new Blob(E, { type: "audio/mpeg" }), N = URL.createObjectURL(_);
|
|
179
|
-
o.src = N;
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
const u = new MediaSource();
|
|
183
|
-
let s, m = !1;
|
|
184
|
-
o.src = URL.createObjectURL(u), u.addEventListener("sourceopen", a);
|
|
185
|
-
async function a() {
|
|
186
|
-
s = u.addSourceBuffer("audio/mpeg"), s.addEventListener("updateend", f);
|
|
187
|
-
const i = await t;
|
|
188
|
-
if (i == null)
|
|
189
|
-
throw new Error("ReadableStream not yet supported in this browser.");
|
|
190
|
-
const l = i.getReader(), E = () => {
|
|
191
|
-
l.read().then(({ done: _, value: N }) => {
|
|
192
|
-
if (_) {
|
|
193
|
-
m = !0;
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
s.updating || s.appendBuffer(N), E();
|
|
197
|
-
}).catch((_) => {
|
|
198
|
-
console.error("Error while fetching and appending chunks:", _);
|
|
199
|
-
});
|
|
200
|
-
};
|
|
201
|
-
E(), o.paused && o.play().catch((_) => console.error("Error playing audio:", _));
|
|
202
|
-
}
|
|
203
|
-
function f() {
|
|
204
|
-
if (m) {
|
|
205
|
-
u.endOfStream(), u.removeEventListener("sourceopen", a), u.removeEventListener("sourceclose", () => {
|
|
206
|
-
T("[nylas-summarize-message-button] Source closed");
|
|
207
|
-
}), s.removeEventListener("updateend", f);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
async readChunk(t, o) {
|
|
213
|
-
return t.read().then(({ done: u, value: s }) => u ? o : (o.push(s), this.readChunk(t, o)));
|
|
214
|
-
}
|
|
215
|
-
render() {
|
|
216
|
-
return g($e, { key: "ea90a71f09b4b71f83271816680f466c85125368" }, g("sp-theme", { key: "317fbcb6f72b0e3eedbd63e52804b333af260987", scale: "medium", color: "dark" }, g("sp-button", { key: "dbaa8ee59ab4c449d0e12da8fa6e10a4476cee4a", label: "Summarize email", "icon-only": !0, onClickCapture: this.onClick, class: {
|
|
217
|
-
"summarize-button": !0,
|
|
218
|
-
stopped: this.state === "stopped",
|
|
219
|
-
loading: this.state === "loading",
|
|
220
|
-
playing: this.state === "playing"
|
|
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: "7794f0eaad660040bb2bbd7ea25b6590096b9648", ref: (t) => this.audioRef = t, autoPlay: !0, onPlaying: () => this.state = "playing", onPause: () => this.state = "stopped", onEnded: () => {
|
|
222
|
-
this.state = "stopped", T("[nylas-summarize-message-button] Audio ended");
|
|
223
|
-
} })));
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
xn([
|
|
227
|
-
wn({
|
|
228
|
-
name: "nylas-summarize-message-button",
|
|
229
|
-
eventToProps: {
|
|
230
|
-
summarize: async (t, o) => {
|
|
231
|
-
const { playAudio: u, updateState: s, abortController: m, message: a } = t.detail, f = _n(a.body || "");
|
|
232
|
-
await s("loading");
|
|
233
|
-
try {
|
|
234
|
-
const i = await o.messages.summarizeText(f), l = o.messages.textToSpeech(i, m);
|
|
235
|
-
await u(l);
|
|
236
|
-
} catch (i) {
|
|
237
|
-
await s("stopped"), console.error("Error summarizing message:", i);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
},
|
|
241
|
-
fireRegisterEvent: !0
|
|
242
|
-
}),
|
|
243
|
-
Be("design:type", Function),
|
|
244
|
-
Be("design:paramtypes", []),
|
|
245
|
-
Be("design:returntype", void 0)
|
|
246
|
-
], kt.prototype, "render", null);
|
|
247
|
-
kt.style = Nn;
|
|
248
|
-
function P(t) {
|
|
249
|
-
return !window.matchMedia("(prefers-color-scheme: dark)").matches || !t ? t : t === "transparent" ? "color" : t.startsWith("#") ? Dn(t) : t.startsWith("rgb") ? Mt(t) : t.startsWith("hsl") ? On(t) : In(t) ? Pn(t) : t;
|
|
250
|
-
}
|
|
251
|
-
function Dn(t) {
|
|
252
|
-
t.length < 7 && (t = "#" + t[1] + t[1] + t[2] + t[2] + t[3] + t[3]);
|
|
253
|
-
const o = (255 - parseInt(t.slice(1, 3), 16)).toString(16).padStart(2, "0"), u = (255 - parseInt(t.slice(3, 5), 16)).toString(16).padStart(2, "0"), s = (255 - parseInt(t.slice(5, 7), 16)).toString(16).padStart(2, "0");
|
|
254
|
-
return `#${o}${u}${s}`;
|
|
255
|
-
}
|
|
256
|
-
function Mt(t) {
|
|
257
|
-
var a;
|
|
258
|
-
const o = (a = t.match(/\d+/g)) == null ? void 0 : a.map(Number);
|
|
259
|
-
if (!o)
|
|
260
|
-
return t;
|
|
261
|
-
const [u, s, m] = o;
|
|
262
|
-
return `rgb(${255 - u}, ${255 - s}, ${255 - m})`;
|
|
263
|
-
}
|
|
264
|
-
function On(t) {
|
|
265
|
-
var a;
|
|
266
|
-
const o = (a = t.match(/\d+\.?\d*/g)) == null ? void 0 : a.map(Number);
|
|
267
|
-
if (!o)
|
|
268
|
-
return t;
|
|
269
|
-
const [u, s, m] = o;
|
|
270
|
-
return `hsl(${u}, ${s}%, ${100 - m}%)`;
|
|
271
|
-
}
|
|
272
|
-
function In(t) {
|
|
273
|
-
return /^[a-z]+$/i.test(t);
|
|
274
|
-
}
|
|
275
|
-
function Pn(t) {
|
|
276
|
-
return Mt(Un(t));
|
|
277
|
-
}
|
|
278
|
-
function Un(t) {
|
|
279
|
-
return t.toLowerCase() === "red" ? "rgb(255, 0, 0)" : "rgb(0, 0, 0)";
|
|
280
|
-
}
|
|
281
|
-
function Lt(t) {
|
|
282
|
-
if (t instanceof HTMLStyleElement) {
|
|
283
|
-
let o = t.textContent;
|
|
284
|
-
if (o) {
|
|
285
|
-
o = o.replaceAll(/@media\s*\(prefers-color-scheme:\s*(dark|light)\)\s*\{([^}]+)\}/g, "");
|
|
286
|
-
const u = o.matchAll(/border-color:\s*([^;]+)/g);
|
|
287
|
-
if (u)
|
|
288
|
-
for (const i of u) {
|
|
289
|
-
const [l, E] = i, _ = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
290
|
-
o = o.replaceAll(_, l.replace(E, P(E)));
|
|
291
|
-
}
|
|
292
|
-
const s = o.matchAll(/border:\s*([^;]+)/g);
|
|
293
|
-
if (s)
|
|
294
|
-
for (const i of s) {
|
|
295
|
-
const l = i[0].trim(), E = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), [_, N, U] = i[1].split(" ");
|
|
296
|
-
o = o.replaceAll(E, l.replace(U, P(U)));
|
|
297
|
-
}
|
|
298
|
-
const m = o.matchAll(/background-color:\s*([^;]+)/g);
|
|
299
|
-
if (m)
|
|
300
|
-
for (const i of m) {
|
|
301
|
-
const [l, E] = i, _ = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
302
|
-
o = o.replaceAll(_, l.replace(E, P(E))), T("backgroundColor", { fullMatch: l, replace: l.replace(E, P(E)), color: E, invertColor: P(E) });
|
|
303
|
-
}
|
|
304
|
-
const a = o.matchAll(/background:\s*([^;]+)/g);
|
|
305
|
-
if (a)
|
|
306
|
-
for (const i of a) {
|
|
307
|
-
const l = i[0].trim(), E = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), [_, N, U] = i[1].split(" ");
|
|
308
|
-
o = o.replaceAll(E, l.replace(U, P(U)));
|
|
309
|
-
}
|
|
310
|
-
const f = o.matchAll(/color:\s*([^;]+)/g);
|
|
311
|
-
if (f)
|
|
312
|
-
for (const i of f) {
|
|
313
|
-
const [l, E] = i, _ = l.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
314
|
-
o = o.replaceAll(_, l.replace(E, P(E)));
|
|
315
|
-
}
|
|
316
|
-
t.textContent = o;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
if (t instanceof HTMLElement) {
|
|
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");
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
function zn(t) {
|
|
325
|
-
Lt(t), t.querySelectorAll("*").forEach((u) => Lt(u));
|
|
326
|
-
}
|
|
327
|
-
var Nt = { exports: {} };
|
|
328
|
-
/*! @license DOMPurify 3.0.8 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.8/LICENSE */
|
|
329
|
-
(function(t, o) {
|
|
330
|
-
(function(u, s) {
|
|
331
|
-
t.exports = s();
|
|
332
|
-
})(yn, function() {
|
|
333
|
-
const {
|
|
334
|
-
entries: u,
|
|
335
|
-
setPrototypeOf: s,
|
|
336
|
-
isFrozen: m,
|
|
337
|
-
getPrototypeOf: a,
|
|
338
|
-
getOwnPropertyDescriptor: f
|
|
339
|
-
} = Object;
|
|
340
|
-
let {
|
|
341
|
-
freeze: i,
|
|
342
|
-
seal: l,
|
|
343
|
-
create: E
|
|
344
|
-
} = Object, {
|
|
345
|
-
apply: _,
|
|
346
|
-
construct: N
|
|
347
|
-
} = typeof Reflect < "u" && Reflect;
|
|
348
|
-
i || (i = function(c) {
|
|
349
|
-
return c;
|
|
350
|
-
}), l || (l = function(c) {
|
|
351
|
-
return c;
|
|
352
|
-
}), _ || (_ = function(c, b, h) {
|
|
353
|
-
return c.apply(b, h);
|
|
354
|
-
}), N || (N = function(c, b) {
|
|
355
|
-
return new c(...b);
|
|
356
|
-
});
|
|
357
|
-
const U = I(Array.prototype.forEach), de = I(Array.prototype.pop), G = I(Array.prototype.push), X = I(String.prototype.toLowerCase), oe = I(String.prototype.toString), Ee = I(String.prototype.match), W = I(String.prototype.replace), xt = I(String.prototype.indexOf), Dt = I(String.prototype.trim), O = I(RegExp.prototype.test), ie = Ot(TypeError);
|
|
358
|
-
function I(y) {
|
|
359
|
-
return function(c) {
|
|
360
|
-
for (var b = arguments.length, h = new Array(b > 1 ? b - 1 : 0), k = 1; k < b; k++)
|
|
361
|
-
h[k - 1] = arguments[k];
|
|
362
|
-
return _(y, c, h);
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
function Ot(y) {
|
|
366
|
-
return function() {
|
|
367
|
-
for (var c = arguments.length, b = new Array(c), h = 0; h < c; h++)
|
|
368
|
-
b[h] = arguments[h];
|
|
369
|
-
return N(y, b);
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
function p(y, c) {
|
|
373
|
-
let b = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : X;
|
|
374
|
-
s && s(y, null);
|
|
375
|
-
let h = c.length;
|
|
376
|
-
for (; h--; ) {
|
|
377
|
-
let k = c[h];
|
|
378
|
-
if (typeof k == "string") {
|
|
379
|
-
const F = b(k);
|
|
380
|
-
F !== k && (m(c) || (c[h] = F), k = F);
|
|
381
|
-
}
|
|
382
|
-
y[k] = !0;
|
|
383
|
-
}
|
|
384
|
-
return y;
|
|
385
|
-
}
|
|
386
|
-
function It(y) {
|
|
387
|
-
for (let c = 0; c < y.length; c++)
|
|
388
|
-
f(y, c) === void 0 && (y[c] = null);
|
|
389
|
-
return y;
|
|
390
|
-
}
|
|
391
|
-
function $(y) {
|
|
392
|
-
const c = E(null);
|
|
393
|
-
for (const [b, h] of u(y))
|
|
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);
|
|
395
|
-
return c;
|
|
396
|
-
}
|
|
397
|
-
function ue(y, c) {
|
|
398
|
-
for (; y !== null; ) {
|
|
399
|
-
const h = f(y, c);
|
|
400
|
-
if (h) {
|
|
401
|
-
if (h.get)
|
|
402
|
-
return I(h.get);
|
|
403
|
-
if (typeof h.value == "function")
|
|
404
|
-
return I(h.value);
|
|
405
|
-
}
|
|
406
|
-
y = a(y);
|
|
407
|
-
}
|
|
408
|
-
function b(h) {
|
|
409
|
-
return console.warn("fallback value for", h), null;
|
|
410
|
-
}
|
|
411
|
-
return b;
|
|
412
|
-
}
|
|
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(
|
|
414
|
-
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
415
|
-
// eslint-disable-line no-useless-escape
|
|
416
|
-
), Gt = l(/^(?:\w+script|data):/i), $t = l(
|
|
417
|
-
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
418
|
-
// eslint-disable-line no-control-regex
|
|
419
|
-
), Ze = l(/^html$/i);
|
|
420
|
-
var Ke = /* @__PURE__ */ Object.freeze({
|
|
421
|
-
__proto__: null,
|
|
422
|
-
MUSTACHE_EXPR: zt,
|
|
423
|
-
ERB_EXPR: Ft,
|
|
424
|
-
TMPLIT_EXPR: Ht,
|
|
425
|
-
DATA_ATTR: Bt,
|
|
426
|
-
ARIA_ATTR: Wt,
|
|
427
|
-
IS_ALLOWED_URI: Ve,
|
|
428
|
-
IS_SCRIPT_OR_DATA: Gt,
|
|
429
|
-
ATTR_WHITESPACE: $t,
|
|
430
|
-
DOCTYPE_NAME: Ze
|
|
431
|
-
});
|
|
432
|
-
const qt = function() {
|
|
433
|
-
return typeof window > "u" ? null : window;
|
|
434
|
-
}, Yt = function(c, b) {
|
|
435
|
-
if (typeof c != "object" || typeof c.createPolicy != "function")
|
|
436
|
-
return null;
|
|
437
|
-
let h = null;
|
|
438
|
-
const k = "data-tt-policy-suffix";
|
|
439
|
-
b && b.hasAttribute(k) && (h = b.getAttribute(k));
|
|
440
|
-
const F = "dompurify" + (h ? "#" + h : "");
|
|
441
|
-
try {
|
|
442
|
-
return c.createPolicy(F, {
|
|
443
|
-
createHTML(V) {
|
|
444
|
-
return V;
|
|
445
|
-
},
|
|
446
|
-
createScriptURL(V) {
|
|
447
|
-
return V;
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
} catch {
|
|
451
|
-
return console.warn("TrustedTypes policy " + F + " could not be created."), null;
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
function Qe() {
|
|
455
|
-
let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : qt();
|
|
456
|
-
const c = (d) => Qe(d);
|
|
457
|
-
if (c.version = "3.0.8", c.removed = [], !y || !y.document || y.document.nodeType !== 9)
|
|
458
|
-
return c.isSupported = !1, c;
|
|
459
|
-
let {
|
|
460
|
-
document: b
|
|
461
|
-
} = y;
|
|
462
|
-
const h = b, k = h.currentScript, {
|
|
463
|
-
DocumentFragment: F,
|
|
464
|
-
HTMLTemplateElement: V,
|
|
465
|
-
Node: ve,
|
|
466
|
-
Element: Je,
|
|
467
|
-
NodeFilter: Se,
|
|
468
|
-
NamedNodeMap: Xt = y.NamedNodeMap || y.MozNamedAttrMap,
|
|
469
|
-
HTMLFormElement: Vt,
|
|
470
|
-
DOMParser: Zt,
|
|
471
|
-
trustedTypes: me
|
|
472
|
-
} = y, pe = Je.prototype, Kt = ue(pe, "cloneNode"), Qt = ue(pe, "nextSibling"), Jt = ue(pe, "childNodes"), Ce = ue(pe, "parentNode");
|
|
473
|
-
if (typeof V == "function") {
|
|
474
|
-
const d = b.createElement("template");
|
|
475
|
-
d.content && d.content.ownerDocument && (b = d.content.ownerDocument);
|
|
476
|
-
}
|
|
477
|
-
let M, ae = "";
|
|
478
|
-
const {
|
|
479
|
-
implementation: Le,
|
|
480
|
-
createNodeIterator: en,
|
|
481
|
-
createDocumentFragment: tn,
|
|
482
|
-
getElementsByTagName: nn
|
|
483
|
-
} = b, {
|
|
484
|
-
importNode: on
|
|
485
|
-
} = h;
|
|
486
|
-
let z = {};
|
|
487
|
-
c.isSupported = typeof u == "function" && typeof Ce == "function" && Le && Le.createHTMLDocument !== void 0;
|
|
488
|
-
const {
|
|
489
|
-
MUSTACHE_EXPR: Re,
|
|
490
|
-
ERB_EXPR: ke,
|
|
491
|
-
TMPLIT_EXPR: Me,
|
|
492
|
-
DATA_ATTR: an,
|
|
493
|
-
ARIA_ATTR: rn,
|
|
494
|
-
IS_SCRIPT_OR_DATA: sn,
|
|
495
|
-
ATTR_WHITESPACE: et
|
|
496
|
-
} = Ke;
|
|
497
|
-
let {
|
|
498
|
-
IS_ALLOWED_URI: tt
|
|
499
|
-
} = Ke, v = null;
|
|
500
|
-
const nt = p({}, [...qe, ...Te, ...Ae, ..._e, ...Ye]);
|
|
501
|
-
let S = null;
|
|
502
|
-
const ot = p({}, [...je, ...we, ...Xe, ...fe]);
|
|
503
|
-
let w = Object.seal(E(null, {
|
|
504
|
-
tagNameCheck: {
|
|
505
|
-
writable: !0,
|
|
506
|
-
configurable: !1,
|
|
507
|
-
enumerable: !0,
|
|
508
|
-
value: null
|
|
509
|
-
},
|
|
510
|
-
attributeNameCheck: {
|
|
511
|
-
writable: !0,
|
|
512
|
-
configurable: !1,
|
|
513
|
-
enumerable: !0,
|
|
514
|
-
value: null
|
|
515
|
-
},
|
|
516
|
-
allowCustomizedBuiltInElements: {
|
|
517
|
-
writable: !0,
|
|
518
|
-
configurable: !1,
|
|
519
|
-
enumerable: !0,
|
|
520
|
-
value: !1
|
|
521
|
-
}
|
|
522
|
-
})), re = null, Ne = null, it = !0, xe = !0, at = !1, rt = !0, Z = !1, q = !1, De = !1, Oe = !1, K = !1, he = !1, ge = !1, st = !0, lt = !1;
|
|
523
|
-
const ln = "user-content-";
|
|
524
|
-
let Ie = !0, se = !1, Q = {}, J = null;
|
|
525
|
-
const ct = p({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
526
|
-
let dt = null;
|
|
527
|
-
const ut = p({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
528
|
-
let Pe = null;
|
|
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";
|
|
530
|
-
let ee = H, Ue = !1, ze = null;
|
|
531
|
-
const cn = p({}, [ye, be, H], oe);
|
|
532
|
-
let le = null;
|
|
533
|
-
const dn = ["application/xhtml+xml", "text/html"], un = "text/html";
|
|
534
|
-
let C = null, te = null;
|
|
535
|
-
const fn = b.createElement("form"), mt = function(e) {
|
|
536
|
-
return e instanceof RegExp || e instanceof Function;
|
|
537
|
-
}, Fe = function() {
|
|
538
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
539
|
-
if (!(te && te === e)) {
|
|
540
|
-
if ((!e || typeof e != "object") && (e = {}), e = $(e), le = // eslint-disable-next-line unicorn/prefer-includes
|
|
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(
|
|
542
|
-
$(ft),
|
|
543
|
-
// eslint-disable-line indent
|
|
544
|
-
e.ADD_URI_SAFE_ATTR,
|
|
545
|
-
// eslint-disable-line indent
|
|
546
|
-
C
|
|
547
|
-
// eslint-disable-line indent
|
|
548
|
-
) : ft, dt = "ADD_DATA_URI_TAGS" in e ? p(
|
|
549
|
-
$(ut),
|
|
550
|
-
// eslint-disable-line indent
|
|
551
|
-
e.ADD_DATA_URI_TAGS,
|
|
552
|
-
// eslint-disable-line indent
|
|
553
|
-
C
|
|
554
|
-
// eslint-disable-line indent
|
|
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) {
|
|
556
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
557
|
-
throw ie('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
558
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
559
|
-
throw ie('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
560
|
-
M = e.TRUSTED_TYPES_POLICY, ae = M.createHTML("");
|
|
561
|
-
} else
|
|
562
|
-
M === void 0 && (M = Yt(me, k)), M !== null && typeof ae == "string" && (ae = M.createHTML(""));
|
|
563
|
-
i && i(e), te = e;
|
|
564
|
-
}
|
|
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) {
|
|
566
|
-
let n = Ce(e);
|
|
567
|
-
(!n || !n.tagName) && (n = {
|
|
568
|
-
namespaceURI: ee,
|
|
569
|
-
tagName: "template"
|
|
570
|
-
});
|
|
571
|
-
const r = X(e.tagName), A = X(n.tagName);
|
|
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;
|
|
573
|
-
}, Y = function(e) {
|
|
574
|
-
G(c.removed, {
|
|
575
|
-
element: e
|
|
576
|
-
});
|
|
577
|
-
try {
|
|
578
|
-
e.parentNode.removeChild(e);
|
|
579
|
-
} catch {
|
|
580
|
-
e.remove();
|
|
581
|
-
}
|
|
582
|
-
}, He = function(e, n) {
|
|
583
|
-
try {
|
|
584
|
-
G(c.removed, {
|
|
585
|
-
attribute: n.getAttributeNode(e),
|
|
586
|
-
from: n
|
|
587
|
-
});
|
|
588
|
-
} catch {
|
|
589
|
-
G(c.removed, {
|
|
590
|
-
attribute: null,
|
|
591
|
-
from: n
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
if (n.removeAttribute(e), e === "is" && !S[e])
|
|
595
|
-
if (K || he)
|
|
596
|
-
try {
|
|
597
|
-
Y(n);
|
|
598
|
-
} catch {
|
|
599
|
-
}
|
|
600
|
-
else
|
|
601
|
-
try {
|
|
602
|
-
n.setAttribute(e, "");
|
|
603
|
-
} catch {
|
|
604
|
-
}
|
|
605
|
-
}, bt = function(e) {
|
|
606
|
-
let n = null, r = null;
|
|
607
|
-
if (Oe)
|
|
608
|
-
e = "<remove></remove>" + e;
|
|
609
|
-
else {
|
|
610
|
-
const R = Ee(e, /^[\r\n\t ]+/);
|
|
611
|
-
r = R && R[0];
|
|
612
|
-
}
|
|
613
|
-
le === "application/xhtml+xml" && ee === H && (e = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + e + "</body></html>");
|
|
614
|
-
const A = M ? M.createHTML(e) : e;
|
|
615
|
-
if (ee === H)
|
|
616
|
-
try {
|
|
617
|
-
n = new Zt().parseFromString(A, le);
|
|
618
|
-
} catch {
|
|
619
|
-
}
|
|
620
|
-
if (!n || !n.documentElement) {
|
|
621
|
-
n = Le.createDocument(ee, "template", null);
|
|
622
|
-
try {
|
|
623
|
-
n.documentElement.innerHTML = Ue ? ae : A;
|
|
624
|
-
} catch {
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
const L = n.body || n.documentElement;
|
|
628
|
-
return e && r && L.insertBefore(b.createTextNode(r), L.childNodes[0] || null), ee === H ? nn.call(n, q ? "html" : "body")[0] : q ? n.documentElement : L;
|
|
629
|
-
}, Et = function(e) {
|
|
630
|
-
return en.call(
|
|
631
|
-
e.ownerDocument || e,
|
|
632
|
-
e,
|
|
633
|
-
// eslint-disable-next-line no-bitwise
|
|
634
|
-
Se.SHOW_ELEMENT | Se.SHOW_COMMENT | Se.SHOW_TEXT,
|
|
635
|
-
null
|
|
636
|
-
);
|
|
637
|
-
}, hn = function(e) {
|
|
638
|
-
return e instanceof Vt && (typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || !(e.attributes instanceof Xt) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function");
|
|
639
|
-
}, Tt = function(e) {
|
|
640
|
-
return typeof ve == "function" && e instanceof ve;
|
|
641
|
-
}, B = function(e, n, r) {
|
|
642
|
-
z[e] && U(z[e], (A) => {
|
|
643
|
-
A.call(c, n, r, te);
|
|
644
|
-
});
|
|
645
|
-
}, At = function(e) {
|
|
646
|
-
let n = null;
|
|
647
|
-
if (B("beforeSanitizeElements", e, null), hn(e))
|
|
648
|
-
return Y(e), !0;
|
|
649
|
-
const r = C(e.nodeName);
|
|
650
|
-
if (B("uponSanitizeElement", e, {
|
|
651
|
-
tagName: r,
|
|
652
|
-
allowedTags: v
|
|
653
|
-
}), e.hasChildNodes() && !Tt(e.firstElementChild) && O(/<[/\w]/g, e.innerHTML) && O(/<[/\w]/g, e.textContent))
|
|
654
|
-
return Y(e), !0;
|
|
655
|
-
if (!v[r] || re[r]) {
|
|
656
|
-
if (!re[r] && wt(r) && (w.tagNameCheck instanceof RegExp && O(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))
|
|
657
|
-
return !1;
|
|
658
|
-
if (Ie && !J[r]) {
|
|
659
|
-
const A = Ce(e) || e.parentNode, L = Jt(e) || e.childNodes;
|
|
660
|
-
if (L && A) {
|
|
661
|
-
const R = L.length;
|
|
662
|
-
for (let x = R - 1; x >= 0; --x)
|
|
663
|
-
A.insertBefore(Kt(L[x], !0), Qt(e));
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
return Y(e), !0;
|
|
667
|
-
}
|
|
668
|
-
return e instanceof Je && !pn(e) || (r === "noscript" || r === "noembed" || r === "noframes") && O(/<\/no(script|embed|frames)/i, e.innerHTML) ? (Y(e), !0) : (Z && e.nodeType === 3 && (n = e.textContent, U([Re, ke, Me], (A) => {
|
|
669
|
-
n = W(n, A, " ");
|
|
670
|
-
}), e.textContent !== n && (G(c.removed, {
|
|
671
|
-
element: e.cloneNode()
|
|
672
|
-
}), e.textContent = n)), B("afterSanitizeElements", e, null), !1);
|
|
673
|
-
}, _t = function(e, n, r) {
|
|
674
|
-
if (st && (n === "id" || n === "name") && (r in b || r in fn))
|
|
675
|
-
return !1;
|
|
676
|
-
if (!(xe && !Ne[n] && O(an, n))) {
|
|
677
|
-
if (!(it && O(rn, n))) {
|
|
678
|
-
if (!S[n] || Ne[n]) {
|
|
679
|
-
if (
|
|
680
|
-
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
681
|
-
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
682
|
-
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
683
|
-
!(wt(e) && (w.tagNameCheck instanceof RegExp && O(w.tagNameCheck, e) || w.tagNameCheck instanceof Function && w.tagNameCheck(e)) && (w.attributeNameCheck instanceof RegExp && O(w.attributeNameCheck, n) || w.attributeNameCheck instanceof Function && w.attributeNameCheck(n)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
684
|
-
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
685
|
-
n === "is" && w.allowCustomizedBuiltInElements && (w.tagNameCheck instanceof RegExp && O(w.tagNameCheck, r) || w.tagNameCheck instanceof Function && w.tagNameCheck(r)))
|
|
686
|
-
)
|
|
687
|
-
return !1;
|
|
688
|
-
} else if (!Pe[n]) {
|
|
689
|
-
if (!O(tt, W(r, et, ""))) {
|
|
690
|
-
if (!((n === "src" || n === "xlink:href" || n === "href") && e !== "script" && xt(r, "data:") === 0 && dt[e])) {
|
|
691
|
-
if (!(at && !O(sn, W(r, et, "")))) {
|
|
692
|
-
if (r)
|
|
693
|
-
return !1;
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
return !0;
|
|
701
|
-
}, wt = function(e) {
|
|
702
|
-
return e.indexOf("-") > 0;
|
|
703
|
-
}, vt = function(e) {
|
|
704
|
-
B("beforeSanitizeAttributes", e, null);
|
|
705
|
-
const {
|
|
706
|
-
attributes: n
|
|
707
|
-
} = e;
|
|
708
|
-
if (!n)
|
|
709
|
-
return;
|
|
710
|
-
const r = {
|
|
711
|
-
attrName: "",
|
|
712
|
-
attrValue: "",
|
|
713
|
-
keepAttr: !0,
|
|
714
|
-
allowedAttributes: S
|
|
715
|
-
};
|
|
716
|
-
let A = n.length;
|
|
717
|
-
for (; A--; ) {
|
|
718
|
-
const L = n[A], {
|
|
719
|
-
name: R,
|
|
720
|
-
namespaceURI: x,
|
|
721
|
-
value: j
|
|
722
|
-
} = L, ce = C(R);
|
|
723
|
-
let D = R === "value" ? j : Dt(j);
|
|
724
|
-
if (r.attrName = ce, r.attrValue = D, r.keepAttr = !0, r.forceKeepAttr = void 0, B("uponSanitizeAttribute", e, r), D = r.attrValue, r.forceKeepAttr || (He(R, e), !r.keepAttr))
|
|
725
|
-
continue;
|
|
726
|
-
if (!rt && O(/\/>/i, D)) {
|
|
727
|
-
He(R, e);
|
|
728
|
-
continue;
|
|
729
|
-
}
|
|
730
|
-
Z && U([Re, ke, Me], (Ct) => {
|
|
731
|
-
D = W(D, Ct, " ");
|
|
732
|
-
});
|
|
733
|
-
const St = C(e.nodeName);
|
|
734
|
-
if (_t(St, ce, D)) {
|
|
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)) {
|
|
737
|
-
case "TrustedHTML": {
|
|
738
|
-
D = M.createHTML(D);
|
|
739
|
-
break;
|
|
740
|
-
}
|
|
741
|
-
case "TrustedScriptURL": {
|
|
742
|
-
D = M.createScriptURL(D);
|
|
743
|
-
break;
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
try {
|
|
747
|
-
x ? e.setAttributeNS(x, R, D) : e.setAttribute(R, D), de(c.removed);
|
|
748
|
-
} catch {
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
B("afterSanitizeAttributes", e, null);
|
|
753
|
-
}, gn = function d(e) {
|
|
754
|
-
let n = null;
|
|
755
|
-
const r = Et(e);
|
|
756
|
-
for (B("beforeSanitizeShadowDOM", e, null); n = r.nextNode(); )
|
|
757
|
-
B("uponSanitizeShadowNode", n, null), !At(n) && (n.content instanceof F && d(n.content), vt(n));
|
|
758
|
-
B("afterSanitizeShadowDOM", e, null);
|
|
759
|
-
};
|
|
760
|
-
return c.sanitize = function(d) {
|
|
761
|
-
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = null, r = null, A = null, L = null;
|
|
762
|
-
if (Ue = !d, Ue && (d = "<!-->"), typeof d != "string" && !Tt(d))
|
|
763
|
-
if (typeof d.toString == "function") {
|
|
764
|
-
if (d = d.toString(), typeof d != "string")
|
|
765
|
-
throw ie("dirty is not a string, aborting");
|
|
766
|
-
} else
|
|
767
|
-
throw ie("toString is not a function");
|
|
768
|
-
if (!c.isSupported)
|
|
769
|
-
return d;
|
|
770
|
-
if (De || Fe(e), c.removed = [], typeof d == "string" && (se = !1), se) {
|
|
771
|
-
if (d.nodeName) {
|
|
772
|
-
const j = C(d.nodeName);
|
|
773
|
-
if (!v[j] || re[j])
|
|
774
|
-
throw ie("root node is forbidden and cannot be sanitized in-place");
|
|
775
|
-
}
|
|
776
|
-
} else if (d instanceof ve)
|
|
777
|
-
n = bt("<!---->"), r = n.ownerDocument.importNode(d, !0), r.nodeType === 1 && r.nodeName === "BODY" || r.nodeName === "HTML" ? n = r : n.appendChild(r);
|
|
778
|
-
else {
|
|
779
|
-
if (!K && !Z && !q && // eslint-disable-next-line unicorn/prefer-includes
|
|
780
|
-
d.indexOf("<") === -1)
|
|
781
|
-
return M && ge ? M.createHTML(d) : d;
|
|
782
|
-
if (n = bt(d), !n)
|
|
783
|
-
return K ? null : ge ? ae : "";
|
|
784
|
-
}
|
|
785
|
-
n && Oe && Y(n.firstChild);
|
|
786
|
-
const R = Et(se ? d : n);
|
|
787
|
-
for (; A = R.nextNode(); )
|
|
788
|
-
At(A) || (A.content instanceof F && gn(A.content), vt(A));
|
|
789
|
-
if (se)
|
|
790
|
-
return d;
|
|
791
|
-
if (K) {
|
|
792
|
-
if (he)
|
|
793
|
-
for (L = tn.call(n.ownerDocument); n.firstChild; )
|
|
794
|
-
L.appendChild(n.firstChild);
|
|
795
|
-
else
|
|
796
|
-
L = n;
|
|
797
|
-
return (S.shadowroot || S.shadowrootmode) && (L = on.call(h, L, !0)), L;
|
|
798
|
-
}
|
|
799
|
-
let x = q ? n.outerHTML : n.innerHTML;
|
|
800
|
-
return q && v["!doctype"] && n.ownerDocument && n.ownerDocument.doctype && n.ownerDocument.doctype.name && O(Ze, n.ownerDocument.doctype.name) && (x = "<!DOCTYPE " + n.ownerDocument.doctype.name + `>
|
|
801
|
-
` + x), Z && U([Re, ke, Me], (j) => {
|
|
802
|
-
x = W(x, j, " ");
|
|
803
|
-
}), M && ge ? M.createHTML(x) : x;
|
|
804
|
-
}, c.setConfig = function() {
|
|
805
|
-
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
806
|
-
Fe(d), De = !0;
|
|
807
|
-
}, c.clearConfig = function() {
|
|
808
|
-
te = null, De = !1;
|
|
809
|
-
}, c.isValidAttribute = function(d, e, n) {
|
|
810
|
-
te || Fe({});
|
|
811
|
-
const r = C(d), A = C(e);
|
|
812
|
-
return _t(r, A, n);
|
|
813
|
-
}, c.addHook = function(d, e) {
|
|
814
|
-
typeof e == "function" && (z[d] = z[d] || [], G(z[d], e));
|
|
815
|
-
}, c.removeHook = function(d) {
|
|
816
|
-
if (z[d])
|
|
817
|
-
return de(z[d]);
|
|
818
|
-
}, c.removeHooks = function(d) {
|
|
819
|
-
z[d] && (z[d] = []);
|
|
820
|
-
}, c.removeAllHooks = function() {
|
|
821
|
-
z = {};
|
|
822
|
-
}, c;
|
|
823
|
-
}
|
|
824
|
-
var jt = Qe();
|
|
825
|
-
return jt;
|
|
826
|
-
});
|
|
827
|
-
})(Nt);
|
|
828
|
-
const Ge = Nt.exports, Fn = ":host{display:inline-grid;overflow:hidden;width:100%}.view-email{width:100%}.view-email div.gmail_quote{display:none;color:var(--nylas-color-primary-400)}.view-email div.gmail_quote.show{display:block}.view-email blockquote{border-color:var(--nylas-color-primary-500) !important}.view-email .nylas-view-email-toggle-button{display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600);border:0;border-radius:2px;font-size:14px;font-weight:500;line-height:1.5;transition:all 0.2s ease-in-out}.view-email .nylas-view-email-toggle-button:hover{background-color:var(--nylas-color-primary-200);color:var(--nylas-color-primary-600)}", Hn = Fn;
|
|
829
|
-
Ge.addHook("afterSanitizeAttributes", function(t) {
|
|
830
|
-
"target" in t && (t.setAttribute("target", "_blank"), t.setAttribute("rel", "noopener"));
|
|
831
|
-
});
|
|
832
|
-
const Bn = class {
|
|
833
|
-
constructor(t) {
|
|
834
|
-
ne(this, t), this.htmlElement = document.createElement("html"), this.setBody = (o) => {
|
|
835
|
-
var m;
|
|
836
|
-
this.state = "loading", this.styles = [], this.hoistedFontURLs = /* @__PURE__ */ new Map(), this.sanitizedBody = "", document.querySelectorAll(".nylas-view-email-font").forEach((a) => {
|
|
837
|
-
a.remove();
|
|
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) => {
|
|
839
|
-
if (console.debug(`[nylas-view-email] Hoisting link: ${a.getAttribute("href")}`), a.getAttribute("rel") === "stylesheet" && a.getAttribute("href")) {
|
|
840
|
-
const f = a.getAttribute("href");
|
|
841
|
-
if (f) {
|
|
842
|
-
const i = new URL(f, window.location.href);
|
|
843
|
-
(i.protocol === "https:" || i.protocol === "http:") && this.hoistedFontURLs.set(i.href, i.href);
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
}), this.htmlElement.querySelectorAll("style").forEach((a) => {
|
|
847
|
-
a.innerHTML.split(`
|
|
848
|
-
`).forEach((f) => {
|
|
849
|
-
const i = f.match(/@import url\((.*)\)/);
|
|
850
|
-
if (i) {
|
|
851
|
-
const l = new URL(i[1], window.location.href);
|
|
852
|
-
(l.protocol === "https:" || l.protocol === "http:") && this.hoistedFontURLs.set(l.href, l.href);
|
|
853
|
-
}
|
|
854
|
-
}), a.innerHTML = a.innerHTML.replace("body", ":host"), this.styles.push(a), a.remove();
|
|
855
|
-
}), this.htmlElement.querySelectorAll("a").forEach((a) => {
|
|
856
|
-
a.setAttribute("target", "_blank");
|
|
857
|
-
});
|
|
858
|
-
const s = this.htmlElement.querySelector(".gmail_quote");
|
|
859
|
-
if (s) {
|
|
860
|
-
const a = document.createElement("button");
|
|
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);
|
|
862
|
-
}
|
|
863
|
-
this.sanitizedBody = Ge.sanitize(this.htmlElement.innerHTML), this.hoistedFontURLs.forEach((a, f) => {
|
|
864
|
-
const i = document.createElement("link");
|
|
865
|
-
i.setAttribute("rel", "stylesheet"), i.setAttribute("href", a), i.classList.add("nylas-view-email-font"), document.head.appendChild(i);
|
|
866
|
-
}), this.state = "ready";
|
|
867
|
-
}, this.handleMobileSize = () => {
|
|
868
|
-
var u, s, m, a;
|
|
869
|
-
const o = Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0);
|
|
870
|
-
if (o <= 768) {
|
|
871
|
-
const f = (u = this.viewEmailElement) == null ? void 0 : u.getBoundingClientRect();
|
|
872
|
-
if (f && this.viewEmailElement && this.parent && f.width > o) {
|
|
873
|
-
const i = this.parent, l = i == null ? void 0 : i.getBoundingClientRect();
|
|
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);
|
|
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`);
|
|
877
|
-
}
|
|
878
|
-
} else
|
|
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");
|
|
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();
|
|
881
|
-
}
|
|
882
|
-
connectedCallback() {
|
|
883
|
-
}
|
|
884
|
-
disconnectedCallback() {
|
|
885
|
-
T("[nylas-view-email] Component disconnected"), this.state = "loading", this.styles = [], this.hoistedFontURLs = /* @__PURE__ */ new Map(), this.sanitizedBody = "", document.querySelectorAll(".nylas-view-email-font").forEach((t) => {
|
|
886
|
-
t.remove();
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
async componentWillLoad() {
|
|
890
|
-
var t;
|
|
891
|
-
T("[nylas-view-email] component loaded"), this.setBody(((t = this.message) == null ? void 0 : t.body) ?? "");
|
|
892
|
-
}
|
|
893
|
-
async componentDidLoad() {
|
|
894
|
-
T("[nylas-view-thread] Component did load"), this.handleMobileSize();
|
|
895
|
-
}
|
|
896
|
-
async messageChanged() {
|
|
897
|
-
var t;
|
|
898
|
-
T("[nylas-view-thread] Message changed", { message: this.message }), this.setBody(((t = this.message) == null ? void 0 : t.body) ?? "");
|
|
899
|
-
}
|
|
900
|
-
handleScroll() {
|
|
901
|
-
this.handleMobileSize();
|
|
902
|
-
}
|
|
903
|
-
viewEmailElementChanged() {
|
|
904
|
-
var o;
|
|
905
|
-
const t = (o = this.viewEmailElement) == null ? void 0 : o.querySelectorAll(".nylas-view-email-toggle-button");
|
|
906
|
-
t && t.forEach((u) => {
|
|
907
|
-
u.addEventListener("click", () => {
|
|
908
|
-
var m;
|
|
909
|
-
const s = (m = this.viewEmailElement) == null ? void 0 : m.querySelector(".gmail_quote");
|
|
910
|
-
s && s.classList.toggle("show");
|
|
911
|
-
});
|
|
912
|
-
});
|
|
913
|
-
}
|
|
914
|
-
render() {
|
|
915
|
-
return console.debug("[nylas-view-email] render", { hoistedFontURLs: this.hoistedFontURLs }), g($e, { key: "de521e9f6d144fc23b8b87bde33851f18f6f8551" }, 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 })));
|
|
916
|
-
}
|
|
917
|
-
get host() {
|
|
918
|
-
return Rt(this);
|
|
919
|
-
}
|
|
920
|
-
static get watchers() {
|
|
921
|
-
return {
|
|
922
|
-
message: ["messageChanged"],
|
|
923
|
-
viewEmailElement: ["viewEmailElementChanged"]
|
|
924
|
-
};
|
|
925
|
-
}
|
|
926
|
-
};
|
|
927
|
-
Bn.style = Hn;
|
|
928
|
-
const Wn = ".sc-reply-all-icon-h{display:flex}", Gn = Wn, $n = class {
|
|
929
|
-
constructor(t) {
|
|
930
|
-
ne(this, t), this.width = "15", this.height = "15";
|
|
931
|
-
}
|
|
932
|
-
render() {
|
|
933
|
-
return g("svg", { key: "07ae6507e1a602fed911674d1358c4c8ff50a96b", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, g("path", { key: "b87617061d705eaefa38cf9a94a2db66b40fff33", 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" }));
|
|
934
|
-
}
|
|
935
|
-
};
|
|
936
|
-
$n.style = Gn;
|
|
937
|
-
const qn = ".sc-reply-icon-h{display:flex}", Yn = qn, jn = class {
|
|
938
|
-
constructor(t) {
|
|
939
|
-
ne(this, t), this.width = "15", this.height = "15";
|
|
940
|
-
}
|
|
941
|
-
render() {
|
|
942
|
-
return g("svg", { key: "1cc7de40ed319f1f003702976c1b32b0983c4fe0", fill: "auto", width: this.width, height: this.height, viewBox: "0 0 1920 1920", xmlns: "http://www.w3.org/2000/svg" }, g("path", { key: "3d425690515226a82a22f78db21cde593f27f986", 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" }));
|
|
943
|
-
}
|
|
944
|
-
};
|
|
945
|
-
jn.style = Yn;
|
|
946
|
-
export {
|
|
947
|
-
Cn as forward_icon,
|
|
948
|
-
kn as nylas_composer,
|
|
949
|
-
kt as nylas_summarize_message_button,
|
|
950
|
-
Bn as nylas_view_email,
|
|
951
|
-
$n as reply_all_icon,
|
|
952
|
-
jn as reply_icon
|
|
953
|
-
};
|