@arkitektbedriftene/fe-lib 0.4.29 → 0.4.31

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.
@@ -1,58 +1,58 @@
1
- var Ft = Object.defineProperty;
2
- var Ht = (t, r, e) => r in t ? Ft(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
- var it = (t, r, e) => (Ht(t, typeof r != "symbol" ? r + "" : r, e), e);
4
- import { createHeadlessEditor as Wt } from "@lexical/headless";
5
- import { $generateHtmlFromNodes as Ut } from "@lexical/html";
6
- import { $getRoot as U, ParagraphNode as jt, $createParagraphNode as j, $createTextNode as A, $setSelection as ft, SELECTION_CHANGE_COMMAND as P, $getSelection as T, COMMAND_PRIORITY_CRITICAL as X, $isRangeSelection as L, $isRootOrShadowRoot as Kt, FORMAT_TEXT_COMMAND as B, COMMAND_PRIORITY_LOW as w, KEY_ARROW_DOWN_COMMAND as qt, KEY_ARROW_UP_COMMAND as Yt, KEY_ESCAPE_COMMAND as mt, KEY_SPACE_COMMAND as Gt, $getNearestNodeFromDOMNode as Q, KEY_ARROW_LEFT_COMMAND as Xt, $isElementNode as Qt, COMMAND_PRIORITY_NORMAL as Jt, $isParagraphNode as Vt, COMMAND_PRIORITY_HIGH as Zt } from "lexical";
7
- import { trimTextContentFromAnchor as te, $setBlocksType as Y, $isAtNodeEnd as at } from "@lexical/selection";
8
- import { AutoLinkNode as ee, LinkNode as kt, $isLinkNode as H, TOGGLE_LINK_COMMAND as J } from "@lexical/link";
9
- import { ListNode as bt, ListItemNode as re, $isListNode as V, INSERT_UNORDERED_LIST_COMMAND as ne, INSERT_ORDERED_LIST_COMMAND as oe, INSERT_CHECK_LIST_COMMAND as vt, insertList as ie, $isListItemNode as z } from "@lexical/list";
10
- import { HeadingNode as ae, QuoteNode as le, $isHeadingNode as se, $createHeadingNode as ce, $createQuoteNode as de } from "@lexical/rich-text";
11
- import { TableNode as ue, TableRowNode as he, TableCellNode as pe, INSERT_TABLE_COMMAND as ge, $getTableCellNodeFromLexicalNode as fe, $deleteTableColumn__EXPERIMENTAL as me, $deleteTableRow__EXPERIMENTAL as ke, $insertTableColumn__EXPERIMENTAL as lt, $insertTableRow__EXPERIMENTAL as st } from "@lexical/table";
12
- import { jsx as n, jsxs as g, Fragment as K } from "react/jsx-runtime";
13
- import { createContext as be, useState as b, useRef as Z, useCallback as v, useContext as ve, useEffect as x, useMemo as Mt, useLayoutEffect as Me } from "react";
14
- import { s as Ct, D as tt, T as Tt, a as C, B as D, b as Lt, c as I, u as et, d as xt, e as Ce, f as Te, o as yt, g as Le, h as Nt, i as St, F as Et, O as wt, j as xe, k as ye, S as Ne, l as Se, m as O, n as _, p as ct, q as Ee, N as we, r as dt, t as Re, v as Rt, C as _e, w as Ie, x as ze } from "./Checkbox-0c1030b1.js";
1
+ var Gt = Object.defineProperty;
2
+ var Jt = (t, e, r) => e in t ? Gt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var st = (t, e, r) => (Jt(t, typeof e != "symbol" ? e + "" : e, r), r);
4
+ import { createHeadlessEditor as Xt } from "@lexical/headless";
5
+ import { $generateHtmlFromNodes as Qt } from "@lexical/html";
6
+ import { $getRoot as K, ParagraphNode as Vt, $createParagraphNode as q, $createTextNode as B, $setSelection as bt, SELECTION_CHANGE_COMMAND as F, $getSelection as T, COMMAND_PRIORITY_CRITICAL as Q, $isRangeSelection as L, $isRootOrShadowRoot as Zt, FORMAT_TEXT_COMMAND as D, COMMAND_PRIORITY_LOW as E, KEY_ARROW_DOWN_COMMAND as te, KEY_ARROW_UP_COMMAND as ee, KEY_ESCAPE_COMMAND as vt, KEY_SPACE_COMMAND as re, $getNearestNodeFromDOMNode as V, KEY_ARROW_LEFT_COMMAND as ne, $isElementNode as oe, COMMAND_PRIORITY_NORMAL as ie, $isParagraphNode as ae, COMMAND_PRIORITY_HIGH as le } from "lexical";
7
+ import { trimTextContentFromAnchor as se, $setBlocksType as J, $isAtNodeEnd as ct } from "@lexical/selection";
8
+ import { LinkNode as z, AutoLinkNode as Mt, $isLinkNode as U, TOGGLE_LINK_COMMAND as Z } from "@lexical/link";
9
+ import { ListNode as tt, ListItemNode as Ct, $isListNode as et, INSERT_UNORDERED_LIST_COMMAND as ce, INSERT_ORDERED_LIST_COMMAND as de, INSERT_CHECK_LIST_COMMAND as Tt, insertList as ue, $isListItemNode as O } from "@lexical/list";
10
+ import { HeadingNode as Lt, QuoteNode as xt, $isHeadingNode as he, $createHeadingNode as pe, $createQuoteNode as ge } from "@lexical/rich-text";
11
+ import { TableNode as yt, TableRowNode as Nt, TableCellNode as St, INSERT_TABLE_COMMAND as fe, $getTableCellNodeFromLexicalNode as me, $deleteTableColumn__EXPERIMENTAL as ke, $deleteTableRow__EXPERIMENTAL as be, $insertTableColumn__EXPERIMENTAL as dt, $insertTableRow__EXPERIMENTAL as ut } from "@lexical/table";
12
+ import { jsx as n, jsxs as g, Fragment as Y } from "react/jsx-runtime";
13
+ import { createContext as ve, useState as b, useRef as rt, useCallback as v, useContext as Me, useEffect as x, useMemo as wt, useLayoutEffect as Ce } from "react";
14
+ import { s as Et, D as nt, T as _t, a as C, B as P, b as Rt, c as I, u as ot, d as It, e as Te, f as Le, o as zt, g as xe, h as Ot, i as $t, F as At, O as Dt, j as ye, k as Ne, S as Se, l as we, m as $, n as R, p as ht, q as Ee, N as _e, r as pt, t as Re, v as Bt, C as Ie, w as ze, x as Oe } from "./Checkbox-0c1030b1.js";
15
15
  import "react-select";
16
- import { LexicalComposer as Oe } from "@lexical/react/LexicalComposer.js";
17
- import { RichTextPlugin as $e } from "@lexical/react/LexicalRichTextPlugin.js";
18
- import Be from "@lexical/react/LexicalErrorBoundary.js";
16
+ import { LexicalComposer as $e } from "@lexical/react/LexicalComposer.js";
17
+ import { RichTextPlugin as Ae } from "@lexical/react/LexicalRichTextPlugin.js";
18
+ import De from "@lexical/react/LexicalErrorBoundary.js";
19
19
  import { useLexicalComposerContext as y } from "@lexical/react/LexicalComposerContext.js";
20
- import { $getNearestNodeOfType as Ae, $findMatchingParent as _t, mergeRegister as rt, isHTMLElement as ut } from "@lexical/utils";
21
- import { G as h, f as De } from "./index.esm-3266b7f8.js";
22
- import { ListPlugin as Pe } from "@lexical/react/LexicalListPlugin.js";
23
- import { HistoryPlugin as Fe } from "@lexical/react/LexicalHistoryPlugin.js";
24
- import { TablePlugin as He } from "@lexical/react/LexicalTablePlugin.js";
20
+ import { $getNearestNodeOfType as Be, $findMatchingParent as Pt, mergeRegister as it, isHTMLElement as gt } from "@lexical/utils";
21
+ import { G as h, f as Pe } from "./index.esm-3266b7f8.js";
22
+ import { ListPlugin as Fe } from "@lexical/react/LexicalListPlugin.js";
23
+ import { HistoryPlugin as He } from "@lexical/react/LexicalHistoryPlugin.js";
24
+ import { TablePlugin as Ue } from "@lexical/react/LexicalTablePlugin.js";
25
25
  import { TabIndentationPlugin as We } from "@lexical/react/LexicalTabIndentationPlugin.js";
26
26
  import "react-dom";
27
27
  import "@radix-ui/react-toolbar";
28
28
  import "@radix-ui/react-dialog";
29
29
  import "@radix-ui/react-dropdown-menu";
30
30
  import "@radix-ui/react-checkbox";
31
- const Ue = ({
31
+ const je = ({
32
32
  text: t,
33
- maxChars: r,
34
- maxLines: e
33
+ maxChars: e,
34
+ maxLines: r
35
35
  }) => {
36
36
  if (t.length === 0)
37
37
  return 0;
38
- const o = typeof e == "number", i = typeof r == "number";
38
+ const o = typeof r == "number", i = typeof e == "number";
39
39
  if (!o && !i)
40
40
  return t.length;
41
41
  let l = 0, a = 0;
42
- for (; a < t.length && (!o || l < e) && (!i || a < r); )
42
+ for (; a < t.length && (!o || l < r) && (!i || a < e); )
43
43
  t[a] === `
44
44
  ` && l++, a++;
45
45
  return t.slice(0, a).length;
46
- }, je = ({
46
+ }, Ke = ({
47
47
  editor: t,
48
- maxChars: r,
49
- maxLines: e
48
+ maxChars: e,
49
+ maxLines: r
50
50
  }) => {
51
- const o = U(), i = o.getTextContent(), l = Ue({ text: i, maxChars: r, maxLines: e }), a = i.length - l, d = o.select().anchor;
52
- te(t, d, a);
51
+ const o = K(), i = o.getTextContent(), l = je({ text: i, maxChars: e, maxLines: r }), a = i.length - l, d = o.select().anchor;
52
+ se(t, d, a);
53
53
  const c = o.getLastChild();
54
- return c instanceof jt && c.getChildrenSize() === 0 && c.remove(), a;
55
- }, It = {
54
+ return c instanceof Vt && c.getChildrenSize() === 0 && c.remove(), a;
55
+ }, Ft = {
56
56
  quote: "ain-rich-text-quote",
57
57
  text: {
58
58
  bold: "ain-rich-text-bold",
@@ -64,49 +64,49 @@ const Ue = ({
64
64
  listitem: "ain-rich-text-nested-list-item"
65
65
  }
66
66
  }
67
- }, zt = (t) => t[0] === "{", Ke = (t) => t !== null && typeof t == "object" && "isEmpty" in t, qe = (t, r) => {
67
+ }, Ht = (t) => t[0] === "{", qe = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ye = (t, e) => {
68
68
  t.update(
69
69
  () => {
70
- const e = U();
71
- e.clear();
72
- const o = j();
73
- o.append(A("")), e.append(o), ft(null);
70
+ const r = K();
71
+ r.clear();
72
+ const o = q();
73
+ o.append(B("")), r.append(o), bt(null);
74
74
  },
75
75
  {
76
- tag: r
76
+ tag: e
77
77
  }
78
78
  );
79
- }, Ye = (t, r, e) => {
80
- r.update(
79
+ }, Ge = (t, e, r) => {
80
+ e.update(
81
81
  () => {
82
- const o = U();
82
+ const o = K();
83
83
  o.clear();
84
- const i = j();
85
- i.append(A(t.trim())), o.append(i), ft(null);
84
+ const i = q();
85
+ i.append(B(t.trim())), o.append(i), bt(null);
86
86
  },
87
87
  {
88
- tag: e
88
+ tag: r
89
89
  }
90
- ), r.blur();
91
- }, sn = (t, r, e) => {
90
+ ), e.blur();
91
+ }, cn = (t, e, r) => {
92
92
  let o = 0;
93
- const i = Wt({
94
- nodes: r,
93
+ const i = Xt({
94
+ nodes: e,
95
95
  editable: !1,
96
- theme: It
96
+ theme: Ft
97
97
  });
98
98
  if (t)
99
99
  try {
100
- if (typeof t == "string" && !zt(t))
100
+ if (typeof t == "string" && !Ht(t))
101
101
  i.update(() => {
102
- const a = U(), s = j();
103
- s.append(A(t.trim())), a.append(s);
102
+ const a = K(), s = q();
103
+ s.append(B(t.trim())), a.append(s);
104
104
  });
105
105
  else {
106
106
  const a = i.parseEditorState(t, () => {
107
- (e == null ? void 0 : e.maxLines) !== void 0 && (o = je({
107
+ (r == null ? void 0 : r.maxLines) !== void 0 && (o = Ke({
108
108
  editor: i,
109
- maxLines: e.maxLines
109
+ maxLines: r.maxLines
110
110
  }));
111
111
  });
112
112
  a.isEmpty() || i.setEditorState(a);
@@ -117,92 +117,134 @@ const Ue = ({
117
117
  let l = "";
118
118
  return i.update(() => {
119
119
  var a;
120
- e != null && e.updateFn && ((a = e.updateFn) == null || a.call(e)), l = Ut(i);
120
+ r != null && r.updateFn && ((a = r.updateFn) == null || a.call(r)), l = Qt(i);
121
121
  }), { html: l, trimCount: o };
122
- }, cn = [
123
- ae,
124
- le,
125
- bt,
126
- re,
127
- ee,
128
- kt,
129
- ue,
130
- he,
131
- pe
132
- ], Ot = be({ hasFocus: !1, editorRef: { current: null } }), Ge = ({ onBlur: t }) => {
133
- const [r, e] = b(!1), o = Z(null), i = v(() => {
134
- e(!0), o.current && window.clearTimeout(o.current);
122
+ };
123
+ class W extends z {
124
+ static getType() {
125
+ return "target-link";
126
+ }
127
+ static clone(e) {
128
+ return new W(
129
+ e.__url,
130
+ { rel: e.__rel, target: e.__target, title: e.__title },
131
+ e.__key
132
+ );
133
+ }
134
+ createDOM(e) {
135
+ const r = super.createDOM(e);
136
+ return r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer"), r;
137
+ }
138
+ exportJSON() {
139
+ return super.exportJSON();
140
+ }
141
+ static importJSON(e) {
142
+ return z.importJSON(e);
143
+ }
144
+ }
145
+ const dn = [
146
+ Lt,
147
+ xt,
148
+ tt,
149
+ Ct,
150
+ Mt,
151
+ z,
152
+ yt,
153
+ Nt,
154
+ St
155
+ ], un = [
156
+ Lt,
157
+ xt,
158
+ tt,
159
+ Ct,
160
+ Mt,
161
+ z,
162
+ yt,
163
+ Nt,
164
+ St,
165
+ W,
166
+ {
167
+ replace: z,
168
+ with: (t) => new W(
169
+ t.getURL(),
170
+ { rel: t.__rel, target: t.__target, title: t.__title },
171
+ t.getKey()
172
+ )
173
+ }
174
+ ], Ut = ve({ hasFocus: !1, editorRef: { current: null } }), Je = ({ onBlur: t }) => {
175
+ const [e, r] = b(!1), o = rt(null), i = v(() => {
176
+ r(!0), o.current && window.clearTimeout(o.current);
135
177
  }, []), l = v(() => {
136
178
  o.current = window.setTimeout(() => {
137
- e(!1), t == null || t();
179
+ r(!1), t == null || t();
138
180
  }, 0);
139
181
  }, [t]);
140
182
  return {
141
- hasFocus: r,
183
+ hasFocus: e,
142
184
  attributes: {
143
185
  onFocus: i,
144
186
  onBlur: l
145
187
  }
146
188
  };
147
- }, nt = () => ve(Ot);
189
+ }, at = () => Me(Ut);
148
190
  function Xe(t) {
149
191
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" } }, { tag: "path", attr: { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" } }] })(t);
150
192
  }
151
193
  function Qe(t) {
152
194
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
153
195
  }
154
- function Je(t) {
196
+ function Ve(t) {
155
197
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 18v-8l-2 2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
156
198
  }
157
- function Ve(t) {
199
+ function Ze(t) {
158
200
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
159
201
  }
160
- function Ze(t) {
202
+ function tr(t) {
161
203
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 -2 -2" } }, { tag: "path", attr: { d: "M17 16a2 2 0 1 0 2 -2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
162
204
  }
163
- function tr(t) {
205
+ function er(t) {
164
206
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M20 18v-8l-4 6h5" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
165
207
  }
166
- function er(t) {
208
+ function rr(t) {
167
209
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 18h2a2 2 0 1 0 0 -4h-2v-4h4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
168
210
  }
169
- function rr(t) {
211
+ function nr(t) {
170
212
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z" } }, { tag: "path", attr: { d: "M21 12a2 2 0 1 0 -4 0v4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
171
213
  }
172
- function nr(t) {
214
+ function or(t) {
173
215
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
174
216
  }
175
- function or(t) {
217
+ function ir(t) {
176
218
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0" } }, { tag: "path", attr: { d: "M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5" } }, { tag: "path", attr: { d: "M3 13h7" } }, { tag: "path", attr: { d: "M21 12v7" } }] })(t);
177
219
  }
178
- function ir(t) {
220
+ function ar(t) {
179
221
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" } }, { tag: "path", attr: { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" } }] })(t);
180
222
  }
181
- function ar(t) {
223
+ function lr(t) {
182
224
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M3.5 5.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 11.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 17.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M11 6l9 0" } }, { tag: "path", attr: { d: "M11 12l9 0" } }, { tag: "path", attr: { d: "M11 18l9 0" } }] })(t);
183
225
  }
184
- function lr(t) {
226
+ function sr(t) {
185
227
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 6h9" } }, { tag: "path", attr: { d: "M11 12h9" } }, { tag: "path", attr: { d: "M12 18h8" } }, { tag: "path", attr: { d: "M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" } }, { tag: "path", attr: { d: "M6 10v-6l-2 2" } }] })(t);
186
228
  }
187
- function sr(t) {
229
+ function cr(t) {
188
230
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M9 6l11 0" } }, { tag: "path", attr: { d: "M9 12l11 0" } }, { tag: "path", attr: { d: "M9 18l11 0" } }, { tag: "path", attr: { d: "M5 6l0 .01" } }, { tag: "path", attr: { d: "M5 12l0 .01" } }, { tag: "path", attr: { d: "M5 18l0 .01" } }] })(t);
189
231
  }
190
- function cr(t) {
232
+ function dr(t) {
191
233
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }, { tag: "path", attr: { d: "M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }] })(t);
192
234
  }
193
- function dr(t) {
235
+ function ur(t) {
194
236
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M5 7l8 10m-8 0l8 -10" } }, { tag: "path", attr: { d: "M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2" } }] })(t);
195
237
  }
196
- function ur(t) {
238
+ function hr(t) {
197
239
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" } }, { tag: "path", attr: { d: "M4 10l16 0" } }, { tag: "path", attr: { d: "M10 4l0 16" } }] })(t);
198
240
  }
199
- function hr(t) {
241
+ function pr(t) {
200
242
  return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
201
243
  }
202
- const pr = Ct("div", {
244
+ const gr = Et("div", {
203
245
  width: "10rem",
204
246
  display: "flex"
205
- }), $t = {
247
+ }), Wt = {
206
248
  bullet: "Punktliste",
207
249
  h1: "Overskrift 1",
208
250
  h2: "Overskrift 2",
@@ -214,24 +256,24 @@ const pr = Ct("div", {
214
256
  paragraph: "Normal",
215
257
  quote: "Sitat",
216
258
  check: "Avkrysningsliste"
217
- }, gr = {
218
- bullet: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
219
- h1: /* @__PURE__ */ n(Je, { size: "1.25rem" }),
220
- h2: /* @__PURE__ */ n(Ve, { size: "1.25rem" }),
221
- h3: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
222
- h4: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
223
- h5: /* @__PURE__ */ n(er, { size: "1.25rem" }),
224
- h6: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
225
- number: /* @__PURE__ */ n(lr, { size: "1.25rem" }),
226
- check: /* @__PURE__ */ n(ar, { size: "1.25rem" }),
227
- paragraph: /* @__PURE__ */ n(or, { size: "1.25rem" }),
228
- quote: /* @__PURE__ */ n(cr, { size: "1.25rem" })
259
+ }, fr = {
260
+ bullet: /* @__PURE__ */ n(cr, { size: "1.25rem" }),
261
+ h1: /* @__PURE__ */ n(Ve, { size: "1.25rem" }),
262
+ h2: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
263
+ h3: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
264
+ h4: /* @__PURE__ */ n(er, { size: "1.25rem" }),
265
+ h5: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
266
+ h6: /* @__PURE__ */ n(nr, { size: "1.25rem" }),
267
+ number: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
268
+ check: /* @__PURE__ */ n(lr, { size: "1.25rem" }),
269
+ paragraph: /* @__PURE__ */ n(ir, { size: "1.25rem" }),
270
+ quote: /* @__PURE__ */ n(dr, { size: "1.25rem" })
229
271
  }, M = ({
230
272
  blockType: t
231
- }) => /* @__PURE__ */ g(K, { children: [
232
- /* @__PURE__ */ n(D, { css: { display: "flex", flex: "0 0 auto" }, children: gr[t] }),
273
+ }) => /* @__PURE__ */ g(Y, { children: [
274
+ /* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children: fr[t] }),
233
275
  /* @__PURE__ */ n(
234
- D,
276
+ P,
235
277
  {
236
278
  css: {
237
279
  flex: "1 1 auto",
@@ -239,69 +281,69 @@ const pr = Ct("div", {
239
281
  textOverflow: "ellipsis",
240
282
  whiteSpace: "nowrap"
241
283
  },
242
- children: $t[t]
284
+ children: Wt[t]
243
285
  }
244
286
  )
245
- ] }), fr = (t) => {
287
+ ] }), mr = (t) => {
246
288
  if (!L(t))
247
289
  return null;
248
- const r = t.anchor.getNode();
249
- let e = r.getKey() === "root" ? r : _t(r, (o) => {
290
+ const e = t.anchor.getNode();
291
+ let r = e.getKey() === "root" ? e : Pt(e, (o) => {
250
292
  const i = o.getParent();
251
- return i !== null && Kt(i);
293
+ return i !== null && Zt(i);
252
294
  });
253
- return e === null && (e = r.getTopLevelElementOrThrow()), {
254
- anchorNode: r,
255
- element: e
295
+ return r === null && (r = e.getTopLevelElementOrThrow()), {
296
+ anchorNode: e,
297
+ element: r
256
298
  };
257
- }, mr = () => {
258
- const [t] = y(), [r, e] = b("paragraph");
299
+ }, kr = () => {
300
+ const [t] = y(), [e, r] = b("paragraph");
259
301
  x(() => t.registerCommand(
260
- P,
302
+ F,
261
303
  () => {
262
- const c = T(), f = fr(c);
304
+ const c = T(), f = mr(c);
263
305
  if (!f)
264
306
  return !1;
265
- const { element: u, anchorNode: m } = f, E = u.getKey();
266
- if (t.getElementByKey(E) !== null)
267
- if (V(u)) {
268
- const k = Ae(
307
+ const { element: u, anchorNode: m } = f, w = u.getKey();
308
+ if (t.getElementByKey(w) !== null)
309
+ if (et(u)) {
310
+ const k = Be(
269
311
  m,
270
- bt
312
+ tt
271
313
  ), S = k ? k.getListType() : u.getListType();
272
- e(S);
314
+ r(S);
273
315
  } else {
274
- const k = se(u) ? u.getTag() : u.getType();
275
- k in $t && e(k);
316
+ const k = he(u) ? u.getTag() : u.getType();
317
+ k in Wt && r(k);
276
318
  }
277
319
  return !1;
278
320
  },
279
- X
321
+ Q
280
322
  ), [t]);
281
323
  const o = (c) => {
282
- r !== c && t.update(() => {
324
+ e !== c && t.update(() => {
283
325
  const f = T();
284
- L(f) && (Y(f, () => ce(c)), e(c));
326
+ L(f) && (J(f, () => pe(c)), r(c));
285
327
  });
286
328
  };
287
- return /* @__PURE__ */ n(pr, { children: /* @__PURE__ */ g(
288
- tt,
329
+ return /* @__PURE__ */ n(gr, { children: /* @__PURE__ */ g(
330
+ nt,
289
331
  {
290
332
  trigger: /* @__PURE__ */ n(
291
- Tt,
333
+ _t,
292
334
  {
293
335
  dropdown: !0,
294
336
  css: { display: "flex", width: "100%", overflow: "hidden" },
295
- children: /* @__PURE__ */ n(M, { blockType: r })
337
+ children: /* @__PURE__ */ n(M, { blockType: e })
296
338
  }
297
339
  ),
298
340
  side: "bottom",
299
341
  align: "start",
300
342
  children: [
301
343
  /* @__PURE__ */ n(C, { onClick: () => {
302
- r !== "paragraph" && t.update(() => {
344
+ e !== "paragraph" && t.update(() => {
303
345
  const c = T();
304
- L(c) && (Y(c, () => j()), e("paragraph"));
346
+ L(c) && (J(c, () => q()), r("paragraph"));
305
347
  });
306
348
  }, children: /* @__PURE__ */ n(M, { blockType: "paragraph" }) }),
307
349
  /* @__PURE__ */ n(C, { onClick: () => o("h1"), children: /* @__PURE__ */ n(M, { blockType: "h1" }) }),
@@ -311,33 +353,33 @@ const pr = Ct("div", {
311
353
  /* @__PURE__ */ n(C, { onClick: () => o("h5"), children: /* @__PURE__ */ n(M, { blockType: "h5" }) }),
312
354
  /* @__PURE__ */ n(C, { onClick: () => o("h6"), children: /* @__PURE__ */ n(M, { blockType: "h6" }) }),
313
355
  /* @__PURE__ */ n(C, { onClick: () => {
314
- r !== "bullet" && (t.dispatchCommand(ne, void 0), e("bullet"));
356
+ e !== "bullet" && (t.dispatchCommand(ce, void 0), r("bullet"));
315
357
  }, children: /* @__PURE__ */ n(M, { blockType: "bullet" }) }),
316
358
  /* @__PURE__ */ n(C, { onClick: () => {
317
- r !== "number" && (t.dispatchCommand(oe, void 0), e("number"));
359
+ e !== "number" && (t.dispatchCommand(de, void 0), r("number"));
318
360
  }, children: /* @__PURE__ */ n(M, { blockType: "number" }) }),
319
361
  /* @__PURE__ */ n(C, { onClick: () => {
320
- r !== "check" && (t.dispatchCommand(vt, void 0), e("check"));
362
+ e !== "check" && (t.dispatchCommand(Tt, void 0), r("check"));
321
363
  }, children: /* @__PURE__ */ n(M, { blockType: "check" }) }),
322
364
  /* @__PURE__ */ n(C, { onClick: () => {
323
- r !== "quote" && t.update(() => {
365
+ e !== "quote" && t.update(() => {
324
366
  const c = T();
325
- L(c) && (Y(c, () => de()), e("quote"));
367
+ L(c) && (J(c, () => ge()), r("quote"));
326
368
  });
327
369
  }, children: /* @__PURE__ */ n(M, { blockType: "quote" }) })
328
370
  ]
329
371
  }
330
372
  ) });
331
- }, kr = () => {
332
- const [t] = y(), [r, e] = b(!1), [o, i] = b(!1), [l, a] = b(!1), [s, d] = b(!1), [c, f] = b(!1), u = v(() => {
373
+ }, br = () => {
374
+ const [t] = y(), [e, r] = b(!1), [o, i] = b(!1), [l, a] = b(!1), [s, d] = b(!1), [c, f] = b(!1), u = v(() => {
333
375
  const p = T();
334
- L(p) && (e(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
376
+ L(p) && (r(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
335
377
  }, []);
336
- x(() => rt(
378
+ x(() => it(
337
379
  t.registerCommand(
338
- P,
380
+ F,
339
381
  () => (u(), !1),
340
- X
382
+ Q
341
383
  ),
342
384
  t.registerUpdateListener(({ editorState: p }) => {
343
385
  p.read(() => {
@@ -346,30 +388,30 @@ const pr = Ct("div", {
346
388
  })
347
389
  ), [t, u]);
348
390
  const m = v(
349
- () => t.dispatchCommand(B, "bold"),
391
+ () => t.dispatchCommand(D, "bold"),
350
392
  [t]
351
- ), E = v(
352
- () => t.dispatchCommand(B, "italic"),
393
+ ), w = v(
394
+ () => t.dispatchCommand(D, "italic"),
353
395
  [t]
354
396
  ), N = v(
355
- () => t.dispatchCommand(B, "underline"),
397
+ () => t.dispatchCommand(D, "underline"),
356
398
  [t]
357
399
  ), k = v(
358
- () => t.dispatchCommand(B, "code"),
400
+ () => t.dispatchCommand(D, "code"),
359
401
  [t]
360
402
  ), S = v(
361
- () => t.dispatchCommand(B, "superscript"),
403
+ () => t.dispatchCommand(D, "superscript"),
362
404
  [t]
363
- ), $ = Mt(() => {
405
+ ), A = wt(() => {
364
406
  const p = [];
365
- return r && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
366
- }, [r, o, l, s, c]);
407
+ return e && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
408
+ }, [e, o, l, s, c]);
367
409
  return /* @__PURE__ */ g(
368
- Lt,
410
+ Rt,
369
411
  {
370
412
  type: "multiple",
371
413
  "aria-label": "Tekstformattering",
372
- value: $,
414
+ value: A,
373
415
  children: [
374
416
  /* @__PURE__ */ n(
375
417
  I,
@@ -383,10 +425,10 @@ const pr = Ct("div", {
383
425
  /* @__PURE__ */ n(
384
426
  I,
385
427
  {
386
- onClick: E,
428
+ onClick: w,
387
429
  title: "Kursiv tekst",
388
430
  value: "italic",
389
- children: /* @__PURE__ */ n(nr, { size: "1.25rem" })
431
+ children: /* @__PURE__ */ n(or, { size: "1.25rem" })
390
432
  }
391
433
  ),
392
434
  /* @__PURE__ */ n(
@@ -395,7 +437,7 @@ const pr = Ct("div", {
395
437
  onClick: N,
396
438
  title: "Understreket tekst",
397
439
  value: "underline",
398
- children: /* @__PURE__ */ n(hr, { size: "1.25rem" })
440
+ children: /* @__PURE__ */ n(pr, { size: "1.25rem" })
399
441
  }
400
442
  ),
401
443
  /* @__PURE__ */ n(
@@ -413,46 +455,46 @@ const pr = Ct("div", {
413
455
  onClick: S,
414
456
  title: "Superscript",
415
457
  value: "superscript",
416
- children: /* @__PURE__ */ n(dr, { size: "1.25rem" })
458
+ children: /* @__PURE__ */ n(ur, { size: "1.25rem" })
417
459
  }
418
460
  )
419
461
  ]
420
462
  }
421
463
  );
422
- }, br = ({ children: t }) => {
423
- const { hasFocus: r, editorRef: e } = nt(), o = r, [i, l] = b(o);
424
- Me(() => {
464
+ }, vr = ({ children: t }) => {
465
+ const { hasFocus: e, editorRef: r } = at(), o = e, [i, l] = b(o);
466
+ Ce(() => {
425
467
  l(o);
426
468
  }, [o]);
427
- const { context: a, refs: s, floatingStyles: d } = et({
469
+ const { context: a, refs: s, floatingStyles: d } = ot({
428
470
  placement: "top",
429
- whileElementsMounted: xt,
471
+ whileElementsMounted: It,
430
472
  middleware: [
431
- Ce({
473
+ Te({
432
474
  apply: ({ rects: f, elements: u }) => {
433
475
  u.floating.style.minWidth = `${f.reference.width}px`;
434
476
  }
435
477
  }),
436
- Te(),
437
- yt({
478
+ Le(),
479
+ zt({
438
480
  mainAxis: 8
439
481
  }),
440
- Le({
482
+ xe({
441
483
  padding: 8
442
484
  })
443
485
  ],
444
486
  open: i,
445
487
  onOpenChange: l,
446
488
  elements: {
447
- reference: e.current
489
+ reference: r.current
448
490
  }
449
- }), { getFloatingProps: c } = Nt([
450
- St(a, {
491
+ }), { getFloatingProps: c } = Ot([
492
+ $t(a, {
451
493
  role: "dialog"
452
494
  })
453
495
  ]);
454
- return i ? /* @__PURE__ */ n(Et, { children: /* @__PURE__ */ n(
455
- wt,
496
+ return i ? /* @__PURE__ */ n(At, { children: /* @__PURE__ */ n(
497
+ Dt,
456
498
  {
457
499
  ref: s.setFloating,
458
500
  style: d,
@@ -463,187 +505,187 @@ const pr = Ct("div", {
463
505
  overflow: "hidden",
464
506
  boxShadow: "$md"
465
507
  },
466
- children: /* @__PURE__ */ n(vr, { children: t })
508
+ children: /* @__PURE__ */ n(Mr, { children: t })
467
509
  }
468
510
  ) }) : null;
469
- }, vr = ({
511
+ }, Mr = ({
470
512
  children: t,
471
- ...r
472
- }) => /* @__PURE__ */ g(xe, { "aria-label": "Formattering", ...r, children: [
473
- /* @__PURE__ */ n(mr, {}),
474
- /* @__PURE__ */ n(ye, {}),
513
+ ...e
514
+ }) => /* @__PURE__ */ g(ye, { "aria-label": "Formattering", ...e, children: [
475
515
  /* @__PURE__ */ n(kr, {}),
516
+ /* @__PURE__ */ n(Ne, {}),
517
+ /* @__PURE__ */ n(br, {}),
476
518
  t
477
519
  ] });
478
- function Mr() {
520
+ function Cr() {
479
521
  const [t] = y();
480
- return x(() => rt(
522
+ return x(() => it(
481
523
  t.registerCommand(
482
- vt,
483
- () => (ie(t, "check"), !0),
484
- w
524
+ Tt,
525
+ () => (ue(t, "check"), !0),
526
+ E
485
527
  ),
486
528
  t.registerCommand(
487
- qt,
488
- (r) => gt(r, t, !1),
489
- w
529
+ te,
530
+ (e) => kt(e, t, !1),
531
+ E
490
532
  ),
491
533
  t.registerCommand(
492
- Yt,
493
- (r) => gt(r, t, !0),
494
- w
534
+ ee,
535
+ (e) => kt(e, t, !0),
536
+ E
495
537
  ),
496
538
  t.registerCommand(
497
- mt,
498
- (r) => {
499
- if (G() != null) {
539
+ vt,
540
+ (e) => {
541
+ if (X() != null) {
500
542
  const o = t.getRootElement();
501
543
  return o != null && o.focus(), !0;
502
544
  }
503
545
  return !1;
504
546
  },
505
- w
547
+ E
506
548
  ),
507
549
  t.registerCommand(
508
- Gt,
509
- (r) => {
510
- const e = G();
511
- return e != null && t.isEditable() ? (t.update(() => {
512
- const o = Q(e);
513
- z(o) && (r.preventDefault(), o.toggleChecked());
550
+ re,
551
+ (e) => {
552
+ const r = X();
553
+ return r != null && t.isEditable() ? (t.update(() => {
554
+ const o = V(r);
555
+ O(o) && (e.preventDefault(), o.toggleChecked());
514
556
  }), !0) : !1;
515
557
  },
516
- w
558
+ E
517
559
  ),
518
560
  t.registerCommand(
519
- Xt,
520
- (r) => t.getEditorState().read(() => {
521
- const e = T();
522
- if (L(e) && e.isCollapsed()) {
523
- const { anchor: o } = e, i = o.type === "element";
561
+ ne,
562
+ (e) => t.getEditorState().read(() => {
563
+ const r = T();
564
+ if (L(r) && r.isCollapsed()) {
565
+ const { anchor: o } = r, i = o.type === "element";
524
566
  if (i || o.offset === 0) {
525
- const l = o.getNode(), a = _t(
567
+ const l = o.getNode(), a = Pt(
526
568
  l,
527
- (s) => Qt(s) && !s.isInline()
569
+ (s) => oe(s) && !s.isInline()
528
570
  );
529
- if (z(a)) {
571
+ if (O(a)) {
530
572
  const s = a.getParent();
531
- if (V(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
573
+ if (et(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
532
574
  const d = t.getElementByKey(a.__key);
533
575
  if (d != null && document.activeElement !== d)
534
- return d.focus(), r.preventDefault(), !0;
576
+ return d.focus(), e.preventDefault(), !0;
535
577
  }
536
578
  }
537
579
  }
538
580
  }
539
581
  return !1;
540
582
  }),
541
- w
583
+ E
542
584
  ),
543
- t.registerRootListener((r, e) => {
544
- r !== null && (r.addEventListener("click", ht), r.addEventListener("pointerdown", pt)), e !== null && (e.removeEventListener("click", ht), e.removeEventListener("pointerdown", pt));
585
+ t.registerRootListener((e, r) => {
586
+ e !== null && (e.addEventListener("click", ft), e.addEventListener("pointerdown", mt)), r !== null && (r.removeEventListener("click", ft), r.removeEventListener("pointerdown", mt));
545
587
  })
546
588
  ), [t]), null;
547
589
  }
548
- function Bt(t, r) {
549
- const e = t.target;
550
- if (e === null || !ut(e))
590
+ function jt(t, e) {
591
+ const r = t.target;
592
+ if (r === null || !gt(r))
551
593
  return;
552
- const o = e.firstChild;
553
- if (o != null && ut(o) && (o.tagName === "UL" || o.tagName === "OL"))
594
+ const o = r.firstChild;
595
+ if (o != null && gt(o) && (o.tagName === "UL" || o.tagName === "OL"))
554
596
  return;
555
- const i = e.parentNode;
597
+ const i = r.parentNode;
556
598
  if (!i || i.__lexicalListType !== "check")
557
599
  return;
558
- const l = t.pageX, a = e.getBoundingClientRect();
559
- (e.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && r();
600
+ const l = t.pageX, a = r.getBoundingClientRect();
601
+ (r.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && e();
560
602
  }
561
- function ht(t) {
562
- Bt(t, () => {
563
- const r = t.target, e = Cr(r);
564
- e != null && e.isEditable() && e.update(() => {
603
+ function ft(t) {
604
+ jt(t, () => {
605
+ const e = t.target, r = Tr(e);
606
+ r != null && r.isEditable() && r.update(() => {
565
607
  if (t.target) {
566
- const o = Q(r);
567
- z(o) && (r.focus(), o.toggleChecked());
608
+ const o = V(e);
609
+ O(o) && (e.focus(), o.toggleChecked());
568
610
  }
569
611
  });
570
612
  });
571
613
  }
572
- function pt(t) {
573
- Bt(t, () => {
614
+ function mt(t) {
615
+ jt(t, () => {
574
616
  t.preventDefault();
575
617
  });
576
618
  }
577
- function Cr(t) {
578
- let r = t;
579
- for (; r; ) {
580
- if (r.__lexicalEditor)
581
- return r.__lexicalEditor;
582
- r = r.parentNode;
619
+ function Tr(t) {
620
+ let e = t;
621
+ for (; e; ) {
622
+ if (e.__lexicalEditor)
623
+ return e.__lexicalEditor;
624
+ e = e.parentNode;
583
625
  }
584
626
  return null;
585
627
  }
586
- function G() {
628
+ function X() {
587
629
  const t = document.activeElement;
588
630
  return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
589
631
  t.parentNode.__lexicalListType === "check" ? t : null;
590
632
  }
591
- function Tr(t, r) {
592
- let e = r ? t.getPreviousSibling() : t.getNextSibling(), o = t;
593
- for (; e == null && z(o); )
594
- o = o.getParentOrThrow().getParent(), o != null && (e = r ? o.getPreviousSibling() : o.getNextSibling());
595
- for (; z(e); ) {
596
- const i = r ? e.getLastChild() : e.getFirstChild();
597
- if (!V(i))
598
- return e;
599
- e = r ? i.getLastChild() : i.getFirstChild();
633
+ function Lr(t, e) {
634
+ let r = e ? t.getPreviousSibling() : t.getNextSibling(), o = t;
635
+ for (; r == null && O(o); )
636
+ o = o.getParentOrThrow().getParent(), o != null && (r = e ? o.getPreviousSibling() : o.getNextSibling());
637
+ for (; O(r); ) {
638
+ const i = e ? r.getLastChild() : r.getFirstChild();
639
+ if (!et(i))
640
+ return r;
641
+ r = e ? i.getLastChild() : i.getFirstChild();
600
642
  }
601
643
  return null;
602
644
  }
603
- function gt(t, r, e) {
604
- const o = G();
605
- return o != null && r.update(() => {
606
- const i = Q(o);
607
- if (!z(i))
645
+ function kt(t, e, r) {
646
+ const o = X();
647
+ return o != null && e.update(() => {
648
+ const i = V(o);
649
+ if (!O(i))
608
650
  return;
609
- const l = Tr(i, e);
651
+ const l = Lr(i, r);
610
652
  if (l != null) {
611
653
  l.selectStart();
612
- const a = r.getElementByKey(l.__key);
654
+ const a = e.getElementByKey(l.__key);
613
655
  a != null && (t.preventDefault(), setTimeout(() => {
614
656
  a.focus();
615
657
  }, 0));
616
658
  }
617
659
  }), !1;
618
660
  }
619
- const Lr = () => /* @__PURE__ */ g(K, { children: [
620
- /* @__PURE__ */ n(Pe, {}),
621
- /* @__PURE__ */ n(He, {}),
661
+ const xr = () => /* @__PURE__ */ g(Y, { children: [
622
662
  /* @__PURE__ */ n(Fe, {}),
623
- /* @__PURE__ */ n(Mr, {}),
663
+ /* @__PURE__ */ n(Ue, {}),
664
+ /* @__PURE__ */ n(He, {}),
665
+ /* @__PURE__ */ n(Cr, {}),
624
666
  /* @__PURE__ */ n(We, {})
625
- ] }), xr = ({
667
+ ] }), yr = ({
626
668
  state: t
627
669
  }) => {
628
- const [r] = y();
670
+ const [e] = y();
629
671
  return x(() => {
630
672
  if (t)
631
673
  try {
632
- if (Ke(t)) {
633
- t.isEmpty() ? qe(r) : r.setEditorState(t);
674
+ if (qe(t)) {
675
+ t.isEmpty() ? Ye(e) : e.setEditorState(t);
634
676
  return;
635
677
  }
636
- if (typeof t == "string" && !zt(t)) {
637
- Ye(t, r);
678
+ if (typeof t == "string" && !Ht(t)) {
679
+ Ge(t, e);
638
680
  return;
639
681
  }
640
- const e = r.parseEditorState(t);
641
- e.isEmpty() || r.setEditorState(e);
642
- } catch (e) {
643
- console.error("Could not parse"), console.error(e);
682
+ const r = e.parseEditorState(t);
683
+ r.isEmpty() || e.setEditorState(r);
684
+ } catch (r) {
685
+ console.error("Could not parse"), console.error(r);
644
686
  }
645
687
  }, []), null;
646
- }, yr = Ct("div", {
688
+ }, Nr = Et("div", {
647
689
  border: "1px solid $borderDarker",
648
690
  borderRadius: "$md",
649
691
  position: "relative",
@@ -680,10 +722,10 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
680
722
  }
681
723
  }
682
724
  ]
683
- }), Nr = ({
725
+ }), Sr = ({
684
726
  isLoading: t
685
727
  }) => /* @__PURE__ */ n(
686
- D,
728
+ P,
687
729
  {
688
730
  css: {
689
731
  visibility: t ? "visible" : "hidden",
@@ -692,12 +734,12 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
692
734
  right: "1rem",
693
735
  display: "flex"
694
736
  },
695
- children: /* @__PURE__ */ n(Ne, {})
737
+ children: /* @__PURE__ */ n(Se, {})
696
738
  }
697
- ), dn = ({
739
+ ), hn = ({
698
740
  isLoading: t,
699
- children: r,
700
- placeholderText: e,
741
+ children: e,
742
+ placeholderText: r,
701
743
  nodes: o,
702
744
  plugins: i,
703
745
  toolbar: l,
@@ -708,36 +750,36 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
708
750
  defaultState: f,
709
751
  css: u
710
752
  }) => {
711
- const { hasFocus: m, attributes: E } = Ge({ onBlur: c }), N = Z(null), k = Mt(() => ({ hasFocus: m, editorRef: N }), [m]);
712
- return /* @__PURE__ */ n(Ot.Provider, { value: k, children: /* @__PURE__ */ g(
713
- Oe,
753
+ const { hasFocus: m, attributes: w } = Je({ onBlur: c }), N = rt(null), k = wt(() => ({ hasFocus: m, editorRef: N }), [m]);
754
+ return /* @__PURE__ */ n(Ut.Provider, { value: k, children: /* @__PURE__ */ g(
755
+ $e,
714
756
  {
715
757
  initialConfig: {
716
758
  namespace: "ain-rich-text",
717
759
  onError: (S) => {
718
760
  console.error(S);
719
761
  },
720
- theme: It,
762
+ theme: Ft,
721
763
  nodes: o,
722
764
  editable: !0
723
765
  },
724
766
  children: [
725
767
  /* @__PURE__ */ g(
726
- yr,
768
+ Nr,
727
769
  {
728
770
  ref: N,
729
771
  hasFocus: m,
730
772
  hideBorder: d,
731
773
  css: u,
732
- ...E,
774
+ ...w,
733
775
  children: [
734
776
  l,
735
777
  /* @__PURE__ */ n(
736
- $e,
778
+ Ae,
737
779
  {
738
780
  contentEditable: s,
739
- placeholder: e ? /* @__PURE__ */ n(
740
- D,
781
+ placeholder: r ? /* @__PURE__ */ n(
782
+ P,
741
783
  {
742
784
  css: {
743
785
  position: "absolute",
@@ -747,25 +789,25 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
747
789
  pointerEvents: "none",
748
790
  fontSize: "$sm"
749
791
  },
750
- children: e
792
+ children: r
751
793
  }
752
794
  ) : null,
753
- ErrorBoundary: Be
795
+ ErrorBoundary: De
754
796
  }
755
797
  ),
756
- /* @__PURE__ */ n(Lr, {}),
798
+ /* @__PURE__ */ n(xr, {}),
757
799
  i,
758
- /* @__PURE__ */ n(Nr, { isLoading: t }),
759
- !l && /* @__PURE__ */ n(br, { children: a })
800
+ /* @__PURE__ */ n(Sr, { isLoading: t }),
801
+ !l && /* @__PURE__ */ n(vr, { children: a })
760
802
  ]
761
803
  }
762
804
  ),
763
- /* @__PURE__ */ n(xr, { state: f }),
764
- /* @__PURE__ */ n(K, { children: r })
805
+ /* @__PURE__ */ n(yr, { state: f }),
806
+ /* @__PURE__ */ n(Y, { children: e })
765
807
  ]
766
808
  }
767
809
  ) });
768
- }, Sr = {
810
+ }, wr = {
769
811
  fontSize: "1rem",
770
812
  lineHeight: "1.5",
771
813
  "h1, h2, h3, h4, h5, h6": {
@@ -955,22 +997,22 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
955
997
  defaultVariants: {
956
998
  size: "md"
957
999
  }
958
- }, un = Se(Sr), hn = () => {
959
- const [t] = y(), r = v(() => {
960
- t.dispatchCommand(ge, {
1000
+ }, pn = we(wr), gn = () => {
1001
+ const [t] = y(), e = v(() => {
1002
+ t.dispatchCommand(fe, {
961
1003
  rows: "3",
962
1004
  columns: "3",
963
1005
  includeHeaders: !1
964
1006
  });
965
1007
  }, [t]);
966
1008
  return /* @__PURE__ */ n(
967
- tt,
1009
+ nt,
968
1010
  {
969
- trigger: /* @__PURE__ */ n(Tt, { dropdown: !0, children: "Sett inn" }),
1011
+ trigger: /* @__PURE__ */ n(_t, { dropdown: !0, children: "Sett inn" }),
970
1012
  side: "bottom",
971
1013
  align: "end",
972
- children: /* @__PURE__ */ g(C, { onClick: r, children: [
973
- /* @__PURE__ */ n(ur, { size: "1.25rem" }),
1014
+ children: /* @__PURE__ */ g(C, { onClick: e, children: [
1015
+ /* @__PURE__ */ n(hr, { size: "1.25rem" }),
974
1016
  " Tabell"
975
1017
  ] })
976
1018
  }
@@ -979,60 +1021,60 @@ const Lr = () => /* @__PURE__ */ g(K, { children: [
979
1021
  function Er(t) {
980
1022
  return h({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "circle", attr: { cx: "256", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "416", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "96", cy: "256", r: "48" } }] })(t);
981
1023
  }
982
- const pn = () => {
983
- const [t] = y(), [r, e] = b(null), { hasFocus: o } = nt();
1024
+ const fn = () => {
1025
+ const [t] = y(), [e, r] = b(null), { hasFocus: o } = at();
984
1026
  x(() => {
985
- !o && r && e(null);
986
- }, [o, r]);
987
- const { refs: i, floatingStyles: l } = et({
1027
+ !o && e && r(null);
1028
+ }, [o, e]);
1029
+ const { refs: i, floatingStyles: l } = ot({
988
1030
  placement: "top-end",
989
- open: !!r,
1031
+ open: !!e,
990
1032
  elements: {
991
- reference: r
1033
+ reference: e
992
1034
  },
993
- middleware: [yt({ mainAxis: -20, crossAxis: -2 })]
1035
+ middleware: [zt({ mainAxis: -20, crossAxis: -2 })]
994
1036
  });
995
1037
  x(() => t.registerCommand(
996
- P,
1038
+ F,
997
1039
  () => {
998
1040
  const s = T();
999
1041
  if (L(s)) {
1000
- const d = s.anchor.getNode(), c = fe(d);
1001
- e(c ? t.getElementByKey(c.getKey()) : null);
1042
+ const d = s.anchor.getNode(), c = me(d);
1043
+ r(c ? t.getElementByKey(c.getKey()) : null);
1002
1044
  }
1003
1045
  return !1;
1004
1046
  },
1005
- Jt
1047
+ ie
1006
1048
  ), [t]);
1007
1049
  const a = (s) => () => {
1008
1050
  t.update(() => {
1009
1051
  switch (s) {
1010
1052
  case "add-row-over":
1011
- st(!1);
1053
+ ut(!1);
1012
1054
  break;
1013
1055
  case "add-row-under":
1014
- st(!0);
1056
+ ut(!0);
1015
1057
  break;
1016
1058
  case "add-column-left":
1017
- lt(!1);
1059
+ dt(!1);
1018
1060
  break;
1019
1061
  case "add-column-right":
1020
- lt(!0);
1062
+ dt(!0);
1021
1063
  break;
1022
1064
  case "delete-row":
1023
- ke();
1065
+ be();
1024
1066
  break;
1025
1067
  case "delete-column":
1026
- me();
1068
+ ke();
1027
1069
  break;
1028
1070
  }
1029
1071
  });
1030
1072
  };
1031
- return r ? /* @__PURE__ */ g(
1032
- tt,
1073
+ return e ? /* @__PURE__ */ g(
1074
+ nt,
1033
1075
  {
1034
1076
  trigger: /* @__PURE__ */ n(
1035
- O,
1077
+ $,
1036
1078
  {
1037
1079
  icon: !0,
1038
1080
  variant: "primary",
@@ -1044,40 +1086,40 @@ const pn = () => {
1044
1086
  }
1045
1087
  ),
1046
1088
  children: [
1047
- /* @__PURE__ */ n(_, { onClick: a("add-row-over"), children: "Legg til rad over" }),
1048
- /* @__PURE__ */ n(_, { onClick: a("add-row-under"), children: "Legg til rad under" }),
1049
- /* @__PURE__ */ n(ct, {}),
1050
- /* @__PURE__ */ n(_, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
1051
- /* @__PURE__ */ n(_, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
1052
- /* @__PURE__ */ n(ct, {}),
1053
- /* @__PURE__ */ n(_, { onClick: a("delete-row"), children: "Fjern rad" }),
1054
- /* @__PURE__ */ n(_, { onClick: a("delete-column"), children: "Fjern kolonne" })
1089
+ /* @__PURE__ */ n(R, { onClick: a("add-row-over"), children: "Legg til rad over" }),
1090
+ /* @__PURE__ */ n(R, { onClick: a("add-row-under"), children: "Legg til rad under" }),
1091
+ /* @__PURE__ */ n(ht, {}),
1092
+ /* @__PURE__ */ n(R, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
1093
+ /* @__PURE__ */ n(R, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
1094
+ /* @__PURE__ */ n(ht, {}),
1095
+ /* @__PURE__ */ n(R, { onClick: a("delete-row"), children: "Fjern rad" }),
1096
+ /* @__PURE__ */ n(R, { onClick: a("delete-column"), children: "Fjern kolonne" })
1055
1097
  ]
1056
1098
  }
1057
1099
  ) : null;
1058
1100
  };
1059
- function At(t) {
1060
- let r = t;
1061
- const e = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, o = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
1062
- return r = String(r).trim(), r.match(e) || r.match(o) ? r : "https://";
1101
+ function Kt(t) {
1102
+ let e = t;
1103
+ const r = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, o = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
1104
+ return e = String(e).trim(), e.match(r) || e.match(o) ? e : "https://";
1063
1105
  }
1064
- function Dt(t) {
1065
- const r = t.anchor, e = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
1066
- return o === i ? o : t.isBackward() ? at(e) ? o : i : at(r) ? o : i;
1106
+ function qt(t) {
1107
+ const e = t.anchor, r = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
1108
+ return o === i ? o : t.isBackward() ? ct(r) ? o : i : ct(e) ? o : i;
1067
1109
  }
1068
- const gn = (t) => (R.baseURL = t, R), W = class extends kt {
1110
+ const mn = (t) => (_.baseURL = t, _), j = class extends z {
1069
1111
  static getType() {
1070
1112
  return "rutine_link";
1071
1113
  }
1072
- static clone(r) {
1073
- return new W(r.__url, {}, r.__key);
1114
+ static clone(e) {
1115
+ return new j(e.__url, {}, e.__key);
1074
1116
  }
1075
- createDOM(r) {
1076
- const e = super.createDOM(r);
1077
- return e.setAttribute("href", this.getURL()), e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"), e.classList.add("rutine-link"), e;
1117
+ createDOM(e) {
1118
+ const r = super.createDOM(e);
1119
+ return r.setAttribute("href", this.getURL()), r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer"), r.classList.add("rutine-link"), r;
1078
1120
  }
1079
- static importJSON(r) {
1080
- return Pt(r.url);
1121
+ static importJSON(e) {
1122
+ return Yt(e.url);
1081
1123
  }
1082
1124
  exportJSON() {
1083
1125
  return {
@@ -1089,68 +1131,68 @@ const gn = (t) => (R.baseURL = t, R), W = class extends kt {
1089
1131
  }
1090
1132
  getURL() {
1091
1133
  try {
1092
- return new URL(this.__url, W.baseURL).toString();
1134
+ return new URL(this.__url, j.baseURL).toString();
1093
1135
  } catch {
1094
1136
  return "";
1095
1137
  }
1096
1138
  }
1097
1139
  };
1098
- let R = W;
1099
- it(R, "baseURL", "");
1100
- function Pt(t) {
1101
- return new R(t);
1140
+ let _ = j;
1141
+ st(_, "baseURL", "");
1142
+ function Yt(t) {
1143
+ return new _(t);
1102
1144
  }
1103
- function wr(t) {
1104
- return t instanceof R;
1145
+ function _r(t) {
1146
+ return t instanceof _;
1105
1147
  }
1106
1148
  const Rr = ({ onClose: t }) => {
1107
- const [r] = y(), e = v(
1149
+ const [e] = y(), r = v(
1108
1150
  (i) => {
1109
- r.update(() => {
1151
+ e.update(() => {
1110
1152
  const l = T();
1111
1153
  if (L(l) && l.isCollapsed()) {
1112
1154
  const a = l.getNodes();
1113
1155
  if (a.length === 1) {
1114
1156
  const s = a[0];
1115
- Vt(s) && s.getChildren().length === 0 && l.insertText(i);
1157
+ ae(s) && s.getChildren().length === 0 && l.insertText(i);
1116
1158
  }
1117
1159
  }
1118
- }), r.dispatchCommand(J, At(i));
1160
+ }), e.dispatchCommand(Z, Kt(i));
1119
1161
  },
1120
- [r]
1162
+ [e]
1121
1163
  );
1122
1164
  return /* @__PURE__ */ g("form", { onSubmit: (i) => {
1123
- e(i.target.url.value), t();
1165
+ r(i.target.url.value), t();
1124
1166
  }, children: [
1125
1167
  /* @__PURE__ */ n(Re, { name: "url", label: "URL", type: "url", required: !0 }),
1126
- /* @__PURE__ */ g(Rt, { children: [
1127
- /* @__PURE__ */ n(O, { onClick: t, children: "Avbryt" }),
1128
- /* @__PURE__ */ n(O, { type: "submit", variant: "primary", children: "Lagre" })
1168
+ /* @__PURE__ */ g(Bt, { children: [
1169
+ /* @__PURE__ */ n($, { onClick: t, children: "Avbryt" }),
1170
+ /* @__PURE__ */ n($, { type: "submit", variant: "primary", children: "Lagre" })
1129
1171
  ] })
1130
1172
  ] });
1131
- }, _r = ({ onClose: t, getDocs: r }) => {
1132
- const [e] = y(), [o, i] = b([]), l = r(), a = v(
1173
+ }, Ir = ({ onClose: t, getDocs: e }) => {
1174
+ const [r] = y(), [o, i] = b([]), l = e(), a = v(
1133
1175
  (s) => {
1134
- e.update(() => {
1176
+ r.update(() => {
1135
1177
  const d = T();
1136
1178
  if (L(d)) {
1137
1179
  const c = [];
1138
1180
  for (const [f, u] of s.entries()) {
1139
- const m = Pt(u.value);
1140
- m.append(A(u.label)), c.push(m), f !== s.length - 1 && c.push(A(" "));
1181
+ const m = Yt(u.value);
1182
+ m.append(B(u.label)), c.push(m), f !== s.length - 1 && c.push(B(" "));
1141
1183
  }
1142
1184
  d.insertNodes(c);
1143
1185
  }
1144
1186
  });
1145
1187
  },
1146
- [e]
1188
+ [r]
1147
1189
  );
1148
- return /* @__PURE__ */ g(K, { children: [
1149
- /* @__PURE__ */ n(_e, { isMulti: !0, options: l, onChange: i }),
1150
- /* @__PURE__ */ g(Rt, { children: [
1151
- /* @__PURE__ */ n(O, { onClick: t, children: "Avbryt" }),
1190
+ return /* @__PURE__ */ g(Y, { children: [
1191
+ /* @__PURE__ */ n(Ie, { isMulti: !0, options: l, onChange: i }),
1192
+ /* @__PURE__ */ g(Bt, { children: [
1193
+ /* @__PURE__ */ n($, { onClick: t, children: "Avbryt" }),
1152
1194
  /* @__PURE__ */ n(
1153
- O,
1195
+ $,
1154
1196
  {
1155
1197
  variant: "primary",
1156
1198
  onClick: () => {
@@ -1161,48 +1203,48 @@ const Rr = ({ onClose: t }) => {
1161
1203
  )
1162
1204
  ] })
1163
1205
  ] });
1164
- }, Ir = ({
1206
+ }, zr = ({
1165
1207
  open: t,
1166
- onOpenChange: r,
1167
- getDocs: e
1208
+ onOpenChange: e,
1209
+ getDocs: r
1168
1210
  }) => {
1169
1211
  const [o, i] = b("url"), l = () => {
1170
- r(!1);
1212
+ e(!1);
1171
1213
  };
1172
- return /* @__PURE__ */ g(Ee, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
1173
- /* @__PURE__ */ g(we, { css: { marginBottom: "$8" }, children: [
1174
- /* @__PURE__ */ n(dt, { active: o === "url", onClick: () => i("url"), children: "URL" }),
1175
- /* @__PURE__ */ n(dt, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
1214
+ return /* @__PURE__ */ g(Ee, { open: t, onOpenChange: e, css: { width: "600px" }, children: [
1215
+ /* @__PURE__ */ g(_e, { css: { marginBottom: "$8" }, children: [
1216
+ /* @__PURE__ */ n(pt, { active: o === "url", onClick: () => i("url"), children: "URL" }),
1217
+ /* @__PURE__ */ n(pt, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
1176
1218
  ] }),
1177
1219
  o === "url" && /* @__PURE__ */ n(Rr, { onClose: l }),
1178
- o === "rutine" && /* @__PURE__ */ n(_r, { onClose: l, getDocs: e })
1220
+ o === "rutine" && /* @__PURE__ */ n(Ir, { onClose: l, getDocs: r })
1179
1221
  ] });
1180
- }, fn = ({ getDocs: t }) => {
1181
- const [r] = y(), [e, o] = b(!1), [i, l] = b(!1), a = v(() => {
1222
+ }, kn = ({ getDocs: t }) => {
1223
+ const [e] = y(), [r, o] = b(!1), [i, l] = b(!1), a = v(() => {
1182
1224
  const s = T();
1183
1225
  if (L(s)) {
1184
- const d = Dt(s), c = d.getParent();
1185
- o(H(c) || H(d));
1226
+ const d = qt(s), c = d.getParent();
1227
+ o(U(c) || U(d));
1186
1228
  }
1187
1229
  }, []);
1188
- return x(() => r.registerCommand(
1189
- P,
1230
+ return x(() => e.registerCommand(
1231
+ F,
1190
1232
  () => (a(), !1),
1191
- X
1192
- ), [r, a]), /* @__PURE__ */ g(Lt, { type: "single", value: e ? "link" : "", children: [
1233
+ Q
1234
+ ), [e, a]), /* @__PURE__ */ g(Rt, { type: "single", value: r ? "link" : "", children: [
1193
1235
  /* @__PURE__ */ n(
1194
1236
  I,
1195
1237
  {
1196
1238
  onClick: () => {
1197
- e ? r.dispatchCommand(J, null) : l(!0);
1239
+ r ? e.dispatchCommand(Z, null) : l(!0);
1198
1240
  },
1199
1241
  title: "Lenke",
1200
1242
  value: "link",
1201
- children: /* @__PURE__ */ n(ir, { size: "1.25rem" })
1243
+ children: /* @__PURE__ */ n(ar, { size: "1.25rem" })
1202
1244
  }
1203
1245
  ),
1204
1246
  /* @__PURE__ */ n(
1205
- Ir,
1247
+ zr,
1206
1248
  {
1207
1249
  open: i,
1208
1250
  onOpenChange: l,
@@ -1210,67 +1252,67 @@ const Rr = ({ onClose: t }) => {
1210
1252
  }
1211
1253
  )
1212
1254
  ] });
1213
- }, mn = () => {
1214
- const [t] = y(), r = Z(null), [e, o] = b(null), [i, l] = b(""), { hasFocus: a } = nt();
1255
+ }, bn = () => {
1256
+ const [t] = y(), e = rt(null), [r, o] = b(null), [i, l] = b(""), { hasFocus: a } = at();
1215
1257
  x(() => {
1216
- e ? t.update(() => {
1217
- l(e.getURL());
1258
+ r ? t.update(() => {
1259
+ l(r.getURL());
1218
1260
  }) : l("");
1219
- }, [t, e]);
1220
- const s = !!(e && i && a), { refs: d, floatingStyles: c, context: f } = et({
1261
+ }, [t, r]);
1262
+ const s = !!(r && i && a), { refs: d, floatingStyles: c, context: f } = ot({
1221
1263
  placement: "top",
1222
1264
  strategy: "fixed",
1223
1265
  open: s,
1224
- whileElementsMounted: xt,
1266
+ whileElementsMounted: It,
1225
1267
  elements: {
1226
- reference: r.current
1268
+ reference: e.current
1227
1269
  },
1228
- middleware: [Ie()]
1229
- }), { getFloatingProps: u } = Nt([
1230
- St(f),
1231
- ze(f)
1270
+ middleware: [ze()]
1271
+ }), { getFloatingProps: u } = Ot([
1272
+ $t(f),
1273
+ Oe(f)
1232
1274
  ]), m = v(() => {
1233
1275
  var S;
1234
1276
  const k = T();
1235
1277
  if (L(k)) {
1236
- const $ = Dt(k), p = $.getParent();
1237
- let F = null;
1238
- if (H(p) ? F = p : H($) && (F = $), F) {
1239
- const q = window.getSelection(), ot = t.getRootElement();
1240
- k !== null && q !== null && ot !== null && ot.contains(q.anchorNode) && t.isEditable() && (r.current = ((S = q.focusNode) == null ? void 0 : S.parentElement) ?? null);
1278
+ const A = qt(k), p = A.getParent();
1279
+ let H = null;
1280
+ if (U(p) ? H = p : U(A) && (H = A), H) {
1281
+ const G = window.getSelection(), lt = t.getRootElement();
1282
+ k !== null && G !== null && lt !== null && lt.contains(G.anchorNode) && t.isEditable() && (e.current = ((S = G.focusNode) == null ? void 0 : S.parentElement) ?? null);
1241
1283
  }
1242
- o(F);
1284
+ o(H);
1243
1285
  }
1244
- }, [t]), E = v(() => {
1245
- e && wr(e) && t.update(() => {
1246
- e.remove();
1247
- }), t.dispatchCommand(J, null);
1248
- }, [t, e]);
1286
+ }, [t]), w = v(() => {
1287
+ r && _r(r) && t.update(() => {
1288
+ r.remove();
1289
+ }), t.dispatchCommand(Z, null);
1290
+ }, [t, r]);
1249
1291
  if (x(() => {
1250
1292
  t.getEditorState().read(() => {
1251
1293
  m();
1252
1294
  });
1253
- }, [t, m]), x(() => rt(
1295
+ }, [t, m]), x(() => it(
1254
1296
  t.registerUpdateListener(({ editorState: k }) => {
1255
1297
  k.read(() => {
1256
1298
  m();
1257
1299
  });
1258
1300
  }),
1259
1301
  t.registerCommand(
1260
- P,
1302
+ F,
1261
1303
  () => (m(), !0),
1262
- w
1304
+ E
1263
1305
  ),
1264
1306
  t.registerCommand(
1265
- mt,
1266
- () => e ? (o(null), !0) : !1,
1267
- Zt
1307
+ vt,
1308
+ () => r ? (o(null), !0) : !1,
1309
+ le
1268
1310
  )
1269
- ), [t, m, e]), !s)
1311
+ ), [t, m, r]), !s)
1270
1312
  return null;
1271
- const N = At(i);
1272
- return /* @__PURE__ */ n(Et, { children: /* @__PURE__ */ g(
1273
- wt,
1313
+ const N = Kt(i);
1314
+ return /* @__PURE__ */ n(At, { children: /* @__PURE__ */ g(
1315
+ Dt,
1274
1316
  {
1275
1317
  ref: d.setFloating,
1276
1318
  css: {
@@ -1284,7 +1326,7 @@ const Rr = ({ onClose: t }) => {
1284
1326
  ...u(),
1285
1327
  children: [
1286
1328
  /* @__PURE__ */ n(
1287
- D,
1329
+ P,
1288
1330
  {
1289
1331
  as: "a",
1290
1332
  css: {
@@ -1301,32 +1343,33 @@ const Rr = ({ onClose: t }) => {
1301
1343
  children: i
1302
1344
  }
1303
1345
  ),
1304
- /* @__PURE__ */ n(O, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ n(De, { size: 24 }) })
1346
+ /* @__PURE__ */ n($, { color: "danger", icon: !0, size: "sm", onClick: w, children: /* @__PURE__ */ n(Pe, { size: 24 }) })
1305
1347
  ]
1306
1348
  }
1307
1349
  ) });
1308
1350
  };
1309
1351
  export {
1310
- Pt as $createRutineLinkNode,
1311
- wr as $isRutineLinkNode,
1312
- br as FloatingToolbar,
1313
- hn as InsertSelector,
1314
- mn as LinkEditPlugin,
1315
- fn as LinkToolbarButton,
1316
- dn as RichTextEditor,
1317
- vr as RichTextToolbar,
1318
- R as RutineLinkNode,
1319
- gn as RutineLinkNodeInit,
1320
- pn as TableEditPlugin,
1321
- qe as clearEditorState,
1322
- cn as defaultNodes,
1323
- Ke as isEditorState,
1324
- zt as isJSON,
1325
- Ot as richTextContext,
1326
- un as richTextCss,
1327
- Sr as richTextStyleObj,
1328
- Ye as setStateFromPlainText,
1329
- sn as stateToHTML,
1330
- Ge as useHasFocusWithin,
1331
- nt as useRichTextContext
1352
+ Yt as $createRutineLinkNode,
1353
+ _r as $isRutineLinkNode,
1354
+ vr as FloatingToolbar,
1355
+ gn as InsertSelector,
1356
+ bn as LinkEditPlugin,
1357
+ kn as LinkToolbarButton,
1358
+ hn as RichTextEditor,
1359
+ Mr as RichTextToolbar,
1360
+ _ as RutineLinkNode,
1361
+ mn as RutineLinkNodeInit,
1362
+ fn as TableEditPlugin,
1363
+ Ye as clearEditorState,
1364
+ dn as defaultNodes,
1365
+ un as defaultViewNodes,
1366
+ qe as isEditorState,
1367
+ Ht as isJSON,
1368
+ Ut as richTextContext,
1369
+ pn as richTextCss,
1370
+ wr as richTextStyleObj,
1371
+ Ge as setStateFromPlainText,
1372
+ cn as stateToHTML,
1373
+ Je as useHasFocusWithin,
1374
+ at as useRichTextContext
1332
1375
  };