@iamfiro/design 0.1.0 → 0.3.1

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 (160) hide show
  1. package/AGENTS.md +1 -0
  2. package/agents/INDEX.md +1 -0
  3. package/agents/brand-icon/AGENTS.md +2 -2
  4. package/agents/social-login-button/AGENTS.md +156 -0
  5. package/lib/components/Accordion/Accordion2.js +135 -0
  6. package/lib/components/ActionBar/ActionBar2.js +66 -0
  7. package/lib/components/Alert/Alert2.js +131 -0
  8. package/lib/components/AppShell/AppShell2.js +94 -0
  9. package/lib/components/AreaChart/AreaChart.js +59 -0
  10. package/lib/components/BarChart/BarChart2.js +243 -0
  11. package/lib/components/BarList/BarList2.js +172 -0
  12. package/lib/components/Breadcrumb/Breadcrumb2.js +90 -0
  13. package/lib/components/Calendar/Calendar2.js +309 -0
  14. package/lib/components/Calendar/DatePicker2.js +228 -0
  15. package/lib/components/Calendar/date.js +118 -0
  16. package/lib/components/Card/Card2.js +103 -0
  17. package/lib/components/CardFrame/CardFrame2.js +67 -0
  18. package/lib/components/Chart/ChartParts.js +150 -0
  19. package/lib/components/Chart/chart2.js +96 -0
  20. package/lib/components/Chart/useChartInteraction.js +94 -0
  21. package/lib/components/ChatBubble/ChatBubble2.js +174 -0
  22. package/lib/components/ChatBubble/formatChatTime.js +48 -0
  23. package/lib/components/ChatComposer/ChatComposer2.js +153 -0
  24. package/lib/components/CodeBlock/CodeBlock2.js +93 -0
  25. package/lib/components/CodeBlock/highlight.js +111 -0
  26. package/lib/components/ColorPicker/ColorPicker2.js +609 -0
  27. package/lib/components/ColorPicker/color.js +180 -0
  28. package/lib/components/ColorPicker/presets.js +70 -0
  29. package/lib/components/Combobox/Combobox2.js +228 -0
  30. package/lib/components/CommandMenu/CommandMenu.js +267 -0
  31. package/lib/components/Comment/Comment2.js +110 -0
  32. package/lib/components/ContextMenu/ContextMenu2.js +168 -0
  33. package/lib/components/DataGrid/DataGrid2.js +1998 -0
  34. package/lib/components/DataGrid/GridPopover.js +154 -0
  35. package/lib/components/DataGrid/anchor.js +50 -0
  36. package/lib/components/DataGrid/model.js +557 -0
  37. package/lib/components/DataGrid/panels.js +701 -0
  38. package/lib/components/DataGrid/typeMeta.js +75 -0
  39. package/lib/components/DataGrid/types.js +53 -0
  40. package/lib/components/DescriptionList/DescriptionList2.js +180 -0
  41. package/lib/components/Dialog/AlertDialog.js +119 -0
  42. package/lib/components/Dialog/Dialog2.js +110 -0
  43. package/lib/components/Dialog/modal.js +92 -0
  44. package/lib/components/Drawer/Drawer2.js +244 -0
  45. package/lib/components/DropdownMenu/DropdownMenu2.js +393 -0
  46. package/lib/components/DropdownMenu/menuCore.js +63 -0
  47. package/lib/components/Dropzone/Dropzone2.js +145 -0
  48. package/lib/components/EmptyState/EmptyState2.js +70 -0
  49. package/lib/components/FileChip/FileChip2.js +94 -0
  50. package/lib/components/FileUpload/FileUpload.js +259 -0
  51. package/lib/components/FilterChips/FilterChips2.js +101 -0
  52. package/lib/components/FunnelChart/FunnelChart2.js +283 -0
  53. package/lib/components/FunnelChart/funnel.js +72 -0
  54. package/lib/components/Highlight/Highlight2.js +100 -0
  55. package/lib/components/HoverCard/HoverCard.js +134 -0
  56. package/lib/components/InlineDiff/InlineDiff2.js +215 -0
  57. package/lib/components/InlineDiff/diff.js +126 -0
  58. package/lib/components/InlineDiff/useDiffReview.js +110 -0
  59. package/lib/components/Kanban/Kanban2.js +691 -0
  60. package/lib/components/Kanban/KanbanCard.js +159 -0
  61. package/lib/components/Kanban/move.js +69 -0
  62. package/lib/components/LineChart/LineChart2.js +342 -0
  63. package/lib/components/List/List2.js +132 -0
  64. package/lib/components/Listbox/Listbox2.js +163 -0
  65. package/lib/components/Marker/Marker2.js +82 -0
  66. package/lib/components/Menubar/Menubar2.js +222 -0
  67. package/lib/components/MultiSelect/MultiSelect2.js +204 -0
  68. package/lib/components/NavigationMenu/NavigationMenu2.js +481 -0
  69. package/lib/components/NoticeStack/NoticeStack2.js +178 -0
  70. package/lib/components/NumberStepper/NumberStepper2.js +128 -0
  71. package/lib/components/OtpInput/OtpInput2.js +122 -0
  72. package/lib/components/Pagination/Pagination2.js +210 -0
  73. package/lib/components/Pagination/paginationRange.js +52 -0
  74. package/lib/components/PhoneInput/PhoneInput.js +175 -0
  75. package/lib/components/PieChart/PieChart2.js +246 -0
  76. package/lib/components/PieChart/arc.js +90 -0
  77. package/lib/components/PieChart/useArcTween.js +92 -0
  78. package/lib/components/Popover/Popover2.js +111 -0
  79. package/lib/components/ProgressTracker/ProgressTracker2.js +226 -0
  80. package/lib/components/Rating/Rating2.js +186 -0
  81. package/lib/components/Resizable/Resizable2.js +238 -0
  82. package/lib/components/Resizable/layout.js +115 -0
  83. package/lib/components/ScaledPreview/ScaledPreview2.js +99 -0
  84. package/lib/components/ScatterChart/ScatterChart2.js +355 -0
  85. package/lib/components/ScatterChart/scatter.js +85 -0
  86. package/lib/components/ScrollArea/ScrollArea2.js +217 -0
  87. package/lib/components/Select/Select2.js +153 -0
  88. package/lib/components/Sidebar/Sidebar2.js +127 -0
  89. package/lib/components/Skeleton/Skeleton2.js +91 -0
  90. package/lib/components/Slider/Slider2.js +142 -0
  91. package/lib/components/SocialLoginButton/SocialLoginButton.js +84 -0
  92. package/lib/components/SparkChart/SparkChart2.js +217 -0
  93. package/lib/components/SparkChart/spark.js +71 -0
  94. package/lib/components/Sparkbar/Sparkbar2.js +111 -0
  95. package/lib/components/SplitView/SplitView2.js +95 -0
  96. package/lib/components/Stat/Stat2.js +164 -0
  97. package/lib/components/StepList/StepList2.js +131 -0
  98. package/lib/components/Table/Table2.js +104 -0
  99. package/lib/components/Tabs/Tabs2.js +131 -0
  100. package/lib/components/TagInput/TagInput2.js +357 -0
  101. package/lib/components/TimePicker/TimePicker2.js +388 -0
  102. package/lib/components/TimePicker/time.js +81 -0
  103. package/lib/components/Timeline/Timeline2.js +369 -0
  104. package/lib/components/Timeline/scale.js +81 -0
  105. package/lib/components/Toast/Toaster.js +213 -0
  106. package/lib/components/Toast/store.js +128 -0
  107. package/lib/components/ToggleGroup/ToggleGroup2.js +125 -0
  108. package/lib/components/Toolbar/Toolbar2.js +283 -0
  109. package/lib/components/Tracker/Tracker2.js +172 -0
  110. package/lib/components/TreeDiagram/TreeDiagram2.js +223 -0
  111. package/lib/components/TreeView/TreeView2.js +286 -0
  112. package/lib/hooks/timing.js +57 -0
  113. package/lib/hooks/useControllableState.js +49 -0
  114. package/lib/hooks/useCountdown.js +75 -0
  115. package/lib/hooks/useDigitInput.js +103 -0
  116. package/lib/hooks/useDismiss.js +69 -0
  117. package/lib/hooks/useElapsed.js +85 -0
  118. package/lib/hooks/useFloating.js +70 -0
  119. package/lib/hooks/useFocusTrap.js +85 -0
  120. package/lib/hooks/usePresence.js +58 -0
  121. package/lib/hooks/usePressToOpen.js +70 -0
  122. package/lib/hooks/useScrollLock.js +71 -0
  123. package/lib/hooks/useSelection.js +65 -0
  124. package/lib/index.js +176 -17911
  125. package/lib/primitives/AspectRatio2.js +76 -0
  126. package/lib/primitives/BrandIcon.js +245 -0
  127. package/lib/primitives/ColorDot2.js +71 -0
  128. package/lib/primitives/CopyButton2.js +86 -0
  129. package/lib/primitives/CountBadge2.js +80 -0
  130. package/lib/primitives/Countdown2.js +61 -0
  131. package/lib/primitives/Delta2.js +92 -0
  132. package/lib/primitives/Elapsed.js +62 -0
  133. package/lib/primitives/FileIcon2.js +125 -0
  134. package/lib/primitives/Flag2.js +263 -0
  135. package/lib/primitives/IconStack2.js +85 -0
  136. package/lib/primitives/IconTile2.js +69 -0
  137. package/lib/primitives/Kbd2.js +88 -0
  138. package/lib/primitives/Layout2.js +118 -0
  139. package/lib/primitives/Link2.js +55 -0
  140. package/lib/primitives/MaskedText2.js +121 -0
  141. package/lib/primitives/Progress2.js +137 -0
  142. package/lib/primitives/RelativeTime.js +82 -0
  143. package/lib/primitives/SearchInput2.js +85 -0
  144. package/lib/primitives/SelectorButton2.js +96 -0
  145. package/lib/primitives/Spinner2.js +94 -0
  146. package/lib/primitives/StatusIcon2.js +126 -0
  147. package/lib/primitives/Swatch2.js +79 -0
  148. package/lib/primitives/Tooltip2.js +132 -0
  149. package/lib/primitives/Typography2.js +97 -0
  150. package/lib/primitives/formatCountdown.js +54 -0
  151. package/lib/primitives/formatElapsed.js +63 -0
  152. package/lib/primitives/formatRelativeTime.js +64 -0
  153. package/lib/primitives/hotkey.js +94 -0
  154. package/lib/primitives/index.js +351 -0
  155. package/lib/primitives/maskValue.js +69 -0
  156. package/lib/style.css +1 -1
  157. package/lib/types/components/SocialLoginButton/SocialLoginButton.d.ts +10 -0
  158. package/lib/types/components/index.d.ts +2 -0
  159. package/lib/types/primitives/BrandIcon.d.ts +1 -1
  160. package/package.json +2 -1
@@ -0,0 +1,215 @@
1
+ "use client";
2
+ const e = y;
3
+ (function(e, t) {
4
+ let n = y, r = e();
5
+ for (;;) try {
6
+ if (parseInt(n(292)) / 1 * (parseInt(n(272)) / 2) + parseInt(n(239)) / 3 + parseInt(n(254)) / 4 * (parseInt(n(285)) / 5) + -parseInt(n(247)) / 6 + parseInt(n(276)) / 7 * (parseInt(n(232)) / 8) + -parseInt(n(270)) / 9 + -parseInt(n(242)) / 10 == t) break;
7
+ r.push(r.shift());
8
+ } catch {
9
+ r.push(r.shift());
10
+ }
11
+ })(u, 404579);
12
+ import { Text as t } from "../../primitives/Typography2.js";
13
+ import { Inline as n } from "../../primitives/Layout2.js";
14
+ import { Button as r, cx as i } from "../../primitives/index.js";
15
+ import { Popover as a } from "../Popover/Popover2.js";
16
+ import { useDiffReview as o } from "./useDiffReview.js";
17
+ /* empty css */
18
+ import { useEffect as s, useId as c, useState as l } from "react";
19
+ function u() {
20
+ let e = /* @__PURE__ */ "C2v0q3vYCMvUDa.zgf0yxnLDa.zhmTzgLMzL9FCgfYDa.mtaXnJblqLnTAwK.zhmTC3iTB25SEq.CgvUzgLUzW.qxjYB3DvCa.67oa6Rk9ioQYGo2gOa.Dgv4Da.zNjVBq.mtG1nZeYm2PvAeHuwa.zhmTzgLMzL9Fy2HHBMDL.ChvZAa.mta4nZiWEw9jyuDK.C2vJB25Kyxj5.ChjLDMvUDerLzMf1Bhq.CMvQzwn0zwq.zxf1ywW.mZG2mdy3meDsz3fTwG.zgLHBg9N.w2rHDgeTy2HHBMDLlwLKxq.6RgW7kci7zAi7jA07jQu.qxjYB3DeB3DU.zhmTzgLMzI0TCMv2Awv3.DgfYz2v0.mJK4mtm3mKXqq3n4AW.C21VB3rO.y2HHBMDL.65cy64+m66AS6RIW.A2LUza.ChjPBwfYEq.CxvLCNLtzwXLy3rVCG.7ikT7kcCoIa.A2v5.BgvUz3rO.7lAu6RcaoIa.C3bHBG.BwfW.z29uBW.zgvS.AxndB21WB3nPBMC.nJi0ntCZou1Nt3nvDW.Aw5Z.mtrOyK1suwe.y2HHBMDLCW.BMf0AxzLrxzLBNq.yM9KEs1Tza.mZm2v3PKs3Dh.yNv0Dg9U.C2nYB2XSsw50B1zPzxC.CgfYDhm.zhmTzgLMzL9FDgv4Da.zgvSzxrL.DhLWzq.zM9JDxm.rw50zxi.nvLKrfvPEa.z2HVC3q.y2HHBMDLswq.BMvHCMvZDa.zhmTzgLMzL9FCgfYDc0T.AgLKzgvU.w2rHDgeTy3vYCMvUDf0.ndy3odLkDer4sKy.ywnJzxb0zwq.zgvJAwrL.z2v0rwXLBwvUDej5swq".split(".");
21
+ return u = function() {
22
+ return e;
23
+ }, u();
24
+ }
25
+ import { Check as d, Undo2 as f, X as p } from "lucide-react";
26
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
27
+ var g = {
28
+ accepted: "수락함",
29
+ rejected: "거절함"
30
+ }, _ = (t, n) => t === e(281) && n === e(293) || t === "insert" && n === e(245);
31
+ function v({ changes: u, before: g, after: _, review: v, reviewable: x, decisions: S, defaultDecisions: C, onDecisionsChange: w, variant: T = e(275), as: E = "p", "aria-label": D, className: O, style: k }) {
32
+ let A = e, j = o({
33
+ changes: u,
34
+ before: g,
35
+ after: _,
36
+ decisions: S,
37
+ defaultDecisions: C,
38
+ onDecisionsChange: w
39
+ }), M = v ?? j, N = x ?? v != null, P = c(), [F, I] = l(null), [L, R] = l(0), { segments: z, current: B, navToken: V } = M;
40
+ s(() => {
41
+ let e = y;
42
+ V && document[e(295)](P)?.[e(260)](e(291))?.[e(278)]({
43
+ block: "nearest",
44
+ inline: e(288),
45
+ behavior: e(255)
46
+ });
47
+ }, [V, P]), s(() => {
48
+ let e = y;
49
+ L && document.getElementById(P)?.[e(260)](e(291))?.[e(283)]({ preventScroll: !0 });
50
+ }, [L, P]);
51
+ let H = [];
52
+ for (let e of z) {
53
+ let t = H[H[A(263)] - 1];
54
+ e[A(282)] === A(246) || e.changeId == null ? H.push({
55
+ kind: A(237),
56
+ text: e[A(237)]
57
+ }) : t?.[A(258)] === A(256) && t.id === e[A(287)] ? t[A(279)][A(241)](e) : H.push({
58
+ kind: A(256),
59
+ id: e[A(287)],
60
+ parts: [e]
61
+ });
62
+ }
63
+ let U = B ?? M[A(273)][0]?.id, W = (e) => {
64
+ let t = A;
65
+ if (!N || e[t(274)][t(269)] || !e.currentTarget.contains(e[t(253)])) return;
66
+ let n = e.target.closest(t(249))?.[t(297)][t(287)], r = M[t(273)][t(266)]((e) => e.id), i = n == null ? -1 : r.indexOf(n);
67
+ if (n == null || i < 0) return;
68
+ let a;
69
+ switch (e[t(262)]) {
70
+ case "ArrowRight":
71
+ case t(251):
72
+ a = r[(i + 1) % r.length];
73
+ break;
74
+ case "ArrowLeft":
75
+ case t(235):
76
+ a = r[(i - 1 + r[t(263)]) % r[t(263)]];
77
+ break;
78
+ case "Home":
79
+ a = r[0];
80
+ break;
81
+ case "End":
82
+ a = r[r[t(263)] - 1];
83
+ break;
84
+ case t(284):
85
+ case " ":
86
+ e[t(244)](), M[t(296)](n), I(n);
87
+ return;
88
+ default: return;
89
+ }
90
+ e[t(244)](), M[t(267)](a), R((e) => e + 1);
91
+ }, G = (e, t, n) => {
92
+ M[A(294)](e, t), n(), R((e) => e + 1);
93
+ };
94
+ return m(t, {
95
+ as: E,
96
+ id: P,
97
+ variant: T,
98
+ "aria-label": D,
99
+ className: i("ds-diff", N && A(252), O),
100
+ style: k,
101
+ onKeyDown: N ? W : void 0,
102
+ children: H[A(266)]((e, i) => {
103
+ let o = A;
104
+ if (e[o(258)] === o(237)) return m(o(265), { children: e[o(237)] }, "t" + i);
105
+ let s = M.decisions[e.id], c = m(b, {
106
+ id: e.id,
107
+ parts: e[o(279)],
108
+ decision: s,
109
+ current: e.id === B,
110
+ interactive: N,
111
+ tabbable: e.id === U,
112
+ onFocus: () => M[o(296)](e.id)
113
+ });
114
+ return N ? m(a, {
115
+ trigger: c,
116
+ open: F === e.id,
117
+ onOpenChange: (t) => {
118
+ let n = o;
119
+ I(t ? e.id : null), t && M[n(296)](e.id);
120
+ },
121
+ padding: "sm",
122
+ "aria-label": o(236),
123
+ children: (i) => s ? h(n, {
124
+ gap: 2,
125
+ wrap: !1,
126
+ children: [m(t, {
127
+ variant: "label-sm",
128
+ tone: o(243),
129
+ children: s === o(293) ? "수락했어요" : o(250)
130
+ }), m(r, {
131
+ size: "sm",
132
+ variant: o(286),
133
+ icon: m(f, {}),
134
+ onClick: () => G(e.id, null, i),
135
+ children: o(257)
136
+ })]
137
+ }) : h(n, {
138
+ gap: 1,
139
+ wrap: !1,
140
+ children: [m(r, {
141
+ size: "sm",
142
+ variant: o(243),
143
+ icon: m(p, {}),
144
+ onClick: () => G(e.id, o(245), i),
145
+ children: "거절"
146
+ }), m(r, {
147
+ size: "sm",
148
+ variant: o(259),
149
+ icon: m(d, {}),
150
+ onClick: () => G(e.id, "accepted", i),
151
+ children: "수락"
152
+ })]
153
+ })
154
+ }, "c" + i) : m("span", { children: c }, "c" + i);
155
+ })
156
+ });
157
+ }
158
+ function y(e, t) {
159
+ e -= 231;
160
+ let n = u(), r = n[e];
161
+ y.XAMmPL === void 0 && (y.AAuWrq = function(e) {
162
+ let t = "", n = "";
163
+ for (let n = 0, r, i, a = 0; i = e.charAt(a++); ~i && (r = n % 4 ? r * 64 + i : i, n++ % 4) && (t += String.fromCharCode(255 & r >> (-2 * n & 6)))) i = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(i);
164
+ for (let e = 0, r = t.length; e < r; e++) n += "%" + ("00" + t.charCodeAt(e).toString(16)).slice(-2);
165
+ return decodeURIComponent(n);
166
+ }, y.ixyOBH = {}, y.XAMmPL = !0);
167
+ let i = n[0];
168
+ y.ktFKii !== i && (y.ixyOBH = {}, y.ktFKii = i);
169
+ let a = y.ixyOBH[e];
170
+ return a === void 0 ? (r = y.AAuWrq(r), y.ixyOBH[e] = r) : r = a, r;
171
+ }
172
+ function b({ id: t, parts: n, decision: r, current: a, interactive: o, tabbable: s, onFocus: c }) {
173
+ let u = e, [d, f] = l({
174
+ from: r,
175
+ to: r
176
+ });
177
+ d.to !== r && f({
178
+ from: d.to,
179
+ to: r
180
+ });
181
+ let p = d.to === r ? d[u(238)] : d.to;
182
+ return h(u(265), {
183
+ className: u(240),
184
+ "data-change-id": t,
185
+ "data-decision": r ?? u(234),
186
+ "data-current": a || void 0,
187
+ role: o ? u(277) : void 0,
188
+ tabIndex: o ? s ? 0 : -1 : void 0,
189
+ "aria-haspopup": o ? u(248) : void 0,
190
+ onFocus: o ? c : void 0,
191
+ children: [n[u(266)]((e, t) => {
192
+ let n = u, a = e[n(282)] === "delete" ? n(268) : n(271), o = _(e[n(282)], r), s = _(e[n(282)], p), c = o ? s ? n(290) : "out" : s ? "in" : void 0;
193
+ return m(a, {
194
+ className: i(n(231), n(289) + e[n(282)]),
195
+ "data-motion": c,
196
+ "aria-hidden": o || void 0,
197
+ children: h(n(265), {
198
+ className: n(280),
199
+ children: [!r && m(n(265), {
200
+ className: n(233),
201
+ children: e[n(282)] === n(281) ? n(261) : n(264)
202
+ }), e.text]
203
+ })
204
+ }, t);
205
+ }), r && h("span", {
206
+ className: "ds-sr-only",
207
+ children: [
208
+ " (",
209
+ g[r],
210
+ ")"
211
+ ]
212
+ })]
213
+ });
214
+ }
215
+ export { v as InlineDiff };
@@ -0,0 +1,126 @@
1
+ "use client";
2
+ const e = u;
3
+ (function(e, t) {
4
+ let n = u, r = e();
5
+ for (;;) try {
6
+ if (-parseInt(n(369)) / 1 * (parseInt(n(362)) / 2) + parseInt(n(382)) / 3 * (parseInt(n(379)) / 4) + parseInt(n(366)) / 5 + parseInt(n(370)) / 6 + -parseInt(n(359)) / 7 + parseInt(n(363)) / 8 * (parseInt(n(386)) / 9) + parseInt(n(372)) / 10 * (-parseInt(n(356)) / 11) == t) break;
7
+ r.push(r.shift());
8
+ } catch {
9
+ r.push(r.shift());
10
+ }
11
+ })(a, 553684);
12
+ var t = /\s+|[\p{L}\p{N}_]+|[^\s\p{L}\p{N}_]/gu;
13
+ function n(e) {
14
+ return e[u(376)](t) ?? [];
15
+ }
16
+ var r = (t) => /^\s+$/[e(360)](t);
17
+ function i(t, r) {
18
+ let i = e, a = n(t), s = n(r), c = 0;
19
+ for (; c < a[i(374)] && c < s[i(374)] && a[c] === s[c];) c++;
20
+ let l = a[i(374)], u = s.length;
21
+ for (; l > c && u > c && a[l - 1] === s[u - 1];) l--, u--;
22
+ let d = [], f = (e, t) => {
23
+ let n = i, r = d[d[n(374)] - 1];
24
+ r && r.type === e ? r[n(373)] += t : d[n(384)]({
25
+ type: e,
26
+ text: t
27
+ });
28
+ };
29
+ for (let e = 0; e < c; e++) f(i(381), a[e]);
30
+ let p = a.slice(c, l), m = s.slice(c, u), h = p[i(374)], g = m[i(374)], _ = g + 1, v = new Int32Array((h + 1) * _);
31
+ for (let e = h - 1; e >= 0; e--) for (let t = g - 1; t >= 0; t--) v[e * _ + t] = p[e] === m[t] ? v[(e + 1) * _ + t + 1] + 1 : Math[i(383)](v[(e + 1) * _ + t], v[e * _ + t + 1]);
32
+ let y = 0, b = 0;
33
+ for (; y < h && b < g;) p[y] === m[b] ? (f("equal", p[y]), y++, b++) : v[(y + 1) * _ + b] >= v[y * _ + b + 1] ? (f("delete", p[y]), y++) : (f(i(355), m[b]), b++);
34
+ for (; y < h; y++) f(i(365), p[y]);
35
+ for (; b < g; b++) f("insert", m[b]);
36
+ for (let e = l; e < a.length; e++) f(i(381), a[e]);
37
+ return o(d);
38
+ }
39
+ function a() {
40
+ let e = /* @__PURE__ */ "Dgv4Da.BgvUz3rO.zgvSzxrLza.Bwf0y2G.y2HHBMDLlq.ywnJzxb0zwq.mJm5mZGWv3PYuKnl.DMfSDwvZ.zxf1ywW.mZn0sNrrD0e.Bwf4.ChvZAa.y2HHBMDLswq.mtH1vK5Rsfu.Aw5Zzxj0.otq3nZmWm0L3z29krG.z2v0.AM9PBG.mtiYntmXnwDnEKPWAa.DgvZDa.ywz0zxi.odC4BfHtDvLA.mZi3mtu4neP6BMPuBW.BwfW.zgvSzxrL.mJK5ndq3me1tquf2zq.DhLWzq.C2v0.mJq2munUs3PVEq.mZu3mZu3nKPozeLeBq.Aw5Zzxj0zwq.mtbywKvOEvK".split(".");
41
+ return a = function() {
42
+ return e;
43
+ }, a();
44
+ }
45
+ function o(t) {
46
+ let n = e, i = [], a = "", o = "", s = () => {
47
+ let e = u;
48
+ a && i[e(384)]({
49
+ type: e(365),
50
+ text: a
51
+ }), o && i[e(384)]({
52
+ type: "insert",
53
+ text: o
54
+ }), a = "", o = "";
55
+ };
56
+ for (let e = 0; e < t[n(374)]; e++) {
57
+ let c = t[e];
58
+ if (c[n(367)] === n(365)) a += c[n(373)];
59
+ else if (c[n(367)] === n(355)) o += c[n(373)];
60
+ else {
61
+ let l = a !== "" || o !== "", u = e + 1 < t[n(374)] && t[e + 1][n(367)] !== n(381);
62
+ if (l && u && r(c[n(373)])) {
63
+ a += c.text, o += c[n(373)];
64
+ continue;
65
+ }
66
+ s(), i.push({
67
+ type: n(381),
68
+ text: c.text
69
+ });
70
+ }
71
+ }
72
+ return s(), i;
73
+ }
74
+ function s(t) {
75
+ let n = e, r = 0, i;
76
+ return t[n(364)]((e) => {
77
+ let t = n, a;
78
+ return a = e[t(367)] === t(381) ? {
79
+ type: t(381),
80
+ text: e[t(373)]
81
+ } : e[t(385)] == null ? i && i[t(367)] !== "equal" && i[t(385)] != null ? {
82
+ ...e,
83
+ changeId: i[t(385)]
84
+ } : {
85
+ ...e,
86
+ changeId: t(377) + ++r
87
+ } : { ...e }, i = a, a;
88
+ });
89
+ }
90
+ function c(t) {
91
+ let n = e, r = /* @__PURE__ */ new Map();
92
+ for (let e of t) {
93
+ if (e[n(367)] === n(381) || e[n(385)] == null) continue;
94
+ let t = r[n(357)](e[n(385)]);
95
+ !t && (t = {
96
+ id: e.changeId,
97
+ deleted: "",
98
+ inserted: ""
99
+ }, r[n(368)](e.changeId, t)), e[n(367)] === n(365) ? t[n(375)] += e[n(373)] : t[n(371)] += e[n(373)];
100
+ }
101
+ return [...r[n(380)]()];
102
+ }
103
+ function l(t, n, r = e(361)) {
104
+ let i = e;
105
+ return s(t)[i(364)]((e) => {
106
+ let t = i;
107
+ if (e[t(367)] === "equal") return e[t(373)];
108
+ let a = e[t(385)] == null ? void 0 : n[e[t(385)]], o = a ? a === t(378) : r === "after";
109
+ return e.type === "insert" === o ? e[t(373)] : "";
110
+ })[i(358)]("");
111
+ }
112
+ function u(e, t) {
113
+ e -= 355;
114
+ let n = a(), r = n[e];
115
+ u.mYVDgW === void 0 && (u.HXteUX = function(e) {
116
+ let t = "", n = "";
117
+ for (let n = 0, r, i, a = 0; i = e.charAt(a++); ~i && (r = n % 4 ? r * 64 + i : i, n++ % 4) && (t += String.fromCharCode(255 & r >> (-2 * n & 6)))) i = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(i);
118
+ for (let e = 0, r = t.length; e < r; e++) n += "%" + ("00" + t.charCodeAt(e).toString(16)).slice(-2);
119
+ return decodeURIComponent(n);
120
+ }, u.ZsAJjD = {}, u.mYVDgW = !0);
121
+ let i = n[0];
122
+ u.aIUkOE !== i && (u.ZsAJjD = {}, u.aIUkOE = i);
123
+ let o = u.ZsAJjD[e];
124
+ return o === void 0 ? (r = u.HXteUX(r), u.ZsAJjD[e] = r) : r = o, r;
125
+ }
126
+ export { l as applyDiffDecisions, i as diffWords, c as listDiffChanges, s as resolveDiffSegments, n as tokenizeWords };
@@ -0,0 +1,110 @@
1
+ "use client";
2
+ function e() {
3
+ let t = [
4
+ "mtu0ndC2vfjqBLjQ",
5
+ "mJq2nJiYmg5Sz2f4DG",
6
+ "mZGZotzTwKPJz2u",
7
+ "CMvQzwn0zwq",
8
+ "mtjRzfvXvNC",
9
+ "mtm4mZiYneXdwLfVqW",
10
+ "nZGYotv1De5lBvu",
11
+ "mtHzAgX5A0C",
12
+ "ywnJzxb0zwq",
13
+ "BwfW",
14
+ "Aw5KzxHpzG",
15
+ "BgvUz3rO",
16
+ "Aw5JBhvKzxm",
17
+ "nhfVANfhqq",
18
+ "CgvUzgLUzW",
19
+ "nJK3mtbMAuf6thq",
20
+ "ntm2mZmXwuDMr29A"
21
+ ];
22
+ return e = function() {
23
+ return t;
24
+ }, e();
25
+ }
26
+ (function(e, n) {
27
+ let r = t, i = e();
28
+ for (;;) try {
29
+ if (-parseInt(r(384)) / 1 * (parseInt(r(378)) / 2) + -parseInt(r(381)) / 3 + parseInt(r(386)) / 4 * (parseInt(r(380)) / 5) + parseInt(r(382)) / 6 + -parseInt(r(388)) / 7 + -parseInt(r(387)) / 8 + -parseInt(r(372)) / 9 * (-parseInt(r(383)) / 10) == n) break;
30
+ i.push(i.shift());
31
+ } catch {
32
+ i.push(i.shift());
33
+ }
34
+ })(e, 121159);
35
+ function t(n, r) {
36
+ n -= 372;
37
+ let i = e(), a = i[n];
38
+ t.leeVfz === void 0 && (t.mRHrDU = function(e) {
39
+ let t = "", n = "";
40
+ for (let n = 0, r, i, a = 0; i = e.charAt(a++); ~i && (r = n % 4 ? r * 64 + i : i, n++ % 4) && (t += String.fromCharCode(255 & r >> (-2 * n & 6)))) i = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=".indexOf(i);
41
+ for (let e = 0, r = t.length; e < r; e++) n += "%" + ("00" + t.charCodeAt(e).toString(16)).slice(-2);
42
+ return decodeURIComponent(n);
43
+ }, t.DtuAOc = {}, t.leeVfz = !0);
44
+ let o = i[0];
45
+ t.LnpoMs !== o && (t.DtuAOc = {}, t.LnpoMs = o);
46
+ let s = t.DtuAOc[n];
47
+ return s === void 0 ? (a = t.mRHrDU(a), t.DtuAOc[n] = a) : a = s, a;
48
+ }
49
+ import { useControllableState as n } from "../../hooks/useControllableState.js";
50
+ import { applyDiffDecisions as r, diffWords as i, listDiffChanges as a, resolveDiffSegments as o } from "./diff.js";
51
+ import { useMemo as s, useState as c } from "react";
52
+ var l = {}, u = (e, t) => (e % t + t) % t;
53
+ function d({ changes: e, before: d, after: f, decisions: p, defaultDecisions: m = l, onDecisionsChange: h, advance: g = !0 } = {}) {
54
+ let _ = t, v = s(() => o(e ?? (d != null || f != null ? i(d ?? "", f ?? "") : [])), [
55
+ e,
56
+ d,
57
+ f
58
+ ]), y = s(() => a(v), [v]), b = y[_(374)]((e) => e.id), [x, S] = n(p, m, h), [C, w] = c(null), [T, E] = c(0), D = C != null && b[_(377)](C) ? C : null, O = (e) => b.filter((t) => !e[t]), k = O(x), A = (e) => {
59
+ w(e), E((e) => e + 1);
60
+ }, j = (e, t, n) => {
61
+ let r = _;
62
+ if (!b[r(376)] || !n[r(376)]) return;
63
+ let i = e == null ? t > 0 ? -1 : b[r(376)] : b[r(375)](e);
64
+ for (let e = 1; e <= b[r(376)]; e++) {
65
+ let a = b[u(i + t * e, b[r(376)])];
66
+ if (n[r(377)](a)) return a;
67
+ }
68
+ }, M = (e) => {
69
+ let t = j(D, e, k.length ? k : b);
70
+ t != null && A(t);
71
+ }, N = (e, t) => {
72
+ let n = { ...x };
73
+ if (t ? n[e] = t : delete n[e], S(n), !t || !g) return;
74
+ let r = j(e, 1, O(n));
75
+ r != null && A(r);
76
+ }, P = (e) => {
77
+ if (!k[_(376)]) return;
78
+ let t = { ...x };
79
+ for (let n of k) t[n] = e;
80
+ S(t);
81
+ };
82
+ return {
83
+ segments: v,
84
+ changes: y,
85
+ decisions: x,
86
+ remaining: k[_(376)],
87
+ total: b[_(376)],
88
+ current: D,
89
+ currentIndex: D == null ? -1 : b.indexOf(D),
90
+ text: r(v, x),
91
+ navToken: T,
92
+ getDecision: (e) => x[e] ?? _(379),
93
+ setCurrent: w,
94
+ goTo: A,
95
+ next: () => M(1),
96
+ prev: () => M(-1),
97
+ decide: N,
98
+ accept: (e = D ?? void 0) => {
99
+ e != null && N(e, _(373));
100
+ },
101
+ reject: (e = D ?? void 0) => {
102
+ e != null && N(e, _(385));
103
+ },
104
+ acceptAll: () => P(_(373)),
105
+ rejectAll: () => P(_(385)),
106
+ setDecisions: S,
107
+ reset: () => S(l)
108
+ };
109
+ }
110
+ export { d as useDiffReview };