@nylas/react 1.1.0-canary.5 → 1.1.0-canary.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/{elements-dc5b338e-e87f79b6.js → elements-dc5b338e-6078b875.js} +1 -1
  2. package/dist/{elements-dc5b338e-29ef67ec.cjs → elements-dc5b338e-96e197ca.cjs} +1 -1
  3. package/dist/{focus-visible-e8093c16-61d506d2.cjs → focus-visible-e8093c16-018ffd63.cjs} +1 -1
  4. package/dist/{focus-visible-e8093c16-e7357f74.js → focus-visible-e8093c16-ab01d60a.js} +1 -1
  5. package/dist/{index-f9ba9aa8.js → index-1fd24ccf.js} +1039 -1428
  6. package/dist/index-823fdc6f.cjs +36 -0
  7. package/dist/react.cjs +1 -1
  8. package/dist/react.js +52 -52
  9. package/package.json +3 -3
  10. package/dist/add-circle-icon_22.entry-9f634efd.js +0 -1731
  11. package/dist/add-circle-icon_22.entry-e7ec6c34.cjs +0 -1
  12. package/dist/archive-icon_7.entry-24bac466.js +0 -75
  13. package/dist/archive-icon_7.entry-6649ed76.cjs +0 -1
  14. package/dist/arrow-icon.entry-1fffd526.cjs +0 -1
  15. package/dist/arrow-icon.entry-82e59ce4.js +0 -15
  16. package/dist/bold-icon_3.entry-5a01fecf.cjs +0 -1
  17. package/dist/bold-icon_3.entry-72e585da.js +0 -35
  18. package/dist/calendar-cancel-icon.entry-0b52bdc9.cjs +0 -1
  19. package/dist/calendar-cancel-icon.entry-247b530c.js +0 -15
  20. package/dist/calendar-check-icon_2.entry-d7bb76c7.cjs +0 -1
  21. package/dist/calendar-check-icon_2.entry-dbb2df49.js +0 -25
  22. package/dist/calendar-icon.entry-911773c4.cjs +0 -1
  23. package/dist/calendar-icon.entry-d64cb3d3.js +0 -15
  24. package/dist/chevron-icon_3.entry-b72f4cdb.cjs +0 -1
  25. package/dist/chevron-icon_3.entry-db9f8217.js +0 -117
  26. package/dist/close-icon.entry-9d141bb4.js +0 -15
  27. package/dist/close-icon.entry-da590fa2.cjs +0 -1
  28. package/dist/constants-6ee60d6d-09ee73d9.cjs +0 -15
  29. package/dist/constants-6ee60d6d-d5928e79.js +0 -3740
  30. package/dist/document-refresh-icon.entry-5e8cc2f0.cjs +0 -1
  31. package/dist/document-refresh-icon.entry-ee9632d7.js +0 -15
  32. package/dist/forward-icon_6.entry-cac8473a.cjs +0 -3
  33. package/dist/forward-icon_6.entry-f054ad9d.js +0 -953
  34. package/dist/globe-icon.entry-2fde6ac4.js +0 -15
  35. package/dist/globe-icon.entry-bc484551.cjs +0 -1
  36. package/dist/google-logo-icon_4.entry-a9848399.cjs +0 -1
  37. package/dist/google-logo-icon_4.entry-dca87e45.js +0 -349
  38. package/dist/index-22f7e49c.cjs +0 -37
  39. package/dist/index.es-f57e612a-1d17c676.js +0 -3137
  40. package/dist/index.es-f57e612a-95ca3e17.cjs +0 -7
  41. package/dist/info-icon_2.entry-dbf3931a.js +0 -34
  42. package/dist/info-icon_2.entry-e67844eb.cjs +0 -1
  43. package/dist/loading-icon.entry-4566cba8.cjs +0 -1
  44. package/dist/loading-icon.entry-ae4c2d7e.js +0 -15
  45. package/dist/mailbox-store-47fc8a1a-2365f20f.js +0 -380
  46. package/dist/mailbox-store-47fc8a1a-cd3516a7.cjs +0 -1
  47. package/dist/nylas-additional-participants.entry-7c568149.cjs +0 -1
  48. package/dist/nylas-additional-participants.entry-e8426256.js +0 -81
  49. package/dist/nylas-booked-event-card_10.entry-6a664889.cjs +0 -1
  50. package/dist/nylas-booked-event-card_10.entry-ef767733.js +0 -782
  51. package/dist/nylas-form-card.entry-d8506b1f.js +0 -54
  52. package/dist/nylas-form-card.entry-e44169b6.cjs +0 -1
  53. package/dist/nylas-if-state.entry-044c49d2.cjs +0 -1
  54. package/dist/nylas-if-state.entry-98a336df.js +0 -94
  55. package/dist/nylas-list-folders.entry-509f9be4.cjs +0 -1
  56. package/dist/nylas-list-folders.entry-55ce3403.js +0 -120
  57. package/dist/nylas-list-threads.entry-1f57382a.js +0 -70
  58. package/dist/nylas-list-threads.entry-c36e2cf3.cjs +0 -1
  59. package/dist/nylas-login.entry-66f542b8.cjs +0 -1
  60. package/dist/nylas-login.entry-76358c2f.js +0 -73
  61. package/dist/nylas-mailbox-pagination.entry-5562257a.js +0 -101
  62. package/dist/nylas-mailbox-pagination.entry-89b0dd99.cjs +0 -1
  63. package/dist/nylas-mailbox-toolbar-button.entry-573e0429.cjs +0 -1
  64. package/dist/nylas-mailbox-toolbar-button.entry-6b1b5b15.js +0 -82
  65. package/dist/nylas-mailbox.entry-97c503f2.js +0 -134
  66. package/dist/nylas-mailbox.entry-e21a2f50.cjs +0 -1
  67. package/dist/nylas-provider.entry-07e1e26a.js +0 -145
  68. package/dist/nylas-provider.entry-61899957.cjs +0 -1
  69. package/dist/nylas-scheduler-editor.entry-60fe38ce.cjs +0 -7
  70. package/dist/nylas-scheduler-editor.entry-e326c9de.js +0 -2275
  71. package/dist/nylas-scheduling.entry-be0cc090.js +0 -235
  72. package/dist/nylas-scheduling.entry-d88289db.cjs +0 -1
  73. package/dist/nylas-threads-refresh.entry-8201f8dd.js +0 -74
  74. package/dist/nylas-threads-refresh.entry-c71ee775.cjs +0 -1
  75. package/dist/nylas-threads-search.entry-912a90a4.cjs +0 -1
  76. package/dist/nylas-threads-search.entry-fc477e01.js +0 -69
  77. package/dist/nylas-view-thread.entry-af418ddb.cjs +0 -1
  78. package/dist/nylas-view-thread.entry-d2953ea8.js +0 -203
  79. package/dist/people-icon.entry-4b598fde.js +0 -15
  80. package/dist/people-icon.entry-73cfa6f5.cjs +0 -1
  81. package/dist/play-icon_2.entry-1a487abb.cjs +0 -1
  82. package/dist/play-icon_2.entry-d1c2f823.js +0 -25
  83. package/dist/refresh-icon.entry-42d543d0.cjs +0 -1
  84. package/dist/refresh-icon.entry-6aedfce6.js +0 -15
  85. package/dist/register-component-cf5c8420-d3fb6bf9.cjs +0 -1
  86. package/dist/register-component-cf5c8420-dc1bc0a4.js +0 -109
  87. package/dist/scheduler-config-store-6222c0ed-000f1a4f.js +0 -18
  88. package/dist/scheduler-config-store-6222c0ed-758621fb.cjs +0 -1
  89. package/dist/scheduler-store-39d37291-4e8e9ff9.js +0 -293
  90. package/dist/scheduler-store-39d37291-b66c052c.cjs +0 -1
  91. package/dist/time-period-selector.entry-f1e27a00.js +0 -76
  92. package/dist/time-period-selector.entry-fb3d0178.cjs +0 -1
  93. package/dist/translate-icon.entry-0d44b6cb.cjs +0 -1
  94. package/dist/translate-icon.entry-3db947f5.js +0 -15
  95. package/dist/warning-icon.entry-a20657e4.cjs +0 -1
  96. package/dist/warning-icon.entry-a8ea0fe0.js +0 -15
@@ -1,1731 +0,0 @@
1
- import { r as y, h as a, c as w, d, H as k, g as x, z as j, A as H, B as ve, i as We, C as V, D as ae, E as ie, G as ke, I as we, J as W, K as Ve } from "./index-f9ba9aa8.js";
2
- import { R as _ } from "./register-component-cf5c8420-dc1bc0a4.js";
3
- import { T as xe, E as _e } from "./constants-6ee60d6d-d5928e79.js";
4
- import "react";
5
- import "react-dom";
6
- const Ue = ".sc-add-circle-icon-h{display:flex}", Ze = Ue, Ye = class {
7
- constructor(e) {
8
- y(this, e), this.width = "24", this.height = "25";
9
- }
10
- render() {
11
- return a("svg", { key: "cf16ecaad5754ff1367162ab390027b36f7ede3e", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "8a93ab08ac48dd371bc2526a42ce86f15595128a", d: "M12 2.5c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10ZM12 4a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17Zm0 3.5a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 12 7.5Z", fill: "currentColor" }));
12
- }
13
- };
14
- Ye.style = Ze;
15
- const Ke = "button.sc-button-component{height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer;font-family:var(--nylas-font-family);font-weight:600}button.button-primary.sc-button-component{background:var(--nylas-primary);color:var(--nylas-base-0);height:48px;border:none;border-radius:var(--nylas-border-radius-2x);font-size:1rem;line-height:24px;padding:0 1rem;cursor:pointer}button.button-primary.sc-button-component:hover{background:var(--nylas-base-600)}button.button-primary.sc-button-component:active{background:var(--nylas-base-800)}button.button-primary.sc-button-component:disabled{background:var(--nylas-base-300);cursor:not-allowed}button.button-basic.sc-button-component{border:1px solid var(--nylas-base-300);color:var(--nylas-base-700);background:transparent}button.button-basic.sc-button-component:hover{background:transparent;border-color:var(--nylas-primary)}button.button-basic.sc-button-component:active{background:transparent;border-color:var(--nylas-base-600);border-width:2px}button.button-basic.sc-button-component:disabled{background:transparent;border-color:var(--nylas-base-300);color:var(--nylas-base-300);cursor:not-allowed}button.button-destructive.sc-button-component{border:1px solid var(--nylas-base-300);color:var(--nylas-error);background:transparent}button.button-destructive.sc-button-component:hover{background:transparent;border-color:var(--nylas-error)}button.button-destructive.sc-button-component:active{background:transparent;border-color:var(--nylas-error-pressed);border-width:2px;color:var(--nylas-error-pressed)}button.button-destructive.sc-button-component:disabled{background:transparent;border-color:var(--nylas-base-300);color:var(--nylas-base-300);cursor:not-allowed}", qe = Ke, Je = class {
16
- constructor(e) {
17
- y(this, e), this.variant = "primary", this.disabled = !1, this.type = "button", this.clickHandler = void 0, this.mouseOverHandler = void 0, this.mouseOutHandler = void 0, this.focusHandler = void 0, this.blurHandler = void 0;
18
- }
19
- render() {
20
- const e = `button-${this.variant}` + (this.disabled ? " disabled" : "");
21
- return a("button", { key: "fc37072bb6662cb8d14d597672b2944aa54bc813", class: e, disabled: this.disabled, type: "type", onClick: this.clickHandler, onMouseOver: this.mouseOverHandler, onMouseOut: this.mouseOutHandler, onFocus: this.focusHandler, onBlur: this.blurHandler }, a("slot", { key: "f951bc5c0b29be66946a743713ca5dd089b64c8c" }));
22
- }
23
- };
24
- Je.style = qe;
25
- const Ge = ".sc-calendar-info-icon-h{display:flex}", Xe = Ge, Qe = class {
26
- constructor(e) {
27
- y(this, e), this.width = "20", this.height = "20";
28
- }
29
- render() {
30
- return a("svg", { key: "060bde1be8b6a697f073c73caa121b3b79f989a1", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "5ddd8695565e3efee4a76a2757cf7cafa79780b0", d: "M12 0C13.3807 0 14.5 1.11929 14.5 2.5V6.59971C14.1832 6.43777 13.8486 6.30564 13.5 6.20703V4H1.5V11.5C1.5 12.3284 2.17157 13 3 13H6.70703C6.80564 13.3486 6.93777 13.6832 7.09971 14H3C1.61929 14 0.5 12.8807 0.5 11.5V2.5C0.5 1.11929 1.61929 0 3 0H12ZM12 1H3C2.17157 1 1.5 1.67157 1.5 2.5V3H13.5V2.5C13.5 1.67157 12.8284 1 12 1ZM11.375 9.5C11.375 9.15482 11.6548 8.875 12 8.875C12.3452 8.875 12.625 9.15482 12.625 9.5C12.625 9.84518 12.3452 10.125 12 10.125C11.6548 10.125 11.375 9.84518 11.375 9.5ZM12.5 13.5C12.5 13.7761 12.2761 14 12 14C11.7239 14 11.5 13.7761 11.5 13.5V11.5C11.5 11.2239 11.7239 11 12 11C12.2761 11 12.5 11.2239 12.5 11.5V13.5ZM7.5 11.5C7.5 9.01472 9.51472 7 12 7C14.4853 7 16.5 9.01472 16.5 11.5C16.5 13.9853 14.4853 16 12 16C9.51472 16 7.5 13.9853 7.5 11.5ZM8.5 11.5C8.5 13.433 10.067 15 12 15C13.933 15 15.5 13.433 15.5 11.5C15.5 9.567 13.933 8 12 8C10.067 8 8.5 9.567 8.5 11.5Z", fill: "currentColor" }));
31
- }
32
- };
33
- Qe.style = Xe;
34
- const et = ".sc-calendar-patterns-icon-h{display:flex}", tt = et, nt = class {
35
- constructor(e) {
36
- y(this, e), this.width = "20", this.height = "20";
37
- }
38
- render() {
39
- return a("svg", { key: "d01849f00df7eb5d24f7da7a76c933fdcdfd13b1", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "d1fdc79ea4e67493ccd8058530e12d127d174e66", d: "M3.25 0H11.75C13.2688 0 14.5 1.23122 14.5 2.75V11.25C14.5 12.7688 13.2688 14 11.75 14H3.25C1.73122 14 0.5 12.7688 0.5 11.25V2.75C0.5 1.23122 1.73122 0 3.25 0ZM2 2.75V4H13V2.75C13 2.05964 12.4404 1.5 11.75 1.5H3.25C2.55964 1.5 2 2.05964 2 2.75ZM12.2071 5L8.20711 9H10.7929L13 6.79289V5H12.2071ZM10.7929 5H8.20711L4.20711 9H6.79289L10.7929 5ZM2.79289 9L6.79289 5H4.20711L2 7.20711V9H2.79289ZM2 5.79289L2.79289 5H2V5.79289ZM12.2071 9H13V8.20711L12.2071 9Z", fill: "currentColor" }));
40
- }
41
- };
42
- nt.style = tt;
43
- const at = ".sc-flow-icon-h{display:flex}", it = at, st = class {
44
- constructor(e) {
45
- y(this, e), this.width = "16", this.height = "12";
46
- }
47
- render() {
48
- return a("svg", { key: "ce2f820ce9aacb96c4464a56676f1f136980caa2", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "af4cba794e87457fd175d21a731c5088cd6a1819", d: "M13 1.66211C11.8954 1.66211 11 2.55754 11 3.66211C11 4.76668 11.8954 5.66211 13 5.66211C14.1046 5.66211 15 4.76668 15 3.66211C15 2.55754 14.1046 1.66211 13 1.66211ZM10.0407 3.16678C10.2768 1.74563 11.5119 0.662109 13 0.662109C14.6569 0.662109 16 2.00526 16 3.66211C16 5.31896 14.6569 6.66211 13 6.66211C11.5162 6.66211 10.2839 5.58482 10.0428 4.16971C9.37629 4.23688 8.82682 4.7426 8.71466 5.41551L8.27173 8.07311C8.07929 9.22776 7.11428 10.087 5.9593 10.1574C5.72319 11.5786 4.48813 12.6621 3 12.6621C1.34315 12.6621 0 11.319 0 9.66211C0 8.00526 1.34315 6.66211 3 6.66211C4.48384 6.66211 5.71607 7.73939 5.95724 9.15451C6.62371 9.08734 7.17318 8.58162 7.28534 7.90871L7.72827 5.25111C7.92071 4.09646 8.88571 3.23718 10.0407 3.16678ZM3 7.66211C1.89543 7.66211 1 8.55754 1 9.66211C1 10.7667 1.89543 11.6621 3 11.6621C4.10457 11.6621 5 10.7667 5 9.66211C5 8.55754 4.10457 7.66211 3 7.66211Z", fill: "currentColor" }));
49
- }
50
- };
51
- st.style = it;
52
- const ot = ".sc-location-icon-h{display:flex}", lt = ot, rt = class {
53
- constructor(e) {
54
- y(this, e), this.width = "16", this.height = "18";
55
- }
56
- render() {
57
- return a("svg", { key: "6854dc205118a9abcd1dcacd099a372ffaa2b5b5", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "c659d22a667fce86b5c06818870b6f90fc569fa0", d: "M10 7.66211C10 9.31896 8.65685 10.6621 7 10.6621C5.34315 10.6621 4 9.31896 4 7.66211C4 6.00526 5.34315 4.66211 7 4.66211C8.65685 4.66211 10 6.00526 10 7.66211ZM9 7.66211C9 6.55754 8.10457 5.66211 7 5.66211C5.89543 5.66211 5 6.55754 5 7.66211C5 8.76668 5.89543 9.66211 7 9.66211C8.10457 9.66211 9 8.76668 9 7.66211ZM11.9497 12.6171C14.6834 9.88221 14.6834 5.44812 11.9497 2.71326C9.21608 -0.0216067 4.78392 -0.0216067 2.05025 2.71326C-0.683418 5.44812 -0.683418 9.88221 2.05025 12.6171L3.57128 14.1159L5.61408 16.101L5.74691 16.2188C6.52168 16.8468 7.65623 16.8076 8.38611 16.1012L10.8223 13.7312L11.9497 12.6171ZM2.75499 3.4183C5.09944 1.07282 8.90055 1.07282 11.245 3.4183C13.5294 5.70364 13.5879 9.3725 11.4207 11.7288L11.245 11.912L9.92371 13.216L7.69315 15.3846L7.60016 15.4642C7.24594 15.732 6.7543 15.732 6.40012 15.4642L6.30713 15.3845L3.3263 12.4791L2.75499 11.912L2.57927 11.7288C0.412077 9.3725 0.47065 5.70364 2.75499 3.4183Z", fill: "currentColor" }));
58
- }
59
- };
60
- rt.style = lt;
61
- const dt = ".sc-location-off-icon-h{display:flex}", ct = dt, pt = class {
62
- constructor(e) {
63
- y(this, e), this.width = "16", this.height = "18";
64
- }
65
- render() {
66
- return a("svg", { key: "d0202239d621e2049349e21b2b7f5d824f153384", width: this.width, height: this.height, fill: "none", xmlns: "http://www.w3.org/2000/svg" }, a("path", { key: "fb6dee10dd728b79127775be0a00e20ac54d26a1", d: "M0.146447 0.808556C0.341709 0.613294 0.658291 0.613294 0.853553 0.808556L15.8536 15.8086C16.0488 16.0038 16.0488 16.3204 15.8536 16.5157C15.6583 16.7109 15.3417 16.7109 15.1464 16.5157L12.0938 13.463L11.8223 13.7312L9.38611 16.1012C8.65623 16.8076 7.52168 16.8468 6.74691 16.2188L6.61408 16.101L4.57128 14.1159L3.05025 12.6171C0.607421 10.1732 0.347525 6.37239 2.27056 3.63976L0.146447 1.51566C-0.0488155 1.3204 -0.0488155 1.00382 0.146447 0.808556ZM9.07768 10.4469C8.74346 10.576 8.38024 10.6468 8.0005 10.6468C6.34839 10.6468 5.00909 9.30689 5.00909 7.65406C5.00909 7.27461 5.07967 6.91166 5.20843 6.57763L2.98793 4.35713C1.49206 6.62038 1.68917 9.67377 3.57927 11.7288L3.75499 11.912L4.3263 12.4791L7.30713 15.3845L7.40012 15.4642C7.7543 15.732 8.24594 15.732 8.60016 15.4642L8.69315 15.3846L10.9237 13.216L11.3883 12.7575L9.07768 10.4469ZM9.85409 8.39486L10.5983 9.13904C10.8487 8.70143 10.9919 8.19447 10.9919 7.65406C10.9919 6.00122 9.65261 4.66134 8.0005 4.66134C7.45986 4.66134 6.95271 4.80482 6.51504 5.05581L7.25921 5.79998C7.48839 5.70819 7.73855 5.6577 8.0005 5.6577C9.10258 5.6577 9.99599 6.5515 9.99599 7.65406C9.99599 7.91581 9.94564 8.16581 9.85409 8.39486ZM4.35291 2.89368C6.70671 1.08827 10.0908 1.26314 12.245 3.4183C14.3986 5.57283 14.5739 8.95702 12.771 11.3118L13.4812 12.022C15.6702 9.27273 15.493 5.25762 12.9497 2.71326C10.4058 0.168159 6.39081 -0.00843871 3.64269 2.18347L4.35291 2.89368Z", fill: "currentColor" }));
67
- }
68
- };
69
- pt.style = ct;
70
- const ft = ':host{display:block;width:inherit;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.dropdown{display:inline-block;width:100%;position:relative}.dropdown .dropdown-label{display:flex;align-items:center;gap:0.25rem;color:var(--nylas-base-800)}.dropbtn{width:inherit;height:48px;color:black;padding:0.5rem;font-size:1rem;cursor:pointer;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.dropbtn.focus{background:transparent}.dropbtn:hover,.dropbtn:active{border:1px solid var(--nylas-primary)}.dropbtn:active{outline:2px solid var(--nylas-primary)}.dropbtn span.open{transform:rotate(90deg)}.dropbtn span.closed{transform:rotate(270deg)}.dropdown-content{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.dropdown-content ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.dropdown-content ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.dropdown-content ul li:hover,.dropdown-content ul li:focus{background-color:var(--nylas-base-100)}.dropdown-content ul li label{display:flex;align-items:center;gap:0.5rem}.dropdown-content ul li label input{margin:0}.selected-options{display:flex;flex-wrap:wrap;gap:0.5rem;padding:0.5rem 0;margin-top:0.25rem;background:var(--nylas-base-0)}.selected-options .selected-option{display:flex;align-items:center;gap:0.5rem;padding:4px 8px;border-radius:var(--nylas-border-radius-2x);background:var(--nylas-base-100);color:var(--nylas-base-800);font-size:16px;font-weight:500;line-height:1.5rem;letter-spacing:0.5px}.selected-options .selected-option button{background:transparent;border:none;cursor:pointer;padding:0}.selected-options .selected-option button:hover{color:var(--nylas-primary)}', bt = ft, ut = class {
71
- constructor(e) {
72
- y(this, e), this.selectedOptionsChanged = w(this, "selectedOptionsChanged", 7), this.name = void 0, this.label = void 0, this.options = [], this.availableOptions = this.options, this.isOpen = !1, this.ariaActivedescendant = "", this.shouldFocusFirstOption = !1;
73
- }
74
- componentDidRender() {
75
- d("multi-select-dropdown", "componentDidRender"), this.isOpen && this.shouldFocusFirstOption && (this.ariaActivedescendant = this.availableOptions[0].value, this.focusOption(0), this.shouldFocusFirstOption = !1);
76
- }
77
- handleOutsideClick(e) {
78
- !e.composedPath().includes(this.el) && this.isOpen && (this.isOpen = !1);
79
- }
80
- selectOption(e) {
81
- this.availableOptions = this.availableOptions.map((n) => (n.value === e.value && (n.selected = !e.selected), n));
82
- const t = this.availableOptions.filter((n) => n.selected).map((n) => n.value);
83
- this.selectedOptionsChanged.emit({
84
- value: t,
85
- name: this.name
86
- });
87
- }
88
- toggleDropdown() {
89
- this.isOpen = !this.isOpen, this.isOpen ? this.shouldFocusFirstOption = !0 : this.ariaActivedescendant = "";
90
- }
91
- handleSelectButtonKeyDown(e) {
92
- switch (e.key) {
93
- case "ArrowDown":
94
- case "Enter":
95
- e.preventDefault(), this.isOpen || this.toggleDropdown();
96
- break;
97
- case "Escape":
98
- this.isOpen = !1;
99
- break;
100
- }
101
- }
102
- handleListboxKeydown(e) {
103
- const t = this.availableOptions, n = t.findIndex((s) => s.value === this.ariaActivedescendant);
104
- switch (e.key) {
105
- case "ArrowDown":
106
- case "Tab":
107
- if (e.shiftKey) {
108
- e.preventDefault();
109
- const o = n - 1 >= 0 ? n - 1 : t.length - 1;
110
- this.ariaActivedescendant = t[o].value, this.focusOption(o);
111
- } else {
112
- e.preventDefault();
113
- const o = n + 1 < t.length ? n + 1 : 0;
114
- this.ariaActivedescendant = t[o].value, this.focusOption(o);
115
- }
116
- break;
117
- case "ArrowUp":
118
- e.preventDefault();
119
- const s = n - 1 >= 0 ? n - 1 : t.length - 1;
120
- this.ariaActivedescendant = t[s].value, this.focusOption(s);
121
- break;
122
- case "Enter":
123
- e.preventDefault(), this.ariaActivedescendant && this.selectOption(t[n]);
124
- break;
125
- case "Escape":
126
- this.isOpen = !1;
127
- break;
128
- }
129
- }
130
- focusOption(e) {
131
- var o;
132
- const t = this.availableOptions[e];
133
- if (!t)
134
- return;
135
- const n = t.value, s = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
136
- s && (s.focus(), s.scrollIntoView({ behavior: "smooth", block: "nearest" }));
137
- }
138
- getSelectedOptions() {
139
- return this.availableOptions.filter((e) => e.selected);
140
- }
141
- renderOption(e) {
142
- return a("li", { key: e.value, id: e.value, role: "option", tabindex: "0", "aria-selected": e.selected ? "true" : "false", onClick: (t) => {
143
- t.stopImmediatePropagation(), this.selectOption(e);
144
- }, class: { selected: !!e.selected } }, a("label", { htmlFor: e.value }, a("input", { "aria-hidden": "true", id: e.value, type: "checkbox", checked: e.selected }), a("span", null, e.label)));
145
- }
146
- render() {
147
- var e, t;
148
- return a(k, { key: "7502de7e6d986d6e2536849703ee28c79b5c1195" }, a("div", { key: "1ddfc9626f7864703fee5e0c3c9bfd09036a17ce", class: "dropdown", part: "msd_dropdown" }, a("label", { key: "8da2bb175a29fe6680fadfd926e3d05240635391", class: "dropdown-label" }, this.label, a("slot", { key: "e1eccd82254cd095768c3e5ae36cff3134ca747f", name: "label-icon", "aria-hidden": "true" })), a("button", { key: "6d56072472b3e51f08e7980ddcff9650fc35c13a", part: "msd_dropdown-button", class: { dropbtn: !0, open: this.isOpen }, onClick: () => this.toggleDropdown(), "aria-haspopup": "listbox", "aria-expanded": this.isOpen ? "true" : "false", "aria-label": this.name, onKeyDown: (n) => this.handleSelectButtonKeyDown(n) }, a("slot", { key: "11dee24f8003354b0316e19833e5001c913f4a9e", name: "select-icon", "aria-hidden": "true" }), a("span", { key: "65c1709b1be19a34be367455062a4719598f51a2", class: "selected-option", part: "msd_dropdown-button-selected-label" }, this.getSelectedOptions().length > 1 ? `Multiple ${this.name}s selected` : ((e = this.availableOptions.filter((n) => n.selected)[0]) == null ? void 0 : e.label) ?? ((t = this.availableOptions[0]) == null ? void 0 : t.label)), a("span", { key: "81d7d8b18144b4276f6c19682c8fd78072a8074b", class: this.isOpen ? "open" : "closed", "aria-hidden": "true" }, a("chevron-icon", { key: "36afd55e13491d5af7af22be2aca5a1dff6c2315", width: "16", height: "16" }))), this.isOpen ? null : a("div", { class: "selected-options" }, this.getSelectedOptions().map((n) => a("span", { class: "selected-option" }, n.label, a("button", { key: n.label, onClick: () => this.selectOption(n) }, a("close-icon", null))))), this.isOpen ? a("div", { class: "dropdown-content", part: "msd_dropdown-content" }, a("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-multiselectable": !0, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (n) => this.handleListboxKeydown(n) }, this.availableOptions.map((n) => this.renderOption(n)))) : null));
149
- }
150
- get el() {
151
- return x(this);
152
- }
153
- };
154
- ut.style = bt;
155
- const ht = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-availability-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-availability-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-availability-picker .header h3{margin:0;font-size:16px;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-availability-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-availability-picker .content{padding:1rem;color:var(--nylas-base-900);font-size:16px;font-family:var(--nylas-font-family)}@media screen and (max-width: 504px){.nylas-availability-picker .content{font-size:15px}}.nylas-availability-picker .content .select-timezone{display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--nylas-base-200);padding-bottom:1rem;gap:1rem}.nylas-availability-picker .content .select-timezone h4{display:flex;gap:0.5rem;align-items:center;margin:0;font-size:16px;font-weight:500;line-height:20px}@media screen and (max-width: 504px){.nylas-availability-picker .content .select-timezone h4{font-size:15px}}.nylas-availability-picker .content .select-timezone select-dropdown{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-availability-picker .content .availability{display:flex;flex-direction:column;gap:1rem;padding:0 0.5rem;margin:1rem 0}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability{gap:0.5rem;padding:0}}.nylas-availability-picker .content .availability .availability-day{display:grid;grid-template-columns:minmax(auto, 65px) 1fr minmax(auto, 40px);gap:1rem;align-items:baseline}@media screen and (max-width: 768px){.nylas-availability-picker .content .availability .availability-day{grid-template-columns:78px 1fr auto}}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day{display:inline-grid;gap:8px;grid-template-columns:60px 1fr auto}}.nylas-availability-picker .content .availability .availability-day .day{display:flex;gap:0.5rem;align-items:center}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day .day{gap:0.25rem}}.nylas-availability-picker .content .availability .availability-day .day input[type=checkbox]{transform:scale(1.3)}.nylas-availability-picker .content .availability .availability-day .time-ranges span.unavailable{height:48px;display:flex;align-items:center;justify-content:center}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range{display:flex;gap:1.5rem;justify-content:space-between;align-items:baseline}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range{justify-content:unset;gap:0.5rem}}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers{display:flex;gap:1rem}@media screen and (max-width: 504px){.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers{gap:0.5rem}}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range .pickers span{margin-top:0.75rem}.nylas-availability-picker .content .availability .availability-day .time-ranges .time-range:not(:last-of-type){margin-bottom:1rem}.nylas-availability-picker .content .availability .availability-day .time-ranges p.error{color:var(--nylas-error)}.nylas-availability-picker .content .availability .availability-day button{border:none;background:transparent;height:40px;cursor:pointer;color:var(--nylas-base-800)}.nylas-availability-picker .content .availability .availability-day button:hover,.nylas-availability-picker .content .availability .availability-day button:active{color:var(--nylas-primary)}', mt = ht;
156
- var yt = function(e, t, n, s) {
157
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
158
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
159
- i = Reflect.decorate(e, t, n, s);
160
- else
161
- for (var r = e.length - 1; r >= 0; r--)
162
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
163
- return o > 3 && i && Object.defineProperty(t, n, i), i;
164
- }, se = function(e, t) {
165
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
166
- return Reflect.metadata(e, t);
167
- };
168
- const Ce = class {
169
- constructor(e) {
170
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.openHours = void 0, this.name = "availability", this.defaultTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.schedule = {
171
- SUN: [],
172
- MON: [{ start: "09:00am", end: "05:00pm" }],
173
- TUE: [{ start: "09:00am", end: "05:00pm" }],
174
- WED: [{ start: "09:00am", end: "05:00pm" }],
175
- THU: [{ start: "09:00am", end: "05:00pm" }],
176
- FRI: [{ start: "09:00am", end: "05:00pm" }],
177
- SAT: []
178
- }, this.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone, this.overlapDays = {};
179
- }
180
- elementNameChangedHandler(e) {
181
- d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
182
- }
183
- scheduleChanged(e, t) {
184
- var n;
185
- if (e !== t) {
186
- this.valueChanged.emit({
187
- value: this.scheduleToOpenHours(e, this.timezone),
188
- name: this.name
189
- });
190
- let s = {};
191
- if (Object.keys(e).forEach((o) => {
192
- const i = e[o];
193
- if (i.length > 0) {
194
- const l = this.getOverlaps(i);
195
- l.length > 0 && (s[o] = l);
196
- }
197
- }), this.overlapDays = s, typeof this.internals.setFormValue != "function")
198
- return;
199
- if (Object.keys(s).length > 0) {
200
- const o = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(Object.keys(s)[0]);
201
- o && this.internals.setValidity({ customError: !0 }, "Overlapping time ranges found", o);
202
- } else
203
- this.internals.setValidity({ customError: !1 }), this.internals.setFormValue(JSON.stringify(this.scheduleToOpenHours(e, this.timezone)));
204
- }
205
- }
206
- selectedOptionChangedHandler(e) {
207
- const { name: t, value: n } = e.detail;
208
- if (t === "timezone") {
209
- if (this.timezone = n, typeof this.internals.setFormValue != "function")
210
- return;
211
- this.internals.setFormValue(JSON.stringify(this.scheduleToOpenHours(this.schedule, this.timezone)));
212
- }
213
- }
214
- connectedCallback() {
215
- d("nylas-availability-picker", "connectedCallback");
216
- }
217
- disconnectedCallback() {
218
- d("nylas-availability-picker", "disconnectedCallback");
219
- }
220
- componentWillLoad() {
221
- d("nylas-availability-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
222
- }
223
- componentDidLoad() {
224
- d("nylas-availability-picker", "componentDidLoad"), this.openHours && this.openHours.length > 0 && this.updateSchedule(this.openHours), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(JSON.stringify(this.scheduleToOpenHours(this.schedule, this.timezone)));
225
- }
226
- getOverlaps(e) {
227
- let t = e.map((s, o) => ({
228
- start: j(s.start),
229
- end: j(s.end),
230
- originalIndex: o
231
- }));
232
- t.sort((s, o) => s.start - o.start);
233
- let n = [];
234
- for (let s = 1; s < t.length; s++)
235
- t[s].start < t[s - 1].end && (n.includes(t[s].originalIndex) || n.push(t[s].originalIndex), n.includes(t[s - 1].originalIndex) || n.push(t[s - 1].originalIndex));
236
- return n.sort((s, o) => s - o);
237
- }
238
- addTimeRange(e) {
239
- const t = this.schedule[e], n = 0, s = 1425;
240
- if (t.length === 0)
241
- this.schedule[e] = [{ start: "09:00am", end: "05:00pm" }];
242
- else {
243
- const o = t.map((l) => ({
244
- start: j(l.start),
245
- end: j(l.end)
246
- })).sort((l, r) => l.start - r.start), i = o[o.length - 1].end;
247
- if (i + 60 <= s)
248
- this.schedule[e].push({
249
- start: H(W(i)),
250
- end: H(W(i + 60))
251
- });
252
- else {
253
- let l = !1;
254
- if (o[0].start > n + 60 && (this.schedule[e].push({
255
- start: H(W(n)),
256
- end: H(W(n + 60))
257
- }), l = !0), !l)
258
- for (let r = 0; r < o.length - 1; r++) {
259
- const b = o[r].end;
260
- if (o[r + 1].start - b >= 60) {
261
- this.schedule[e].push({
262
- start: H(W(b)),
263
- end: H(W(b + 60))
264
- });
265
- break;
266
- }
267
- }
268
- }
269
- }
270
- this.schedule[e].sort((o, i) => j(o.start) - j(i.start)), this.schedule = { ...this.schedule };
271
- }
272
- removeTimeRange(e, t) {
273
- this.schedule[e].splice(t, 1), this.schedule = { ...this.schedule };
274
- }
275
- setTime(e, t, n) {
276
- const [s, o] = e.split("_"), [i, l] = s.split(":");
277
- o === "start" ? this.schedule[i][l].start = n : o === "end" && (this.schedule[i][l].end = n), this.internals.setValidity({ customError: !1 }), this.schedule = { ...this.schedule };
278
- }
279
- setFormError(e, t, n) {
280
- var l;
281
- const [s, o] = e.split("_"), i = (l = this.host.shadowRoot) == null ? void 0 : l.getElementById(e);
282
- i && this.internals.setValidity({ customError: !0 }, `Invalid ${o} time`, i);
283
- }
284
- updateSchedule(e) {
285
- const t = {
286
- SUN: [],
287
- MON: [],
288
- TUE: [],
289
- WED: [],
290
- THU: [],
291
- FRI: [],
292
- SAT: []
293
- };
294
- e.forEach((n) => {
295
- n.days.forEach((s) => {
296
- const o = this.getDayKey(s), i = H(n.start), l = H(n.end), r = { start: i, end: l };
297
- let b = !1;
298
- t[o] && (b = t[o].some((p) => p.start === r.start && p.end === r.end)), b || (t[o] ? t[o].push(r) : t[o] = [r]);
299
- });
300
- }), e.length === 0 && (this.timezone = e[0].timezone), this.timezone = e[0].timezone, this.schedule = t;
301
- }
302
- getDayKey(e) {
303
- return ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"][e];
304
- }
305
- scheduleToOpenHours(e, t = "UTC") {
306
- const n = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
307
- let s = /* @__PURE__ */ new Map();
308
- n.forEach((i, l) => {
309
- e[i] && e[i].forEach((r) => {
310
- const b = ve(r.start), p = ve(r.end), h = `${b}-${p}`;
311
- if (!s.has(h))
312
- s.set(h, { days: [l], start: b, end: p });
313
- else {
314
- let f = s.get(h);
315
- f && (f.days.push(l), s.set(h, f));
316
- }
317
- });
318
- });
319
- let o = [];
320
- return s.forEach((i, l) => {
321
- o.push({
322
- days: i.days,
323
- start: i.start,
324
- end: i.end,
325
- timezone: t
326
- });
327
- }), o;
328
- }
329
- render() {
330
- const e = Object.keys(xe).map((t) => ({
331
- label: xe[t],
332
- value: t
333
- }));
334
- return a(k, { key: "440dc2f314a9c47eb8186f4ed965ed3052301ddf" }, a("div", { key: "2d31ef10ae53275fc065f4e9f68c32f42b60d829", class: "nylas-availability-picker" }, a("div", { key: "aa6695b6054b81ece7ede5f5e089545a041800f6", class: "header", part: "nap__header" }, a("h3", { key: "86e0d18ca7b70d74159c5cead0d6f5a17a145fa7" }, "General availability"), a("p", { key: "05da67e03befbe936793af5ee98f801b512d28e7" }, "Set your availability for scheduling meetings.")), a("div", { key: "84c6bf714ccea4aff07d6e660d8ca3f96ce9a8cc", class: "content" }, a("div", { key: "16edf74e06bed5440df5f5ea73e90cfa83d08b29", class: "select-timezone", part: "nap__select-timezone" }, a("h4", { key: "1025677efcaf114cb86ce57324c299eeea79b37e", class: "sub-header" }, "Select timezone", a("span", { key: "6d65a6457da202c5a3d5c5cd4e185903a12cec7f", class: "icon" }, a("tooltip-component", { key: "61a40ea06c06f1d306a8b352d9ae883d09768249" }, a("info-icon", { key: "2d447cc2e6a619ee7b1cf1fd3e2b6424fcd6db5b", slot: "tooltip-icon" }), a("span", { key: "35742354ba0841bc1c17170094bab09d536208e6", slot: "tooltip-content" }, "Select your timezone for displaying availability.")))), a("select-dropdown", { key: "3532c95b077fc701cdbf89cd13668acc675cf0e4", name: "timezone", exportparts: "sd_dropdown: nap__timezone-container, sd_dropdown-button: nap__timezone-button, sd_dropdown-content: nap__timezone-dropdown-content", options: e, defaultSelectedOption: e.find((t) => t.value === this.defaultTimezone) }, a("span", { key: "c1e870c593966e29d72c3f519f3309f84e4b9a9a", slot: "select-icon" }, a("globe-icon", { key: "df23e31168778926b6118651cd636ab801f062f1", width: "20", height: "20" })))), a("div", { key: "5ad8cf7078dc104d1258f77e1c69bebf8c82d8dd", class: "availability", part: "nap__availability" }, Object.keys(this.schedule).map((t) => {
335
- const n = t, s = this.schedule[t];
336
- return a("div", { class: "availability-day" }, a("div", { class: "day", part: "nap__day" }, a("input", { type: "checkbox", name: n, id: n, checked: s.length > 0, onClick: () => {
337
- s.length > 0 ? this.schedule[n] = [] : this.schedule[n] = [{ start: "09:00am", end: "05:00pm" }], this.schedule = { ...this.schedule };
338
- } }), a("label", { htmlFor: n, "aria-label": "Select day" }, n)), a("div", { class: "time-ranges", part: "nap__time-ranges" }, s.length ? null : a("span", { class: "unavailable" }, "Unavailable"), s.length > 0 && s.map((o, i) => {
339
- var b, p;
340
- const l = `${t}:${i}_start`, r = `${t}:${i}_end`;
341
- return a("div", { class: "time-range", part: "nap__time-range" }, a("div", { class: "pickers" }, a("nylas-time-window-picker", { id: l, hasError: (b = this.overlapDays[n]) == null ? void 0 : b.includes(i), time: o.start, name: l, key: l, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times", setTime: (h, f) => this.setTime(l, h, f), setFormError: (h, f) => this.setFormError(l, h, f) }), a("span", null, " - "), a("nylas-time-window-picker", { id: r, hasError: (p = this.overlapDays[n]) == null ? void 0 : p.includes(i), time: o.end, name: r, key: r, minimumStartTime: o.start, exportparts: "time-picker: nap__time-picker-container, time-input: nap__time-picker-input, times: nap__time-picker-times", setTime: (h, f) => this.setTime(r, h, f), setFormError: (h, f) => this.setFormError(r, h, f) })), a("button", { onClick: () => this.removeTimeRange(n, i) }, a("close-icon", null)));
342
- }), a("p", { class: "error" }, this.overlapDays[n] ? "Overlapping time ranges" : "")), a("div", null, s.length > 0 ? a("button", { onClick: () => this.addTimeRange(n), part: "nap__add-time-range" }, a("add-circle-icon", null)) : null));
343
- })))));
344
- }
345
- static get formAssociated() {
346
- return !0;
347
- }
348
- get host() {
349
- return x(this);
350
- }
351
- static get watchers() {
352
- return {
353
- name: ["elementNameChangedHandler"],
354
- schedule: ["scheduleChanged"]
355
- };
356
- }
357
- };
358
- yt([
359
- _({
360
- name: "nylas-availability-picker",
361
- fireRegisterEvent: !0
362
- }),
363
- se("design:type", Function),
364
- se("design:paramtypes", []),
365
- se("design:returntype", void 0)
366
- ], Ce.prototype, "render", null);
367
- Ce.style = mt;
368
- const gt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-booking-calendar-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-booking-calendar-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-booking-calendar-picker .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-booking-calendar-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading{padding-bottom:1rem;display:flex;flex-direction:column;gap:4px}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading .label{display:flex;align-items:center;gap:0.5rem;margin:1rem 1rem 0;color:var(--nylas-base-800)}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading .loading-button{margin:0 1rem;padding:0;width:inherit;height:48px;color:black;font-size:1rem;cursor:not-allowed;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__loading .loading-button span{padding:0 1rem}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown{padding:1rem;display:flex;flex-direction:column;gap:4px}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown span.label{display:flex;align-items:center;gap:4px;color:var(--nylas-base-800)}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown span.label tooltip-component{display:flex}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown){width:100%}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown-content){width:100%;max-width:unset}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-booking-calendar-picker .nylas-booking-calendar-picker__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', vt = gt;
369
- var kt = function(e, t, n, s) {
370
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
371
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
372
- i = Reflect.decorate(e, t, n, s);
373
- else
374
- for (var r = e.length - 1; r >= 0; r--)
375
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
376
- return o > 3 && i && Object.defineProperty(t, n, i), i;
377
- }, oe = function(e, t) {
378
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
379
- return Reflect.metadata(e, t);
380
- };
381
- const Te = class {
382
- constructor(e) {
383
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.calendars = void 0, this.name = "calendar", this.defaultBookingCalendar = "", this.selectedCalendar = "";
384
- }
385
- connectedCallback() {
386
- d("nylas-booking-calendar-picker", "connectedCallback");
387
- }
388
- disconnectedCallback() {
389
- d("nylas-booking-calendar-picker", "disconnectedCallback");
390
- }
391
- componentWillLoad() {
392
- d("nylas-booking-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
393
- }
394
- componentDidLoad() {
395
- d("nylas-booking-calendar-picker", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultBookingCalendar.toString(), "booking-calendar"), this.selectedCalendar = this.defaultBookingCalendar;
396
- }
397
- componentWillUpdate() {
398
- d("nylas-booking-calendar-picker", "componentWillUpdate");
399
- }
400
- componentDidUpdate() {
401
- d("nylas-booking-calendar-picker", "componentDidUpdate");
402
- }
403
- componentWillRender() {
404
- d("nylas-booking-calendar-picker", "componentWillRender");
405
- }
406
- componentDidRender() {
407
- d("nylas-booking-calendar-picker", "componentDidRender");
408
- }
409
- elementNameChangedHandler(e) {
410
- d("nylas-booking-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
411
- }
412
- selectedOptionChangedHandler(e) {
413
- d("nylas-booking-calendar-picker", "selectedOptionChangedHandler", e.detail);
414
- const t = (n) => {
415
- const { value: s } = n.detail;
416
- this.selectedCalendar = s, this.internals.setFormValue(s.toString(), "booking-calendar");
417
- };
418
- this.valueChanged.emit({ ...e.detail, valueChanged: t });
419
- }
420
- render() {
421
- var t;
422
- const e = ((t = this.calendars) == null ? void 0 : t.map((n) => ({
423
- value: n.id,
424
- label: n.name
425
- }))) ?? [];
426
- return a(k, null, a("div", { class: "nylas-booking-calendar-picker", part: "nbcp" }, a("div", { class: "header", part: "nbcp__header" }, a("h3", null, "Calendar booking"), a("p", null, "Choose calendar where you’d like the event bookings to show up.")), e.length > 0 ? a("div", { class: "nylas-booking-calendar-picker__dropdown" }, a("span", { class: "label", part: "nbcp__input-label" }, "Select a calendar to book meetings on", a("tooltip-component", null, a("info-icon", { slot: "tooltip-icon" }), a("span", { slot: "tooltip-content" }, "Check availability across one or multiple calendars. If multiple calendars are selected, you must be available across all of them to be considered available."))), a("select-dropdown", { name: "booking-calendar", options: e, withSearch: !1, exportparts: "sd_dropdown: nbcp__dropdown, sd_dropdown-button: nbcp__dropdown-button, sd_dropdown-content: nbcp__dropdown-content", defaultSelectedOption: e.find((n) => n.value == this.defaultBookingCalendar) ?? e[0] })) : a("div", { class: "nylas-booking-calendar-picker__loading" }, a("span", { class: "label" }, "Select a calendar to book meetings on ", a("info-icon", null)), a("div", { class: "loading-button" }, a("span", null, "Loading...")))));
427
- }
428
- static get formAssociated() {
429
- return !0;
430
- }
431
- get host() {
432
- return x(this);
433
- }
434
- static get watchers() {
435
- return {
436
- name: ["elementNameChangedHandler"]
437
- };
438
- }
439
- };
440
- kt([
441
- _({
442
- name: "nylas-booking-calendar-picker",
443
- eventToProps: {
444
- valueChanged: async (e, t) => {
445
- const { valueChanged: n } = e.detail;
446
- n && n(e);
447
- }
448
- },
449
- fireRegisterEvent: !0
450
- }),
451
- oe("design:type", Function),
452
- oe("design:paramtypes", []),
453
- oe("design:returntype", void 0)
454
- ], Te.prototype, "render", null);
455
- Te.style = vt;
456
- const wt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-buffer-time{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200);text-align:left}.nylas-buffer-time .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-buffer-time .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-buffer-time .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-buffer-time .nylas-buffer-time__body{display:grid;grid-template-columns:1fr auto}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown{padding:1rem;display:flex;flex-direction:column;gap:1rem;border-right:1px solid var(--nylas-base-200)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown .nylas-buffer-time__row{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:1rem}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown .nylas-buffer-time__row label{width:200px}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__dropdown .nylas-buffer-time__row .dropdown-container{display:flex;gap:1rem;align-items:center}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview{width:200px;padding:1rem;background:var(--nylas-base-25);border-bottom-right-radius:var(--nylas-border-radius-2x)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview h4{font-size:12px;line-height:24px;color:var(--nylas-base-600);font-family:var(--nylas-font-family);font-weight:500;text-align:center}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .slot{background-color:transparent;border-top:1px solid var(--nylas-base-300)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .slot.active{background-color:var(--nylas-base-100)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .slot:last-of-type{border-bottom:1px solid var(--nylas-base-300)}.nylas-buffer-time .nylas-buffer-time__body .nylas-buffer-time__preview .preview-container .event-slot{background-color:var(--nylas-base-600);border-top:1px solid var(--nylas-base-300);border-bottom:1px solid var(--nylas-base-300)}.nylas-buffer-time .nylas-buffer-time__dropdown select-dropdown::part(sd_dropdown-button){width:104px;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-buffer-time .nylas-buffer-time__dropdown select-dropdown::part(sd_dropdown-content){width:100%}.nylas-buffer-time .nylas-buffer-time__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', xt = wt;
457
- var _t = function(e, t, n, s) {
458
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
459
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
460
- i = Reflect.decorate(e, t, n, s);
461
- else
462
- for (var r = e.length - 1; r >= 0; r--)
463
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
464
- return o > 3 && i && Object.defineProperty(t, n, i), i;
465
- }, le = function(e, t) {
466
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
467
- return Reflect.metadata(e, t);
468
- };
469
- const Oe = class {
470
- constructor(e) {
471
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "buffer-time", this.buffer = { before: 0, after: 0 }, this.selectedBeforeBufferTime = this.buffer.before, this.selectedAfterBufferTime = this.buffer.after;
472
- }
473
- connectedCallback() {
474
- d("nylas-buffer-time", "connectedCallback");
475
- }
476
- disconnectedCallback() {
477
- d("nylas-buffer-time", "disconnectedCallback");
478
- }
479
- componentWillLoad() {
480
- d("nylas-buffer-time", "componentWillLoad"), this.host.setAttribute("name", this.name);
481
- }
482
- componentDidLoad() {
483
- if (d("nylas-buffer-time", "componentDidLoad"), typeof this.internals.setFormValue == "function") {
484
- const e = {
485
- before: this.selectedBeforeBufferTime,
486
- after: this.selectedAfterBufferTime
487
- };
488
- this.internals.setFormValue(JSON.stringify(e), this.name);
489
- }
490
- this.selectedAfterBufferTime = this.buffer.after, this.selectedBeforeBufferTime = this.buffer.before;
491
- }
492
- componentWillUpdate() {
493
- d("nylas-buffer-time", "componentWillUpdate");
494
- }
495
- componentDidUpdate() {
496
- d("nylas-buffer-time", "componentDidUpdate");
497
- }
498
- componentWillRender() {
499
- d("nylas-buffer-time", "componentWillRender");
500
- }
501
- componentDidRender() {
502
- d("nylas-buffer-time", "componentDidRender");
503
- }
504
- elementNameChangedHandler(e) {
505
- d("nylas-buffer-time", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
506
- }
507
- selectedOptionChangedHandler(e) {
508
- d("nylas-buffer-time", "selectedOptionChangedHandler", e.detail);
509
- const t = (n) => {
510
- const { value: s, name: o } = n.detail;
511
- o === "before-buffer-time" ? this.selectedBeforeBufferTime = parseInt(s) : o === "after-buffer-time" && (this.selectedAfterBufferTime = parseInt(s));
512
- const i = {
513
- before: this.selectedBeforeBufferTime,
514
- after: this.selectedAfterBufferTime
515
- };
516
- this.internals.setFormValue(JSON.stringify(i), "booking-calendar");
517
- };
518
- this.valueChanged.emit({ ...e.detail, valueChanged: t });
519
- }
520
- renderPreview() {
521
- const s = (l) => {
522
- const r = Math.floor(l / 30), b = l % 30 / 30 * 20;
523
- return {
524
- fullSlots: r,
525
- partialFillHeight: b
526
- };
527
- }, o = () => {
528
- const { fullSlots: l, partialFillHeight: r } = s(this.selectedBeforeBufferTime);
529
- return Array.from({ length: 4 }, (b, p) => {
530
- const h = this.selectedBeforeBufferTime > 0 && p > 4 - l - 1, f = this.selectedBeforeBufferTime > 0 && p === 4 - l - 1 && r > 0;
531
- let v = {};
532
- return h && !f ? v.backgroundColor = "var(--nylas-base-100)" : f && (v.background = `linear-gradient(to top, var(--nylas-base-100) ${r}px, transparent 0)`), a("div", { key: p, class: `slot ${h ? "active" : ""}`, style: {
533
- height: "20px",
534
- ...v
535
- } });
536
- });
537
- }, i = () => {
538
- const { fullSlots: l, partialFillHeight: r } = s(this.selectedAfterBufferTime);
539
- return Array.from({ length: 4 }, (b, p) => {
540
- const h = this.selectedAfterBufferTime > 0 && p < l, f = p === l && r > 0;
541
- let v = {};
542
- return h && !f ? v.backgroundColor = "var(--nylas-base-100)" : f && (v.background = `linear-gradient(to bottom, var(--nylas-base-100) ${r}px, transparent 0)`), a("div", { key: p, class: `slot ${h ? "active" : ""}`, style: {
543
- height: "20px",
544
- ...v
545
- } });
546
- });
547
- };
548
- return a("div", { class: "preview-container" }, o(), a("div", { class: "event-slot", style: { height: "40px" } }), i());
549
- }
550
- render() {
551
- const e = Array.from({ length: 121 }, (t, n) => ({
552
- label: n.toString(),
553
- value: n
554
- }));
555
- return a(k, null, a("div", { class: "nylas-buffer-time", part: "nbt" }, a("div", { class: "header", part: "nbt__header" }, a("h3", null, "Buffer time"), a("p", null, "Add buffer time before and after the event.")), a("div", { class: "nylas-buffer-time__body", part: "nbt__body" }, a("div", { class: "nylas-buffer-time__dropdown" }, a("div", { class: "nylas-buffer-time__row" }, a("label", null, "Before the event"), a("div", { class: "dropdown-container" }, a("select-dropdown", { id: "before-buffer-time", name: "before-buffer-time", exportparts: "sd_dropdown: nbt__dropdown-before, sd_dropdown-button: nbt__dropdown-button-before, sd_dropdown-content: nbt__dropdown-content-before", options: e, defaultSelectedOption: e.find((t) => t.value == this.selectedBeforeBufferTime) ?? e[0] }), a("span", null, "mins"))), a("div", { class: "nylas-buffer-time__row" }, a("label", null, "After the event"), a("div", { class: "dropdown-container" }, a("select-dropdown", { id: "after-buffer-time", name: "after-buffer-time", exportparts: "sd_dropdown: nbt__dropdown-after, sd_dropdown-button: nbt__dropdown-button-after, sd_dropdown-content: nbt__dropdown-content-after", options: e, defaultSelectedOption: e.find((t) => t.value == this.selectedAfterBufferTime) ?? e[0] }), a("span", null, "mins")))), a("div", { class: "nylas-buffer-time__preview", part: "nbt__preview" }, a("h4", null, "PREVIEW"), this.renderPreview()))));
556
- }
557
- static get formAssociated() {
558
- return !0;
559
- }
560
- get host() {
561
- return x(this);
562
- }
563
- static get watchers() {
564
- return {
565
- name: ["elementNameChangedHandler"]
566
- };
567
- }
568
- };
569
- _t([
570
- _({
571
- name: "nylas-buffer-time",
572
- eventToProps: {
573
- valueChanged: async (e, t) => {
574
- const { valueChanged: n } = e.detail;
575
- n && n(e);
576
- }
577
- },
578
- fireRegisterEvent: !0
579
- }),
580
- le("design:type", Function),
581
- le("design:paramtypes", []),
582
- le("design:returntype", void 0)
583
- ], Oe.prototype, "render", null);
584
- Oe.style = xt;
585
- const Ct = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-calendar-picker{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-calendar-picker .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-calendar-picker .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-calendar-picker .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-calendar-picker .nylas-calendar-picker__loading{padding-bottom:1rem;display:flex;flex-direction:column;gap:4px}.nylas-calendar-picker .nylas-calendar-picker__loading .label{display:flex;align-items:center;gap:0.5rem;margin:1rem 1rem 0;color:var(--nylas-base-800)}.nylas-calendar-picker .nylas-calendar-picker__loading .label tooltip-component{display:flex}.nylas-calendar-picker .nylas-calendar-picker__loading .loading-button{margin:0 1rem;padding:0;width:inherit;height:48px;color:black;font-size:1rem;cursor:not-allowed;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-calendar-picker .nylas-calendar-picker__loading .loading-button span{padding:0 1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown{padding:1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown){width:100%;display:flex;flex-direction:column;gap:4px}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown-content){width:100%;max-width:unset}.nylas-calendar-picker .nylas-calendar-picker__dropdown multi-select-dropdown::part(msd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Tt = Ct;
586
- var Ot = function(e, t, n, s) {
587
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
588
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
589
- i = Reflect.decorate(e, t, n, s);
590
- else
591
- for (var r = e.length - 1; r >= 0; r--)
592
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
593
- return o > 3 && i && Object.defineProperty(t, n, i), i;
594
- }, re = function(e, t) {
595
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
596
- return Reflect.metadata(e, t);
597
- };
598
- const De = class {
599
- constructor(e) {
600
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.calendars = void 0, this.organizerEmail = void 0, this.name = "calendar", this.defaultSelectedCalendars = [], this.selectedCalendars = [];
601
- }
602
- connectedCallback() {
603
- d("nylas-calendar-picker", "connectedCallback");
604
- }
605
- disconnectedCallback() {
606
- d("nylas-calendar-picker", "disconnectedCallback");
607
- }
608
- componentWillLoad() {
609
- d("nylas-calendar-picker", "componentWillLoad"), this.host.setAttribute("name", this.name);
610
- }
611
- componentDidLoad() {
612
- d("nylas-calendar-picker", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.defaultSelectedCalendars.toString(), "calendar");
613
- }
614
- componentWillUpdate() {
615
- d("nylas-calendar-picker", "componentWillUpdate");
616
- }
617
- componentDidUpdate() {
618
- d("nylas-calendar-picker", "componentDidUpdate");
619
- }
620
- componentWillRender() {
621
- d("nylas-calendar-picker", "componentWillRender");
622
- }
623
- componentDidRender() {
624
- d("nylas-calendar-picker", "componentDidRender");
625
- }
626
- elementNameChangedHandler(e) {
627
- d("nylas-calendar-picker", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
628
- }
629
- selectedOptionsChangedHandler(e) {
630
- d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
631
- const t = (n) => {
632
- const { value: s } = n.detail;
633
- this.selectedCalendars = [...s], this.internals.setFormValue(s.toString(), "calendar");
634
- };
635
- this.valueChanged.emit({ ...e.detail, name: this.name, valueChangedHandler: t });
636
- }
637
- render() {
638
- var t;
639
- const e = ((t = this.calendars) == null ? void 0 : t.map((n) => {
640
- var s, o;
641
- return {
642
- value: n.id,
643
- label: n.name,
644
- selected: ((s = this.defaultSelectedCalendars) == null ? void 0 : s.includes(n.id)) || ((o = this.defaultSelectedCalendars) == null ? void 0 : o.includes("primary")) && n.id === this.organizerEmail
645
- };
646
- })) ?? [];
647
- return a(k, null, a("div", { class: "nylas-calendar-picker", part: "ncp" }, a("div", { class: "header", part: "ncp__header" }, a("h3", null, "Calendar availability"), a("p", null, "Select calendars that you’d like to use for checking your availability.")), e.length > 0 ? a("div", { class: "nylas-calendar-picker__dropdown" }, a("multi-select-dropdown", { name: "calendar", label: "Select calendars that will be checked for availability", options: e, exportparts: "msd__dropdown: ncp__dropdown, msd__dropdown-button: ncp__dropdown-button, msd__dropdown-content: ncp__dropdown-content" }, a("span", { slot: "label-icon" }, a("tooltip-component", null, a("info-icon", { slot: "tooltip-icon" }), a("span", { slot: "tooltip-content" }, "Check availability across one or multiple calendars. If multiple calendars are selected, you must be available across all of them to be considered available. The default is your primary calendar if none are selected."))))) : a("div", { class: "nylas-calendar-picker__loading" }, a("span", { class: "label" }, "Select calendars that will be checked for availability ", a("info-icon", null)), a("div", { class: "loading-button" }, a("span", null, "Loading...")))));
648
- }
649
- static get formAssociated() {
650
- return !0;
651
- }
652
- get host() {
653
- return x(this);
654
- }
655
- static get watchers() {
656
- return {
657
- name: ["elementNameChangedHandler"]
658
- };
659
- }
660
- };
661
- Ot([
662
- _({
663
- name: "nylas-calendar-picker",
664
- eventToProps: {
665
- valueChanged: async (e, t) => {
666
- const { valueChangedHandler: n } = e.detail;
667
- n && n(e);
668
- }
669
- },
670
- fireRegisterEvent: !0
671
- }),
672
- re("design:type", Function),
673
- re("design:paramtypes", []),
674
- re("design:returntype", void 0)
675
- ], De.prototype, "render", null);
676
- De.style = Tt;
677
- const Dt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif;width:inherit}.nylas-custom-booking-flow{width:inherit;display:flex;flex-direction:column;margin:1rem;border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200)}.nylas-custom-booking-flow .header{padding:1rem;border-bottom:1px solid var(--nylas-base-200)}.nylas-custom-booking-flow .header h3{margin:0;font-size:1rem;font-weight:600;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-custom-booking-flow .header p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-custom-booking-flow .nylas-custom-booking-flow__loading{padding-bottom:1rem}.nylas-custom-booking-flow .nylas-custom-booking-flow__loading .label{display:flex;align-items:center;gap:0.5rem;margin:1rem 1rem 0;color:var(--nylas-base-800)}.nylas-custom-booking-flow .nylas-custom-booking-flow__loading .loading-button{margin:0 1rem;padding:0;width:inherit;height:48px;color:black;font-size:1rem;cursor:not-allowed;display:flex;gap:0.5rem;justify-content:space-between;align-items:center;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}.nylas-custom-booking-flow .nylas-custom-booking-flow__loading .loading-button span{padding:0 1rem}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown{padding:1rem}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown span.label{display:flex;align-items:center;gap:4px;color:var(--nylas-base-800)}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown span.label tooltip-component{display:flex}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown select-dropdown::part(sd_dropdown){width:100%}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown select-dropdown::part(sd_dropdown-content){width:100%;max-width:unset}.nylas-custom-booking-flow .nylas-custom-booking-flow__dropdown select-dropdown::part(sd_dropdown-button-selected-label){max-width:calc(100% - 2rem);font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', It = Dt;
678
- var Et = function(e, t, n, s) {
679
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
680
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
681
- i = Reflect.decorate(e, t, n, s);
682
- else
683
- for (var r = e.length - 1; r >= 0; r--)
684
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
685
- return o > 3 && i && Object.defineProperty(t, n, i), i;
686
- }, de = function(e, t) {
687
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
688
- return Reflect.metadata(e, t);
689
- };
690
- const Ie = class {
691
- constructor(e) {
692
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "booking-type", this.bookingType = "", this.selectedBookingType = "";
693
- }
694
- connectedCallback() {
695
- d("nylas-custom-booking-flow", "connectedCallback");
696
- }
697
- disconnectedCallback() {
698
- d("nylas-custom-booking-flow", "disconnectedCallback");
699
- }
700
- componentWillLoad() {
701
- d("nylas-custom-booking-flow", "componentWillLoad"), this.host.setAttribute("name", this.name);
702
- }
703
- componentDidLoad() {
704
- d("nylas-custom-booking-flow", "componentDidLoad"), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(this.bookingType.toString(), "booking-calendar"), this.selectedBookingType = this.bookingType;
705
- }
706
- componentWillUpdate() {
707
- d("nylas-custom-booking-flow", "componentWillUpdate");
708
- }
709
- componentDidUpdate() {
710
- d("nylas-custom-booking-flow", "componentDidUpdate");
711
- }
712
- componentWillRender() {
713
- d("nylas-custom-booking-flow", "componentWillRender");
714
- }
715
- componentDidRender() {
716
- d("nylas-custom-booking-flow", "componentDidRender");
717
- }
718
- elementNameChangedHandler(e) {
719
- d("nylas-custom-booking-flow", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
720
- }
721
- selectedOptionChangedHandler(e) {
722
- d("nylas-custom-booking-flow", "selectedOptionChangedHandler", e.detail);
723
- const t = (n) => {
724
- const { value: s } = n.detail;
725
- this.selectedBookingType = s, this.internals.setFormValue(s.toString(), "booking-calendar");
726
- };
727
- this.valueChanged.emit({ ...e.detail, valueChanged: t });
728
- }
729
- render() {
730
- const e = [
731
- {
732
- label: "Automatically accept bookings",
733
- value: "booking"
734
- },
735
- {
736
- label: "Manually confirm/decline bookings",
737
- value: "pre-booking"
738
- }
739
- ];
740
- return a(k, { key: "a4f8162f7964925b34c256d88fa8cd3f0e684e7e" }, a("div", { key: "3b5c6077ad57d232f9c25c17b117b4ad31cf3cfa", class: "nylas-custom-booking-flow", part: "ncbf" }, a("div", { key: "4ecafa38be03812b2b6188d4858018d5cd94be8e", class: "header", part: "ncbf__header" }, a("h3", { key: "d0eccafc6133ff24de9fbab11737e08862aad835" }, "Customize booking flow"), a("p", { key: "0e75183824a878b6df83f92467aba58072d2ac6f" }, "Customize how new bookings are handled when a booking is completed.")), e.length > 0 ? a("div", { class: "nylas-custom-booking-flow__dropdown" }, a("span", { class: "label" }, "After a booking is confirmed", a("tooltip-component", null, a("info-icon", { slot: "tooltip-icon" }), a("span", { slot: "tooltip-content" }, "Choose how you’d like to handle new bookings. If you choose to manually confirm/decline bookings, you will be able to review and accept or decline each booking request."))), a("select-dropdown", { name: "booking-type", options: e, withSearch: !1, exportparts: "sd_dropdown: ncbf__dropdown, sd_dropdown-button: ncbf__dropdown-button, sd_dropdown-content: ncbf__dropdown-content", defaultSelectedOption: e.find((t) => t.value == this.bookingType) ?? e[0] })) : a("div", { class: "nylas-custom-booking-flow__loading" }, a("span", { class: "label" }, "Select a calendar to book meetings on ", a("info-icon", null)), a("div", { class: "loading-button" }, a("span", null, "Loading...")))));
741
- }
742
- static get formAssociated() {
743
- return !0;
744
- }
745
- get host() {
746
- return x(this);
747
- }
748
- static get watchers() {
749
- return {
750
- name: ["elementNameChangedHandler"]
751
- };
752
- }
753
- };
754
- Et([
755
- _({
756
- name: "nylas-custom-booking-flow",
757
- eventToProps: {
758
- valueChanged: async (e, t) => {
759
- const { valueChanged: n } = e.detail;
760
- n && n(e);
761
- }
762
- },
763
- fireRegisterEvent: !0
764
- }),
765
- de("design:type", Function),
766
- de("design:paramtypes", []),
767
- de("design:returntype", void 0)
768
- ], Ie.prototype, "render", null);
769
- Ie.style = It;
770
- const St = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-description{display:flex;flex-direction:column;gap:4px}.nylas-event-description label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-description label span.label-icon{margin-left:4px}.nylas-event-description label span.label-icon tooltip-component{display:flex}.nylas-event-description textarea{padding:12px 16px;border-width:1;resize:vertical;border-radius:8px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px;border:1px solid var(--nylas-base-200)}.nylas-event-description textarea::-webkit-resizer{display:none}', $t = St;
771
- var Lt = function(e, t, n, s) {
772
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
773
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
774
- i = Reflect.decorate(e, t, n, s);
775
- else
776
- for (var r = e.length - 1; r >= 0; r--)
777
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
778
- return o > 3 && i && Object.defineProperty(t, n, i), i;
779
- }, ce = function(e, t) {
780
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
781
- return Reflect.metadata(e, t);
782
- };
783
- const Ee = class {
784
- constructor(e) {
785
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.eventDescription = void 0, this.description = this.eventDescription ?? "", this.name = "description";
786
- }
787
- elementNameChangedHandler(e) {
788
- d("nylas-event-description", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
789
- }
790
- connectedCallback() {
791
- d("nylas-event-description", "connectedCallback");
792
- }
793
- componentWillLoad() {
794
- d("nylas-event-description", "componentWillLoad"), this.host.setAttribute("name", this.name);
795
- }
796
- componentDidLoad() {
797
- d("nylas-event-description", "componentDidLoad");
798
- }
799
- disconnectedCallback() {
800
- d("nylas-event-description", "disconnectedCallback");
801
- }
802
- handleChange(e) {
803
- this.description = e.target.value, this.internals.setFormValue(e.target.value, "description"), this.valueChanged.emit({ value: e.target.value, name: this.name });
804
- }
805
- render() {
806
- return a(k, { key: "5519bbdfdc7e253bf5b83c18decd714e54f58714" }, a("div", { key: "36541738e7d447cb6f9b3bf0f931c851efb0d8fe", class: "nylas-event-description", part: "nedesc" }, a("label", { key: "c0eb70c7e36360844559e0fd0a451243fb6f5860", htmlFor: "description" }, "Event description", a("span", { key: "98c176eaa09ccdac28fbba62f67ceeb8a6fed751", class: "label-icon" }, a("tooltip-component", { key: "553ca988451d6053a8863a52cbcdcb12dd041362" }, a("info-icon", { key: "015507616ffc54352cbecc9766e59d0db4a25367", slot: "tooltip-icon" }), a("span", { key: "86efa5b15ae112f6f974ba32e8c138e2c906184f", slot: "tooltip-content" }, "Provide any additional details for your event.")))), a("textarea", { key: "619f982afa3f2af2794d93cc0df930db618a3e5e", id: "description", part: "nedesc__textarea", name: "description", value: this.description, maxlength: "8192", onInput: (e) => this.handleChange(e) })));
807
- }
808
- static get formAssociated() {
809
- return !0;
810
- }
811
- get host() {
812
- return x(this);
813
- }
814
- static get watchers() {
815
- return {
816
- name: ["elementNameChangedHandler"]
817
- };
818
- }
819
- };
820
- Lt([
821
- _({
822
- name: "nylas-event-description",
823
- eventToProps: {},
824
- fireRegisterEvent: !0
825
- }),
826
- ce("design:type", Function),
827
- ce("design:paramtypes", []),
828
- ce("design:returntype", void 0)
829
- ], Ee.prototype, "render", null);
830
- Ee.style = $t;
831
- const At = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-duration{display:flex;flex-direction:column;gap:4px}.nylas-event-duration label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-duration label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-duration label span.label-icon{margin-left:4px}.nylas-event-duration label span.label-icon tooltip-component{display:flex}.nylas-event-duration__wrapper{display:flex;align-items:center;gap:0.5rem}.nylas-event-duration__wrapper input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200);font-family:var(--nylas-font-family);font-size:16px;line-height:24px;width:48px}.nylas-event-duration__wrapper select-dropdown::part(sd_dropdown-button){border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px}.nylas-event-duration__wrapper select-dropdown::part(sd_dropdown-button-selected-label){font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', Ft = At;
832
- var Ht = function(e, t, n, s) {
833
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
834
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
835
- i = Reflect.decorate(e, t, n, s);
836
- else
837
- for (var r = e.length - 1; r >= 0; r--)
838
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
839
- return o > 3 && i && Object.defineProperty(t, n, i), i;
840
- }, pe = function(e, t) {
841
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
842
- return Reflect.metadata(e, t);
843
- };
844
- const Se = class {
845
- constructor(e) {
846
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.name = "duration", this.eventDurationMinutes = void 0, this.duration = this.eventDurationMinutes ? this.eventDurationMinutes >= 60 ? this.eventDurationMinutes / 60 : this.eventDurationMinutes : 5, this.durationMinutes = this.eventDurationMinutes ?? 5, this.durationIncrement = this.eventDurationMinutes && this.eventDurationMinutes >= 60 ? 60 : 1;
847
- }
848
- elementNameChangedHandler(e) {
849
- d("nylas-event-duration", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
850
- }
851
- durationMinutesChangedHandler(e, t) {
852
- d("nylas-event-duration", "durationMinutesChangedHandler", e), e !== t && this.valueChanged.emit({ value: e.toString(), name: this.name });
853
- }
854
- connectedCallback() {
855
- d("nylas-event-duration", "connectedCallback");
856
- }
857
- componentWillLoad() {
858
- d("nylas-event-duration", "componentWillLoad"), this.host.setAttribute("name", this.name);
859
- }
860
- componentDidLoad() {
861
- d("nylas-event-duration", "componentDidLoad"), this.internals.setFormValue(this.durationMinutes.toString(), "duration");
862
- }
863
- disconnectedCallback() {
864
- d("nylas-event-duration", "disconnectedCallback");
865
- }
866
- handleChange(e) {
867
- this.duration = e.target.value, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), this.name);
868
- }
869
- handleBlur() {
870
- (this.duration === null || this.duration === void 0) && this.durationIncrement === 1 && (this.duration = 5), (this.duration <= 0 || this.duration === null || this.duration === void 0) && this.durationIncrement === 60 && (this.duration = 1), this.duration < 5 && this.durationIncrement === 1 && (this.duration = 5), this.duration > 720 && this.durationIncrement === 1 && (this.duration = 720), this.duration > 12 && this.durationIncrement === 60 && (this.duration = 12), this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
871
- }
872
- selectedOptionChangedHandler(e) {
873
- d("nylas-calendar-picker", "selectedOptionChangedHandler", e.detail);
874
- const { value: t } = e.detail;
875
- this.durationIncrement = parseInt(t), this.durationIncrement === 1 ? this.duration = 5 : this.duration = 1, this.durationMinutes = this.duration * this.durationIncrement, this.internals.setFormValue(this.durationMinutes.toString(), "duration");
876
- }
877
- render() {
878
- const e = [
879
- { value: 1, label: "minutes" },
880
- { value: 60, label: "hours" }
881
- ];
882
- return a(k, { key: "b4c54d309345b6333578f1f8f49fbe9be7e50af7" }, a("div", { key: "401311ed8b0deb33eeb1013264f192ba87b0d118", class: "nylas-event-duration", part: "ned" }, a("label", { key: "5de11caa4aff28ca3fb11811e21adecfed22d32d", htmlFor: "duration" }, "Event duration", a("span", { key: "592731edca9c0c4ca63250e1fc3d964e4c7b271d", class: "required" }, "*"), a("span", { key: "b9f6a70dc84222e68d2251f485bbd3545d05fcde", class: "label-icon" }, a("tooltip-component", { key: "8fa85c6907a3625c1f50750b962014e7d413ea34" }, a("info-icon", { key: "677374d62adb9c9e27307b64bd69a979a28f32eb", slot: "tooltip-icon" }), a("span", { key: "d2ebc474b7876c3e23e31a296c826557b329be61", slot: "tooltip-content" }, "Set the duration of your event.")))), a("div", { key: "1240a158b86d06ed9e3859487e8688fc2cfea9e5", class: "nylas-event-duration__wrapper" }, a("input", { key: "fffb610158d4b056761f41e9b2ffd0e0aa5b1bfd", type: "number", part: "ned_input", id: "duration", name: "duration", value: this.duration, onBlur: () => this.handleBlur(), onInput: (t) => this.handleChange(t), min: 5 }), a("select-dropdown", { key: "8cf3f16c86c0220f992f69e4cfa012c170145b9e", name: "event-duration", options: e, exportparts: "sd__dropdown: ned__dropdown, sd__dropdown-button: ned__dropdown-button, sd__dropdown-content: ned__dropdown-content", defaultSelectedOption: e.find((t) => t.value == this.durationIncrement) ?? e[0], withSearch: !1 }))));
883
- }
884
- static get formAssociated() {
885
- return !0;
886
- }
887
- get host() {
888
- return x(this);
889
- }
890
- static get watchers() {
891
- return {
892
- name: ["elementNameChangedHandler"],
893
- durationMinutes: ["durationMinutesChangedHandler"]
894
- };
895
- }
896
- };
897
- Ht([
898
- _({
899
- name: "nylas-event-duration",
900
- eventToProps: {},
901
- fireRegisterEvent: !0
902
- }),
903
- pe("design:type", Function),
904
- pe("design:paramtypes", []),
905
- pe("design:returntype", void 0)
906
- ], Se.prototype, "render", null);
907
- Se.style = Ft;
908
- const Mt = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-info__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-event-info__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-event-info__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-event-info__block{display:flex;justify-content:space-between;gap:0.5rem}', Nt = Mt;
909
- var Rt = function(e, t, n, s) {
910
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
911
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
912
- i = Reflect.decorate(e, t, n, s);
913
- else
914
- for (var r = e.length - 1; r >= 0; r--)
915
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
916
- return o > 3 && i && Object.defineProperty(t, n, i), i;
917
- }, fe = function(e, t) {
918
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
919
- return Reflect.metadata(e, t);
920
- };
921
- const $e = class {
922
- constructor(e) {
923
- y(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
924
- }
925
- connectedCallback() {
926
- d("nylas-event-info", "connectedCallback");
927
- }
928
- componentWillLoad() {
929
- d("nylas-event-info", "componentWillLoad");
930
- }
931
- componentDidLoad() {
932
- d("nylas-event-info", "componentDidLoad");
933
- }
934
- disconnectedCallback() {
935
- d("nylas-event-info", "disconnectedCallback");
936
- }
937
- render() {
938
- return a(k, { key: "c558409607a64f0b043b5d4877d52a9bbcc8e451" }, a("nylas-form-card", { key: "9ac2943ec1364a07a7597115a516a301b645f105" }, a("h1", { key: "49647e71b13b778ef37ae197aff7b8885520d0d9", slot: "header-title", class: "nylas-event-info__title" }, "Event information"), a("h3", { key: "a4378d75f03a8b4ab6902d8f8ef4870b9377e367", slot: "header-subtitle", class: "nylas-event-info__subtitle" }, "Enter all event information."), a("div", { key: "3fcfd8cde128d1afaa038f801ee0be0a74068cac", slot: "content", class: "nylas-event-info__content" }, a("slot", { key: "e4e986148a526fa0ec2bc89f451403031f8d2c51", name: "inputs" }))));
939
- }
940
- static get formAssociated() {
941
- return !0;
942
- }
943
- };
944
- Rt([
945
- _({
946
- name: "nylas-event-info",
947
- eventToProps: {},
948
- fireRegisterEvent: !0
949
- }),
950
- fe("design:type", Function),
951
- fe("design:paramtypes", []),
952
- fe("design:returntype", void 0)
953
- ], $e.prototype, "render", null);
954
- $e.style = Nt;
955
- const zt = ':host{display:block;margin:1rem;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-limits__title{color:var(--nylas-base-900);font-size:16px;font-style:normal;font-weight:600;line-height:20px;margin:0;text-align:left}.nylas-event-limits__subtitle{color:var(--nylas-base-600);font-size:14px;font-style:normal;font-weight:400;line-height:20px;margin:0.25rem 0px 0px;text-align:left}.nylas-event-limits__content{padding:1rem;display:flex;flex-direction:column;gap:1rem}.nylas-event-limits__block{display:flex;justify-content:space-between;gap:0.5rem}', Pt = zt;
956
- var Bt = function(e, t, n, s) {
957
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
958
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
959
- i = Reflect.decorate(e, t, n, s);
960
- else
961
- for (var r = e.length - 1; r >= 0; r--)
962
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
963
- return o > 3 && i && Object.defineProperty(t, n, i), i;
964
- }, be = function(e, t) {
965
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
966
- return Reflect.metadata(e, t);
967
- };
968
- const Le = class {
969
- constructor(e) {
970
- y(this, e), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals);
971
- }
972
- connectedCallback() {
973
- d("nylas-event-limits", "connectedCallback");
974
- }
975
- componentWillLoad() {
976
- d("nylas-event-limits", "componentWillLoad");
977
- }
978
- componentDidLoad() {
979
- d("nylas-event-limits", "componentDidLoad");
980
- }
981
- disconnectedCallback() {
982
- d("nylas-event-limits", "disconnectedCallback");
983
- }
984
- render() {
985
- return a(k, { key: "41a6e89d00846f05f1540b0f1f3b6b8e1ee4e179" }, a("nylas-form-card", { key: "b68ba99fa9cbb92fba4133b327ce8f4e11ea7d55" }, a("h1", { key: "36fac220420d7bc3ae15a10ce1da95fc2a7ea1d0", slot: "header-title", class: "nylas-event-limits__title" }, "Set event limits"), a("h3", { key: "bd316f146a23e1e95bd4e691d1ee888ba779b927", slot: "header-subtitle", class: "nylas-event-limits__subtitle" }, "Customize event limits for the event."), a("div", { key: "8eb05024799a6b9dfbbbe4d42ced5ee9e8ded026", slot: "content", class: "nylas-event-limits__content" }, a("slot", { key: "e8554afe460136b431349042c70946dc2eadf93e", name: "inputs" }))));
986
- }
987
- static get formAssociated() {
988
- return !0;
989
- }
990
- };
991
- Bt([
992
- _({
993
- name: "nylas-event-limits",
994
- eventToProps: {},
995
- fireRegisterEvent: !0
996
- }),
997
- be("design:type", Function),
998
- be("design:paramtypes", []),
999
- be("design:returntype", void 0)
1000
- ], Le.prototype, "render", null);
1001
- Le.style = Pt;
1002
- const jt = ':host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-title{display:flex;flex-direction:column;gap:4px;position:relative;text-align:left}.nylas-event-title div.title{padding:12px 16px;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);overflow:scroll;white-space:nowrap;scrollbar-width:thin}.nylas-event-title div.title::-webkit-scrollbar{width:6px;height:6px}.nylas-event-title input{padding:12px 16px;border-width:1;border-radius:8px;border:1px solid var(--nylas-base-200)}.nylas-event-title span.help-text{color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:21px}.nylas-event-title label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-title label span.required{color:var(--nylas-error, #cc4841)}.nylas-event-title label span.label-icon{margin-left:4px}.nylas-event-title label span.label-icon tooltip-component{display:flex}.highlighted-tag{background-color:var(--nylas-base-200);border-radius:var(--nylas-border-radius);padding:5px;margin-left:4px}.token-options{display:block;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;z-index:1;border-radius:4px;position:absolute;top:80px;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}@media screen and (max-width: 768px){.token-options{right:0;width:325px;max-width:unset}}.token-options ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px;margin:0}.token-options ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left;cursor:pointer}.token-options ul li .token-label{display:flex;flex-direction:column;font-weight:400}.token-options ul li .token-label .token{color:var(--nylas-abse-900);font-size:16px;line-height:24px}.token-options ul li .token-label .description{color:var(--nylas-base-600);font-size:14px;line-height:21px}.token-options ul li:hover,.token-options ul li:focus,.token-options ul li:active,.token-options ul li.active{background-color:var(--nylas-base-100)}.token-options ul li:hover .token-label .token,.token-options ul li:focus .token-label .token,.token-options ul li:active .token-label .token,.token-options ul li.active .token-label .token{color:var(--nylas-primary)}.token-options .selected{background-color:var(--nylas-base-100)}', Wt = jt;
1003
- var Vt = function(e, t, n, s) {
1004
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
1005
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1006
- i = Reflect.decorate(e, t, n, s);
1007
- else
1008
- for (var r = e.length - 1; r >= 0; r--)
1009
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
1010
- return o > 3 && i && Object.defineProperty(t, n, i), i;
1011
- }, ue = function(e, t) {
1012
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1013
- return Reflect.metadata(e, t);
1014
- };
1015
- const Ae = class {
1016
- constructor(e) {
1017
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.eventTitle = void 0, this.name = "title", this.showTokens = !1, this.availableTokens = _e.map((t) => ({
1018
- label: t.token,
1019
- value: t.value,
1020
- labelHTML: t
1021
- })), this.filteredTokens = this.availableTokens, this.ariaActivedescendant = "", this.currentWord = { $value: "", fullText: "", index: -1, focusOffset: -1 };
1022
- }
1023
- elementNameChangedHandler(e) {
1024
- d("nylas-event-title", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1025
- }
1026
- ariaActivedescendantChangedHandler(e) {
1027
- var t, n;
1028
- if (d("nylas-event-title", "ariaActivedescendantChangedHandler", e), e !== "") {
1029
- const s = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(e);
1030
- s == null || s.classList.add("active");
1031
- } else {
1032
- const s = (n = this.host.shadowRoot) == null ? void 0 : n.querySelectorAll(".token-options li.active");
1033
- s == null || s.forEach((o) => o.classList.remove("active"));
1034
- }
1035
- }
1036
- connectedCallback() {
1037
- d("nylas-event-title", "connectedCallback");
1038
- }
1039
- componentWillLoad() {
1040
- d("nylas-event-title", "componentWillLoad"), this.host.setAttribute("name", this.name);
1041
- }
1042
- componentDidLoad() {
1043
- d("nylas-event-title", "componentDidLoad"), this.updateEventTitleFromProp(this.eventTitle || "");
1044
- }
1045
- disconnectedCallback() {
1046
- d("nylas-event-title", "disconnectedCallback");
1047
- }
1048
- updateEventTitleFromProp(e) {
1049
- d("nylas-event-title", "eventTitleChangedHandler", e), this.titleRef.innerHTML = this.highlightTokens(), this.titleRef.focus();
1050
- }
1051
- highlightTokens() {
1052
- let e = this.eventTitle || "";
1053
- return _e.forEach((t) => {
1054
- const n = t.value, s = new RegExp(`(\\${n})(?!\\w)`, "g");
1055
- e = e.replace(s, '<span class="highlighted-tag">$1</span>');
1056
- }), e;
1057
- }
1058
- getCurrentSelectionForBrowser() {
1059
- var n, s, o;
1060
- const e = (i, l, r) => {
1061
- const b = i.replace(/[\u200B-\u200D\uFEFF]/g, ""), p = b.lastIndexOf("$"), h = b.substring(p).split(" ")[0];
1062
- return {
1063
- focusOffset: l,
1064
- dollarIndex: p,
1065
- lastWord: h,
1066
- currentText: b,
1067
- node: r
1068
- };
1069
- }, t = Ve();
1070
- switch (console.log("currentBrowser", t), t) {
1071
- case "Chrome":
1072
- const i = (n = this.host.shadowRoot) == null ? void 0 : n.getSelection(), l = i == null ? void 0 : i.focusNode, r = (l == null ? void 0 : l.nodeValue) || "";
1073
- return e(r, (i == null ? void 0 : i.focusOffset) || -1, l);
1074
- case "Firefox":
1075
- const b = document.getSelection(), p = ((s = b == null ? void 0 : b.anchorNode) == null ? void 0 : s.nodeValue) || "";
1076
- return e(p, (b == null ? void 0 : b.focusOffset) || -1, b == null ? void 0 : b.anchorNode);
1077
- case "Safari":
1078
- const h = window.getSelection(), f = h == null ? void 0 : h.getComposedRanges(this.host.shadowRoot)[0], v = ((o = f == null ? void 0 : f.startContainer) == null ? void 0 : o.nodeValue) || "";
1079
- return e(v, (f == null ? void 0 : f.endOffset) || -1, f == null ? void 0 : f.startContainer);
1080
- default:
1081
- return console.warn("Browser not supported"), null;
1082
- }
1083
- }
1084
- handleChange(e) {
1085
- const t = e.target.textContent || "", n = this.getCurrentSelectionForBrowser();
1086
- if (!n) {
1087
- this.updateEventTitle(t), this.resetDropdown();
1088
- return;
1089
- }
1090
- const { focusOffset: s, dollarIndex: o, lastWord: i, currentText: l } = n;
1091
- if (o === -1 || s < o) {
1092
- this.updateEventTitle(t), this.resetDropdown();
1093
- return;
1094
- }
1095
- i.startsWith("$") ? (this.showTokens = !0, this.currentWord = {
1096
- $value: i,
1097
- fullText: l,
1098
- index: o,
1099
- focusOffset: s
1100
- }, this.populateSuggestionsDropdown(i)) : this.resetDropdown(), this.updateEventTitle(t);
1101
- }
1102
- handleInputKeyDown(e) {
1103
- var t, n, s, o;
1104
- if (e.key === "Enter") {
1105
- e.preventDefault();
1106
- const i = (t = this.host.shadowRoot) == null ? void 0 : t.getElementById(this.ariaActivedescendant);
1107
- i && (i.click(), this.ariaActivedescendant = "");
1108
- } else if (e.key === "ArrowDown") {
1109
- e.preventDefault();
1110
- const i = (n = this.host.shadowRoot) == null ? void 0 : n.getElementById(this.ariaActivedescendant);
1111
- if (i) {
1112
- const l = i.nextElementSibling;
1113
- l ? this.ariaActivedescendant = l.id : this.ariaActivedescendant = this.filteredTokens[0].label;
1114
- } else
1115
- this.ariaActivedescendant = this.filteredTokens[0].label;
1116
- } else if (e.key === "ArrowUp") {
1117
- e.preventDefault();
1118
- const i = (s = this.host.shadowRoot) == null ? void 0 : s.getElementById(this.ariaActivedescendant);
1119
- if (i) {
1120
- const l = i.previousElementSibling;
1121
- l ? this.ariaActivedescendant = l.id : this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1122
- } else
1123
- this.ariaActivedescendant = this.filteredTokens[this.filteredTokens.length - 1].label;
1124
- } else if (e.key === "Escape")
1125
- e.preventDefault(), this.resetDropdown();
1126
- else if (e.key === "Backspace" || e.key === "Delete") {
1127
- const i = this.getCurrentSelectionForBrowser();
1128
- i != null && i.currentText.startsWith("${") && (o = i == null ? void 0 : i.node) != null && o.parentNode && i.node.parentNode.removeChild(i.node);
1129
- }
1130
- }
1131
- selectOption(e, t) {
1132
- var c;
1133
- e.preventDefault();
1134
- const n = this.currentWord.fullText, s = this.currentWord.$value;
1135
- let o = this.titleRef.firstChild, i = null;
1136
- for (; o; ) {
1137
- if (o.nodeType === 3) {
1138
- const u = ((c = o.textContent) == null ? void 0 : c.replace(/[\u200B-\u200D\uFEFF]/g, "")) || "", m = n.replace(/[\u200B-\u200D\uFEFF]/g, "");
1139
- if (u.includes(m)) {
1140
- i = o;
1141
- break;
1142
- }
1143
- }
1144
- o = o.nextSibling;
1145
- }
1146
- if (!i)
1147
- return;
1148
- const l = i.textContent || "", r = l.indexOf(s), b = l.substring(0, r), p = l.substring(r + s.length), h = document.createTextNode(b), f = document.createRange(), v = document.createElement("span");
1149
- v.classList.add("highlighted-tag"), v.textContent = `${t.value}`;
1150
- const Z = document.createTextNode(p);
1151
- if (p !== "")
1152
- i.replaceWith(h, v, Z), f.setStart(Z, 0);
1153
- else {
1154
- const u = document.createTextNode("​");
1155
- i.replaceWith(h, v, u), f.setStart(u, 0);
1156
- }
1157
- this.resetDropdown(), this.titleRef.focus();
1158
- const $ = window.getSelection();
1159
- f.collapse(!0), $ == null || $.removeAllRanges(), $ == null || $.addRange(f), this.updateEventTitle(this.titleRef.textContent || "");
1160
- }
1161
- populateSuggestionsDropdown(e = "") {
1162
- this.filteredTokens = this.availableTokens.filter((t) => t.label.startsWith(e.toString()) || t.value.startsWith(e.toString())), this.filteredTokens.length > 0 && (this.ariaActivedescendant = this.filteredTokens[0].label);
1163
- }
1164
- updateEventTitle(e) {
1165
- const t = e.replace(/ +/g, " ");
1166
- this.valueChanged.emit({ value: t, name: this.name });
1167
- }
1168
- resetDropdown() {
1169
- this.showTokens = !1, this.ariaActivedescendant = "";
1170
- }
1171
- getLabelHTML(e) {
1172
- return a("div", { class: "token-label" }, a("span", { class: "token" }, e.token), a("span", { class: "description" }, e.description));
1173
- }
1174
- render() {
1175
- var e;
1176
- return a(k, { key: "a58acf57120285f1c42b0df698b31e298b40407d" }, a("div", { key: "ed5b5e3d7694fbce89647344b066326271786779", class: "nylas-event-title", part: "net" }, a("label", { key: "102d6d0df0164809afe2f215408cc321703c38bc", htmlFor: "title" }, "Event title", a("span", { key: "e024b656ae41640181ba67aed42a52509774354c", class: "required" }, "*"), a("span", { key: "7116bafdab5470e86ba2acdafc2236610b79ea59", class: "label-icon" }, a("tooltip-component", { key: "71a50958f2f04cdfe0cc35c17f60c64f3b910e84" }, a("info-icon", { key: "92e96b68f699d4aff80e028538259e27ba803e18", slot: "tooltip-icon" }), a("span", { key: "5c29a9e8bde6f4cd8df38082b70ad15682e4b687", slot: "tooltip-content" }, "Enter a title for your event.")))), a("div", { key: "72f580436b050b2af9b78149e3b8831912847e7f", class: "title", part: "net__title", ref: (t) => this.titleRef = t, contentEditable: "true", onInput: (t) => this.handleChange(t), onKeyDown: (t) => this.handleInputKeyDown(t) }), this.showTokens && ((e = this.filteredTokens) == null ? void 0 : e.length) > 0 && a("div", { class: "token-options", part: "net__dropdown-content" }, a("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant }, this.filteredTokens.map((t) => a("li", { tabindex: "0", key: t.label, id: t.label, class: { active: this.ariaActivedescendant === t.label }, onClick: (n) => this.selectOption(n, t), role: "option" }, this.getLabelHTML(t.labelHTML))))), a("span", { key: "a75e5bea3c3841e1030ff676465c036006cf617f", class: "help-text" }, "Create a dynamic templated event title by typing $. Learn more")));
1177
- }
1178
- static get formAssociated() {
1179
- return !0;
1180
- }
1181
- get host() {
1182
- return x(this);
1183
- }
1184
- static get watchers() {
1185
- return {
1186
- name: ["elementNameChangedHandler"],
1187
- ariaActivedescendant: ["ariaActivedescendantChangedHandler"]
1188
- };
1189
- }
1190
- };
1191
- Vt([
1192
- _({
1193
- name: "nylas-event-title",
1194
- eventToProps: {},
1195
- fireRegisterEvent: !0
1196
- }),
1197
- ue("design:type", Function),
1198
- ue("design:paramtypes", []),
1199
- ue("design:returntype", void 0)
1200
- ], Ae.prototype, "render", null);
1201
- Ae.style = Wt;
1202
- const Ut = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-limit-future-bookings{display:flex;justify-content:space-between;font-family:var(--nylas-font-family)}.nylas-limit-future-bookings label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-limit-future-bookings label span.label-icon{margin-left:4px}.nylas-limit-future-bookings label span.label-icon tooltip-component{display:flex}', Zt = Ut;
1203
- var Yt = function(e, t, n, s) {
1204
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
1205
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1206
- i = Reflect.decorate(e, t, n, s);
1207
- else
1208
- for (var r = e.length - 1; r >= 0; r--)
1209
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
1210
- return o > 3 && i && Object.defineProperty(t, n, i), i;
1211
- }, he = function(e, t) {
1212
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1213
- return Reflect.metadata(e, t);
1214
- };
1215
- const Fe = class {
1216
- constructor(e) {
1217
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.availableDaysInFuture = void 0, this.name = "limit-future-bookings", this.selectedNumber = 1, this.selectedPeriod = "day";
1218
- }
1219
- elementNameChangedHandler(e) {
1220
- d("nylas-limit-future-bookings", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1221
- }
1222
- availableDaysInFutureChanged(e) {
1223
- const { number: t, period: n } = this.calculateNumberAndPeriodFromDays(e);
1224
- this.selectedNumber = t, this.selectedPeriod = n;
1225
- }
1226
- connectedCallback() {
1227
- d("nylas-limit-future-bookings", "connectedCallback");
1228
- }
1229
- componentWillLoad() {
1230
- d("nylas-limit-future-bookings", "componentWillLoad"), this.host.setAttribute("name", this.name);
1231
- }
1232
- componentDidLoad() {
1233
- var e;
1234
- d("nylas-limit-future-bookings", "componentDidLoad"), this.availableDaysInFutureChanged(this.availableDaysInFuture ?? 1), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(((e = this.availableDaysInFuture) == null ? void 0 : e.toString()) ?? "1", this.name);
1235
- }
1236
- disconnectedCallback() {
1237
- d("nylas-limit-future-bookings", "disconnectedCallback");
1238
- }
1239
- timePeriodChangedHandler(e) {
1240
- const { number: t, period: n } = e.detail;
1241
- let s;
1242
- n === "day" ? s = t : n === "week" ? s = t * 7 : s = t * 30, this.valueChanged.emit({ value: s, name: this.name }), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(s.toString(), this.name);
1243
- }
1244
- calculateNumberAndPeriodFromDays(e) {
1245
- return e >= 30 && e % 30 === 0 ? { number: e / 30, period: "month" } : e >= 7 && e % 7 === 0 ? { number: e / 7, period: "week" } : { number: e, period: "day" };
1246
- }
1247
- render() {
1248
- return a(k, { key: "51c0c8da5fd7f5dde898fd72e450f7d964c424c6" }, a("div", { key: "0cca0db28b809eec38f93bb25ad8e7ec281836f0", class: "nylas-limit-future-bookings", part: "nlfb" }, a("label", { key: "feb8cd912af491a1f26a5e32ec2a7cf6d34309da" }, "Limit future bookings", a("span", { key: "c1e61e9137428534f80db3222fa0c71b220fe333", class: "label-icon" }, a("tooltip-component", { key: "b1f429be3c382dfe5b1cf6bfd98f71dd9a3d4b81" }, a("info-icon", { key: "e52cdd714fa99b9e8ff1b995a15a44474bf7dbdd", slot: "tooltip-icon" }), a("span", { key: "8fc34d1fd12b92312d6e5c380a0aba8a2605285d", slot: "tooltip-content" }, "Set a limit on how far in the future bookings can be made.")))), a("time-period-selector", { key: "3edfddf9214f8729e6d36f4b5aca4fb771829cea", id: "limit-future-bookings", timePeriods: ["day", "week", "month"], exportparts: "tps__number-dropdown: nlfb__number-dropdown, tps__number-dropdown-button: nlfb__number-dropdown-button, tps__number-dropdown-content: nlfb__number-dropdown-content, tps__period-dropdown: nlfb__period-dropdown, tps__period-dropdown-button: nlfb__period-dropdown-button, tps__period-dropdown-content: nlfb__period-dropdown-content", defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod })));
1249
- }
1250
- static get formAssociated() {
1251
- return !0;
1252
- }
1253
- get host() {
1254
- return x(this);
1255
- }
1256
- static get watchers() {
1257
- return {
1258
- name: ["elementNameChangedHandler"],
1259
- availableDaysInFuture: ["availableDaysInFutureChanged"]
1260
- };
1261
- }
1262
- };
1263
- Yt([
1264
- _({
1265
- name: "nylas-limit-future-bookings",
1266
- eventToProps: {},
1267
- fireRegisterEvent: !0
1268
- }),
1269
- he("design:type", Function),
1270
- he("design:paramtypes", []),
1271
- he("design:returntype", void 0)
1272
- ], Fe.prototype, "render", null);
1273
- Fe.style = Zt;
1274
- const Kt = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-event-location{display:flex;flex-direction:column;gap:4px;font-family:var(--nylas-font-family)}.nylas-event-location label{display:flex;align-items:center;color:var(--nylas-base-nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-event-location label span.label-icon{margin-left:4px}.nylas-event-location label span.label-icon tooltip-component{display:flex}.nylas-event-location span[slot=select-icon]{border-right:1px solid var(--nylas-base-200);padding:16px 0.75rem 16px 0.5rem;border-radius:var(--nylas-border-radius-2x);border-bottom-right-radius:0;border-top-right-radius:0;height:20px}.nylas-event-location div.location-input{display:grid;grid-template-columns:auto 1fr;width:100%;gap:0.5rem}.nylas-event-location div.location-input input{border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:12px 16px;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}.nylas-event-location select-dropdown{width:208px}@media screen and (max-width: 768px){.nylas-event-location select-dropdown{width:100%}}.nylas-event-location select-dropdown::part(sd_dropdown){width:100%}.nylas-event-location select-dropdown::part(sd_dropdown-content){left:calc(35px + 0.5rem)}.nylas-event-location select-dropdown::part(sd_dropdown-button){display:flex;justify-content:space-between;width:100%;border:1px solid var(--nylas-base-200);padding:0 0.5rem}.nylas-event-location select-dropdown::part(sd_dropdown-button-selected-label){display:inline-flex;align-self:center;padding:14px 0;font-family:var(--nylas-font-family);font-size:16px;line-height:24px}', qt = Kt;
1275
- var Jt = function(e, t, n, s) {
1276
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
1277
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1278
- i = Reflect.decorate(e, t, n, s);
1279
- else
1280
- for (var r = e.length - 1; r >= 0; r--)
1281
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
1282
- return o > 3 && i && Object.defineProperty(t, n, i), i;
1283
- }, me = function(e, t) {
1284
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1285
- return Reflect.metadata(e, t);
1286
- };
1287
- const He = class {
1288
- constructor(e) {
1289
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.eventLocation = void 0, this.location = this.eventLocation ?? "", this.selectedLocationOption = this.eventLocation ? "custom" : "none", this.name = "location";
1290
- }
1291
- elementNameChangedHandler(e) {
1292
- d("nylas-location-component", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1293
- }
1294
- eventLocationChangedHandler(e, t) {
1295
- d("nylas-location-component", "eventLocationChangedHandler", e), e !== t && (this.selectedLocationOption = e ? "custom" : "none");
1296
- }
1297
- connectedCallback() {
1298
- d("nylas-location-component", "connectedCallback");
1299
- }
1300
- componentWillLoad() {
1301
- d("nylas-location-component", "componentWillLoad"), this.host.setAttribute("name", this.name);
1302
- }
1303
- componentDidLoad() {
1304
- d("nylas-location-component", "componentDidLoad");
1305
- }
1306
- disconnectedCallback() {
1307
- d("nylas-location-component", "disconnectedCallback");
1308
- }
1309
- selectedOptionChangedHandler(e) {
1310
- this.selectedLocationOption = e.detail.value, this.selectedLocationOption === "none" && (this.location = "", this.setFormValue("", "location"), this.valueChanged.emit({ value: "", name: this.name }));
1311
- }
1312
- setFormValue(e, t) {
1313
- typeof this.internals.setFormValue == "function" && this.internals.setFormValue(e, t);
1314
- }
1315
- handleChange(e) {
1316
- this.location = e.target.value, this.setFormValue(e.target.value, "location"), this.valueChanged.emit({ value: e.target.value, name: this.name });
1317
- }
1318
- render() {
1319
- const e = [
1320
- { value: "none", label: "None" },
1321
- { value: "custom", label: "Custom location" }
1322
- ], t = {
1323
- none: a("location-off-icon", { key: "694d28e2c953bd5519209e10435bf646578d114a" }),
1324
- custom: a("location-icon", { key: "7062ec4488bff42737000d61ea2bf139a873a2c5" })
1325
- };
1326
- return a(k, { key: "fc9ae763769cb2eb7bc441b1badd42247875f398" }, a("div", { key: "7af34d7e80f9f54c27625e8740c6b5474087e737", class: "nylas-event-location", part: "nel" }, a("label", { key: "f5023e444ca97848346897f51fce28352f267d49", htmlFor: "location" }, "Location type", a("span", { key: "f5b34257a36a986f22e7d6d912976c23ebe979ad", class: "label-icon" }, a("tooltip-component", { key: "68ac23d32ce98388faa32476c4d5630e7fe8b684" }, a("info-icon", { key: "57a204c6d75da1132272e1e1d59e1fd46e9677fc", slot: "tooltip-icon" }), a("span", { key: "1dd7951c0aa0f5024a02f64a83495c2d241daa84", slot: "tooltip-content" }, "Choose how you’ll meet with the participants at the scheduled time. Pick from available conferencing options or add a custom location.")))), a("div", { key: "e059381733d12841294fdb781ad59a6a12f49a74", class: "location-input" }, a("select-dropdown", { key: "006b90371c0fde6f2e8dc3be75b40e398ceaf62d", withSearch: !1, name: "location", options: e, defaultSelectedOption: e.find((n) => n.value == this.selectedLocationOption), exportparts: "sd__dropdown: nel__dropdown, sd__dropdown-button: nel__dropdown-button, sd__dropdown-content: nel__dropdown-content" }, a("span", { key: "6f61a147ebbc95c142ffa379886d15031168f837", slot: "select-icon" }, t[this.selectedLocationOption])), this.selectedLocationOption === "custom" && a("input", { type: "text", part: "nel__location", id: "location", name: "location", maxlength: "1024", value: this.location, onInput: (n) => this.handleChange(n) }))));
1327
- }
1328
- static get formAssociated() {
1329
- return !0;
1330
- }
1331
- get host() {
1332
- return x(this);
1333
- }
1334
- static get watchers() {
1335
- return {
1336
- name: ["elementNameChangedHandler"],
1337
- eventLocation: ["eventLocationChangedHandler"]
1338
- };
1339
- }
1340
- };
1341
- Jt([
1342
- _({
1343
- name: "nylas-location-component",
1344
- eventToProps: {},
1345
- fireRegisterEvent: !0
1346
- }),
1347
- me("design:type", Function),
1348
- me("design:paramtypes", []),
1349
- me("design:returntype", void 0)
1350
- ], He.prototype, "render", null);
1351
- He.style = qt;
1352
- const Gt = ':host{--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.nylas-min-cancellation-notice{display:flex;justify-content:space-between;font-family:var(--nylas-font-family)}.nylas-min-cancellation-notice label{display:flex;align-items:center;color:var(--nylas-base-800);font-size:14px;font-style:normal;font-weight:400;line-height:150%;}.nylas-min-cancellation-notice label span.label-icon{margin-left:4px}.nylas-min-cancellation-notice label span.label-icon tooltip-component{display:flex}', Xt = Gt;
1353
- var Qt = function(e, t, n, s) {
1354
- var o = arguments.length, i = o < 3 ? t : s === null ? s = Object.getOwnPropertyDescriptor(t, n) : s, l;
1355
- if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
1356
- i = Reflect.decorate(e, t, n, s);
1357
- else
1358
- for (var r = e.length - 1; r >= 0; r--)
1359
- (l = e[r]) && (i = (o < 3 ? l(i) : o > 3 ? l(t, n, i) : l(t, n)) || i);
1360
- return o > 3 && i && Object.defineProperty(t, n, i), i;
1361
- }, ye = function(e, t) {
1362
- if (typeof Reflect == "object" && typeof Reflect.metadata == "function")
1363
- return Reflect.metadata(e, t);
1364
- };
1365
- const Me = class {
1366
- constructor(e) {
1367
- y(this, e), this.valueChanged = w(this, "valueChanged", 7), e.$hostElement$["s-ei"] ? this.internals = e.$hostElement$["s-ei"] : (this.internals = e.$hostElement$.attachInternals(), e.$hostElement$["s-ei"] = this.internals), this.minCancellationNotice = void 0, this.name = "min-cancellation-notice", this.selectedNumber = 1, this.selectedPeriod = "day";
1368
- }
1369
- elementNameChangedHandler(e) {
1370
- d("nylas-min-cancellation-notice", "elementNameChangedHandler", e), this.host.setAttribute("name", e);
1371
- }
1372
- availableDaysInFutureChanged(e) {
1373
- const { number: t, period: n } = this.calculateNumberAndPeriodFromMinutes(e);
1374
- this.selectedNumber = t, this.selectedPeriod = n;
1375
- }
1376
- connectedCallback() {
1377
- d("nylas-min-cancellation-notice", "connectedCallback");
1378
- }
1379
- componentWillLoad() {
1380
- d("nylas-min-cancellation-notice", "componentWillLoad"), this.host.setAttribute("name", this.name);
1381
- }
1382
- componentDidLoad() {
1383
- var e;
1384
- d("nylas-min-cancellation-notice", "componentDidLoad"), this.availableDaysInFutureChanged(this.minCancellationNotice ?? 1), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(((e = this.minCancellationNotice) == null ? void 0 : e.toString()) ?? "1", this.name);
1385
- }
1386
- disconnectedCallback() {
1387
- d("nylas-min-cancellation-notice", "disconnectedCallback");
1388
- }
1389
- timePeriodChangedHandler(e) {
1390
- const { number: t, period: n } = e.detail;
1391
- let s;
1392
- const o = 60, i = o * 24, l = i * 7, r = i * 30;
1393
- n === "minute" ? s = t : n === "hour" ? s = t * o : n === "day" ? s = t * i : n === "week" ? s = t * l : n === "month" ? s = t * r : s = 0, this.valueChanged.emit({ value: s, name: this.name }), typeof this.internals.setFormValue == "function" && this.internals.setFormValue(s.toString(), this.name);
1394
- }
1395
- calculateNumberAndPeriodFromMinutes(e) {
1396
- return e >= 43200 ? { number: Math.floor(e / 43200), period: "month" } : e >= 10080 ? { number: Math.floor(e / 10080), period: "week" } : e >= 1440 ? { number: Math.floor(e / 1440), period: "day" } : e >= 60 ? { number: Math.floor(e / 60), period: "hour" } : { number: e, period: "minute" };
1397
- }
1398
- render() {
1399
- return a(k, { key: "e8638ae7a5b45140fa0abc7e50d4ec751faed4a4" }, a("div", { key: "282e956cdf1b1b9b2f42ea497fb80ae3cc422d58", class: "nylas-min-cancellation-notice", part: "nmcn" }, a("label", { key: "18c52355a024ff02a896cd6727fb947d4892d3d6" }, "Minimum cancellation notice", a("span", { key: "0ebeecfaadaf1a6b2c96ab0370516b744e79ecbf", class: "label-icon" }, a("tooltip-component", { key: "e216327d62b98e954286a16bef997115617c9fb8" }, a("info-icon", { key: "b2ac6e0031012959ed6282deb04b73eabb5e84de", slot: "tooltip-icon" }), a("span", { key: "05e0bb93d0468b97d0ce815fafe5ca0ab6be31cc", slot: "tooltip-content" }, "Set the minimum amount of time required to cancel an event.")))), a("time-period-selector", { key: "28e31fad6667ee1b7c05e63620a5716167262c5f", id: "min-cancellation-notice", exportparts: "tps__number-dropdown: nmcn__number-dropdown, tps__number-dropdown-button: nmcn__number-dropdown-button, tps__number-dropdown-content: nmcn__number-dropdown-content, tps__period-dropdown: nmcn__period-dropdown, tps__period-dropdown-button: nmcn__period-dropdown-button, tps__period-dropdown-content: nmcn__period-dropdown-content", timePeriods: ["minute", "hour", "day", "week"], defaultSelectedNumber: this.selectedNumber, defaultSelectedPeriod: this.selectedPeriod })));
1400
- }
1401
- static get formAssociated() {
1402
- return !0;
1403
- }
1404
- get host() {
1405
- return x(this);
1406
- }
1407
- static get watchers() {
1408
- return {
1409
- name: ["elementNameChangedHandler"],
1410
- availableDaysInFuture: ["availableDaysInFutureChanged"]
1411
- };
1412
- }
1413
- };
1414
- Qt([
1415
- _({
1416
- name: "nylas-min-cancellation-notice",
1417
- eventToProps: {},
1418
- fireRegisterEvent: !0
1419
- }),
1420
- ye("design:type", Function),
1421
- ye("design:paramtypes", []),
1422
- ye("design:returntype", void 0)
1423
- ], Me.prototype, "render", null);
1424
- Me.style = Xt;
1425
- var Ne = { exports: {} };
1426
- (function(e, t) {
1427
- (function(n, s) {
1428
- e.exports = s();
1429
- })(We, function() {
1430
- var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, s = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, o = /\d\d/, i = /\d\d?/, l = /\d*[^-_:/,()\s\d]+/, r = {}, b = function(c) {
1431
- return (c = +c) + (c > 68 ? 1900 : 2e3);
1432
- }, p = function(c) {
1433
- return function(u) {
1434
- this[c] = +u;
1435
- };
1436
- }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(c) {
1437
- (this.zone || (this.zone = {})).offset = function(u) {
1438
- if (!u || u === "Z")
1439
- return 0;
1440
- var m = u.match(/([+-]|\d\d)/g), g = 60 * m[1] + (+m[2] || 0);
1441
- return g === 0 ? 0 : m[0] === "+" ? -g : g;
1442
- }(c);
1443
- }], f = function(c) {
1444
- var u = r[c];
1445
- return u && (u.indexOf ? u : u.s.concat(u.f));
1446
- }, v = function(c, u) {
1447
- var m, g = r.meridiem;
1448
- if (g) {
1449
- for (var D = 1; D <= 24; D += 1)
1450
- if (c.indexOf(g(D, 0, u)) > -1) {
1451
- m = D > 12;
1452
- break;
1453
- }
1454
- } else
1455
- m = c === (u ? "pm" : "PM");
1456
- return m;
1457
- }, Z = { A: [l, function(c) {
1458
- this.afternoon = v(c, !1);
1459
- }], a: [l, function(c) {
1460
- this.afternoon = v(c, !0);
1461
- }], S: [/\d/, function(c) {
1462
- this.milliseconds = 100 * +c;
1463
- }], SS: [o, function(c) {
1464
- this.milliseconds = 10 * +c;
1465
- }], SSS: [/\d{3}/, function(c) {
1466
- this.milliseconds = +c;
1467
- }], s: [i, p("seconds")], ss: [i, p("seconds")], m: [i, p("minutes")], mm: [i, p("minutes")], H: [i, p("hours")], h: [i, p("hours")], HH: [i, p("hours")], hh: [i, p("hours")], D: [i, p("day")], DD: [o, p("day")], Do: [l, function(c) {
1468
- var u = r.ordinal, m = c.match(/\d+/);
1469
- if (this.day = m[0], u)
1470
- for (var g = 1; g <= 31; g += 1)
1471
- u(g).replace(/\[|\]/g, "") === c && (this.day = g);
1472
- }], M: [i, p("month")], MM: [o, p("month")], MMM: [l, function(c) {
1473
- var u = f("months"), m = (f("monthsShort") || u.map(function(g) {
1474
- return g.slice(0, 3);
1475
- })).indexOf(c) + 1;
1476
- if (m < 1)
1477
- throw new Error();
1478
- this.month = m % 12 || m;
1479
- }], MMMM: [l, function(c) {
1480
- var u = f("months").indexOf(c) + 1;
1481
- if (u < 1)
1482
- throw new Error();
1483
- this.month = u % 12 || u;
1484
- }], Y: [/[+-]?\d+/, p("year")], YY: [o, function(c) {
1485
- this.year = b(c);
1486
- }], YYYY: [/\d{4}/, p("year")], Z: h, ZZ: h };
1487
- function $(c) {
1488
- var u, m;
1489
- u = c, m = r && r.formats;
1490
- for (var g = (c = u.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(N, L, O) {
1491
- var C = O && O.toUpperCase();
1492
- return L || m[O] || n[O] || m[C].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(A, F, R) {
1493
- return F || R.slice(1);
1494
- });
1495
- })).match(s), D = g.length, I = 0; I < D; I += 1) {
1496
- var U = g[I], M = Z[U], E = M && M[0], S = M && M[1];
1497
- g[I] = S ? { regex: E, parser: S } : U.replace(/^\[|\]$/g, "");
1498
- }
1499
- return function(N) {
1500
- for (var L = {}, O = 0, C = 0; O < D; O += 1) {
1501
- var A = g[O];
1502
- if (typeof A == "string")
1503
- C += A.length;
1504
- else {
1505
- var F = A.regex, R = A.parser, Y = N.slice(C), P = F.exec(Y)[0];
1506
- R.call(L, P), N = N.replace(P, "");
1507
- }
1508
- }
1509
- return function(z) {
1510
- var T = z.afternoon;
1511
- if (T !== void 0) {
1512
- var B = z.hours;
1513
- T ? B < 12 && (z.hours += 12) : B === 12 && (z.hours = 0), delete z.afternoon;
1514
- }
1515
- }(L), L;
1516
- };
1517
- }
1518
- return function(c, u, m) {
1519
- m.p.customParseFormat = !0, c && c.parseTwoDigitYear && (b = c.parseTwoDigitYear);
1520
- var g = u.prototype, D = g.parse;
1521
- g.parse = function(I) {
1522
- var U = I.date, M = I.utc, E = I.args;
1523
- this.$u = M;
1524
- var S = E[1];
1525
- if (typeof S == "string") {
1526
- var N = E[2] === !0, L = E[3] === !0, O = N || L, C = E[2];
1527
- L && (C = E[2]), r = this.$locale(), !N && C && (r = m.Ls[C]), this.$d = function(Y, P, z) {
1528
- try {
1529
- if (["x", "X"].indexOf(P) > -1)
1530
- return new Date((P === "X" ? 1e3 : 1) * Y);
1531
- var T = $(P)(Y), B = T.year, K = T.month, Re = T.day, ze = T.hours, Pe = T.minutes, Be = T.seconds, je = T.milliseconds, ge = T.zone, J = /* @__PURE__ */ new Date(), G = Re || (B || K ? 1 : J.getDate()), X = B || J.getFullYear(), q = 0;
1532
- B && !K || (q = K > 0 ? K - 1 : J.getMonth());
1533
- var Q = ze || 0, ee = Pe || 0, te = Be || 0, ne = je || 0;
1534
- return ge ? new Date(Date.UTC(X, q, G, Q, ee, te, ne + 60 * ge.offset * 1e3)) : z ? new Date(Date.UTC(X, q, G, Q, ee, te, ne)) : new Date(X, q, G, Q, ee, te, ne);
1535
- } catch {
1536
- return /* @__PURE__ */ new Date("");
1537
- }
1538
- }(U, S, M), this.init(), C && C !== !0 && (this.$L = this.locale(C).$L), O && U != this.format(S) && (this.$d = /* @__PURE__ */ new Date("")), r = {};
1539
- } else if (S instanceof Array)
1540
- for (var A = S.length, F = 1; F <= A; F += 1) {
1541
- E[1] = S[F - 1];
1542
- var R = m.apply(this, E);
1543
- if (R.isValid()) {
1544
- this.$d = R.$d, this.$L = R.$L, this.init();
1545
- break;
1546
- }
1547
- F === A && (this.$d = /* @__PURE__ */ new Date(""));
1548
- }
1549
- else
1550
- D.call(this, I);
1551
- };
1552
- };
1553
- });
1554
- })(Ne);
1555
- const en = Ne.exports, tn = ':host{display:block;position:relative;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:"Inter", sans-serif}.time-picker{display:inline-block;width:150px;font-family:var(--nylas-font-family);position:relative}@media screen and (max-width: 768px){.time-picker{width:auto}}.time-picker input{width:150px;height:48px;text-align:center;font-size:16px;font-family:inherit;cursor:pointer;background:transparent;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x)}@media screen and (max-width: 768px){.time-picker input{width:88px}}@media screen and (max-width: 504px){.time-picker input{width:68px;font-size:15px}}.time-picker input.focus{background:transparent}.time-picker input:hover,.time-picker input:active{border:1px solid var(--nylas-primary)}.time-picker input:active{outline:2px solid var(--nylas-primary)}.time-picker input span.open{transform:rotate(90deg)}.time-picker input span.closed{transform:rotate(270deg)}.time-picker input.error{border:1px solid var(--nylas-error)}.time-picker p.error{color:var(--nylas-error);font-size:0.875rem;margin:0}.times{display:block;margin-top:0.5rem;background-color:var(--nylas-base-0);width:100%;max-height:336px;overflow:auto;border:1px solid #ddd;z-index:1;border-radius:4px;position:absolute;box-shadow:0px 4px 6px -2px rgba(0, 0, 0, 0.0509803922);box-shadow:0px 10px 15px -3px rgba(0, 0, 0, 0.1019607843)}.times ul{padding:0;list-style-type:none;color:var(--nylas-base-900);max-height:336px}.times ul li{padding:16px, 12px, 16px, 12px;color:black;padding:12px 16px;text-decoration:none;display:block;font-family:inherit;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:center;cursor:pointer}.times ul li.focused{background-color:var(--nylas-base-100)}.times ul li:hover,.times ul li:focus{background-color:var(--nylas-base-100)}.times ul li label{display:flex;align-items:center;gap:0.5rem}.times ul li label input{margin:0}', nn = tn;
1556
- V.extend(en);
1557
- const an = class {
1558
- constructor(e) {
1559
- y(this, e), this.timeChange = w(this, "timeChange", 7), this.time = void 0, this.minimumStartTime = null, this.placeholder = "hh:mmam/pm", this.setTime = void 0, this.name = void 0, this.hasError = !1, this.setFormError = void 0, this.err = "", this.showTimes = !1, this.ariaActivedescendant = "", this.times = this.generateTimes(), this.shouldAutoScroll = !1;
1560
- }
1561
- handleOutsideClick(e) {
1562
- !e.composedPath().includes(this.el) && this.showTimes && (this.showTimes = !1);
1563
- }
1564
- minimumStartTimeChangedHandler() {
1565
- if (this.minimumStartTime) {
1566
- let e = V().hour(parseInt(this.minimumStartTime)).minute(parseInt(this.minimumStartTime.slice(-4, -2)));
1567
- this.minimumStartTime.slice(-2).toLowerCase() === "pm" && parseInt(this.minimumStartTime) !== 12 ? e = e.add(12, "hour") : this.minimumStartTime.slice(-2).toLowerCase() === "am" && parseInt(this.minimumStartTime) === 12 && (e = e.subtract(12, "hour")), this.times = this.generateTimes();
1568
- const t = V(this.times[0].value, "hh:mma");
1569
- V(this.time, "hh:mma").isBefore(t) && (this.err = "Invalid", this.setFormError(null, "Invalid"));
1570
- }
1571
- }
1572
- componentDidRender() {
1573
- if (this.showTimes && this.shouldAutoScroll) {
1574
- const e = ae(this.time), t = this.times.findIndex((n) => n.value === e);
1575
- t > -1 && (this.shouldAutoScroll = !1, this.scrollToViewWithinParent(t));
1576
- return;
1577
- }
1578
- }
1579
- handleTimeChange(e, t) {
1580
- const n = t.split(":");
1581
- n[0] === "00" && n[1].slice(-2) == "pm" && (this.err = "Invalid", this.setFormError(e, "Invalid")), ie(t) ? (this.err = "", this.setFormError(null)) : (this.err = "Invalid", this.setFormError(e, "Invalid")), this.setTime(e, t), this.timeChange.emit(t);
1582
- }
1583
- handleTimeAutocomplete(e) {
1584
- var n;
1585
- const t = (n = e.target) == null ? void 0 : n.value;
1586
- if (!ie(t)) {
1587
- this.err = "Invalid", this.setFormError(e, "Invalid");
1588
- return;
1589
- }
1590
- if (t === "") {
1591
- const s = ke().format("hh:mma");
1592
- this.setTime(e, s);
1593
- return;
1594
- }
1595
- if (!we(t)) {
1596
- const s = ae(t);
1597
- this.setTime(s);
1598
- return;
1599
- }
1600
- this.setTime(e, t);
1601
- }
1602
- handleOnInput(e) {
1603
- var n;
1604
- const t = (n = e.target) == null ? void 0 : n.value;
1605
- if (ie(t)) {
1606
- if (t === "") {
1607
- const s = ke().format("hh:mma"), o = this.times.findIndex((i) => i.value === s);
1608
- o > -1 && this.scrollToViewWithinParent(o);
1609
- return;
1610
- }
1611
- if (!we(t)) {
1612
- const s = ae(t), o = this.times.findIndex((i) => i.value === s);
1613
- o > -1 && this.scrollToViewWithinParent(o);
1614
- return;
1615
- }
1616
- }
1617
- }
1618
- generateTimes() {
1619
- const e = [];
1620
- let t = V().set("hour", 0).set("minute", 0).set("second", 0);
1621
- this.minimumStartTime && (t = V(this.minimumStartTime, "hh:mma"));
1622
- const n = t.endOf("day").diff(t, "minutes"), s = Math.round(n / 15);
1623
- for (let o = 0; o < s + 1; o++) {
1624
- const i = t.add(o * 15, "minute");
1625
- if (o == s && i.format("hh:mma").includes("am"))
1626
- break;
1627
- e.push({ id: o, value: i.format("hh:mma") });
1628
- }
1629
- return e;
1630
- }
1631
- handleComboboxKeyDown(e) {
1632
- if (e.key === "ArrowDown") {
1633
- if (e.preventDefault(), !this.showTimes) {
1634
- this.showTimes = !0, this.shouldAutoScroll = !0;
1635
- return;
1636
- }
1637
- if (this.ariaActivedescendant === "")
1638
- this.ariaActivedescendant = this.times[0].id.toString(), this.focusOption(0);
1639
- else {
1640
- const t = this.times.findIndex((s) => s.id.toString() === this.ariaActivedescendant), n = t + 1 < this.times.length ? t + 1 : 0;
1641
- this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
1642
- }
1643
- } else if (e.key === "ArrowUp")
1644
- if (e.preventDefault(), this.ariaActivedescendant === "")
1645
- this.ariaActivedescendant = this.times[this.times.length - 1].id.toString(), this.focusOption(this.times.length - 1);
1646
- else {
1647
- const t = this.times.findIndex((s) => s.id.toString() === this.ariaActivedescendant), n = t - 1 >= 0 ? t - 1 : this.times.length - 1;
1648
- this.ariaActivedescendant = this.times[n].id.toString(), this.focusOption(n);
1649
- }
1650
- else
1651
- e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
1652
- }
1653
- handleListboxKeydown(e) {
1654
- const t = this.times, n = t.findIndex((s) => s.id.toString() === this.ariaActivedescendant);
1655
- if (e.key === "ArrowDown" || e.key === "Tab" && !e.shiftKey) {
1656
- e.preventDefault();
1657
- const s = n + 1 < t.length ? n + 1 : 0;
1658
- this.ariaActivedescendant = t[s].id.toString(), this.focusOption(s);
1659
- } else if (e.key === "ArrowUp" || e.key === "Tab" && e.shiftKey) {
1660
- e.preventDefault();
1661
- const s = n - 1 >= 0 ? n - 1 : t.length - 1;
1662
- this.ariaActivedescendant = t[s].id.toString(), this.focusOption(s);
1663
- } else if (e.key === "Enter") {
1664
- if (e.preventDefault(), this.ariaActivedescendant) {
1665
- const s = t[n];
1666
- this.handleTimeChange(e, s.value), this.showTimes = !1, this.ariaActivedescendant = "", this.timeInput.focus();
1667
- }
1668
- } else
1669
- e.key === "Escape" && (this.showTimes = !1, this.timeInput.focus());
1670
- }
1671
- scrollToViewWithinParent(e) {
1672
- var l;
1673
- const t = this.times[e], n = (l = this.el.shadowRoot) == null ? void 0 : l.getElementById(t.id.toString()), s = this.timeMenu;
1674
- this.ariaActivedescendant = t.id.toString();
1675
- const o = n.getBoundingClientRect(), i = s.getBoundingClientRect();
1676
- o.top < i.top ? s.scrollTop -= i.top - o.top : o.bottom > i.bottom && (s.scrollTop += o.bottom - i.bottom), o.left < i.left ? s.scrollLeft -= i.left - o.left : o.right > i.right && (s.scrollLeft += o.right - i.right);
1677
- }
1678
- focusOption(e) {
1679
- var o;
1680
- const t = this.times[e];
1681
- if (!t)
1682
- return;
1683
- const n = t.id.toString(), s = (o = this.el.shadowRoot) == null ? void 0 : o.getElementById(n);
1684
- s && (s.focus(), s.scrollIntoView({ behavior: "smooth", block: "nearest" }));
1685
- }
1686
- render() {
1687
- return a(k, { key: "68fb5327c6e823e29aafa4fd7e81bddac7ab19e9" }, a("div", { key: "c1f7edbdc95926f66fb627cfe0eb7044611518a5", class: "time-picker", part: "time-picker" }, a("input", { key: "f1c274637b24b9e4e88798ab83524efb8e75de36", type: "text", name: this.name, id: this.name, part: "time-input", class: {
1688
- "time-input": !0,
1689
- error: !!this.err || this.hasError
1690
- }, ref: (e) => this.timeInput = e, value: this.time, onClick: () => {
1691
- this.showTimes = !0, this.shouldAutoScroll = !0;
1692
- }, "aria-haspopup": "listbox", "aria-label": this.name, "aria-expanded": this.showTimes ? "true" : "false", placeholder: this.placeholder, onKeyDown: (e) => this.handleComboboxKeyDown(e), onInput: (e) => this.handleOnInput(e), onBlur: (e) => this.handleTimeAutocomplete(e) }), this.err && a("div", { class: "invalid-time-icon" }), this.showTimes && a("div", { class: "times", part: "times", ref: (e) => this.timeMenu = e }, a("ul", { tabindex: "-1", role: "listbox", "aria-label": this.name, "aria-activedescendant": this.ariaActivedescendant, onKeyDown: (e) => this.handleListboxKeydown(e) }, this.times.map((e) => a("li", { tabindex: "0", key: e.id, id: e.id.toString(), class: {
1693
- focused: this.ariaActivedescendant === e.id.toString()
1694
- }, onClick: (t) => {
1695
- this.handleTimeChange(t, e.value), this.showTimes = !1, this.timeInput.focus();
1696
- }, role: "option" }, `${e.value}`)))), !this.showTimes && this.err && a("p", { class: "error", id: "email-error" }, this.err)));
1697
- }
1698
- get el() {
1699
- return x(this);
1700
- }
1701
- static get watchers() {
1702
- return {
1703
- minimumStartTime: ["minimumStartTimeChangedHandler"]
1704
- };
1705
- }
1706
- };
1707
- an.style = nn;
1708
- export {
1709
- Ye as add_circle_icon,
1710
- Je as button_component,
1711
- Qe as calendar_info_icon,
1712
- nt as calendar_patterns_icon,
1713
- st as flow_icon,
1714
- rt as location_icon,
1715
- pt as location_off_icon,
1716
- ut as multi_select_dropdown,
1717
- Ce as nylas_availability_picker,
1718
- Te as nylas_booking_calendar_picker,
1719
- Oe as nylas_buffer_time,
1720
- De as nylas_calendar_picker,
1721
- Ie as nylas_custom_booking_flow,
1722
- Ee as nylas_event_description,
1723
- Se as nylas_event_duration,
1724
- $e as nylas_event_info,
1725
- Le as nylas_event_limits,
1726
- Ae as nylas_event_title,
1727
- Fe as nylas_limit_future_bookings,
1728
- He as nylas_location_component,
1729
- Me as nylas_min_cancellation_notice,
1730
- an as nylas_time_window_picker
1731
- };