clearotron 0.3.2-beta.8 → 0.3.2-beta.9

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 (238) hide show
  1. package/.env.example +34 -3
  2. package/CONTRIBUTING.md +8 -8
  3. package/INSTALL.md +6 -6
  4. package/SECURITY.md +3 -3
  5. package/bin/brandowner.mjs +3 -3
  6. package/bin/framework-preflight.mjs +1 -1
  7. package/bin/start.mjs +18 -4
  8. package/build-info.json +2 -2
  9. package/docs/DELIVERY.md +2 -1
  10. package/docs/INTAKE.md +1 -1
  11. package/docs/ONBOARDING.md +1 -1
  12. package/docs/architecture/03-run-lifecycle.md +6 -6
  13. package/docs/architecture/04-configuration-reference.md +6 -3
  14. package/docs/architecture/05-config-governance.md +6 -1
  15. package/docs/architecture/05-customer-profiles.md +2 -2
  16. package/docs/architecture/06-operations-runbook.md +3 -3
  17. package/docs/architecture/08-development-guide.md +6 -6
  18. package/docs/configuration.md +5 -5
  19. package/docs/decisions/0003-credential-model.md +1 -1
  20. package/docs/writing-standard.md +4 -0
  21. package/driver/CHANGELOG.md +48 -0
  22. package/driver/README.md +3 -3
  23. package/driver/binding-layers.mjs +1 -1
  24. package/driver/citation-census.json +3 -3
  25. package/driver/{prelim-variants-record.mjs → clearance-variants-record.mjs} +24 -24
  26. package/driver/common-law-receipts.mjs +2 -2
  27. package/driver/company-bundle.mjs +3 -3
  28. package/driver/compose-read.mjs +8 -14
  29. package/driver/consumption-ledger.mjs +2 -2
  30. package/driver/contract-arm2-baseline.json +2 -3
  31. package/driver/contract-dictation-registry.mjs +19 -19
  32. package/driver/contract-e3-backlog.mjs +19 -19
  33. package/driver/contract-e3-baseline.json +14 -14
  34. package/driver/contract-vocabulary.mjs +24 -17
  35. package/driver/deliver-trigger.sh +16 -16
  36. package/driver/demo-container.mjs +3 -3
  37. package/driver/dev-portal.mjs +3 -3
  38. package/driver/disposition-call.mjs +1 -1
  39. package/driver/doubt-ledger.mjs +2 -2
  40. package/driver/drainer-identity.mjs +34 -8
  41. package/driver/driver.config.mjs +95 -45
  42. package/driver/engine/mcp/README.md +1 -1
  43. package/driver/engine/mcp/dispositions-server.mjs +3 -3
  44. package/driver/engine/mcp/gather-config.mjs +9 -9
  45. package/driver/engine/mcp/perplexity-server.mjs +2 -2
  46. package/driver/engine/mcp/recording-server.mjs +5 -5
  47. package/driver/enqueue-schema.mjs +6 -2
  48. package/driver/findings-model.mjs +5 -2
  49. package/driver/flag-snapshot.mjs +6 -3
  50. package/driver/form-neighbourhood.mjs +54 -7
  51. package/driver/framework.mjs +4 -4
  52. package/driver/gateway.mjs +12 -6
  53. package/driver/jx-lanes.mjs +2 -2
  54. package/driver/jx-units.mjs +1 -1
  55. package/driver/jx.mjs +30 -2
  56. package/driver/knockout-review-record.mjs +56 -4
  57. package/driver/known-conflicts.mjs +1 -1
  58. package/driver/named-band.mjs +1 -33
  59. package/driver/ordinary-words.mjs +51 -0
  60. package/driver/outbox-backoff.mjs +31 -16
  61. package/driver/package.json +1 -1
  62. package/driver/partial-payload-baseline.json +2 -2
  63. package/driver/phase0.mjs +3 -3
  64. package/driver/pipeline-knockout.mjs +5 -5
  65. package/driver/pipeline.mjs +206 -68
  66. package/driver/placement-form.mjs +77 -1
  67. package/driver/placement-model.mjs +1 -1
  68. package/driver/portal-report.mjs +92 -5
  69. package/driver/portal-service.mjs +34 -8
  70. package/driver/portal-upstream.mjs +1 -1
  71. package/driver/preserve-merge.mjs +3 -3
  72. package/driver/product-rows.mjs +2 -2
  73. package/driver/products.mjs +1 -1
  74. package/driver/profiles/README.md +3 -3
  75. package/driver/profiles/demo-brand-owner.json +2 -2
  76. package/driver/profiles.mjs +55 -17
  77. package/driver/progress.mjs +18 -8
  78. package/driver/provider-usage.mjs +8 -8
  79. package/driver/publish/index.mjs +110 -5
  80. package/driver/publish/knockout.mjs +29 -4
  81. package/driver/publish/pool-admin.mjs +1 -1
  82. package/driver/publish/publish-inputs.mjs +18 -2
  83. package/driver/publish/render-knockout.mjs +115 -24
  84. package/driver/publish/render.mjs +153 -34
  85. package/driver/publish/search-depth.mjs +133 -4
  86. package/driver/publish/templates/report.css +60 -3
  87. package/driver/publish/xlsx.mjs +8 -1
  88. package/driver/queue-order.mjs +2 -2
  89. package/driver/recording-agreement.mjs +1 -1
  90. package/driver/reference-score.mjs +1 -1
  91. package/driver/register-count.mjs +50 -5
  92. package/driver/register-coverage.mjs +67 -0
  93. package/driver/register-grant-vocabulary.mjs +1 -1
  94. package/driver/register-plan.mjs +19 -2
  95. package/driver/registry-fidelity.mjs +3 -3
  96. package/driver/repair-composers.mjs +1 -1
  97. package/driver/repair-contract.mjs +1 -1
  98. package/driver/replay-archive.mjs +6 -6
  99. package/driver/report-overview-record.mjs +2 -2
  100. package/driver/run-requirements.mjs +3 -3
  101. package/driver/runner.mjs +2 -2
  102. package/driver/scope-facts.mjs +20 -5
  103. package/driver/scope-ledger.mjs +5 -5
  104. package/driver/search-policy.mjs +22 -12
  105. package/driver/skills/README.md +15 -15
  106. package/driver/skills/blind-frame/SKILL.md +2 -2
  107. package/driver/skills/case-law-citation/SKILL.md +4 -4
  108. package/driver/skills/case-law-citation/sources/eurlex.md +1 -1
  109. package/driver/skills/{prelim-common-law → clearance-common-law}/SKILL.md +22 -22
  110. package/driver/skills/{prelim-common-law → clearance-common-law}/perplexity-prompts.md +1 -1
  111. package/driver/skills/{prelim-register → clearance-register}/SKILL.md +10 -10
  112. package/driver/skills/{prelim-register → clearance-register}/digest.md +2 -2
  113. package/driver/skills/{prelim-register → clearance-register}/providers/README.md +1 -1
  114. package/driver/skills/{prelim-register → clearance-register}/providers/clarivate.md +37 -35
  115. package/driver/skills/{prelim-register → clearance-register}/providers/corsearch.md +20 -11
  116. package/driver/skills/{prelim-register → clearance-register}/providers/signa.md +5 -5
  117. package/driver/skills/{prelim-register → clearance-register}/register-recipes.md +3 -3
  118. package/driver/skills/{prelim-register → clearance-register}/status-rules.md +2 -2
  119. package/driver/skills/{prelim-register → clearance-register}/stealth-filer-indicators.md +1 -1
  120. package/driver/skills/{prelim-register → clearance-register}/unit.md +2 -2
  121. package/driver/skills/{prelim-search → clearance-search}/SKILL.md +31 -31
  122. package/driver/skills/{prelim-search → clearance-search}/delivery-contract.md +1 -1
  123. package/driver/skills/{prelim-search → clearance-search}/phase2-execution.md +18 -18
  124. package/driver/skills/{prelim-search → clearance-search}/synthesis-rules.md +7 -7
  125. package/driver/skills/{prelim-variants → clearance-variants}/SKILL.md +18 -18
  126. package/driver/skills/{prelim-variants → clearance-variants}/transliteration-scripts.md +5 -5
  127. package/driver/skills/frame-diff/SKILL.md +1 -1
  128. package/driver/skills/knockout-assess/SKILL.md +10 -7
  129. package/driver/skills/matter-frame/SKILL.md +3 -3
  130. package/driver/skills/narrative-refutation/SKILL.md +9 -9
  131. package/driver/skills/placement-inquiry/SKILL.md +5 -5
  132. package/driver/stage-context.mjs +1 -1
  133. package/driver/stages-knockout.mjs +4 -4
  134. package/driver/stages.mjs +53 -53
  135. package/driver/status-snapshot.mjs +2 -2
  136. package/driver/suite-census.json +218 -92
  137. package/driver/surface-exit-verdict.mjs +58 -0
  138. package/driver/systemd/README.md +2 -2
  139. package/driver/systemd/clearotron-worker.service +1 -1
  140. package/driver/terminal-clamp.mjs +2 -0
  141. package/driver/usage-ledger.mjs +1 -1
  142. package/driver/variant-manifest-model.mjs +4 -4
  143. package/driver/verify-knockout.mjs +27 -0
  144. package/driver/verify.mjs +67 -6
  145. package/driver/whatif-queue.mjs +1 -1
  146. package/driver/wordlists/en.txt +63906 -0
  147. package/mcp-server/CHANGELOG.md +4 -0
  148. package/mcp-server/README.md +1 -1
  149. package/mcp-server/lib/README.md +1 -1
  150. package/mcp-server/lib/options.mjs +8 -7
  151. package/mcp-server/lib/plan.mjs +18 -2
  152. package/mcp-server/lib/runs.mjs +1 -1
  153. package/mcp-server/lib/usage.mjs +3 -3
  154. package/mcp-server/lib/whatif.mjs +1 -1
  155. package/mcp-server/package.json +1 -1
  156. package/mcp-server/server.mjs +3 -0
  157. package/package.json +12 -11
  158. package/portal-ui/dist/assets/{index-CVOIvdhc.css → index-CtvwLCti.css} +207 -3
  159. package/portal-ui/dist/assets/{index-6jzO9HiX.js → index-EVaSo5-g.js} +1459 -482
  160. package/portal-ui/dist/index.html +2 -2
  161. package/portal-ui/package.json +1 -1
  162. package/providers/README.md +1 -1
  163. package/providers/_shared/enumerate.mjs +6 -6
  164. package/providers/_shared/execute-plan.mjs +3 -3
  165. package/providers/_shared/ledger.mjs +119 -5
  166. package/providers/_shared/provider-text.mjs +2 -2
  167. package/providers/_shared/screen.mjs +2 -2
  168. package/providers/_shared/script-form.mjs +3 -3
  169. package/providers/_shared/territory-codes.mjs +23 -3
  170. package/providers/clarivate/README.md +1 -1
  171. package/providers/clarivate/src/capabilities.js +12 -12
  172. package/providers/clarivate/src/core.js +37 -43
  173. package/providers/corsearch/README.md +1 -1
  174. package/providers/corsearch/src/capabilities.js +5 -5
  175. package/providers/corsearch/src/core.js +3 -3
  176. package/providers/oauth-mcp-bridge/CHANGELOG.md +4 -0
  177. package/providers/oauth-mcp-bridge/package.json +1 -1
  178. package/providers/perplexity/src/core.js +1 -1
  179. package/providers/signa/README.md +1 -1
  180. package/providers/signa/src/capabilities.js +42 -49
  181. package/providers/signa/src/core.js +106 -29
  182. package/providers/uspto-local/src/sync.js +1 -1
  183. package/scripts/README.md +1 -0
  184. package/scripts/ask-ai-render-check.mjs +127 -1
  185. package/scripts/authority-boundary-probe.mjs +4 -4
  186. package/scripts/backfill-started-at.mjs +2 -2
  187. package/scripts/census-merge-driver.mjs +33 -2
  188. package/scripts/citation-anchor-report.mjs +181 -0
  189. package/scripts/dead-names.mjs +1 -1
  190. package/scripts/deprecate-below.mjs +66 -8
  191. package/scripts/drain-preflight.mjs +1 -1
  192. package/scripts/e2e.mjs +174 -0
  193. package/scripts/env-audit.mjs +27 -0
  194. package/scripts/env-classify.mjs +20 -2
  195. package/scripts/freeze-example-run.mjs +20 -10
  196. package/scripts/live-surface-check.mjs +124 -41
  197. package/scripts/markdown-link-check.mjs +1 -1
  198. package/scripts/merge-shape-check.mjs +242 -0
  199. package/scripts/mint-names-in-force.mjs +5 -5
  200. package/scripts/mint-offered-territories.mjs +72 -0
  201. package/scripts/mint-public-residue.mjs +2 -2
  202. package/scripts/mint-reference-strip-backlog.mjs +2 -2
  203. package/scripts/mint-suite-census.mjs +75 -2
  204. package/scripts/mint-writing-standard-backlog.mjs +2 -2
  205. package/scripts/purge-runs.mjs +7 -7
  206. package/scripts/reconcile-runs.mjs +2 -2
  207. package/scripts/release-approve-parked.mjs +20 -2
  208. package/scripts/release-await-cut.mjs +120 -1
  209. package/scripts/release-note-required.mjs +76 -8
  210. package/scripts/report-header-render-check.mjs +164 -0
  211. package/shared/brand.mjs +27 -0
  212. package/shared/connect-clients.mjs +39 -11
  213. package/shared/env-aliases.mjs +1 -1
  214. package/shared/identifier-scan.mjs +65 -9
  215. package/shared/identifier-sentinels.mjs +22 -0
  216. package/shared/names-in-force.mjs +3 -1
  217. package/shared/offered-territories.json +738 -0
  218. package/shared/pre-rename-spellings.mjs +53 -0
  219. package/shared/reference-guard-classes.mjs +40 -2
  220. package/shared/stdio-connect.mjs +39 -4
  221. package/shared/tree-commit.mjs +48 -0
  222. /package/driver/skills/{prelim-register → clearance-register}/providers/euipo.md +0 -0
  223. /package/driver/skills/{prelim-register → clearance-register}/providers/free-tier.md +0 -0
  224. /package/driver/skills/{prelim-register → clearance-register}/providers/uspto-local.md +0 -0
  225. /package/driver/skills/{prelim-search → clearance-search}/field-doctrine-pharma.md +0 -0
  226. /package/driver/skills/{prelim-search → clearance-search}/firm-wide-reasoning.md +0 -0
  227. /package/driver/skills/{prelim-search → clearance-search}/report-prose.md +0 -0
  228. /package/driver/skills/{prelim-search → clearance-search}/risk-framework-demo.manifest.json +0 -0
  229. /package/driver/skills/{prelim-search → clearance-search}/risk-framework-demo.md +0 -0
  230. /package/driver/skills/{prelim-search → clearance-search}/risk-framework-triage.manifest.json +0 -0
  231. /package/driver/skills/{prelim-search → clearance-search}/risk-framework-triage.md +0 -0
  232. /package/driver/skills/{prelim-search → clearance-search}/risk-framework.manifest.json +0 -0
  233. /package/driver/skills/{prelim-search → clearance-search}/risk-framework.md +0 -0
  234. /package/driver/skills/{prelim-search → clearance-search}/template-formatting.md +0 -0
  235. /package/driver/skills/{prelim-search → clearance-search}/templates/email/generic.md +0 -0
  236. /package/driver/skills/{prelim-search → clearance-search}/templates/search-request-form.html +0 -0
  237. /package/driver/skills/{prelim-search → clearance-search}/worked-examples-demo.md +0 -0
  238. /package/driver/skills/{prelim-search → clearance-search}/worked-examples.md +0 -0
@@ -12338,14 +12338,24 @@ var api = {
12338
12338
  method: "POST",
12339
12339
  body: JSON.stringify(input)
12340
12340
  }),
12341
- roster: () => call("/portal/admin/roster", (b) => asArray(b["customers"]).map((c) => {
12342
- const r = c;
12343
- return {
12344
- key: asString(r["key"]) ?? "",
12345
- name: asString(r["name"]) ?? "",
12346
- facts: asCompanyFacts(r),
12347
- org: asString(r["org"]) ?? null
12348
- };
12341
+ roster: () => call("/portal/admin/roster", (b) => ({
12342
+ companies: asArray(b["customers"]).map((c) => {
12343
+ const r = c;
12344
+ return {
12345
+ key: asString(r["key"]) ?? "",
12346
+ name: asString(r["name"]) ?? "",
12347
+ facts: asCompanyFacts(r),
12348
+ org: asString(r["org"]) ?? null
12349
+ };
12350
+ }),
12351
+ unreadable: asArray(b["unreadable"]).flatMap((u) => {
12352
+ const r = u;
12353
+ const key = asString(r["key"]);
12354
+ return key ? [{
12355
+ key,
12356
+ reason: asString(r["reason"]) ?? ""
12357
+ }] : [];
12358
+ })
12349
12359
  }))
12350
12360
  };
12351
12361
  //#endregion
@@ -12451,7 +12461,7 @@ var NAV = [
12451
12461
  path: "/portal/ai",
12452
12462
  icon: "sparkles",
12453
12463
  scope: "account",
12454
- rail: "below"
12464
+ rail: "foot"
12455
12465
  },
12456
12466
  {
12457
12467
  id: "new-company",
@@ -12497,7 +12507,8 @@ function navGroupsFor(who, entries = NAV) {
12497
12507
  const visibleEntries = navFor(who, entries);
12498
12508
  return {
12499
12509
  account: visibleEntries.filter((e) => railSideOf(e) === "above"),
12500
- owner: visibleEntries.filter((e) => railSideOf(e) === "below")
12510
+ owner: visibleEntries.filter((e) => railSideOf(e) === "below"),
12511
+ foot: visibleEntries.filter((e) => railSideOf(e) === "foot")
12501
12512
  };
12502
12513
  }
12503
12514
  function scopeOf(id, entries = NAV) {
@@ -13184,16 +13195,30 @@ function usePath() {
13184
13195
  ];
13185
13196
  }
13186
13197
  function NavList({ entries, current, go, collapsed }) {
13198
+ const [folded, setFolded] = (0, import_react.useState)(null);
13199
+ const within = (id) => current === id || (current?.startsWith(id + ".") ?? false);
13200
+ (0, import_react.useEffect)(() => {
13201
+ if (folded !== null && current !== folded && !(current?.startsWith(folded + ".") ?? false)) setFolded(null);
13202
+ }, [current, folded]);
13187
13203
  return (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: entries.map((e) => {
13188
- const active = current === e.id || (current?.startsWith(e.id + ".") ?? false);
13204
+ const active = within(e.id);
13205
+ const open = Boolean(e.children) && active && folded !== e.id;
13189
13206
  return (0, import_jsx_runtime.jsxs)("div", { children: [(0, import_jsx_runtime.jsxs)("button", {
13190
13207
  type: "button",
13191
13208
  className: `nav-item${active ? " active" : ""}`,
13192
- onClick: () => go(e.path),
13209
+ onClick: () => {
13210
+ if (e.children && active && !collapsed) {
13211
+ setFolded(open ? e.id : null);
13212
+ return;
13213
+ }
13214
+ setFolded(null);
13215
+ go(e.path);
13216
+ },
13193
13217
  "aria-current": active ? "page" : void 0,
13218
+ "aria-expanded": e.children && !collapsed ? open : void 0,
13194
13219
  title: collapsed ? e.label : void 0,
13195
13220
  children: [(0, import_jsx_runtime.jsx)(Icon, { name: e.icon }), collapsed ? null : (0, import_jsx_runtime.jsx)("span", { children: e.label })]
13196
- }), e.children && active && !collapsed ? (0, import_jsx_runtime.jsx)("div", {
13221
+ }), e.children && open && !collapsed ? (0, import_jsx_runtime.jsx)("div", {
13197
13222
  className: "nav-sub",
13198
13223
  children: e.children.map((c) => (0, import_jsx_runtime.jsxs)("div", { children: [c.groupLabel ? (0, import_jsx_runtime.jsx)("div", {
13199
13224
  className: "eyebrow nav-group",
@@ -13261,7 +13286,10 @@ function AppShell({ render }) {
13261
13286
  const readsRoster = meResult?.kind === "ok" && meResult.value.allAccounts;
13262
13287
  const { result: rosterResult, reload: reloadRoster } = useLoad(() => readsRoster ? api.roster() : Promise.resolve({
13263
13288
  kind: "ok",
13264
- value: []
13289
+ value: {
13290
+ companies: [],
13291
+ unreadable: []
13292
+ }
13265
13293
  }), [readsRoster]);
13266
13294
  (0, import_react.useEffect)(() => {
13267
13295
  document.documentElement.classList.toggle("anon-on", anon);
@@ -13296,7 +13324,7 @@ function AppShell({ render }) {
13296
13324
  const groups = navGroupsFor(me);
13297
13325
  const entry = screenForPath(path, me) ?? (path === "/portal" || path === "/portal/" ? HOME : null);
13298
13326
  const personal = entry !== null && avatarEntryOf(entry.id, me) !== null;
13299
- const names = ownerNameMap(me.accountNames, rosterResult?.kind === "ok" ? rosterResult.value : []);
13327
+ const names = ownerNameMap(me.accountNames, rosterResult?.kind === "ok" ? rosterResult.value.companies : []);
13300
13328
  const ownerName = (key) => {
13301
13329
  if (key === null || !isGenericKey(key)) return ownerNameFrom(names, key);
13302
13330
  const plain = ownerNameFrom(names, GENERIC_ACCOUNT);
@@ -13304,17 +13332,17 @@ function AppShell({ render }) {
13304
13332
  if (!org || me.organisations.length < 2) return plain;
13305
13333
  return `${plain} · ${me.organisations.find((o) => o.key === org)?.name ?? org}`;
13306
13334
  };
13307
- const facts = companyFactsMap(me.accountFacts, rosterResult?.kind === "ok" ? rosterResult.value : []);
13335
+ const facts = companyFactsMap(me.accountFacts, rosterResult?.kind === "ok" ? rosterResult.value.companies : []);
13308
13336
  const factsFor = (key) => facts[isGenericKey(key) ? GENERIC_ACCOUNT : key];
13309
- const ownerKeys = switcherKeys(me, rosterResult?.kind === "ok" ? rosterResult.value : null);
13310
- const rosterOrgs = Object.fromEntries((rosterResult?.kind === "ok" ? rosterResult.value : []).flatMap((c) => c.org ? [[c.key, c.org]] : []));
13337
+ const ownerKeys = switcherKeys(me, rosterResult?.kind === "ok" ? rosterResult.value.companies : null);
13338
+ const rosterOrgs = Object.fromEntries((rosterResult?.kind === "ok" ? rosterResult.value.companies : []).flatMap((c) => c.org ? [[c.key, c.org]] : []));
13311
13339
  const orgOf = (key) => orgOfGeneric(key) ?? me.accountOrgs[key] ?? rosterOrgs[key] ?? null;
13312
13340
  const organisations = me.organisations;
13313
13341
  const refreshCompanies = () => {
13314
13342
  reloadMe();
13315
13343
  reloadRoster();
13316
13344
  };
13317
- const sole = ownerKeys.length === 1 ? ownerKeys[0] ?? null : null;
13345
+ const sole = !(readsRoster && !!rosterResult && rosterResult.kind !== "ok") && ownerKeys.length === 1 ? ownerKeys[0] ?? null : null;
13318
13346
  const ownerInView = owner ?? sole;
13319
13347
  const body = entry ? render(entry.id, {
13320
13348
  me,
@@ -13405,6 +13433,15 @@ function AppShell({ render }) {
13405
13433
  })]
13406
13434
  }) : null]
13407
13435
  }),
13436
+ groups.foot.length ? (0, import_jsx_runtime.jsx)("div", {
13437
+ className: "sidebar-pinned",
13438
+ children: (0, import_jsx_runtime.jsx)(NavList, {
13439
+ entries: groups.foot,
13440
+ current: entry?.id ?? null,
13441
+ go,
13442
+ collapsed: collapsed && !mobile
13443
+ })
13444
+ }) : null,
13408
13445
  !mobile ? (0, import_jsx_runtime.jsx)("div", {
13409
13446
  className: "sidebar-foot",
13410
13447
  children: (0, import_jsx_runtime.jsxs)("button", {
@@ -13418,141 +13455,166 @@ function AppShell({ render }) {
13418
13455
  }),
13419
13456
  (0, import_jsx_runtime.jsxs)("div", {
13420
13457
  className: "main",
13421
- children: [(0, import_jsx_runtime.jsxs)("header", {
13422
- className: "topbar",
13423
- children: [
13424
- mobile ? (0, import_jsx_runtime.jsx)("button", {
13425
- type: "button",
13426
- className: "icon-btn",
13427
- "aria-label": "Open menu",
13428
- onClick: () => setDrawer(true),
13429
- children: (0, import_jsx_runtime.jsx)(Icon, { name: "menu" })
13430
- }) : null,
13431
- (0, import_jsx_runtime.jsx)("h1", {
13432
- "data-anon": personal ? void 0 : "mark",
13433
- children: !entry ? "Not found" : personal ? entry.label : scopeOf(entry.id) === "owner" ? ownerName(ownerInView) : ""
13434
- }),
13435
- (0, import_jsx_runtime.jsxs)("div", {
13436
- style: {
13437
- marginLeft: "auto",
13438
- display: "flex",
13439
- alignItems: "center",
13440
- gap: 4,
13441
- position: "relative"
13442
- },
13443
- children: [
13444
- !mobile && accountName ? (0, import_jsx_runtime.jsxs)("div", {
13445
- style: {
13446
- textAlign: "right",
13447
- marginRight: 8,
13448
- minWidth: 0
13449
- },
13450
- children: [(0, import_jsx_runtime.jsx)("div", {
13451
- className: "eyebrow",
13452
- children: "Organisation"
13453
- }), (0, import_jsx_runtime.jsx)("div", {
13458
+ children: [
13459
+ (0, import_jsx_runtime.jsxs)("header", {
13460
+ className: "topbar",
13461
+ children: [
13462
+ mobile ? (0, import_jsx_runtime.jsx)("button", {
13463
+ type: "button",
13464
+ className: "icon-btn",
13465
+ "aria-label": "Open menu",
13466
+ onClick: () => setDrawer(true),
13467
+ children: (0, import_jsx_runtime.jsx)(Icon, { name: "menu" })
13468
+ }) : null,
13469
+ (0, import_jsx_runtime.jsx)("h1", {
13470
+ "data-anon": personal ? void 0 : "mark",
13471
+ children: !entry ? "Not found" : personal ? entry.label : scopeOf(entry.id) === "owner" ? ownerName(ownerInView) : ""
13472
+ }),
13473
+ (0, import_jsx_runtime.jsxs)("div", {
13474
+ style: {
13475
+ marginLeft: "auto",
13476
+ display: "flex",
13477
+ alignItems: "center",
13478
+ gap: 4,
13479
+ position: "relative"
13480
+ },
13481
+ children: [
13482
+ !mobile && accountName ? (0, import_jsx_runtime.jsxs)("div", {
13454
13483
  style: {
13455
- fontWeight: 700,
13456
- color: "var(--text-strong)",
13457
- fontSize: 14,
13458
- lineHeight: 1.2,
13459
- whiteSpace: "nowrap"
13484
+ textAlign: "right",
13485
+ marginRight: 8,
13486
+ minWidth: 0
13460
13487
  },
13461
- "data-anon": "mark",
13462
- children: accountName
13463
- })]
13464
- }) : null,
13465
- (0, import_jsx_runtime.jsx)("button", {
13466
- type: "button",
13467
- className: "icon-btn",
13468
- "aria-pressed": anon,
13469
- "aria-label": "Blur names for screen sharing",
13470
- title: "Blur names for screen sharing",
13471
- onClick: () => setAnon((a) => !a),
13472
- children: (0, import_jsx_runtime.jsx)(Icon, { name: anon ? "eye-off" : "eye" })
13473
- }),
13474
- (0, import_jsx_runtime.jsx)("button", {
13475
- type: "button",
13476
- className: "icon-btn",
13477
- "aria-pressed": theme === "dark",
13478
- "aria-label": "Switch light or dark theme",
13479
- title: "Switch light or dark theme",
13480
- onClick: toggleTheme,
13481
- children: (0, import_jsx_runtime.jsx)(Icon, { name: "theme" })
13482
- }),
13483
- (0, import_jsx_runtime.jsx)("button", {
13484
- type: "button",
13485
- className: "icon-btn avatar",
13486
- "aria-haspopup": "menu",
13487
- "aria-expanded": avatarOpen,
13488
- "aria-label": "Settings and about",
13489
- "aria-current": personal ? "true" : void 0,
13490
- onClick: () => setAvatarOpen((o) => !o),
13491
- children: initials(me.email)
13492
- }),
13493
- avatarOpen ? (0, import_jsx_runtime.jsxs)("div", {
13494
- className: "float",
13495
- role: "menu",
13496
- style: {
13497
- position: "absolute",
13498
- right: 0,
13499
- top: 40,
13500
- width: 240,
13501
- padding: 6,
13502
- zIndex: 50
13503
- },
13504
- children: [
13505
- (0, import_jsx_runtime.jsxs)("div", {
13488
+ children: [(0, import_jsx_runtime.jsx)("div", {
13489
+ className: "eyebrow",
13490
+ children: "Organisation"
13491
+ }), (0, import_jsx_runtime.jsx)("div", {
13506
13492
  style: {
13507
- padding: "8px 10px",
13508
- borderBottom: "1px solid var(--border-hairline)"
13493
+ fontWeight: 700,
13494
+ color: "var(--text-strong)",
13495
+ fontSize: 14,
13496
+ lineHeight: 1.2,
13497
+ whiteSpace: "nowrap"
13509
13498
  },
13510
- children: [
13511
- (0, import_jsx_runtime.jsx)("div", {
13512
- className: "eyebrow",
13513
- children: "Signed in as"
13514
- }),
13515
- (0, import_jsx_runtime.jsx)("div", {
13516
- style: {
13517
- fontSize: 13,
13518
- wordBreak: "break-all"
13519
- },
13520
- "data-anon": "mark",
13521
- children: me.email
13522
- }),
13523
- (0, import_jsx_runtime.jsx)("div", {
13524
- style: {
13525
- fontSize: 12,
13526
- color: "var(--text-muted)",
13527
- marginTop: 2
13528
- },
13529
- children: permissionsPhrase(me.permissions)
13530
- })
13531
- ]
13532
- }),
13533
- avatarMenuFor(me).map((e) => (0, import_jsx_runtime.jsxs)("div", { children: [e.groupLabel ? (0, import_jsx_runtime.jsx)("div", {
13534
- className: "eyebrow nav-group",
13535
- style: { padding: "8px 10px 2px" },
13536
- children: e.groupLabel
13537
- }) : null, (0, import_jsx_runtime.jsx)("button", {
13538
- type: "button",
13539
- className: "nav-item",
13540
- role: "menuitem",
13541
- onClick: () => go(e.path),
13542
- children: e.label
13543
- })] }, e.id)),
13544
- (0, import_jsx_runtime.jsx)("a", {
13545
- className: "nav-item",
13546
- role: "menuitem",
13547
- href: "/portal/sign-out",
13548
- children: "Log out"
13549
- })
13550
- ]
13551
- }) : null
13499
+ "data-anon": "mark",
13500
+ children: accountName
13501
+ })]
13502
+ }) : null,
13503
+ (0, import_jsx_runtime.jsx)("button", {
13504
+ type: "button",
13505
+ className: "icon-btn",
13506
+ "aria-pressed": anon,
13507
+ "aria-label": "Blur names for screen sharing",
13508
+ title: "Blur names for screen sharing",
13509
+ onClick: () => setAnon((a) => !a),
13510
+ children: (0, import_jsx_runtime.jsx)(Icon, { name: anon ? "eye-off" : "eye" })
13511
+ }),
13512
+ (0, import_jsx_runtime.jsx)("button", {
13513
+ type: "button",
13514
+ className: "icon-btn",
13515
+ "aria-pressed": theme === "dark",
13516
+ "aria-label": "Switch light or dark theme",
13517
+ title: "Switch light or dark theme",
13518
+ onClick: toggleTheme,
13519
+ children: (0, import_jsx_runtime.jsx)(Icon, { name: "theme" })
13520
+ }),
13521
+ (0, import_jsx_runtime.jsx)("button", {
13522
+ type: "button",
13523
+ className: "icon-btn avatar",
13524
+ "aria-haspopup": "menu",
13525
+ "aria-expanded": avatarOpen,
13526
+ "aria-label": "Settings and about",
13527
+ "aria-current": personal ? "true" : void 0,
13528
+ onClick: () => setAvatarOpen((o) => !o),
13529
+ children: initials(me.email)
13530
+ }),
13531
+ avatarOpen ? (0, import_jsx_runtime.jsxs)("div", {
13532
+ className: "float",
13533
+ role: "menu",
13534
+ style: {
13535
+ position: "absolute",
13536
+ right: 0,
13537
+ top: 40,
13538
+ width: 240,
13539
+ padding: 6,
13540
+ zIndex: 50
13541
+ },
13542
+ children: [
13543
+ (0, import_jsx_runtime.jsxs)("div", {
13544
+ style: {
13545
+ padding: "8px 10px",
13546
+ borderBottom: "1px solid var(--border-hairline)"
13547
+ },
13548
+ children: [
13549
+ (0, import_jsx_runtime.jsx)("div", {
13550
+ className: "eyebrow",
13551
+ children: "Signed in as"
13552
+ }),
13553
+ (0, import_jsx_runtime.jsx)("div", {
13554
+ style: {
13555
+ fontSize: 13,
13556
+ wordBreak: "break-all"
13557
+ },
13558
+ "data-anon": "mark",
13559
+ children: me.email
13560
+ }),
13561
+ (0, import_jsx_runtime.jsx)("div", {
13562
+ style: {
13563
+ fontSize: 12,
13564
+ color: "var(--text-muted)",
13565
+ marginTop: 2
13566
+ },
13567
+ children: permissionsPhrase(me.permissions)
13568
+ })
13569
+ ]
13570
+ }),
13571
+ avatarMenuFor(me).map((e) => (0, import_jsx_runtime.jsxs)("div", { children: [e.groupLabel ? (0, import_jsx_runtime.jsx)("div", {
13572
+ className: "eyebrow nav-group",
13573
+ style: { padding: "8px 10px 2px" },
13574
+ children: e.groupLabel
13575
+ }) : null, (0, import_jsx_runtime.jsx)("button", {
13576
+ type: "button",
13577
+ className: "nav-item",
13578
+ role: "menuitem",
13579
+ onClick: () => go(e.path),
13580
+ children: e.label
13581
+ })] }, e.id)),
13582
+ (0, import_jsx_runtime.jsx)("a", {
13583
+ className: "nav-item",
13584
+ role: "menuitem",
13585
+ href: "/portal/sign-out",
13586
+ children: "Log out"
13587
+ })
13588
+ ]
13589
+ }) : null
13590
+ ]
13591
+ })
13592
+ ]
13593
+ }),
13594
+ readsRoster && rosterResult?.kind === "ok" && rosterResult.value.unreadable.length ? (0, import_jsx_runtime.jsx)("div", {
13595
+ className: "notice",
13596
+ role: "status",
13597
+ style: { margin: "12px 24px 0" },
13598
+ children: rosterResult.value.unreadable.map((u) => (0, import_jsx_runtime.jsxs)("p", {
13599
+ style: { margin: "0 0 4px" },
13600
+ children: [
13601
+ (0, import_jsx_runtime.jsx)("span", {
13602
+ className: "mono",
13603
+ "data-anon": "mark",
13604
+ children: u.key
13605
+ }),
13606
+ " ",
13607
+ (0, import_jsx_runtime.jsx)("b", {
13608
+ style: { color: "var(--tone-high)" },
13609
+ children: "This company’s framework could not be read."
13610
+ }),
13611
+ " ",
13612
+ "This needs an administrator to look at it."
13552
13613
  ]
13553
- })
13554
- ]
13555
- }), body]
13614
+ }, u.key))
13615
+ }) : null,
13616
+ body
13617
+ ]
13556
13618
  })
13557
13619
  ]
13558
13620
  });
@@ -13806,7 +13868,7 @@ function rolledUp(fam) {
13806
13868
  //#region src/contract/failure.ts
13807
13869
  var STAGE_PHRASE = {
13808
13870
  "matter-frame": "while framing the matter",
13809
- "prelim-variants": "while working out which variants to search",
13871
+ "clearance-variants": "while working out which variants to search",
13810
13872
  "blind-frame": "while framing the matter",
13811
13873
  "common-law": "during the common-law search",
13812
13874
  "common-law-half": "during the common-law search",
@@ -13843,55 +13905,751 @@ function readableFailure(failedStage, reason) {
13843
13905
  raw
13844
13906
  };
13845
13907
  }
13908
+ var offered_territories_default = {
13909
+ _generated: "by scripts/mint-offered-territories.mjs from searchableTerritories() — do not edit; re-mint",
13910
+ regions: [
13911
+ {
13912
+ "code": "EU",
13913
+ "name": "European Union"
13914
+ },
13915
+ {
13916
+ "code": "BX",
13917
+ "name": "Benelux"
13918
+ },
13919
+ {
13920
+ "code": "AP",
13921
+ "name": "African Regional (ARIPO)"
13922
+ }
13923
+ ],
13924
+ countries: [
13925
+ {
13926
+ "code": "AF",
13927
+ "name": "Afghanistan"
13928
+ },
13929
+ {
13930
+ "code": "AL",
13931
+ "name": "Albania"
13932
+ },
13933
+ {
13934
+ "code": "DZ",
13935
+ "name": "Algeria"
13936
+ },
13937
+ {
13938
+ "code": "AD",
13939
+ "name": "Andorra"
13940
+ },
13941
+ {
13942
+ "code": "AO",
13943
+ "name": "Angola"
13944
+ },
13945
+ {
13946
+ "code": "AI",
13947
+ "name": "Anguilla"
13948
+ },
13949
+ {
13950
+ "code": "AG",
13951
+ "name": "Antigua & Barbuda"
13952
+ },
13953
+ {
13954
+ "code": "AR",
13955
+ "name": "Argentina"
13956
+ },
13957
+ {
13958
+ "code": "AM",
13959
+ "name": "Armenia"
13960
+ },
13961
+ {
13962
+ "code": "AW",
13963
+ "name": "Aruba"
13964
+ },
13965
+ {
13966
+ "code": "AU",
13967
+ "name": "Australia"
13968
+ },
13969
+ {
13970
+ "code": "AT",
13971
+ "name": "Austria"
13972
+ },
13973
+ {
13974
+ "code": "AZ",
13975
+ "name": "Azerbaijan"
13976
+ },
13977
+ {
13978
+ "code": "BS",
13979
+ "name": "Bahamas"
13980
+ },
13981
+ {
13982
+ "code": "BH",
13983
+ "name": "Bahrain"
13984
+ },
13985
+ {
13986
+ "code": "BD",
13987
+ "name": "Bangladesh"
13988
+ },
13989
+ {
13990
+ "code": "BB",
13991
+ "name": "Barbados"
13992
+ },
13993
+ {
13994
+ "code": "BY",
13995
+ "name": "Belarus"
13996
+ },
13997
+ {
13998
+ "code": "BE",
13999
+ "name": "Belgium"
14000
+ },
14001
+ {
14002
+ "code": "BZ",
14003
+ "name": "Belize"
14004
+ },
14005
+ {
14006
+ "code": "BM",
14007
+ "name": "Bermuda"
14008
+ },
14009
+ {
14010
+ "code": "BT",
14011
+ "name": "Bhutan"
14012
+ },
14013
+ {
14014
+ "code": "BO",
14015
+ "name": "Bolivia"
14016
+ },
14017
+ {
14018
+ "code": "BA",
14019
+ "name": "Bosnia & Herzegovina"
14020
+ },
14021
+ {
14022
+ "code": "BW",
14023
+ "name": "Botswana"
14024
+ },
14025
+ {
14026
+ "code": "BR",
14027
+ "name": "Brazil"
14028
+ },
14029
+ {
14030
+ "code": "VG",
14031
+ "name": "British Virgin Islands"
14032
+ },
14033
+ {
14034
+ "code": "BN",
14035
+ "name": "Brunei"
14036
+ },
14037
+ {
14038
+ "code": "BG",
14039
+ "name": "Bulgaria"
14040
+ },
14041
+ {
14042
+ "code": "BI",
14043
+ "name": "Burundi"
14044
+ },
14045
+ {
14046
+ "code": "KH",
14047
+ "name": "Cambodia"
14048
+ },
14049
+ {
14050
+ "code": "CA",
14051
+ "name": "Canada"
14052
+ },
14053
+ {
14054
+ "code": "CV",
14055
+ "name": "Cape Verde"
14056
+ },
14057
+ {
14058
+ "code": "BQ",
14059
+ "name": "Caribbean Netherlands"
14060
+ },
14061
+ {
14062
+ "code": "KY",
14063
+ "name": "Cayman Islands"
14064
+ },
14065
+ {
14066
+ "code": "CL",
14067
+ "name": "Chile"
14068
+ },
14069
+ {
14070
+ "code": "CN",
14071
+ "name": "China"
14072
+ },
14073
+ {
14074
+ "code": "CO",
14075
+ "name": "Colombia"
14076
+ },
14077
+ {
14078
+ "code": "CD",
14079
+ "name": "Congo - Kinshasa"
14080
+ },
14081
+ {
14082
+ "code": "CR",
14083
+ "name": "Costa Rica"
14084
+ },
14085
+ {
14086
+ "code": "HR",
14087
+ "name": "Croatia"
14088
+ },
14089
+ {
14090
+ "code": "CU",
14091
+ "name": "Cuba"
14092
+ },
14093
+ {
14094
+ "code": "CW",
14095
+ "name": "Curaçao"
14096
+ },
14097
+ {
14098
+ "code": "CY",
14099
+ "name": "Cyprus"
14100
+ },
14101
+ {
14102
+ "code": "CZ",
14103
+ "name": "Czechia"
14104
+ },
14105
+ {
14106
+ "code": "DK",
14107
+ "name": "Denmark"
14108
+ },
14109
+ {
14110
+ "code": "DM",
14111
+ "name": "Dominica"
14112
+ },
14113
+ {
14114
+ "code": "DO",
14115
+ "name": "Dominican Republic"
14116
+ },
14117
+ {
14118
+ "code": "EC",
14119
+ "name": "Ecuador"
14120
+ },
14121
+ {
14122
+ "code": "EG",
14123
+ "name": "Egypt"
14124
+ },
14125
+ {
14126
+ "code": "SV",
14127
+ "name": "El Salvador"
14128
+ },
14129
+ {
14130
+ "code": "EE",
14131
+ "name": "Estonia"
14132
+ },
14133
+ {
14134
+ "code": "SZ",
14135
+ "name": "Eswatini"
14136
+ },
14137
+ {
14138
+ "code": "ET",
14139
+ "name": "Ethiopia"
14140
+ },
14141
+ {
14142
+ "code": "FJ",
14143
+ "name": "Fiji"
14144
+ },
14145
+ {
14146
+ "code": "FI",
14147
+ "name": "Finland"
14148
+ },
14149
+ {
14150
+ "code": "FR",
14151
+ "name": "France"
14152
+ },
14153
+ {
14154
+ "code": "GM",
14155
+ "name": "Gambia"
14156
+ },
14157
+ {
14158
+ "code": "GE",
14159
+ "name": "Georgia"
14160
+ },
14161
+ {
14162
+ "code": "DE",
14163
+ "name": "Germany"
14164
+ },
14165
+ {
14166
+ "code": "GH",
14167
+ "name": "Ghana"
14168
+ },
14169
+ {
14170
+ "code": "GI",
14171
+ "name": "Gibraltar"
14172
+ },
14173
+ {
14174
+ "code": "GR",
14175
+ "name": "Greece"
14176
+ },
14177
+ {
14178
+ "code": "GD",
14179
+ "name": "Grenada"
14180
+ },
14181
+ {
14182
+ "code": "GT",
14183
+ "name": "Guatemala"
14184
+ },
14185
+ {
14186
+ "code": "GG",
14187
+ "name": "Guernsey"
14188
+ },
14189
+ {
14190
+ "code": "GY",
14191
+ "name": "Guyana"
14192
+ },
14193
+ {
14194
+ "code": "HT",
14195
+ "name": "Haiti"
14196
+ },
14197
+ {
14198
+ "code": "HN",
14199
+ "name": "Honduras"
14200
+ },
14201
+ {
14202
+ "code": "HK",
14203
+ "name": "Hong Kong"
14204
+ },
14205
+ {
14206
+ "code": "HU",
14207
+ "name": "Hungary"
14208
+ },
14209
+ {
14210
+ "code": "IS",
14211
+ "name": "Iceland"
14212
+ },
14213
+ {
14214
+ "code": "IN",
14215
+ "name": "India"
14216
+ },
14217
+ {
14218
+ "code": "ID",
14219
+ "name": "Indonesia"
14220
+ },
14221
+ {
14222
+ "code": "IR",
14223
+ "name": "Iran"
14224
+ },
14225
+ {
14226
+ "code": "IQ",
14227
+ "name": "Iraq"
14228
+ },
14229
+ {
14230
+ "code": "IE",
14231
+ "name": "Ireland"
14232
+ },
14233
+ {
14234
+ "code": "IL",
14235
+ "name": "Israel"
14236
+ },
14237
+ {
14238
+ "code": "IT",
14239
+ "name": "Italy"
14240
+ },
14241
+ {
14242
+ "code": "JM",
14243
+ "name": "Jamaica"
14244
+ },
14245
+ {
14246
+ "code": "JP",
14247
+ "name": "Japan"
14248
+ },
14249
+ {
14250
+ "code": "JE",
14251
+ "name": "Jersey"
14252
+ },
14253
+ {
14254
+ "code": "JO",
14255
+ "name": "Jordan"
14256
+ },
14257
+ {
14258
+ "code": "KZ",
14259
+ "name": "Kazakhstan"
14260
+ },
14261
+ {
14262
+ "code": "KE",
14263
+ "name": "Kenya"
14264
+ },
14265
+ {
14266
+ "code": "KW",
14267
+ "name": "Kuwait"
14268
+ },
14269
+ {
14270
+ "code": "KG",
14271
+ "name": "Kyrgyzstan"
14272
+ },
14273
+ {
14274
+ "code": "LA",
14275
+ "name": "Laos"
14276
+ },
14277
+ {
14278
+ "code": "LV",
14279
+ "name": "Latvia"
14280
+ },
14281
+ {
14282
+ "code": "LB",
14283
+ "name": "Lebanon"
14284
+ },
14285
+ {
14286
+ "code": "LS",
14287
+ "name": "Lesotho"
14288
+ },
14289
+ {
14290
+ "code": "LR",
14291
+ "name": "Liberia"
14292
+ },
14293
+ {
14294
+ "code": "LY",
14295
+ "name": "Libya"
14296
+ },
14297
+ {
14298
+ "code": "LI",
14299
+ "name": "Liechtenstein"
14300
+ },
14301
+ {
14302
+ "code": "LT",
14303
+ "name": "Lithuania"
14304
+ },
14305
+ {
14306
+ "code": "LU",
14307
+ "name": "Luxembourg"
14308
+ },
14309
+ {
14310
+ "code": "MO",
14311
+ "name": "Macau"
14312
+ },
14313
+ {
14314
+ "code": "MG",
14315
+ "name": "Madagascar"
14316
+ },
14317
+ {
14318
+ "code": "MW",
14319
+ "name": "Malawi"
14320
+ },
14321
+ {
14322
+ "code": "MY",
14323
+ "name": "Malaysia"
14324
+ },
14325
+ {
14326
+ "code": "MV",
14327
+ "name": "Maldives"
14328
+ },
14329
+ {
14330
+ "code": "MT",
14331
+ "name": "Malta"
14332
+ },
14333
+ {
14334
+ "code": "MU",
14335
+ "name": "Mauritius"
14336
+ },
14337
+ {
14338
+ "code": "MX",
14339
+ "name": "Mexico"
14340
+ },
14341
+ {
14342
+ "code": "MD",
14343
+ "name": "Moldova"
14344
+ },
14345
+ {
14346
+ "code": "MC",
14347
+ "name": "Monaco"
14348
+ },
14349
+ {
14350
+ "code": "MN",
14351
+ "name": "Mongolia"
14352
+ },
14353
+ {
14354
+ "code": "ME",
14355
+ "name": "Montenegro"
14356
+ },
14357
+ {
14358
+ "code": "MS",
14359
+ "name": "Montserrat"
14360
+ },
14361
+ {
14362
+ "code": "MA",
14363
+ "name": "Morocco"
14364
+ },
14365
+ {
14366
+ "code": "MZ",
14367
+ "name": "Mozambique"
14368
+ },
14369
+ {
14370
+ "code": "MM",
14371
+ "name": "Myanmar (Burma)"
14372
+ },
14373
+ {
14374
+ "code": "NA",
14375
+ "name": "Namibia"
14376
+ },
14377
+ {
14378
+ "code": "NP",
14379
+ "name": "Nepal"
14380
+ },
14381
+ {
14382
+ "code": "NL",
14383
+ "name": "Netherlands"
14384
+ },
14385
+ {
14386
+ "code": "NZ",
14387
+ "name": "New Zealand"
14388
+ },
14389
+ {
14390
+ "code": "NI",
14391
+ "name": "Nicaragua"
14392
+ },
14393
+ {
14394
+ "code": "NG",
14395
+ "name": "Nigeria"
14396
+ },
14397
+ {
14398
+ "code": "MK",
14399
+ "name": "North Macedonia"
14400
+ },
14401
+ {
14402
+ "code": "NO",
14403
+ "name": "Norway"
14404
+ },
14405
+ {
14406
+ "code": "OM",
14407
+ "name": "Oman"
14408
+ },
14409
+ {
14410
+ "code": "PK",
14411
+ "name": "Pakistan"
14412
+ },
14413
+ {
14414
+ "code": "PA",
14415
+ "name": "Panama"
14416
+ },
14417
+ {
14418
+ "code": "PG",
14419
+ "name": "Papua New Guinea"
14420
+ },
14421
+ {
14422
+ "code": "PY",
14423
+ "name": "Paraguay"
14424
+ },
14425
+ {
14426
+ "code": "PE",
14427
+ "name": "Peru"
14428
+ },
14429
+ {
14430
+ "code": "PH",
14431
+ "name": "Philippines"
14432
+ },
14433
+ {
14434
+ "code": "PL",
14435
+ "name": "Poland"
14436
+ },
14437
+ {
14438
+ "code": "PT",
14439
+ "name": "Portugal"
14440
+ },
14441
+ {
14442
+ "code": "QA",
14443
+ "name": "Qatar"
14444
+ },
14445
+ {
14446
+ "code": "RO",
14447
+ "name": "Romania"
14448
+ },
14449
+ {
14450
+ "code": "RU",
14451
+ "name": "Russia"
14452
+ },
14453
+ {
14454
+ "code": "RW",
14455
+ "name": "Rwanda"
14456
+ },
14457
+ {
14458
+ "code": "WS",
14459
+ "name": "Samoa"
14460
+ },
14461
+ {
14462
+ "code": "ST",
14463
+ "name": "São Tomé & Príncipe"
14464
+ },
14465
+ {
14466
+ "code": "SA",
14467
+ "name": "Saudi Arabia"
14468
+ },
14469
+ {
14470
+ "code": "RS",
14471
+ "name": "Serbia"
14472
+ },
14473
+ {
14474
+ "code": "SC",
14475
+ "name": "Seychelles"
14476
+ },
14477
+ {
14478
+ "code": "SL",
14479
+ "name": "Sierra Leone"
14480
+ },
14481
+ {
14482
+ "code": "SG",
14483
+ "name": "Singapore"
14484
+ },
14485
+ {
14486
+ "code": "SX",
14487
+ "name": "Sint Maarten"
14488
+ },
14489
+ {
14490
+ "code": "SK",
14491
+ "name": "Slovakia"
14492
+ },
14493
+ {
14494
+ "code": "SI",
14495
+ "name": "Slovenia"
14496
+ },
14497
+ {
14498
+ "code": "SB",
14499
+ "name": "Solomon Islands"
14500
+ },
14501
+ {
14502
+ "code": "ZA",
14503
+ "name": "South Africa"
14504
+ },
14505
+ {
14506
+ "code": "KR",
14507
+ "name": "South Korea"
14508
+ },
14509
+ {
14510
+ "code": "ES",
14511
+ "name": "Spain"
14512
+ },
14513
+ {
14514
+ "code": "LK",
14515
+ "name": "Sri Lanka"
14516
+ },
14517
+ {
14518
+ "code": "KN",
14519
+ "name": "St. Kitts & Nevis"
14520
+ },
14521
+ {
14522
+ "code": "LC",
14523
+ "name": "St. Lucia"
14524
+ },
14525
+ {
14526
+ "code": "VC",
14527
+ "name": "St. Vincent & Grenadines"
14528
+ },
14529
+ {
14530
+ "code": "SD",
14531
+ "name": "Sudan"
14532
+ },
14533
+ {
14534
+ "code": "SR",
14535
+ "name": "Suriname"
14536
+ },
14537
+ {
14538
+ "code": "SE",
14539
+ "name": "Sweden"
14540
+ },
14541
+ {
14542
+ "code": "CH",
14543
+ "name": "Switzerland"
14544
+ },
14545
+ {
14546
+ "code": "SY",
14547
+ "name": "Syria"
14548
+ },
14549
+ {
14550
+ "code": "TW",
14551
+ "name": "Taiwan"
14552
+ },
14553
+ {
14554
+ "code": "TJ",
14555
+ "name": "Tajikistan"
14556
+ },
14557
+ {
14558
+ "code": "TZ",
14559
+ "name": "Tanzania"
14560
+ },
14561
+ {
14562
+ "code": "TH",
14563
+ "name": "Thailand"
14564
+ },
14565
+ {
14566
+ "code": "TO",
14567
+ "name": "Tonga"
14568
+ },
14569
+ {
14570
+ "code": "TT",
14571
+ "name": "Trinidad & Tobago"
14572
+ },
14573
+ {
14574
+ "code": "TN",
14575
+ "name": "Tunisia"
14576
+ },
14577
+ {
14578
+ "code": "TR",
14579
+ "name": "Turkey"
14580
+ },
14581
+ {
14582
+ "code": "TM",
14583
+ "name": "Turkmenistan"
14584
+ },
14585
+ {
14586
+ "code": "TC",
14587
+ "name": "Turks & Caicos Islands"
14588
+ },
14589
+ {
14590
+ "code": "UG",
14591
+ "name": "Uganda"
14592
+ },
14593
+ {
14594
+ "code": "UA",
14595
+ "name": "Ukraine"
14596
+ },
14597
+ {
14598
+ "code": "AE",
14599
+ "name": "United Arab Emirates"
14600
+ },
14601
+ {
14602
+ "code": "GB",
14603
+ "name": "United Kingdom"
14604
+ },
14605
+ {
14606
+ "code": "US",
14607
+ "name": "United States"
14608
+ },
14609
+ {
14610
+ "code": "UY",
14611
+ "name": "Uruguay"
14612
+ },
14613
+ {
14614
+ "code": "UZ",
14615
+ "name": "Uzbekistan"
14616
+ },
14617
+ {
14618
+ "code": "VE",
14619
+ "name": "Venezuela"
14620
+ },
14621
+ {
14622
+ "code": "VN",
14623
+ "name": "Vietnam"
14624
+ },
14625
+ {
14626
+ "code": "YE",
14627
+ "name": "Yemen"
14628
+ },
14629
+ {
14630
+ "code": "ZM",
14631
+ "name": "Zambia"
14632
+ },
14633
+ {
14634
+ "code": "ZW",
14635
+ "name": "Zimbabwe"
14636
+ }
14637
+ ],
14638
+ left_out: {
14639
+ "unnamed": ["OA", "WO"],
14640
+ "untiered": []
14641
+ }
14642
+ };
13846
14643
  //#endregion
13847
14644
  //#region src/contract/composerProduct.ts
13848
14645
  var EMPTY_DRAFT = {
13849
- product: null,
13850
- territories: [],
13851
- replacesOwnTerritories: false,
13852
- nativeLanguage: false
13853
- };
13854
- var REGIONS = [
13855
- "European Union",
13856
- "Benelux",
13857
- "African Regional (ARIPO)"
13858
- ];
13859
- var COUNTRIES = [
13860
- "United States",
13861
- "United Kingdom",
13862
- "Ireland",
13863
- "France",
13864
- "Germany",
13865
- "Spain",
13866
- "Italy",
13867
- "Netherlands",
13868
- "Switzerland",
13869
- "Austria",
13870
- "Sweden",
13871
- "Norway",
13872
- "Poland",
13873
- "Bulgaria",
13874
- "Greece",
13875
- "Turkey",
13876
- "Canada",
13877
- "Mexico",
13878
- "Brazil",
13879
- "Argentina",
13880
- "China",
13881
- "Hong Kong",
13882
- "Taiwan",
13883
- "Macau",
13884
- "Japan",
13885
- "South Korea",
13886
- "Singapore",
13887
- "India",
13888
- "Thailand",
13889
- "Australia",
13890
- "New Zealand",
13891
- "United Arab Emirates",
13892
- "Saudi Arabia",
13893
- "South Africa"
13894
- ];
14646
+ product: null,
14647
+ territories: [],
14648
+ replacesOwnTerritories: false,
14649
+ nativeLanguage: false
14650
+ };
14651
+ var REGIONS = offered_territories_default.regions.map((t) => t.name);
14652
+ var COUNTRIES = offered_territories_default.countries.map((t) => t.name);
13895
14653
  var ALIASES$1 = {
13896
14654
  "European Union": ["eu", "europe"],
13897
14655
  "United States": [
@@ -13911,45 +14669,7 @@ function tierOf(name) {
13911
14669
  if (COUNTRIES.includes(name)) return "country";
13912
14670
  return null;
13913
14671
  }
13914
- var TERRITORY_CODES = Object.freeze({
13915
- "European Union": "EU",
13916
- "Benelux": "BX",
13917
- "African Regional (ARIPO)": "AP",
13918
- "United States": "US",
13919
- "United Kingdom": "GB",
13920
- "Ireland": "IE",
13921
- "France": "FR",
13922
- "Germany": "DE",
13923
- "Spain": "ES",
13924
- "Italy": "IT",
13925
- "Netherlands": "NL",
13926
- "Switzerland": "CH",
13927
- "Austria": "AT",
13928
- "Sweden": "SE",
13929
- "Norway": "NO",
13930
- "Poland": "PL",
13931
- "Bulgaria": "BG",
13932
- "Greece": "GR",
13933
- "Turkey": "TR",
13934
- "Canada": "CA",
13935
- "Mexico": "MX",
13936
- "Brazil": "BR",
13937
- "Argentina": "AR",
13938
- "China": "CN",
13939
- "Hong Kong": "HK",
13940
- "Taiwan": "TW",
13941
- "Macau": "MO",
13942
- "Japan": "JP",
13943
- "South Korea": "KR",
13944
- "Singapore": "SG",
13945
- "India": "IN",
13946
- "Thailand": "TH",
13947
- "Australia": "AU",
13948
- "New Zealand": "NZ",
13949
- "United Arab Emirates": "AE",
13950
- "Saudi Arabia": "SA",
13951
- "South Africa": "ZA"
13952
- });
14672
+ var TERRITORY_CODES = Object.freeze(Object.fromEntries([...offered_territories_default.regions, ...offered_territories_default.countries].map((t) => [t.name, t.code])));
13953
14673
  var territoryCode = (name) => TERRITORY_CODES[name] ?? name;
13954
14674
  var WITH_ARTICLE = new Set([
13955
14675
  "European Union",
@@ -13970,7 +14690,13 @@ function offerableFor(product) {
13970
14690
  }
13971
14691
  function reachesTerritory(name, covered) {
13972
14692
  if (!Array.isArray(covered)) return true;
13973
- return covered.includes(name);
14693
+ const key = territoryKeyOf(name);
14694
+ return covered.some((c) => territoryKeyOf(c) === key);
14695
+ }
14696
+ var worldwideLine = (registerLabel) => registerLabel ? `Worldwide, searched on ${registerLabel}` : "Worldwide";
14697
+ function territoryKeyOf(value) {
14698
+ const v = String(value ?? "").trim();
14699
+ return TERRITORY_CODES[v] ?? TERRITORY_CODES[ALL_TERRITORIES$1.find((t) => t.toLowerCase() === v.toLowerCase()) ?? ""] ?? canonicalJurisdictionCode(v);
13974
14700
  }
13975
14701
  function territoryMatches(query, chosen, product, limit = 8, _covered) {
13976
14702
  return matchTerritoriesIn(offerableFor(product), query, chosen, limit);
@@ -14057,15 +14783,6 @@ function chooseProduct(d, product) {
14057
14783
  nativeLanguage: nativeLanguageControl(product) === "toggle" ? d.nativeLanguage : false
14058
14784
  };
14059
14785
  }
14060
- function geographyNote(product) {
14061
- if (!product) return null;
14062
- switch (product.geography) {
14063
- case "worldwide, and nothing else": return "Worldwide. This search is not narrowed — that is what it is. To search particular places, pick a different search above.";
14064
- case "exactly one country": return "One country. Regions are not offered here: the case-law and opposition reading is per-country practice, and there is no such thing as one region’s precedent.";
14065
- case "a region, or two or more countries": return "A region, or two or more countries. One country on its own is a Full country search — pick that one instead.";
14066
- default: return "Worldwide, or any set of territories you name.";
14067
- }
14068
- }
14069
14786
  function recommendSearch(products, names, territories) {
14070
14787
  if (territories.length === 0 && names <= 1) return null;
14071
14788
  const live = products.filter((p) => p.available);
@@ -15425,7 +16142,43 @@ function pageWindow(rows, page, size) {
15425
16142
  total: rows.length
15426
16143
  };
15427
16144
  }
15428
- function clearancesColumns(mode) {
16145
+ function clearancesColumns(mode, width = { wide: false }) {
16146
+ if (width.wide) {
16147
+ const wide = [{
16148
+ key: "twisty",
16149
+ share: 4
16150
+ }];
16151
+ if (mode.pick) wide.push({
16152
+ key: "pick",
16153
+ share: 3
16154
+ });
16155
+ wide.push({
16156
+ key: "name",
16157
+ share: 0
16158
+ });
16159
+ if (mode.owner) wide.push({
16160
+ key: "company",
16161
+ share: 11
16162
+ });
16163
+ wide.push({
16164
+ key: "status",
16165
+ share: 16
16166
+ }, {
16167
+ key: "risk",
16168
+ share: 12
16169
+ }, {
16170
+ key: "updated",
16171
+ share: 10
16172
+ }, {
16173
+ key: "actions",
16174
+ share: 25
16175
+ });
16176
+ const left = 100 - wide.reduce((n, c) => n + c.share, 0);
16177
+ return wide.map((c) => c.key === "name" ? {
16178
+ key: "name",
16179
+ share: left
16180
+ } : c);
16181
+ }
15429
16182
  const cols = [{
15430
16183
  key: "twisty",
15431
16184
  share: 4
@@ -15444,16 +16197,16 @@ function clearancesColumns(mode) {
15444
16197
  });
15445
16198
  cols.push({
15446
16199
  key: "status",
15447
- share: mode.owner ? 16 : 19
16200
+ share: mode.owner ? 14 : 16
15448
16201
  }, {
15449
16202
  key: "risk",
15450
16203
  share: mode.owner ? 14 : 15
15451
16204
  }, {
15452
16205
  key: "updated",
15453
- share: 12
16206
+ share: 14
15454
16207
  }, {
15455
16208
  key: "actions",
15456
- share: mode.pick ? 25 : 22
16209
+ share: mode.pick ? 21 : 20
15457
16210
  });
15458
16211
  const rest = 100 - cols.reduce((n, c) => n + c.share, 0);
15459
16212
  return cols.map((c) => c.key === "name" ? {
@@ -15537,11 +16290,11 @@ function RiskDot({ tone, label }) {
15537
16290
  children: "—"
15538
16291
  });
15539
16292
  return (0, import_jsx_runtime.jsxs)("span", {
16293
+ className: "risk-dot",
15540
16294
  style: {
15541
16295
  display: "inline-flex",
15542
16296
  alignItems: "center",
15543
- gap: 8,
15544
- whiteSpace: "nowrap"
16297
+ gap: 8
15545
16298
  },
15546
16299
  children: [(0, import_jsx_runtime.jsx)("span", {
15547
16300
  className: "dot",
@@ -15645,6 +16398,89 @@ function StatusCell({ state, step, reason, failedStage, pausedKind = null, reset
15645
16398
  children: detail
15646
16399
  }) : null] });
15647
16400
  }
16401
+ //#endregion
16402
+ //#region src/components/PinnedScrollbar.tsx
16403
+ function PinnedScrollbar({ target }) {
16404
+ const track = (0, import_react.useRef)(null);
16405
+ const [g, setG] = (0, import_react.useState)({
16406
+ scrolls: false,
16407
+ thumb: 0,
16408
+ left: 0
16409
+ });
16410
+ const drag = (0, import_react.useRef)(null);
16411
+ (0, import_react.useEffect)(() => {
16412
+ const el = target.current;
16413
+ if (!el) return;
16414
+ const measure = () => {
16415
+ const scrolls = /auto|scroll/.test(getComputedStyle(el).overflowX) && el.scrollWidth > el.clientWidth + 1;
16416
+ const ratio = el.clientWidth / Math.max(1, el.scrollWidth);
16417
+ const room = Math.max(1, el.scrollWidth - el.clientWidth);
16418
+ setG({
16419
+ scrolls,
16420
+ thumb: ratio * 100,
16421
+ left: el.scrollLeft / room * (100 - ratio * 100)
16422
+ });
16423
+ el.classList.toggle("has-pinned-bar", scrolls);
16424
+ };
16425
+ const ro = new ResizeObserver(measure);
16426
+ ro.observe(el);
16427
+ if (el.firstElementChild) ro.observe(el.firstElementChild);
16428
+ measure();
16429
+ el.addEventListener("scroll", measure, { passive: true });
16430
+ return () => {
16431
+ ro.disconnect();
16432
+ el.removeEventListener("scroll", measure);
16433
+ el.classList.remove("has-pinned-bar");
16434
+ };
16435
+ }, [target]);
16436
+ if (!g.scrolls) return null;
16437
+ const scale = () => {
16438
+ const el = target.current, t = track.current;
16439
+ return el && t ? el.scrollWidth / Math.max(1, t.clientWidth) : 0;
16440
+ };
16441
+ const onThumbDown = (e) => {
16442
+ const el = target.current;
16443
+ if (!el) return;
16444
+ e.stopPropagation();
16445
+ e.currentTarget.setPointerCapture(e.pointerId);
16446
+ drag.current = {
16447
+ x: e.clientX,
16448
+ scroll: el.scrollLeft
16449
+ };
16450
+ };
16451
+ const onThumbMove = (e) => {
16452
+ const el = target.current, d = drag.current;
16453
+ if (el && d) el.scrollLeft = d.scroll + (e.clientX - d.x) * scale();
16454
+ };
16455
+ const onThumbUp = () => {
16456
+ drag.current = null;
16457
+ };
16458
+ const onTrackDown = (e) => {
16459
+ const el = target.current, t = track.current;
16460
+ if (!el || !t) return;
16461
+ el.scrollLeft = (e.clientX - t.getBoundingClientRect().left) * scale() - el.clientWidth / 2;
16462
+ };
16463
+ return (0, import_jsx_runtime.jsx)("div", {
16464
+ className: "pinned-bar",
16465
+ "aria-hidden": "true",
16466
+ children: (0, import_jsx_runtime.jsx)("div", {
16467
+ ref: track,
16468
+ className: "pinned-track",
16469
+ onPointerDown: onTrackDown,
16470
+ children: (0, import_jsx_runtime.jsx)("div", {
16471
+ className: "pinned-thumb",
16472
+ style: {
16473
+ width: `${g.thumb}%`,
16474
+ left: `${g.left}%`
16475
+ },
16476
+ onPointerDown: onThumbDown,
16477
+ onPointerMove: onThumbMove,
16478
+ onPointerUp: onThumbUp,
16479
+ onPointerCancel: onThumbUp
16480
+ })
16481
+ })
16482
+ });
16483
+ }
15648
16484
  function searchesLeft(usage) {
15649
16485
  if (!usage || !usage.capped || usage.dailyRuns == null) return null;
15650
16486
  return Math.max(0, usage.dailyRuns - usage.today);
@@ -15695,11 +16531,12 @@ function issuedOn(run) {
15695
16531
  day: "2-digit"
15696
16532
  }).format(t);
15697
16533
  }
15698
- function reportPhrase(mark, date, kind = "clearance") {
16534
+ function reportPhrase(mark, date, kind = "clearance", finding = null) {
15699
16535
  const name = String(mark ?? "").trim() || "this mark";
15700
16536
  const noun = kind === "knockout-batch" ? "knockout search" : "clearance";
15701
16537
  const when = readableDate(date);
15702
- return when ? `the ${name} ${noun} from ${when}` : `the ${name} ${noun}`;
16538
+ const report = when ? `the ${name} ${noun} from ${when}` : `the ${name} ${noun}`;
16539
+ return finding === null ? report : `finding ${finding} of ${report}`;
15703
16540
  }
15704
16541
  function askAiPrompt(mark, date, kind = "clearance") {
15705
16542
  return `Brief me on ${reportPhrase(mark, date, kind)}.`;
@@ -15723,12 +16560,30 @@ var ASK_AI_QUESTIONS = [
15723
16560
  }
15724
16561
  ];
15725
16562
  function askAiQuestion(index, run) {
15726
- return (ASK_AI_QUESTIONS[index] ?? ASK_AI_QUESTIONS[0]).compose(reportPhrase(run.markName, run.date, run.kind));
16563
+ return (ASK_AI_QUESTIONS[index] ?? ASK_AI_QUESTIONS[0]).compose(reportPhrase(run.markName, run.date, run.kind, run.finding ?? null));
16564
+ }
16565
+ function findingAsked(asked, kind, pickedMark) {
16566
+ if (!asked) return null;
16567
+ if (kind !== "knockout-batch") return {
16568
+ ordinal: asked.ordinal,
16569
+ markName: null,
16570
+ nonce: asked.nonce
16571
+ };
16572
+ return pickedMark ? {
16573
+ ordinal: asked.ordinal,
16574
+ markName: pickedMark,
16575
+ nonce: asked.nonce
16576
+ } : {
16577
+ ordinal: null,
16578
+ markName: null,
16579
+ nonce: asked.nonce
16580
+ };
15727
16581
  }
15728
16582
  function askAiHeading(run) {
15729
16583
  const text = (s) => String(s ?? "").trim() || null;
15730
16584
  return {
15731
16585
  mark: text(run.markName),
16586
+ finding: run.finding ?? null,
15732
16587
  product: text(run.productName),
15733
16588
  searched: text(run.date)
15734
16589
  };
@@ -15792,18 +16647,38 @@ function askAiOffer(run, access) {
15792
16647
  }
15793
16648
  //#endregion
15794
16649
  //#region src/components/AskAi.tsx
15795
- function AskAi({ runId, markSlug = null, markName, date, kind, productName, access, go, quiet = false, openOnArrival = false }) {
16650
+ function AskAi({ runId, markSlug = null, markName, date, kind, productName, access, go, quiet = false, openOnArrival = false, fromFinding = null, hideButton = false, onClose }) {
15796
16651
  const [open, setOpen] = (0, import_react.useState)(openOnArrival);
16652
+ const [about, setAbout] = (0, import_react.useState)(null);
15797
16653
  const [askAnyway, setAskAnyway] = (0, import_react.useState)(false);
15798
16654
  const [picked, setPicked] = (0, import_react.useState)(0);
15799
16655
  const box = (0, import_react.useRef)(null);
15800
16656
  const rows = (0, import_react.useRef)([]);
16657
+ const asked = about?.markName ?? markName;
15801
16658
  const run = {
16659
+ markName: asked,
16660
+ date,
16661
+ kind,
16662
+ finding: about?.ordinal ?? null
16663
+ };
16664
+ const offer = askAiOffer({
15802
16665
  markName,
15803
16666
  date,
15804
16667
  kind
15805
- };
15806
- const offer = askAiOffer(run, access);
16668
+ }, access);
16669
+ (0, import_react.useEffect)(() => {
16670
+ if (!fromFinding) return;
16671
+ if (open && about?.ordinal === fromFinding.ordinal && about?.markName === fromFinding.markName) {
16672
+ setOpen(false);
16673
+ return;
16674
+ }
16675
+ setAbout({
16676
+ ordinal: fromFinding.ordinal,
16677
+ markName: fromFinding.markName
16678
+ });
16679
+ setPicked(0);
16680
+ setOpen(true);
16681
+ }, [fromFinding]);
15807
16682
  (0, import_react.useEffect)(() => {
15808
16683
  if (!open) return;
15809
16684
  function onDown(e) {
@@ -15819,12 +16694,16 @@ function AskAi({ runId, markSlug = null, markName, date, kind, productName, acce
15819
16694
  document.removeEventListener("keydown", onKey);
15820
16695
  };
15821
16696
  }, [open]);
16697
+ (0, import_react.useEffect)(() => {
16698
+ if (!open && hideButton) onClose?.();
16699
+ }, [open]);
15822
16700
  if (!offer.drawn) return null;
15823
16701
  const asking = offer.connected || askAnyway;
15824
16702
  const heading = askAiHeading({
15825
- markName,
16703
+ markName: asked,
15826
16704
  productName,
15827
- date
16705
+ date,
16706
+ finding: about?.ordinal ?? null
15828
16707
  });
15829
16708
  const ask = () => {
15830
16709
  setOpen(false);
@@ -15852,6 +16731,7 @@ function AskAi({ runId, markSlug = null, markName, date, kind, productName, acce
15852
16731
  "data-anon": "mark",
15853
16732
  children: heading.mark
15854
16733
  }, "mark") : null,
16734
+ heading.finding !== null ? (0, import_jsx_runtime.jsxs)("span", { children: ["finding ", heading.finding] }, "finding") : null,
15855
16735
  heading.product ? (0, import_jsx_runtime.jsx)("span", { children: heading.product }, "product") : null,
15856
16736
  heading.searched ? (0, import_jsx_runtime.jsxs)("span", {
15857
16737
  className: "ask-ai-when",
@@ -15866,12 +16746,15 @@ function AskAi({ runId, markSlug = null, markName, date, kind, productName, acce
15866
16746
  className: "ask-ai",
15867
16747
  "data-ask-ai": asking ? "ask" : "connect",
15868
16748
  children: [
15869
- (0, import_jsx_runtime.jsxs)("button", {
16749
+ hideButton ? null : (0, import_jsx_runtime.jsxs)("button", {
15870
16750
  type: "button",
15871
16751
  className: quiet ? "btn-ghost ask-ai-btn is-quiet" : "btn-ghost ask-ai-btn",
15872
16752
  "aria-haspopup": "dialog",
15873
16753
  "aria-expanded": open,
15874
- onClick: () => setOpen((v) => !v),
16754
+ onClick: () => {
16755
+ setAbout(null);
16756
+ setOpen((v) => !v);
16757
+ },
15875
16758
  children: [(0, import_jsx_runtime.jsx)(Icon, {
15876
16759
  name: "sparkles",
15877
16760
  size: 14
@@ -16010,6 +16893,18 @@ function writeGroupPref(on) {
16010
16893
  } catch {}
16011
16894
  }
16012
16895
  function Clearances({ ctx }) {
16896
+ const [tableWidth, setTableWidth] = (0, import_react.useState)(0);
16897
+ const widthWatch = (0, import_react.useRef)(null);
16898
+ const namesWrapEl = (0, import_react.useRef)(null);
16899
+ const namesWrap = (0, import_react.useCallback)((el) => {
16900
+ namesWrapEl.current = el;
16901
+ widthWatch.current?.disconnect();
16902
+ widthWatch.current = null;
16903
+ if (!el) return;
16904
+ widthWatch.current = new ResizeObserver(() => setTableWidth(el.clientWidth));
16905
+ widthWatch.current.observe(el);
16906
+ setTableWidth(el.clientWidth);
16907
+ }, []);
16013
16908
  const [filter, setFilter] = (0, import_react.useState)("all");
16014
16909
  const [sort, setSort] = (0, import_react.useState)({
16015
16910
  key: "date",
@@ -16038,6 +16933,7 @@ function Clearances({ ctx }) {
16038
16933
  const families = famResult?.kind === "ok" ? famResult.value : NO_FAMILIES;
16039
16934
  const { result: aiResult } = useLoad(() => api.mcpAccess(), []);
16040
16935
  const aiAccess = aiResult?.kind === "ok" ? aiResult.value : null;
16936
+ const [askFor, setAskFor] = (0, import_react.useState)(null);
16041
16937
  const [picked, setPicked] = (0, import_react.useState)(new Set());
16042
16938
  const canGroup = canManage(ctx.me) && seesAll;
16043
16939
  const [showRetired, setShowRetired] = (0, import_react.useState)(false);
@@ -16184,7 +17080,7 @@ function Clearances({ ctx }) {
16184
17080
  else next.add(id);
16185
17081
  return next;
16186
17082
  });
16187
- const askAi = (_name, read) => (0, import_jsx_runtime.jsx)(AskAi, {
17083
+ const askAi = (_name, read) => askFor !== read.runId ? null : (0, import_jsx_runtime.jsx)(AskAi, {
16188
17084
  runId: read.runId,
16189
17085
  markName: read.markName,
16190
17086
  date: read.date,
@@ -16192,7 +17088,18 @@ function Clearances({ ctx }) {
16192
17088
  productName: runProductLabel(read.productName, read.marks.length),
16193
17089
  access: aiAccess,
16194
17090
  go: ctx.go,
16195
- quiet: true
17091
+ quiet: true,
17092
+ hideButton: true,
17093
+ openOnArrival: true,
17094
+ onClose: () => setAskFor(null)
17095
+ });
17096
+ const askMenu = (read) => ({
17097
+ show: askAiOffer({
17098
+ markName: read.markName,
17099
+ date: read.date,
17100
+ kind: read.kind
17101
+ }, aiAccess).drawn,
17102
+ open: () => setAskFor(read.runId)
16196
17103
  });
16197
17104
  const sortBtn = (key, label) => (0, import_jsx_runtime.jsxs)("button", {
16198
17105
  type: "button",
@@ -16375,13 +17282,14 @@ function Clearances({ ctx }) {
16375
17282
  }) : null,
16376
17283
  (0, import_jsx_runtime.jsx)("div", {
16377
17284
  className: "table-wrap names-wrap",
17285
+ ref: namesWrap,
16378
17286
  children: (0, import_jsx_runtime.jsxs)("table", {
16379
17287
  className: "data fixed",
16380
17288
  children: [
16381
17289
  (0, import_jsx_runtime.jsx)("colgroup", { children: clearancesColumns({
16382
17290
  pick: canGroup,
16383
17291
  owner: showOwnerColumn
16384
- }).map((c) => (0, import_jsx_runtime.jsx)("col", { style: { width: `${c.share}%` } }, c.key)) }),
17292
+ }, { wide: tableWidth >= 960 }).map((c) => (0, import_jsx_runtime.jsx)("col", { style: { width: `${c.share}%` } }, c.key)) }),
16385
17293
  (0, import_jsx_runtime.jsx)("thead", { children: (0, import_jsx_runtime.jsxs)("tr", { children: [
16386
17294
  (0, import_jsx_runtime.jsx)("th", {}),
16387
17295
  canGroup ? (0, import_jsx_runtime.jsx)("th", { "aria-label": "Select for grouping" }) : null,
@@ -16428,7 +17336,8 @@ function Clearances({ ctx }) {
16428
17336
  onUngroup: canGroup ? ungroupFamily : void 0,
16429
17337
  onRetire: canGroup ? retireMark : void 0,
16430
17338
  onRetireRun: canGroup ? retireRun : void 0,
16431
- askAi
17339
+ askAi,
17340
+ askMenu
16432
17341
  }) : (0, import_jsx_runtime.jsx)(MarkRow, {
16433
17342
  mark: r,
16434
17343
  open: open.has(r.id),
@@ -16441,12 +17350,14 @@ function Clearances({ ctx }) {
16441
17350
  onPick: () => pick(r.id),
16442
17351
  onRetire: canGroup ? retireMark : void 0,
16443
17352
  onRetireRun: canGroup ? retireRun : void 0,
16444
- askAi
17353
+ askAi,
17354
+ askMenu
16445
17355
  })] }, r.id);
16446
17356
  })] })
16447
17357
  ]
16448
17358
  })
16449
17359
  }),
17360
+ (0, import_jsx_runtime.jsx)(PinnedScrollbar, { target: namesWrapEl }),
16450
17361
  !rows.length ? (0, import_jsx_runtime.jsx)("div", {
16451
17362
  className: "empty",
16452
17363
  children: "No names match this view."
@@ -16666,34 +17577,37 @@ function MenuItem({ onSelect, title, children }) {
16666
17577
  });
16667
17578
  }
16668
17579
  function RowActions({ open, ask, menu }) {
16669
- return (0, import_jsx_runtime.jsxs)("div", {
16670
- className: "row-actions",
16671
- children: [
16672
- (0, import_jsx_runtime.jsx)("span", {
16673
- className: "row-actions-open",
16674
- children: open ? (0, import_jsx_runtime.jsx)("button", {
16675
- type: "button",
16676
- className: "row-open",
16677
- onClick: (e) => {
16678
- e.stopPropagation();
16679
- open.go();
16680
- },
16681
- children: open.label
16682
- }) : null
16683
- }),
16684
- (0, import_jsx_runtime.jsx)("span", {
16685
- className: "row-actions-ask",
16686
- onClick: (e) => e.stopPropagation(),
16687
- children: ask
16688
- }),
16689
- (0, import_jsx_runtime.jsx)("span", {
16690
- className: "row-actions-more",
16691
- children: menu
16692
- })
16693
- ]
17580
+ return (0, import_jsx_runtime.jsx)("div", {
17581
+ className: "row-actions-box",
17582
+ children: (0, import_jsx_runtime.jsxs)("div", {
17583
+ className: "row-actions",
17584
+ children: [
17585
+ (0, import_jsx_runtime.jsx)("span", {
17586
+ className: "row-actions-open",
17587
+ children: open ? (0, import_jsx_runtime.jsx)("button", {
17588
+ type: "button",
17589
+ className: "row-open",
17590
+ onClick: (e) => {
17591
+ e.stopPropagation();
17592
+ open.go();
17593
+ },
17594
+ children: open.label
17595
+ }) : null
17596
+ }),
17597
+ (0, import_jsx_runtime.jsx)("span", {
17598
+ className: "row-actions-ask",
17599
+ onClick: (e) => e.stopPropagation(),
17600
+ children: ask
17601
+ }),
17602
+ (0, import_jsx_runtime.jsx)("span", {
17603
+ className: "row-actions-more",
17604
+ children: menu
17605
+ })
17606
+ ]
17607
+ })
16694
17608
  });
16695
17609
  }
16696
- function FamilyRows({ family, isOpen, onToggle, go, picking, showOwner = false, ownerLabel = "", isPicked, onPick, onUngroup, onRetire, onRetireRun, askAi }) {
17610
+ function FamilyRows({ family, isOpen, onToggle, go, picking, showOwner = false, ownerLabel = "", isPicked, onPick, onUngroup, onRetire, onRetireRun, askAi, askMenu }) {
16697
17611
  const open = isOpen(family.id);
16698
17612
  const busy = groupStatus(family);
16699
17613
  return (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [(0, import_jsx_runtime.jsxs)("tr", {
@@ -16733,10 +17647,7 @@ function FamilyRows({ family, isOpen, onToggle, go, picking, showOwner = false,
16733
17647
  }) : null,
16734
17648
  (0, import_jsx_runtime.jsx)("td", { children: busy ? (0, import_jsx_runtime.jsxs)("span", {
16735
17649
  className: "status",
16736
- children: [(0, import_jsx_runtime.jsx)("span", { className: `dot ${busy.state}` }), (0, import_jsx_runtime.jsx)("span", {
16737
- className: "status-count",
16738
- children: busy.text
16739
- })]
17650
+ children: [(0, import_jsx_runtime.jsx)("span", { className: `dot ${busy.state}` }), (0, import_jsx_runtime.jsx)("span", { children: busy.text.replace(/^(\d+) /, "$1\xA0") })]
16740
17651
  }) : (0, import_jsx_runtime.jsx)(StatusCell, {
16741
17652
  state: family.state,
16742
17653
  step: null,
@@ -16787,10 +17698,11 @@ function FamilyRows({ family, isOpen, onToggle, go, picking, showOwner = false,
16787
17698
  onPick: () => onPick(m.id),
16788
17699
  onRetire,
16789
17700
  onRetireRun,
16790
- askAi
17701
+ askAi,
17702
+ askMenu
16791
17703
  }, m.id)) : null] });
16792
17704
  }
16793
- function MarkRow({ mark, open, onToggle, go, indent = false, picking = false, showOwner = false, ownerLabel = "", picked = false, onPick, onRetire, onRetireRun, askAi }) {
17705
+ function MarkRow({ mark, open, onToggle, go, indent = false, picking = false, showOwner = false, ownerLabel = "", picked = false, onPick, onRetire, onRetireRun, askAi, askMenu }) {
16794
17706
  const run = mark.current;
16795
17707
  const threaded = mark.reads.length > 1;
16796
17708
  const report = shownReport(mark);
@@ -16891,13 +17803,16 @@ function MarkRow({ mark, open, onToggle, go, indent = false, picking = false, sh
16891
17803
  go: openReport
16892
17804
  } : null,
16893
17805
  ask: actions.askAbout ? askAi(mark.name, actions.askAbout) : null,
16894
- menu: onRetire ? (0, import_jsx_runtime.jsx)(RowMenu$1, {
17806
+ menu: onRetire || actions.askAbout && askMenu(actions.askAbout).show ? (0, import_jsx_runtime.jsxs)(RowMenu$1, {
16895
17807
  label: `More actions for ${mark.name}`,
16896
- children: (0, import_jsx_runtime.jsx)(MenuItem, {
17808
+ children: [onRetire ? (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: (0, import_jsx_runtime.jsx)(MenuItem, {
16897
17809
  title: threaded ? `Retire all ${mark.reads.length} searches of ${mark.name} — the whole name comes off this list for everyone; the reports and their links stay, and "Show retired" brings it back. To retire ONE search, open the row and use that search's menu.` : `Retire ${mark.name} — it comes off this list for everyone; the reports and their links stay, and "Show retired" brings it back`,
16898
17810
  onSelect: () => onRetire(mark),
16899
17811
  children: threaded ? `Retire all ${mark.reads.length}` : "Retire"
16900
- })
17812
+ }) }) : null, actions.askAbout && askMenu(actions.askAbout).show ? (0, import_jsx_runtime.jsx)(MenuItem, {
17813
+ onSelect: () => askMenu(actions.askAbout).open(),
17814
+ children: "Ask AI"
17815
+ }) : null]
16901
17816
  }) : null
16902
17817
  })
16903
17818
  })
@@ -17266,6 +18181,38 @@ function readCommandFailure(data, sameSource) {
17266
18181
  message: typeof m.message === "string" ? m.message : "it did not say why"
17267
18182
  };
17268
18183
  }
18184
+ function readAskAi(data, sameSource) {
18185
+ if (!sameSource) return null;
18186
+ if (typeof data !== "object" || data === null) return null;
18187
+ const m = data;
18188
+ if (m.source !== "cordillera-report" || m.type !== "askAi") return null;
18189
+ const whole = (v) => typeof v === "number" && Number.isInteger(v) && v >= 0 ? v : null;
18190
+ return {
18191
+ ordinal: whole(m.ordinal),
18192
+ markIndex: whole(m.markIndex)
18193
+ };
18194
+ }
18195
+ function readFrameSections(data, sameSource) {
18196
+ if (!sameSource) return null;
18197
+ if (typeof data !== "object" || data === null) return null;
18198
+ const msg = data;
18199
+ if (msg.source !== "cordillera-report" || msg.type !== "sections") return null;
18200
+ if (!Array.isArray(msg.sections)) return null;
18201
+ const out = [];
18202
+ for (const raw of msg.sections) {
18203
+ if (typeof raw !== "object" || raw === null) continue;
18204
+ const { id, label } = raw;
18205
+ if (typeof id !== "string" || typeof label !== "string") continue;
18206
+ const trimmed = label.trim().slice(0, 40);
18207
+ if (!id.trim() || !trimmed) continue;
18208
+ out.push({
18209
+ id,
18210
+ label: trimmed
18211
+ });
18212
+ if (out.length === 12) break;
18213
+ }
18214
+ return out;
18215
+ }
17269
18216
  function frameCommand(command, value) {
17270
18217
  return {
17271
18218
  source: FRAME_TAG,
@@ -17281,6 +18228,8 @@ function useReportFrame() {
17281
18228
  const [height, setHeight] = (0, import_react.useState)(FIRST_PAINT);
17282
18229
  const [failed, setFailed] = (0, import_react.useState)(null);
17283
18230
  const [controls, setControls] = (0, import_react.useState)(null);
18231
+ const [sections, setSections] = (0, import_react.useState)(null);
18232
+ const [askedFrom, setAskedFrom] = (0, import_react.useState)(null);
17284
18233
  (0, import_react.useEffect)(() => {
17285
18234
  function onMessage(e) {
17286
18235
  const frame = ref.current;
@@ -17295,6 +18244,11 @@ function useReportFrame() {
17295
18244
  setControls(has);
17296
18245
  return;
17297
18246
  }
18247
+ const secs = readFrameSections(e.data, mine);
18248
+ if (secs !== null) {
18249
+ setSections(secs);
18250
+ return;
18251
+ }
17298
18252
  const jump = readFrameScroll(e.data, mine);
17299
18253
  if (jump !== null) {
17300
18254
  if (frame) {
@@ -17313,6 +18267,14 @@ function useReportFrame() {
17313
18267
  setFailed(`That did not work — the report could not ${bad.command}. (${bad.message})`);
17314
18268
  return;
17315
18269
  }
18270
+ const asked = readAskAi(e.data, mine);
18271
+ if (asked) {
18272
+ setAskedFrom((prev) => ({
18273
+ ...asked,
18274
+ nonce: (prev?.nonce ?? 0) + 1
18275
+ }));
18276
+ return;
18277
+ }
17316
18278
  }
17317
18279
  window.addEventListener("message", onMessage);
17318
18280
  return () => window.removeEventListener("message", onMessage);
@@ -17326,6 +18288,8 @@ function useReportFrame() {
17326
18288
  }, []),
17327
18289
  failed,
17328
18290
  controls,
18291
+ sections,
18292
+ askedFrom,
17329
18293
  clearFailed: () => setFailed(null)
17330
18294
  };
17331
18295
  }
@@ -17482,6 +18446,10 @@ function Result({ ctx, runId, markSlug }) {
17482
18446
  const run = (0, import_react.useMemo)(() => runs.find((r) => r.runId === runId) ?? null, [runs, runId]);
17483
18447
  const reads = (0, import_react.useMemo)(() => run ? readsFor(runs, run) : [], [runs, run]);
17484
18448
  const frame = useReportFrame();
18449
+ const [atSection, setAtSection] = (0, import_react.useState)(null);
18450
+ (0, import_react.useEffect)(() => {
18451
+ setAtSection(null);
18452
+ }, [runId, markSlug]);
17485
18453
  const grouped = run !== null && showsAssessment(run, markSlug);
17486
18454
  const { result: summaryResult } = useLoad(() => grouped ? api.runSummary(runId) : Promise.resolve({ kind: "notFound" }), [runId, grouped]);
17487
18455
  const assessment = summaryResult?.kind === "ok" ? summaryResult.value : [];
@@ -17540,9 +18508,9 @@ function Result({ ctx, runId, markSlug }) {
17540
18508
  })] })
17541
18509
  ]
17542
18510
  }),
17543
- (0, import_jsx_runtime.jsx)("div", {
18511
+ (0, import_jsx_runtime.jsxs)("div", {
17544
18512
  className: "report-head",
17545
- children: (0, import_jsx_runtime.jsxs)("div", {
18513
+ children: [(0, import_jsx_runtime.jsxs)("div", {
17546
18514
  style: {
17547
18515
  display: "flex",
17548
18516
  alignItems: "center",
@@ -17601,7 +18569,8 @@ function Result({ ctx, runId, markSlug }) {
17601
18569
  productName: product,
17602
18570
  access,
17603
18571
  go: ctx.go,
17604
- openOnArrival: askOnArrival
18572
+ openOnArrival: askOnArrival,
18573
+ fromFinding: findingAsked(frame.askedFrom, run.kind, pickedMark)
17605
18574
  }),
17606
18575
  doc ? (0, import_jsx_runtime.jsx)(ExportMenu, {
17607
18576
  send: frame.send,
@@ -17609,46 +18578,74 @@ function Result({ ctx, runId, markSlug }) {
17609
18578
  offered: frame.controls ?? []
17610
18579
  }) : null
17611
18580
  ]
17612
- })
17613
- }),
17614
- hasThread(reads) ? (0, import_jsx_runtime.jsxs)("div", {
17615
- style: {
17616
- display: "flex",
17617
- gap: 8,
17618
- flexWrap: "wrap",
17619
- margin: "18px 0 4px"
17620
- },
17621
- children: [(0, import_jsx_runtime.jsx)("span", {
17622
- className: "eyebrow",
17623
- style: { alignSelf: "center" },
17624
- children: "Reads"
17625
- }), reads.map((r) => {
17626
- const active = r.runId === run.runId;
17627
- return (0, import_jsx_runtime.jsxs)("button", {
17628
- type: "button",
17629
- className: "pill",
17630
- "aria-current": active ? "true" : void 0,
17631
- onClick: () => ctx.go(resultPath(r.runId)),
17632
- style: {
17633
- cursor: "pointer",
17634
- display: "inline-flex",
17635
- alignItems: "center",
17636
- gap: 7,
17637
- background: active ? "var(--accent-wash)" : "var(--surface-sunken)",
17638
- borderColor: active ? "var(--accent)" : "var(--border-hairline)",
17639
- color: active ? "var(--text-accent)" : "var(--text-muted)"
17640
- },
17641
- children: [r.tone ? (0, import_jsx_runtime.jsx)("span", {
17642
- className: "dot",
18581
+ }), hasThread(reads) || (frame.sections?.length ?? 0) > 1 ? (0, import_jsx_runtime.jsxs)("div", {
18582
+ className: "report-nav",
18583
+ children: [
18584
+ hasThread(reads) ? (0, import_jsx_runtime.jsxs)("div", {
17643
18585
  style: {
17644
- background: `var(--tone-${r.tone})`,
17645
- width: 7,
17646
- height: 7
17647
- }
17648
- }) : null, readLabel(r)]
17649
- }, r.runId);
17650
- })]
17651
- }) : null,
18586
+ display: "flex",
18587
+ gap: 8,
18588
+ flexWrap: "wrap",
18589
+ alignItems: "center"
18590
+ },
18591
+ children: [(0, import_jsx_runtime.jsx)("span", {
18592
+ className: "eyebrow",
18593
+ style: { alignSelf: "center" },
18594
+ children: "Reads"
18595
+ }), reads.map((r) => {
18596
+ const active = r.runId === run.runId;
18597
+ return (0, import_jsx_runtime.jsxs)("button", {
18598
+ type: "button",
18599
+ className: "pill",
18600
+ "aria-current": active ? "true" : void 0,
18601
+ onClick: () => ctx.go(resultPath(r.runId)),
18602
+ style: {
18603
+ cursor: "pointer",
18604
+ display: "inline-flex",
18605
+ alignItems: "center",
18606
+ gap: 7,
18607
+ background: active ? "var(--accent-wash)" : "var(--surface-sunken)",
18608
+ borderColor: active ? "var(--accent)" : "var(--border-hairline)",
18609
+ color: active ? "var(--text-accent)" : "var(--text-muted)"
18610
+ },
18611
+ children: [r.tone ? (0, import_jsx_runtime.jsx)("span", {
18612
+ className: "dot",
18613
+ style: {
18614
+ background: `var(--tone-${r.tone})`,
18615
+ width: 7,
18616
+ height: 7
18617
+ }
18618
+ }) : null, readLabel(r)]
18619
+ }, r.runId);
18620
+ })]
18621
+ }) : null,
18622
+ hasThread(reads) && (frame.sections?.length ?? 0) > 1 ? (0, import_jsx_runtime.jsx)("span", {
18623
+ className: "report-nav-sep",
18624
+ "aria-hidden": "true"
18625
+ }) : null,
18626
+ (frame.sections?.length ?? 0) > 1 ? (0, import_jsx_runtime.jsx)("nav", {
18627
+ className: "report-sections",
18628
+ "aria-label": "Sections of this report",
18629
+ children: (frame.sections ?? []).map((sec, i) => {
18630
+ const now = atSection === null ? i === 0 : atSection === sec.id;
18631
+ return (0, import_jsx_runtime.jsxs)("button", {
18632
+ type: "button",
18633
+ className: "report-section",
18634
+ "aria-current": now ? "true" : void 0,
18635
+ onClick: () => {
18636
+ setAtSection(sec.id);
18637
+ frame.send("section", sec.id);
18638
+ },
18639
+ children: [(0, import_jsx_runtime.jsx)("span", {
18640
+ className: "report-section-dot",
18641
+ "aria-hidden": "true"
18642
+ }), sec.label]
18643
+ }, sec.id);
18644
+ })
18645
+ }) : null
18646
+ ]
18647
+ }) : null]
18648
+ }),
17652
18649
  frame.failed ? (0, import_jsx_runtime.jsxs)("div", {
17653
18650
  className: "notice",
17654
18651
  style: { borderLeftColor: "var(--tone-high)" },
@@ -18451,7 +19448,6 @@ function NewClearance({ ctx }) {
18451
19448
  const activePipeline = activeLevel?.pipeline ?? null;
18452
19449
  const marketplacesApply = activePipeline !== "knockout";
18453
19450
  const whereLevel = pickedByHand || draft.savedSearch || editingSlug ? activeLevel : null;
18454
- const geoNote = geographyNote(whereLevel);
18455
19451
  const nativeControl = nativeLanguageControl(activeLevel);
18456
19452
  const machinery = machineryFor(draft.pick, activeLevel);
18457
19453
  const knockout = (0, import_react.useMemo)(() => levels.filter((l) => l.available && l.maxNames > 1).sort((a, b) => b.maxNames - a.maxNames)[0] ?? null, [levels]);
@@ -18857,153 +19853,131 @@ function NewClearance({ ctx }) {
18857
19853
  children: [names.length, " names, one search."]
18858
19854
  }) : null
18859
19855
  ] }),
18860
- (0, import_jsx_runtime.jsxs)("div", { children: [
19856
+ (0, import_jsx_runtime.jsxs)("div", { children: [(0, import_jsx_runtime.jsx)("div", {
19857
+ className: "section-title",
19858
+ children: "Where"
19859
+ }), whereLevel?.geography === "worldwide, and nothing else" ? (0, import_jsx_runtime.jsx)("div", {
19860
+ style: {
19861
+ display: "flex",
19862
+ flexWrap: "wrap",
19863
+ gap: 6,
19864
+ margin: "9px 0 0"
19865
+ },
19866
+ children: (0, import_jsx_runtime.jsx)("span", {
19867
+ className: "chip",
19868
+ children: worldwideLine(registerLabel)
19869
+ })
19870
+ }) : (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
18861
19871
  (0, import_jsx_runtime.jsx)("div", {
18862
- className: "section-title",
18863
- children: "Where"
18864
- }),
18865
- geoNote ? (0, import_jsx_runtime.jsx)("p", {
18866
- className: "section-hint",
18867
- children: geoNote
18868
- }) : null,
18869
- whereLevel?.geography === "worldwide, and nothing else" ? (0, import_jsx_runtime.jsx)("div", {
18870
19872
  style: {
18871
19873
  display: "flex",
18872
19874
  flexWrap: "wrap",
18873
19875
  gap: 6,
18874
- margin: "9px 0 0"
19876
+ margin: "9px 0 12px"
18875
19877
  },
18876
- children: (0, import_jsx_runtime.jsx)("span", {
18877
- className: "chip",
18878
- children: "Worldwide"
18879
- })
18880
- }) : (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
18881
- (0, import_jsx_runtime.jsx)("div", {
19878
+ children: draft.pick.territories.length === 0 ? own.territories.length ? (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [own.territories.map((t) => (0, import_jsx_runtime.jsxs)("span", {
19879
+ "data-anon": "mark",
19880
+ className: reachesTerritory(t, registerTerritories) ? "chip" : "chip chip-deferred",
19881
+ title: reachesTerritory(t, registerTerritories) ? void 0 : notAvailableLine([t], registerLabel),
19882
+ children: [reachesTerritory(t, registerTerritories) ? t : notAvailableLine([t], registerLabel), (0, import_jsx_runtime.jsx)("button", {
19883
+ type: "button",
19884
+ "aria-label": `Remove ${t}`,
19885
+ className: "chip-x",
19886
+ onClick: () => setPick(takeOverOwnTerritories(draft.pick, own.territories, t)),
19887
+ children: (0, import_jsx_runtime.jsx)(Icon, {
19888
+ name: "x",
19889
+ size: 13
19890
+ })
19891
+ })]
19892
+ }, t)), (0, import_jsx_runtime.jsx)("span", {
18882
19893
  style: {
18883
- display: "flex",
18884
- flexWrap: "wrap",
18885
- gap: 6,
18886
- margin: "9px 0 12px"
19894
+ fontSize: 11,
19895
+ color: "var(--text-faint)",
19896
+ alignSelf: "center"
18887
19897
  },
18888
- children: draft.pick.territories.length === 0 ? own.territories.length ? (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [own.territories.map((t) => (0, import_jsx_runtime.jsxs)("span", {
18889
- "data-anon": "mark",
18890
- className: reachesTerritory(t, registerTerritories) ? "chip" : "chip chip-deferred",
18891
- title: reachesTerritory(t, registerTerritories) ? void 0 : notAvailableLine([t], registerLabel),
18892
- children: [reachesTerritory(t, registerTerritories) ? t : notAvailableLine([t], registerLabel), (0, import_jsx_runtime.jsx)("button", {
18893
- type: "button",
18894
- "aria-label": `Remove ${t}`,
18895
- className: "chip-x",
18896
- onClick: () => setPick(takeOverOwnTerritories(draft.pick, own.territories, t)),
18897
- children: (0, import_jsx_runtime.jsx)(Icon, {
18898
- name: "x",
18899
- size: 13
18900
- })
18901
- })]
18902
- }, t)), (0, import_jsx_runtime.jsx)("span", {
18903
- style: {
18904
- fontSize: 11,
18905
- color: "var(--text-faint)",
18906
- alignSelf: "center"
18907
- },
18908
- children: own.territoriesFrom
18909
- })] }) : (0, import_jsx_runtime.jsx)("span", {
18910
- className: "chip",
18911
- children: "Worldwide"
18912
- }) : draft.pick.territories.map((t) => (0, import_jsx_runtime.jsxs)("span", {
18913
- className: reachesTerritory(t, registerTerritories) ? "chip chip-own" : "chip chip-own chip-deferred",
18914
- title: reachesTerritory(t, registerTerritories) ? void 0 : notAvailableLine([t], registerLabel),
18915
- children: [reachesTerritory(t, registerTerritories) ? t : notAvailableLine([t], registerLabel), (0, import_jsx_runtime.jsx)("button", {
18916
- type: "button",
18917
- "aria-label": `Remove ${t}`,
18918
- className: "chip-x",
18919
- onClick: () => setPick(removeTerritory(draft.pick, t)),
18920
- children: (0, import_jsx_runtime.jsx)(Icon, {
18921
- name: "x",
18922
- size: 13
18923
- })
18924
- })]
18925
- }, t))
18926
- }),
18927
- (0, import_jsx_runtime.jsx)("div", {
18928
- className: "field-label",
18929
- children: whereLevel?.geography === "exactly one country" ? "Add a country" : "Add a country or region"
18930
- }),
18931
- (0, import_jsx_runtime.jsxs)("div", {
18932
- className: "fld-medium",
18933
- style: { position: "relative" },
18934
- children: [(0, import_jsx_runtime.jsx)("input", {
18935
- value: territoryQuery,
18936
- onChange: (e) => setTerritoryQuery(e.target.value),
18937
- autoComplete: "off",
18938
- "aria-label": "Add a territory",
18939
- className: "ctx-input"
18940
- }), territoryMatches(territoryQuery, draft.pick.territories, whereLevel, 8, registerTerritories).length ? (0, import_jsx_runtime.jsx)("div", {
18941
- className: "typeahead",
18942
- children: territoryMatches(territoryQuery, draft.pick.territories, whereLevel, 8, registerTerritories).map((t) => (0, import_jsx_runtime.jsxs)("button", {
18943
- type: "button",
18944
- disabled: !reachesTerritory(t, registerTerritories),
18945
- onClick: () => {
18946
- setPick(addTerritory(draft.pick, t, whereLevel, registerTerritories));
18947
- setTerritoryQuery("");
18948
- },
18949
- children: [t, reachesTerritory(t, registerTerritories) ? null : (0, import_jsx_runtime.jsx)("span", {
18950
- className: "typeahead-note",
18951
- children: notAvailableLine([], registerLabel)
18952
- })]
18953
- }, t))
18954
- }) : null]
18955
- }),
18956
- whereLevel?.geography === "exactly one country" && draft.pick.territories.length === 1 ? (0, import_jsx_runtime.jsxs)("div", {
18957
- className: "callout-accent",
18958
- children: [draft.pick.territories[0], " — naming another country replaces it, because this search reads one at a time."]
18959
- }) : null
18960
- ] })
18961
- ] }),
18962
- (0, import_jsx_runtime.jsxs)("div", { children: [
18963
- (0, import_jsx_runtime.jsx)("div", {
18964
- className: "section-title",
18965
- children: "Goods or services"
18966
- }),
18967
- (0, import_jsx_runtime.jsx)("p", {
18968
- className: "section-hint",
18969
- children: "Optional. Say what the name is for, to focus the search. Without it, the classes below are used."
19898
+ children: own.territoriesFrom
19899
+ })] }) : (0, import_jsx_runtime.jsx)("span", {
19900
+ className: "chip",
19901
+ children: worldwideLine(registerLabel)
19902
+ }) : draft.pick.territories.map((t) => (0, import_jsx_runtime.jsxs)("span", {
19903
+ className: reachesTerritory(t, registerTerritories) ? "chip chip-own" : "chip chip-own chip-deferred",
19904
+ title: reachesTerritory(t, registerTerritories) ? void 0 : notAvailableLine([t], registerLabel),
19905
+ children: [reachesTerritory(t, registerTerritories) ? t : notAvailableLine([t], registerLabel), (0, import_jsx_runtime.jsx)("button", {
19906
+ type: "button",
19907
+ "aria-label": `Remove ${t}`,
19908
+ className: "chip-x",
19909
+ onClick: () => setPick(removeTerritory(draft.pick, t)),
19910
+ children: (0, import_jsx_runtime.jsx)(Icon, {
19911
+ name: "x",
19912
+ size: 13
19913
+ })
19914
+ })]
19915
+ }, t))
18970
19916
  }),
18971
- (0, import_jsx_runtime.jsx)("textarea", {
18972
- value: draft.goods,
18973
- onChange: (e) => edit({ goods: e.target.value }),
18974
- rows: 3,
18975
- "aria-label": "Goods or services",
18976
- placeholder: "Example: energy drinks; dietary supplements",
18977
- className: "ctx-input",
18978
- style: {
18979
- resize: "vertical",
18980
- lineHeight: 1.5
18981
- }
18982
- })
18983
- ] }),
18984
- (0, import_jsx_runtime.jsxs)("div", { children: [
18985
19917
  (0, import_jsx_runtime.jsx)("div", {
18986
- className: "section-title",
18987
- children: "Context (optional)"
19918
+ className: "field-label",
19919
+ children: whereLevel?.geography === "exactly one country" ? "Add a country" : "Add a country or region"
18988
19920
  }),
18989
- (0, import_jsx_runtime.jsx)("textarea", {
18990
- value: draft.instructions,
18991
- onChange: (e) => edit({ instructions: e.target.value }),
18992
- rows: 3,
18993
- "aria-label": "Context (optional)",
18994
- placeholder: "Example: we already own the mark in the US and this is about the EU launch. Our launch page is https://example.com/press/aquaplus-launch, and there is a LinkedIn post announcing it from 3 June.",
18995
- className: "ctx-input",
18996
- style: {
18997
- resize: "vertical",
18998
- lineHeight: 1.5
18999
- }
19921
+ (0, import_jsx_runtime.jsxs)("div", {
19922
+ className: "fld-medium",
19923
+ style: { position: "relative" },
19924
+ children: [(0, import_jsx_runtime.jsx)("input", {
19925
+ value: territoryQuery,
19926
+ onChange: (e) => setTerritoryQuery(e.target.value),
19927
+ autoComplete: "off",
19928
+ "aria-label": "Add a territory",
19929
+ className: "ctx-input"
19930
+ }), territoryMatches(territoryQuery, draft.pick.territories, whereLevel, 8, registerTerritories).length ? (0, import_jsx_runtime.jsx)("div", {
19931
+ className: "typeahead",
19932
+ children: territoryMatches(territoryQuery, draft.pick.territories, whereLevel, 8, registerTerritories).map((t) => (0, import_jsx_runtime.jsxs)("button", {
19933
+ type: "button",
19934
+ disabled: !reachesTerritory(t, registerTerritories),
19935
+ onClick: () => {
19936
+ setPick(addTerritory(draft.pick, t, whereLevel, registerTerritories));
19937
+ setTerritoryQuery("");
19938
+ },
19939
+ children: [t, reachesTerritory(t, registerTerritories) ? null : (0, import_jsx_runtime.jsx)("span", {
19940
+ className: "typeahead-note",
19941
+ children: notAvailableLine([], registerLabel)
19942
+ })]
19943
+ }, t))
19944
+ }) : null]
19000
19945
  }),
19001
- (0, import_jsx_runtime.jsx)("p", {
19002
- className: "section-hint",
19003
- style: { margin: "7px 0 0" },
19004
- children: "A search started by an agent through the connector can reference emails or documents it can already read, so there is nothing to paste in that case."
19005
- })
19006
- ] }),
19946
+ whereLevel?.geography === "exactly one country" && draft.pick.territories.length === 1 ? (0, import_jsx_runtime.jsxs)("div", {
19947
+ className: "callout-accent",
19948
+ children: [draft.pick.territories[0], " — naming another country replaces it, because this search reads one at a time."]
19949
+ }) : null
19950
+ ] })] }),
19951
+ (0, import_jsx_runtime.jsxs)("div", { children: [(0, import_jsx_runtime.jsx)("div", {
19952
+ className: "section-title",
19953
+ children: "Goods or services"
19954
+ }), (0, import_jsx_runtime.jsx)("textarea", {
19955
+ value: draft.goods,
19956
+ onChange: (e) => edit({ goods: e.target.value }),
19957
+ rows: 3,
19958
+ "aria-label": "Goods or services",
19959
+ placeholder: "Example: energy drinks; dietary supplements",
19960
+ className: "ctx-input",
19961
+ style: {
19962
+ resize: "vertical",
19963
+ lineHeight: 1.5
19964
+ }
19965
+ })] }),
19966
+ (0, import_jsx_runtime.jsxs)("div", { children: [(0, import_jsx_runtime.jsx)("div", {
19967
+ className: "section-title",
19968
+ children: "Context (optional)"
19969
+ }), (0, import_jsx_runtime.jsx)("textarea", {
19970
+ value: draft.instructions,
19971
+ onChange: (e) => edit({ instructions: e.target.value }),
19972
+ rows: 3,
19973
+ "aria-label": "Context (optional)",
19974
+ placeholder: "Example: we already own the mark in the US and this is about the EU launch. Our launch page is https://example.com/press/aquaplus-launch, and there is a LinkedIn post announcing it from 3 June.",
19975
+ className: "ctx-input",
19976
+ style: {
19977
+ resize: "vertical",
19978
+ lineHeight: 1.5
19979
+ }
19980
+ })] }),
19007
19981
  (0, import_jsx_runtime.jsxs)("div", {
19008
19982
  className: "ctx-card",
19009
19983
  children: [
@@ -19373,7 +20347,7 @@ function NewClearance({ ctx }) {
19373
20347
  })
19374
20348
  })]
19375
20349
  }),
19376
- !untouched && gaps.length ? (0, import_jsx_runtime.jsxs)("div", {
20350
+ !untouched && gaps.length && !(gaps.length === 1 && gaps[0] === blockedBy) ? (0, import_jsx_runtime.jsxs)("div", {
19377
20351
  className: "notice",
19378
20352
  style: {
19379
20353
  borderColor: "var(--tone-medium)",
@@ -20096,11 +21070,11 @@ function ReviewDialog({ plan, busy, owner, project, names, goods, nativeOn, onSt
20096
21070
  ]
20097
21071
  }) : (0, import_jsx_runtime.jsx)(Row$3, {
20098
21072
  label: "Where",
20099
- children: "Worldwide"
21073
+ children: worldwideLine(registerLabel)
20100
21074
  }),
20101
21075
  (0, import_jsx_runtime.jsx)(Row$3, {
20102
21076
  label: "Registers to search",
20103
- children: plan.coverage ? (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [plan.coverage.reached.length ? joinAnd(plan.coverage.reached) : "None", plan.coverage.missing.length ? (0, import_jsx_runtime.jsxs)(Muted, { children: [". ", notAvailableLine(plan.coverage.missing, registerLabel)] }) : null] }) : places.length ? joinAnd(places) : "Worldwide"
21077
+ children: plan.coverage ? (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [plan.coverage.reached.length ? joinAnd(plan.coverage.reached) : "None", plan.coverage.missing.length ? (0, import_jsx_runtime.jsxs)(Muted, { children: [". ", notAvailableLine(plan.coverage.missing, registerLabel)] }) : null] }) : places.length ? joinAnd(places) : worldwideLine(registerLabel)
20104
21078
  }),
20105
21079
  scope && scope.classes.length ? (0, import_jsx_runtime.jsxs)(Row$3, {
20106
21080
  label: "Classes",
@@ -24297,6 +25271,7 @@ function useSourceRepo() {
24297
25271
  return result && isOk(result) && result.value.sourceRepo ? result.value.sourceRepo : null;
24298
25272
  }
24299
25273
  function PeopleAccess({ ctx }) {
25274
+ const peopleWrap = (0, import_react.useRef)(null);
24300
25275
  const { result } = useLoad(() => api.adminAccess(), []);
24301
25276
  const repo = useSourceRepo();
24302
25277
  const seesAll = ctx.me.allAccounts;
@@ -24415,6 +25390,7 @@ function PeopleAccess({ ctx }) {
24415
25390
  }) : null,
24416
25391
  (0, import_jsx_runtime.jsx)("div", {
24417
25392
  className: "table-wrap",
25393
+ ref: peopleWrap,
24418
25394
  children: (0, import_jsx_runtime.jsxs)("table", {
24419
25395
  className: "data",
24420
25396
  children: [(0, import_jsx_runtime.jsx)("thead", { children: (0, import_jsx_runtime.jsxs)("tr", { children: [
@@ -24434,6 +25410,7 @@ function PeopleAccess({ ctx }) {
24434
25410
  }, p.email)) })]
24435
25411
  })
24436
25412
  }),
25413
+ (0, import_jsx_runtime.jsx)(PinnedScrollbar, { target: peopleWrap }),
24437
25414
  (0, import_jsx_runtime.jsx)("dl", {
24438
25415
  className: "perm-key",
24439
25416
  children: PERMISSIONS_KEY.map((k) => (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [(0, import_jsx_runtime.jsx)("dt", { children: k.term }), (0, import_jsx_runtime.jsx)("dd", { children: k.means })] }, k.term))