@gatewaze/admin-embed 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/AiSkillsPicker-dbFhcanE.js +373 -0
- package/dist/ContentAccessPage-D0HRqPFc.js +264 -0
- package/dist/DataTable-fe6yRVpF.js +1984 -0
- package/dist/DetailPageHeader-D_v7924k.js +69 -0
- package/dist/EditionEmail-CyhC8232.js +8382 -0
- package/dist/GuideContent-DBXKCu7r.js +7580 -0
- package/dist/HostMediaTab-BsIBEQ1v.js +440 -0
- package/dist/InboxPage-C8ivCKdx.js +1112 -0
- package/dist/NewsletterCanvasEditor--B06apn3.js +11453 -0
- package/dist/NewsletterSetupWizard-BqV6-fa5.js +347 -0
- package/dist/NewsletterSignup-DRVZIpOs.js +224 -0
- package/dist/Page-D3u8IZ2a.js +14 -0
- package/dist/Toaster-Cde0i6IA.js +18 -0
- package/dist/Tooltip-CqxUlW1d.js +746 -0
- package/dist/_collectionSlug_-B3UN6M-Q.js +308 -0
- package/dist/_collection_-Qz4k_Qjl.js +139 -0
- package/dist/_edition_-DQXwkI_-.js +301 -0
- package/dist/_id_-CtT7rT9f.js +257 -0
- package/dist/_id_-CzScE4Qn.js +1197 -0
- package/dist/_virtual_gatewaze-modules-BeloWlOa.js +991 -0
- package/dist/admin-B0Mmrh_O.js +1239 -0
- package/dist/admin-CcfoK6vD.js +17 -0
- package/dist/admin-embed.js +21844 -0
- package/dist/admin.css +2 -0
- package/dist/block-editor-vXBShAue.js +226 -0
- package/dist/brand-DklYwIeA.js +11 -0
- package/dist/brick-editor-CmBitMMK.js +225 -0
- package/dist/broadcastService-CBqXNt_N.js +190 -0
- package/dist/classnames-uWIYaD6z.js +44 -0
- package/dist/contentAccessService-Cs7tdAo-.js +59 -0
- package/dist/context-jzuubYRz.js +5 -0
- package/dist/createSafeContext-P1pK0sAN.js +17 -0
- package/dist/detail-B8SVFJJr.js +26285 -0
- package/dist/detail-uFBxRbLF.js +2966 -0
- package/dist/dist-DTrOExw8.js +38806 -0
- package/dist/edition-slug-CARO24Bs.js +7 -0
- package/dist/export-edition-html-C_hdXQu5.js +18893 -0
- package/dist/floating-ui.dom-Cyv879E9.js +987 -0
- package/dist/hooks-C377EXJG.js +2974 -0
- package/dist/img/mlops-logo.png +0 -0
- package/dist/img/mlops-logo2.png +0 -0
- package/dist/index.d.ts +105 -0
- package/dist/jsx-runtime-CjozyJt-.js +180 -0
- package/dist/lib-CylJmhlJ.js +828 -0
- package/dist/list-C0cz0aQz.js +451 -0
- package/dist/list-CIVgIGsU.js +166 -0
- package/dist/logo/mlops-alt.png +0 -0
- package/dist/logo/mlops-logo.png +0 -0
- package/dist/new-r4KWpqa6.js +80 -0
- package/dist/outline-DwDYhYcF.js +6538 -0
- package/dist/pages-Ersfxcz7.js +216 -0
- package/dist/preview/12627f.jpg +0 -0
- package/dist/preview/af009d.jpg +0 -0
- package/dist/public-api-LD11kMxh.js +238 -0
- package/dist/react-DB2tPNit.js +933 -0
- package/dist/react-dom-giQNVXng.js +267 -0
- package/dist/registry-4XrV9iNG.js +7 -0
- package/dist/render-BtUWfMUt.js +59634 -0
- package/dist/resolvePeopleByEmail-hivX2l07.js +828 -0
- package/dist/runtime-config.js +10 -0
- package/dist/sends-BkPO6PG2.js +182 -0
- package/dist/server.browser-Pj3QUa7k.js +15227 -0
- package/dist/shim-BCerG8nb.js +6681 -0
- package/dist/sonnerHostBridge-CXuCMM3R.js +665 -0
- package/dist/src-BWDAOzZO.js +799 -0
- package/dist/starter-templates-CFs-QUdF.js +3077 -0
- package/dist/storage-VDSvnkvR.js +39 -0
- package/dist/templateParser-BQ2IsJ6c.js +49 -0
- package/dist/templates-rjQjWsRr.js +253 -0
- package/dist/theme/gatewaze/android-icon-144x144.png +0 -0
- package/dist/theme/gatewaze/android-icon-192x192.png +0 -0
- package/dist/theme/gatewaze/android-icon-36x36.png +0 -0
- package/dist/theme/gatewaze/android-icon-48x48.png +0 -0
- package/dist/theme/gatewaze/android-icon-72x72.png +0 -0
- package/dist/theme/gatewaze/android-icon-96x96.png +0 -0
- package/dist/theme/gatewaze/favicon-144x144.png +0 -0
- package/dist/theme/gatewaze/favicon-16x16.png +0 -0
- package/dist/theme/gatewaze/favicon-192x192.png +0 -0
- package/dist/theme/gatewaze/favicon-32x32.png +0 -0
- package/dist/theme/gatewaze/favicon-96x96.png +0 -0
- package/dist/theme/gatewaze/favicon.ico +0 -0
- package/dist/theme/gatewaze/gatewaze-icon-512.png +0 -0
- package/dist/theme/gatewaze/gatewaze-logo-black.svg +24 -0
- package/dist/theme/gatewaze/gatewaze-logo-white.svg +20 -0
- package/dist/theme/gatewaze/gatewaze-poweredby-black.svg +25 -0
- package/dist/theme/gatewaze/gatewaze-poweredby-white.svg +25 -0
- package/dist/theme/gatewaze/logo_black.svg +24 -0
- package/dist/theme/gatewaze/logo_white.svg +20 -0
- package/dist/theme-D6odw5nx.js +586 -0
- package/dist/ui-DRIo9Krs.js +9747 -0
- package/dist/upload-DMNfZ6FX.js +505 -0
- package/dist/useModuleFeature-DgsFIUpv.js +8 -0
- package/dist/utils-BcVvIjaY.js +36 -0
- package/dist/with-selector-B8eSdVx_.js +100 -0
- package/package.json +33 -0
|
@@ -0,0 +1,828 @@
|
|
|
1
|
+
import { c as e, t } from "./react-DB2tPNit.js";
|
|
2
|
+
import { d as n } from "./shim-BCerG8nb.js";
|
|
3
|
+
import { t as r } from "./jsx-runtime-CjozyJt-.js";
|
|
4
|
+
import { D as i, E as a, O as o, c as s, o as c } from "./ui-DRIo9Krs.js";
|
|
5
|
+
import { a as l, c as u, i as d, l as f, o as p, r as m, s as h } from "./export-edition-html-C_hdXQu5.js";
|
|
6
|
+
import { a as g } from "./hooks-C377EXJG.js";
|
|
7
|
+
import { n as _ } from "./sonnerHostBridge-CXuCMM3R.js";
|
|
8
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/outline/esm/ArchiveBoxArrowDownIcon.js
|
|
9
|
+
var v = /* @__PURE__ */ e(t());
|
|
10
|
+
function y({ title: e, titleId: t, ...n }, r) {
|
|
11
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
fill: "none",
|
|
14
|
+
viewBox: "0 0 24 24",
|
|
15
|
+
strokeWidth: 1.5,
|
|
16
|
+
stroke: "currentColor",
|
|
17
|
+
"aria-hidden": "true",
|
|
18
|
+
"data-slot": "icon",
|
|
19
|
+
ref: r,
|
|
20
|
+
"aria-labelledby": t
|
|
21
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
22
|
+
strokeLinecap: "round",
|
|
23
|
+
strokeLinejoin: "round",
|
|
24
|
+
d: "m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
var b = /*#__PURE__*/ v.forwardRef(y);
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/outline/esm/ArchiveBoxXMarkIcon.js
|
|
30
|
+
function x({ title: e, titleId: t, ...n }, r) {
|
|
31
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
fill: "none",
|
|
34
|
+
viewBox: "0 0 24 24",
|
|
35
|
+
strokeWidth: 1.5,
|
|
36
|
+
stroke: "currentColor",
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
"data-slot": "icon",
|
|
39
|
+
ref: r,
|
|
40
|
+
"aria-labelledby": t
|
|
41
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
42
|
+
strokeLinecap: "round",
|
|
43
|
+
strokeLinejoin: "round",
|
|
44
|
+
d: "m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"
|
|
45
|
+
}));
|
|
46
|
+
}
|
|
47
|
+
var S = /*#__PURE__*/ v.forwardRef(x);
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/outline/esm/ArchiveBoxIcon.js
|
|
50
|
+
function C({ title: e, titleId: t, ...n }, r) {
|
|
51
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
52
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
53
|
+
fill: "none",
|
|
54
|
+
viewBox: "0 0 24 24",
|
|
55
|
+
strokeWidth: 1.5,
|
|
56
|
+
stroke: "currentColor",
|
|
57
|
+
"aria-hidden": "true",
|
|
58
|
+
"data-slot": "icon",
|
|
59
|
+
ref: r,
|
|
60
|
+
"aria-labelledby": t
|
|
61
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
62
|
+
strokeLinecap: "round",
|
|
63
|
+
strokeLinejoin: "round",
|
|
64
|
+
d: "m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
var w = /*#__PURE__*/ v.forwardRef(C);
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/outline/esm/BriefcaseIcon.js
|
|
70
|
+
function T({ title: e, titleId: t, ...n }, r) {
|
|
71
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
72
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
73
|
+
fill: "none",
|
|
74
|
+
viewBox: "0 0 24 24",
|
|
75
|
+
strokeWidth: 1.5,
|
|
76
|
+
stroke: "currentColor",
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
"data-slot": "icon",
|
|
79
|
+
ref: r,
|
|
80
|
+
"aria-labelledby": t
|
|
81
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
82
|
+
strokeLinecap: "round",
|
|
83
|
+
strokeLinejoin: "round",
|
|
84
|
+
d: "M20.25 14.15v4.25c0 1.094-.787 2.036-1.872 2.18-2.087.277-4.216.42-6.378.42s-4.291-.143-6.378-.42c-1.085-.144-1.872-1.086-1.872-2.18v-4.25m16.5 0a2.18 2.18 0 0 0 .75-1.661V8.706c0-1.081-.768-2.015-1.837-2.175a48.114 48.114 0 0 0-3.413-.387m4.5 8.006c-.194.165-.42.295-.673.38A23.978 23.978 0 0 1 12 15.75c-2.648 0-5.195-.429-7.577-1.22a2.016 2.016 0 0 1-.673-.38m0 0A2.18 2.18 0 0 1 3 12.489V8.706c0-1.081.768-2.015 1.837-2.175a48.111 48.111 0 0 1 3.413-.387m7.5 0V5.25A2.25 2.25 0 0 0 13.5 3h-3a2.25 2.25 0 0 0-2.25 2.25v.894m7.5 0a48.667 48.667 0 0 0-7.5 0M12 12.75h.008v.008H12v-.008Z"
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
var E = /*#__PURE__*/ v.forwardRef(T);
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/outline/esm/ChevronUpIcon.js
|
|
90
|
+
function D({ title: e, titleId: t, ...n }, r) {
|
|
91
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
92
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
93
|
+
fill: "none",
|
|
94
|
+
viewBox: "0 0 24 24",
|
|
95
|
+
strokeWidth: 1.5,
|
|
96
|
+
stroke: "currentColor",
|
|
97
|
+
"aria-hidden": "true",
|
|
98
|
+
"data-slot": "icon",
|
|
99
|
+
ref: r,
|
|
100
|
+
"aria-labelledby": t
|
|
101
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
102
|
+
strokeLinecap: "round",
|
|
103
|
+
strokeLinejoin: "round",
|
|
104
|
+
d: "m4.5 15.75 7.5-7.5 7.5 7.5"
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
107
|
+
var O = /*#__PURE__*/ v.forwardRef(D);
|
|
108
|
+
//#endregion
|
|
109
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/outline/esm/EnvelopeOpenIcon.js
|
|
110
|
+
function k({ title: e, titleId: t, ...n }, r) {
|
|
111
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
112
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
113
|
+
fill: "none",
|
|
114
|
+
viewBox: "0 0 24 24",
|
|
115
|
+
strokeWidth: 1.5,
|
|
116
|
+
stroke: "currentColor",
|
|
117
|
+
"aria-hidden": "true",
|
|
118
|
+
"data-slot": "icon",
|
|
119
|
+
ref: r,
|
|
120
|
+
"aria-labelledby": t
|
|
121
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
122
|
+
strokeLinecap: "round",
|
|
123
|
+
strokeLinejoin: "round",
|
|
124
|
+
d: "M21.75 9v.906a2.25 2.25 0 0 1-1.183 1.981l-6.478 3.488M2.25 9v.906a2.25 2.25 0 0 0 1.183 1.981l6.478 3.488m8.839 2.51-4.66-2.51m0 0-1.023-.55a2.25 2.25 0 0 0-2.134 0l-1.022.55m0 0-4.661 2.51m16.5 1.615a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V8.844a2.25 2.25 0 0 1 1.183-1.981l7.5-4.039a2.25 2.25 0 0 1 2.134 0l7.5 4.039a2.25 2.25 0 0 1 1.183 1.98V19.5Z"
|
|
125
|
+
}));
|
|
126
|
+
}
|
|
127
|
+
var A = /*#__PURE__*/ v.forwardRef(k);
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/outline/esm/InboxIcon.js
|
|
130
|
+
function j({ title: e, titleId: t, ...n }, r) {
|
|
131
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
132
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
133
|
+
fill: "none",
|
|
134
|
+
viewBox: "0 0 24 24",
|
|
135
|
+
strokeWidth: 1.5,
|
|
136
|
+
stroke: "currentColor",
|
|
137
|
+
"aria-hidden": "true",
|
|
138
|
+
"data-slot": "icon",
|
|
139
|
+
ref: r,
|
|
140
|
+
"aria-labelledby": t
|
|
141
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
142
|
+
strokeLinecap: "round",
|
|
143
|
+
strokeLinejoin: "round",
|
|
144
|
+
d: "M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
var M = /*#__PURE__*/ v.forwardRef(j);
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/outline/esm/PaperClipIcon.js
|
|
150
|
+
function N({ title: e, titleId: t, ...n }, r) {
|
|
151
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
152
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
153
|
+
fill: "none",
|
|
154
|
+
viewBox: "0 0 24 24",
|
|
155
|
+
strokeWidth: 1.5,
|
|
156
|
+
stroke: "currentColor",
|
|
157
|
+
"aria-hidden": "true",
|
|
158
|
+
"data-slot": "icon",
|
|
159
|
+
ref: r,
|
|
160
|
+
"aria-labelledby": t
|
|
161
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
162
|
+
strokeLinecap: "round",
|
|
163
|
+
strokeLinejoin: "round",
|
|
164
|
+
d: "m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"
|
|
165
|
+
}));
|
|
166
|
+
}
|
|
167
|
+
var P = /*#__PURE__*/ v.forwardRef(N);
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/outline/esm/StarIcon.js
|
|
170
|
+
function F({ title: e, titleId: t, ...n }, r) {
|
|
171
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
172
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
173
|
+
fill: "none",
|
|
174
|
+
viewBox: "0 0 24 24",
|
|
175
|
+
strokeWidth: 1.5,
|
|
176
|
+
stroke: "currentColor",
|
|
177
|
+
"aria-hidden": "true",
|
|
178
|
+
"data-slot": "icon",
|
|
179
|
+
ref: r,
|
|
180
|
+
"aria-labelledby": t
|
|
181
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
182
|
+
strokeLinecap: "round",
|
|
183
|
+
strokeLinejoin: "round",
|
|
184
|
+
d: "M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
var I = /*#__PURE__*/ v.forwardRef(F);
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region ../../node_modules/.pnpm/@heroicons+react@2.2.0_react@19.2.4/node_modules/@heroicons/react/24/solid/esm/StarIcon.js
|
|
190
|
+
function L({ title: e, titleId: t, ...n }, r) {
|
|
191
|
+
return /*#__PURE__*/ v.createElement("svg", Object.assign({
|
|
192
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
193
|
+
viewBox: "0 0 24 24",
|
|
194
|
+
fill: "currentColor",
|
|
195
|
+
"aria-hidden": "true",
|
|
196
|
+
"data-slot": "icon",
|
|
197
|
+
ref: r,
|
|
198
|
+
"aria-labelledby": t
|
|
199
|
+
}, n), e ? /*#__PURE__*/ v.createElement("title", { id: t }, e) : null, /*#__PURE__*/ v.createElement("path", {
|
|
200
|
+
fillRule: "evenodd",
|
|
201
|
+
d: "M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z",
|
|
202
|
+
clipRule: "evenodd"
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
var R = /*#__PURE__*/ v.forwardRef(L), z = r(), B = 10485760;
|
|
206
|
+
function V(e) {
|
|
207
|
+
return new Promise((t, n) => {
|
|
208
|
+
let r = new FileReader();
|
|
209
|
+
r.onload = () => {
|
|
210
|
+
let e = r.result, n = e.indexOf(",");
|
|
211
|
+
t(n >= 0 ? e.slice(n + 1) : e);
|
|
212
|
+
}, r.onerror = () => n(r.error), r.readAsDataURL(e);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
function H({ kind: e, replyId: t, toEmail: r, toName: a, onSent: o }) {
|
|
216
|
+
let [s, l] = (0, v.useState)(""), [u, f] = (0, v.useState)([]), [p, h] = (0, v.useState)(!1), g = (0, v.useRef)(null), y = !s.replace(/<[^>]*>/g, "").trim(), b = (e) => {
|
|
217
|
+
if (!e || e.length === 0) return;
|
|
218
|
+
let t = [...u, ...Array.from(e)];
|
|
219
|
+
if (t.reduce((e, t) => e + t.size, 0) > B) {
|
|
220
|
+
_.error("Attachments exceed 10 MB total");
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
f(t);
|
|
224
|
+
}, x = (e) => f((t) => t.filter((t, n) => n !== e));
|
|
225
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
226
|
+
className: "mt-3 rounded-lg border border-[var(--gray-a5)] bg-[var(--gray-a1)] p-3",
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
229
|
+
className: "flex items-center justify-between mb-2 text-xs text-[var(--gray-9)]",
|
|
230
|
+
children: [/* @__PURE__ */ (0, z.jsxs)("span", { children: [
|
|
231
|
+
"Reply to",
|
|
232
|
+
" ",
|
|
233
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
234
|
+
className: "text-[var(--gray-11)]",
|
|
235
|
+
children: a ? `${a} <${r}>` : r
|
|
236
|
+
})
|
|
237
|
+
] }), /* @__PURE__ */ (0, z.jsx)("span", {
|
|
238
|
+
className: "italic",
|
|
239
|
+
children: "Sends from the original address"
|
|
240
|
+
})]
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ (0, z.jsx)(m, {
|
|
243
|
+
content: s,
|
|
244
|
+
onChange: l,
|
|
245
|
+
placeholder: "Write your reply…",
|
|
246
|
+
editable: !p
|
|
247
|
+
}),
|
|
248
|
+
u.length > 0 && /* @__PURE__ */ (0, z.jsx)("ul", {
|
|
249
|
+
className: "mt-2 space-y-1",
|
|
250
|
+
children: u.map((e, t) => /* @__PURE__ */ (0, z.jsxs)("li", {
|
|
251
|
+
className: "flex items-center gap-2 text-xs text-[var(--gray-11)]",
|
|
252
|
+
children: [
|
|
253
|
+
/* @__PURE__ */ (0, z.jsx)(P, { className: "w-3.5 h-3.5 flex-shrink-0" }),
|
|
254
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
255
|
+
className: "truncate",
|
|
256
|
+
children: e.name
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ (0, z.jsxs)("span", {
|
|
259
|
+
className: "text-[var(--gray-9)] flex-shrink-0",
|
|
260
|
+
children: [(e.size / 1024).toFixed(0), " KB"]
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ (0, z.jsx)("button", {
|
|
263
|
+
type: "button",
|
|
264
|
+
onClick: () => x(t),
|
|
265
|
+
disabled: p,
|
|
266
|
+
className: "text-[var(--gray-9)] hover:text-[var(--red-9)] flex-shrink-0",
|
|
267
|
+
title: "Remove attachment",
|
|
268
|
+
children: /* @__PURE__ */ (0, z.jsx)(c, { className: "w-3.5 h-3.5" })
|
|
269
|
+
})
|
|
270
|
+
]
|
|
271
|
+
}, `${e.name}-${t}`))
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
274
|
+
className: "mt-2 flex items-center justify-between",
|
|
275
|
+
children: [
|
|
276
|
+
/* @__PURE__ */ (0, z.jsx)("input", {
|
|
277
|
+
ref: g,
|
|
278
|
+
type: "file",
|
|
279
|
+
multiple: !0,
|
|
280
|
+
hidden: !0,
|
|
281
|
+
onChange: (e) => {
|
|
282
|
+
b(e.target.files), g.current && (g.current.value = "");
|
|
283
|
+
}
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ (0, z.jsxs)(i, {
|
|
286
|
+
variant: "soft",
|
|
287
|
+
color: "gray",
|
|
288
|
+
size: "1",
|
|
289
|
+
onClick: () => g.current?.click(),
|
|
290
|
+
disabled: p,
|
|
291
|
+
children: [/* @__PURE__ */ (0, z.jsx)(P, { className: "w-4 h-4" }), " Attach"]
|
|
292
|
+
}),
|
|
293
|
+
/* @__PURE__ */ (0, z.jsxs)(i, {
|
|
294
|
+
variant: "solid",
|
|
295
|
+
size: "2",
|
|
296
|
+
onClick: async () => {
|
|
297
|
+
if (y) {
|
|
298
|
+
_.error("Write a reply first");
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
h(!0);
|
|
302
|
+
try {
|
|
303
|
+
let i = await Promise.all(u.map(async (e) => ({
|
|
304
|
+
filename: e.name,
|
|
305
|
+
type: e.type || "application/octet-stream",
|
|
306
|
+
content: await V(e)
|
|
307
|
+
}))), c = s.replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim(), { data: d, error: p } = await n.functions.invoke("reply-send", { body: {
|
|
308
|
+
kind: e,
|
|
309
|
+
replyId: t,
|
|
310
|
+
bodyHtml: s,
|
|
311
|
+
bodyText: c,
|
|
312
|
+
attachments: i
|
|
313
|
+
} });
|
|
314
|
+
if (p || d && d.error) throw Error(p?.message || d?.error || "Send failed");
|
|
315
|
+
_.success(`Reply sent to ${a || r}`), l(""), f([]), o?.();
|
|
316
|
+
} catch (e) {
|
|
317
|
+
_.error(`Could not send reply: ${e.message}`);
|
|
318
|
+
} finally {
|
|
319
|
+
h(!1);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
disabled: p || y,
|
|
323
|
+
children: [
|
|
324
|
+
/* @__PURE__ */ (0, z.jsx)(d, { className: "w-4 h-4" }),
|
|
325
|
+
" ",
|
|
326
|
+
p ? "Sending…" : "Send reply"
|
|
327
|
+
]
|
|
328
|
+
})
|
|
329
|
+
]
|
|
330
|
+
})
|
|
331
|
+
]
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
function U({ messages: e }) {
|
|
335
|
+
return e.length ? /* @__PURE__ */ (0, z.jsx)("div", {
|
|
336
|
+
className: "mt-3 space-y-2",
|
|
337
|
+
children: e.map((e) => /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
338
|
+
className: "rounded-lg border-l-2 border-l-[var(--accent-9)] bg-[var(--accent-a2)] px-3 py-2",
|
|
339
|
+
children: [
|
|
340
|
+
/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
341
|
+
className: "text-xs text-[var(--gray-9)] mb-1",
|
|
342
|
+
children: [
|
|
343
|
+
"You replied · ",
|
|
344
|
+
new Date(e.created_at).toLocaleString(),
|
|
345
|
+
" · ",
|
|
346
|
+
e.from_address,
|
|
347
|
+
" → ",
|
|
348
|
+
e.to_address
|
|
349
|
+
]
|
|
350
|
+
}),
|
|
351
|
+
e.body_html ? /* @__PURE__ */ (0, z.jsx)("div", {
|
|
352
|
+
className: "prose prose-sm max-w-none text-[var(--gray-12)] [&_a]:text-[var(--accent-9)]",
|
|
353
|
+
dangerouslySetInnerHTML: { __html: e.body_html }
|
|
354
|
+
}) : /* @__PURE__ */ (0, z.jsx)("pre", {
|
|
355
|
+
className: "text-sm text-[var(--gray-12)] whitespace-pre-wrap font-sans",
|
|
356
|
+
children: e.body_text || ""
|
|
357
|
+
}),
|
|
358
|
+
e.attachments && e.attachments.length > 0 && /* @__PURE__ */ (0, z.jsx)("ul", {
|
|
359
|
+
className: "mt-2 space-y-0.5",
|
|
360
|
+
children: e.attachments.map((e, t) => /* @__PURE__ */ (0, z.jsxs)("li", {
|
|
361
|
+
className: "flex items-center gap-1.5 text-xs text-[var(--gray-10)]",
|
|
362
|
+
children: [
|
|
363
|
+
/* @__PURE__ */ (0, z.jsx)(P, { className: "w-3 h-3" }),
|
|
364
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
365
|
+
className: "truncate",
|
|
366
|
+
children: e.filename
|
|
367
|
+
}),
|
|
368
|
+
typeof e.size == "number" && e.size > 0 && /* @__PURE__ */ (0, z.jsxs)("span", {
|
|
369
|
+
className: "text-[var(--gray-9)]",
|
|
370
|
+
children: [(e.size / 1024).toFixed(0), " KB"]
|
|
371
|
+
})
|
|
372
|
+
]
|
|
373
|
+
}, `${e.filename}-${t}`))
|
|
374
|
+
})
|
|
375
|
+
]
|
|
376
|
+
}, e.id))
|
|
377
|
+
}) : null;
|
|
378
|
+
}
|
|
379
|
+
//#endregion
|
|
380
|
+
//#region src/components/people/PersonLink.tsx
|
|
381
|
+
function W({ personId: e, label: t, className: n = "", title: r }) {
|
|
382
|
+
let i = g();
|
|
383
|
+
if (!e) return /* @__PURE__ */ (0, z.jsx)("span", {
|
|
384
|
+
className: `${n} text-[var(--gray-12)]`,
|
|
385
|
+
title: r,
|
|
386
|
+
children: t
|
|
387
|
+
});
|
|
388
|
+
let a = () => i(`/people/${e}`);
|
|
389
|
+
return /* @__PURE__ */ (0, z.jsx)("span", {
|
|
390
|
+
role: "link",
|
|
391
|
+
tabIndex: 0,
|
|
392
|
+
title: r || "View person profile",
|
|
393
|
+
onClick: (e) => {
|
|
394
|
+
e.stopPropagation(), a();
|
|
395
|
+
},
|
|
396
|
+
onKeyDown: (e) => {
|
|
397
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), a());
|
|
398
|
+
},
|
|
399
|
+
className: `${n} cursor-pointer text-[var(--accent-11)] hover:underline underline-offset-2`,
|
|
400
|
+
children: t
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/components/replies/RepliesWorkspace.tsx
|
|
405
|
+
function G(e) {
|
|
406
|
+
let t = e.auto_reply_reason || "";
|
|
407
|
+
return t.startsWith("departed") ? "job_change" : e.is_auto_reply ? t === "dsn" || t === "bounce-sender" ? "bounce" : "ooo" : "reply";
|
|
408
|
+
}
|
|
409
|
+
var K = {
|
|
410
|
+
ooo: {
|
|
411
|
+
label: "Out of office",
|
|
412
|
+
color: "amber"
|
|
413
|
+
},
|
|
414
|
+
job_change: {
|
|
415
|
+
label: "Job change",
|
|
416
|
+
color: "red"
|
|
417
|
+
},
|
|
418
|
+
bounce: {
|
|
419
|
+
label: "Bounce",
|
|
420
|
+
color: "gray"
|
|
421
|
+
}
|
|
422
|
+
}, q = [
|
|
423
|
+
{
|
|
424
|
+
key: "inbox",
|
|
425
|
+
label: "Inbox",
|
|
426
|
+
icon: M,
|
|
427
|
+
group: "primary"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
key: "starred",
|
|
431
|
+
label: "Starred",
|
|
432
|
+
icon: I,
|
|
433
|
+
group: "primary"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
key: "sent",
|
|
437
|
+
label: "Sent",
|
|
438
|
+
icon: d,
|
|
439
|
+
group: "primary"
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
key: "archived",
|
|
443
|
+
label: "Archived",
|
|
444
|
+
icon: w,
|
|
445
|
+
group: "primary"
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
key: "ooo",
|
|
449
|
+
label: "Out of office",
|
|
450
|
+
icon: p,
|
|
451
|
+
group: "filter"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
key: "job_change",
|
|
455
|
+
label: "Job changes",
|
|
456
|
+
icon: E,
|
|
457
|
+
group: "filter"
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
key: "bounce",
|
|
461
|
+
label: "Bounces",
|
|
462
|
+
icon: s,
|
|
463
|
+
group: "filter"
|
|
464
|
+
}
|
|
465
|
+
];
|
|
466
|
+
function J(e) {
|
|
467
|
+
let t = new Date(e), n = Math.floor((Date.now() - t.getTime()) / 864e5);
|
|
468
|
+
return n === 0 ? t.toLocaleTimeString(void 0, {
|
|
469
|
+
hour: "2-digit",
|
|
470
|
+
minute: "2-digit"
|
|
471
|
+
}) : n === 1 ? "Yesterday" : n < 7 ? `${n} days ago` : t.toLocaleDateString(void 0, {
|
|
472
|
+
month: "short",
|
|
473
|
+
day: "numeric",
|
|
474
|
+
year: "numeric"
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
function Y({ kind: e, replies: t, sent: r, personByEmail: i, onReload: s, emptyHint: c }) {
|
|
478
|
+
let [d, p] = (0, v.useState)("inbox"), [m, g] = (0, v.useState)(null), [_, y] = (0, v.useState)({}), x = e === "broadcast" ? "broadcast_replies" : e === "event" ? "event_replies" : "newsletter_replies", C = (0, v.useMemo)(() => t.map((e) => _[e.id] ? {
|
|
479
|
+
...e,
|
|
480
|
+
..._[e.id]
|
|
481
|
+
} : e), [t, _]), w = (0, v.useMemo)(() => {
|
|
482
|
+
let e = {};
|
|
483
|
+
for (let t of r) (e[t.reply_id] ||= []).push(t);
|
|
484
|
+
return e;
|
|
485
|
+
}, [r]), T = (0, v.useMemo)(() => {
|
|
486
|
+
let e = C.filter((e) => !e.is_archived), t = (t) => e.filter((e) => G(e) === t).length;
|
|
487
|
+
return {
|
|
488
|
+
inbox: t("reply"),
|
|
489
|
+
ooo: t("ooo"),
|
|
490
|
+
job_change: t("job_change"),
|
|
491
|
+
bounce: t("bounce"),
|
|
492
|
+
starred: e.filter((e) => e.is_starred).length,
|
|
493
|
+
archived: C.filter((e) => e.is_archived).length,
|
|
494
|
+
sent: r.length
|
|
495
|
+
};
|
|
496
|
+
}, [C, r]), E = (0, v.useMemo)(() => C.filter((e) => !e.is_archived && !e.is_read && G(e) === "reply").length, [C]), D = (0, v.useMemo)(() => {
|
|
497
|
+
if (d === "archived") return C.filter((e) => e.is_archived);
|
|
498
|
+
let e = C.filter((e) => !e.is_archived);
|
|
499
|
+
return d === "starred" ? e.filter((e) => e.is_starred) : d === "inbox" ? e.filter((e) => G(e) === "reply") : e.filter((e) => G(e) === d);
|
|
500
|
+
}, [C, d]), k = (e, t) => {
|
|
501
|
+
y((n) => ({
|
|
502
|
+
...n,
|
|
503
|
+
[e]: {
|
|
504
|
+
...n[e] || {},
|
|
505
|
+
...t
|
|
506
|
+
}
|
|
507
|
+
})), n.from(x).update(t).eq("id", e).then(({ error: n }) => {
|
|
508
|
+
n && (console.error(`[RepliesWorkspace] failed to update ${x} ${e}:`, n), y((n) => {
|
|
509
|
+
let r = n[e];
|
|
510
|
+
if (!r) return n;
|
|
511
|
+
let i = { ...r };
|
|
512
|
+
for (let e of Object.keys(t)) delete i[e];
|
|
513
|
+
let { [e]: a, ...o } = n;
|
|
514
|
+
return Object.keys(i).length > 0 ? {
|
|
515
|
+
...o,
|
|
516
|
+
[e]: i
|
|
517
|
+
} : o;
|
|
518
|
+
}));
|
|
519
|
+
});
|
|
520
|
+
}, j = (e) => {
|
|
521
|
+
let t = m !== e.id;
|
|
522
|
+
g(t ? e.id : null), t && !e.is_read && k(e.id, { is_read: !0 });
|
|
523
|
+
}, M = q.filter((e) => e.group === "primary" || T[e.key] > 0);
|
|
524
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
525
|
+
className: "flex gap-6",
|
|
526
|
+
children: [/* @__PURE__ */ (0, z.jsx)("nav", {
|
|
527
|
+
className: "w-44 flex-shrink-0 space-y-0.5",
|
|
528
|
+
children: M.map((e, t) => {
|
|
529
|
+
let n = M[t - 1], r = n && n.group === "primary" && e.group === "filter", i = d === e.key, a = e.icon, s = T[e.key];
|
|
530
|
+
return /* @__PURE__ */ (0, z.jsxs)("div", { children: [r && /* @__PURE__ */ (0, z.jsx)("div", { className: "my-2 border-t border-[var(--gray-a4)]" }), /* @__PURE__ */ (0, z.jsxs)("button", {
|
|
531
|
+
type: "button",
|
|
532
|
+
onClick: () => {
|
|
533
|
+
p(e.key), g(null);
|
|
534
|
+
},
|
|
535
|
+
className: `w-full flex items-center gap-2.5 px-3 py-2 rounded-lg text-sm transition-colors ${i ? "bg-[var(--accent-a3)] text-[var(--accent-11)] font-medium" : "text-[var(--gray-11)] hover:bg-[var(--gray-a3)]"}`,
|
|
536
|
+
children: [
|
|
537
|
+
/* @__PURE__ */ (0, z.jsx)(a, { className: "w-4 h-4 flex-shrink-0" }),
|
|
538
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
539
|
+
className: "flex-1 text-left truncate",
|
|
540
|
+
children: e.label
|
|
541
|
+
}),
|
|
542
|
+
e.key === "inbox" && E > 0 ? /* @__PURE__ */ (0, z.jsx)(o, {
|
|
543
|
+
variant: "solid",
|
|
544
|
+
color: "blue",
|
|
545
|
+
size: "1",
|
|
546
|
+
children: E
|
|
547
|
+
}) : s > 0 ? /* @__PURE__ */ (0, z.jsx)("span", {
|
|
548
|
+
className: `text-xs ${i ? "opacity-80" : "text-[var(--gray-9)]"}`,
|
|
549
|
+
children: s
|
|
550
|
+
}) : null
|
|
551
|
+
]
|
|
552
|
+
})] }, e.key);
|
|
553
|
+
})
|
|
554
|
+
}), /* @__PURE__ */ (0, z.jsx)("div", {
|
|
555
|
+
className: "flex-1 min-w-0",
|
|
556
|
+
children: d === "sent" ? /* @__PURE__ */ (0, z.jsx)(X, {
|
|
557
|
+
sent: r,
|
|
558
|
+
personByEmail: i
|
|
559
|
+
}) : D.length === 0 ? /* @__PURE__ */ (0, z.jsxs)(a, {
|
|
560
|
+
variant: "surface",
|
|
561
|
+
className: "p-12 text-center",
|
|
562
|
+
children: [
|
|
563
|
+
/* @__PURE__ */ (0, z.jsx)(l, { className: "w-10 h-10 text-[var(--gray-8)] mx-auto mb-3" }),
|
|
564
|
+
/* @__PURE__ */ (0, z.jsx)("p", {
|
|
565
|
+
className: "text-[var(--gray-11)] mb-1",
|
|
566
|
+
children: "Nothing here"
|
|
567
|
+
}),
|
|
568
|
+
/* @__PURE__ */ (0, z.jsx)("p", {
|
|
569
|
+
className: "text-sm text-[var(--gray-9)]",
|
|
570
|
+
children: c || "Replies will appear here"
|
|
571
|
+
})
|
|
572
|
+
]
|
|
573
|
+
}) : /* @__PURE__ */ (0, z.jsx)("div", {
|
|
574
|
+
className: "space-y-2",
|
|
575
|
+
children: D.map((t) => {
|
|
576
|
+
let n = m === t.id, r = G(t), c = r === "reply" ? null : K[r], d = i[t.from_email?.toLowerCase()], p = w[t.id]?.length ?? 0;
|
|
577
|
+
return /* @__PURE__ */ (0, z.jsxs)(a, {
|
|
578
|
+
variant: "surface",
|
|
579
|
+
className: `transition-colors ${t.is_read ? "" : "border-l-2 border-l-[var(--accent-9)]"}`,
|
|
580
|
+
children: [/* @__PURE__ */ (0, z.jsxs)("button", {
|
|
581
|
+
onClick: () => j(t),
|
|
582
|
+
className: "w-full text-left px-4 py-3 flex items-center gap-3",
|
|
583
|
+
children: [
|
|
584
|
+
t.is_read ? /* @__PURE__ */ (0, z.jsx)(A, { className: "w-4 h-4 text-[var(--gray-9)] flex-shrink-0" }) : /* @__PURE__ */ (0, z.jsx)(l, { className: "w-4 h-4 text-[var(--accent-9)] flex-shrink-0" }),
|
|
585
|
+
/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
586
|
+
className: "flex-1 min-w-0",
|
|
587
|
+
children: [/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
588
|
+
className: "flex items-center gap-2",
|
|
589
|
+
children: [/* @__PURE__ */ (0, z.jsx)(W, {
|
|
590
|
+
personId: d,
|
|
591
|
+
label: t.from_name || t.from_email,
|
|
592
|
+
className: `text-sm truncate ${t.is_read ? "" : "font-semibold"}`,
|
|
593
|
+
title: d ? "View person profile" : void 0
|
|
594
|
+
}), t.from_name && /* @__PURE__ */ (0, z.jsx)("span", {
|
|
595
|
+
className: "text-xs text-[var(--gray-9)] truncate hidden sm:inline",
|
|
596
|
+
children: t.from_email
|
|
597
|
+
})]
|
|
598
|
+
}), /* @__PURE__ */ (0, z.jsx)("p", {
|
|
599
|
+
className: `text-sm truncate ${t.is_read ? "text-[var(--gray-9)]" : "font-medium text-[var(--gray-11)]"}`,
|
|
600
|
+
children: t.subject || "(no subject)"
|
|
601
|
+
})]
|
|
602
|
+
}),
|
|
603
|
+
/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
604
|
+
className: "flex items-center gap-2 flex-shrink-0",
|
|
605
|
+
children: [
|
|
606
|
+
c && /* @__PURE__ */ (0, z.jsx)(o, {
|
|
607
|
+
variant: "soft",
|
|
608
|
+
color: c.color,
|
|
609
|
+
size: "1",
|
|
610
|
+
className: "hidden md:inline-flex",
|
|
611
|
+
title: t.auto_reply_reason || void 0,
|
|
612
|
+
children: c.label
|
|
613
|
+
}),
|
|
614
|
+
t.badge && /* @__PURE__ */ (0, z.jsx)(o, {
|
|
615
|
+
variant: "soft",
|
|
616
|
+
color: "blue",
|
|
617
|
+
size: "1",
|
|
618
|
+
className: "hidden md:inline-flex",
|
|
619
|
+
children: t.badge
|
|
620
|
+
}),
|
|
621
|
+
t.forwarded_at && /* @__PURE__ */ (0, z.jsx)(u, {
|
|
622
|
+
className: "w-3.5 h-3.5 text-[var(--gray-9)]",
|
|
623
|
+
title: `Forwarded to ${t.forwarded_to}`
|
|
624
|
+
}),
|
|
625
|
+
p > 0 && /* @__PURE__ */ (0, z.jsx)(f, {
|
|
626
|
+
className: "w-3.5 h-3.5 text-[var(--accent-9)]",
|
|
627
|
+
title: `Replied ${p}×`
|
|
628
|
+
}),
|
|
629
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
630
|
+
role: "button",
|
|
631
|
+
tabIndex: 0,
|
|
632
|
+
title: t.is_starred ? "Unstar" : "Star",
|
|
633
|
+
onClick: (e) => {
|
|
634
|
+
e.stopPropagation(), k(t.id, { is_starred: !t.is_starred });
|
|
635
|
+
},
|
|
636
|
+
onKeyDown: (e) => {
|
|
637
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), k(t.id, { is_starred: !t.is_starred }));
|
|
638
|
+
},
|
|
639
|
+
className: "cursor-pointer flex-shrink-0",
|
|
640
|
+
children: t.is_starred ? /* @__PURE__ */ (0, z.jsx)(R, { className: "w-4 h-4 text-[var(--amber-9)]" }) : /* @__PURE__ */ (0, z.jsx)(I, { className: "w-4 h-4 text-[var(--gray-9)] hover:text-[var(--amber-9)]" })
|
|
641
|
+
}),
|
|
642
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
643
|
+
role: "button",
|
|
644
|
+
tabIndex: 0,
|
|
645
|
+
title: t.is_archived ? "Move to inbox" : "Archive",
|
|
646
|
+
onClick: (e) => {
|
|
647
|
+
e.stopPropagation(), k(t.id, { is_archived: !t.is_archived }), t.is_archived || g(null);
|
|
648
|
+
},
|
|
649
|
+
onKeyDown: (e) => {
|
|
650
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), k(t.id, { is_archived: !t.is_archived }));
|
|
651
|
+
},
|
|
652
|
+
className: "cursor-pointer flex-shrink-0",
|
|
653
|
+
children: t.is_archived ? /* @__PURE__ */ (0, z.jsx)(S, { className: "w-4 h-4 text-[var(--gray-9)] hover:text-[var(--gray-12)]" }) : /* @__PURE__ */ (0, z.jsx)(b, { className: "w-4 h-4 text-[var(--gray-9)] hover:text-[var(--gray-12)]" })
|
|
654
|
+
}),
|
|
655
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
656
|
+
className: "text-xs text-[var(--gray-9)] whitespace-nowrap",
|
|
657
|
+
children: J(t.created_at)
|
|
658
|
+
}),
|
|
659
|
+
n ? /* @__PURE__ */ (0, z.jsx)(O, { className: "w-4 h-4 text-[var(--gray-9)]" }) : /* @__PURE__ */ (0, z.jsx)(h, { className: "w-4 h-4 text-[var(--gray-9)]" })
|
|
660
|
+
]
|
|
661
|
+
})
|
|
662
|
+
]
|
|
663
|
+
}), n && /* @__PURE__ */ (0, z.jsx)("div", {
|
|
664
|
+
className: "px-4 pb-4 border-t border-[var(--gray-a4)]",
|
|
665
|
+
children: /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
666
|
+
className: "pt-3",
|
|
667
|
+
children: [
|
|
668
|
+
/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
669
|
+
className: "flex flex-wrap gap-x-6 gap-y-1 text-xs text-[var(--gray-9)] mb-3",
|
|
670
|
+
children: [
|
|
671
|
+
/* @__PURE__ */ (0, z.jsxs)("span", { children: [
|
|
672
|
+
"From:",
|
|
673
|
+
" ",
|
|
674
|
+
/* @__PURE__ */ (0, z.jsx)(W, {
|
|
675
|
+
personId: d,
|
|
676
|
+
label: t.from_name ? `${t.from_name} <${t.from_email}>` : t.from_email,
|
|
677
|
+
className: "text-xs"
|
|
678
|
+
})
|
|
679
|
+
] }),
|
|
680
|
+
/* @__PURE__ */ (0, z.jsxs)("span", { children: ["Date: ", new Date(t.created_at).toLocaleString()] }),
|
|
681
|
+
t.forwarded_at && /* @__PURE__ */ (0, z.jsxs)("span", {
|
|
682
|
+
className: "flex items-center gap-1",
|
|
683
|
+
children: [
|
|
684
|
+
/* @__PURE__ */ (0, z.jsx)(u, { className: "w-3 h-3" }),
|
|
685
|
+
" Forwarded to ",
|
|
686
|
+
t.forwarded_to,
|
|
687
|
+
" at ",
|
|
688
|
+
new Date(t.forwarded_at).toLocaleString()
|
|
689
|
+
]
|
|
690
|
+
})
|
|
691
|
+
]
|
|
692
|
+
}),
|
|
693
|
+
t.body_html ? /* @__PURE__ */ (0, z.jsx)("div", {
|
|
694
|
+
className: "prose prose-sm max-w-none text-[var(--gray-12)] [&_a]:text-[var(--accent-9)]",
|
|
695
|
+
dangerouslySetInnerHTML: { __html: t.body_html }
|
|
696
|
+
}) : /* @__PURE__ */ (0, z.jsx)("pre", {
|
|
697
|
+
className: "text-sm text-[var(--gray-12)] whitespace-pre-wrap font-sans",
|
|
698
|
+
children: t.body_text || "(empty)"
|
|
699
|
+
}),
|
|
700
|
+
/* @__PURE__ */ (0, z.jsx)(U, { messages: w[t.id] || [] }),
|
|
701
|
+
/* @__PURE__ */ (0, z.jsx)(H, {
|
|
702
|
+
kind: e,
|
|
703
|
+
replyId: t.id,
|
|
704
|
+
toEmail: t.from_email,
|
|
705
|
+
toName: t.from_name,
|
|
706
|
+
onSent: s
|
|
707
|
+
})
|
|
708
|
+
]
|
|
709
|
+
})
|
|
710
|
+
})]
|
|
711
|
+
}, t.id);
|
|
712
|
+
})
|
|
713
|
+
})
|
|
714
|
+
})]
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
function X({ sent: e, personByEmail: t }) {
|
|
718
|
+
let [n, r] = (0, v.useState)(null), i = (0, v.useMemo)(() => [...e].sort((e, t) => e.created_at < t.created_at ? 1 : -1), [e]);
|
|
719
|
+
return i.length === 0 ? /* @__PURE__ */ (0, z.jsxs)(a, {
|
|
720
|
+
variant: "surface",
|
|
721
|
+
className: "p-12 text-center",
|
|
722
|
+
children: [
|
|
723
|
+
/* @__PURE__ */ (0, z.jsx)(d, { className: "w-10 h-10 text-[var(--gray-8)] mx-auto mb-3" }),
|
|
724
|
+
/* @__PURE__ */ (0, z.jsx)("p", {
|
|
725
|
+
className: "text-[var(--gray-11)] mb-1",
|
|
726
|
+
children: "No sent replies"
|
|
727
|
+
}),
|
|
728
|
+
/* @__PURE__ */ (0, z.jsx)("p", {
|
|
729
|
+
className: "text-sm text-[var(--gray-9)]",
|
|
730
|
+
children: "Replies you send from here will appear in this folder"
|
|
731
|
+
})
|
|
732
|
+
]
|
|
733
|
+
}) : /* @__PURE__ */ (0, z.jsx)("div", {
|
|
734
|
+
className: "space-y-2",
|
|
735
|
+
children: i.map((e) => {
|
|
736
|
+
let i = n === e.id, o = t[e.to_address?.toLowerCase()];
|
|
737
|
+
return /* @__PURE__ */ (0, z.jsxs)(a, {
|
|
738
|
+
variant: "surface",
|
|
739
|
+
children: [/* @__PURE__ */ (0, z.jsxs)("button", {
|
|
740
|
+
onClick: () => r(i ? null : e.id),
|
|
741
|
+
className: "w-full text-left px-4 py-3 flex items-center gap-3",
|
|
742
|
+
children: [
|
|
743
|
+
/* @__PURE__ */ (0, z.jsx)(d, { className: "w-4 h-4 text-[var(--gray-9)] flex-shrink-0" }),
|
|
744
|
+
/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
745
|
+
className: "flex-1 min-w-0",
|
|
746
|
+
children: [/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
747
|
+
className: "flex items-center gap-2 text-sm",
|
|
748
|
+
children: [/* @__PURE__ */ (0, z.jsx)("span", {
|
|
749
|
+
className: "text-[var(--gray-9)]",
|
|
750
|
+
children: "To"
|
|
751
|
+
}), /* @__PURE__ */ (0, z.jsx)(W, {
|
|
752
|
+
personId: o,
|
|
753
|
+
label: e.to_address,
|
|
754
|
+
className: "text-sm truncate"
|
|
755
|
+
})]
|
|
756
|
+
}), /* @__PURE__ */ (0, z.jsx)("p", {
|
|
757
|
+
className: "text-sm truncate text-[var(--gray-9)]",
|
|
758
|
+
children: e.subject || "(no subject)"
|
|
759
|
+
})]
|
|
760
|
+
}),
|
|
761
|
+
/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
762
|
+
className: "flex items-center gap-2 flex-shrink-0",
|
|
763
|
+
children: [
|
|
764
|
+
e.attachments && e.attachments.length > 0 && /* @__PURE__ */ (0, z.jsx)(P, {
|
|
765
|
+
className: "w-3.5 h-3.5 text-[var(--gray-9)]",
|
|
766
|
+
title: `${e.attachments.length} attachment(s)`
|
|
767
|
+
}),
|
|
768
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
769
|
+
className: "text-xs text-[var(--gray-9)] whitespace-nowrap",
|
|
770
|
+
children: J(e.created_at)
|
|
771
|
+
}),
|
|
772
|
+
i ? /* @__PURE__ */ (0, z.jsx)(O, { className: "w-4 h-4 text-[var(--gray-9)]" }) : /* @__PURE__ */ (0, z.jsx)(h, { className: "w-4 h-4 text-[var(--gray-9)]" })
|
|
773
|
+
]
|
|
774
|
+
})
|
|
775
|
+
]
|
|
776
|
+
}), i && /* @__PURE__ */ (0, z.jsxs)("div", {
|
|
777
|
+
className: "px-4 pb-4 border-t border-[var(--gray-a4)]",
|
|
778
|
+
children: [
|
|
779
|
+
/* @__PURE__ */ (0, z.jsxs)("div", {
|
|
780
|
+
className: "flex flex-wrap gap-x-6 gap-y-1 text-xs text-[var(--gray-9)] my-3",
|
|
781
|
+
children: [
|
|
782
|
+
/* @__PURE__ */ (0, z.jsxs)("span", { children: ["To: ", e.to_address] }),
|
|
783
|
+
/* @__PURE__ */ (0, z.jsxs)("span", { children: ["From: ", e.from_address] }),
|
|
784
|
+
/* @__PURE__ */ (0, z.jsxs)("span", { children: ["Date: ", new Date(e.created_at).toLocaleString()] })
|
|
785
|
+
]
|
|
786
|
+
}),
|
|
787
|
+
e.body_html ? /* @__PURE__ */ (0, z.jsx)("div", {
|
|
788
|
+
className: "prose prose-sm max-w-none text-[var(--gray-12)] [&_a]:text-[var(--accent-9)]",
|
|
789
|
+
dangerouslySetInnerHTML: { __html: e.body_html }
|
|
790
|
+
}) : /* @__PURE__ */ (0, z.jsx)("pre", {
|
|
791
|
+
className: "text-sm text-[var(--gray-12)] whitespace-pre-wrap font-sans",
|
|
792
|
+
children: e.body_text || ""
|
|
793
|
+
}),
|
|
794
|
+
e.attachments && e.attachments.length > 0 && /* @__PURE__ */ (0, z.jsx)("ul", {
|
|
795
|
+
className: "mt-2 space-y-0.5",
|
|
796
|
+
children: e.attachments.map((e, t) => /* @__PURE__ */ (0, z.jsxs)("li", {
|
|
797
|
+
className: "flex items-center gap-1.5 text-xs text-[var(--gray-10)]",
|
|
798
|
+
children: [
|
|
799
|
+
/* @__PURE__ */ (0, z.jsx)(P, { className: "w-3 h-3" }),
|
|
800
|
+
/* @__PURE__ */ (0, z.jsx)("span", {
|
|
801
|
+
className: "truncate",
|
|
802
|
+
children: e.filename
|
|
803
|
+
}),
|
|
804
|
+
typeof e.size == "number" && e.size > 0 && /* @__PURE__ */ (0, z.jsxs)("span", {
|
|
805
|
+
className: "text-[var(--gray-9)]",
|
|
806
|
+
children: [(e.size / 1024).toFixed(0), " KB"]
|
|
807
|
+
})
|
|
808
|
+
]
|
|
809
|
+
}, `${e.filename}-${t}`))
|
|
810
|
+
})
|
|
811
|
+
]
|
|
812
|
+
})]
|
|
813
|
+
}, e.id);
|
|
814
|
+
})
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
//#endregion
|
|
818
|
+
//#region src/lib/resolvePeopleByEmail.ts
|
|
819
|
+
async function Z(e) {
|
|
820
|
+
let t = Array.from(new Set(e.filter((e) => !!e).map((e) => e.trim()).filter(Boolean)));
|
|
821
|
+
if (t.length === 0) return {};
|
|
822
|
+
let r = Array.from(new Set(t.flatMap((e) => [e, e.toLowerCase()]))), [i, a] = await Promise.all([n.from("people").select("id, email").in("email", r), n.from("person_emails").select("person_id, email").in("email", r)]), o = {};
|
|
823
|
+
for (let e of i.data || []) e.email && e.id && (o[e.email.toLowerCase()] = e.id);
|
|
824
|
+
for (let e of a.data || []) e.email && e.person_id && (o[e.email.toLowerCase()] = e.person_id);
|
|
825
|
+
return o;
|
|
826
|
+
}
|
|
827
|
+
//#endregion
|
|
828
|
+
export { Y as n, Z as t };
|