@xyo-network/react-chain-boundwitness 1.0.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 (204) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +13 -0
  3. package/dist/browser/index.mjs +1246 -0
  4. package/dist/browser/index.mjs.map +1 -0
  5. package/dist/types/Plugin.d.ts +3 -0
  6. package/dist/types/Plugin.d.ts.map +1 -0
  7. package/dist/types/components/Card/Card.d.ts +9 -0
  8. package/dist/types/components/Card/Card.d.ts.map +1 -0
  9. package/dist/types/components/Card/CardContent/AddressAvatarGroup.d.ts +8 -0
  10. package/dist/types/components/Card/CardContent/AddressAvatarGroup.d.ts.map +1 -0
  11. package/dist/types/components/Card/CardContent/CardContent.d.ts +9 -0
  12. package/dist/types/components/Card/CardContent/CardContent.d.ts.map +1 -0
  13. package/dist/types/components/Card/CardContent/SchemaAvatarGroup.d.ts +9 -0
  14. package/dist/types/components/Card/CardContent/SchemaAvatarGroup.d.ts.map +1 -0
  15. package/dist/types/components/Card/CardContent/index.d.ts +3 -0
  16. package/dist/types/components/Card/CardContent/index.d.ts.map +1 -0
  17. package/dist/types/components/Card/CardContent/layout/CardColumnTitle.d.ts +5 -0
  18. package/dist/types/components/Card/CardContent/layout/CardColumnTitle.d.ts.map +1 -0
  19. package/dist/types/components/Card/CardContent/layout/CardColumnsFlex.d.ts +2 -0
  20. package/dist/types/components/Card/CardContent/layout/CardColumnsFlex.d.ts.map +1 -0
  21. package/dist/types/components/Card/CardContent/layout/CardContentFlex.d.ts +5 -0
  22. package/dist/types/components/Card/CardContent/layout/CardContentFlex.d.ts.map +1 -0
  23. package/dist/types/components/Card/CardContent/layout/index.d.ts +4 -0
  24. package/dist/types/components/Card/CardContent/layout/index.d.ts.map +1 -0
  25. package/dist/types/components/Card/CardHeader/CardHeader.d.ts +14 -0
  26. package/dist/types/components/Card/CardHeader/CardHeader.d.ts.map +1 -0
  27. package/dist/types/components/Card/CardHeader/index.d.ts +2 -0
  28. package/dist/types/components/Card/CardHeader/index.d.ts.map +1 -0
  29. package/dist/types/components/Card/index.d.ts +4 -0
  30. package/dist/types/components/Card/index.d.ts.map +1 -0
  31. package/dist/types/components/Details/BoundWitnessLinksDetails.d.ts +8 -0
  32. package/dist/types/components/Details/BoundWitnessLinksDetails.d.ts.map +1 -0
  33. package/dist/types/components/Details/Box/DetailsBox.d.ts +6 -0
  34. package/dist/types/components/Details/Box/DetailsBox.d.ts.map +1 -0
  35. package/dist/types/components/Details/Box/index.d.ts +2 -0
  36. package/dist/types/components/Details/Box/index.d.ts.map +1 -0
  37. package/dist/types/components/Details/Card/DetailsCard.d.ts +7 -0
  38. package/dist/types/components/Details/Card/DetailsCard.d.ts.map +1 -0
  39. package/dist/types/components/Details/Card/DetailsCardContent.d.ts +10 -0
  40. package/dist/types/components/Details/Card/DetailsCardContent.d.ts.map +1 -0
  41. package/dist/types/components/Details/Card/DetailsCardInner.d.ts +7 -0
  42. package/dist/types/components/Details/Card/DetailsCardInner.d.ts.map +1 -0
  43. package/dist/types/components/Details/Card/Navigation/BottomNavigation.d.ts +11 -0
  44. package/dist/types/components/Details/Card/Navigation/BottomNavigation.d.ts.map +1 -0
  45. package/dist/types/components/Details/Card/Navigation/NavigationTabs.d.ts +10 -0
  46. package/dist/types/components/Details/Card/Navigation/NavigationTabs.d.ts.map +1 -0
  47. package/dist/types/components/Details/Card/Navigation/index.d.ts +3 -0
  48. package/dist/types/components/Details/Card/Navigation/index.d.ts.map +1 -0
  49. package/dist/types/components/Details/Card/index.d.ts +2 -0
  50. package/dist/types/components/Details/Card/index.d.ts.map +1 -0
  51. package/dist/types/components/Details/Details.d.ts +11 -0
  52. package/dist/types/components/Details/Details.d.ts.map +1 -0
  53. package/dist/types/components/Details/ValidationDetails.d.ts +8 -0
  54. package/dist/types/components/Details/ValidationDetails.d.ts.map +1 -0
  55. package/dist/types/components/Details/index.d.ts +5 -0
  56. package/dist/types/components/Details/index.d.ts.map +1 -0
  57. package/dist/types/components/_shared/Actions/BWActions.d.ts +14 -0
  58. package/dist/types/components/_shared/Actions/BWActions.d.ts.map +1 -0
  59. package/dist/types/components/_shared/Actions/Verification.d.ts +9 -0
  60. package/dist/types/components/_shared/Actions/Verification.d.ts.map +1 -0
  61. package/dist/types/components/_shared/Actions/_shared/ActionMenuItemProps.d.ts +7 -0
  62. package/dist/types/components/_shared/Actions/_shared/ActionMenuItemProps.d.ts.map +1 -0
  63. package/dist/types/components/_shared/Actions/_shared/MenuItemDialog.d.ts +7 -0
  64. package/dist/types/components/_shared/Actions/_shared/MenuItemDialog.d.ts.map +1 -0
  65. package/dist/types/components/_shared/Actions/_shared/index.d.ts +3 -0
  66. package/dist/types/components/_shared/Actions/_shared/index.d.ts.map +1 -0
  67. package/dist/types/components/_shared/Actions/index.d.ts +5 -0
  68. package/dist/types/components/_shared/Actions/index.d.ts.map +1 -0
  69. package/dist/types/components/_shared/Actions/json/MenuItem.d.ts +6 -0
  70. package/dist/types/components/_shared/Actions/json/MenuItem.d.ts.map +1 -0
  71. package/dist/types/components/_shared/Actions/json/index.d.ts +2 -0
  72. package/dist/types/components/_shared/Actions/json/index.d.ts.map +1 -0
  73. package/dist/types/components/_shared/Actions/previous-hash/DialogContent.d.ts +8 -0
  74. package/dist/types/components/_shared/Actions/previous-hash/DialogContent.d.ts.map +1 -0
  75. package/dist/types/components/_shared/Actions/previous-hash/MenuItem.d.ts +6 -0
  76. package/dist/types/components/_shared/Actions/previous-hash/MenuItem.d.ts.map +1 -0
  77. package/dist/types/components/_shared/Actions/previous-hash/QuickTipButton.d.ts +8 -0
  78. package/dist/types/components/_shared/Actions/previous-hash/QuickTipButton.d.ts.map +1 -0
  79. package/dist/types/components/_shared/Actions/previous-hash/index.d.ts +4 -0
  80. package/dist/types/components/_shared/Actions/previous-hash/index.d.ts.map +1 -0
  81. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/BackPaperAdornment.d.ts +6 -0
  82. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/BackPaperAdornment.d.ts.map +1 -0
  83. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornment.d.ts +6 -0
  84. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornment.d.ts.map +1 -0
  85. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornmentIconButton.d.ts +6 -0
  86. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornmentIconButton.d.ts.map +1 -0
  87. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/index.d.ts +4 -0
  88. package/dist/types/components/_shared/Heading/HashHeadingPaper/Adornment/index.d.ts.map +1 -0
  89. package/dist/types/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.d.ts +10 -0
  90. package/dist/types/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.d.ts.map +1 -0
  91. package/dist/types/components/_shared/Heading/HashHeadingPaper/index.d.ts +2 -0
  92. package/dist/types/components/_shared/Heading/HashHeadingPaper/index.d.ts.map +1 -0
  93. package/dist/types/components/_shared/Heading/Heading.d.ts +4 -0
  94. package/dist/types/components/_shared/Heading/Heading.d.ts.map +1 -0
  95. package/dist/types/components/_shared/Heading/HeadingPaper/HeadingPaper.d.ts +9 -0
  96. package/dist/types/components/_shared/Heading/HeadingPaper/HeadingPaper.d.ts.map +1 -0
  97. package/dist/types/components/_shared/Heading/HeadingPaper/index.d.ts +2 -0
  98. package/dist/types/components/_shared/Heading/HeadingPaper/index.d.ts.map +1 -0
  99. package/dist/types/components/_shared/Heading/HeadingProps.d.ts +14 -0
  100. package/dist/types/components/_shared/Heading/HeadingProps.d.ts.map +1 -0
  101. package/dist/types/components/_shared/Heading/index.d.ts +5 -0
  102. package/dist/types/components/_shared/Heading/index.d.ts.map +1 -0
  103. package/dist/types/components/_shared/Payloads/PayloadsPropertyGroup.d.ts +10 -0
  104. package/dist/types/components/_shared/Payloads/PayloadsPropertyGroup.d.ts.map +1 -0
  105. package/dist/types/components/_shared/Payloads/PayloadsTable.d.ts +10 -0
  106. package/dist/types/components/_shared/Payloads/PayloadsTable.d.ts.map +1 -0
  107. package/dist/types/components/_shared/Payloads/index.d.ts +3 -0
  108. package/dist/types/components/_shared/Payloads/index.d.ts.map +1 -0
  109. package/dist/types/components/_shared/Payloads/payloads-table/TableBody.d.ts +11 -0
  110. package/dist/types/components/_shared/Payloads/payloads-table/TableBody.d.ts.map +1 -0
  111. package/dist/types/components/_shared/Payloads/payloads-table/TableBodyFiltered.d.ts +8 -0
  112. package/dist/types/components/_shared/Payloads/payloads-table/TableBodyFiltered.d.ts.map +1 -0
  113. package/dist/types/components/_shared/Payloads/payloads-table/TableHead.d.ts +4 -0
  114. package/dist/types/components/_shared/Payloads/payloads-table/TableHead.d.ts.map +1 -0
  115. package/dist/types/components/_shared/Payloads/payloads-table/index.d.ts +4 -0
  116. package/dist/types/components/_shared/Payloads/payloads-table/index.d.ts.map +1 -0
  117. package/dist/types/components/_shared/Signatures/SignatureDetails.d.ts +8 -0
  118. package/dist/types/components/_shared/Signatures/SignatureDetails.d.ts.map +1 -0
  119. package/dist/types/components/_shared/Signatures/SignatureTable.d.ts +8 -0
  120. package/dist/types/components/_shared/Signatures/SignatureTable.d.ts.map +1 -0
  121. package/dist/types/components/_shared/Signatures/SignatureTableRow.d.ts +14 -0
  122. package/dist/types/components/_shared/Signatures/SignatureTableRow.d.ts.map +1 -0
  123. package/dist/types/components/_shared/Signatures/index.d.ts +3 -0
  124. package/dist/types/components/_shared/Signatures/index.d.ts.map +1 -0
  125. package/dist/types/components/_shared/index.d.ts +5 -0
  126. package/dist/types/components/_shared/index.d.ts.map +1 -0
  127. package/dist/types/components/index.d.ts +4 -0
  128. package/dist/types/components/index.d.ts.map +1 -0
  129. package/dist/types/index.d.ts +3 -0
  130. package/dist/types/index.d.ts.map +1 -0
  131. package/package.json +92 -0
  132. package/src/Plugin.ts +20 -0
  133. package/src/components/Card/Card.stories.tsx +22 -0
  134. package/src/components/Card/Card.tsx +24 -0
  135. package/src/components/Card/CardContent/AddressAvatarGroup.tsx +28 -0
  136. package/src/components/Card/CardContent/CardContent.tsx +36 -0
  137. package/src/components/Card/CardContent/SchemaAvatarGroup.tsx +45 -0
  138. package/src/components/Card/CardContent/index.ts +2 -0
  139. package/src/components/Card/CardContent/layout/CardColumnTitle.tsx +11 -0
  140. package/src/components/Card/CardContent/layout/CardColumnsFlex.tsx +8 -0
  141. package/src/components/Card/CardContent/layout/CardContentFlex.tsx +19 -0
  142. package/src/components/Card/CardContent/layout/index.ts +3 -0
  143. package/src/components/Card/CardHeader/CardHeader.tsx +97 -0
  144. package/src/components/Card/CardHeader/index.ts +1 -0
  145. package/src/components/Card/index.ts +3 -0
  146. package/src/components/Details/BoundWitnessLinksDetails.tsx +39 -0
  147. package/src/components/Details/Box/DetailsBox.stories.tsx +65 -0
  148. package/src/components/Details/Box/DetailsBox.tsx +70 -0
  149. package/src/components/Details/Box/index.ts +1 -0
  150. package/src/components/Details/Card/DetailsCard.stories.tsx +37 -0
  151. package/src/components/Details/Card/DetailsCard.tsx +18 -0
  152. package/src/components/Details/Card/DetailsCardContent.tsx +63 -0
  153. package/src/components/Details/Card/DetailsCardInner.tsx +55 -0
  154. package/src/components/Details/Card/Navigation/BottomNavigation.stories.tsx +24 -0
  155. package/src/components/Details/Card/Navigation/BottomNavigation.tsx +50 -0
  156. package/src/components/Details/Card/Navigation/NavigationTabs.stories.tsx +26 -0
  157. package/src/components/Details/Card/Navigation/NavigationTabs.tsx +52 -0
  158. package/src/components/Details/Card/Navigation/index.ts +2 -0
  159. package/src/components/Details/Card/index.ts +1 -0
  160. package/src/components/Details/Details.stories.tsx +77 -0
  161. package/src/components/Details/Details.tsx +34 -0
  162. package/src/components/Details/ValidationDetails.tsx +44 -0
  163. package/src/components/Details/index.ts +4 -0
  164. package/src/components/_shared/Actions/BWActions.tsx +53 -0
  165. package/src/components/_shared/Actions/Verification.tsx +43 -0
  166. package/src/components/_shared/Actions/_shared/ActionMenuItemProps.ts +7 -0
  167. package/src/components/_shared/Actions/_shared/MenuItemDialog.tsx +27 -0
  168. package/src/components/_shared/Actions/_shared/index.ts +2 -0
  169. package/src/components/_shared/Actions/index.ts +4 -0
  170. package/src/components/_shared/Actions/json/MenuItem.tsx +41 -0
  171. package/src/components/_shared/Actions/json/index.ts +1 -0
  172. package/src/components/_shared/Actions/previous-hash/DialogContent.tsx +43 -0
  173. package/src/components/_shared/Actions/previous-hash/MenuItem.tsx +35 -0
  174. package/src/components/_shared/Actions/previous-hash/QuickTipButton.tsx +31 -0
  175. package/src/components/_shared/Actions/previous-hash/index.ts +3 -0
  176. package/src/components/_shared/Heading/HashHeadingPaper/Adornment/BackPaperAdornment.tsx +13 -0
  177. package/src/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornment.tsx +14 -0
  178. package/src/components/_shared/Heading/HashHeadingPaper/Adornment/PaperAdornmentIconButton.tsx +14 -0
  179. package/src/components/_shared/Heading/HashHeadingPaper/Adornment/index.ts +3 -0
  180. package/src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.stories.tsx +33 -0
  181. package/src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.tsx +43 -0
  182. package/src/components/_shared/Heading/HashHeadingPaper/index.ts +1 -0
  183. package/src/components/_shared/Heading/Heading.tsx +49 -0
  184. package/src/components/_shared/Heading/HeadingPaper/HeadingPaper.tsx +52 -0
  185. package/src/components/_shared/Heading/HeadingPaper/index.ts +1 -0
  186. package/src/components/_shared/Heading/HeadingProps.tsx +15 -0
  187. package/src/components/_shared/Heading/index.ts +4 -0
  188. package/src/components/_shared/Payloads/PayloadsPropertyGroup.tsx +25 -0
  189. package/src/components/_shared/Payloads/PayloadsTable.tsx +51 -0
  190. package/src/components/_shared/Payloads/index.ts +2 -0
  191. package/src/components/_shared/Payloads/payloads-table/TableBody.tsx +67 -0
  192. package/src/components/_shared/Payloads/payloads-table/TableBodyFiltered.tsx +51 -0
  193. package/src/components/_shared/Payloads/payloads-table/TableHead.tsx +27 -0
  194. package/src/components/_shared/Payloads/payloads-table/index.ts +3 -0
  195. package/src/components/_shared/Signatures/SignatureDetails.tsx +21 -0
  196. package/src/components/_shared/Signatures/SignatureTable.stories.tsx +29 -0
  197. package/src/components/_shared/Signatures/SignatureTable.tsx +93 -0
  198. package/src/components/_shared/Signatures/SignatureTableRow.tsx +88 -0
  199. package/src/components/_shared/Signatures/index.ts +2 -0
  200. package/src/components/_shared/index.ts +4 -0
  201. package/src/components/index.ts +3 -0
  202. package/src/index.ts +2 -0
  203. package/typedoc.json +5 -0
  204. package/xy.config.ts +10 -0
@@ -0,0 +1,1246 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/components/_shared/Actions/BWActions.tsx
5
+ import { DataObject as DataObjectIcon } from "@mui/icons-material";
6
+ import { ellipsize as ellipsize2 } from "@xylabs/eth-address";
7
+ import { FlexRow as FlexRow2 } from "@xylabs/react-flexbox";
8
+ import { QuickTipButton as QuickTipButton3 } from "@xylabs/react-quick-tip-button";
9
+ import { usePayloadHash } from "@xyo-network/react-shared";
10
+ import React6 from "react";
11
+
12
+ // src/components/_shared/Actions/previous-hash/DialogContent.tsx
13
+ import { ContentCopy } from "@mui/icons-material";
14
+ import { Alert, AlertTitle, Collapse, DialogContent } from "@mui/material";
15
+ import { FlexGrowRow, FlexRow } from "@xylabs/react-flexbox";
16
+ import { EllipsizeBox } from "@xyo-network/react-shared";
17
+ import React, { useState } from "react";
18
+ var PreviousHashDialogContent = /* @__PURE__ */ __name(({ boundwitness, ...props }) => {
19
+ const [copied, setCopied] = useState(false);
20
+ const onCopy = /* @__PURE__ */ __name(async () => {
21
+ await navigator.clipboard.writeText(boundwitness?.previous_hashes[0] ?? "");
22
+ setCopied(true);
23
+ setTimeout(() => {
24
+ setCopied(false);
25
+ }, 5e3);
26
+ }, "onCopy");
27
+ return /* @__PURE__ */ React.createElement(DialogContent, props, /* @__PURE__ */ React.createElement(FlexGrowRow, {
28
+ columnGap: 2
29
+ }, /* @__PURE__ */ React.createElement(ContentCopy, {
30
+ sx: {
31
+ cursor: "pointer"
32
+ },
33
+ onClick: /* @__PURE__ */ __name(() => void onCopy(), "onClick")
34
+ }), /* @__PURE__ */ React.createElement(EllipsizeBox, {
35
+ flexGrow: "1",
36
+ typographyProps: {
37
+ variant: "body1"
38
+ }
39
+ }, boundwitness?.previous_hashes.join(","))), /* @__PURE__ */ React.createElement(FlexRow, null, /* @__PURE__ */ React.createElement(Collapse, {
40
+ in: copied,
41
+ unmountOnExit: true
42
+ }, /* @__PURE__ */ React.createElement(Alert, null, /* @__PURE__ */ React.createElement(AlertTitle, null, "Previous hash copied to clipboard")))));
43
+ }, "PreviousHashDialogContent");
44
+
45
+ // src/components/_shared/Actions/previous-hash/MenuItem.tsx
46
+ import { Link } from "@mui/icons-material";
47
+ import { ListItemIcon, MenuItem } from "@mui/material";
48
+ import React3, { useState as useState2 } from "react";
49
+
50
+ // src/components/_shared/Actions/_shared/MenuItemDialog.tsx
51
+ import { Button, Dialog, DialogActions, DialogContent as DialogContent2, DialogTitle } from "@mui/material";
52
+ import React2 from "react";
53
+ var MenuItemDialog = /* @__PURE__ */ __name(({ children, dialogTitle, open, onClose, ...props }) => {
54
+ return /* @__PURE__ */ React2.createElement(Dialog, {
55
+ open,
56
+ onClose,
57
+ sx: {
58
+ "& .MuiPaper-root": {
59
+ minWidth: "75%"
60
+ }
61
+ },
62
+ ...props
63
+ }, /* @__PURE__ */ React2.createElement(DialogTitle, null, dialogTitle), /* @__PURE__ */ React2.createElement(DialogContent2, null, children), /* @__PURE__ */ React2.createElement(DialogActions, {
64
+ sx: {
65
+ display: "flex",
66
+ flexDirection: "row",
67
+ justifyContent: "end"
68
+ }
69
+ }, /* @__PURE__ */ React2.createElement(Button, {
70
+ variant: "contained",
71
+ onClick: /* @__PURE__ */ __name((e) => onClose?.(e, "escapeKeyDown"), "onClick")
72
+ }, "Close")));
73
+ }, "MenuItemDialog");
74
+
75
+ // src/components/_shared/Actions/previous-hash/MenuItem.tsx
76
+ var BWPreviousHashMenuItem = /* @__PURE__ */ __name(({ boundwitness, onClick, onDialogClose, ...props }) => {
77
+ const [open, setOpen] = useState2(false);
78
+ const onClose = /* @__PURE__ */ __name(() => {
79
+ onDialogClose?.();
80
+ setOpen(false);
81
+ }, "onClose");
82
+ const handleMenuClick = /* @__PURE__ */ __name((e) => {
83
+ onClick?.(e);
84
+ setOpen(true);
85
+ }, "handleMenuClick");
86
+ return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(MenuItem, {
87
+ onClick: handleMenuClick,
88
+ ...props
89
+ }, /* @__PURE__ */ React3.createElement(ListItemIcon, null, /* @__PURE__ */ React3.createElement(Link, null)), "Previous Hash"), /* @__PURE__ */ React3.createElement(MenuItemDialog, {
90
+ open,
91
+ onClose,
92
+ dialogTitle: "Previous Hash"
93
+ }, /* @__PURE__ */ React3.createElement(PreviousHashDialogContent, {
94
+ boundwitness
95
+ })));
96
+ }, "BWPreviousHashMenuItem");
97
+
98
+ // src/components/_shared/Actions/previous-hash/QuickTipButton.tsx
99
+ import { LinkRounded as LinkRoundedIcon } from "@mui/icons-material";
100
+ import { ellipsize } from "@xylabs/eth-address";
101
+ import { QuickTipButton } from "@xylabs/react-quick-tip-button";
102
+ import React4 from "react";
103
+ var BWPreviousHashQuickTipButton = /* @__PURE__ */ __name(({ boundwitness, ...props }) => {
104
+ const previousHash = boundwitness?.previous_hashes[0] ?? null;
105
+ const formattedPreviousHash = previousHash === null ? "No Previous Hash" : `Previous Hash - ${ellipsize(previousHash, 8)}`;
106
+ return /* @__PURE__ */ React4.createElement(QuickTipButton, {
107
+ Icon: LinkRoundedIcon,
108
+ disabled: previousHash === null,
109
+ hoverText: formattedPreviousHash,
110
+ disableDialog: previousHash === null,
111
+ dialogProps: {
112
+ fullWidth: true,
113
+ maxWidth: "md"
114
+ },
115
+ ...props
116
+ }, previousHash === null ? null : /* @__PURE__ */ React4.createElement(PreviousHashDialogContent, {
117
+ boundwitness
118
+ }));
119
+ }, "BWPreviousHashQuickTipButton");
120
+
121
+ // src/components/_shared/Actions/Verification.tsx
122
+ import { CancelRounded as CancelRoundedIcon, CheckCircleOutlineRounded as CheckCircleOutlineRoundedIcon } from "@mui/icons-material";
123
+ import { Typography } from "@mui/material";
124
+ import { FlexCol } from "@xylabs/react-flexbox";
125
+ import { usePromise } from "@xylabs/react-promise";
126
+ import { QuickTipButton as QuickTipButton2 } from "@xylabs/react-quick-tip-button";
127
+ import { BoundWitnessValidator } from "@xyo-network/boundwitness-validator";
128
+ import React5, { forwardRef } from "react";
129
+ var InvalidIcon = /* @__PURE__ */ forwardRef((props, ref) => /* @__PURE__ */ React5.createElement(CancelRoundedIcon, {
130
+ color: "error",
131
+ ref,
132
+ ...props
133
+ }));
134
+ InvalidIcon.displayName = "InvalidIcon";
135
+ var BWVerification = /* @__PURE__ */ __name(({ boundwitness, iconColors }) => {
136
+ const [errors = []] = usePromise(async () => await (boundwitness ? new BoundWitnessValidator(boundwitness) : void 0)?.validate(), [
137
+ boundwitness
138
+ ]);
139
+ return /* @__PURE__ */ React5.createElement(QuickTipButton2, {
140
+ Icon: errors.length > 0 ? /* @__PURE__ */ forwardRef((props, ref) => {
141
+ return /* @__PURE__ */ React5.createElement(InvalidIcon, {
142
+ color: iconColors ? "error" : void 0,
143
+ ref,
144
+ ...props
145
+ });
146
+ }) : /* @__PURE__ */ forwardRef((props, ref) => {
147
+ return /* @__PURE__ */ React5.createElement(CheckCircleOutlineRoundedIcon, {
148
+ color: iconColors ? "success" : void 0,
149
+ ref,
150
+ ...props
151
+ });
152
+ }),
153
+ hoverText: errors.length > 0 ? "Invalid Bound Witness" : "Valid"
154
+ }, errors.length > 0 ? /* @__PURE__ */ React5.createElement(FlexCol, {
155
+ flexWrap: "wrap",
156
+ alignItems: "start"
157
+ }, errors.map((error, index) => {
158
+ return /* @__PURE__ */ React5.createElement(Typography, {
159
+ key: index
160
+ }, error.toString());
161
+ })) : /* @__PURE__ */ React5.createElement(Typography, null, "No Errors"));
162
+ }, "BWVerification");
163
+
164
+ // src/components/_shared/Actions/BWActions.tsx
165
+ var BWActions = /* @__PURE__ */ __name(({ additionalActions, boundwitness, hideJSONButton, hideValidation, hidePreviousHash, priorActions, validationIconColors, ...props }) => {
166
+ const hash = usePayloadHash(boundwitness);
167
+ return /* @__PURE__ */ React6.createElement(FlexRow2, props, priorActions, hidePreviousHash || boundwitness?.previous_hashes.length === 0 ? null : /* @__PURE__ */ React6.createElement(BWPreviousHashQuickTipButton, {
168
+ boundwitness
169
+ }), hideValidation ? null : /* @__PURE__ */ React6.createElement(BWVerification, {
170
+ iconColors: validationIconColors,
171
+ boundwitness
172
+ }), hideJSONButton ? null : /* @__PURE__ */ React6.createElement(QuickTipButton3, {
173
+ Icon: DataObjectIcon,
174
+ title: `JSON for ${ellipsize2(hash ?? "", 8)}`,
175
+ dialogProps: {
176
+ fullWidth: true,
177
+ maxWidth: "md"
178
+ }
179
+ }, /* @__PURE__ */ React6.createElement("pre", {
180
+ style: {
181
+ wordBreak: "break-all"
182
+ }
183
+ }, boundwitness ? JSON.stringify(boundwitness, null, 2) : null)), additionalActions);
184
+ }, "BWActions");
185
+
186
+ // src/components/_shared/Actions/json/MenuItem.tsx
187
+ import { Code } from "@mui/icons-material";
188
+ import { ListItemIcon as ListItemIcon2, MenuItem as MenuItem2 } from "@mui/material";
189
+ import { ellipsize as ellipsize3 } from "@xylabs/eth-address";
190
+ import { JsonViewerEx } from "@xyo-network/react-payload-raw-info";
191
+ import { usePayloadHash as usePayloadHash2 } from "@xyo-network/react-shared";
192
+ import React7, { useState as useState3 } from "react";
193
+ var BWJsonMenuItem = /* @__PURE__ */ __name(({ boundwitness, onClick, onDialogClose, ...props }) => {
194
+ const hash = usePayloadHash2(boundwitness);
195
+ const [open, setOpen] = useState3(false);
196
+ const onClose = /* @__PURE__ */ __name(() => {
197
+ onDialogClose?.();
198
+ setOpen(false);
199
+ }, "onClose");
200
+ const handleMenuClick = /* @__PURE__ */ __name((e) => {
201
+ onClick?.(e);
202
+ setOpen(true);
203
+ }, "handleMenuClick");
204
+ const title = hash ? `JSON for ${ellipsize3(hash, 5)}` : "JSON";
205
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(MenuItem2, {
206
+ onClick: handleMenuClick,
207
+ ...props
208
+ }, /* @__PURE__ */ React7.createElement(ListItemIcon2, null, /* @__PURE__ */ React7.createElement(Code, null)), "JSON"), /* @__PURE__ */ React7.createElement(MenuItemDialog, {
209
+ open,
210
+ onClose,
211
+ dialogTitle: title
212
+ }, /* @__PURE__ */ React7.createElement(JsonViewerEx, {
213
+ value: boundwitness
214
+ })));
215
+ }, "BWJsonMenuItem");
216
+
217
+ // src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.tsx
218
+ import { useTheme } from "@mui/material";
219
+ import { Identicon } from "@xylabs/react-identicon";
220
+ import React10, { forwardRef as forwardRef3 } from "react";
221
+
222
+ // src/components/_shared/Heading/HeadingPaper/HeadingPaper.tsx
223
+ import { Paper, styled } from "@mui/material";
224
+ import React9, { forwardRef as forwardRef2 } from "react";
225
+
226
+ // src/components/_shared/Heading/Heading.tsx
227
+ import { FlexGrowRow as FlexGrowRow2 } from "@xylabs/react-flexbox";
228
+ import { EllipsizeBox as EllipsizeBox2 } from "@xyo-network/react-shared";
229
+ import React8, { useRef } from "react";
230
+ var BWHeading = /* @__PURE__ */ __name(({ AdornmentEnd, AdornmentStart, heading, headingProps, IconComponent, size = "medium", fallbackText = "No heading Provided", ...props }) => {
231
+ const ellipsizeRef = useRef(null);
232
+ const headingText = heading ?? fallbackText;
233
+ const sizeParser = /* @__PURE__ */ __name((size2) => {
234
+ const map = {
235
+ large: "h4",
236
+ medium: "body1",
237
+ small: "caption"
238
+ };
239
+ const mappedSize = map[size2];
240
+ if (mappedSize === void 0) {
241
+ throw new Error(`${size2} is not a recognized TextSize`);
242
+ }
243
+ return mappedSize;
244
+ }, "sizeParser");
245
+ return /* @__PURE__ */ React8.createElement(FlexGrowRow2, {
246
+ columnGap: 2,
247
+ ...props
248
+ }, AdornmentStart, IconComponent, /* @__PURE__ */ React8.createElement(EllipsizeBox2, {
249
+ title: headingText,
250
+ width: "100%",
251
+ typographyProps: {
252
+ variant: sizeParser(size),
253
+ ...headingProps
254
+ },
255
+ ref: ellipsizeRef
256
+ }, headingText), AdornmentEnd);
257
+ }, "BWHeading");
258
+
259
+ // src/components/_shared/Heading/HeadingPaper/HeadingPaper.tsx
260
+ var HeadingPaper = /* @__PURE__ */ forwardRef2((props, ref) => {
261
+ const { AdornmentStart, AdornmentEnd, paperProps } = props;
262
+ const { paperProps: excludedPaperProps, ...bwHeadingProps } = props;
263
+ return /* @__PURE__ */ React9.createElement(StyledHeadingPaper, {
264
+ hasAdornmentStart: !!AdornmentStart,
265
+ hasAdornmentEnd: !!AdornmentEnd,
266
+ elevation: 4,
267
+ ref,
268
+ ...paperProps
269
+ }, /* @__PURE__ */ React9.createElement(BWHeading, bwHeadingProps));
270
+ });
271
+ HeadingPaper.displayName = "HeadingPaper";
272
+ var StyledHeadingPaper = styled(Paper, {
273
+ name: "StyledHeadingPaper",
274
+ shouldForwardProp: /* @__PURE__ */ __name((prop) => ![
275
+ "hasAdornmentEnd",
276
+ "hasAdornmentStart",
277
+ "paperProps"
278
+ ].includes(prop), "shouldForwardProp")
279
+ })(({ hasAdornmentEnd, hasAdornmentStart, theme }) => ({
280
+ alignItems: "center",
281
+ columnGap: theme.spacing(2),
282
+ display: "flex",
283
+ flexDirection: "row",
284
+ overflow: "hidden",
285
+ padding: theme.spacing(1),
286
+ ...hasAdornmentStart && {
287
+ paddingLeft: 0
288
+ },
289
+ ...hasAdornmentEnd && {
290
+ paddingRight: 0
291
+ },
292
+ ...(hasAdornmentStart || hasAdornmentEnd) && {
293
+ paddingBottom: 0,
294
+ paddingTop: 0
295
+ },
296
+ paddingRight: theme.spacing(1)
297
+ }));
298
+
299
+ // src/components/_shared/Heading/HashHeadingPaper/HashHeadingPaper.tsx
300
+ var HashHeadingPaper = /* @__PURE__ */ forwardRef3(({ hash, identiconProps, ...props }, ref) => {
301
+ const theme = useTheme();
302
+ return /* @__PURE__ */ React10.createElement(HeadingPaper, {
303
+ heading: hash,
304
+ fallbackText: "No hash provided",
305
+ ref,
306
+ IconComponent: hash ? /* @__PURE__ */ React10.createElement(Identicon, {
307
+ size: Number.parseInt(theme.spacing(3).replace("px", "")),
308
+ p: 0.25,
309
+ value: hash,
310
+ sx: {
311
+ background: theme.palette.background.paper
312
+ },
313
+ ...identiconProps
314
+ }) : null,
315
+ sx: {
316
+ columnGap: 1
317
+ },
318
+ ...props
319
+ });
320
+ });
321
+ HashHeadingPaper.displayName = "HashHeadingPaper";
322
+
323
+ // src/components/_shared/Payloads/PayloadsPropertyGroup.tsx
324
+ import { PropertyGroup } from "@xyo-network/react-property";
325
+ import React15 from "react";
326
+
327
+ // src/components/_shared/Payloads/PayloadsTable.tsx
328
+ import { BoundWitnessSchema } from "@xyo-network/boundwitness-model";
329
+ import { usePayloadHash as usePayloadHash3 } from "@xyo-network/react-shared";
330
+ import { TableEx } from "@xyo-network/react-table";
331
+ import React14 from "react";
332
+
333
+ // src/components/_shared/Payloads/payloads-table/TableBody.tsx
334
+ import { TableBody, TableCell, TableRow } from "@mui/material";
335
+ import { useEvent } from "@xyo-network/react-event";
336
+ import { TableRowNoData } from "@xyo-network/react-payload-table";
337
+ import { HashTableCell } from "@xyo-network/react-shared";
338
+ import { useTableHeight } from "@xyo-network/react-table";
339
+ import React11, { useLayoutEffect, useRef as useRef2 } from "react";
340
+ var BoundWitnessPayloadTableBody = /* @__PURE__ */ __name(({ boundwitnessHash, eventNoun = "payload", payloadHashes, payloadSchemas, ...props }) => {
341
+ const { payloads, archive, maxSchemaDepth, onRowClick, exploreDomain, emptyRows, noResults, NoResultRowComponent, ...tableProps } = props;
342
+ const ref = useRef2(null);
343
+ const [tableRef, dispatch] = useEvent(void 0, ref);
344
+ const { setRowHeight } = useTableHeight();
345
+ const tableRowRef = useRef2(null);
346
+ const handleOnClick = /* @__PURE__ */ __name((hash) => {
347
+ dispatch(eventNoun, "click", hash);
348
+ }, "handleOnClick");
349
+ useLayoutEffect(() => {
350
+ if (tableRowRef.current) {
351
+ setRowHeight?.(tableRowRef.current.offsetHeight);
352
+ }
353
+ });
354
+ return /* @__PURE__ */ React11.createElement(TableBody, {
355
+ ref: tableRef,
356
+ ...tableProps
357
+ }, noResults && NoResultRowComponent ? /* @__PURE__ */ React11.createElement(NoResultRowComponent, null) : null, payloadHashes && payloadSchemas && payloadHashes.length > 0 && payloadHashes?.map((hash, index) => {
358
+ return /* @__PURE__ */ React11.createElement(TableRow, {
359
+ ref: tableRowRef,
360
+ key: boundwitnessHash + hash,
361
+ onClick: /* @__PURE__ */ __name(() => handleOnClick(hash), "onClick"),
362
+ sx: {
363
+ cursor: "pointer"
364
+ }
365
+ }, /* @__PURE__ */ React11.createElement(TableCell, {
366
+ title: payloadSchemas[index]
367
+ }, payloadSchemas[index]), /* @__PURE__ */ React11.createElement(HashTableCell, {
368
+ title: hash
369
+ }, hash));
370
+ }) || /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(TableRowNoData, {
371
+ additionalCells: 1
372
+ })));
373
+ }, "BoundWitnessPayloadTableBody");
374
+
375
+ // src/components/_shared/Payloads/payloads-table/TableBodyFiltered.tsx
376
+ import React12, { useMemo, useState as useState4 } from "react";
377
+ var BoundWitnessFilteredPayloadTableBody = /* @__PURE__ */ __name(({ bwFilterType = "equal", eventNoun = "payload", payloadHashes, payloadSchemas, schemaFilter, ...props }) => {
378
+ const [bwPayloadHashes, setBWPayloadHashes] = useState4();
379
+ const [bwPayloadSchemas, setBWPayloadSchemas] = useState4();
380
+ useMemo(() => {
381
+ if (!schemaFilter) {
382
+ setBWPayloadHashes(payloadHashes);
383
+ setBWPayloadSchemas(payloadSchemas);
384
+ }
385
+ }, [
386
+ payloadHashes,
387
+ payloadSchemas,
388
+ schemaFilter
389
+ ]);
390
+ useMemo(() => {
391
+ if (payloadSchemas && schemaFilter) {
392
+ const filteredSchemas = payloadSchemas.filter((schema) => {
393
+ return bwFilterType === "equal" ? schema === schemaFilter : schema !== schemaFilter;
394
+ });
395
+ setBWPayloadSchemas(filteredSchemas);
396
+ }
397
+ }, [
398
+ bwFilterType,
399
+ payloadSchemas,
400
+ schemaFilter
401
+ ]);
402
+ useMemo(() => {
403
+ if (payloadHashes && payloadSchemas && schemaFilter) {
404
+ const filteredHashes = payloadSchemas.reduce((acc, schema, index) => {
405
+ if (bwFilterType === "equal" ? schema === schemaFilter : schema !== schemaFilter) {
406
+ acc.push(payloadHashes[index]);
407
+ }
408
+ return acc;
409
+ }, []);
410
+ setBWPayloadHashes(filteredHashes);
411
+ }
412
+ }, [
413
+ bwFilterType,
414
+ payloadHashes,
415
+ payloadSchemas,
416
+ schemaFilter
417
+ ]);
418
+ return /* @__PURE__ */ React12.createElement(BoundWitnessPayloadTableBody, {
419
+ payloadHashes: bwPayloadHashes,
420
+ payloadSchemas: bwPayloadSchemas,
421
+ eventNoun,
422
+ ...props
423
+ });
424
+ }, "BoundWitnessFilteredPayloadTableBody");
425
+
426
+ // src/components/_shared/Payloads/payloads-table/TableHead.tsx
427
+ import { styled as styled2, TableHead, TableRow as TableRow2, Typography as Typography2 } from "@mui/material";
428
+ import { TableCellEx } from "@xyo-network/react-table";
429
+ import React13 from "react";
430
+ var BoundWitnessPayloadTableHead = /* @__PURE__ */ __name((props) => {
431
+ const {
432
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
433
+ columns,
434
+ ...tableHeadProps
435
+ } = props;
436
+ return /* @__PURE__ */ React13.createElement(TableHead, tableHeadProps, /* @__PURE__ */ React13.createElement(TableRow2, null, /* @__PURE__ */ React13.createElement(TableCellEx, null, /* @__PURE__ */ React13.createElement(TableCellTypography, {
437
+ variant: "caption"
438
+ }, "Schema")), /* @__PURE__ */ React13.createElement(TableCellEx, null, /* @__PURE__ */ React13.createElement(TableCellTypography, {
439
+ variant: "caption"
440
+ }, "Hash"))));
441
+ }, "BoundWitnessPayloadTableHead");
442
+ var TableCellTypography = styled2(Typography2, {
443
+ name: "TableCellTypography"
444
+ })(() => ({
445
+ fontWeight: "bold"
446
+ }));
447
+
448
+ // src/components/_shared/Payloads/PayloadsTable.tsx
449
+ var BoundWitnessPayloadsTable = /* @__PURE__ */ __name(({ boundwitness, ...props }) => {
450
+ const hash = usePayloadHash3(boundwitness);
451
+ return /* @__PURE__ */ React14.createElement(BoundWitnessPayloadsTableInner, props, /* @__PURE__ */ React14.createElement(BoundWitnessFilteredPayloadTableBody, {
452
+ eventNoun: "payload",
453
+ schemaFilter: BoundWitnessSchema,
454
+ bwFilterType: "notEqual",
455
+ noResults: boundwitness?.payload_hashes.length === 0,
456
+ payloadHashes: boundwitness?.payload_hashes,
457
+ payloadSchemas: boundwitness?.payload_schemas,
458
+ boundwitnessHash: boundwitness ? hash : ""
459
+ }));
460
+ }, "BoundWitnessPayloadsTable");
461
+ var BoundWitnessPayloadsTableForBWs = /* @__PURE__ */ __name(({ boundwitness, ...props }) => {
462
+ const hash = usePayloadHash3(boundwitness);
463
+ return /* @__PURE__ */ React14.createElement(BoundWitnessPayloadsTableInner, props, /* @__PURE__ */ React14.createElement(BoundWitnessFilteredPayloadTableBody, {
464
+ eventNoun: "boundwitness",
465
+ schemaFilter: BoundWitnessSchema,
466
+ noResults: boundwitness?.payload_hashes.length === 0,
467
+ payloadHashes: boundwitness?.payload_hashes,
468
+ payloadSchemas: boundwitness?.payload_schemas,
469
+ boundwitnessHash: boundwitness ? hash : ""
470
+ }));
471
+ }, "BoundWitnessPayloadsTableForBWs");
472
+ var BoundWitnessPayloadsTableInner = /* @__PURE__ */ __name(({ children, ...props }) => /* @__PURE__ */ React14.createElement(TableEx, props, /* @__PURE__ */ React14.createElement(BoundWitnessPayloadTableHead, null), children), "BoundWitnessPayloadsTableInner");
473
+
474
+ // src/components/_shared/Payloads/PayloadsPropertyGroup.tsx
475
+ var BoundWitnessPayloads = /* @__PURE__ */ __name(({ payload: boundwitness, payloadTableProps, ...props }) => {
476
+ let elevation = 2;
477
+ if (props.paper) {
478
+ elevation += props.elevation ?? 0;
479
+ }
480
+ return /* @__PURE__ */ React15.createElement(PropertyGroup, {
481
+ titleProps: {
482
+ elevation
483
+ },
484
+ title: "Payloads",
485
+ tip: "The hash and schema for each payload witnessed",
486
+ ...props
487
+ }, /* @__PURE__ */ React15.createElement(BoundWitnessPayloadsTable, {
488
+ boundwitness,
489
+ ...payloadTableProps
490
+ }));
491
+ }, "BoundWitnessPayloads");
492
+
493
+ // src/components/_shared/Signatures/SignatureDetails.tsx
494
+ import { PropertyGroup as PropertyGroup2 } from "@xyo-network/react-property";
495
+ import React18 from "react";
496
+
497
+ // src/components/_shared/Signatures/SignatureTable.tsx
498
+ import { TableBody as TableBody2, TableHead as TableHead2, TableRow as TableRow4, Typography as Typography4 } from "@mui/material";
499
+ import { TableRowNoData as TableRowNoData2 } from "@xyo-network/react-payload-table";
500
+ import { usePayloadHash as usePayloadHash4 } from "@xyo-network/react-shared";
501
+ import { TableCellEx as TableCellEx2, TableEx as TableEx2 } from "@xyo-network/react-table";
502
+ import React17 from "react";
503
+
504
+ // src/components/_shared/Signatures/SignatureTableRow.tsx
505
+ import { Link as Link2, TableCell as TableCell2, TableRow as TableRow3, Typography as Typography3 } from "@mui/material";
506
+ import { toUint8Array } from "@xylabs/arraybuffer";
507
+ import { ellipsize as ellipsize4 } from "@xylabs/eth-address";
508
+ import { usePromise as usePromise2 } from "@xylabs/react-promise";
509
+ import { BoundWitnessValidator as BoundWitnessValidator2 } from "@xyo-network/boundwitness-validator";
510
+ import { useEvent as useEvent2 } from "@xyo-network/react-event";
511
+ import { AddressTableCell } from "@xyo-network/react-shared";
512
+ import React16 from "react";
513
+ import { MdClear, MdDone } from "react-icons/md";
514
+ var BoundWitnessSignatureTableRow = /* @__PURE__ */ __name(({ address, archive, clickableFields, hash, previousHash, signature, ...props }) => {
515
+ const [errors] = usePromise2(async () => hash && address ? await BoundWitnessValidator2.validateSignature(toUint8Array(hash).buffer, toUint8Array(address).buffer, toUint8Array(signature)?.buffer) : [], [
516
+ hash,
517
+ address,
518
+ signature
519
+ ]);
520
+ const [addressRef, addressDispatch] = useEvent2();
521
+ const [signatureRef, signatureDispatch] = useEvent2();
522
+ const formattedHash = /* @__PURE__ */ __name((hash2) => hash2 ? ellipsize4(hash2, 8) : "-", "formattedHash");
523
+ return /* @__PURE__ */ React16.createElement(TableRow3, props, /* @__PURE__ */ React16.createElement(AddressTableCell, {
524
+ ref: addressRef,
525
+ archive,
526
+ value: address,
527
+ onClick: /* @__PURE__ */ __name(() => addressDispatch("address", "click", address), "onClick"),
528
+ link: clickableFields?.includes("address")
529
+ }), /* @__PURE__ */ React16.createElement(TableCell2, {
530
+ sx: {
531
+ display: {
532
+ md: "table-cell",
533
+ xs: "none"
534
+ }
535
+ },
536
+ align: "center"
537
+ }, /* @__PURE__ */ React16.createElement(Typography3, {
538
+ variant: "body2",
539
+ fontFamily: "monospace"
540
+ }, formattedHash(previousHash))), /* @__PURE__ */ React16.createElement(TableCell2, {
541
+ sx: {
542
+ display: {
543
+ sm: "table-cell",
544
+ xs: "none"
545
+ }
546
+ },
547
+ align: "center"
548
+ }, /* @__PURE__ */ React16.createElement(Typography3, {
549
+ variant: "body2",
550
+ fontFamily: "monospace",
551
+ ref: signatureRef,
552
+ onClick: /* @__PURE__ */ __name(() => signatureDispatch("signature", "click", signature), "onClick")
553
+ }, clickableFields?.includes("signature") ? /* @__PURE__ */ React16.createElement(Link2, null, formattedHash(signature)) : formattedHash(signature))), /* @__PURE__ */ React16.createElement(TableCell2, {
554
+ key: "valid",
555
+ align: "center"
556
+ }, errors === void 0 ? /* @__PURE__ */ React16.createElement(MdDone, {
557
+ fontSize: 18,
558
+ color: "gray"
559
+ }) : errors?.length === 0 ? /* @__PURE__ */ React16.createElement(MdDone, {
560
+ fontSize: 18,
561
+ color: "green"
562
+ }) : /* @__PURE__ */ React16.createElement(MdClear, {
563
+ color: "red",
564
+ fontSize: 18
565
+ })));
566
+ }, "BoundWitnessSignatureTableRow");
567
+
568
+ // src/components/_shared/Signatures/SignatureTable.tsx
569
+ var signatureDataFromBoundWitness = /* @__PURE__ */ __name((boundWitness) => {
570
+ const result = [];
571
+ for (let i = 0; i < boundWitness.addresses.length; i++) {
572
+ result.push({
573
+ address: boundWitness.addresses[i],
574
+ previous_hash: boundWitness.previous_hashes?.[i],
575
+ signature: boundWitness.$signatures?.[i] ?? []
576
+ });
577
+ }
578
+ return result;
579
+ }, "signatureDataFromBoundWitness");
580
+ var BoundWitnessSignatureTable = /* @__PURE__ */ __name(({ block, ...props }) => {
581
+ const signatureData = block ? signatureDataFromBoundWitness(block) : [];
582
+ const hash = usePayloadHash4(block);
583
+ return /* @__PURE__ */ React17.createElement(TableEx2, props, /* @__PURE__ */ React17.createElement(TableHead2, null, /* @__PURE__ */ React17.createElement(TableRow4, null, /* @__PURE__ */ React17.createElement(TableCellEx2, {
584
+ align: "left"
585
+ }, /* @__PURE__ */ React17.createElement(Typography4, {
586
+ variant: "caption"
587
+ }, /* @__PURE__ */ React17.createElement("strong", null, "Address"))), /* @__PURE__ */ React17.createElement(TableCellEx2, {
588
+ sx: {
589
+ display: {
590
+ md: "table-cell",
591
+ xs: "none"
592
+ }
593
+ },
594
+ align: "center",
595
+ width: "10px"
596
+ }, /* @__PURE__ */ React17.createElement(Typography4, {
597
+ variant: "caption"
598
+ }, /* @__PURE__ */ React17.createElement("strong", null, "Previous"))), /* @__PURE__ */ React17.createElement(TableCellEx2, {
599
+ sx: {
600
+ display: {
601
+ sm: "table-cell",
602
+ xs: "none"
603
+ }
604
+ },
605
+ align: "center",
606
+ width: "10px"
607
+ }, /* @__PURE__ */ React17.createElement(Typography4, {
608
+ variant: "caption"
609
+ }, /* @__PURE__ */ React17.createElement("strong", null, "Signature"))), /* @__PURE__ */ React17.createElement(TableCellEx2, {
610
+ align: "center",
611
+ width: "10px"
612
+ }, /* @__PURE__ */ React17.createElement(Typography4, {
613
+ variant: "caption"
614
+ }, /* @__PURE__ */ React17.createElement("strong", null, "Valid"))))), /* @__PURE__ */ React17.createElement(TableBody2, null, !signatureData || signatureData.length === 0 ? /* @__PURE__ */ React17.createElement(TableRowNoData2, {
615
+ additionalCells: 3
616
+ }) : null, signatureData.map((data, index) => {
617
+ return /* @__PURE__ */ React17.createElement(BoundWitnessSignatureTableRow, {
618
+ key: `${data.signature}-${data.previous_hash}-${index}`,
619
+ address: data.address,
620
+ previousHash: data.previous_hash,
621
+ hash,
622
+ signature: data.signature,
623
+ clickableFields: [
624
+ "address"
625
+ ]
626
+ });
627
+ })));
628
+ }, "BoundWitnessSignatureTable");
629
+
630
+ // src/components/_shared/Signatures/SignatureDetails.tsx
631
+ var BoundWitnessSignatureDetails = /* @__PURE__ */ __name(({ block, ...props }) => {
632
+ let elevation = 2;
633
+ if (props.paper) {
634
+ elevation += props.elevation ?? 0;
635
+ }
636
+ return /* @__PURE__ */ React18.createElement(PropertyGroup2, {
637
+ titleProps: {
638
+ elevation
639
+ },
640
+ title: "Signatures",
641
+ tip: "The list of signatures for this block",
642
+ ...props
643
+ }, /* @__PURE__ */ React18.createElement(BoundWitnessSignatureTable, {
644
+ block
645
+ }));
646
+ }, "BoundWitnessSignatureDetails");
647
+
648
+ // src/components/Card/Card.tsx
649
+ import { Card } from "@mui/material";
650
+ import React24 from "react";
651
+
652
+ // src/components/Card/CardContent/CardContent.tsx
653
+ import React22, { forwardRef as forwardRef4 } from "react";
654
+
655
+ // src/components/Card/CardContent/AddressAvatarGroup.tsx
656
+ import { Avatar, AvatarGroup } from "@mui/material";
657
+ import { Identicon as Identicon2 } from "@xylabs/react-identicon";
658
+ import React19, { useRef as useRef3 } from "react";
659
+ var AddressAvatarGroup = /* @__PURE__ */ __name(({ addresses, maxAvatars = 4, ...props }) => {
660
+ const ref = useRef3(null);
661
+ const size = ref.current ? ref.current.clientWidth * 0.65 : void 0;
662
+ return /* @__PURE__ */ React19.createElement(AvatarGroup, {
663
+ max: maxAvatars,
664
+ total: addresses?.length,
665
+ ...props
666
+ }, addresses?.map((address, index) => /* @__PURE__ */ React19.createElement(Avatar, {
667
+ key: index + address,
668
+ title: address,
669
+ ref,
670
+ sx: {
671
+ bgcolor: "background.paper"
672
+ }
673
+ }, /* @__PURE__ */ React19.createElement(Identicon2, {
674
+ value: address,
675
+ position: "absolute",
676
+ p: 0.25,
677
+ top: 0,
678
+ bottom: 0,
679
+ left: 0,
680
+ right: 0,
681
+ size
682
+ }))));
683
+ }, "AddressAvatarGroup");
684
+
685
+ // src/components/Card/CardContent/layout/CardColumnsFlex.tsx
686
+ import { styled as styled3 } from "@mui/material";
687
+ import { FlexCol as FlexCol2 } from "@xylabs/react-flexbox";
688
+ var CardColumnsFlex = styled3(FlexCol2, {
689
+ name: "CardColumnsFlex"
690
+ })(({ theme }) => ({
691
+ ["@media only screen and (min-width: 333px)"]: {
692
+ minWidth: "50%"
693
+ },
694
+ minWidth: "100%",
695
+ rowGap: theme.spacing(1)
696
+ }));
697
+
698
+ // src/components/Card/CardContent/layout/CardColumnTitle.tsx
699
+ import { styled as styled4, Typography as Typography5 } from "@mui/material";
700
+ import React20 from "react";
701
+ var CardColumnTitle = styled4(Typography5, {
702
+ name: "CardColumnTitle"
703
+ })(({ theme }) => ({
704
+ color: theme.palette.text.primary,
705
+ fontWeight: 500
706
+ }));
707
+ var CardColumnTitleH2 = /* @__PURE__ */ __name((props) => /* @__PURE__ */ React20.createElement(CardColumnTitle, props), "CardColumnTitleH2");
708
+
709
+ // src/components/Card/CardContent/layout/CardContentFlex.tsx
710
+ import { alpha, CardContent, styled as styled5 } from "@mui/material";
711
+ var CardContentFlex = styled5(CardContent, {
712
+ name: "CardContentFlex",
713
+ shouldForwardProp: /* @__PURE__ */ __name((prop) => prop !== "active", "shouldForwardProp")
714
+ })(({ theme, active }) => ({
715
+ [":last-child"]: {
716
+ paddingBottom: theme.spacing(1)
717
+ },
718
+ ...active && {
719
+ background: alpha(theme.palette.secondary.dark, 0.33)
720
+ },
721
+ display: "flex",
722
+ flexDirection: "row",
723
+ flexWrap: "wrap",
724
+ justifyContent: "center",
725
+ rowGap: theme.spacing(1)
726
+ }));
727
+
728
+ // src/components/Card/CardContent/SchemaAvatarGroup.tsx
729
+ import { Avatar as Avatar2, AvatarGroup as AvatarGroup2 } from "@mui/material";
730
+ import { BoundWitnessSchema as BoundWitnessSchema2 } from "@xyo-network/boundwitness-model";
731
+ import { usePayloadRenderPluginResolver } from "@xyo-network/react-payload-plugin-resolver";
732
+ import React21, { useCallback } from "react";
733
+ import { VscSymbolMethod, VscSymbolNamespace } from "react-icons/vsc";
734
+ var SchemaAvatarGroup = /* @__PURE__ */ __name(({ schemas, maxAvatars = 4, ...props }) => {
735
+ const { resolver } = usePayloadRenderPluginResolver();
736
+ const resolveSchemaToIcon = useCallback((schema, index) => {
737
+ const SchemaAvatar = resolver?.resolve({
738
+ schema
739
+ })?.components.avatar.image;
740
+ return SchemaAvatar ? /* @__PURE__ */ React21.createElement(SchemaAvatar, {
741
+ key: index + schema
742
+ }) : /* @__PURE__ */ React21.createElement(Avatar2, {
743
+ key: index + schema,
744
+ title: schema,
745
+ sx: {
746
+ bgcolor: "primary.main",
747
+ color: "primary.contrastText"
748
+ }
749
+ }, schema === BoundWitnessSchema2 ? /* @__PURE__ */ React21.createElement(VscSymbolMethod, null) : /* @__PURE__ */ React21.createElement(VscSymbolNamespace, null));
750
+ }, [
751
+ resolver
752
+ ]);
753
+ return /* @__PURE__ */ React21.createElement(AvatarGroup2, {
754
+ max: maxAvatars,
755
+ total: schemas?.length,
756
+ ...props
757
+ }, schemas?.map((schema, index) => resolveSchemaToIcon(schema, index)));
758
+ }, "SchemaAvatarGroup");
759
+
760
+ // src/components/Card/CardContent/CardContent.tsx
761
+ var BoundWitnessCardContent = /* @__PURE__ */ forwardRef4(({ payload, active, ...props }, ref) => {
762
+ const boundwitness = payload;
763
+ return /* @__PURE__ */ React22.createElement(CardContentFlex, {
764
+ ref,
765
+ active,
766
+ ...props
767
+ }, /* @__PURE__ */ React22.createElement(CardColumnsFlex, null, /* @__PURE__ */ React22.createElement(CardColumnTitleH2, null, "Payloads"), /* @__PURE__ */ React22.createElement(SchemaAvatarGroup, {
768
+ schemas: boundwitness?.payload_schemas
769
+ })), /* @__PURE__ */ React22.createElement(CardColumnsFlex, null, /* @__PURE__ */ React22.createElement(CardColumnTitleH2, null, "Signers"), /* @__PURE__ */ React22.createElement(AddressAvatarGroup, {
770
+ addresses: boundwitness?.addresses
771
+ })));
772
+ });
773
+ BoundWitnessCardContent.displayName = "BoundWitnessCardContent";
774
+
775
+ // src/components/Card/CardHeader/CardHeader.tsx
776
+ import { CardHeader, styled as styled6, useTheme as useTheme2 } from "@mui/material";
777
+ import { Identicon as Identicon3 } from "@xylabs/react-identicon";
778
+ import { usePayloadHash as usePayloadHash5 } from "@xyo-network/react-shared";
779
+ import React23, { forwardRef as forwardRef5 } from "react";
780
+ var BoundWitnessCardHeader = /* @__PURE__ */ forwardRef5(({ active = false, activeBgColor = true, additionalActions, hideJSONButton, hidePreviousHash, hideValidation, payload, ...props }, ref) => {
781
+ const boundwitness = payload;
782
+ const theme = useTheme2();
783
+ const hash = usePayloadHash5(boundwitness);
784
+ return /* @__PURE__ */ React23.createElement(CardHeaderHash, {
785
+ ref,
786
+ active,
787
+ activeBgColor,
788
+ title: /* @__PURE__ */ React23.createElement(BWHeading, {
789
+ heading: hash,
790
+ IconComponent: /* @__PURE__ */ React23.createElement(Identicon3, {
791
+ size: Number.parseInt(theme.spacing(2.5).replace("px", "")),
792
+ p: 0.5,
793
+ value: hash,
794
+ sx: {
795
+ background: theme.palette.background.paper
796
+ }
797
+ })
798
+ }),
799
+ action: /* @__PURE__ */ React23.createElement(BWActions, {
800
+ hideJSONButton,
801
+ hideValidation,
802
+ hidePreviousHash,
803
+ boundwitness,
804
+ additionalActions
805
+ }),
806
+ ...props
807
+ });
808
+ });
809
+ BoundWitnessCardHeader.displayName = "BoundWitnessCardHeader";
810
+ var CardHeaderHash = styled6(CardHeader, {
811
+ name: "CardHeaderHash",
812
+ shouldForwardProp: /* @__PURE__ */ __name((prop) => ![
813
+ "active",
814
+ "activeBgColor"
815
+ ].includes(prop), "shouldForwardProp")
816
+ })(({ theme, active, activeBgColor }) => ({
817
+ "& .MuiCardHeader-action": {
818
+ marginBottom: 0,
819
+ marginTop: 0
820
+ },
821
+ "& .MuiCardHeader-content": {
822
+ overflow: "visible"
823
+ },
824
+ "&.MuiCardHeader-root": {
825
+ ...active && activeBgColor && {
826
+ backgroundColor: theme.palette.info
827
+ },
828
+ borderBottom: `1px solid ${theme.palette.divider}`,
829
+ paddingBottom: theme.spacing(1),
830
+ paddingTop: theme.spacing(1)
831
+ },
832
+ "padding": `${theme.spacing(0.5)} ${theme.spacing(2)}`
833
+ }));
834
+
835
+ // src/components/Card/Card.tsx
836
+ var BoundWitnessRendererCard = /* @__PURE__ */ __name(({ payload, active, ...props }) => {
837
+ const boundwitness = payload;
838
+ return /* @__PURE__ */ React24.createElement(Card, props, /* @__PURE__ */ React24.createElement(BoundWitnessCardHeader, {
839
+ payload: boundwitness,
840
+ active,
841
+ hideJSONButton: true,
842
+ hidePreviousHash: true,
843
+ hideValidation: true
844
+ }), /* @__PURE__ */ React24.createElement(BoundWitnessCardContent, {
845
+ payload: boundwitness,
846
+ active
847
+ }));
848
+ }, "BoundWitnessRendererCard");
849
+
850
+ // src/components/Details/Box/DetailsBox.tsx
851
+ import { Divider } from "@mui/material";
852
+ import { FlexCol as FlexCol3 } from "@xylabs/react-flexbox";
853
+ import { BoundWitnessSchema as BoundWitnessSchema3 } from "@xyo-network/boundwitness-model";
854
+ import { usePayloadHash as usePayloadHash6 } from "@xyo-network/react-shared";
855
+ import { TableHeightProvider } from "@xyo-network/react-table";
856
+ import React25, { useMemo as useMemo2 } from "react";
857
+ import { FaSignature } from "react-icons/fa";
858
+ import { VscSymbolMethod as VscSymbolMethod2, VscSymbolNamespace as VscSymbolNamespace2 } from "react-icons/vsc";
859
+ var BoundWitnessDetailsBox = /* @__PURE__ */ __name(({ visibleRows, ...props }) => {
860
+ return /* @__PURE__ */ React25.createElement(TableHeightProvider, {
861
+ defaultVisibleRows: visibleRows,
862
+ additionalRows: 1
863
+ }, /* @__PURE__ */ React25.createElement(BoundWitnessDetailsBoxInner, props));
864
+ }, "BoundWitnessDetailsBox");
865
+ BoundWitnessDetailsBox.displayName = "BoundWitnessDetailsBox";
866
+ var BoundWitnessDetailsBoxInner = /* @__PURE__ */ __name(({ payload, ...props }) => {
867
+ const boundWitness = payload;
868
+ const partialBoundWitness = boundWitness;
869
+ const hash = usePayloadHash6(payload);
870
+ const hasBWPayloads = useMemo2(() => partialBoundWitness ? partialBoundWitness.payload_schemas?.includes(BoundWitnessSchema3) : false, [
871
+ partialBoundWitness
872
+ ]);
873
+ return /* @__PURE__ */ React25.createElement(FlexCol3, {
874
+ alignItems: "stretch",
875
+ rowGap: 4,
876
+ ...props
877
+ }, /* @__PURE__ */ React25.createElement(HashHeadingPaper, {
878
+ hash,
879
+ paperProps: {
880
+ sx: {
881
+ p: 2
882
+ }
883
+ },
884
+ AdornmentEnd: /* @__PURE__ */ React25.createElement(BWActions, {
885
+ boundwitness: boundWitness
886
+ }),
887
+ identiconProps: {
888
+ p: 0.75,
889
+ size: 24
890
+ }
891
+ }), /* @__PURE__ */ React25.createElement(Divider, {
892
+ flexItem: true
893
+ }), /* @__PURE__ */ React25.createElement(FlexCol3, {
894
+ alignItems: "stretch",
895
+ rowGap: 1,
896
+ mb: 1
897
+ }, /* @__PURE__ */ React25.createElement(HeadingPaper, {
898
+ IconComponent: /* @__PURE__ */ React25.createElement(VscSymbolNamespace2, null),
899
+ heading: "Payloads"
900
+ }), /* @__PURE__ */ React25.createElement(BoundWitnessPayloadsTable, {
901
+ boundwitness: boundWitness
902
+ })), hasBWPayloads ? /* @__PURE__ */ React25.createElement(FlexCol3, {
903
+ alignItems: "stretch",
904
+ rowGap: 1,
905
+ mb: 1
906
+ }, /* @__PURE__ */ React25.createElement(HeadingPaper, {
907
+ IconComponent: /* @__PURE__ */ React25.createElement(VscSymbolMethod2, null),
908
+ heading: "Bound Witnesses"
909
+ }), /* @__PURE__ */ React25.createElement(BoundWitnessPayloadsTableForBWs, {
910
+ boundwitness: boundWitness
911
+ })) : null, /* @__PURE__ */ React25.createElement(FlexCol3, {
912
+ alignItems: "stretch",
913
+ rowGap: 1,
914
+ mb: 1
915
+ }, /* @__PURE__ */ React25.createElement(HeadingPaper, {
916
+ IconComponent: /* @__PURE__ */ React25.createElement(FaSignature, null),
917
+ heading: "Signatures"
918
+ }), /* @__PURE__ */ React25.createElement(BoundWitnessSignatureTable, {
919
+ block: boundWitness
920
+ })));
921
+ }, "BoundWitnessDetailsBoxInner");
922
+ BoundWitnessDetailsBoxInner.displayName = "BoundWitnessDetailsBoxInner";
923
+
924
+ // src/components/Details/Card/DetailsCard.tsx
925
+ import { TableHeightProvider as TableHeightProvider2 } from "@xyo-network/react-table";
926
+ import React30, { forwardRef as forwardRef9 } from "react";
927
+
928
+ // src/components/Details/Card/DetailsCardInner.tsx
929
+ import { ExpandLessRounded as ExpandLessRoundedIcon, ExpandMoreRounded as ExpandMoreRoundedIcon } from "@mui/icons-material";
930
+ import { Card as Card2, Divider as Divider2, IconButton } from "@mui/material";
931
+ import { useResetState } from "@xylabs/react-hooks";
932
+ import React29, { forwardRef as forwardRef8 } from "react";
933
+
934
+ // src/components/Details/Card/DetailsCardContent.tsx
935
+ import { Collapse as Collapse2 } from "@mui/material";
936
+ import { FlexGrowCol, FlexRow as FlexRow3 } from "@xylabs/react-flexbox";
937
+ import { CardContentEx } from "@xyo-network/react-card";
938
+ import { useTableHeight as useTableHeight2 } from "@xyo-network/react-table";
939
+ import React28, { forwardRef as forwardRef7, useState as useState5 } from "react";
940
+
941
+ // src/components/Details/Card/Navigation/BottomNavigation.tsx
942
+ import { BottomNavigation, BottomNavigationAction, styled as styled7 } from "@mui/material";
943
+ import { BoundWitnessSchema as BoundWitnessSchema4 } from "@xyo-network/boundwitness-model";
944
+ import React26, { forwardRef as forwardRef6 } from "react";
945
+ import { FaSignature as FaSignature2 } from "react-icons/fa";
946
+ import { VscSymbolMethod as VscSymbolMethod3, VscSymbolNamespace as VscSymbolNamespace3 } from "react-icons/vsc";
947
+ var BoundWitnessBottomNavigation = /* @__PURE__ */ forwardRef6(({ activeTab = 0, setActiveTab, boundWitness, ...props }, ref) => {
948
+ const payloadCount = boundWitness?.payload_schemas.filter((schema) => schema !== BoundWitnessSchema4).length ?? 0;
949
+ const boundWitnessCount = boundWitness?.payload_schemas.filter((schema) => schema === BoundWitnessSchema4).length ?? 0;
950
+ const signers = boundWitness?.addresses.length ?? 0;
951
+ return /* @__PURE__ */ React26.createElement(StyledBottomNavigation, {
952
+ showLabels: true,
953
+ value: activeTab,
954
+ onChange: /* @__PURE__ */ __name((_event, newValue) => {
955
+ setActiveTab?.(newValue);
956
+ }, "onChange"),
957
+ ref,
958
+ ...props
959
+ }, /* @__PURE__ */ React26.createElement(BottomNavigationAction, {
960
+ label: `Payloads - ${payloadCount}`,
961
+ icon: /* @__PURE__ */ React26.createElement(VscSymbolNamespace3, null)
962
+ }), /* @__PURE__ */ React26.createElement(BottomNavigationAction, {
963
+ label: `Bound Witnesses - ${boundWitnessCount}`,
964
+ icon: /* @__PURE__ */ React26.createElement(VscSymbolMethod3, null)
965
+ }), /* @__PURE__ */ React26.createElement(BottomNavigationAction, {
966
+ label: `Signatures - ${signers}`,
967
+ icon: /* @__PURE__ */ React26.createElement(FaSignature2, null)
968
+ }));
969
+ });
970
+ BoundWitnessBottomNavigation.displayName = "BoundWitnessBottomNavigation";
971
+ var StyledBottomNavigation = styled7(BottomNavigation, {
972
+ name: "StyledBottomNavigation"
973
+ })(() => ({
974
+ background: "inherit"
975
+ }));
976
+
977
+ // src/components/Details/Card/Navigation/NavigationTabs.tsx
978
+ import { Paper as Paper2, Tab, Tabs, useTheme as useTheme3 } from "@mui/material";
979
+ import { BoundWitnessSchema as BoundWitnessSchema5 } from "@xyo-network/boundwitness-model";
980
+ import React27 from "react";
981
+ import { FaSignature as FaSignature3 } from "react-icons/fa";
982
+ import { VscSymbolMethod as VscSymbolMethod4, VscSymbolNamespace as VscSymbolNamespace4 } from "react-icons/vsc";
983
+ var BWNavigationTabs = /* @__PURE__ */ __name(({ setValue, value, boundWitness, ...props }) => {
984
+ const payloadCount = boundWitness?.payload_schemas.filter((schema) => schema !== BoundWitnessSchema5).length ?? 0;
985
+ const boundWitnessCount = boundWitness?.payload_schemas.filter((schema) => schema === BoundWitnessSchema5).length ?? 0;
986
+ const signers = boundWitness?.addresses.length ?? 0;
987
+ const theme = useTheme3();
988
+ const handleChange = /* @__PURE__ */ __name((_event, newValue) => {
989
+ setValue?.(newValue);
990
+ }, "handleChange");
991
+ const tabProps = {
992
+ iconPosition: "start",
993
+ sx: {
994
+ boxShadow: "none",
995
+ fontSize: theme.spacing(1.75),
996
+ justifyContent: "start",
997
+ lineHeight: 3,
998
+ minHeight: 0,
999
+ overflow: "hidden"
1000
+ }
1001
+ };
1002
+ return /* @__PURE__ */ React27.createElement(Tabs, {
1003
+ orientation: "vertical",
1004
+ value,
1005
+ onChange: handleChange,
1006
+ "aria-label": "BW Vertical tabs",
1007
+ ...props
1008
+ }, /* @__PURE__ */ React27.createElement(Tab, {
1009
+ component: Paper2,
1010
+ elevation: value === 0 ? 3 : 0,
1011
+ ...tabProps,
1012
+ label: `Payloads - ${payloadCount}`,
1013
+ icon: /* @__PURE__ */ React27.createElement(VscSymbolNamespace4, null)
1014
+ }), /* @__PURE__ */ React27.createElement(Tab, {
1015
+ component: Paper2,
1016
+ elevation: value === 1 ? 3 : 0,
1017
+ ...tabProps,
1018
+ label: `Bound Witnesses - ${boundWitnessCount}`,
1019
+ icon: /* @__PURE__ */ React27.createElement(VscSymbolMethod4, null)
1020
+ }), /* @__PURE__ */ React27.createElement(Tab, {
1021
+ component: Paper2,
1022
+ elevation: value === 2 ? 3 : 0,
1023
+ ...tabProps,
1024
+ label: `Signatures - ${signers}`,
1025
+ icon: /* @__PURE__ */ React27.createElement(FaSignature3, null)
1026
+ }));
1027
+ }, "BWNavigationTabs");
1028
+
1029
+ // src/components/Details/Card/DetailsCardContent.tsx
1030
+ var DetailsCardContent = /* @__PURE__ */ forwardRef7(({ collapsed, boundwitness, setCollapsed, ...props }, ref) => {
1031
+ const { height } = useTableHeight2();
1032
+ const [activeTab, setActiveTab] = useState5(0);
1033
+ return /* @__PURE__ */ React28.createElement(CardContentEx, {
1034
+ removePadding: true
1035
+ }, /* @__PURE__ */ React28.createElement(FlexGrowCol, {
1036
+ alignItems: "stretch",
1037
+ height: height !== void 0 && collapsed ? height : "auto",
1038
+ justifyContent: "start",
1039
+ ref
1040
+ }, /* @__PURE__ */ React28.createElement(Collapse2, {
1041
+ in: collapsed
1042
+ }, /* @__PURE__ */ React28.createElement(FlexRow3, {
1043
+ alignItems: "stretch",
1044
+ height: height !== void 0 && collapsed ? height : "auto",
1045
+ ...props
1046
+ }, /* @__PURE__ */ React28.createElement(BWNavigationTabs, {
1047
+ value: activeTab,
1048
+ setValue: setActiveTab,
1049
+ boundWitness: boundwitness
1050
+ }), /* @__PURE__ */ React28.createElement(FlexGrowCol, {
1051
+ justifyContent: "start",
1052
+ overflow: "scroll",
1053
+ sx: {
1054
+ borderLeft: "1px solid",
1055
+ borderLeftColor: "divider"
1056
+ }
1057
+ }, activeTab === 0 ? /* @__PURE__ */ React28.createElement(BoundWitnessPayloadsTable, {
1058
+ boundwitness,
1059
+ variant: "scrollable"
1060
+ }) : null, activeTab === 1 ? /* @__PURE__ */ React28.createElement(BoundWitnessPayloadsTableForBWs, {
1061
+ boundwitness,
1062
+ variant: "scrollable"
1063
+ }) : null, activeTab === 2 ? /* @__PURE__ */ React28.createElement(BoundWitnessSignatureTable, {
1064
+ block: boundwitness,
1065
+ variant: "scrollable"
1066
+ }) : null)))), /* @__PURE__ */ React28.createElement(Collapse2, {
1067
+ in: !collapsed,
1068
+ unmountOnExit: true
1069
+ }, /* @__PURE__ */ React28.createElement(BoundWitnessBottomNavigation, {
1070
+ onClick: /* @__PURE__ */ __name(() => setCollapsed?.(true), "onClick"),
1071
+ activeTab,
1072
+ setActiveTab,
1073
+ boundWitness: boundwitness
1074
+ })));
1075
+ });
1076
+ DetailsCardContent.displayName = "DetailsCardContent";
1077
+
1078
+ // src/components/Details/Card/DetailsCardInner.tsx
1079
+ var BoundWitnessDetailsCardInner = /* @__PURE__ */ forwardRef8(({ payload, active, ...props }, ref) => {
1080
+ const boundwitness = payload;
1081
+ const [collapsed, setCollapsed] = useResetState(!active);
1082
+ return /* @__PURE__ */ React29.createElement(Card2, {
1083
+ ref,
1084
+ ...props
1085
+ }, /* @__PURE__ */ React29.createElement(BoundWitnessCardHeader, {
1086
+ payload,
1087
+ active,
1088
+ activeBgColor: false,
1089
+ hideJSONButton: false,
1090
+ hideValidation: false,
1091
+ hidePreviousHash: false,
1092
+ additionalActions: /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(Divider2, {
1093
+ flexItem: true,
1094
+ orientation: "vertical",
1095
+ sx: {
1096
+ ml: 2,
1097
+ mr: 1
1098
+ }
1099
+ }), /* @__PURE__ */ React29.createElement(IconButton, {
1100
+ onClick: /* @__PURE__ */ __name(() => setCollapsed(!collapsed), "onClick")
1101
+ }, collapsed ? /* @__PURE__ */ React29.createElement(ExpandMoreRoundedIcon, null) : /* @__PURE__ */ React29.createElement(ExpandLessRoundedIcon, null))),
1102
+ sx: {
1103
+ columnGap: 2
1104
+ }
1105
+ }), /* @__PURE__ */ React29.createElement(DetailsCardContent, {
1106
+ boundwitness,
1107
+ collapsed,
1108
+ setCollapsed,
1109
+ ref
1110
+ }));
1111
+ });
1112
+ BoundWitnessDetailsCardInner.displayName = "BoundWitnessDetailsCardInner";
1113
+
1114
+ // src/components/Details/Card/DetailsCard.tsx
1115
+ var BoundWitnessDetailsCard = /* @__PURE__ */ forwardRef9(({ visibleRows, ...props }, ref) => {
1116
+ return /* @__PURE__ */ React30.createElement(TableHeightProvider2, {
1117
+ defaultVisibleRows: visibleRows,
1118
+ additionalRows: 1
1119
+ }, /* @__PURE__ */ React30.createElement(BoundWitnessDetailsCardInner, {
1120
+ ref,
1121
+ ...props
1122
+ }));
1123
+ });
1124
+ BoundWitnessDetailsCard.displayName = "BoundWitnessDetailsCard";
1125
+
1126
+ // src/components/Details/Details.tsx
1127
+ import { FlexCol as FlexCol5 } from "@xylabs/react-flexbox";
1128
+ import { PayloadDataDetails, PayloadJsonDetails } from "@xyo-network/react-payload-details";
1129
+ import React32, { forwardRef as forwardRef10 } from "react";
1130
+
1131
+ // src/components/Details/ValidationDetails.tsx
1132
+ import { Typography as Typography6 } from "@mui/material";
1133
+ import { FlexCol as FlexCol4 } from "@xylabs/react-flexbox";
1134
+ import { usePromise as usePromise3 } from "@xylabs/react-promise";
1135
+ import { BoundWitnessValidator as BoundWitnessValidator3 } from "@xyo-network/boundwitness-validator";
1136
+ import { Property, PropertyGroup as PropertyGroup3 } from "@xyo-network/react-property";
1137
+ import React31 from "react";
1138
+ var BoundWitnessValidationDetails = /* @__PURE__ */ __name(({ value, ...props }) => {
1139
+ const [errors = []] = usePromise3(async () => await (value ? new BoundWitnessValidator3(value).validate() : void 0), [
1140
+ value
1141
+ ]);
1142
+ let elevation = 2;
1143
+ if (props.paper) {
1144
+ elevation += props.elevation ?? 0;
1145
+ }
1146
+ return /* @__PURE__ */ React31.createElement(PropertyGroup3, {
1147
+ titleProps: {
1148
+ elevation
1149
+ },
1150
+ title: "Validation",
1151
+ tip: "The results from validating the block",
1152
+ ...props
1153
+ }, /* @__PURE__ */ React31.createElement(Property, {
1154
+ titleProps: {
1155
+ elevation
1156
+ },
1157
+ flexGrow: 1,
1158
+ title: "Valid",
1159
+ value: errors.length === 0 ? "True" : "False",
1160
+ tip: errors.length > 0 ? /* @__PURE__ */ React31.createElement(FlexCol4, {
1161
+ flexWrap: "wrap"
1162
+ }, errors.map((error, index) => {
1163
+ return /* @__PURE__ */ React31.createElement(Typography6, {
1164
+ key: index
1165
+ }, error.toString());
1166
+ })) : /* @__PURE__ */ React31.createElement(Typography6, null, "No Errors")
1167
+ }));
1168
+ }, "BoundWitnessValidationDetails");
1169
+
1170
+ // src/components/Details/Details.tsx
1171
+ var BoundWitnessDetails = /* @__PURE__ */ forwardRef10(({ paper, payload, children, ...props }, ref) => {
1172
+ const boundwitness = payload;
1173
+ return /* @__PURE__ */ React32.createElement(FlexCol5, {
1174
+ justifyContent: "flex-start",
1175
+ alignItems: "stretch",
1176
+ gap: 1,
1177
+ ref,
1178
+ ...props
1179
+ }, /* @__PURE__ */ React32.createElement(PayloadDataDetails, {
1180
+ paper,
1181
+ payload: boundwitness,
1182
+ size: "large",
1183
+ badge: true
1184
+ }), /* @__PURE__ */ React32.createElement(BoundWitnessPayloads, {
1185
+ paper,
1186
+ payload: boundwitness
1187
+ }), /* @__PURE__ */ React32.createElement(BoundWitnessSignatureDetails, {
1188
+ paper,
1189
+ block: boundwitness
1190
+ }), /* @__PURE__ */ React32.createElement(BoundWitnessValidationDetails, {
1191
+ paper,
1192
+ value: boundwitness
1193
+ }), /* @__PURE__ */ React32.createElement(PayloadJsonDetails, {
1194
+ paper,
1195
+ payload: boundwitness
1196
+ }), children);
1197
+ });
1198
+ BoundWitnessDetails.displayName = "BoundWitnessDetails [XYO]";
1199
+
1200
+ // src/Plugin.ts
1201
+ import { createPayloadRenderPlugin } from "@xyo-network/react-payload-plugin";
1202
+ var BoundWitnessRenderPlugin = {
1203
+ ...createPayloadRenderPlugin({
1204
+ canRender: /* @__PURE__ */ __name((payload) => payload?.schema === "network.xyo.boundwitness", "canRender"),
1205
+ components: {
1206
+ box: {
1207
+ detailsBox: BoundWitnessDetailsBox
1208
+ },
1209
+ card: {
1210
+ content: BoundWitnessCardContent,
1211
+ header: BoundWitnessCardHeader
1212
+ }
1213
+ },
1214
+ name: "BoundWitness"
1215
+ })
1216
+ };
1217
+ export {
1218
+ BWActions,
1219
+ BWHeading,
1220
+ BWJsonMenuItem,
1221
+ BWPreviousHashMenuItem,
1222
+ BWPreviousHashQuickTipButton,
1223
+ BWVerification,
1224
+ BoundWitnessCardContent,
1225
+ BoundWitnessCardHeader,
1226
+ BoundWitnessDetails,
1227
+ BoundWitnessDetailsBox,
1228
+ BoundWitnessDetailsCard,
1229
+ BoundWitnessPayloads,
1230
+ BoundWitnessPayloadsTable,
1231
+ BoundWitnessPayloadsTableForBWs,
1232
+ BoundWitnessPayloadsTableInner,
1233
+ BoundWitnessRenderPlugin,
1234
+ BoundWitnessRendererCard,
1235
+ BoundWitnessSignatureDetails,
1236
+ BoundWitnessSignatureTable,
1237
+ BoundWitnessValidationDetails,
1238
+ CardColumnTitle,
1239
+ CardColumnTitleH2,
1240
+ CardColumnsFlex,
1241
+ CardContentFlex,
1242
+ HashHeadingPaper,
1243
+ HeadingPaper,
1244
+ PreviousHashDialogContent
1245
+ };
1246
+ //# sourceMappingURL=index.mjs.map