import { b as generateId } from "./dist-CdWSQzOH.js";
import { m as actions } from "./module-GSyfQ2a7.js";
import "./upgrade-manifest-BIwYwBhU.js";
import "./document-drive-DwMcPeeu.js";
import "./chunk-VBDAOXYI-DxYKDIjC.js";
import "./dist-B2aX2Fsh.js";
import { i as useSelectedGrantSystemDocument } from "./grant-system-BbYpxivd.js";
import "./load-design-tokens-DI8M2VZx.js";
import { t as DocumentToolbar } from "./connect-9ej7S5NE-Db2m-K1a.js";
import { useCallback, useState } from "react";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
//#region editors/grant-system-editor/components/OrgProfile.tsx
const TYPE_OPTIONS = [
	"DAO",
	"FOUNDATION",
	"PROTOCOL",
	"COMPANY",
	"PROGRAM",
	"PERSON",
	"OTHER"
];
function OrgProfile(p) {
	return /* @__PURE__ */ jsxs("section", {
		className: "rfp-card rfp-section",
		children: [
			/* @__PURE__ */ jsxs("div", {
				className: "rfp-col",
				children: [/* @__PURE__ */ jsx("h2", {
					className: "rfp-section-subtitle",
					children: "Organization profile"
				}), /* @__PURE__ */ jsx("p", {
					className: "rfp-hint",
					children: "DAOIP-5 Grant System identity fields."
				})]
			}),
			/* @__PURE__ */ jsx("hr", { className: "rfp-divider" }),
			/* @__PURE__ */ jsxs("div", {
				className: "rfp-grid-2",
				children: [/* @__PURE__ */ jsxs("label", {
					className: "rfp-field",
					children: [/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Name"
					}), /* @__PURE__ */ jsx("input", {
						className: "rfp-input",
						defaultValue: p.state.name ?? "",
						placeholder: "e.g. Ethereum Foundation",
						onBlur: (e) => {
							const v = e.target.value.trim();
							if (v !== (p.state.name ?? "")) p.onSetOrgName(v);
						}
					})]
				}), /* @__PURE__ */ jsxs("label", {
					className: "rfp-field",
					children: [/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Type"
					}), /* @__PURE__ */ jsxs("select", {
						className: "rfp-select",
						value: p.state.type ?? "",
						onChange: (e) => {
							const v = e.target.value;
							if (v) p.onSetType(v);
						},
						children: [/* @__PURE__ */ jsx("option", {
							value: "",
							disabled: true,
							children: "Select type…"
						}), TYPE_OPTIONS.map((t) => /* @__PURE__ */ jsx("option", {
							value: t,
							children: t.toLowerCase()
						}, t))]
					})]
				})]
			}),
			/* @__PURE__ */ jsxs("div", {
				className: "rfp-grid-2",
				children: [/* @__PURE__ */ jsxs("label", {
					className: "rfp-field",
					children: [/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Short code"
					}), /* @__PURE__ */ jsx("input", {
						className: "rfp-input",
						defaultValue: p.state.code ?? "",
						placeholder: "e.g. EF, OCS, OPTIMISM",
						onBlur: (e) => p.onSetCode(e.target.value.trim())
					})]
				}), /* @__PURE__ */ jsxs("label", {
					className: "rfp-field",
					children: [/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Grant pools index URI"
					}), /* @__PURE__ */ jsx("input", {
						className: "rfp-input",
						defaultValue: p.state.grantPoolsURI ?? "",
						placeholder: "https://…",
						onBlur: (e) => p.onSetGrantPoolsUri(e.target.value.trim())
					})]
				})]
			}),
			/* @__PURE__ */ jsxs("label", {
				className: "rfp-field",
				children: [/* @__PURE__ */ jsx("span", {
					className: "rfp-label",
					children: "Description"
				}), /* @__PURE__ */ jsx("textarea", {
					className: "rfp-textarea",
					defaultValue: p.state.description ?? "",
					placeholder: "What this organization funds and why.",
					onBlur: (e) => p.onSetDescription(e.target.value.trim())
				})]
			}),
			/* @__PURE__ */ jsxs("div", {
				className: "rfp-grid-2",
				children: [/* @__PURE__ */ jsxs("label", {
					className: "rfp-field",
					children: [/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Logo URL"
					}), /* @__PURE__ */ jsx("input", {
						className: "rfp-input",
						defaultValue: p.state.image ?? "",
						placeholder: "https://…",
						onBlur: (e) => p.onSetImage(e.target.value.trim())
					})]
				}), /* @__PURE__ */ jsxs("label", {
					className: "rfp-field",
					children: [/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Cover image URL"
					}), /* @__PURE__ */ jsx("input", {
						className: "rfp-input",
						defaultValue: p.state.coverImage ?? "",
						placeholder: "https://…",
						onBlur: (e) => p.onSetCoverImage(e.target.value.trim())
					})]
				})]
			})
		]
	});
}
//#endregion
//#region editors/grant-system-editor/components/ContactPanel.tsx
function ContactPanel({ state, onSetEmail, onSetContactName }) {
	return /* @__PURE__ */ jsxs("section", {
		className: "rfp-card rfp-section",
		children: [
			/* @__PURE__ */ jsx("div", {
				className: "rfp-col",
				children: /* @__PURE__ */ jsx("h2", {
					className: "rfp-section-subtitle",
					children: "Contact"
				})
			}),
			/* @__PURE__ */ jsx("hr", { className: "rfp-divider" }),
			/* @__PURE__ */ jsxs("div", {
				className: "rfp-grid-2",
				children: [/* @__PURE__ */ jsxs("label", {
					className: "rfp-field",
					children: [/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Primary contact name"
					}), /* @__PURE__ */ jsx("input", {
						className: "rfp-input",
						defaultValue: state.contactName ?? "",
						placeholder: "e.g. Grants Team",
						onBlur: (e) => onSetContactName(e.target.value.trim())
					})]
				}), /* @__PURE__ */ jsxs("label", {
					className: "rfp-field",
					children: [/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Email"
					}), /* @__PURE__ */ jsx("input", {
						className: "rfp-input",
						type: "email",
						defaultValue: state.email ?? "",
						placeholder: "grants@example.org",
						onBlur: (e) => onSetEmail(e.target.value.trim())
					})]
				})]
			})
		]
	});
}
//#endregion
//#region editors/grant-system-editor/components/LinksPanel.tsx
const SOCIAL_PLATFORMS = [
	"TWITTER",
	"DISCORD",
	"TELEGRAM",
	"GITHUB",
	"LINKEDIN",
	"FARCASTER",
	"LENS",
	"MIRROR",
	"WEBSITE"
];
function LinksPanel(p) {
	const [sameAsDraft, setSameAsDraft] = useState("");
	const [platformDraft, setPlatformDraft] = useState("TWITTER");
	const [urlDraft, setUrlDraft] = useState("");
	const handleAddSameAs = () => {
		const v = sameAsDraft.trim();
		if (!v) return;
		p.onAddSameAs(v);
		setSameAsDraft("");
	};
	const handleAddSocial = () => {
		const v = urlDraft.trim();
		if (!v) return;
		p.onAddSocial(platformDraft, v);
		setUrlDraft("");
	};
	return /* @__PURE__ */ jsxs("section", {
		className: "rfp-card rfp-section",
		children: [
			/* @__PURE__ */ jsxs("div", {
				className: "rfp-col",
				children: [/* @__PURE__ */ jsx("h2", {
					className: "rfp-section-subtitle",
					children: "Identity links"
				}), /* @__PURE__ */ jsxs("p", {
					className: "rfp-hint",
					children: [
						"schema.org ",
						/* @__PURE__ */ jsx("code", { children: "sameAs" }),
						" references (Wikipedia, Wikidata, official site) and social media channels."
					]
				})]
			}),
			/* @__PURE__ */ jsx("hr", { className: "rfp-divider" }),
			/* @__PURE__ */ jsxs("div", {
				className: "rfp-col",
				children: [
					/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Canonical identity (sameAs)"
					}),
					/* @__PURE__ */ jsxs("div", {
						className: "rfp-row",
						children: [/* @__PURE__ */ jsx("input", {
							className: "rfp-input",
							style: { flex: 1 },
							placeholder: "https://…",
							value: sameAsDraft,
							onChange: (e) => setSameAsDraft(e.target.value),
							onKeyDown: (e) => {
								if (e.key === "Enter") {
									e.preventDefault();
									handleAddSameAs();
								}
							}
						}), /* @__PURE__ */ jsx("button", {
							className: "rfp-btn-secondary",
							onClick: handleAddSameAs,
							children: "Add"
						})]
					}),
					p.state.sameAs.length === 0 ? /* @__PURE__ */ jsx("div", {
						className: "rfp-empty",
						children: "No identity links yet."
					}) : /* @__PURE__ */ jsx("ul", {
						className: "rfp-list",
						children: p.state.sameAs.map((url) => /* @__PURE__ */ jsxs("li", {
							className: "rfp-list-item",
							children: [/* @__PURE__ */ jsx("a", {
								href: url,
								target: "_blank",
								rel: "noreferrer",
								style: {
									color: "inherit",
									textDecoration: "none"
								},
								children: url
							}), /* @__PURE__ */ jsx("button", {
								className: "rfp-btn-ghost",
								onClick: () => p.onRemoveSameAs(url),
								"aria-label": "Remove link",
								children: "Remove"
							})]
						}, url))
					})
				]
			}),
			/* @__PURE__ */ jsxs("div", {
				className: "rfp-col",
				children: [
					/* @__PURE__ */ jsx("span", {
						className: "rfp-label",
						children: "Socials"
					}),
					/* @__PURE__ */ jsxs("div", {
						className: "rfp-row",
						children: [
							/* @__PURE__ */ jsx("select", {
								className: "rfp-select",
								style: { maxWidth: 160 },
								value: platformDraft,
								onChange: (e) => setPlatformDraft(e.target.value),
								children: SOCIAL_PLATFORMS.map((p) => /* @__PURE__ */ jsx("option", {
									value: p,
									children: p.toLowerCase()
								}, p))
							}),
							/* @__PURE__ */ jsx("input", {
								className: "rfp-input",
								style: { flex: 1 },
								placeholder: "https://twitter.com/…",
								value: urlDraft,
								onChange: (e) => setUrlDraft(e.target.value),
								onKeyDown: (e) => {
									if (e.key === "Enter") {
										e.preventDefault();
										handleAddSocial();
									}
								}
							}),
							/* @__PURE__ */ jsx("button", {
								className: "rfp-btn-secondary",
								onClick: handleAddSocial,
								children: "Add"
							})
						]
					}),
					p.state.socials.length === 0 ? /* @__PURE__ */ jsx("div", {
						className: "rfp-empty",
						children: "No socials yet."
					}) : /* @__PURE__ */ jsx("ul", {
						className: "rfp-list",
						children: p.state.socials.map((s) => /* @__PURE__ */ jsxs("li", {
							className: "rfp-list-item",
							children: [/* @__PURE__ */ jsxs("div", {
								className: "rfp-row",
								style: {
									gap: 12,
									flex: 1,
									minWidth: 0
								},
								children: [/* @__PURE__ */ jsx("span", {
									className: "rfp-chip",
									children: s.platform.toLowerCase()
								}), /* @__PURE__ */ jsx("input", {
									className: "rfp-input",
									style: { flex: 1 },
									defaultValue: s.url,
									onBlur: (e) => {
										const v = e.target.value.trim();
										if (v && v !== s.url) p.onUpdateSocialUrl(s.id, v);
									}
								})]
							}), /* @__PURE__ */ jsx("button", {
								className: "rfp-btn-ghost",
								onClick: () => p.onRemoveSocial(s.id),
								"aria-label": "Remove social",
								children: "Remove"
							})]
						}, s.id))
					})
				]
			})
		]
	});
}
//#endregion
//#region editors/grant-system-editor/components/VerificationPanel.tsx
function VerificationPanel(p) {
	const [verifier, setVerifier] = useState("");
	const [method, setMethod] = useState("MANUAL_REVIEW");
	const [rejectReason, setRejectReason] = useState("");
	const [suspendReason, setSuspendReason] = useState("");
	const [revocationReason, setRevocationReason] = useState("");
	const [reinstatedBy, setReinstatedBy] = useState("");
	const canRequest = p.state.verificationState === "UNVERIFIED";
	const canApprove = p.state.verificationState === "PENDING_REVIEW";
	const canReject = p.state.verificationState === "PENDING_REVIEW";
	const canSuspend = p.state.verificationState === "VERIFIED";
	const canRevoke = p.state.verificationState === "VERIFIED";
	const canReinstate = p.state.verificationState === "SUSPENDED" || p.state.verificationState === "REVOKED";
	return /* @__PURE__ */ jsxs("section", {
		className: "rfp-card rfp-section",
		children: [
			/* @__PURE__ */ jsxs("div", {
				className: "rfp-col",
				children: [/* @__PURE__ */ jsx("h2", {
					className: "rfp-section-subtitle",
					children: "Verification"
				}), /* @__PURE__ */ jsx("p", {
					className: "rfp-hint",
					children: "Publisher verification lifecycle for the RFP Hub allowlist."
				})]
			}),
			/* @__PURE__ */ jsx("hr", { className: "rfp-divider" }),
			/* @__PURE__ */ jsxs("label", {
				className: "rfp-field",
				children: [/* @__PURE__ */ jsx("span", {
					className: "rfp-label",
					children: "Publisher wallet (authoritative signer)"
				}), /* @__PURE__ */ jsx("input", {
					className: "rfp-input",
					defaultValue: p.state.publisherWallet ?? "",
					placeholder: "0x…",
					onBlur: (e) => {
						const v = e.target.value.trim();
						if (v) p.onSetPublisherWallet(v);
					}
				})]
			}),
			/* @__PURE__ */ jsx("div", {
				className: "rfp-row",
				style: { gap: 12 },
				children: /* @__PURE__ */ jsx("button", {
					className: "rfp-btn-primary",
					disabled: !canRequest,
					onClick: p.onRequestVerification,
					children: "Request verification"
				})
			}),
			canApprove ? /* @__PURE__ */ jsx("div", {
				className: "rfp-card",
				style: { background: "#fff" },
				children: /* @__PURE__ */ jsxs("div", {
					className: "rfp-section",
					children: [
						/* @__PURE__ */ jsx("span", {
							className: "rfp-label",
							children: "Approve verification"
						}),
						/* @__PURE__ */ jsxs("div", {
							className: "rfp-grid-2",
							children: [/* @__PURE__ */ jsxs("label", {
								className: "rfp-field",
								children: [/* @__PURE__ */ jsx("span", {
									className: "rfp-label",
									children: "Verifier DID"
								}), /* @__PURE__ */ jsx("input", {
									className: "rfp-input",
									value: verifier,
									onChange: (e) => setVerifier(e.target.value),
									placeholder: "did:pkh:eip155:1:0x…"
								})]
							}), /* @__PURE__ */ jsxs("label", {
								className: "rfp-field",
								children: [/* @__PURE__ */ jsx("span", {
									className: "rfp-label",
									children: "Method"
								}), /* @__PURE__ */ jsxs("select", {
									className: "rfp-select",
									value: method,
									onChange: (e) => setMethod(e.target.value),
									children: [
										/* @__PURE__ */ jsx("option", {
											value: "MANUAL_REVIEW",
											children: "Manual review"
										}),
										/* @__PURE__ */ jsx("option", {
											value: "DOMAIN_VERIFICATION",
											children: "Domain verification"
										}),
										/* @__PURE__ */ jsx("option", {
											value: "WALLET_SIGNATURE",
											children: "Wallet signature"
										}),
										/* @__PURE__ */ jsx("option", {
											value: "THIRD_PARTY_ATTESTATION",
											children: "Third-party attestation"
										})
									]
								})]
							})]
						}),
						/* @__PURE__ */ jsxs("div", {
							className: "rfp-row",
							style: {
								gap: 8,
								flexWrap: "wrap"
							},
							children: [/* @__PURE__ */ jsx("button", {
								className: "rfp-btn-primary",
								disabled: !verifier.trim(),
								onClick: () => {
									p.onApproveVerification(verifier.trim(), method);
									setVerifier("");
								},
								children: "Approve"
							}), canReject ? /* @__PURE__ */ jsx("button", {
								className: "rfp-btn-secondary",
								disabled: !rejectReason.trim(),
								onClick: () => {
									p.onRejectVerification(rejectReason.trim());
									setRejectReason("");
								},
								style: { color: "var(--rfp-error)" },
								children: "Reject"
							}) : null]
						}),
						canReject ? /* @__PURE__ */ jsxs("label", {
							className: "rfp-field",
							children: [/* @__PURE__ */ jsx("span", {
								className: "rfp-label",
								children: "Rejection reason"
							}), /* @__PURE__ */ jsx("input", {
								className: "rfp-input",
								value: rejectReason,
								onChange: (e) => setRejectReason(e.target.value),
								placeholder: "Why rejecting"
							})]
						}) : null
					]
				})
			}) : null,
			canSuspend || canRevoke ? /* @__PURE__ */ jsx("div", {
				className: "rfp-card",
				style: { background: "#fff" },
				children: /* @__PURE__ */ jsxs("div", {
					className: "rfp-section",
					children: [
						/* @__PURE__ */ jsx("span", {
							className: "rfp-label",
							children: "Suspend / Revoke"
						}),
						canSuspend ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("label", {
							className: "rfp-field",
							children: [/* @__PURE__ */ jsx("span", {
								className: "rfp-label",
								children: "Suspension reason"
							}), /* @__PURE__ */ jsx("input", {
								className: "rfp-input",
								value: suspendReason,
								onChange: (e) => setSuspendReason(e.target.value),
								placeholder: "Reason for suspension"
							})]
						}), /* @__PURE__ */ jsx("button", {
							className: "rfp-btn-secondary",
							disabled: !suspendReason.trim(),
							onClick: () => {
								p.onSuspendVerification(suspendReason.trim());
								setSuspendReason("");
							},
							style: { alignSelf: "flex-start" },
							children: "Suspend"
						})] }) : null,
						canRevoke ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("label", {
							className: "rfp-field",
							children: [/* @__PURE__ */ jsx("span", {
								className: "rfp-label",
								children: "Revocation reason"
							}), /* @__PURE__ */ jsx("textarea", {
								className: "rfp-textarea",
								value: revocationReason,
								onChange: (e) => setRevocationReason(e.target.value),
								placeholder: "Why is verification being revoked?"
							})]
						}), /* @__PURE__ */ jsx("button", {
							className: "rfp-btn-secondary",
							disabled: !revocationReason.trim(),
							onClick: () => {
								p.onRevokeVerification(revocationReason.trim());
								setRevocationReason("");
							},
							style: {
								color: "var(--rfp-error)",
								alignSelf: "flex-start"
							},
							children: "Revoke"
						})] }) : null
					]
				})
			}) : null,
			canReinstate ? /* @__PURE__ */ jsx("div", {
				className: "rfp-card",
				style: { background: "#fff" },
				children: /* @__PURE__ */ jsxs("div", {
					className: "rfp-section",
					children: [
						/* @__PURE__ */ jsx("span", {
							className: "rfp-label",
							children: "Reinstate verification"
						}),
						/* @__PURE__ */ jsxs("label", {
							className: "rfp-field",
							children: [/* @__PURE__ */ jsx("span", {
								className: "rfp-label",
								children: "Reinstated by (DID)"
							}), /* @__PURE__ */ jsx("input", {
								className: "rfp-input",
								value: reinstatedBy,
								onChange: (e) => setReinstatedBy(e.target.value),
								placeholder: "did:pkh:eip155:1:0x…"
							})]
						}),
						/* @__PURE__ */ jsx("button", {
							className: "rfp-btn-primary",
							disabled: !reinstatedBy.trim(),
							onClick: () => {
								p.onReinstateVerification(reinstatedBy.trim());
								setReinstatedBy("");
							},
							style: { alignSelf: "flex-start" },
							children: "Reinstate"
						})
					]
				})
			}) : null,
			p.state.revokedAt || p.state.revocationReason ? /* @__PURE__ */ jsxs("p", {
				className: "rfp-hint",
				children: [p.state.revokedAt ? `Revoked/suspended ${new Date(p.state.revokedAt).toLocaleString()}` : "", p.state.revocationReason ? ` · ${p.state.revocationReason}` : ""]
			}) : null,
			p.state.verifiedAt ? /* @__PURE__ */ jsxs("p", {
				className: "rfp-hint",
				children: [
					"Verified",
					" ",
					new Date(p.state.verifiedAt).toLocaleString(),
					p.state.verifiedBy ? ` by ${p.state.verifiedBy}` : "",
					p.state.verificationMethod ? ` via ${p.state.verificationMethod.toLowerCase().replace(/_/g, " ")}` : ""
				]
			}) : null
		]
	});
}
//#endregion
//#region editors/grant-system-editor/components/VerificationBadge.tsx
const LABEL = {
	UNVERIFIED: "Unverified",
	PENDING_REVIEW: "Pending review",
	VERIFIED: "Verified",
	SUSPENDED: "Suspended",
	REVOKED: "Revoked"
};
const CLASS = {
	UNVERIFIED: "rfp-status-draft",
	PENDING_REVIEW: "rfp-status-pending",
	VERIFIED: "rfp-status-approved",
	SUSPENDED: "rfp-status-closed",
	REVOKED: "rfp-status-rejected"
};
function VerificationBadge({ state }) {
	return /* @__PURE__ */ jsx("span", {
		className: `rfp-status-badge ${CLASS[state] ?? "rfp-status-draft"}`,
		children: LABEL[state] ?? state
	});
}
//#endregion
//#region editors/grant-system-editor/components/ExtensionsPanel.tsx
function ExtensionsPanel({ state, on }) {
	const [expanded, setExpanded] = useState(false);
	return /* @__PURE__ */ jsxs("section", {
		className: "rfp-card rfp-section",
		children: [/* @__PURE__ */ jsxs("div", {
			className: "rfp-row",
			style: { justifyContent: "space-between" },
			children: [/* @__PURE__ */ jsxs("h2", {
				className: "rfp-section-subtitle",
				children: ["DAOIP-5 extensions ", state.extensions ? "· set" : "· empty"]
			}), /* @__PURE__ */ jsx("button", {
				className: "rfp-btn-ghost",
				onClick: () => setExpanded((v) => !v),
				children: expanded ? "Hide" : "Show"
			})]
		}), expanded ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("hr", { className: "rfp-divider" }), /* @__PURE__ */ jsxs("label", {
			className: "rfp-field",
			children: [/* @__PURE__ */ jsx("span", {
				className: "rfp-label",
				children: "Extensions (JSON)"
			}), /* @__PURE__ */ jsx("textarea", {
				className: "rfp-textarea",
				defaultValue: state.extensions ?? "",
				placeholder: "{\"vendorKey\": \"value\"}",
				onBlur: (e) => on.setExtensions(e.target.value),
				style: {
					fontFamily: "monospace",
					minHeight: 120
				}
			})]
		})] }) : null]
	});
}
//#endregion
//#region editors/grant-system-editor/editor.tsx
function Editor() {
	const [document, dispatch] = useSelectedGrantSystemDocument();
	if (!document) return null;
	const state = document.state.global;
	const onSetOrgName = useCallback((name) => dispatch(actions.setOrgName({ name })), [dispatch]);
	const onSetType = useCallback((type) => type && dispatch(actions.setType({ type })), [dispatch]);
	const onSetCode = useCallback((code) => dispatch(actions.setCode({ code })), [dispatch]);
	const onSetDescription = useCallback((description) => dispatch(actions.setDescription({ description })), [dispatch]);
	const onSetGrantPoolsUri = useCallback((grantPoolsURI) => dispatch(actions.setGrantPoolsUri({ grantPoolsURI })), [dispatch]);
	const onSetImage = useCallback((image) => dispatch(actions.setImage({ image })), [dispatch]);
	const onSetCoverImage = useCallback((coverImage) => dispatch(actions.setCoverImage({ coverImage })), [dispatch]);
	const onSetEmail = useCallback((email) => dispatch(actions.setEmail({ email })), [dispatch]);
	const onSetContactName = useCallback((contactName) => dispatch(actions.setContactName({ contactName })), [dispatch]);
	const onAddSameAs = useCallback((url) => dispatch(actions.addSameAs({ url })), [dispatch]);
	const onRemoveSameAs = useCallback((url) => dispatch(actions.removeSameAs({ url })), [dispatch]);
	const onAddSocial = useCallback((platform, url) => dispatch(actions.addSocial({
		id: generateId(),
		platform,
		url
	})), [dispatch]);
	const onRemoveSocial = useCallback((id) => dispatch(actions.removeSocial({ id })), [dispatch]);
	const onUpdateSocialUrl = useCallback((id, url) => dispatch(actions.updateSocialUrl({
		id,
		url
	})), [dispatch]);
	const onSetExtensions = useCallback((extensions) => dispatch(actions.setExtensions({ extensions })), [dispatch]);
	const onSetPublisherWallet = useCallback((publisherWallet) => dispatch(actions.setPublisherWallet({ publisherWallet })), [dispatch]);
	const onRequestVerification = useCallback(() => dispatch(actions.requestVerification({ requestedAt: (/* @__PURE__ */ new Date()).toISOString() })), [dispatch]);
	const onApproveVerification = useCallback((verifiedBy, method) => dispatch(actions.approveVerification({
		verifiedBy,
		method,
		verifiedAt: (/* @__PURE__ */ new Date()).toISOString()
	})), [dispatch]);
	const onRejectVerification = useCallback((reason) => dispatch(actions.rejectVerification({
		reason,
		rejectedAt: (/* @__PURE__ */ new Date()).toISOString()
	})), [dispatch]);
	const onSuspendVerification = useCallback((reason) => dispatch(actions.suspendVerification({
		reason,
		suspendedAt: (/* @__PURE__ */ new Date()).toISOString()
	})), [dispatch]);
	const onRevokeVerification = useCallback((reason) => dispatch(actions.revokeVerification({
		reason,
		revokedAt: (/* @__PURE__ */ new Date()).toISOString()
	})), [dispatch]);
	const onReinstateVerification = useCallback((reinstatedBy) => dispatch(actions.reinstateVerification({
		reinstatedBy,
		verifiedAt: (/* @__PURE__ */ new Date()).toISOString()
	})), [dispatch]);
	return /* @__PURE__ */ jsxs("div", {
		className: "rfp-scope",
		children: [/* @__PURE__ */ jsx(DocumentToolbar, {}), /* @__PURE__ */ jsx("div", {
			className: "rfp-page",
			children: /* @__PURE__ */ jsxs("div", {
				className: "rfp-page-inner",
				children: [
					/* @__PURE__ */ jsxs("header", {
						className: "rfp-header",
						children: [/* @__PURE__ */ jsxs("div", {
							className: "rfp-header-row",
							children: [/* @__PURE__ */ jsxs("div", {
								className: "rfp-col",
								children: [/* @__PURE__ */ jsx("span", {
									className: "rfp-meta",
									children: "Grant System · DAOIP-5"
								}), /* @__PURE__ */ jsx("h1", {
									className: "rfp-h1",
									children: state.name || "Unnamed organization"
								})]
							}), /* @__PURE__ */ jsx(VerificationBadge, { state: state.verificationState })]
						}), state.description ? /* @__PURE__ */ jsx("p", {
							className: "rfp-body",
							style: { maxWidth: 680 },
							children: state.description
						}) : null]
					}),
					/* @__PURE__ */ jsx(OrgProfile, {
						state,
						onSetOrgName,
						onSetType,
						onSetCode,
						onSetDescription,
						onSetGrantPoolsUri,
						onSetImage,
						onSetCoverImage
					}),
					/* @__PURE__ */ jsx(ContactPanel, {
						state,
						onSetEmail,
						onSetContactName
					}),
					/* @__PURE__ */ jsx(LinksPanel, {
						state,
						onAddSameAs,
						onRemoveSameAs,
						onAddSocial,
						onRemoveSocial,
						onUpdateSocialUrl
					}),
					/* @__PURE__ */ jsx(VerificationPanel, {
						state,
						onSetPublisherWallet,
						onRequestVerification,
						onApproveVerification,
						onRejectVerification,
						onSuspendVerification,
						onRevokeVerification,
						onReinstateVerification
					}),
					/* @__PURE__ */ jsx(ExtensionsPanel, {
						state,
						on: { setExtensions: onSetExtensions }
					})
				]
			})
		})]
	});
}
//#endregion
export { Editor as default };

//# sourceMappingURL=editor-DqvNeGDY.js.map