@zeniai/web-components 4.4.70 → 4.4.71-beta0AN

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 (184) hide show
  1. package/dist/Editor-CbBxvSmp.js +919 -0
  2. package/dist/{SessionTimeoutPopup-BKNhya21.js → SessionTimeoutPopup-BMerO3g4.js} +112074 -113753
  3. package/dist/TaskDescriptionEditor-DyTyMxvk.js +700 -0
  4. package/dist/apple-wallet-DMr790ZM.js +19 -0
  5. package/dist/bank-verification-HpVi21UA.js +5 -0
  6. package/dist/cockpit.esm.js +1198 -1199
  7. package/dist/components/common/lazyLottie.d.ts +8 -0
  8. package/dist/components/common/lazyReactPdf.d.ts +13 -0
  9. package/dist/components/common/lazySvg.d.ts +17 -0
  10. package/dist/components/formElements/autoCompleteSingleSelectField/AutoCompleteSingleSelectField.d.ts +3 -1
  11. package/dist/components/formElements/singleSelectPickerField/SingleSelectPickerField.d.ts +2 -0
  12. package/dist/components/invoicing/createInvoice/InvoicingCreateInvoicePage.d.ts +3 -1
  13. package/dist/components/invoicing/subscriptionForm/InvoicingSubscriptionFormPage.d.ts +3 -1
  14. package/dist/components/invoicing/subscriptionForm/subscriptionForm.shared.d.ts +4 -0
  15. package/dist/components/settingsPage/Integrations/components/integrationLogos.d.ts +2874 -12
  16. package/dist/index.esm.js +139 -139
  17. package/dist/mcdonalds-logo-BTFuGR4i.js +5 -0
  18. package/dist/mercury-logo-Xd1WsXHh.js +5 -0
  19. package/dist/mercury-logo-dark-WebeUx9w.js +5 -0
  20. package/dist/more-providers-avatars-Dt7HPmCt.js +5 -0
  21. package/dist/netsuite-logo-Dp53a_wk.js +5 -0
  22. package/dist/netsuite-logo-dark-C53BYo7C.js +5 -0
  23. package/dist/paypal-logo-RhbjaD58.js +5 -0
  24. package/dist/paypal-logo-dark-_jTZA_FH.js +5 -0
  25. package/dist/phone-otp-DI7iHM2C.js +7 -0
  26. package/dist/subway-logo-B-Kc0fke.js +5 -0
  27. package/dist/underline-BNKkE4Fr.js +223 -0
  28. package/dist/vendor-@stripe-stripe-js-BmvP0myE.js +108 -0
  29. package/dist/vendor-react-lottie-player-Qhg4gMF8.js +174 -0
  30. package/dist/zeni-card-trust-BpxZYDve.js +5 -0
  31. package/dist/zeni-thanksgiving-logo-full-BLmLHEXd.js +5 -0
  32. package/package.json +6 -8
  33. package/dist/SessionTimeoutPopup-D12fxo7a.cjs +0 -92815
  34. package/dist/assets/illustrative/ai-cfo.svg +0 -13
  35. package/dist/assets/illustrative/rewardsEmailTemplate/business-banking-icon.svg +0 -21
  36. package/dist/assets/illustrative/rewardsEmailTemplate/cards-icon.svg +0 -11
  37. package/dist/assets/interface/ai-icon-color-selected-filled-small.svg +0 -27
  38. package/dist/assets/interface/ai-icon-color-selected-small.svg +0 -20
  39. package/dist/assets/interface/ai-icon-selected-filled-plain.svg +0 -5
  40. package/dist/assets/interface/arrow-2-left.svg +0 -4
  41. package/dist/assets/interface/autofill-3.svg +0 -3
  42. package/dist/assets/interface/graph-trend.svg +0 -11
  43. package/dist/assets/interface/growth-round.svg +0 -5
  44. package/dist/assets/interface/saving-money-egg.svg +0 -15
  45. package/dist/assets/interface/treasury-thumbnail.png +0 -0
  46. package/dist/assets/logos/gmail-logo.svg +0 -20
  47. package/dist/assets/logos/microsoft365-logo.svg +0 -25
  48. package/dist/assets/oldicons/promoPages/usp-line.svg +0 -3
  49. package/dist/cockpit.cjs.js +0 -5805
  50. package/dist/index.cjs.js +0 -1
  51. package/dist/vendor-@babel-runtime-_D8QudKm.cjs +0 -4
  52. package/dist/vendor-@floating-ui-core-Dyvby5gX.cjs +0 -1
  53. package/dist/vendor-@floating-ui-dom-CexqkosJ.cjs +0 -1
  54. package/dist/vendor-@floating-ui-utils-sUr78tUz.cjs +0 -1
  55. package/dist/vendor-@popperjs-core-Da5z8R8_.cjs +0 -1
  56. package/dist/vendor-@react-oauth-google-RY6l5Pdi.cjs +0 -1
  57. package/dist/vendor-@statsig-client-core-CcuuGlfw.cjs +0 -1
  58. package/dist/vendor-@statsig-js-client-C6n1oYZG.cjs +0 -1
  59. package/dist/vendor-@statsig-react-bindings-DVuaLZfm.cjs +0 -1
  60. package/dist/vendor-@ungap-structured-clone-BSqP9FP7.cjs +0 -1
  61. package/dist/vendor-@zeniai-client-epic-state-DWdyw6ma.cjs +0 -1
  62. package/dist/vendor-autosuggest-highlight-BrLUL75m.cjs +0 -1
  63. package/dist/vendor-bail-CPU4onRe.cjs +0 -1
  64. package/dist/vendor-big.js-BfsYTtpv.cjs +0 -1
  65. package/dist/vendor-browser-image-compression-BZPRtRQ2.cjs +0 -20
  66. package/dist/vendor-ccount-B3JMtXU-.cjs +0 -1
  67. package/dist/vendor-clsx-CAED27AB.cjs +0 -1
  68. package/dist/vendor-color-BlJDv7Qx.cjs +0 -1
  69. package/dist/vendor-color-convert-DNxf_t0v.cjs +0 -1
  70. package/dist/vendor-color-name-DMfyNIC_.cjs +0 -1
  71. package/dist/vendor-color-string-DlngRZWO.cjs +0 -1
  72. package/dist/vendor-comma-separated-tokens-CM2uar_0.cjs +0 -1
  73. package/dist/vendor-countries-list-DdDJCIea.cjs +0 -1
  74. package/dist/vendor-country-flag-icons-CaT9dyG0.cjs +0 -1
  75. package/dist/vendor-cross-fetch-BcrCP3uC.cjs +0 -2
  76. package/dist/vendor-decode-named-character-reference-CpsLJx05.cjs +0 -1
  77. package/dist/vendor-devlop-IYc_KfOj.cjs +0 -1
  78. package/dist/vendor-escape-string-regexp-CXe2COqk.cjs +0 -1
  79. package/dist/vendor-estree-util-is-identifier-name-DqXb06tQ.cjs +0 -1
  80. package/dist/vendor-extend-Xv02IcfV.cjs +0 -1
  81. package/dist/vendor-fast-deep-equal-xp5wgv1k.cjs +0 -1
  82. package/dist/vendor-hast-util-to-jsx-runtime-Cn0tASh-.cjs +0 -1
  83. package/dist/vendor-hast-util-whitespace-B7YrIln0.cjs +0 -1
  84. package/dist/vendor-html-url-attributes-B55Ir3vo.cjs +0 -1
  85. package/dist/vendor-inline-style-parser-BwLpyraz.cjs +0 -2
  86. package/dist/vendor-input-format-B4RKCxE4.cjs +0 -3
  87. package/dist/vendor-is-arrayish-DfXUb1DJ.cjs +0 -1
  88. package/dist/vendor-is-plain-obj-DH-Kh8FX.cjs +0 -1
  89. package/dist/vendor-js-file-download-Cbb6agEb.cjs +0 -1
  90. package/dist/vendor-libphonenumber-js-DkZ7WT-u.cjs +0 -13
  91. package/dist/vendor-lodash-CNz95YDD.cjs +0 -1
  92. package/dist/vendor-lodash.debounce-C9YP0rOk.cjs +0 -1
  93. package/dist/vendor-longest-streak-CpfJ7Pkv.cjs +0 -1
  94. package/dist/vendor-lottie-web-Cnpvoe-Q.cjs +0 -2
  95. package/dist/vendor-markdown-table-BIbVC1pY.cjs +0 -2
  96. package/dist/vendor-mdast-util-find-and-replace-BqOMYvvg.cjs +0 -1
  97. package/dist/vendor-mdast-util-from-markdown-DmcqmoHq.cjs +0 -1
  98. package/dist/vendor-mdast-util-gfm-DYVYZtQo.cjs +0 -1
  99. package/dist/vendor-mdast-util-gfm-autolink-literal-B7Jk_6Zc.cjs +0 -1
  100. package/dist/vendor-mdast-util-gfm-footnote-BqZr5GmF.cjs +0 -2
  101. package/dist/vendor-mdast-util-gfm-strikethrough-DkmBmVZz.cjs +0 -1
  102. package/dist/vendor-mdast-util-gfm-table-GRkZEL2K.cjs +0 -3
  103. package/dist/vendor-mdast-util-gfm-task-list-item-COkL7umh.cjs +0 -1
  104. package/dist/vendor-mdast-util-phrasing-B3pE6Gyd.cjs +0 -1
  105. package/dist/vendor-mdast-util-to-hast-DZGTy4jY.cjs +0 -11
  106. package/dist/vendor-mdast-util-to-markdown-CFDJSkr8.cjs +0 -12
  107. package/dist/vendor-mdast-util-to-string-epeputJu.cjs +0 -1
  108. package/dist/vendor-memoize-one-DetCWhre.cjs +0 -1
  109. package/dist/vendor-micromark-QT1lJ_9G.cjs +0 -3
  110. package/dist/vendor-micromark-core-commonmark-CHMYvCou.cjs +0 -1
  111. package/dist/vendor-micromark-extension-gfm-DOHEv_Ow.cjs +0 -1
  112. package/dist/vendor-micromark-extension-gfm-autolink-literal-BIi53Rt2.cjs +0 -1
  113. package/dist/vendor-micromark-extension-gfm-footnote-CuTbB2_e.cjs +0 -1
  114. package/dist/vendor-micromark-extension-gfm-strikethrough-CcuQ-v4I.cjs +0 -1
  115. package/dist/vendor-micromark-extension-gfm-table-CoYdjDBk.cjs +0 -1
  116. package/dist/vendor-micromark-extension-gfm-tagfilter-Dyvby5gX.cjs +0 -1
  117. package/dist/vendor-micromark-extension-gfm-task-list-item-eGtf7dwN.cjs +0 -1
  118. package/dist/vendor-micromark-factory-destination-DODxvNwQ.cjs +0 -1
  119. package/dist/vendor-micromark-factory-label-DRCYHbTp.cjs +0 -1
  120. package/dist/vendor-micromark-factory-space-BxE8R4nI.cjs +0 -1
  121. package/dist/vendor-micromark-factory-title-HTScd-95.cjs +0 -1
  122. package/dist/vendor-micromark-factory-whitespace-Cfovfawt.cjs +0 -1
  123. package/dist/vendor-micromark-util-character-ThpXZ0p5.cjs +0 -1
  124. package/dist/vendor-micromark-util-chunked-CCaF1jRh.cjs +0 -1
  125. package/dist/vendor-micromark-util-classify-character-BXzv_u9-.cjs +0 -1
  126. package/dist/vendor-micromark-util-combine-extensions-ymdtWEAr.cjs +0 -1
  127. package/dist/vendor-micromark-util-decode-numeric-character-reference-sKQehvtv.cjs +0 -1
  128. package/dist/vendor-micromark-util-decode-string-Coo2FPbM.cjs +0 -1
  129. package/dist/vendor-micromark-util-encode-Dyvby5gX.cjs +0 -1
  130. package/dist/vendor-micromark-util-html-tag-name-BqwwRvi2.cjs +0 -1
  131. package/dist/vendor-micromark-util-normalize-identifier-CZzRW9lF.cjs +0 -1
  132. package/dist/vendor-micromark-util-resolve-all-B1vkj8Lj.cjs +0 -1
  133. package/dist/vendor-micromark-util-sanitize-uri-fWsohj9C.cjs +0 -1
  134. package/dist/vendor-micromark-util-subtokenize-B5hanNMp.cjs +0 -1
  135. package/dist/vendor-object-assign-5rXDT7QN.cjs +0 -1
  136. package/dist/vendor-prop-types-D7ILSZ36.cjs +0 -2
  137. package/dist/vendor-property-information-B58jd_xz.cjs +0 -1
  138. package/dist/vendor-react-CzqSQR9J.cjs +0 -14
  139. package/dist/vendor-react-circular-progressbar-BnDuoTgW.cjs +0 -6
  140. package/dist/vendor-react-datepicker-GIiaQhgI.cjs +0 -2
  141. package/dist/vendor-react-draggable-rHHMjzs1.cjs +0 -3
  142. package/dist/vendor-react-error-boundary-DUjnAjoQ.cjs +0 -1
  143. package/dist/vendor-react-fast-compare-DjJCSAPj.cjs +0 -1
  144. package/dist/vendor-react-google-autocomplete-Du5iErAd.cjs +0 -2
  145. package/dist/vendor-react-hook-form-DowHtP8_.cjs +0 -1
  146. package/dist/vendor-react-is-DK4cIQ7j.cjs +0 -1
  147. package/dist/vendor-react-lottie-player-Cwb-Xhoz.cjs +0 -1
  148. package/dist/vendor-react-lottie-player-DcNoEdGF.js +0 -155
  149. package/dist/vendor-react-markdown-sVAdj9xV.cjs +0 -1
  150. package/dist/vendor-react-merge-refs-Daoz85kW.cjs +0 -1
  151. package/dist/vendor-react-number-format-QGmN0d2v.cjs +0 -7
  152. package/dist/vendor-react-onclickoutside-CjoT6SX4.cjs +0 -1
  153. package/dist/vendor-react-phone-number-input-BBnFN-wD.cjs +0 -4
  154. package/dist/vendor-react-popper-DEi6sOBD.cjs +0 -1
  155. package/dist/vendor-react-select-DufBhudz.cjs +0 -4
  156. package/dist/vendor-react-virtualized-auto-sizer-DS8s5Nqf.cjs +0 -1
  157. package/dist/vendor-react-vtree-CtDSz2Mv.cjs +0 -1
  158. package/dist/vendor-react-webcam-CPpkXthK.cjs +0 -1
  159. package/dist/vendor-react-window-CuU_qzaW.cjs +0 -1
  160. package/dist/vendor-react-window-infinite-loader-CdyCIjx6.cjs +0 -1
  161. package/dist/vendor-remark-gfm-Bou12kJi.cjs +0 -1
  162. package/dist/vendor-remark-parse-BYKtvo5n.cjs +0 -1
  163. package/dist/vendor-remark-rehype-CuqXXG-2.cjs +0 -1
  164. package/dist/vendor-rfdc-sZ2eP5eF.cjs +0 -1
  165. package/dist/vendor-simple-swizzle-BNELyqz6.cjs +0 -1
  166. package/dist/vendor-space-separated-tokens-0etuzMC1.cjs +0 -1
  167. package/dist/vendor-style-to-js-CUjGi3ge.cjs +0 -1
  168. package/dist/vendor-style-to-object--fzklQoy.cjs +0 -1
  169. package/dist/vendor-trim-lines-BO73c4j-.cjs +0 -1
  170. package/dist/vendor-trough-CZIkZM5d.cjs +0 -1
  171. package/dist/vendor-unified-hdBFtaBE.cjs +0 -1
  172. package/dist/vendor-unist-util-is-C5fG5pIe.cjs +0 -1
  173. package/dist/vendor-unist-util-position-DsgljCtl.cjs +0 -1
  174. package/dist/vendor-unist-util-stringify-position-DfmUoPWR.cjs +0 -1
  175. package/dist/vendor-unist-util-visit-Cyg51Aas.cjs +0 -1
  176. package/dist/vendor-unist-util-visit-parents-BFfGpcYZ.cjs +0 -1
  177. package/dist/vendor-us-bank-account-validator-DOz5Vc9n.cjs +0 -1
  178. package/dist/vendor-use-isomorphic-layout-effect-CkGv31zs.cjs +0 -1
  179. package/dist/vendor-use-resize-observer-FgrE0mfc.cjs +0 -1
  180. package/dist/vendor-utils-CN5UYrS0.cjs +0 -1
  181. package/dist/vendor-vfile-DagMcMZP.cjs +0 -1
  182. package/dist/vendor-vfile-message-DB4fwBOw.cjs +0 -1
  183. package/dist/vendor-warning-FOT2NNRo.cjs +0 -1
  184. package/dist/vendor-zwitch-Dyvby5gX.cjs +0 -1
@@ -0,0 +1,700 @@
1
+ import { j as e } from "./vendor-react-DRsGZW4u.js";
2
+ import { useRef as $, useCallback as I, useState as f, useEffect as A } from "react";
3
+ import x from "@emotion/styled";
4
+ import { $generateHtmlFromNodes as gt, $generateNodesFromDOM as bt } from "@lexical/html";
5
+ import { AutoLinkNode as ft, LinkNode as ht, $isLinkNode as P, TOGGLE_LINK_COMMAND as H } from "@lexical/link";
6
+ import { ListNode as nt, ListItemNode as xt, $isListNode as Nt, INSERT_UNORDERED_LIST_COMMAND as Et, REMOVE_LIST_COMMAND as kt } from "@lexical/list";
7
+ import { LexicalComposer as yt } from "@lexical/react/LexicalComposer";
8
+ import { useLexicalComposerContext as st } from "@lexical/react/LexicalComposerContext";
9
+ import { ContentEditable as Ct } from "@lexical/react/LexicalContentEditable";
10
+ import jt from "@lexical/react/LexicalErrorBoundary";
11
+ import { HistoryPlugin as Tt } from "@lexical/react/LexicalHistoryPlugin";
12
+ import { LinkPlugin as vt } from "@lexical/react/LexicalLinkPlugin";
13
+ import { ListPlugin as Lt } from "@lexical/react/LexicalListPlugin";
14
+ import { RichTextPlugin as $t } from "@lexical/react/LexicalRichTextPlugin";
15
+ import { HeadingNode as At, QuoteNode as Rt, $isHeadingNode as St } from "@lexical/rich-text";
16
+ import { $isParentElementRTL as Dt, $isAtNodeEnd as W } from "@lexical/selection";
17
+ import { $getNearestNodeOfType as Ot, mergeRegister as rt } from "@lexical/utils";
18
+ import { useTheme as Mt } from "@mui/material/styles";
19
+ import { $getSelection as at, $isRangeSelection as lt, SELECTION_CHANGE_COMMAND as ct, CAN_UNDO_COMMAND as _t, CAN_REDO_COMMAND as wt, FORMAT_TEXT_COMMAND as B, FORMAT_ELEMENT_COMMAND as M, INDENT_CONTENT_COMMAND as It, OUTDENT_CONTENT_COMMAND as Pt, UNDO_COMMAND as Bt, REDO_COMMAND as Ht, $getRoot as K, $createParagraphNode as Ut } from "lexical";
20
+ import { createPortal as Ft } from "react-dom";
21
+ import { cc as zt, ce as Wt, cd as Kt, af as Gt, fs as r, i$ as U, fB as Vt, gF as p, gq as Xt, dC as Qt, hz as Yt, g4 as qt, aP as Jt } from "./SessionTimeoutPopup-BMerO3g4.js";
22
+ import { t as Zt, E as te, C as ee, a as oe, P as ie, L as ne, S as se, d as re, l as ae, g as le, h as ce, f as de, b as me, k as pe, e as ue, c as ge, i as be, j as fe } from "./underline-BNKkE4Fr.js";
23
+ const he = (t) => t.replace(zt, "&").replace(Wt, "<").replace(Kt, ">"), xe = /* @__PURE__ */ new Set([
24
+ "ADDRESS",
25
+ "ARTICLE",
26
+ "ASIDE",
27
+ "BLOCKQUOTE",
28
+ "DD",
29
+ "DIV",
30
+ "DL",
31
+ "DT",
32
+ "FIGURE",
33
+ "FOOTER",
34
+ "H1",
35
+ "H2",
36
+ "H3",
37
+ "H4",
38
+ "H5",
39
+ "H6",
40
+ "HEADER",
41
+ "LI",
42
+ "MAIN",
43
+ "NAV",
44
+ "OL",
45
+ "P",
46
+ "PRE",
47
+ "SECTION",
48
+ "TABLE",
49
+ "TBODY",
50
+ "TD",
51
+ "TFOOT",
52
+ "TH",
53
+ "THEAD",
54
+ "TR",
55
+ "UL"
56
+ ]), _ = (t) => t != null && t.nodeType === Node.ELEMENT_NODE && xe.has(t.tagName), Ne = (t) => {
57
+ const { previousSibling: o, nextSibling: i } = t, s = o == null || _(o), n = i == null || _(i);
58
+ return s && n && (_(o) || _(i));
59
+ }, Ee = (t) => {
60
+ const o = t.createTreeWalker(t.body, NodeFilter.SHOW_TEXT), i = [];
61
+ let s = o.nextNode();
62
+ for (; s != null; )
63
+ i.push(s), s = o.nextNode();
64
+ i.forEach((n) => {
65
+ if (n.parentNode == null || n.textContent == null)
66
+ return;
67
+ const a = n.textContent.replace(Gt, `
68
+ `);
69
+ if (!a.includes(`
70
+ `) || a.trim() === "" && Ne(n))
71
+ return;
72
+ const c = t.createDocumentFragment();
73
+ a.split(`
74
+ `).forEach((d, g) => {
75
+ g > 0 && c.appendChild(t.createElement("br")), d !== "" && c.appendChild(t.createTextNode(d));
76
+ }), n.parentNode.replaceChild(c, n);
77
+ });
78
+ }, ke = 200, ye = (t, o) => {
79
+ if (t.delete(o), t.add(o), t.size > ke) {
80
+ const i = t.values().next().value;
81
+ i != null && t.delete(i);
82
+ }
83
+ }, Ce = (t, o, i) => t !== o && !i.has(t), w = 1, {
84
+ taskManagement: {
85
+ taskDetail: { descriptionEditorTooltip: k }
86
+ },
87
+ common: {
88
+ texts: {
89
+ bold: G,
90
+ italic: V,
91
+ underline: X,
92
+ link: Q,
93
+ bulletList: Y,
94
+ indent: q,
95
+ outdent: J,
96
+ undo: Z,
97
+ redo: tt
98
+ }
99
+ }
100
+ } = Yt.getLocalizedStrings();
101
+ function et(t, o) {
102
+ o === null ? (t.style.opacity = "0", t.style.top = "-1000px", t.style.left = "-1000px") : (t.style.opacity = "1", t.style.top = `${o.top + o.height + window.pageYOffset + 10}px`, t.style.left = `${o.left + window.pageXOffset - t.offsetWidth / 2 + o.width / 2}px`);
103
+ }
104
+ function dt(t) {
105
+ const o = t.anchor, i = t.focus, s = t.anchor.getNode(), n = t.focus.getNode();
106
+ return s === n ? s : t?.isBackward() ? W(i) ? s : n : W(o) ? n : s;
107
+ }
108
+ function je({ editor: t }) {
109
+ const o = Mt(), i = $(null), s = $(null), n = $(!1), [a, c] = f(""), [d, g] = f(!1), [j, N] = f(null), b = I(() => {
110
+ const l = at();
111
+ if (lt(l)) {
112
+ const C = dt(l), h = C.getParent();
113
+ P(h) ? c(h.getURL()) : P(C) ? c(C.getURL()) : c("");
114
+ }
115
+ const R = i.current, y = window.getSelection(), S = document.activeElement;
116
+ if (R === null)
117
+ return;
118
+ const T = t.getRootElement();
119
+ if (l !== null && y != null && !y.isCollapsed && T !== null && T.contains(y.anchorNode)) {
120
+ const C = y.getRangeAt(0);
121
+ let h;
122
+ if (y.anchorNode === T) {
123
+ let v = T;
124
+ for (; v.firstElementChild != null; )
125
+ v = v.firstElementChild;
126
+ h = v.getBoundingClientRect();
127
+ } else
128
+ h = C.getBoundingClientRect();
129
+ n.current || et(R, h), N(l);
130
+ } else (!S || S.className !== "link-input") && (et(R, null), N(null), g(!1), c(""));
131
+ return !0;
132
+ }, [t]);
133
+ return A(() => rt(
134
+ t.registerUpdateListener(({ editorState: l }) => {
135
+ l.read(() => {
136
+ b();
137
+ });
138
+ }),
139
+ t.registerCommand(
140
+ ct,
141
+ () => (b(), !0),
142
+ w
143
+ )
144
+ ), [t, b]), A(() => {
145
+ t.getEditorState().read(() => {
146
+ b();
147
+ });
148
+ }, [t, b]), A(() => {
149
+ d && s.current != null && s.current?.focus();
150
+ }, [d]), /* @__PURE__ */ e.jsx(De, { ref: i, children: d ? /* @__PURE__ */ e.jsx(
151
+ "input",
152
+ {
153
+ ref: s,
154
+ className: "link-input",
155
+ value: a,
156
+ onChange: (l) => {
157
+ c(l.target.value);
158
+ },
159
+ onKeyDown: (l) => {
160
+ l.key === "Enter" ? (l.preventDefault(), j !== null && (a !== "" && t.dispatchCommand(H, a), g(!1))) : l.key === "Escape" && (l.preventDefault(), g(!1));
161
+ }
162
+ }
163
+ ) : /* @__PURE__ */ e.jsxs(Oe, { className: "link-input", children: [
164
+ /* @__PURE__ */ e.jsx(Me, { href: a, target: "_blank", rel: "noopener noreferrer", children: a }),
165
+ /* @__PURE__ */ e.jsx(
166
+ _e,
167
+ {
168
+ className: "link-edit",
169
+ type: "button",
170
+ tabIndex: 0,
171
+ onMouseDown: (l) => l.preventDefault(),
172
+ onClick: () => {
173
+ g(!0);
174
+ },
175
+ children: /* @__PURE__ */ e.jsx(
176
+ qt,
177
+ {
178
+ style: {
179
+ width: r.sp3,
180
+ height: r.sp3,
181
+ color: o.colors.primary
182
+ }
183
+ }
184
+ )
185
+ }
186
+ )
187
+ ] }) });
188
+ }
189
+ function Te({ onChange: t }) {
190
+ const [o] = st(), i = $(null), [s, n] = f(!1), [a, c] = f(!1), [d, g] = f("paragraph"), [, j] = f(!1), [N, b] = f(!1), [l, R] = f(!1), [y, S] = f(!1), [T, C] = f(!1), h = I(() => {
191
+ const m = at();
192
+ if (lt(m)) {
193
+ const L = m.anchor.getNode(), E = L.getKey() === "root" ? L : L.getTopLevelElementOrThrow(), D = E.getKey();
194
+ if (o.getElementByKey(D) !== null)
195
+ if (Nt(E)) {
196
+ const O = Ot(L, nt), ut = O ? O.getTag() : E.getTag();
197
+ g(ut);
198
+ } else {
199
+ const O = St(E) ? E.getTag() : E.getType();
200
+ g(O);
201
+ }
202
+ C(m.hasFormat("bold")), R(m.hasFormat("italic")), S(m.hasFormat("underline")), j(Dt(m));
203
+ const z = dt(m), pt = z.getParent();
204
+ P(pt) || P(z) ? b(!0) : b(!1);
205
+ }
206
+ }, [o]);
207
+ A(() => rt(
208
+ o.registerUpdateListener(({ editorState: m }) => {
209
+ m.read(() => {
210
+ h();
211
+ });
212
+ }),
213
+ o.registerCommand(
214
+ ct,
215
+ () => (h(), !1),
216
+ w
217
+ ),
218
+ o.registerCommand(
219
+ _t,
220
+ (m) => (n(m), !1),
221
+ w
222
+ ),
223
+ o.registerCommand(
224
+ wt,
225
+ (m) => (c(m), !1),
226
+ w
227
+ )
228
+ ), [o, h]), A(() => o.registerUpdateListener(
229
+ ({ dirtyElements: m, dirtyLeaves: L, editorState: E, tags: D }) => {
230
+ D.has("history-merge") || D.has("initial-content") || m.size === 0 && L.size === 0 || E.read(() => {
231
+ const F = gt(o, null);
232
+ t(F);
233
+ });
234
+ }
235
+ ), [o, t]);
236
+ const v = I(() => {
237
+ N ? o.dispatchCommand(H, null) : o.dispatchCommand(H, "https://");
238
+ }, [o, N]), mt = () => {
239
+ d !== "ul" ? o.dispatchCommand(Et, void 0) : o.dispatchCommand(kt, void 0);
240
+ };
241
+ return /* @__PURE__ */ e.jsxs(Se, { className: "toolbar", ref: i, children: [
242
+ /* @__PURE__ */ e.jsxs(ot, { children: [
243
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: G, children: /* @__PURE__ */ e.jsx(
244
+ u,
245
+ {
246
+ type: "button",
247
+ onClick: () => o.dispatchCommand(B, "bold"),
248
+ className: "toolbar-item spaced " + (T ? "active" : ""),
249
+ "data-testid": "task-description-editor-toolbar-bold",
250
+ "aria-label": G,
251
+ children: /* @__PURE__ */ e.jsx(se, { className: "format" })
252
+ }
253
+ ) }),
254
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: V, children: /* @__PURE__ */ e.jsx(
255
+ u,
256
+ {
257
+ type: "button",
258
+ onClick: () => o.dispatchCommand(B, "italic"),
259
+ className: "toolbar-item spaced " + (l ? "active" : ""),
260
+ "data-testid": "task-description-editor-toolbar-italic",
261
+ "aria-label": V,
262
+ children: /* @__PURE__ */ e.jsx(re, { className: "format" })
263
+ }
264
+ ) }),
265
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: X, children: /* @__PURE__ */ e.jsx(
266
+ u,
267
+ {
268
+ type: "button",
269
+ onClick: () => o.dispatchCommand(B, "underline"),
270
+ className: "toolbar-item spaced " + (y ? "active" : ""),
271
+ "data-testid": "task-description-editor-toolbar-underline",
272
+ "aria-label": X,
273
+ children: /* @__PURE__ */ e.jsx(ae, { className: "format" })
274
+ }
275
+ ) }),
276
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: Q, children: /* @__PURE__ */ e.jsx(
277
+ u,
278
+ {
279
+ type: "button",
280
+ onClick: v,
281
+ className: "toolbar-item spaced " + (N ? "active" : ""),
282
+ "data-testid": "task-description-editor-toolbar-link",
283
+ "aria-label": Q,
284
+ children: /* @__PURE__ */ e.jsx(le, { className: "format" })
285
+ }
286
+ ) }),
287
+ N && Ft(/* @__PURE__ */ e.jsx(je, { editor: o }), document.body),
288
+ /* @__PURE__ */ e.jsx(it, {}),
289
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: Y, children: /* @__PURE__ */ e.jsx(
290
+ u,
291
+ {
292
+ type: "button",
293
+ onClick: mt,
294
+ className: "toolbar-item spaced " + (d === "ul" ? "active" : ""),
295
+ "data-testid": "task-description-editor-toolbar-bulletList",
296
+ "aria-label": Y,
297
+ children: /* @__PURE__ */ e.jsx(ce, { className: "format" })
298
+ }
299
+ ) }),
300
+ /* @__PURE__ */ e.jsx(it, {}),
301
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: k.leftAlign, children: /* @__PURE__ */ e.jsx(
302
+ u,
303
+ {
304
+ type: "button",
305
+ onClick: () => o.dispatchCommand(M, "left"),
306
+ className: "toolbar-item spaced",
307
+ "data-testid": "task-description-editor-toolbar-leftAlign",
308
+ "aria-label": k.leftAlign,
309
+ children: /* @__PURE__ */ e.jsx(de, { className: "format" })
310
+ }
311
+ ) }),
312
+ /* @__PURE__ */ e.jsx(
313
+ p,
314
+ {
315
+ placement: "bottom",
316
+ title: k.centerAlign,
317
+ children: /* @__PURE__ */ e.jsx(
318
+ u,
319
+ {
320
+ type: "button",
321
+ onClick: () => o.dispatchCommand(M, "center"),
322
+ className: "toolbar-item spaced",
323
+ "data-testid": "task-description-editor-toolbar-centerAlign",
324
+ "aria-label": k.centerAlign,
325
+ children: /* @__PURE__ */ e.jsx(me, { className: "format" })
326
+ }
327
+ )
328
+ }
329
+ ),
330
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: k.rightAlign, children: /* @__PURE__ */ e.jsx(
331
+ u,
332
+ {
333
+ type: "button",
334
+ onClick: () => o.dispatchCommand(M, "right"),
335
+ className: "toolbar-item spaced",
336
+ "data-testid": "task-description-editor-toolbar-rightAlign",
337
+ "aria-label": k.rightAlign,
338
+ children: /* @__PURE__ */ e.jsx(pe, { className: "format" })
339
+ }
340
+ ) }),
341
+ /* @__PURE__ */ e.jsx(
342
+ p,
343
+ {
344
+ placement: "bottom",
345
+ title: k.justifyAlign,
346
+ children: /* @__PURE__ */ e.jsx(
347
+ u,
348
+ {
349
+ type: "button",
350
+ onClick: () => o.dispatchCommand(M, "justify"),
351
+ className: "toolbar-item",
352
+ "data-testid": "task-description-editor-toolbar-justifyAlign",
353
+ "aria-label": k.justifyAlign,
354
+ children: /* @__PURE__ */ e.jsx(ue, { className: "format" })
355
+ }
356
+ )
357
+ }
358
+ ),
359
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: q, children: /* @__PURE__ */ e.jsx(
360
+ u,
361
+ {
362
+ type: "button",
363
+ onClick: () => o.dispatchCommand(It, void 0),
364
+ className: "toolbar-item",
365
+ "data-testid": "task-description-editor-toolbar-indent",
366
+ "aria-label": q,
367
+ children: /* @__PURE__ */ e.jsx(ge, { className: "format" })
368
+ }
369
+ ) }),
370
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: J, children: /* @__PURE__ */ e.jsx(
371
+ u,
372
+ {
373
+ type: "button",
374
+ onClick: () => o.dispatchCommand(Pt, void 0),
375
+ className: "toolbar-item",
376
+ "data-testid": "task-description-editor-toolbar-outdent",
377
+ "aria-label": J,
378
+ children: /* @__PURE__ */ e.jsx(be, { className: "format" })
379
+ }
380
+ ) })
381
+ ] }),
382
+ /* @__PURE__ */ e.jsxs(ot, { children: [
383
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: Z, children: /* @__PURE__ */ e.jsx(
384
+ u,
385
+ {
386
+ type: "button",
387
+ disabled: !s,
388
+ onClick: () => o.dispatchCommand(Bt, void 0),
389
+ className: "toolbar-item spaced",
390
+ "data-testid": "task-description-editor-toolbar-undo",
391
+ "aria-label": Z,
392
+ children: /* @__PURE__ */ e.jsx(Xt, { className: "format" })
393
+ }
394
+ ) }),
395
+ /* @__PURE__ */ e.jsx(p, { placement: "bottom", title: tt, children: /* @__PURE__ */ e.jsx(
396
+ u,
397
+ {
398
+ type: "button",
399
+ disabled: !a,
400
+ onClick: () => o.dispatchCommand(Ht, void 0),
401
+ className: "toolbar-item",
402
+ "data-testid": "task-description-editor-toolbar-redo",
403
+ "aria-label": tt,
404
+ children: /* @__PURE__ */ e.jsx(fe, { className: "format" })
405
+ }
406
+ ) })
407
+ ] })
408
+ ] });
409
+ }
410
+ function ve({
411
+ emittedHtml: t,
412
+ initialValue: o
413
+ }) {
414
+ const [i] = st(), s = $(void 0);
415
+ return A(() => {
416
+ const n = o ?? "";
417
+ if (!Ce(
418
+ n,
419
+ s.current,
420
+ t
421
+ )) {
422
+ s.current = n;
423
+ return;
424
+ }
425
+ const a = s.current == null;
426
+ if (s.current = n, n.trim() === "") {
427
+ a || i.update(
428
+ () => {
429
+ const c = K();
430
+ c.clear(), c.append(Ut());
431
+ },
432
+ { tag: "initial-content" }
433
+ );
434
+ return;
435
+ }
436
+ i.update(
437
+ () => {
438
+ const c = new DOMParser(), d = n.trim(), g = d.startsWith("<p") || d.startsWith("<div") || d.startsWith("<ul") || d.startsWith("<ol") || d.startsWith("<h") ? n : `<p>${he(n)}</p>`, j = c.parseFromString(g, "text/html");
439
+ Ee(j);
440
+ const N = bt(i, j), b = K();
441
+ b.clear(), b.append(...N);
442
+ },
443
+ { tag: "initial-content" }
444
+ );
445
+ }, [i, o, t]), null;
446
+ }
447
+ const Le = {
448
+ namespace: "TaskDescriptionEditor",
449
+ onError(t) {
450
+ throw t;
451
+ },
452
+ nodes: [
453
+ At,
454
+ nt,
455
+ xt,
456
+ Rt,
457
+ ft,
458
+ ht
459
+ ],
460
+ theme: Zt
461
+ };
462
+ function no({
463
+ initialValue: t,
464
+ placeholder: o,
465
+ onChange: i
466
+ }) {
467
+ const s = $(/* @__PURE__ */ new Set()).current, n = I(
468
+ (a) => {
469
+ ye(s, a), i(a);
470
+ },
471
+ [s, i]
472
+ );
473
+ return /* @__PURE__ */ e.jsxs(yt, { initialConfig: Le, children: [
474
+ /* @__PURE__ */ e.jsx(te, {}),
475
+ /* @__PURE__ */ e.jsxs($e, { children: [
476
+ /* @__PURE__ */ e.jsx(Te, { onChange: n }),
477
+ /* @__PURE__ */ e.jsxs(Ae, { children: [
478
+ /* @__PURE__ */ e.jsx(
479
+ $t,
480
+ {
481
+ contentEditable: /* @__PURE__ */ e.jsx(Ct, { className: "task-editor-input" }),
482
+ placeholder: o != null && o !== "" ? /* @__PURE__ */ e.jsx(Re, { children: o }) : null,
483
+ ErrorBoundary: jt
484
+ }
485
+ ),
486
+ /* @__PURE__ */ e.jsx(
487
+ ve,
488
+ {
489
+ emittedHtml: s,
490
+ initialValue: t
491
+ }
492
+ ),
493
+ /* @__PURE__ */ e.jsx(ee, {}),
494
+ /* @__PURE__ */ e.jsx(oe, {}),
495
+ /* @__PURE__ */ e.jsx(Tt, {}),
496
+ /* @__PURE__ */ e.jsx(Lt, {}),
497
+ /* @__PURE__ */ e.jsx(vt, {}),
498
+ /* @__PURE__ */ e.jsx(ie, {}),
499
+ /* @__PURE__ */ e.jsx(ne, { maxDepth: 7 })
500
+ ] })
501
+ ] })
502
+ ] });
503
+ }
504
+ const $e = x(Vt)`
505
+ position: relative;
506
+ margin: ${r.sp0};
507
+ border-radius: ${r.sp2};
508
+ color: ${(t) => t.theme.colors.primary};
509
+ text-align: left;
510
+ border: 1px solid ${(t) => t.theme.colors.grey3};
511
+ overflow: hidden;
512
+ margin-bottom: ${r.sp3};
513
+
514
+ &:hover {
515
+ border: 1px solid ${(t) => t.theme.colors.primary};
516
+
517
+ .toolbar {
518
+ border-bottom: 1px solid ${(t) => t.theme.colors.primary};
519
+ }
520
+ }
521
+
522
+ &:focus-within {
523
+ border: 1px solid ${(t) => t.theme.colors.primary};
524
+
525
+ .toolbar {
526
+ border-bottom: 1px solid ${(t) => t.theme.colors.primary};
527
+ }
528
+ }
529
+
530
+ .task-editor-input {
531
+ min-height: 80px;
532
+ max-height: 240px;
533
+ overflow: auto;
534
+ resize: none;
535
+ ${U.largeRegular.css};
536
+ color: ${(t) => t.theme.colors.primary};
537
+ position: relative;
538
+ tab-size: 1;
539
+ outline: 0;
540
+ padding: ${r.sp3} 12px;
541
+
542
+ .editor__link {
543
+ color: ${(t) => t.theme.colors.link};
544
+ text-decoration: none;
545
+ }
546
+ .editor__link:hover {
547
+ text-decoration: underline;
548
+ cursor: pointer;
549
+ }
550
+ }
551
+
552
+ .task-editor-input p {
553
+ margin: 0;
554
+ }
555
+
556
+ .toolbar {
557
+ display: flex;
558
+ margin-bottom: 1px;
559
+ background: ${(t) => t.theme.colors.grey5};
560
+ padding: ${r.sp1};
561
+ border-top-left-radius: 10px;
562
+ border-top-right-radius: 10px;
563
+ vertical-align: middle;
564
+ border-bottom: 1px solid ${(t) => t.theme.colors.grey3};
565
+ justify-content: space-between;
566
+ }
567
+
568
+ .toolbar button.toolbar-item {
569
+ border: 0;
570
+ display: flex;
571
+ background: none;
572
+ border-radius: ${r.sp2};
573
+ padding: ${r.sp1};
574
+ cursor: pointer;
575
+ vertical-align: middle;
576
+ }
577
+
578
+ .toolbar button.toolbar-item:disabled {
579
+ cursor: not-allowed;
580
+ }
581
+
582
+ .toolbar button.toolbar-item.spaced {
583
+ margin-right: 2px;
584
+ }
585
+
586
+ .toolbar button.toolbar-item svg.format {
587
+ background-size: contain;
588
+ display: inline-block;
589
+ height: ${r.sp3};
590
+ width: ${r.sp3};
591
+ vertical-align: -0.25em;
592
+ display: flex;
593
+ color: ${(t) => t.theme.colors.grey1};
594
+ }
595
+
596
+ .toolbar button.toolbar-item:disabled svg.format {
597
+ opacity: 0.2;
598
+ }
599
+
600
+ .toolbar button.toolbar-item.active {
601
+ svg.format {
602
+ color: ${(t) => t.theme.colors.primary};
603
+ }
604
+ }
605
+
606
+ .toolbar .toolbar-item:hover:not([disabled]) {
607
+ svg.format {
608
+ color: ${(t) => t.theme.colors.primary};
609
+ }
610
+ }
611
+
612
+ .toolbar .divider {
613
+ width: 1px;
614
+ background-color: ${(t) => t.theme.colors.background};
615
+ margin: ${r.sp0} ${r.sp1};
616
+ }
617
+ `, Ae = x.div`
618
+ background-color: transparent;
619
+ position: relative;
620
+ `, Re = x(Qt)`
621
+ color: ${(t) => t.theme.colors.grey2};
622
+ overflow: hidden;
623
+ position: absolute;
624
+ text-overflow: ellipsis;
625
+ top: ${r.sp3};
626
+ left: 12px;
627
+ user-select: none;
628
+ display: inline-block;
629
+ pointer-events: none;
630
+ `, Se = x.div``, ot = x.div`
631
+ display: flex;
632
+ align-items: center;
633
+ gap: ${r.sp1};
634
+ `, u = x.button``, it = () => /* @__PURE__ */ e.jsx("div", { className: "divider" }), De = x.div`
635
+ position: absolute;
636
+ z-index: 10000;
637
+ top: -10000px;
638
+ left: -10000px;
639
+ margin-top: -6px;
640
+ max-width: 300px;
641
+ width: 100%;
642
+ opacity: 0;
643
+ border: 1px solid ${(t) => t.theme.colors.grey3};
644
+ background-color: ${(t) => t.theme.colors.grey5};
645
+ box-shadow: ${r.sp0} 5px 10px ${Jt.overlayLight};
646
+ border-radius: ${r.sp2};
647
+ transition: opacity 0.5s;
648
+
649
+ .link-input {
650
+ display: block;
651
+ box-sizing: border-box;
652
+ padding: ${r.sp3};
653
+ border-radius: ${r.sp3};
654
+ background-color: ${(t) => t.theme.colors.grey5};
655
+ ${U.standardRegular.css};
656
+ color: ${(t) => t.theme.colors.primary};
657
+ border: 0;
658
+ outline: 0;
659
+ position: relative;
660
+ }
661
+
662
+ button.link-edit {
663
+ display: flex;
664
+ align-items: center;
665
+ width: 35px;
666
+ position: absolute;
667
+ right: ${r.sp0};
668
+ top: ${r.sp0};
669
+ bottom: ${r.sp0};
670
+ cursor: pointer;
671
+ background: none;
672
+ border: none;
673
+ padding: 0;
674
+ margin: 0;
675
+
676
+ &:focus {
677
+ outline: none;
678
+ }
679
+ }
680
+ `, Oe = x.div`
681
+ display: flex;
682
+ align-items: center;
683
+ justify-content: space-between;
684
+ `, Me = x.a`
685
+ color: ${(t) => t.theme.colors.link};
686
+ text-decoration: none;
687
+ display: block;
688
+ white-space: nowrap;
689
+ overflow: hidden;
690
+ text-overflow: ellipsis;
691
+ margin-right: 30px;
692
+ ${U.standardRegular.css};
693
+
694
+ &:hover {
695
+ text-decoration: underline;
696
+ }
697
+ `, _e = x.button``;
698
+ export {
699
+ no as default
700
+ };