{"version":3,"sources":["../src/types/index.ts","../src/taxonomy/continents.ts","../src/taxonomy/countries.ts","../src/taxonomy/employment-type.ts","../src/taxonomy/industry-taxonomy.ts","../src/taxonomy/open-to.ts","../src/taxonomy/workplace-type.ts","../src/taxonomy/platforms.ts","../src/taxonomy/skill-categories.ts","../src/taxonomy/skill-grouping.ts","../src/taxonomy/skill-display-groups.ts","../src/taxonomy/app-categories.ts","../src/taxonomy/app-category-map.ts","../src/taxonomy/activity-tiers.json","../src/taxonomy/activity-tiers.ts","../src/taxonomy/presentation-role.ts","../src/taxonomy/publication-type.ts","../src/taxonomy/presentation-link-type.ts","../src/taxonomy/calendar-event.ts","../src/taxonomy/involvement-kind.ts","../src/taxonomy/artifact-link-kind.ts","../src/taxonomy/verification-providers.ts","../src/taxonomy/investment.ts","../src/format/company-name.ts","../src/format/normalize-legal-form.ts","../src/format/normalize-company-key.ts","../src/format/format-time.ts","../src/format/format-duration.ts","../src/format/timeline.ts","../src/format/summarize-deliveries.ts","../src/format/sort-by-date.ts","../src/format/doi.ts","../src/format/handle-utils.ts","../src/format/location-utils.ts","../src/format/location-segments.ts","../src/format/pds-utils.ts","../src/format/embed.ts","../src/format/talk-slug.ts","../src/logic/primary-position.ts","../src/profile/headline-role-dedupe.ts","../src/profile/section-model.ts","../src/format/meta-description.ts","../src/format/text-sanitize.ts","../src/format/text-truncate.ts","../src/format/format-display-url.ts","../src/format/time-utils.ts","../src/format/wcag-contrast.ts","../src/import/presentation-csv.ts","../src/cards/app-url-patterns.ts","../src/cards/resolve-card-url.ts","../src/cards/visibility.ts","../src/cards/adult-content.ts","../src/publishers/registry.ts","../src/stream/verbs.json","../src/stream/verbs.ts","../src/stream/stream-card-vm-schema.ts","../src/schemas/shared.ts","../src/publishing/registry.ts","../src/stream/to-stream-card-vm.ts","../src/logic/profile-completeness.ts","../src/logic/profile-dimensions.ts","../src/logic/profile-summary.ts","../src/logic/pseudo-employer.ts","../src/logic/domain-detect.ts","../src/logic/entity-disambiguation.ts","../src/logic/entity-ref-anchor.ts","../src/logic/org-floor.ts","../src/logic/company-page-indexable.ts","../src/logic/recent-activity.ts","../src/profile/range-sort.ts","../src/profile/language-sort.ts","../src/profile/section-sorts.ts","../src/profile/involvement-grouping.ts","../src/schemas/blob-ref.ts","../src/schemas/endorsement-confirmation.ts","../src/schemas/entity.ts","../src/schemas/endorsement.ts","../src/schemas/org-profile.ts","../src/schemas/org-employment-attestation.ts","../src/schemas/graph-follow.ts","../src/schemas/follow-profile.ts","../src/schemas/feed.ts","../src/schemas/profile-certification.ts","../src/schemas/profile-course.ts","../src/schemas/profile-education.ts","../src/schemas/profile-external-account.ts","../src/schemas/profile-honor.ts","../src/schemas/profile-project.ts","../src/schemas/profile-involvement.ts","../src/schemas/profile-language.ts","../src/schemas/profile-position.ts","../src/schemas/profile-presentation.ts","../src/schemas/profile-presentation-delivery.ts","../src/schemas/profile-publication.ts","../src/schemas/profile-self.ts","../src/schemas/profile-skill.ts","../src/schemas/profile-volunteering.ts","../src/schemas/profile-investment.ts","../src/roadmap/index.ts","../src/repo/groups.ts","../src/repo/labels.ts","../src/index.ts"],"names":["z","parsed","COMBINING_MARKS","clean","link","media","isNonEmptyString","entityRefField"],"mappings":";;;;;AAqgBO,IAAM,aAAA,GAAgB;AAAA,EAC3B,2BAAA;AAAA,EACA,0BAAA;AAAA,EACA;AACF;;;ACvgBO,IAAM,UAAA,GAAmE;AAAA,EAC9E,EAAE,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,QAAA,EAAS;AAAA,EAC7B,EAAE,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,YAAA,EAAa;AAAA,EACjC,EAAE,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,MAAA,EAAO;AAAA,EAC3B,EAAE,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,QAAA,EAAS;AAAA,EAC7B,EAAE,IAAA,EAAM,IAAA,EAAM,IAAA,EAAM,eAAA,EAAgB;AAAA,EACpC,EAAE,IAAA,E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OAAA,QAAe,SAAA,GAAY,SAAA;AAE9E,EAAA,MAAM,OAAO,IAAA,CAAK,IAAA,IAAQ,UAAA,CAAW,MAAA,EAAQ,KAAK,IAAI,CAAA;AACtD,EAAA,IAAI,IAAA,KAAS,MAAA,EAAW,KAAA,CAAM,IAAA,GAAO,IAAA;AAErC,EAAA,MAAM,aAAa,IAAA,CAAK,UAAA,IAAc,UAAA,CAAW,MAAA,EAAQ,KAAK,UAAU,CAAA;AACxE,EAAA,IAAI,UAAA,KAAe,MAAA,EAAW,KAAA,CAAM,UAAA,GAAa,UAAA;AAEjD,EAAA,OAAO,KAAA;AACT;;;ACrNO,IAAM,gBAAA,GAA2B","file":"index.cjs","sourcesContent":["export interface LocationValue {\n  city?: string;\n  /** community.lexicon.location.address field -- preferred over `city`. */\n  locality?: string;\n  region?: string;\n  country: string;\n  countryCode?: string;\n  postalCode?: string;\n  geonameId?: number;\n}\n\nexport interface SkillRef {\n  uri: string;\n}\n\nexport interface ProfilePosition {\n  rkey: string;\n  /**\n   * Optional: omitted for self-employed / freelance / independent positions.\n   * The lexicon and the record schema already make company optional.\n   */\n  company?: string;\n  /**\n   * Portable org entity identifier (Wikidata/ROR/LEI URI) written when the user\n   * picks an organization from the resolver typeahead. Absent for free-text or\n   * independent positions (#159).\n   */\n  entityRef?: string;\n  /**\n   * Resolved current canonical name of the durably-linked company (#240),\n   * computed by the AppView at read time. Render this over `company` for a\n   * linked position, so a name correction reaches every linked profile without\n   * a PDS write. Absent for free-text or unresolved positions (fall back to\n   * `company`).\n   */\n  entityName?: string;\n  /**\n   * Company-page slug for a durably-linked position, resolved by the AppView at\n   * read time alongside `entityName` (#159). Lets a consumer link the company\n   * name to its `/c/{domain}` page without re-resolving `entityRef`. `domain` is\n   * the readable form, `publicId` the durable fallback; build the link as\n   * `/c/${companyDomain ?? companyPublicId}`. Both absent for free-text /\n   * unlinked positions.\n   */\n  companyDomain?: string;\n  companyPublicId?: string;\n  title: string;\n  description?: string;\n  startedAt: string;\n  endedAt?: string;\n  location?: LocationValue | null;\n  employmentType?: string;\n  /**\n   * Party this role is held on behalf of, when the person represents someone else --\n   * most often a fund whose board seat this is. A disclosure rather than a role type,\n   * so it is a separate field from `employmentType`. Absent for independent roles.\n   */\n  onBehalfOf?: string;\n  /** DID of the represented party, when known. May be an organization or a person. */\n  onBehalfOfDid?: string;\n  /** Portable entity identifier for the represented party (Wikidata/ROR/LEI URI). */\n  onBehalfOfEntityRef?: string;\n  workplaceType?: string;\n  skills?: SkillRef[];\n  linkedSkills?: ProfileSkill[];\n  primary?: boolean;\n  hidden?: boolean;\n}\n\nexport interface ProfileEducation {\n  rkey: string;\n  institution: string;\n  /**\n   * Portable org entity identifier (Wikidata/ROR/LEI URI) written when the user\n   * links the institution to a resolved organization (#159/#241). Absent for\n   * free-text entries. Mirrors `ProfilePosition.entityRef`; the AppView sends it\n   * for display (the \"Linked\" badge).\n   */\n  entityRef?: string;\n  /**\n   * Resolved current canonical name of the durably-linked institution (#252),\n   * computed by the AppView at read time. Render this over `institution` for a\n   * linked entry, so a name correction reaches every linked profile without a\n   * PDS write. Absent for free-text or unresolved entries (fall back to\n   * `institution`).\n   */\n  entityName?: string;\n  degree?: string;\n  fieldOfStudy?: string;\n  description?: string;\n  activities?: string;\n  startedAt?: string;\n  endedAt?: string;\n  hidden?: boolean;\n}\n\nexport interface ProfileSkill {\n  rkey: string;\n  name: string;\n  /**\n   * CID of the skill record, needed as a strongRef when endorsing it. Often\n   * absent: only the firehose carries a CID, so a skill added moments ago has\n   * none indexed yet. Pass it to `createEndorsement` when present and omit it\n   * otherwise -- the AppView resolves it from the owner's PDS.\n   */\n  cid?: string;\n  category?: string;\n  /**\n   * Freeform user-defined grouping label nested under `category` (e.g.\n   * \"Frontend\", \"Backend\"). No known values; renderers decide the display\n   * label. See `groupSkillsBySubCategory`.\n   */\n  subCategory?: string;\n  endorsementCount?: number;\n  endorsed?: boolean;\n  /**\n   * Names this skill was endorsed under, where they differ from what it is\n   * called now. Absent when nothing has drifted.\n   *\n   * A rename keeps the same record, so endorsements follow it and stay\n   * counted. Showing the original name is what keeps that honest: a reader can\n   * see that a skill now called one thing was vouched for as another, instead\n   * of the rename quietly laundering the endorsement.\n   */\n  endorsedAs?: string[];\n  activityBacked?: boolean;\n}\n\nexport interface SkillSuggestion {\n  canonicalName: string;\n  slug: string;\n  category: string;\n}\n\nexport interface Endorsement {\n  endorserDid: string;\n  endorserHandle: string;\n  endorserDisplayName?: string;\n  endorserAvatar?: string;\n  comment?: string;\n  relationshipContext?: string;\n  createdAt: string;\n}\n\nexport interface EndorsementData {\n  skillRkey: string;\n  comment?: string;\n  relationshipContext?: string;\n}\n\nexport interface ProfileLocation {\n  rkey: string;\n  type: string;\n  label?: string | null;\n  isPrimary: boolean;\n  locationCountry?: string | null;\n  locationRegion?: string | null;\n  /** Legacy alias for `locationLocality`; emitted by sifa-api during the additive response window. */\n  locationCity?: string | null;\n  /** community.lexicon.location.address field name -- prefer over `locationCity`. */\n  locationLocality?: string | null;\n  countryCode?: string | null;\n  location?: string | null;\n}\n\nexport interface ProfileCertification {\n  rkey: string;\n  name: string;\n  /**\n   * Issuing organization. The write contract names this field `authority`\n   * everywhere (record schema, DB column, PDS record); the AppView read view\n   * emits `authority` as the canonical field (#249). Optional during the\n   * deprecation window while consumers migrate off the legacy `issuingOrg`\n   * alias below.\n   */\n  authority?: string;\n  /**\n   * @deprecated Legacy read-view alias for {@link authority} (#249). Carries the\n   * same value; will be dropped once web + SDK consumers read `authority`.\n   */\n  issuingOrg?: string;\n  /**\n   * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the issuing\n   * organization to a resolved entity (#159/#241). Absent for free-text entries.\n   * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.\n   */\n  entityRef?: string;\n  /**\n   * Resolved current canonical name of the durably-linked issuing organization\n   * (#252), computed by the AppView at read time. Render this over `authority`\n   * for a linked entry. Absent for free-text or unresolved entries (fall back to\n   * `authority`).\n   */\n  entityName?: string;\n  issueDate?: string;\n  expiryDate?: string;\n  credentialUrl?: string;\n  hidden?: boolean;\n}\n\nexport interface ProfileProject {\n  rkey: string;\n  name: string;\n  description?: string;\n  url?: string;\n  startDate?: string;\n  endDate?: string;\n  /** Other people named on this project, hydrated from the stored DIDs. */\n  members?: ProjectMemberCard[];\n  /**\n   * AT-URI of the same project as recorded elsewhere, when this entry\n   * duplicates another person's. Set so consumers can tell the two describe one\n   * project; both still render from their own owner's record.\n   */\n  /** AT-URI of the same record on another person's profile, when they keep one. */\n  sameAs?: string;\n  hidden?: boolean;\n}\n\nexport interface PublicationContributor {\n  name: string;\n  orcidId?: string;\n  did?: string;\n  handle?: string;\n}\n\n/**\n * A co-author an importer produced that the profile owner can offer to link to\n * a Sifa account.\n *\n * Matched on verified ORCID iD only, never on name: \"A. Example\", \"Alice\n * Example\", and \"Example, A.\" are one person, and \"J. Smith\" is four hundred.\n *\n * A suggestion, never a claim. Nothing reaches any repository until the owner\n * acts, which is what makes ORCID re-syncing safe: matching writes nothing, so\n * a re-sync cannot generate a confirmation request.\n */\nexport interface AuthorSuggestion {\n  /** ORCID iD the match was made on. The join key back to a contributor. */\n  orcidId: string;\n  did: string;\n  handle: string;\n  /** Display name on the matched account, for showing what is being proposed. */\n  displayName?: string;\n}\n\nexport interface ProfilePublication {\n  rkey: string;\n  title: string;\n  subtitle?: string;\n  publisher?: string;\n  date?: string;\n  url?: string;\n  description?: string;\n  source?: 'sifa' | 'standard' | 'orcid';\n  doi?: string;\n  type?: string;\n  typeLabel?: string;\n  contributors?: PublicationContributor[];\n  verified?: boolean;\n  verifiedVia?: string;\n  orcidPutCode?: number;\n  hidden?: boolean;\n  orcidCorroborated?: boolean;\n  pendingVerification?: boolean;\n  appId?: string;\n  /**\n   * AT-URI of the parent `site.standard.publication` for Standard.site\n   * articles — the subscribable unit. Used to group articles by publication\n   * on the profile. Undefined for Sifa/ORCID publications.\n   */\n  publicationUri?: string | null;\n  /** Canonical publication origin — the subscribe / link-out target. */\n  publicationUrl?: string | null;\n  /** Publication display name for the group header (falls back to host). */\n  publicationName?: string | null;\n  /**\n   * Cover image URL for Standard.site articles — the document's `coverImage`\n   * blob (CDN-served), falling back to the article page's og:image. Undefined\n   * for Sifa/ORCID publications, null when none could be resolved.\n   */\n  image?: string | null;\n}\n\nexport interface ProfileVolunteering {\n  rkey: string;\n  organization: string;\n  /**\n   * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the\n   * organization to a resolved entity (#159/#241). Absent for free-text entries.\n   * Mirrors `ProfilePosition.entityRef`; the AppView sends it for display.\n   */\n  entityRef?: string;\n  /**\n   * Resolved current canonical name of the durably-linked organization (#252),\n   * computed by the AppView at read time. Render this over `organization` for a\n   * linked entry. Absent for free-text or unresolved entries (fall back to\n   * `organization`).\n   */\n  entityName?: string;\n  role?: string;\n  cause?: string;\n  startDate?: string;\n  endDate?: string;\n  description?: string;\n  hidden?: boolean;\n}\n\nexport interface ProfileHonor {\n  rkey: string;\n  title: string;\n  issuer?: string;\n  /**\n   * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the issuer to a\n   * resolved entity (#159/#241). Absent for free-text entries. Mirrors\n   * `ProfilePosition.entityRef`; the AppView sends it for display.\n   */\n  entityRef?: string;\n  /**\n   * Resolved current canonical name of the durably-linked issuer (#252),\n   * computed by the AppView at read time. Render this over `issuer` for a linked\n   * entry. Absent for free-text or unresolved entries (fall back to `issuer`).\n   */\n  entityName?: string;\n  date?: string;\n  description?: string;\n  hidden?: boolean;\n}\n\n/**\n * One proof link on an involvement record, as served by the AppView. Mirrors\n * `id.sifa.defs#artifactLink`, plus the computed rung-2 verification signal.\n */\nexport interface ProfileInvolvementLink {\n  url: string;\n  kind?: string;\n  label?: string;\n  /**\n   * Rung-2 cross-ref: true when the link host matches one of the owner's\n   * *verified* `externalAccount` records (GitHub, GitLab, ORCID, ...).\n   * Computed by the AppView; deterministic host match, no new primitive.\n   */\n  verified?: boolean;\n  /**\n   * Platform token of the matched verified external account (e.g.\n   * `id.sifa.defs#platformGithub`), for the badge label. Absent when\n   * `verified` is not true.\n   */\n  verifiedPlatform?: string;\n}\n\n/**\n * An involvement entry as served by the AppView: an `id.sifa.profile.involvement`\n * record, or a mapped legacy `id.sifa.profile.volunteering` record (`legacy`),\n * grouped in the UI by `kind` via the SDK's involvement-kind taxonomy.\n */\n/** One artifact link on an investment (round announcement, portfolio page, filing). */\nexport interface ProfileInvestmentLink {\n  url: string;\n  kind?: string;\n  label?: string;\n}\n\n/** A capital position: money the person put in. Roles with duties are positions. */\nexport interface ProfileInvestment {\n  rkey: string;\n  /** For a limited-partner entry this names the fund, not a portfolio company. */\n  company: string;\n  companyDid?: string;\n  entityRef?: string;\n  /** Resolved canonical name of the linked company. Render over `company` when present. */\n  entityName?: string;\n  /** How the capital went in. Angel, syndicate member or LP -- never GP. */\n  role?: string;\n  /** The company's funding stage at the time of the investment, not its stage today. */\n  stage?: string;\n  /** active / exited / written off / undisclosed. */\n  status?: string;\n  /** The vehicle the capital went through. Absent for a cheque in the person's own name. */\n  via?: string;\n  viaDid?: string;\n  viaEntityRef?: string;\n  /** Whole major currency units plus an ISO 4217 code. Absent unless the person opted in. */\n  amount?: { value: number; currency: string };\n  startedAt?: string;\n  endedAt?: string;\n  description?: string;\n  links?: ProfileInvestmentLink[];\n  hidden?: boolean;\n}\n\nexport interface ProfileInvolvement {\n  rkey: string;\n  /** Involvement-kind token; drives the display heading. Legacy rows map to charity. */\n  kind: string;\n  upstream?: string;\n  upstreamDid?: string;\n  upstreamUrl?: string;\n  role?: string;\n  description?: string;\n  startedAt?: string;\n  endedAt?: string;\n  links?: ProfileInvolvementLink[];\n  /**\n   * Portable org entity identifier (Wikidata/ROR/LEI URI) written when the user\n   * picks the upstream from the resolver typeahead. Absent for free-text or\n   * one-off involvement.\n   */\n  entityRef?: string;\n  /**\n   * Resolved current canonical name of the durably-linked upstream, computed by\n   * the AppView at read time. Render over `upstream` when present. Absent for\n   * free-text or unresolved entries.\n   */\n  entityName?: string;\n  location?: LocationValue | null;\n  skills?: SkillRef[];\n  /** Skill records resolved from `skills`, for display. */\n  linkedSkills?: ProfileSkill[];\n  /**\n   * True when this row is a mapped legacy `id.sifa.profile.volunteering` record\n   * (no `kind`), rendered under \"Volunteering\". Editing it backfills to an\n   * `involvement` record and deletes the legacy one.\n   */\n  legacy?: boolean;\n  hidden?: boolean;\n  /** Other people named on this involvement, hydrated from the stored DIDs. */\n  collaborators?: ProjectMemberCard[];\n  /** AT-URI of the same involvement as recorded on another person's profile. */\n  sameAs?: string;\n}\n\nexport type LanguageProficiency =\n  'elementary' | 'limited_working' | 'professional_working' | 'full_professional' | 'native';\n\nexport interface ProfileLanguage {\n  rkey: string;\n  language: string;\n  proficiency?: LanguageProficiency;\n  hidden?: boolean;\n}\n\nexport interface ProfileCourse {\n  rkey: string;\n  name: string;\n  institution?: string;\n  /**\n   * Portable org entity identifier (Wikidata/ROR/LEI URI) linking the institution\n   * to a resolved entity (#159/#241). Absent for free-text entries. Mirrors\n   * `ProfilePosition.entityRef`; the AppView sends it for display.\n   */\n  entityRef?: string;\n  /**\n   * Resolved current canonical name of the durably-linked institution (#252),\n   * computed by the AppView at read time. Render this over `institution` for a\n   * linked entry. Absent for free-text or unresolved entries (fall back to\n   * `institution`).\n   */\n  entityName?: string;\n  number?: string;\n  /** rkey of the associated certification, resolved from the course's\n   * `credential` at-uri. Used to join the course to a certification in the\n   * same profile payload (for the linked-credential date and link). */\n  credentialRkey?: string;\n  /** Date the course was completed, as an RFC 3339 datetime. Optional; the\n   * editor collects month granularity (YYYY-MM). */\n  completedAt?: string;\n  hidden?: boolean;\n}\n\n/** A related link on a presentation or delivery, as returned by the AppView. */\nexport interface PresentationLinkView {\n  uri: string;\n  label?: string;\n  type?: string;\n}\n\n/**\n * A co-speaker on a delivery, hydrated from a stored DID to a profile card.\n * Any atproto account; `hasSifaProfile` is true when they have a claimed Sifa\n * profile (vs an unclaimed atproto account that still renders at /p/<handle>).\n */\n/**\n * Another person named on someone's record, as rendered by the AppView.\n *\n * `displayName` and `avatar` are present only when `confirmed` is true. An\n * unconfirmed claim renders as a bare handle with no identity attached and no\n * link to a profile: naming someone is a claim, and until they affirm it the\n * claim must not borrow their face.\n */\nexport interface ActorCard {\n  did: string;\n  handle: string;\n  displayName?: string;\n  avatar?: string;\n  hasSifaProfile?: boolean;\n  /** True once the named person has published a matching `id.sifa.confirmation`. */\n  confirmed?: boolean;\n  /**\n   * True when the record was materially changed after being confirmed -- a\n   * rename, or a changed role. The confirmation stands until withdrawn, but the\n   * UI should say the claim has moved since it was affirmed.\n   */\n  confirmedStale?: boolean;\n}\n\n/** @deprecated Use {@link ActorCard}. Kept so existing co-speaker call sites keep compiling. */\nexport type CoSpeaker = ActorCard;\n\n/**\n * Roles shipped today. The lexicon declares these as `knownValues`, so the\n * field itself stays a plain string: a consumer meeting a role it does not\n * recognise should show it rather than discard it.\n *\n * Display only. A record living in someone else's repository cannot grant\n * write access to anything, and the UI must not imply that it does.\n */\nexport const PROJECT_ROLES = [\n  'id.sifa.defs#projectOwner',\n  'id.sifa.defs#projectCore',\n  'id.sifa.defs#projectContributor',\n] as const;\n\nexport type ProjectRole = (typeof PROJECT_ROLES)[number];\n\n/** A person named as a member of a project, with their role alongside the actor card. */\nexport interface ProjectMemberCard extends ActorCard {\n  role?: string;\n  title?: string;\n}\n\n/** An occasion on which a presentation was delivered (the AppView view-model). */\nexport interface ProfilePresentationDelivery {\n  rkey: string;\n  /** rkey of the parent presentation when this delivery references one. */\n  presentationRkey?: string | null;\n  /** Co-speakers at this occasion, hydrated from the stored DIDs. */\n  coSpeakers?: CoSpeaker[];\n  /** AT-URI of the same session as recorded on another person's profile. */\n  sameAs?: string;\n  title?: string | null;\n  role?: string | null;\n  eventName?: string | null;\n  /** Day-only date, YYYY-MM-DD. */\n  date?: string | null;\n  location?: string | null;\n  locationCountry?: string | null;\n  locationRegion?: string | null;\n  locationLocality?: string | null;\n  countryCode?: string | null;\n  /** Full community.lexicon.calendar.event mode token. */\n  mode?: string | null;\n  /** Full community.lexicon.calendar.event status token. */\n  status?: string | null;\n  links?: PresentationLinkView[];\n  /** at-uri of the linked calendar event, when present. */\n  eventUri?: string | null;\n  hidden?: boolean;\n}\n\n/** A reusable presentation with its deliveries grouped underneath (AppView view-model). */\nexport interface ProfilePresentation {\n  rkey: string;\n  title: string;\n  description?: string | null;\n  /** Duration in minutes: a fixed value (min only) or a range. */\n  duration?: { minMinutes: number; maxMinutes?: number } | null;\n  intendedAudiences?: string[];\n  links?: PresentationLinkView[];\n  /** at-uri of a long-form write-up (Leaflet / site.standard document). */\n  writeupUri?: string | null;\n  /** Resolved URL of the uploaded cover image, when present. */\n  coverImageUrl?: string | null;\n  hidden?: boolean;\n  deliveries?: ProfilePresentationDelivery[];\n}\n\nexport interface TrustStat {\n  key: string;\n  label: string;\n  value: number;\n}\n\nexport interface ActiveApp {\n  id: string;\n  name: string;\n  category: string;\n  recentCount: number;\n  latestRecordAt?: string | null;\n}\n\nexport interface VerifiedAccount {\n  platform: string;\n  identifier: string;\n  url?: string;\n}\n\nexport interface ExternalAccountKeytraceClaim {\n  rkey: string;\n  claimedAt: string;\n}\n\nexport interface ExternalAccount {\n  rkey: string;\n  platform: string;\n  url: string;\n  label?: string;\n  feedUrl?: string;\n  primary?: boolean;\n  verifiable: boolean;\n  verified: boolean;\n  verifiedVia?: string | null;\n  source?: 'sifa' | 'keytrace' | 'keyoxide' | 'marque';\n  hidden?: boolean;\n  keytraceVerified?: boolean;\n  keytraceClaim?: ExternalAccountKeytraceClaim;\n}\n\nexport interface FeedItem {\n  title: string;\n  excerpt: string;\n  url: string;\n  timestamp: string;\n  source: string;\n}\n\nexport interface PdsProviderInfo {\n  name: string;\n  host: string;\n}\n\nexport interface ProfileIndustry {\n  industry: string;\n  domain?: string;\n}\n\nexport interface ProfileOverrideSource {\n  headline?: string;\n  about?: string;\n  displayName?: string;\n  avatarUrl?: string;\n}\n\n/**\n * A structured physical address on the org view. Mirrors\n * `community.lexicon.location.address`; every field is optional.\n */\nexport interface OrgAddressView {\n  country: string | null;\n  postalCode: string | null;\n  region: string | null;\n  locality: string | null;\n  street: string | null;\n  name: string | null;\n}\n\n/** A featured link on the org view. Both `name` and `url` are present. */\nexport interface OrgLinkView {\n  name: string;\n  url: string;\n}\n\n/**\n * The org-profile fields exposed on the profile resolve when the org rendering\n * floor is met. Narrow on purpose: `contact` is never included (not rendered\n * publicly); record URI/CID are internal. Mirrors sifa-api's `OrgProfileView`.\n */\nexport interface OrgProfileView {\n  name: string;\n  description: string | null;\n  website: string | null;\n  /** Blob CID (or resolved URL) of the org logo, when present. */\n  logoBlob: string | null;\n  entityRefs: string[] | null;\n  addresses: OrgAddressView[] | null;\n  /** Self-selected headcount range (declared bucket, never calculated). */\n  companySize: string | null;\n  links: OrgLinkView[] | null;\n}\n\n/**\n * A company entity recognized purely from the handle's registrable domain\n * (#160 auto-recognize), independent of any org record. Present on the verdict\n * when `recognized` is true. `domain` is the handle's registrable domain and\n * round-trips through `/c/<domain>`; `publicId` is nullable because entities\n * minted before the public_id backfill have none.\n */\nexport interface RecognizedEntity {\n  publicId: string | null;\n  domain: string;\n  name: string;\n}\n\n/**\n * Server-computed org rendering-floor verdict (#160), carried on the profile\n * resolve so clients need no extra round-trip. Read it via the `useOrgProfile`\n * hook.\n *\n * `isOrg` is the CLAIMED floor: true when the account has an\n * `id.sifa.org.profile` record AND its handle is a custom registrable domain\n * (the authoritative, PSL-backed check lives server-side).\n *\n * `recognized` is INDEPENDENT of `isOrg`: true when the handle's registrable\n * domain resolves to a known, non-suppressed, non-natural-person company entity\n * in Sifa's DB, even with no org record yet (auto-recognize known-company\n * domains). A known company that has not yet claimed is\n * `recognized: true, isOrg: false`; a claimed recognized company is both true.\n * Use it to treat a recognized-but-unclaimed company account as a company\n * (company onboarding, `/c/` routing) before it claims.\n */\nexport interface OrgFloorVerdict {\n  isOrg: boolean;\n  orgProfile?: OrgProfileView;\n  recognized: boolean;\n  /**\n   * Whether the account's handle is a custom registrable apex domain, i.e.\n   * eligible to CLAIM an org page (#306). Mirrors the `isBindableHandleDomain`\n   * floor the api enforces at write time, surfaced so the `/claim` wizard can\n   * gate on eligibility BEFORE the authority consent rather than failing the\n   * final PDS write. Independent of `isOrg`/`recognized` -- purely the handle's\n   * shape, so a `*.bsky.social` account reads false and a not-yet-claimed\n   * custom domain reads true.\n   *\n   * Optional here (a tolerant reader): the api always emits it, but a profile\n   * payload cached before this field shipped may omit it. Gate on the explicit\n   * `customDomain === false` for the up-front block; treat absent as unknown and\n   * let the api 403 stay the authoritative backstop -- never enforce on this\n   * field alone.\n   */\n  customDomain?: boolean;\n  /**\n   * Whether the account also keeps a visible personal profile, from\n   * `id.sifa.org.profile.personalProfileVisible`. True only for a claimed org\n   * (`isOrg`) that opted in -- the sole-trader case, where one DID carries both\n   * a person facet at `/p/` and a company facet at `/c/` and neither route\n   * redirects to the other. Absent or false is the exclusive default: the\n   * account presents solely as an organization and `/p/` redirects to `/c/`.\n   */\n  personalProfileVisible?: boolean;\n  /**\n   * Invariant (not encoded in the type, matching the flat wire shape the api\n   * sends): present whenever `recognized` is true, absent when false. Callers\n   * that read it after narrowing on `recognized === true` should still\n   * defensively check, since the type does not enforce the pairing.\n   */\n  recognizedEntity?: RecognizedEntity;\n}\n\n/**\n * The account owner's answer to \"are you a person, a company, or both?\".\n *\n * `'person'` and `'company'` are Sifa-local overrides stored in\n * `account_render_overrides` (set via `POST /api/account/render-preference`).\n * `'both'` is NOT stored here -- it is the portable\n * `id.sifa.org.profile.personalProfileVisible` declaration in the account's own\n * PDS, so any AppView can evaluate it without asking Sifa. Resolve the combined\n * answer with `resolveAccountFacetMode`.\n */\nexport type AccountFacetMode = 'person' | 'company' | 'both';\n\nexport interface Profile {\n  did: string;\n  handle: string;\n  /**\n   * Sifa-local render override, absent when the account has never set one\n   * (auto: today's recognition behaviour). `'person'` is the escape hatch for a\n   * personal domain that Sifa catalogued as a company.\n   */\n  renderPreference?: 'person' | 'company' | null;\n  /**\n   * Org rendering-floor verdict (#160). Present on the profile resolve; absent\n   * on payloads that predate the field. When `org.isOrg` is true the account\n   * renders as an organization (`/c/`).\n   */\n  org?: OrgFloorVerdict;\n  displayName?: string;\n  /**\n   * Given (first) name from `id.sifa.profile.self.givenName`. Schema.org\n   * `Person.givenName`. Optional; absent for users who haven't filled in\n   * structured name fields. Consumers wanting a rendered name should use\n   * `formatStructuredName(givenName, familyName) ?? displayName ?? handle`.\n   */\n  givenName?: string;\n  /**\n   * Family (last) name from `id.sifa.profile.self.familyName`. Schema.org\n   * `Person.familyName`. See `givenName` for fallback guidance.\n   */\n  familyName?: string;\n  /**\n   * Free-form phonetic respelling of the user's name from\n   * `id.sifa.profile.self.namePronunciation` (e.g. `Foo-kuh`). Optional; a\n   * native field with no `app.bsky.actor.profile` equivalent. Text only.\n   */\n  namePronunciation?: string;\n  /**\n   * Resolved URL of the name-pronunciation audio clip from\n   * `id.sifa.profile.self.namePronunciationAudio`, served from the user's PDS\n   * (`com.atproto.sync.getBlob`). Optional; absent when no clip is set.\n   */\n  namePronunciationAudioUrl?: string;\n  avatar?: string;\n  pronouns?: string;\n  headline?: string;\n  about?: string;\n  hasHeadlineOverride?: boolean;\n  hasAboutOverride?: boolean;\n  hasDisplayNameOverride?: boolean;\n  hasAvatarUrlOverride?: boolean;\n  source?: ProfileOverrideSource;\n  industries?: ProfileIndustry[];\n  location?: LocationValue | null;\n  locations?: ProfileLocation[];\n  /**\n   * @deprecated Flat location field emitted at the response root during the\n   * additive response window for `community.lexicon.location.address`.\n   * Prefer the structured `locations[]` array (use the entry where\n   * `isPrimary` is true).\n   */\n  locationCountry?: string | null;\n  /**\n   * @deprecated See `locationCountry`. Prefer `locations[].locationRegion`.\n   */\n  locationRegion?: string | null;\n  /**\n   * @deprecated Legacy alias for `locationLocality`; emitted alongside it\n   * during the additive response window. Prefer `locations[].locationLocality`.\n   */\n  locationCity?: string | null;\n  /**\n   * @deprecated community.lexicon.location.address field name. Prefer\n   * `locations[].locationLocality`.\n   */\n  locationLocality?: string | null;\n  /**\n   * @deprecated See `locationCountry`. Prefer `locations[].countryCode`.\n   */\n  countryCode?: string | null;\n  website?: string;\n  openTo?: string[];\n  preferredWorkplace?: string[];\n  availableFromUtc?: number;\n  availableToUtc?: number;\n  pdsProvider?: PdsProviderInfo | null;\n  claimed: boolean;\n  /**\n   * User-set opt-out flag from `id.sifa.profile.self.discoverable`. When\n   * `false`, the rendering app emits `noindex` and excludes the page from\n   * sitemaps. Absent means default-true (current behavior for existing\n   * records that predate this field).\n   */\n  discoverable?: boolean;\n  isOwnProfile?: boolean;\n  createdAt?: string;\n  trustStats?: TrustStat[];\n  verifiedAccounts?: VerifiedAccount[];\n  activeApps?: ActiveApp[];\n  blueskyVerified?: boolean;\n  blueskyVerifiedAt?: string | null;\n  followersCount: number;\n  followingCount: number;\n  connectionsCount: number;\n  atprotoFollowersCount?: number;\n  positions: ProfilePosition[];\n  education: ProfileEducation[];\n  skills: ProfileSkill[];\n  certifications?: ProfileCertification[];\n  projects?: ProfileProject[];\n  publications?: ProfilePublication[];\n  /**\n   * Co-authors on imported publications that resolve to a Sifa account.\n   *\n   * Owner-only, and absent rather than empty for every other viewer, so a\n   * consumer cannot tell \"no suggestions\" from \"not yours\". Join to a\n   * publication contributor by `orcidId`.\n   */\n  authorSuggestions?: AuthorSuggestion[];\n  volunteering?: ProfileVolunteering[];\n  involvement?: ProfileInvolvement[];\n  investments?: ProfileInvestment[];\n  honors?: ProfileHonor[];\n  languages?: ProfileLanguage[];\n  courses?: ProfileCourse[];\n  presentations?: ProfilePresentation[];\n  presentationDeliveries?: ProfilePresentationDelivery[];\n  externalAccounts?: ExternalAccount[];\n}\n","export type ContinentCode = 'AF' | 'AN' | 'AS' | 'EU' | 'NA' | 'OC' | 'SA';\n\nexport const CONTINENTS: ReadonlyArray<{ code: ContinentCode; name: string }> = [\n  { code: 'AF', name: 'Africa' },\n  { code: 'AN', name: 'Antarctica' },\n  { code: 'AS', name: 'Asia' },\n  { code: 'EU', name: 'Europe' },\n  { code: 'NA', name: 'North America' },\n  { code: 'OC', name: 'Oceania' },\n  { code: 'SA', name: 'South America' },\n];\n\nconst COUNTRY_TO_CONTINENT: Record<string, ContinentCode> = {\n  AD: 'EU',\n  AE: 'AS',\n  AF: 'AS',\n  AG: 'NA',\n  AL: 'EU',\n  AM: 'AS',\n  AO: 'AF',\n  AR: 'SA',\n  AT: 'EU',\n  AU: 'OC',\n  AZ: 'AS',\n  BA: 'EU',\n  BB: 'NA',\n  BD: 'AS',\n  BE: 'EU',\n  BF: 'AF',\n  BG: 'EU',\n  BH: 'AS',\n  BI: 'AF',\n  BJ: 'AF',\n  BN: 'AS',\n  BO: 'SA',\n  BR: 'SA',\n  BS: 'NA',\n  BT: 'AS',\n  BW: 'AF',\n  BY: 'EU',\n  BZ: 'NA',\n  CA: 'NA',\n  CD: 'AF',\n  CF: 'AF',\n  CG: 'AF',\n  CH: 'EU',\n  CI: 'AF',\n  CL: 'SA',\n  CM: 'AF',\n  CN: 'AS',\n  CO: 'SA',\n  CR: 'NA',\n  CU: 'NA',\n  CV: 'AF',\n  CY: 'AS',\n  CZ: 'EU',\n  DE: 'EU',\n  DJ: 'AF',\n  DK: 'EU',\n  DM: 'NA',\n  DO: 'NA',\n  DZ: 'AF',\n  EC: 'SA',\n  EE: 'EU',\n  EG: 'AF',\n  ER: 'AF',\n  ES: 'EU',\n  ET: 'AF',\n  FI: 'EU',\n  FJ: 'OC',\n  FR: 'EU',\n  GA: 'AF',\n  GB: 'EU',\n  GD: 'NA',\n  GE: 'AS',\n  GH: 'AF',\n  GM: 'AF',\n  GN: 'AF',\n  GQ: 'AF',\n  GR: 'EU',\n  GT: 'NA',\n  GW: 'AF',\n  GY: 'SA',\n  HK: 'AS',\n  HN: 'NA',\n  HR: 'EU',\n  HT: 'NA',\n  HU: 'EU',\n  ID: 'AS',\n  IE: 'EU',\n  IL: 'AS',\n  IN: 'AS',\n  IQ: 'AS',\n  IR: 'AS',\n  IS: 'EU',\n  IT: 'EU',\n  JM: 'NA',\n  JO: 'AS',\n  JP: 'AS',\n  KE: 'AF',\n  KG: 'AS',\n  KH: 'AS',\n  KM: 'AF',\n  KN: 'NA',\n  KP: 'AS',\n  KR: 'AS',\n  KW: 'AS',\n  KZ: 'AS',\n  LA: 'AS',\n  LB: 'AS',\n  LC: 'NA',\n  LI: 'EU',\n  LK: 'AS',\n  LR: 'AF',\n  LS: 'AF',\n  LT: 'EU',\n  LU: 'EU',\n  LV: 'EU',\n  LY: 'AF',\n  MA: 'AF',\n  MC: 'EU',\n  MD: 'EU',\n  ME: 'EU',\n  MG: 'AF',\n  MK: 'EU',\n  ML: 'AF',\n  MM: 'AS',\n  MN: 'AS',\n  MO: 'AS',\n  MR: 'AF',\n  MT: 'EU',\n  MU: 'AF',\n  MV: 'AS',\n  MW: 'AF',\n  MX: 'NA',\n  MY: 'AS',\n  MZ: 'AF',\n  NA: 'AF',\n  NE: 'AF',\n  NG: 'AF',\n  NI: 'NA',\n  NL: 'EU',\n  NO: 'EU',\n  NP: 'AS',\n  NZ: 'OC',\n  OM: 'AS',\n  PA: 'NA',\n  PE: 'SA',\n  PG: 'OC',\n  PH: 'AS',\n  PK: 'AS',\n  PL: 'EU',\n  PR: 'NA',\n  PS: 'AS',\n  PT: 'EU',\n  PY: 'SA',\n  QA: 'AS',\n  RO: 'EU',\n  RS: 'EU',\n  RU: 'EU',\n  RW: 'AF',\n  SA: 'AS',\n  SB: 'OC',\n  SC: 'AF',\n  SD: 'AF',\n  SE: 'EU',\n  SG: 'AS',\n  SI: 'EU',\n  SK: 'EU',\n  SL: 'AF',\n  SM: 'EU',\n  SN: 'AF',\n  SO: 'AF',\n  SR: 'SA',\n  SS: 'AF',\n  ST: 'AF',\n  SV: 'NA',\n  SY: 'AS',\n  SZ: 'AF',\n  TD: 'AF',\n  TG: 'AF',\n  TH: 'AS',\n  TJ: 'AS',\n  TL: 'AS',\n  TM: 'AS',\n  TN: 'AF',\n  TO: 'OC',\n  TR: 'AS',\n  TT: 'NA',\n  TW: 'AS',\n  TZ: 'AF',\n  UA: 'EU',\n  UG: 'AF',\n  US: 'NA',\n  UY: 'SA',\n  UZ: 'AS',\n  VA: 'EU',\n  VC: 'NA',\n  VE: 'SA',\n  VN: 'AS',\n  VU: 'OC',\n  WS: 'OC',\n  XK: 'EU',\n  YE: 'AS',\n  ZA: 'AF',\n  ZM: 'AF',\n  ZW: 'AF',\n};\n\nexport function getContinent(countryCode: string): ContinentCode | null {\n  if (!countryCode) return null;\n  return COUNTRY_TO_CONTINENT[countryCode.toUpperCase()] ?? null;\n}\n","/** ISO 3166-1 country list for local fallback when GeoNames is unavailable. */\nexport const COUNTRIES: ReadonlyArray<{ code: string; name: string }> = [\n  { code: 'AF', name: 'Afghanistan' },\n  { code: 'AL', name: 'Albania' },\n  { code: 'DZ', name: 'Algeria' },\n  { code: 'AD', name: 'Andorra' },\n  { code: 'AO', name: 'Angola' },\n  { code: 'AG', name: 'Antigua and Barbuda' },\n  { code: 'AR', name: 'Argentina' },\n  { code: 'AM', name: 'Armenia' },\n  { code: 'AU', name: 'Australia' },\n  { code: 'AT', name: 'Austria' },\n  { code: 'AZ', name: 'Azerbaijan' },\n  { code: 'BS', name: 'Bahamas' },\n  { code: 'BH', name: 'Bahrain' },\n  { code: 'BD', name: 'Bangladesh' },\n  { code: 'BB', name: 'Barbados' },\n  { code: 'BY', name: 'Belarus' },\n  { code: 'BE', name: 'Belgium' },\n  { code: 'BZ', name: 'Belize' },\n  { code: 'BJ', name: 'Benin' },\n  { code: 'BT', name: 'Bhutan' },\n  { code: 'BO', name: 'Bolivia' },\n  { code: 'BA', name: 'Bosnia and Herzegovina' },\n  { code: 'BW', name: 'Botswana' },\n  { code: 'BR', name: 'Brazil' },\n  { code: 'BN', name: 'Brunei' },\n  { code: 'BG', name: 'Bulgaria' },\n  { code: 'BF', name: 'Burkina Faso' },\n  { code: 'BI', name: 'Burundi' },\n  { code: 'CV', name: 'Cabo Verde' },\n  { code: 'KH', name: 'Cambodia' },\n  { code: 'CM', name: 'Cameroon' },\n  { code: 'CA', name: 'Canada' },\n  { code: 'CF', name: 'Central African Republic' },\n  { code: 'TD', name: 'Chad' },\n  { code: 'CL', name: 'Chile' },\n  { code: 'CN', name: 'China' },\n  { code: 'CO', name: 'Colombia' },\n  { code: 'KM', name: 'Comoros' },\n  { code: 'CG', name: 'Congo' },\n  { code: 'CD', name: 'Congo (DRC)' },\n  { code: 'CR', name: 'Costa Rica' },\n  { code: 'CI', name: \"Cote d'Ivoire\" },\n  { code: 'HR', name: 'Croatia' },\n  { code: 'CU', name: 'Cuba' },\n  { code: 'CY', name: 'Cyprus' },\n  { code: 'CZ', name: 'Czechia' },\n  { code: 'DK', name: 'Denmark' },\n  { code: 'DJ', name: 'Djibouti' },\n  { code: 'DM', name: 'Dominica' },\n  { code: 'DO', name: 'Dominican Republic' },\n  { code: 'EC', name: 'Ecuador' },\n  { code: 'EG', name: 'Egypt' },\n  { code: 'SV', name: 'El Salvador' },\n  { code: 'GQ', name: 'Equatorial Guinea' },\n  { code: 'ER', name: 'Eritrea' },\n  { code: 'EE', name: 'Estonia' },\n  { code: 'SZ', name: 'Eswatini' },\n  { code: 'ET', name: 'Ethiopia' },\n  { code: 'FJ', name: 'Fiji' },\n  { code: 'FI', name: 'Finland' },\n  { code: 'FR', name: 'France' },\n  { code: 'GA', name: 'Gabon' },\n  { code: 'GM', name: 'Gambia' },\n  { code: 'GE', name: 'Georgia' },\n  { code: 'DE', name: 'Germany' },\n  { code: 'GH', name: 'Ghana' },\n  { code: 'GR', name: 'Greece' },\n  { code: 'GD', name: 'Grenada' },\n  { code: 'GT', name: 'Guatemala' },\n  { code: 'GN', name: 'Guinea' },\n  { code: 'GW', name: 'Guinea-Bissau' },\n  { code: 'GY', name: 'Guyana' },\n  { code: 'HT', name: 'Haiti' },\n  { code: 'HN', name: 'Honduras' },\n  { code: 'HU', name: 'Hungary' },\n  { code: 'IS', name: 'Iceland' },\n  { code: 'IN', name: 'India' },\n  { code: 'ID', name: 'Indonesia' },\n  { code: 'IR', name: 'Iran' },\n  { code: 'IQ', name: 'Iraq' },\n  { code: 'IE', name: 'Ireland' },\n  { code: 'IL', name: 'Israel' },\n  { code: 'IT', name: 'Italy' },\n  { code: 'JM', name: 'Jamaica' },\n  { code: 'JP', name: 'Japan' },\n  { code: 'JO', name: 'Jordan' },\n  { code: 'KZ', name: 'Kazakhstan' },\n  { code: 'KE', name: 'Kenya' },\n  { code: 'KI', name: 'Kiribati' },\n  { code: 'KP', name: 'North Korea' },\n  { code: 'KR', name: 'South Korea' },\n  { code: 'KW', name: 'Kuwait' },\n  { code: 'KG', name: 'Kyrgyzstan' },\n  { code: 'LA', name: 'Laos' },\n  { code: 'LV', name: 'Latvia' },\n  { code: 'LB', name: 'Lebanon' },\n  { code: 'LS', name: 'Lesotho' },\n  { code: 'LR', name: 'Liberia' },\n  { code: 'LY', name: 'Libya' },\n  { code: 'LI', name: 'Liechtenstein' },\n  { code: 'LT', name: 'Lithuania' },\n  { code: 'LU', name: 'Luxembourg' },\n  { code: 'MG', name: 'Madagascar' },\n  { code: 'MW', name: 'Malawi' },\n  { code: 'MY', name: 'Malaysia' },\n  { code: 'MV', name: 'Maldives' },\n  { code: 'ML', name: 'Mali' },\n  { code: 'MT', name: 'Malta' },\n  { code: 'MH', name: 'Marshall Islands' },\n  { code: 'MR', name: 'Mauritania' },\n  { code: 'MU', name: 'Mauritius' },\n  { code: 'MX', name: 'Mexico' },\n  { code: 'FM', name: 'Micronesia' },\n  { code: 'MD', name: 'Moldova' },\n  { code: 'MC', name: 'Monaco' },\n  { code: 'MN', name: 'Mongolia' },\n  { code: 'ME', name: 'Montenegro' },\n  { code: 'MA', name: 'Morocco' },\n  { code: 'MZ', name: 'Mozambique' },\n  { code: 'MM', name: 'Myanmar' },\n  { code: 'NA', name: 'Namibia' },\n  { code: 'NR', name: 'Nauru' },\n  { code: 'NP', name: 'Nepal' },\n  { code: 'NL', name: 'Netherlands' },\n  { code: 'NZ', name: 'New Zealand' },\n  { code: 'NI', name: 'Nicaragua' },\n  { code: 'NE', name: 'Niger' },\n  { code: 'NG', name: 'Nigeria' },\n  { code: 'MK', name: 'North Macedonia' },\n  { code: 'NO', name: 'Norway' },\n  { code: 'OM', name: 'Oman' },\n  { code: 'PK', name: 'Pakistan' },\n  { code: 'PW', name: 'Palau' },\n  { code: 'PS', name: 'Palestine' },\n  { code: 'PA', name: 'Panama' },\n  { code: 'PG', name: 'Papua New Guinea' },\n  { code: 'PY', name: 'Paraguay' },\n  { code: 'PE', name: 'Peru' },\n  { code: 'PH', name: 'Philippines' },\n  { code: 'PL', name: 'Poland' },\n  { code: 'PT', name: 'Portugal' },\n  { code: 'QA', name: 'Qatar' },\n  { code: 'RO', name: 'Romania' },\n  { code: 'RU', name: 'Russia' },\n  { code: 'RW', name: 'Rwanda' },\n  { code: 'KN', name: 'Saint Kitts and Nevis' },\n  { code: 'LC', name: 'Saint Lucia' },\n  { code: 'VC', name: 'Saint Vincent and the Grenadines' },\n  { code: 'WS', name: 'Samoa' },\n  { code: 'SM', name: 'San Marino' },\n  { code: 'ST', name: 'Sao Tome and Principe' },\n  { code: 'SA', name: 'Saudi Arabia' },\n  { code: 'SN', name: 'Senegal' },\n  { code: 'RS', name: 'Serbia' },\n  { code: 'SC', name: 'Seychelles' },\n  { code: 'SL', name: 'Sierra Leone' },\n  { code: 'SG', name: 'Singapore' },\n  { code: 'SK', name: 'Slovakia' },\n  { code: 'SI', name: 'Slovenia' },\n  { code: 'SB', name: 'Solomon Islands' },\n  { code: 'SO', name: 'Somalia' },\n  { code: 'ZA', name: 'South Africa' },\n  { code: 'SS', name: 'South Sudan' },\n  { code: 'ES', name: 'Spain' },\n  { code: 'LK', name: 'Sri Lanka' },\n  { code: 'SD', name: 'Sudan' },\n  { code: 'SR', name: 'Suriname' },\n  { code: 'SE', name: 'Sweden' },\n  { code: 'CH', name: 'Switzerland' },\n  { code: 'SY', name: 'Syria' },\n  { code: 'TW', name: 'Taiwan' },\n  { code: 'TJ', name: 'Tajikistan' },\n  { code: 'TZ', name: 'Tanzania' },\n  { code: 'TH', name: 'Thailand' },\n  { code: 'TL', name: 'Timor-Leste' },\n  { code: 'TG', name: 'Togo' },\n  { code: 'TO', name: 'Tonga' },\n  { code: 'TT', name: 'Trinidad and Tobago' },\n  { code: 'TN', name: 'Tunisia' },\n  { code: 'TR', name: 'Turkey' },\n  { code: 'TM', name: 'Turkmenistan' },\n  { code: 'TV', name: 'Tuvalu' },\n  { code: 'UG', name: 'Uganda' },\n  { code: 'UA', name: 'Ukraine' },\n  { code: 'AE', name: 'United Arab Emirates' },\n  { code: 'GB', name: 'United Kingdom' },\n  { code: 'US', name: 'United States' },\n  { code: 'UY', name: 'Uruguay' },\n  { code: 'UZ', name: 'Uzbekistan' },\n  { code: 'VU', name: 'Vanuatu' },\n  { code: 'VA', name: 'Vatican City' },\n  { code: 'VE', name: 'Venezuela' },\n  { code: 'VN', name: 'Vietnam' },\n  { code: 'YE', name: 'Yemen' },\n  { code: 'ZM', name: 'Zambia' },\n  { code: 'ZW', name: 'Zimbabwe' },\n] as const;\n","/**\n * Employment-type taxonomy. Mirrors `id.sifa.defs#employmentType.knownValues`\n * from sifa-lexicons. Surfaces both a flat NSID→label map (for read-only\n * display) and a grouped structure (for editor dropdowns).\n */\n\nexport interface EmploymentTypeOption {\n  value: string;\n  label: string;\n}\n\nexport interface EmploymentTypeGroup {\n  label: string;\n  items: EmploymentTypeOption[];\n}\n\nexport const EMPLOYMENT_TYPE_GROUPS: EmploymentTypeGroup[] = [\n  {\n    label: 'Employee',\n    items: [\n      { value: 'id.sifa.defs#fullTime', label: 'Full-time' },\n      { value: 'id.sifa.defs#partTime', label: 'Part-time' },\n      { value: 'id.sifa.defs#temporary', label: 'Temporary' },\n      { value: 'id.sifa.defs#seasonal', label: 'Seasonal' },\n    ],\n  },\n  {\n    label: 'Independent',\n    items: [\n      { value: 'id.sifa.defs#contract', label: 'Contract' },\n      { value: 'id.sifa.defs#freelance', label: 'Freelance' },\n      { value: 'id.sifa.defs#selfEmployed', label: 'Self-employed' },\n      { value: 'id.sifa.defs#independentWork', label: 'Independent work' },\n    ],\n  },\n  {\n    label: 'Training & early-career',\n    items: [\n      { value: 'id.sifa.defs#internship', label: 'Internship' },\n      { value: 'id.sifa.defs#apprenticeship', label: 'Apprenticeship' },\n      { value: 'id.sifa.defs#fellowship', label: 'Fellowship' },\n      { value: 'id.sifa.defs#trainee', label: 'Trainee' },\n    ],\n  },\n  // A non-executive director is normally not an employee, and neither is a volunteer:\n  // this axis was never payroll-only. These roles carry a title, duties and a term, so\n  // they belong on a position rather than on the investment record.\n  {\n    label: 'Governance & advisory',\n    items: [\n      { value: 'id.sifa.defs#boardMember', label: 'Board member' },\n      { value: 'id.sifa.defs#boardObserver', label: 'Board observer' },\n      { value: 'id.sifa.defs#advisor', label: 'Advisor' },\n    ],\n  },\n];\n\nexport const EMPLOYMENT_TYPE_LABELS: Record<string, string> = {\n  ...Object.fromEntries(\n    EMPLOYMENT_TYPE_GROUPS.flatMap((g) => g.items).map((o) => [o.value, o.label]),\n  ),\n  // `volunteer` is retained for legacy records but no longer offered in the\n  // editor dropdown. Volunteering is a distinct thing (no payroll, no formal\n  // role, no obligation) rather than a kind of employment, so it lives in the\n  // dedicated `id.sifa.profile.volunteering` section, not on the employment-type\n  // axis. Kept here so old positions still render a human label, not the raw NSID.\n  'id.sifa.defs#volunteer': 'Volunteer',\n};\n\n/** Resolve a label for an employment-type token. Falls back to the raw value. */\nexport function getEmploymentTypeLabel(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return EMPLOYMENT_TYPE_LABELS[value] ?? value;\n}\n\n/**\n * Employment-type group whose members may omit a company name: independent\n * workers (contract, freelance, self-employed, independent work) often have no\n * separately named or registered entity. Derived from the group rather than a\n * hand-maintained list so it stays in sync if the group's membership changes.\n */\nexport const COMPANY_OPTIONAL_EMPLOYMENT_TYPES: ReadonlySet<string> = new Set(\n  EMPLOYMENT_TYPE_GROUPS.find((g) => g.label === 'Independent')?.items.map((i) => i.value) ?? [],\n);\n\n/**\n * Whether a company name is required for a position with the given employment\n * type. Company is optional for the Independent group; required otherwise,\n * including when the employment type is unspecified (the conservative default,\n * since most positions are at a named organization).\n */\nexport function isCompanyRequired(employmentType: string | undefined | null): boolean {\n  if (!employmentType) return true;\n  return !COMPANY_OPTIONAL_EMPLOYMENT_TYPES.has(employmentType);\n}\n\n/**\n * Employment types for which the `onBehalfOf` disclosure is meaningful — a seat or\n * advisory role can be held as someone else's representative, most often a fund whose\n * board seat it is. Derived from the group rather than hand-listed so it cannot drift.\n */\nexport const ON_BEHALF_OF_EMPLOYMENT_TYPES: ReadonlySet<string> = new Set(\n  EMPLOYMENT_TYPE_GROUPS.find((g) => g.label === 'Governance & advisory')?.items.map(\n    (i) => i.value,\n  ) ?? [],\n);\n\n/**\n * Whether to offer the `onBehalfOf` disclosure for a given employment type. False when\n * the type is unspecified: a full-time employee represents nobody, and surfacing the\n * field on every position form would put a rare disclosure in front of everyone.\n */\nexport function isOnBehalfOfApplicable(employmentType: string | undefined | null): boolean {\n  if (!employmentType) return false;\n  return ON_BEHALF_OF_EMPLOYMENT_TYPES.has(employmentType);\n}\n","/** Two-level industry/domain taxonomy for profile classification. */\n\nexport interface IndustryOption {\n  value: string;\n  labelKey: string;\n  domains: { value: string; labelKey: string }[];\n}\n\nexport const INDUSTRY_OPTIONS: IndustryOption[] = [\n  {\n    value: 'id.sifa.defs#industryTechnology',\n    labelKey: 'industryTechnology',\n    domains: [\n      { value: 'id.sifa.defs#domainSoftwareEngineering', labelKey: 'domainSoftwareEngineering' },\n      { value: 'id.sifa.defs#domainDataScience', labelKey: 'domainDataScience' },\n      { value: 'id.sifa.defs#domainCybersecurity', labelKey: 'domainCybersecurity' },\n      { value: 'id.sifa.defs#domainDevops', labelKey: 'domainDevops' },\n      { value: 'id.sifa.defs#domainProductDesign', labelKey: 'domainProductDesign' },\n      { value: 'id.sifa.defs#domainGameDev', labelKey: 'domainGameDev' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryFinance',\n    labelKey: 'industryFinance',\n    domains: [\n      { value: 'id.sifa.defs#domainBanking', labelKey: 'domainBanking' },\n      { value: 'id.sifa.defs#domainFintech', labelKey: 'domainFintech' },\n      { value: 'id.sifa.defs#domainInsurance', labelKey: 'domainInsurance' },\n      { value: 'id.sifa.defs#domainInvestmentMgmt', labelKey: 'domainInvestmentMgmt' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryHealthcare',\n    labelKey: 'industryHealthcare',\n    domains: [\n      { value: 'id.sifa.defs#domainClinicalResearch', labelKey: 'domainClinicalResearch' },\n      { value: 'id.sifa.defs#domainHealthtech', labelKey: 'domainHealthtech' },\n      { value: 'id.sifa.defs#domainPharma', labelKey: 'domainPharma' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryEducation',\n    labelKey: 'industryEducation',\n    domains: [\n      { value: 'id.sifa.defs#domainHigherEd', labelKey: 'domainHigherEd' },\n      { value: 'id.sifa.defs#domainEdtech', labelKey: 'domainEdtech' },\n      { value: 'id.sifa.defs#domainPrimarySecondary', labelKey: 'domainPrimarySecondary' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryMedia',\n    labelKey: 'industryMedia',\n    domains: [\n      { value: 'id.sifa.defs#domainJournalism', labelKey: 'domainJournalism' },\n      { value: 'id.sifa.defs#domainFilmVideo', labelKey: 'domainFilmVideo' },\n      { value: 'id.sifa.defs#domainGaming', labelKey: 'domainGaming' },\n      { value: 'id.sifa.defs#domainAdvertising', labelKey: 'domainAdvertising' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryRetail',\n    labelKey: 'industryRetail',\n    domains: [\n      { value: 'id.sifa.defs#domainEcommerce', labelKey: 'domainEcommerce' },\n      { value: 'id.sifa.defs#domainSupplyChain', labelKey: 'domainSupplyChain' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryManufacturing',\n    labelKey: 'industryManufacturing',\n    domains: [\n      { value: 'id.sifa.defs#domainAutomotive', labelKey: 'domainAutomotive' },\n      { value: 'id.sifa.defs#domainAerospace', labelKey: 'domainAerospace' },\n      { value: 'id.sifa.defs#domainHardware', labelKey: 'domainHardware' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryEnergy',\n    labelKey: 'industryEnergy',\n    domains: [\n      { value: 'id.sifa.defs#domainRenewables', labelKey: 'domainRenewables' },\n      { value: 'id.sifa.defs#domainOilGas', labelKey: 'domainOilGas' },\n      { value: 'id.sifa.defs#domainClimateTech', labelKey: 'domainClimateTech' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryGovernment',\n    labelKey: 'industryGovernment',\n    domains: [\n      { value: 'id.sifa.defs#domainPublicPolicy', labelKey: 'domainPublicPolicy' },\n      { value: 'id.sifa.defs#domainDefense', labelKey: 'domainDefense' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryLegal',\n    labelKey: 'industryLegal',\n    domains: [\n      { value: 'id.sifa.defs#domainIpLaw', labelKey: 'domainIpLaw' },\n      { value: 'id.sifa.defs#domainCompliance', labelKey: 'domainCompliance' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryConsulting',\n    labelKey: 'industryConsulting',\n    domains: [\n      { value: 'id.sifa.defs#domainManagementConsulting', labelKey: 'domainManagementConsulting' },\n      { value: 'id.sifa.defs#domainDevrel', labelKey: 'domainDevrel' },\n      { value: 'id.sifa.defs#domainHrRecruitment', labelKey: 'domainHrRecruitment' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryNonprofit',\n    labelKey: 'industryNonprofit',\n    domains: [\n      { value: 'id.sifa.defs#domainHumanRights', labelKey: 'domainHumanRights' },\n      { value: 'id.sifa.defs#domainOpenSource', labelKey: 'domainOpenSource' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryRealEstate',\n    labelKey: 'industryRealEstate',\n    domains: [{ value: 'id.sifa.defs#domainProptech', labelKey: 'domainProptech' }],\n  },\n  {\n    value: 'id.sifa.defs#industryTransport',\n    labelKey: 'industryTransport',\n    domains: [\n      { value: 'id.sifa.defs#domainAutonomousVehicles', labelKey: 'domainAutonomousVehicles' },\n      { value: 'id.sifa.defs#domainLogistics', labelKey: 'domainLogistics' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryAgriculture',\n    labelKey: 'industryAgriculture',\n    domains: [\n      { value: 'id.sifa.defs#domainAgritech', labelKey: 'domainAgritech' },\n      { value: 'id.sifa.defs#domainFoodTech', labelKey: 'domainFoodTech' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryHospitality',\n    labelKey: 'industryHospitality',\n    domains: [\n      { value: 'id.sifa.defs#domainHotels', labelKey: 'domainHotels' },\n      { value: 'id.sifa.defs#domainTravelTourism', labelKey: 'domainTravelTourism' },\n      { value: 'id.sifa.defs#domainFoodBeverage', labelKey: 'domainFoodBeverage' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryTelecom',\n    labelKey: 'industryTelecom',\n    domains: [\n      { value: 'id.sifa.defs#domainNetworkInfra', labelKey: 'domainNetworkInfra' },\n      { value: 'id.sifa.defs#domainMobileServices', labelKey: 'domainMobileServices' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryMining',\n    labelKey: 'industryMining',\n    domains: [\n      { value: 'id.sifa.defs#domainExtraction', labelKey: 'domainExtraction' },\n      { value: 'id.sifa.defs#domainGeological', labelKey: 'domainGeological' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryFashion',\n    labelKey: 'industryFashion',\n    domains: [\n      { value: 'id.sifa.defs#domainFashionDesign', labelKey: 'domainFashionDesign' },\n      { value: 'id.sifa.defs#domainTextileManufacturing', labelKey: 'domainTextileManufacturing' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryMaritime',\n    labelKey: 'industryMaritime',\n    domains: [\n      { value: 'id.sifa.defs#domainShipping', labelKey: 'domainShipping' },\n      { value: 'id.sifa.defs#domainPortOperations', labelKey: 'domainPortOperations' },\n      { value: 'id.sifa.defs#domainNavalArchitecture', labelKey: 'domainNavalArchitecture' },\n    ],\n  },\n  {\n    value: 'id.sifa.defs#industryOther',\n    labelKey: 'industryOther',\n    domains: [],\n  },\n];\n\n/** Find the industry option for a given industry value. */\nexport function findIndustry(value: string | undefined | null): IndustryOption | undefined {\n  if (!value) return undefined;\n  return INDUSTRY_OPTIONS.find((i) => i.value === value);\n}\n\n/** Get the label key for an industry or domain token, falling back to the raw value. */\nexport function getIndustryLabelKey(value: string): string {\n  for (const industry of INDUSTRY_OPTIONS) {\n    if (industry.value === value) return industry.labelKey;\n    for (const domain of industry.domains) {\n      if (domain.value === value) return domain.labelKey;\n    }\n  }\n  return value;\n}\n","/**\n * \"Open to\" taxonomy. Mirrors `id.sifa.defs#openToWorkStatus.knownValues` from\n * sifa-lexicons. Surfaces a single source of truth for the editor (where the\n * user picks values) and the IdentityCard (where badges are rendered).\n *\n * Shape matches `INDUSTRY_OPTIONS`: `{ value, labelKey }` so consumers can run\n * `labelKey` through their own i18n layer (e.g. next-intl `useTranslations`).\n */\n\nexport type OpenToGroup = 'work' | 'mentorship' | 'peer';\n\nexport interface OpenToOption {\n  value: string;\n  labelKey: string;\n  token: string;\n  group: OpenToGroup;\n}\n\nexport const OPEN_TO_OPTIONS: OpenToOption[] = [\n  {\n    value: 'id.sifa.defs#fullTimeRoles',\n    labelKey: 'fullTimeRoles',\n    token: 'fullTime',\n    group: 'work',\n  },\n  {\n    value: 'id.sifa.defs#partTimeRoles',\n    labelKey: 'partTimeRoles',\n    token: 'partTime',\n    group: 'work',\n  },\n  {\n    value: 'id.sifa.defs#contractRoles',\n    labelKey: 'contractRoles',\n    token: 'contract',\n    group: 'work',\n  },\n  {\n    value: 'id.sifa.defs#commissions',\n    labelKey: 'commissions',\n    token: 'commissions',\n    group: 'work',\n  },\n  {\n    value: 'id.sifa.defs#boardPositions',\n    labelKey: 'boardPositions',\n    token: 'board',\n    group: 'work',\n  },\n  {\n    value: 'id.sifa.defs#speakingEngagements',\n    labelKey: 'speakingEngagements',\n    token: 'speaking',\n    group: 'work',\n  },\n  {\n    value: 'id.sifa.defs#mentoringOthers',\n    labelKey: 'mentoringOthers',\n    token: 'mentor',\n    group: 'mentorship',\n  },\n  {\n    value: 'id.sifa.defs#beingMentored',\n    labelKey: 'beingMentored',\n    token: 'mentee',\n    group: 'mentorship',\n  },\n  {\n    value: 'id.sifa.defs#collaborations',\n    labelKey: 'collaborations',\n    token: 'collab',\n    group: 'peer',\n  },\n];\n\n/** Map short token (e.g. \"fullTime\") -> lex value (e.g. \"id.sifa.defs#fullTimeRoles\"). */\nexport const OPEN_TO_TOKEN_TO_VALUE: Record<string, string> = Object.fromEntries(\n  OPEN_TO_OPTIONS.map((o) => [o.token, o.value]),\n);\n\n/** Map lex value -> short token. */\nexport const OPEN_TO_VALUE_TO_TOKEN: Record<string, string> = Object.fromEntries(\n  OPEN_TO_OPTIONS.map((o) => [o.value, o.token]),\n);\n\n/** All valid tokens, useful for runtime validation. */\nexport const OPEN_TO_TOKENS: readonly string[] = OPEN_TO_OPTIONS.map((o) => o.token);\n\n/** Resolve a token to its lex value, returning `undefined` if unknown. */\nexport function openToTokenToValue(token: string | undefined | null): string | undefined {\n  if (!token) return undefined;\n  return OPEN_TO_TOKEN_TO_VALUE[token];\n}\n\n/** Resolve a lex value to its token, returning `undefined` if unknown. */\nexport function openToValueToToken(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return OPEN_TO_VALUE_TO_TOKEN[value];\n}\n\n/**\n * Legacy aliases — tokens the lexicon used to expose but doesn't anymore.\n * Records written before the lexicon migration may still carry them; resolve\n * them to the closest current `labelKey` for display.\n */\nconst OPEN_TO_LEGACY_ALIASES: Record<string, string> = {\n  'id.sifa.defs#mentoring': 'mentoringOthers',\n};\n\nconst OPEN_TO_LABEL_KEY_MAP: Record<string, string> = {\n  ...Object.fromEntries(OPEN_TO_OPTIONS.map((o) => [o.value, o.labelKey])),\n  ...OPEN_TO_LEGACY_ALIASES,\n};\n\n/**\n * Resolve a `labelKey` for an `openToWorkStatus` token. Returns `undefined`\n * for tokens not in the canonical set or the legacy alias map, so callers\n * can choose their own fallback (e.g. render the raw value).\n */\nexport function getOpenToLabelKey(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return OPEN_TO_LABEL_KEY_MAP[value];\n}\n\n/**\n * Legacy `openToWorkStatus` values mapped to their current canonical value.\n * Mirrors {@link OPEN_TO_LEGACY_ALIASES} but resolves to the full lex value\n * (not just the `labelKey`) so it can rewrite stored records.\n */\nexport const OPEN_TO_LEGACY_VALUE_ALIASES: Record<string, string> = {\n  'id.sifa.defs#mentoring': 'id.sifa.defs#mentoringOthers',\n};\n\n/**\n * Normalize a list of `openTo` values: resolve legacy aliases to their\n * canonical value, then dedup while preserving first-seen order. Unknown tokens\n * pass through untouched (forward-compat). Used by the editor (so a legacy token\n * maps onto a real option and migrates forward on save) and by display (so a\n * record carrying both the legacy and canonical token renders a single badge).\n */\nexport function normalizeOpenTo(values: readonly string[]): string[] {\n  const seen = new Set<string>();\n  const out: string[] = [];\n  for (const value of values) {\n    const canonical = OPEN_TO_LEGACY_VALUE_ALIASES[value] ?? value;\n    if (seen.has(canonical)) continue;\n    seen.add(canonical);\n    out.push(canonical);\n  }\n  return out;\n}\n","/**\n * Workplace-type taxonomy. Mirrors `id.sifa.defs#workplaceType.knownValues`\n * from sifa-lexicons. `remote` is retained for legacy records but the scoped\n * variants (`remoteLocal`, `remoteRegion`, `remoteGlobal`) are preferred for\n * new records per the lexicon description.\n */\n\nexport interface WorkplaceTypeOption {\n  value: string;\n  label: string;\n}\n\nexport const WORKPLACE_TYPE_OPTIONS: WorkplaceTypeOption[] = [\n  { value: 'id.sifa.defs#onSite', label: 'On-site' },\n  { value: 'id.sifa.defs#hybrid', label: 'Hybrid' },\n  { value: 'id.sifa.defs#remoteLocal', label: 'Remote (same country)' },\n  { value: 'id.sifa.defs#remoteRegion', label: 'Remote (same region)' },\n  { value: 'id.sifa.defs#remoteGlobal', label: 'Remote (anywhere)' },\n];\n\nexport const WORKPLACE_TYPE_LABELS: Record<string, string> = {\n  ...Object.fromEntries(WORKPLACE_TYPE_OPTIONS.map((o) => [o.value, o.label])),\n  'id.sifa.defs#remote': 'Remote',\n};\n\n/** Resolve a label for a workplace-type token. Falls back to the raw value. */\nexport function getWorkplaceTypeLabel(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return WORKPLACE_TYPE_LABELS[value] ?? value;\n}\n\n/**\n * Legacy workplace tokens the lexicon retains for old records, mapped to their\n * current canonical token. `id.sifa.defs#remote` is \"Treated as remoteGlobal by\n * AppViews\" per the lexicon, so it resolves to the scoped `remoteGlobal`.\n */\nexport const WORKPLACE_TYPE_LEGACY_ALIASES: Record<string, string> = {\n  'id.sifa.defs#remote': 'id.sifa.defs#remoteGlobal',\n};\n\n/**\n * Normalize a list of workplace-type tokens: resolve legacy aliases to their\n * canonical token, then dedup while preserving first-seen order. Unknown tokens\n * pass through untouched (forward-compat). Used by the editor (so a legacy token\n * maps onto a real option and migrates forward on save) and by display (so a\n * record carrying both the legacy and canonical token renders a single badge).\n */\nexport function normalizeWorkplaceTypes(values: readonly string[]): string[] {\n  const seen = new Set<string>();\n  const out: string[] = [];\n  for (const value of values) {\n    const canonical = WORKPLACE_TYPE_LEGACY_ALIASES[value] ?? value;\n    if (seen.has(canonical)) continue;\n    seen.add(canonical);\n    out.push(canonical);\n  }\n  return out;\n}\n","/**\n * Platform identifiers, labels, and URL helpers used in profile external accounts.\n *\n * This file is intentionally data-only -- icon mapping is platform-specific\n * (React DOM components on web, React Native components on mobile) and lives\n * in the consumer.\n */\n\nexport const PLATFORM_LABELS = {\n  bluesky: 'Bluesky',\n  github: 'GitHub',\n  codeberg: 'Codeberg',\n  gitlab: 'GitLab',\n  forgejo: 'Forgejo',\n  gitea: 'Gitea',\n  linkedin: 'LinkedIn',\n  youtube: 'YouTube',\n  twitter: 'X (Twitter)',\n  instagram: 'Instagram',\n  substack: 'Substack',\n  tangled: 'Tangled',\n  dns: 'Domain',\n  website: 'Website',\n  rss: 'RSS',\n  fediverse: 'Fediverse',\n  orcid: 'ORCID',\n  keyoxide: 'Keyoxide',\n} as const;\n\nexport type PlatformId = keyof typeof PLATFORM_LABELS;\n\n/** Prefix of the lexicon platform knownValue tokens (e.g. id.sifa.defs#platformLinkedin). */\nconst PLATFORM_TOKEN_PREFIX = 'id.sifa.defs#platform';\n\n/**\n * Normalize a platform value to the short code used throughout the app (the\n * editor, the API `VALID_PLATFORMS` enum, the DB, and {@link PLATFORM_LABELS}).\n *\n * External-account records may carry `platform` as the raw lexicon knownValue\n * token (`id.sifa.defs#platformLinkedin`) instead of the short code — written by\n * some third-party apps. This maps the token to its lowercase suffix\n * (`linkedin`) and passes short codes / unknown values through unchanged.\n */\n/**\n * Synonyms written by third-party tools and keytrace claims (whose `type` is\n * surfaced as the platform) for the same underlying network, mapped to the\n * canonical short code. Without this, a keytrace-verified Mastodon account\n * arrives as `activitypub`, an unknown platform that renders as a generic\n * website and is skipped by Fediverse ingestion.\n */\nconst PLATFORM_ALIASES: Record<string, PlatformId> = {\n  activitypub: 'fediverse',\n  mastodon: 'fediverse',\n};\n\nexport function normalizePlatformId(platform: string): string {\n  const code = platform.startsWith(PLATFORM_TOKEN_PREFIX)\n    ? platform.slice(PLATFORM_TOKEN_PREFIX.length).toLowerCase()\n    : platform;\n  return PLATFORM_ALIASES[code.toLowerCase()] ?? code;\n}\n\nexport function isKnownPlatform(platform: string): platform is PlatformId {\n  return platform in PLATFORM_LABELS;\n}\n\nexport function getPlatformLabel(platform: string): string {\n  const normalized = normalizePlatformId(platform);\n  return isKnownPlatform(normalized) ? PLATFORM_LABELS[normalized] : PLATFORM_LABELS.website;\n}\n\n/** Platforms excluded from the \"Add Links\" dropdown (auto-derived or not accepted by API). */\nconst EXCLUDED_FROM_DROPDOWN = new Set<PlatformId>(['bluesky', 'dns', 'tangled']);\n\n/** Platforms available in the \"Add Links\" dropdown. */\nexport const PLATFORM_OPTIONS: ReadonlyArray<{ value: PlatformId; label: string }> = (\n  Object.entries(PLATFORM_LABELS) as [PlatformId, string][]\n)\n  .filter(([value]) => !EXCLUDED_FROM_DROPDOWN.has(value))\n  .map(([value, label]) => ({ value, label }));\n\n/**\n * Build a favicon URL for a given site URL using Google's public favicon service.\n * Returns `null` if the URL cannot be parsed.\n */\nexport function getFaviconUrl(siteUrl: string): string | null {\n  try {\n    const { hostname } = new URL(siteUrl);\n    return `https://www.google.com/s2/favicons?domain=${encodeURIComponent(hostname)}&sz=32`;\n  } catch {\n    return null;\n  }\n}\n","export const SKILL_CATEGORIES = [\n  { value: 'technical', label: 'Technical' },\n  { value: 'business', label: 'Business' },\n  { value: 'creative', label: 'Creative' },\n  { value: 'interpersonal', label: 'Interpersonal' },\n  { value: 'industry', label: 'Industry' },\n  { value: 'community', label: 'Community' },\n  { value: 'security', label: 'Security' },\n] as const;\n\nexport type SkillCategory = (typeof SKILL_CATEGORIES)[number]['value'];\n\nexport const CATEGORY_ORDER: ReadonlyArray<SkillCategory> = SKILL_CATEGORIES.map((c) => c.value);\n\nexport const CATEGORY_LABELS: Record<SkillCategory | 'other', string> = {\n  ...(Object.fromEntries(SKILL_CATEGORIES.map((c) => [c.value, c.label])) as Record<\n    SkillCategory,\n    string\n  >),\n  other: 'Other',\n};\n\n/**\n * Reduces a `category` value from a skill record to a bare token.\n *\n * `id.sifa.profile.skill` publishes its `knownValues` in lexicon-ref form\n * (`id.sifa.defs#technical`), so a client writing that is following the\n * lexicon. Sifa's own surfaces store and compare bare tokens (`technical`), and\n * without this the ref form falls through to the \"other\" bucket. Both forms are\n * legal: `knownValues` is advisory in AT Protocol, not a closed enum.\n *\n * Normalising is not validating. An unrecognised value is returned as-is, in\n * lowercase, and callers decide what to do with it (`groupSkillsByCategory`\n * buckets it as \"other\").\n */\nexport function normalizeSkillCategory(value: string | undefined | null): string | undefined {\n  if (typeof value !== 'string') return undefined;\n  const afterRef = value.includes('#') ? value.slice(value.lastIndexOf('#') + 1) : value;\n  const token = afterRef.trim().toLowerCase();\n  return token === '' ? undefined : token;\n}\n","import type { ProfileSkill } from '../types/index.js';\n\nimport { CATEGORY_ORDER, normalizeSkillCategory } from './skill-categories.js';\n\nexport type MergedProfileSkill = ProfileSkill & {\n  mergedRkeys: string[];\n  positionRkeys?: string[];\n};\n\n/**\n * Collapses skills that resolve to the same name (case-insensitive, trimmed).\n *\n * LinkedIn import creates one skill record per (skill, position) pair, so a\n * profile can have several \"Ruby\" rows. We surface them as a single chip with\n * all underlying rkeys exposed via `mergedRkeys` so edit/delete can fan out.\n */\nexport function dedupeSkills(skills: ProfileSkill[]): MergedProfileSkill[] {\n  const groups = new Map<string, MergedProfileSkill>();\n\n  for (const skill of skills) {\n    const key = skill.name.trim().toLowerCase();\n    const existing = groups.get(key);\n    const positions = (skill as ProfileSkill & { positionRkeys?: string[] }).positionRkeys ?? [];\n\n    if (!existing) {\n      groups.set(key, {\n        ...skill,\n        mergedRkeys: [skill.rkey],\n        positionRkeys: [...positions],\n      });\n      continue;\n    }\n\n    existing.mergedRkeys.push(skill.rkey);\n    if (!existing.category && skill.category) existing.category = skill.category;\n    const incomingSubCategory = skill.subCategory?.trim();\n    if (incomingSubCategory && !existing.subCategory?.trim()) {\n      existing.subCategory = incomingSubCategory;\n    }\n    if ((skill.endorsementCount ?? 0) > (existing.endorsementCount ?? 0)) {\n      existing.endorsementCount = skill.endorsementCount;\n    }\n    if (skill.endorsed) existing.endorsed = true;\n    if (skill.activityBacked) existing.activityBacked = true;\n    const merged = new Set([...(existing.positionRkeys ?? []), ...positions]);\n    existing.positionRkeys = Array.from(merged);\n  }\n\n  return Array.from(groups.values());\n}\n\n/**\n * Groups skills by category in CATEGORY_ORDER, with unknown/empty categories\n * collected under \"other\". Within each group: sorted by endorsementCount desc,\n * then alphabetical by name. Empty groups are omitted.\n */\nexport function groupSkillsByCategory<T extends ProfileSkill>(skills: T[]): [string, T[]][] {\n  const grouped = new Map<string, T[]>();\n\n  for (const skill of skills) {\n    // Accepts the lexicon's own ref form (id.sifa.defs#technical) as well as\n    // the bare token, so a record written to spec is not bucketed as \"other\".\n    const normalised = normalizeSkillCategory(skill.category) ?? '';\n    const key = (CATEGORY_ORDER as readonly string[]).includes(normalised) ? normalised : 'other';\n    const bucket = grouped.get(key) ?? [];\n    bucket.push(skill);\n    grouped.set(key, bucket);\n  }\n\n  for (const [, groupSkills] of grouped) {\n    groupSkills.sort((a, b) => {\n      const countDiff = (b.endorsementCount ?? 0) - (a.endorsementCount ?? 0);\n      if (countDiff !== 0) return countDiff;\n      return a.name.localeCompare(b.name);\n    });\n  }\n\n  const ordered: [string, T[]][] = [];\n  for (const cat of CATEGORY_ORDER) {\n    const group = grouped.get(cat);\n    if (group?.length) ordered.push([cat, group]);\n  }\n  const otherGroup = grouped.get('other');\n  if (otherGroup?.length) ordered.push(['other', otherGroup]);\n\n  return ordered;\n}\n\n/**\n * Groups skills by their freeform `subCategory` label (#305), for renderers\n * that present skills in the user's own groups (Frontend, Backend, etc.).\n *\n * Labels are matched case-insensitively and surfaced under the first-seen\n * casing. Groups are ordered alphabetically by label; skills with no\n * `subCategory` collect under a trailing `null` bucket (omitted when empty).\n * Within each group: endorsementCount desc, then alphabetical by name.\n */\nexport function groupSkillsBySubCategory<T extends ProfileSkill>(\n  skills: T[],\n): [string | null, T[]][] {\n  const labels = new Map<string, string>();\n  const grouped = new Map<string, T[]>();\n\n  for (const skill of skills) {\n    const raw = skill.subCategory?.trim();\n    const key = raw ? raw.toLowerCase() : '';\n    if (raw && !labels.has(key)) labels.set(key, raw);\n    const bucket = grouped.get(key) ?? [];\n    bucket.push(skill);\n    grouped.set(key, bucket);\n  }\n\n  // Clone before sorting so the caller's arrays are never mutated in place.\n  const sortByRank = (groupSkills: T[]): T[] =>\n    [...groupSkills].sort((a, b) => {\n      const countDiff = (b.endorsementCount ?? 0) - (a.endorsementCount ?? 0);\n      if (countDiff !== 0) return countDiff;\n      return a.name.localeCompare(b.name);\n    });\n\n  const ordered: [string | null, T[]][] = [];\n  for (const key of [...labels.keys()].sort((a, b) => a.localeCompare(b))) {\n    const label = labels.get(key);\n    const group = grouped.get(key);\n    if (label && group?.length) ordered.push([label, sortByRank(group)]);\n  }\n  const ungrouped = grouped.get('');\n  if (ungrouped?.length) ordered.push([null, sortByRank(ungrouped)]);\n\n  return ordered;\n}\n","import type { ProfileSkill } from '../types/index.js';\n\nimport { groupSkillsBySubCategory } from './skill-grouping.js';\n\nexport interface SkillDisplayGroups<T extends ProfileSkill> {\n  /** Sub-groups for one category; a `null` label is the unlabelled bucket. */\n  groups: [string | null, T[]][];\n  /**\n   * Whether sub-category labels carry information here. False when the category\n   * has fewer than two distinct sub-categories, where a lone label says nothing\n   * the category heading does not already say.\n   */\n  showLabels: boolean;\n}\n\nexport interface SkillDisplayGroupsOptions {\n  /**\n   * Put the unlabelled bucket first instead of last. Inline chip rendering\n   * reads fine with it trailing, but in a linear document (markdown, docx,\n   * print) trailing unlabelled entries appear to belong to the sub-heading\n   * above them, so documents want it directly under the category heading.\n   */\n  ungroupedFirst?: boolean;\n}\n\n/**\n * Prepares one category's skills for display: the sub-groups, plus whether to\n * label them (the render rule from #314).\n *\n * Shared so the profile, print, markdown and docx surfaces group identically\n * rather than each re-deriving the threshold.\n */\nexport function groupSkillsForDisplay<T extends ProfileSkill>(\n  skills: T[],\n  options: SkillDisplayGroupsOptions = {},\n): SkillDisplayGroups<T> {\n  const grouped = groupSkillsBySubCategory(skills);\n  const labelled = grouped.filter(([label]) => label !== null);\n\n  const groups = options.ungroupedFirst\n    ? [...grouped.filter(([label]) => label === null), ...labelled]\n    : grouped;\n\n  return { groups, showLabels: labelled.length >= 2 };\n}\n","/**\n * App-category taxonomy for AT Protocol apps tracked by Sifa.\n *\n * Categories group apps by what kind of activity they produce (Posts, Photos,\n * Code, ...). They drive the pill-size icon shown in `<AppPill>` and the\n * fallback glyph used in activity-card headers when no app-specific logo\n * exists.\n *\n * This file is intentionally data-only -- icon mapping is renderer-specific\n * (React DOM Phosphor components on web, React Native components on mobile)\n * and lives in the consumer. The `phosphorIcon` field is the Phosphor icon\n * NAME, not a component reference.\n *\n * Categories are an internal grouping; we do not surface this taxonomy in\n * public-facing copy.\n */\n\nexport const APP_CATEGORIES = {\n  Art: { phosphorIcon: 'PaintBrush' },\n  Articles: { phosphorIcon: 'Article' },\n  Chat: { phosphorIcon: 'ChatsCircle' },\n  Code: { phosphorIcon: 'Code' },\n  Domains: { phosphorIcon: 'Globe' },\n  Endorsements: { phosphorIcon: 'HandHeart' },\n  Events: { phosphorIcon: 'CalendarBlank' },\n  Impact: { phosphorIcon: 'Certificate' },\n  Links: { phosphorIcon: 'LinkSimple' },\n  Lists: { phosphorIcon: 'ListBullets' },\n  Music: { phosphorIcon: 'MusicNote' },\n  Pages: { phosphorIcon: 'Browser' },\n  Pastes: { phosphorIcon: 'Clipboard' },\n  Photos: { phosphorIcon: 'Camera' },\n  Places: { phosphorIcon: 'MapPin' },\n  Posts: { phosphorIcon: 'ChatCircle' },\n  'Q&A': { phosphorIcon: 'Question' },\n  Recipes: { phosphorIcon: 'CookingPot' },\n  Research: { phosphorIcon: 'Path' },\n  Reviews: { phosphorIcon: 'Star' },\n  Slides: { phosphorIcon: 'Presentation' },\n  Social: { phosphorIcon: 'UsersThree' },\n  Translations: { phosphorIcon: 'Translate' },\n  Verification: { phosphorIcon: 'Key' },\n  Video: { phosphorIcon: 'VideoCamera' },\n} as const;\n\nexport type AppCategoryId = keyof typeof APP_CATEGORIES;\n\nexport const APP_CATEGORY_IDS = Object.keys(APP_CATEGORIES) as AppCategoryId[];\n\nexport function isAppCategory(value: string): value is AppCategoryId {\n  return Object.prototype.hasOwnProperty.call(APP_CATEGORIES, value);\n}\n\nexport function getAppCategoryIcon(category: AppCategoryId): string {\n  return APP_CATEGORIES[category].phosphorIcon;\n}\n","/**\n * Maps every AT Protocol app Sifa tracks to its `AppCategoryId`. Single source\n * of truth for what category an app belongs to; sifa-api and sifa-web both\n * import from here.\n *\n * Add a new app: pick the category whose generic glyph best represents the\n * activity. If no existing category fits, add a new one to APP_CATEGORIES\n * rather than introducing a per-app override.\n */\n\nimport type { AppCategoryId } from './app-categories.js';\n\nexport const APP_CATEGORY_MAP = {\n  // Backend-scanned (sifa-api APP_REGISTRY)\n  bluesky: 'Posts',\n  tangled: 'Code',\n  github: 'Code',\n  // Posts ingested from a verified Fediverse (ActivityPub) account. Like\n  // github, there is no PDS collection behind it -- its own scanner owns the\n  // app-stats row.\n  fediverse: 'Posts',\n  // Items ingested from a verified RSS or Atom feed: blogs, newsletters,\n  // podcast and channel feeds. Categorized as Articles rather than Posts\n  // because the common case is a long-form blog entry with a title.\n  rss: 'Articles',\n  smokesignal: 'Events',\n  flashes: 'Photos',\n  grain: 'Photos',\n  pixl: 'Photos', // pics.pixl.image — photo posts on pixl.pics\n  whitewind: 'Articles',\n  frontpage: 'Links',\n  pastesphere: 'Pastes',\n  standard: 'Articles',\n  aetheros: 'Pages',\n  roomy: 'Social',\n  keytrace: 'Verification',\n  popfeed: 'Reviews',\n  streamplace: 'Video',\n  semble: 'Research',\n  youandme: 'Social',\n  leaflet: 'Articles',\n  colibri: 'Social',\n  collectivesocial: 'Lists',\n  bookhive: 'Reviews',\n  beaconbits: 'Places',\n  passports: 'Places',\n  asq: 'Q&A',\n  spark: 'Posts',\n  nooki: 'Social',\n  atstore: 'Reviews',\n  plyr: 'Music',\n  anisota: 'Posts',\n  atfund: 'Endorsements',\n  crate: 'Articles',\n  atmorsvp: 'Events',\n  opensocial: 'Social',\n  // Kevara speaker-directory listing — a professional speaking-availability\n  // declaration (talk topics, formats like keynote/panel/conference-talk).\n  // Grouped under Events as the closest fit (speaking engagements).\n  kevara: 'Events',\n  // Marque domain registrar — a domain registration record is a dated\n  // identity/ownership action, surfaced as a \"registered a domain\" event.\n  marque: 'Domains',\n  // ATCR (io.atcr) — distributed OCI container registry. The portfolio entry\n  // is io.atcr.repo.page (a published repository with a markdown README);\n  // manifests and tags are low-level artifacts excluded backend-side.\n  atcr: 'Code',\n  // Batch onboard — apps surfaced on high-volume profiles. Each gives its\n  // collections a named pill + category icon instead of a raw NSID.\n  mcp: 'Code', // app.mcp.server — published MCP servers (name/tools/language)\n  userinput: 'Social', // app.userinput — roadmap discussions + replies\n  minomobi: 'Music', // com.minomobi.music.composition — authored music\n  voxport: 'Video', // com.voxport.podcast.series — podcast series\n  badges: 'Verification', // community.lexicon.badge.award — signed earned credentials\n  atvouch: 'Endorsements', // dev.atvouch.graph.vouch — trust vouches\n  watsm: 'Code', // io.calabro.watsm.program — published WASM programs\n  plonk: 'Pastes', // li.plonk.paste — text pastes\n  alternativeproto: 'Links', // net.alternativeproto.submission — app-directory listings\n  papili: 'Links', // one.papili.post — link posts\n  vit: 'Code', // org.v-it.skill — published agent skills\n  lifepo: 'Social', // st.lifepo.lifeEvent — life-event timeline\n  streamthought: 'Posts', // stream.thought.blip — microblog thoughts\n  waow: 'Photos', // tech.waow.* — doodl drawings (dominant), polls, slides\n  lichen: 'Pages', // wiki.lichen — wiki notes + wikis\n  // Onboard from aramzs.xyz profile audit — new named pills.\n  aetherdocs: 'Slides', // os.aether.docs.presentation — authored slide decks\n  kich: 'Recipes', // io.kich.recipe.recipe — authored recipes\n  margin: 'Research', // at.margin.{note,annotation} — web-annotation notes with a body\n  // Onboard from moll.dev profile audit.\n  recipe: 'Recipes', // exchange.recipe.recipe — authored recipes on recipe.exchange\n\n  // Onboard from willow.sh profile audit.\n  guestbook: 'Social', // dev.baileytownsend.guestbook.entry — a note left on someone's cross-site guestbook\n\n  // Onboard from trezy.codes profile audit.\n  atmobb: 'Social', // app.atmobb.discussion.{thread,reply} — federated forum threads + replies\n\n  // Onboard from aaronstevenwhite.io profile audit.\n  chive: 'Research', // pub.chive.eprint.submission — preprints on chive.pub\n\n  // Onboard from helene-cook.eu profile audit.\n  zeens: 'Photos', // app.photosky.collection — curated photo collections on zeens.app\n\n  // Onboard from scanash.com profile audit.\n  locale: 'Translations', // at.locale.{project,translation} — localization projects and authored translation strings on locale.at\n  pckt: 'Posts', // blog.pckt.mini.post — microblog posts with no site.standard.document twin\n\n  // Onboard from the holke.xyz profile audit (impact-funding ecosystem).\n  hypercerts: 'Impact', // org.hypercerts.{claim.activity,collection} — authored claims of work done, and the project collections that group them\n  certified: 'Endorsements', // app.certified.{badge.award,actor.membership} — endorsements issued to another DID, and group memberships\n  impactindexer: 'Reviews', // org.impactindexer.review.comment — written reviews of a hypercert claim\n  pinksea: 'Art', // com.shinolabs.pinksea.oekaki — hand-drawn artwork posted to the PinkSea oekaki BBS\n\n  // Web-only (rendered in pills/cards via sifa-web atproto-apps.ts;\n  // no backend scan collection yet)\n  linkat: 'Links',\n  kipclip: 'Links',\n  statusphere: 'Social',\n} as const satisfies Record<string, AppCategoryId>;\n\nexport type KnownAppId = keyof typeof APP_CATEGORY_MAP;\n\nexport function isKnownAppId(appId: string): appId is KnownAppId {\n  return Object.prototype.hasOwnProperty.call(APP_CATEGORY_MAP, appId);\n}\n\nexport function categoryForApp(appId: string): AppCategoryId | undefined {\n  return isKnownAppId(appId) ? APP_CATEGORY_MAP[appId] : undefined;\n}\n","{\n  \"$schema\": \"https://sifa.id/schemas/activity-tiers/v1.json\",\n  \"version\": \"1.3.0\",\n  \"updated\": \"2026-08-25\",\n  \"tiers\": {\n    \"creation\": {\n      \"label\": \"Made\",\n      \"description\": \"Substantive records the actor authored: posts, articles, repos, galleries, livestreams, RSVPs, CV entries. Surfaced on the public profile and in the network timeline.\",\n      \"shownOnPublicProfile\": true\n    },\n    \"action\": {\n      \"label\": \"Did\",\n      \"description\": \"Engagement records (likes, reposts, follows, votes, stars, reactions). Visible to the actor on the 'What is public about me' page and on the originating app, but not surfaced on the Sifa public profile.\",\n      \"shownOnPublicProfile\": false\n    },\n    \"filtered\": {\n      \"label\": null,\n      \"description\": \"Configuration, infrastructure, moderation, game state, ephemeral consumption signals (bookmarks, highlights), and other records Sifa does not display anywhere. The records remain public on the actor's PDS regardless.\",\n      \"shownOnPublicProfile\": false\n    }\n  },\n  \"lexicons\": {\n    \"app.atmobb.discussion.reply\": {\n      \"tier\": \"creation\",\n      \"app\": \"atmobb\",\n      \"notes\": \"Replies are authored text, consistent with app.bsky.feed.post covering replies.\"\n    },\n    \"app.atmobb.discussion.thread\": {\n      \"tier\": \"creation\",\n      \"app\": \"atmobb\"\n    },\n    \"app.beaconbits.beacon\": {\n      \"tier\": \"creation\",\n      \"app\": \"beaconbits\"\n    },\n    \"app.bsky.actor.profile\": {\n      \"tier\": \"filtered\",\n      \"app\": \"bluesky\",\n      \"notes\": \"Profile metadata record.\"\n    },\n    \"app.bsky.feed.generator\": {\n      \"tier\": \"filtered\",\n      \"app\": \"bluesky\",\n      \"notes\": \"Feed generator definition record, not personal activity.\"\n    },\n    \"app.bsky.feed.like\": {\n      \"tier\": \"action\",\n      \"app\": \"bluesky\"\n    },\n    \"app.bsky.feed.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"bluesky\",\n      \"notes\": \"Ambiguous: many posts are casual, but the lexicon also carries long-form posts and threads. Treated as creation; empty quote-posts (no text + record embed) are filtered at the consumer layer, not here.\"\n    },\n    \"app.bsky.feed.repost\": {\n      \"tier\": \"action\",\n      \"app\": \"bluesky\"\n    },\n    \"app.bsky.graph.block\": {\n      \"tier\": \"filtered\",\n      \"app\": \"bluesky\",\n      \"notes\": \"Moderation record.\"\n    },\n    \"app.bsky.graph.follow\": {\n      \"tier\": \"action\",\n      \"app\": \"bluesky\"\n    },\n    \"app.bsky.graph.list\": {\n      \"tier\": \"filtered\",\n      \"app\": \"bluesky\",\n      \"notes\": \"User-curated list metadata; not surfaced as profile activity.\"\n    },\n    \"app.bsky.graph.listblock\": {\n      \"tier\": \"filtered\",\n      \"app\": \"bluesky\",\n      \"notes\": \"Moderation record.\"\n    },\n    \"app.bsky.graph.listitem\": {\n      \"tier\": \"filtered\",\n      \"app\": \"bluesky\",\n      \"notes\": \"List membership; rendered via the parent list, not as standalone activity.\"\n    },\n    \"app.bsky.graph.mute\": {\n      \"tier\": \"filtered\",\n      \"app\": \"bluesky\",\n      \"notes\": \"Moderation record.\"\n    },\n    \"app.bsky.graph.starterpack\": {\n      \"tier\": \"filtered\",\n      \"app\": \"bluesky\"\n    },\n    \"app.bsky.graph.verification\": {\n      \"tier\": \"creation\",\n      \"app\": \"bluesky\",\n      \"notes\": \"Diverges from app.bsky.graph.follow (action) on purpose: verifying another account's handle is a deliberate trust statement the actor authors, not a tap. Sifa renders it with its own card.\"\n    },\n    \"app.certified.actor.membership\": {\n      \"tier\": \"creation\",\n      \"app\": \"certified\",\n      \"notes\": \"Joining a group is a commitment, same shape as a Colibri or Open Social membership.\"\n    },\n    \"app.certified.badge.award\": {\n      \"tier\": \"creation\",\n      \"app\": \"certified\",\n      \"notes\": \"An endorsement issued to another DID. A trust signal the actor contributes, like a Bluesky verification.\"\n    },\n    \"app.certified.badge.response\": {\n      \"tier\": \"creation\",\n      \"app\": \"certified\",\n      \"notes\": \"The recipient's acceptance of a badge someone else awarded them. An accepted badge is a credential the person holds; rejected ones are hidden by an ACTIVITY_VISIBILITY_RULES predicate.\"\n    },\n    \"app.collectivesocial.feed.list\": {\n      \"tier\": \"creation\",\n      \"app\": \"collectivesocial\",\n      \"notes\": \"Auto-created default Inbox lists are filtered at the consumer layer via isDefault=true predicate.\"\n    },\n    \"app.mcp.server\": {\n      \"tier\": \"creation\",\n      \"app\": \"mcp\"\n    },\n    \"app.photosky.collection\": {\n      \"tier\": \"creation\",\n      \"app\": \"zeens\",\n      \"notes\": \"A curated photo collection on Zeens (still the app.photosky namespace).\"\n    },\n    \"app.sidetrail.trail\": {\n      \"tier\": \"creation\",\n      \"app\": \"semble\"\n    },\n    \"app.sidetrail.walk\": {\n      \"tier\": \"creation\",\n      \"app\": \"semble\"\n    },\n    \"app.userinput.discussion\": {\n      \"tier\": \"creation\",\n      \"app\": \"userinput\"\n    },\n    \"app.userinput.reply\": {\n      \"tier\": \"creation\",\n      \"app\": \"userinput\",\n      \"notes\": \"Replies are authored text, consistent with app.bsky.feed.post covering replies.\"\n    },\n    \"at.locale.project\": {\n      \"tier\": \"creation\",\n      \"app\": \"locale\",\n      \"notes\": \"A localization project the actor owns: git source, source and target locales.\"\n    },\n    \"at.locale.translation\": {\n      \"tier\": \"creation\",\n      \"app\": \"locale\",\n      \"notes\": \"One authored translated string for a message key in a target locale.\"\n    },\n    \"at.margin.annotation\": {\n      \"tier\": \"creation\",\n      \"app\": \"margin\",\n      \"notes\": \"An annotation on someone else's text is still authored writing.\"\n    },\n    \"at.margin.bookmark\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Bookmark \\u2014 consumption signal, not creation.\",\n      \"app\": \"margin\"\n    },\n    \"at.margin.highlight\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Highlight \\u2014 consumption signal, not creation.\",\n      \"app\": \"margin\"\n    },\n    \"at.margin.note\": {\n      \"tier\": \"creation\",\n      \"app\": \"margin\"\n    },\n    \"at.marque.domain\": {\n      \"tier\": \"creation\",\n      \"app\": \"marque\"\n    },\n    \"at.youandme.connection\": {\n      \"tier\": \"creation\",\n      \"app\": \"youandme\"\n    },\n    \"blog.pckt.mini.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"pckt\",\n      \"notes\": \"A pckt microblog post. Long-form pckt posts are site.standard.document instead.\"\n    },\n    \"blue.flashes.feed.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"flashes\"\n    },\n    \"blue.linkat.board\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Link-in-bio board; consumption signal.\",\n      \"app\": \"linkat\"\n    },\n    \"buzz.bookhive.book\": {\n      \"tier\": \"creation\",\n      \"app\": \"bookhive\"\n    },\n    \"com.minomobi.music.composition\": {\n      \"tier\": \"creation\",\n      \"app\": \"minomobi\"\n    },\n    \"com.shinolabs.pinksea.oekaki\": {\n      \"tier\": \"creation\",\n      \"app\": \"pinksea\",\n      \"notes\": \"A drawing made in PinkSea's canvas, stored as an image blob with alt text and tags.\"\n    },\n    \"com.voxport.podcast.series\": {\n      \"tier\": \"creation\",\n      \"app\": \"voxport\"\n    },\n    \"com.whtwnd.blog.entry\": {\n      \"tier\": \"creation\",\n      \"app\": \"whitewind\"\n    },\n    \"community.lexicon.badge.award\": {\n      \"tier\": \"creation\",\n      \"app\": \"badges\",\n      \"notes\": \"The award record is authored by the giver, so it is their attestation about someone else.\"\n    },\n    \"community.lexicon.bookmarks.bookmark\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Bookmark \\u2014 consumption signal.\",\n      \"app\": \"kipclip\"\n    },\n    \"community.lexicon.calendar.rsvp\": {\n      \"tier\": \"creation\",\n      \"app\": \"smokesignal\",\n      \"notes\": \"Ambiguous: RSVPs are reactions to events, but they are public commitments and the only Smoke Signal record Sifa scans today. Classified as creation.\"\n    },\n    \"community.nooki.comments\": {\n      \"tier\": \"creation\",\n      \"app\": \"nooki\",\n      \"notes\": \"Comments are authored text.\"\n    },\n    \"community.nooki.membership\": {\n      \"tier\": \"creation\",\n      \"app\": \"nooki\",\n      \"notes\": \"Joining a community, classified like social.colibri.membership (creation).\"\n    },\n    \"community.opensocial.membership\": {\n      \"tier\": \"creation\",\n      \"app\": \"opensocial\",\n      \"notes\": \"Joining a community, classified like social.colibri.membership (creation).\"\n    },\n    \"computer.aetheros.page\": {\n      \"tier\": \"creation\",\n      \"app\": \"aetheros\"\n    },\n    \"dev.atvouch.graph.vouch\": {\n      \"tier\": \"creation\",\n      \"app\": \"atvouch\",\n      \"notes\": \"Vouching for someone. Authored attestation, same reasoning as fund.at.graph.endorse.\"\n    },\n    \"dev.baileytownsend.guestbook.entry\": {\n      \"tier\": \"creation\",\n      \"app\": \"guestbook\",\n      \"notes\": \"Signing someone else's guestbook is a short authored message.\"\n    },\n    \"dev.keytrace.claim\": {\n      \"tier\": \"creation\",\n      \"app\": \"keytrace\"\n    },\n    \"dev.skyboard.board\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Skyboard task-board metadata.\",\n      \"app\": \"skyboard\"\n    },\n    \"dev.skyboard.op\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Skyboard operation log.\",\n      \"app\": \"skyboard\"\n    },\n    \"dev.skyboard.task\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Skyboard task record.\",\n      \"app\": \"skyboard\"\n    },\n    \"events.smokesignal.profile\": {\n      \"tier\": \"filtered\",\n      \"app\": \"smokesignal\",\n      \"notes\": \"Profile metadata record.\"\n    },\n    \"exchange.recipe.recipe\": {\n      \"tier\": \"creation\",\n      \"app\": \"recipe\"\n    },\n    \"fm.plyr.comment\": {\n      \"tier\": \"creation\",\n      \"app\": \"plyr\",\n      \"notes\": \"Comments are authored text.\"\n    },\n    \"forum.barazo.community.member\": {\n      \"tier\": \"creation\",\n      \"app\": \"barazo\"\n    },\n    \"forum.barazo.flag\": {\n      \"tier\": \"filtered\",\n      \"app\": \"barazo\",\n      \"notes\": \"Moderation flag.\"\n    },\n    \"forum.barazo.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"barazo\"\n    },\n    \"forum.barazo.reaction\": {\n      \"tier\": \"action\",\n      \"app\": \"barazo\"\n    },\n    \"forum.barazo.reply\": {\n      \"tier\": \"action\",\n      \"app\": \"barazo\",\n      \"notes\": \"Short conversational reply \\u2014 engagement signal.\"\n    },\n    \"forum.barazo.reputation.event\": {\n      \"tier\": \"creation\",\n      \"app\": \"barazo\"\n    },\n    \"fund.at.graph.endorse\": {\n      \"tier\": \"creation\",\n      \"app\": \"atfund\",\n      \"notes\": \"Endorsing someone. Authored attestation, not engagement.\"\n    },\n    \"fyi.asq.answer\": {\n      \"tier\": \"creation\",\n      \"app\": \"asq\"\n    },\n    \"fyi.asq.question\": {\n      \"tier\": \"creation\",\n      \"app\": \"asq\"\n    },\n    \"fyi.atstore.listing.review\": {\n      \"tier\": \"creation\",\n      \"app\": \"atstore\"\n    },\n    \"fyi.unravel.frontpage.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"frontpage\"\n    },\n    \"fyi.unravel.frontpage.vote\": {\n      \"tier\": \"action\",\n      \"app\": \"frontpage\"\n    },\n    \"id.sifa.authConnection\": {\n      \"tier\": \"filtered\",\n      \"app\": \"sifa\",\n      \"notes\": \"OAuth scope record.\"\n    },\n    \"id.sifa.authMeet\": {\n      \"tier\": \"filtered\",\n      \"app\": \"sifa\",\n      \"notes\": \"OAuth scope record.\"\n    },\n    \"id.sifa.authProfile\": {\n      \"tier\": \"filtered\",\n      \"app\": \"sifa\",\n      \"notes\": \"OAuth scope record.\"\n    },\n    \"id.sifa.authProfileAccess\": {\n      \"tier\": \"filtered\",\n      \"app\": \"sifa\",\n      \"notes\": \"OAuth profile-access record.\"\n    },\n    \"id.sifa.authProject\": {\n      \"tier\": \"filtered\",\n      \"app\": \"sifa\",\n      \"notes\": \"OAuth scope record.\"\n    },\n    \"id.sifa.confirmation\": {\n      \"tier\": \"action\",\n      \"app\": \"sifa\",\n      \"notes\": \"Confirmation that a record naming the actor is accurate (co-speaker credit, project membership).\"\n    },\n    \"id.sifa.endorsement\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\",\n      \"notes\": \"Endorsement authored by the actor about another profile.\"\n    },\n    \"id.sifa.endorsement.confirmation\": {\n      \"tier\": \"action\",\n      \"app\": \"sifa\",\n      \"notes\": \"Confirmation/acceptance of an endorsement received.\"\n    },\n    \"id.sifa.graph.connection\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\",\n      \"notes\": \"Mutual professional connection record.\"\n    },\n    \"id.sifa.graph.follow\": {\n      \"tier\": \"action\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.meeting\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.certification\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.course\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.education\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.externalAccount\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.honor\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.language\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.location\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.position\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.presentation\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.presentationDelivery\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.project\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.publication\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.self\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\",\n      \"notes\": \"Sifa professional profile root.\"\n    },\n    \"id.sifa.profile.skill\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.profile.volunteering\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"id.sifa.project.member\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\",\n      \"notes\": \"Deprecated, never implemented. Superseded by id.sifa.confirmation.\"\n    },\n    \"id.sifa.project.membership\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\",\n      \"notes\": \"Deprecated, never implemented. Superseded by id.sifa.confirmation.\"\n    },\n    \"id.sifa.project.self\": {\n      \"tier\": \"creation\",\n      \"app\": \"sifa\"\n    },\n    \"io.atcr.repo.page\": {\n      \"tier\": \"creation\",\n      \"app\": \"atcr\"\n    },\n    \"io.calabro.watsm.program\": {\n      \"tier\": \"creation\",\n      \"app\": \"watsm\"\n    },\n    \"io.kich.recipe.recipe\": {\n      \"tier\": \"creation\",\n      \"app\": \"kich\"\n    },\n    \"is.kevara.directory.speaker\": {\n      \"tier\": \"creation\",\n      \"app\": \"kevara\"\n    },\n    \"li.plonk.paste\": {\n      \"tier\": \"creation\",\n      \"app\": \"plonk\"\n    },\n    \"link.pastesphere.snippet\": {\n      \"tier\": \"creation\",\n      \"app\": \"pastesphere\"\n    },\n    \"net.alternativeproto.submission\": {\n      \"tier\": \"creation\",\n      \"app\": \"alternativeproto\"\n    },\n    \"net.alternativeproto.vote\": {\n      \"tier\": \"action\",\n      \"notes\": \"Vote record on a third-party protocol.\",\n      \"app\": \"alternativeproto\"\n    },\n    \"net.anisota.feed.list\": {\n      \"tier\": \"creation\",\n      \"app\": \"anisota\"\n    },\n    \"net.anisota.feed.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"anisota\"\n    },\n    \"net.anisota.player.state\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Anisota game player state.\",\n      \"app\": \"anisota\"\n    },\n    \"network.cosmik.card\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Link-in-bio card; consumption signal.\",\n      \"app\": \"cosmik\"\n    },\n    \"network.cosmik.collection\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Stale registry id \\u2014 Cosmik formerly in app registry.\",\n      \"app\": \"cosmik\"\n    },\n    \"network.cosmik.collectionLink\": {\n      \"tier\": \"filtered\",\n      \"app\": \"cosmik\"\n    },\n    \"network.cosmik.connection\": {\n      \"tier\": \"filtered\",\n      \"app\": \"cosmik\"\n    },\n    \"network.cosmik.follow\": {\n      \"tier\": \"filtered\",\n      \"app\": \"cosmik\"\n    },\n    \"one.papili.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"papili\"\n    },\n    \"org.hypercerts.claim.activity\": {\n      \"tier\": \"creation\",\n      \"app\": \"hypercerts\",\n      \"notes\": \"A hypercert: an authored claim of work done, with title, description, and weighted contributors.\"\n    },\n    \"org.hypercerts.claim.collection\": {\n      \"tier\": \"creation\",\n      \"app\": \"hypercerts\",\n      \"notes\": \"Older shape of the project container that groups claims. Superseded by org.hypercerts.collection.\"\n    },\n    \"org.hypercerts.claim.evaluation\": {\n      \"tier\": \"creation\",\n      \"app\": \"hypercerts\",\n      \"notes\": \"An assessment of a claim carrying a score and a written summary. An opinion with a body.\"\n    },\n    \"org.hypercerts.collection\": {\n      \"tier\": \"creation\",\n      \"app\": \"hypercerts\",\n      \"notes\": \"An authored project container grouping hypercert claims, with its own title, banner, and description.\"\n    },\n    \"org.impactindexer.review.comment\": {\n      \"tier\": \"creation\",\n      \"app\": \"impactindexer\",\n      \"notes\": \"A written review of a hypercert claim, like a Popfeed or BookHive review.\"\n    },\n    \"org.v-it.skill\": {\n      \"tier\": \"creation\",\n      \"app\": \"vit\"\n    },\n    \"os.aether.docs.presentation\": {\n      \"tier\": \"creation\",\n      \"app\": \"aetherdocs\"\n    },\n    \"pics.pixl.image\": {\n      \"tier\": \"creation\",\n      \"app\": \"pixl\"\n    },\n    \"place.stream.broadcast.origin\": {\n      \"tier\": \"filtered\",\n      \"app\": \"streamplace\",\n      \"notes\": \"Broadcast origin/infrastructure record.\"\n    },\n    \"place.stream.chat.message\": {\n      \"tier\": \"filtered\",\n      \"app\": \"streamplace\",\n      \"notes\": \"Ephemeral chat message.\"\n    },\n    \"place.stream.chat.profile\": {\n      \"tier\": \"filtered\",\n      \"app\": \"streamplace\",\n      \"notes\": \"Chat profile metadata.\"\n    },\n    \"place.stream.key\": {\n      \"tier\": \"filtered\",\n      \"app\": \"streamplace\",\n      \"notes\": \"Stream key \\u2014 sensitive infrastructure record.\"\n    },\n    \"place.stream.livestream\": {\n      \"tier\": \"creation\",\n      \"app\": \"streamplace\"\n    },\n    \"place.stream.metadata.configuration\": {\n      \"tier\": \"filtered\",\n      \"app\": \"streamplace\",\n      \"notes\": \"Stream configuration metadata.\"\n    },\n    \"pub.chive.eprint.submission\": {\n      \"tier\": \"creation\",\n      \"app\": \"chive\",\n      \"notes\": \"An authored preprint: title, ordered authors with affiliations, abstract.\"\n    },\n    \"pub.leaflet.authFullPermissions\": {\n      \"tier\": \"filtered\",\n      \"app\": \"leaflet\",\n      \"notes\": \"OAuth permission record.\"\n    },\n    \"pub.leaflet.comment\": {\n      \"tier\": \"creation\",\n      \"app\": \"leaflet\"\n    },\n    \"pub.leaflet.interactions.recommend\": {\n      \"tier\": \"action\",\n      \"app\": \"leaflet\"\n    },\n    \"quest.atmo.checkin\": {\n      \"tier\": \"creation\",\n      \"app\": \"atmorsvp\",\n      \"notes\": \"Attendance, classified like community.lexicon.calendar.rsvp (creation) rather than as engagement. The creation tier description names RSVPs explicitly.\"\n    },\n    \"quest.atmo.event\": {\n      \"tier\": \"creation\",\n      \"app\": \"atmorsvp\"\n    },\n    \"sh.tangled.actor.profile\": {\n      \"tier\": \"filtered\",\n      \"app\": \"tangled\",\n      \"notes\": \"Profile metadata record.\"\n    },\n    \"sh.tangled.feed.star\": {\n      \"tier\": \"action\",\n      \"app\": \"tangled\"\n    },\n    \"sh.tangled.graph.follow\": {\n      \"tier\": \"action\",\n      \"app\": \"tangled\"\n    },\n    \"sh.tangled.repo\": {\n      \"tier\": \"creation\",\n      \"app\": \"tangled\"\n    },\n    \"sh.tangled.repo.issue\": {\n      \"tier\": \"creation\",\n      \"app\": \"tangled\"\n    },\n    \"sh.tangled.repo.pull\": {\n      \"tier\": \"creation\",\n      \"app\": \"tangled\"\n    },\n    \"site.standard.document\": {\n      \"tier\": \"creation\",\n      \"app\": \"standard\"\n    },\n    \"so.sprk.feed.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"spark\"\n    },\n    \"so.sprk.story.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"spark\"\n    },\n    \"social.colibri.actor.data\": {\n      \"tier\": \"filtered\",\n      \"app\": \"colibri\",\n      \"notes\": \"Actor metadata.\"\n    },\n    \"social.colibri.approval\": {\n      \"tier\": \"filtered\",\n      \"app\": \"colibri\",\n      \"notes\": \"Moderation approval record.\"\n    },\n    \"social.colibri.category\": {\n      \"tier\": \"filtered\",\n      \"app\": \"colibri\",\n      \"notes\": \"Category metadata.\"\n    },\n    \"social.colibri.channel\": {\n      \"tier\": \"filtered\",\n      \"app\": \"colibri\",\n      \"notes\": \"Channel definition.\"\n    },\n    \"social.colibri.channel.read\": {\n      \"tier\": \"filtered\",\n      \"app\": \"colibri\",\n      \"notes\": \"Read-state marker.\"\n    },\n    \"social.colibri.community\": {\n      \"tier\": \"filtered\",\n      \"app\": \"colibri\",\n      \"notes\": \"Community definition.\"\n    },\n    \"social.colibri.membership\": {\n      \"tier\": \"creation\",\n      \"app\": \"colibri\"\n    },\n    \"social.colibri.message\": {\n      \"tier\": \"filtered\",\n      \"app\": \"colibri\",\n      \"notes\": \"Chat message \\u2014 high-volume conversational signal, not portfolio.\"\n    },\n    \"social.colibri.reaction\": {\n      \"tier\": \"filtered\",\n      \"app\": \"colibri\",\n      \"notes\": \"Chat reaction.\"\n    },\n    \"social.colibri.richtext.facet\": {\n      \"tier\": \"filtered\",\n      \"app\": \"colibri\",\n      \"notes\": \"Richtext facet sub-record.\"\n    },\n    \"social.crate.content\": {\n      \"tier\": \"creation\",\n      \"app\": \"crate\"\n    },\n    \"social.crate.note\": {\n      \"tier\": \"creation\",\n      \"app\": \"crate\"\n    },\n    \"social.grain.gallery\": {\n      \"tier\": \"creation\",\n      \"app\": \"grain\"\n    },\n    \"social.grain.gallery.item\": {\n      \"tier\": \"filtered\",\n      \"app\": \"grain\",\n      \"notes\": \"Item-within-gallery; rendered via parent gallery.\"\n    },\n    \"social.grain.photo\": {\n      \"tier\": \"filtered\",\n      \"app\": \"grain\",\n      \"notes\": \"Raw photo asset; surfaced via the gallery that references it.\"\n    },\n    \"social.grain.photo.exif\": {\n      \"tier\": \"filtered\",\n      \"app\": \"grain\",\n      \"notes\": \"EXIF metadata for a photo.\"\n    },\n    \"social.grain.story\": {\n      \"tier\": \"filtered\",\n      \"app\": \"grain\",\n      \"notes\": \"Ephemeral story format.\"\n    },\n    \"social.passports.fiftyStates.visit\": {\n      \"tier\": \"creation\",\n      \"app\": \"passports\"\n    },\n    \"social.passports.travel.leg\": {\n      \"tier\": \"creation\",\n      \"app\": \"passports\"\n    },\n    \"social.pinksky.app.preference\": {\n      \"tier\": \"filtered\",\n      \"app\": \"bluesky\",\n      \"notes\": \"Pinkleap (Bluesky client) app preferences.\"\n    },\n    \"social.popfeed.actor.profile\": {\n      \"tier\": \"filtered\",\n      \"app\": \"popfeed\",\n      \"notes\": \"Profile metadata record.\"\n    },\n    \"social.popfeed.challenge.participation\": {\n      \"tier\": \"filtered\",\n      \"app\": \"popfeed\",\n      \"notes\": \"Challenge participation tracking.\"\n    },\n    \"social.popfeed.feed.like\": {\n      \"tier\": \"action\",\n      \"app\": \"popfeed\"\n    },\n    \"social.popfeed.feed.note\": {\n      \"tier\": \"creation\",\n      \"app\": \"popfeed\"\n    },\n    \"social.popfeed.feed.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"popfeed\"\n    },\n    \"social.popfeed.feed.review\": {\n      \"tier\": \"creation\",\n      \"app\": \"popfeed\"\n    },\n    \"social.psky.feed.post\": {\n      \"tier\": \"creation\",\n      \"app\": \"picosky\"\n    },\n    \"space.roomy.space.personal\": {\n      \"tier\": \"creation\",\n      \"app\": \"roomy\"\n    },\n    \"st.lifepo.lifeEvent\": {\n      \"tier\": \"creation\",\n      \"app\": \"lifepo\"\n    },\n    \"stream.thought.blip\": {\n      \"tier\": \"creation\",\n      \"app\": \"streamthought\"\n    },\n    \"tech.waow.doodl.drawing\": {\n      \"tier\": \"creation\",\n      \"app\": \"waow\"\n    },\n    \"tech.waow.doodl.icon\": {\n      \"tier\": \"creation\",\n      \"app\": \"waow\"\n    },\n    \"tech.waow.doodl.iconset\": {\n      \"tier\": \"creation\",\n      \"app\": \"waow\"\n    },\n    \"tech.waow.doodl.logo\": {\n      \"tier\": \"creation\",\n      \"app\": \"waow\"\n    },\n    \"tech.waow.pollz.poll\": {\n      \"tier\": \"creation\",\n      \"app\": \"waow\"\n    },\n    \"tech.waow.slides.deck\": {\n      \"tier\": \"creation\",\n      \"app\": \"waow\"\n    },\n    \"tech.waow.slides.slide\": {\n      \"tier\": \"creation\",\n      \"app\": \"waow\",\n      \"notes\": \"Individual slides are components of a deck. Both are kept; the consumer decides whether to collapse them.\"\n    },\n    \"wiki.lichen.note\": {\n      \"tier\": \"creation\",\n      \"app\": \"lichen\"\n    },\n    \"wiki.lichen.wiki\": {\n      \"tier\": \"creation\",\n      \"app\": \"lichen\"\n    },\n    \"xyz.statusphere.status\": {\n      \"tier\": \"filtered\",\n      \"notes\": \"Statusphere emoji status \\u2014 leisure signal.\",\n      \"app\": \"statusphere\"\n    }\n  }\n}\n","import { z } from 'zod';\n\n// This SDK is the source of truth for the activity taxonomy.\n//\n// It used to be synced from sifa-lexicons, but the taxonomy is editorial\n// rather than protocol: none of it is published to a PDS, and it governs how\n// Sifa renders records rather than what any record means. Keeping it in the\n// lexicon repo meant it lived where nobody edited it, and the two copies\n// drifted 60 entries apart before anything noticed.\n//\n// It is served publicly at https://sifa.id/.well-known/sifa-activity-tiers.json\n// so third-party clients and sibling AppViews can read Sifa's choices rather\n// than infer them.\nimport rawTaxonomy from './activity-tiers.json' with { type: 'json' };\n\nexport type ActivityTier = 'creation' | 'action' | 'filtered';\n\nexport interface TierMeta {\n  label: string | null;\n  description: string;\n  shownOnPublicProfile: boolean;\n}\n\nexport interface LexiconEntry {\n  tier: ActivityTier;\n  app?: string;\n  notes?: string;\n}\n\nexport interface ActivityTaxonomy {\n  version: string;\n  updated: string;\n  tiers: Record<ActivityTier, TierMeta>;\n  lexicons: Record<string, LexiconEntry>;\n}\n\nconst tierMetaSchema = z.object({\n  label: z.string().nullable(),\n  description: z.string(),\n  shownOnPublicProfile: z.boolean(),\n});\n\nconst lexiconEntrySchema = z.object({\n  tier: z.enum(['creation', 'action', 'filtered']),\n  app: z.string().optional(),\n  notes: z.string().optional(),\n});\n\nconst taxonomySchema = z.object({\n  version: z.string(),\n  updated: z.string(),\n  tiers: z.object({\n    creation: tierMetaSchema,\n    action: tierMetaSchema,\n    filtered: tierMetaSchema,\n  }),\n  lexicons: z.record(z.string(), lexiconEntrySchema),\n});\n\nconst parsed: ActivityTaxonomy = taxonomySchema.parse(rawTaxonomy);\n\nexport const ACTIVITY_TIERS: Readonly<ActivityTaxonomy> = Object.freeze(parsed);\n\n/**\n * Returns the activity tier for a given AT Protocol NSID.\n * Returns 'filtered' for unknown/unclassified NSIDs (safe default — won't\n * leak unknown records to public profile surfaces).\n */\nexport function getActivityTier(nsid: string): ActivityTier {\n  if (!nsid) return 'filtered';\n  const entry = ACTIVITY_TIERS.lexicons[nsid];\n  return entry ? entry.tier : 'filtered';\n}\n\n/**\n * Returns the full lexicon entry (tier + app + notes), or null if unknown.\n */\nexport function getLexiconEntry(nsid: string): LexiconEntry | null {\n  if (!nsid) return null;\n  const entry = ACTIVITY_TIERS.lexicons[nsid];\n  return entry ?? null;\n}\n\n/**\n * Returns tier metadata (label, description, public visibility).\n */\nexport function getTierMeta(tier: ActivityTier): TierMeta {\n  return ACTIVITY_TIERS.tiers[tier];\n}\n\n/**\n * Returns the taxonomy version + updated date for diagnostics and\n * version-skew detection between SDK consumers and the canonical taxonomy.\n */\nexport function getActivityTaxonomyVersion(): { version: string; updated: string } {\n  return { version: ACTIVITY_TIERS.version, updated: ACTIVITY_TIERS.updated };\n}\n","/**\n * Presentation-role taxonomy. Mirrors `id.sifa.defs#presentationRole.knownValues`\n * from sifa-lexicons. The role describes how the person took part in a single\n * delivery (it can differ between deliveries of the same presentation).\n */\n\nexport interface PresentationRoleOption {\n  value: string;\n  label: string;\n}\n\nexport const PRESENTATION_ROLE_OPTIONS: PresentationRoleOption[] = [\n  { value: 'id.sifa.defs#presenter', label: 'Presenter' },\n  { value: 'id.sifa.defs#panelist', label: 'Panelist' },\n  { value: 'id.sifa.defs#keynote', label: 'Keynote' },\n  { value: 'id.sifa.defs#workshop', label: 'Workshop' },\n  { value: 'id.sifa.defs#host', label: 'Host' },\n];\n\nexport const PRESENTATION_ROLE_LABELS: Record<string, string> = Object.fromEntries(\n  PRESENTATION_ROLE_OPTIONS.map((o) => [o.value, o.label]),\n);\n\n/** Resolve a label for a presentation-role token. Falls back to the raw value. */\nexport function getPresentationRoleLabel(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return PRESENTATION_ROLE_LABELS[value] ?? value;\n}\n","/**\n * Publication-type taxonomy. Mirrors `id.sifa.profile.publication.type`\n * `knownValues` from sifa-lexicons.\n *\n * The values are ORCID's work-type vocabulary rather than `id.sifa.defs` tokens,\n * unlike every other enum here. That is deliberate: the vocabulary is ORCID's,\n * not Sifa's. It is what the data arrives in and what the AppView stores and\n * serves unmapped, so a synced work round-trips with no translation table.\n * Minting Sifa tokens would make Sifa the owner of a bibliographic vocabulary it\n * did not design. COAR Resource Types stays the anchor a consumer maps to.\n *\n * The set is open. A publication that reached Sifa from Standard.site, RSS, or a\n * hand-typed entry need not fit ORCID's list, so an unknown value is kept as\n * written rather than dropped.\n */\n\nexport interface PublicationTypeOption {\n  value: string;\n  label: string;\n}\n\nexport const PUBLICATION_TYPE_OPTIONS: PublicationTypeOption[] = [\n  { value: 'journal-article', label: 'Journal Article' },\n  { value: 'conference-paper', label: 'Conference Paper' },\n  { value: 'conference-abstract', label: 'Conference Abstract' },\n  { value: 'conference-poster', label: 'Conference Poster' },\n  { value: 'book', label: 'Book' },\n  { value: 'book-chapter', label: 'Book Chapter' },\n  { value: 'book-review', label: 'Book Review' },\n  { value: 'edited-book', label: 'Edited Book' },\n  { value: 'dissertation', label: 'Dissertation' },\n  { value: 'preprint', label: 'Preprint' },\n  { value: 'dataset', label: 'Dataset' },\n  { value: 'report', label: 'Report' },\n  { value: 'review', label: 'Review' },\n  { value: 'patent', label: 'Patent' },\n  { value: 'software', label: 'Software' },\n  { value: 'working-paper', label: 'Working Paper' },\n  { value: 'artistic-performance', label: 'Artistic Performance' },\n  { value: 'lecture-speech', label: 'Lecture/Speech' },\n  { value: 'online-resource', label: 'Online Resource' },\n  { value: 'newspaper-article', label: 'Newspaper Article' },\n  { value: 'research-technique', label: 'Research Technique' },\n  { value: 'standards-and-policy', label: 'Standards & Policy' },\n  { value: 'technical-standard', label: 'Technical Standard' },\n  { value: 'registered-copyright', label: 'Registered Copyright' },\n  { value: 'translation', label: 'Translation' },\n  { value: 'dictionary-entry', label: 'Dictionary Entry' },\n  { value: 'encyclopedia-entry', label: 'Encyclopedia Entry' },\n  { value: 'supervised-student-publication', label: 'Supervised Student Publication' },\n  { value: 'annotation', label: 'Annotation' },\n  { value: 'test', label: 'Test' },\n  { value: 'spin-off-company', label: 'Spin-off Company' },\n  { value: 'disclosure', label: 'Disclosure' },\n  { value: 'license', label: 'License' },\n  { value: 'trademark', label: 'Trademark' },\n  { value: 'design', label: 'Design' },\n  // ORCID's catch-all. Labelled \"Publication\" rather than \"Other\" because it is\n  // what shows on the card, and a badge reading \"Other\" tells a reader nothing.\n  { value: 'other', label: 'Publication' },\n];\n\nexport const PUBLICATION_TYPE_LABELS: Record<string, string> = Object.fromEntries(\n  PUBLICATION_TYPE_OPTIONS.map((o) => [o.value, o.label]),\n);\n\n/**\n * Resolve a label for a publication type.\n *\n * An unrecognized value falls back to the generic label rather than being shown\n * raw: an ORCID work type is a slug, and rendering \"spin-off-company\" verbatim\n * on a card reads as a bug. A caller that wants the raw value already has it.\n */\nexport function getPublicationTypeLabel(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return PUBLICATION_TYPE_LABELS[value] ?? 'Publication';\n}\n","/**\n * Presentation link-type taxonomy. Mirrors\n * `id.sifa.defs#presentationLinkType.knownValues` from sifa-lexicons. Used to\n * pick an icon and a default label for a presentation or delivery link.\n */\n\nexport interface PresentationLinkTypeOption {\n  value: string;\n  label: string;\n}\n\nexport const PRESENTATION_LINK_TYPE_OPTIONS: PresentationLinkTypeOption[] = [\n  { value: 'id.sifa.defs#linkSlides', label: 'Slides' },\n  { value: 'id.sifa.defs#linkRecording', label: 'Recording' },\n  { value: 'id.sifa.defs#linkEvent', label: 'Event page' },\n  { value: 'id.sifa.defs#linkRegistration', label: 'Registration' },\n  { value: 'id.sifa.defs#linkWriteup', label: 'Write-up' },\n  { value: 'id.sifa.defs#linkOther', label: 'Link' },\n];\n\nexport const PRESENTATION_LINK_TYPE_LABELS: Record<string, string> = Object.fromEntries(\n  PRESENTATION_LINK_TYPE_OPTIONS.map((o) => [o.value, o.label]),\n);\n\n/** Resolve a label for a presentation link-type token. Falls back to the raw value. */\nexport function getPresentationLinkTypeLabel(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return PRESENTATION_LINK_TYPE_LABELS[value] ?? value;\n}\n","/**\n * Display labels for `community.lexicon.calendar.event` mode and status tokens.\n * A presentation delivery stores the full upstream token (so it stays faithful\n * to the source event); these maps turn the token into a human label.\n */\n\nexport const CALENDAR_EVENT_MODE_LABELS: Record<string, string> = {\n  'community.lexicon.calendar.event#inperson': 'In person',\n  'community.lexicon.calendar.event#virtual': 'Virtual',\n  'community.lexicon.calendar.event#hybrid': 'Hybrid',\n};\n\n/** Resolve a label for a calendar-event mode token. Falls back to the raw value. */\nexport function getCalendarEventModeLabel(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return CALENDAR_EVENT_MODE_LABELS[value] ?? value;\n}\n\nexport const CALENDAR_EVENT_STATUS_LABELS: Record<string, string> = {\n  'community.lexicon.calendar.event#scheduled': 'Scheduled',\n  'community.lexicon.calendar.event#cancelled': 'Cancelled',\n  'community.lexicon.calendar.event#postponed': 'Postponed',\n  'community.lexicon.calendar.event#rescheduled': 'Rescheduled',\n  'community.lexicon.calendar.event#planned': 'Planned',\n};\n\n/** Resolve a label for a calendar-event status token. Falls back to the raw value. */\nexport function getCalendarEventStatusLabel(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return CALENDAR_EVENT_STATUS_LABELS[value] ?? value;\n}\n","/**\n * Involvement-kind taxonomy. Mirrors `id.sifa.defs#involvementKind.knownValues`\n * from sifa-lexicons. `label` is the picker/select label; `heading` is the\n * profile section heading a record of this kind renders under (charity records,\n * including mapped legacy `volunteering`, render under \"Volunteering\").\n */\n\nexport interface InvolvementKindOption {\n  value: string;\n  label: string;\n  heading: string;\n}\n\nexport const INVOLVEMENT_KIND_OPTIONS: InvolvementKindOption[] = [\n  { value: 'id.sifa.defs#involvementOpenSource', label: 'Open source', heading: 'Open Source' },\n  { value: 'id.sifa.defs#involvementCommunity', label: 'Community', heading: 'Community' },\n  { value: 'id.sifa.defs#involvementCharity', label: 'Volunteering', heading: 'Volunteering' },\n  { value: 'id.sifa.defs#involvementCivic', label: 'Civic', heading: 'Civic' },\n  { value: 'id.sifa.defs#involvementOther', label: 'Other', heading: 'Other' },\n];\n\nexport const INVOLVEMENT_KIND_LABELS: Record<string, string> = Object.fromEntries(\n  INVOLVEMENT_KIND_OPTIONS.map((o) => [o.value, o.label]),\n);\n\nexport const INVOLVEMENT_KIND_HEADINGS: Record<string, string> = Object.fromEntries(\n  INVOLVEMENT_KIND_OPTIONS.map((o) => [o.value, o.heading]),\n);\n\n/** Resolve the select label for an involvement-kind token. Falls back to the raw value. */\nexport function getInvolvementKindLabel(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return INVOLVEMENT_KIND_LABELS[value] ?? value;\n}\n\n/**\n * Resolve the display-section heading for an involvement-kind token. Unknown\n * kinds (including a future token an older client hasn't learned) fall under\n * \"Other\" so a record is never dropped from the profile.\n */\nexport function getInvolvementKindHeading(value: string | undefined | null): string {\n  if (!value) return 'Other';\n  return INVOLVEMENT_KIND_HEADINGS[value] ?? 'Other';\n}\n","/**\n * Artifact-link-kind taxonomy. Mirrors the bare-string `knownValues` of\n * `id.sifa.defs#artifactLink.kind` from sifa-lexicons. Open set: any string is\n * valid; these are the recognized kinds used to pick an icon and a default label.\n */\n\nexport interface ArtifactLinkKindOption {\n  value: string;\n  label: string;\n}\n\nexport const ARTIFACT_LINK_KIND_OPTIONS: ArtifactLinkKindOption[] = [\n  { value: 'pull-request', label: 'Pull request' },\n  { value: 'issue', label: 'Issue' },\n  { value: 'commit', label: 'Commit' },\n  { value: 'review', label: 'Review' },\n  { value: 'release', label: 'Release' },\n  { value: 'talk', label: 'Talk' },\n  { value: 'video', label: 'Video' },\n  { value: 'slides', label: 'Slides' },\n  { value: 'article', label: 'Article' },\n  { value: 'thread', label: 'Thread' },\n  { value: 'dataset', label: 'Dataset' },\n  { value: 'edit', label: 'Edit' },\n  { value: 'other', label: 'Link' },\n];\n\nexport const ARTIFACT_LINK_KIND_LABELS: Record<string, string> = Object.fromEntries(\n  ARTIFACT_LINK_KIND_OPTIONS.map((o) => [o.value, o.label]),\n);\n\n/** Resolve a label for an artifact-link-kind value. Falls back to the raw value. */\nexport function getArtifactLinkKindLabel(value: string | undefined | null): string | undefined {\n  if (!value) return undefined;\n  return ARTIFACT_LINK_KIND_LABELS[value] ?? value;\n}\n","/**\n * Verification providers -- the trust roots Sifa recognizes for AT Protocol\n * `app.bsky.graph.verification` records.\n *\n * Framing (see decisions/2026-07-13-third-party-verification-providers.md, D4):\n * a verification checkmark is ONE low-tier trust layer, not Sifa's headline.\n * Most of what it certifies is \"this account is who they claim to be\" -- useful,\n * and worth carrying because it's an already-recognized network signal, but low\n * value on its own. It sits among Sifa's other trust signals and never becomes a\n * score or a gate. This registry only decides which issuers Sifa displays and\n * with what provenance.\n *\n * Data-only: badge colors and icons are consumer concerns (React DOM on web,\n * React Native on mobile), same split as {@link PLATFORM_LABELS}. Consumers map\n * a provider id to a token/color.\n */\n\nexport type VerificationProviderId = 'bluesky' | 'mu';\n\n/** How Sifa learns about a provider's verifications. */\nexport type VerificationSource = 'bluesky-api' | 'firehose';\n\nexport interface VerificationProvider {\n  id: VerificationProviderId;\n  /** Human label for the badge popover, e.g. \"Bluesky\", \"mu (Eurosky)\". */\n  label: string;\n  /**\n   * Primary-display priority (D1): when an account holds verifications from\n   * multiple providers, the lowest number wins the single inline badge and the\n   * rest move into the popover. Must be unique across providers.\n   */\n  priority: number;\n  /**\n   * - `bluesky-api`: sourced from Bluesky's public-API `verifiedStatus`. Bluesky\n   *   maintains its own trusted-verifier set, so Sifa keeps no local DID list.\n   * - `firehose`: sourced from the Jetstream, gated on {@link verifierDids}.\n   */\n  source: VerificationSource;\n  /**\n   * Trusted verifier DIDs for firehose-sourced providers. A verification record\n   * counts only if its ISSUER DID is in this list. Empty for `bluesky-api`\n   * providers (Bluesky's AppView owns that decision). DIDs, not handles: a handle\n   * takeover must never confer verifier status.\n   */\n  verifierDids: readonly string[];\n}\n\n/**\n * A verification held by an account, as surfaced to the UI. `issuerDid` is\n * present for firehose-sourced providers and absent for `bluesky-api`.\n */\nexport interface AccountVerification {\n  provider: VerificationProviderId;\n  verifiedAt?: string | null;\n  issuerDid?: string | null;\n}\n\n/**\n * mu / Eurosky trusted verifiers (see https://hello.mu.social/verification).\n * Sifa-maintained allowlist -- this is the governance commitment. Add a DID here\n * only after confirming the organization is a mu trusted verifier. Handles are\n * comments for humans; the DID is what the firehose issuer gate matches.\n */\nconst MU_VERIFIER_DIDS = [\n  'did:plc:ooensn4mr5mhznzypvxelfa3', // eurosky.social -- coordinates the trusted-verifier program\n  'did:plc:durcipmx2rwgzzagbiumobs5', // france-atmosphe.re\n  'did:plc:zsf5p7rqilz2qvyd7ezmxrfj', // belgium-atmosphe.re\n  'did:plc:hd564mpf6bekrwzyhvujs54b', // medsky.network\n  'did:plc:u5zp7npt5kpueado77kuihyz', // npmx.dev\n  'did:plc:6tndl5lqrzjrx7ahjom2gjbq', // stewardshiplab.org\n  'did:plc:vnycpb2e4lh4tc7oyr3n2jvh', // newsmastfoundation.org\n  'did:plc:dsiqe4pszk5ldbjk66fyryjv', // cpesr.fr\n] as const;\n\nexport const VERIFICATION_PROVIDERS: Record<VerificationProviderId, VerificationProvider> = {\n  bluesky: {\n    id: 'bluesky',\n    label: 'Bluesky',\n    priority: 0,\n    source: 'bluesky-api',\n    verifierDids: [],\n  },\n  mu: {\n    id: 'mu',\n    label: 'mu (Eurosky)',\n    priority: 1,\n    source: 'firehose',\n    verifierDids: MU_VERIFIER_DIDS,\n  },\n};\n\nexport function isKnownVerificationProvider(id: string): id is VerificationProviderId {\n  // Object.hasOwn, not `in`: `in` also matches inherited Object.prototype keys\n  // ('toString', 'constructor', ...), which would wrongly narrow those strings\n  // and make getVerificationProvider return a prototype function.\n  return Object.hasOwn(VERIFICATION_PROVIDERS, id);\n}\n\nexport function getVerificationProvider(id: string): VerificationProvider | undefined {\n  return isKnownVerificationProvider(id) ? VERIFICATION_PROVIDERS[id] : undefined;\n}\n\n/**\n * The firehose issuer gate: given the DID that authored an\n * `app.bsky.graph.verification` record, return the provider it verifies for, or\n * `null` if the issuer is not a recognized firehose verifier. API-sourced\n * providers (Bluesky) are never matched here -- their verifications do not enter\n * through the firehose, so a self-issued record cannot resolve to them.\n */\nexport function resolveVerifierProvider(issuerDid: string): VerificationProviderId | null {\n  for (const provider of Object.values(VERIFICATION_PROVIDERS)) {\n    if (provider.source !== 'firehose') continue;\n    if (provider.verifierDids.includes(issuerDid)) return provider.id;\n  }\n  return null;\n}\n\n/**\n * D1 primary-provider selection: from all verifications an account holds, pick\n * the one whose provider has the highest priority (lowest `priority` number) for\n * the single inline badge. The rest belong in the popover. Verifications from\n * unknown providers are ignored. Returns `null` when nothing is displayable.\n */\nexport function primaryVerification(\n  verifications: readonly AccountVerification[],\n): AccountVerification | null {\n  let best: AccountVerification | null = null;\n  let bestPriority = Number.POSITIVE_INFINITY;\n  for (const verification of verifications) {\n    const provider = getVerificationProvider(verification.provider);\n    if (!provider) continue;\n    if (provider.priority < bestPriority) {\n      best = verification;\n      bestPriority = provider.priority;\n    }\n  }\n  return best;\n}\n","/**\n * Investment taxonomy. Mirrors `id.sifa.defs#investmentRole`, `#investmentStage`\n * and `#investmentStatus` from sifa-lexicons.\n *\n * These describe a capital position: money the person put in. Roles with duties --\n * board seats, advisory work -- are positions, not investments, and carry their own\n * `employmentType` values instead.\n */\n\nexport interface InvestmentOption {\n  value: string;\n  label: string;\n}\n\n/**\n * How the capital went in.\n *\n * General partner is deliberately absent. Running a fund is a role, recorded as an\n * `id.sifa.profile.position`, and offering it here would invite listing a fund's\n * entire portfolio as personal cheques. A partner's own commitment to their fund is\n * a `limitedPartner` entry naming that fund.\n */\nexport const INVESTMENT_ROLE_OPTIONS: InvestmentOption[] = [\n  { value: 'id.sifa.defs#angelInvestment', label: 'Angel' },\n  { value: 'id.sifa.defs#syndicateInvestment', label: 'Syndicate member' },\n  { value: 'id.sifa.defs#limitedPartner', label: 'Limited partner' },\n  { value: 'id.sifa.defs#otherInvestment', label: 'Other' },\n];\n\n/** The company's funding stage at the time of the investment, not its stage today. */\nexport const INVESTMENT_STAGE_OPTIONS: InvestmentOption[] = [\n  { value: 'id.sifa.defs#stagePreSeed', label: 'Pre-seed' },\n  { value: 'id.sifa.defs#stageSeed', label: 'Seed' },\n  { value: 'id.sifa.defs#stageSeriesA', label: 'Series A' },\n  { value: 'id.sifa.defs#stageSeriesB', label: 'Series B' },\n  { value: 'id.sifa.defs#stageSeriesCPlus', label: 'Series C or later' },\n  { value: 'id.sifa.defs#stageGrowth', label: 'Growth' },\n  { value: 'id.sifa.defs#stageSecondary', label: 'Secondary' },\n  { value: 'id.sifa.defs#stageOther', label: 'Other' },\n];\n\n/**\n * Where the position stands now. Recording a write-off is showing your work; nothing\n * in Sifa derives a hit rate or a return from these values.\n */\nexport const INVESTMENT_STATUS_OPTIONS: InvestmentOption[] = [\n  { value: 'id.sifa.defs#investmentActive', label: 'Active' },\n  { value: 'id.sifa.defs#investmentExited', label: 'Exited' },\n  { value: 'id.sifa.defs#investmentWrittenOff', label: 'Written off' },\n  { value: 'id.sifa.defs#investmentUndisclosed', label: 'Undisclosed' },\n];\n\nfunction toLabels(options: InvestmentOption[]): Record<string, string> {\n  return Object.fromEntries(options.map((o) => [o.value, o.label]));\n}\n\nexport const INVESTMENT_ROLE_LABELS: Record<string, string> = toLabels(INVESTMENT_ROLE_OPTIONS);\nexport const INVESTMENT_STAGE_LABELS: Record<string, string> = toLabels(INVESTMENT_STAGE_OPTIONS);\nexport const INVESTMENT_STATUS_LABELS: Record<string, string> = toLabels(INVESTMENT_STATUS_OPTIONS);\n\nfunction resolve(\n  labels: Record<string, string>,\n  value: string | undefined | null,\n): string | undefined {\n  if (!value) return undefined;\n  return labels[value] ?? value;\n}\n\n/** Resolve a label for an investment-role token. Falls back to the raw value. */\nexport function getInvestmentRoleLabel(value: string | undefined | null): string | undefined {\n  return resolve(INVESTMENT_ROLE_LABELS, value);\n}\n\n/** Resolve a label for an investment-stage token. Falls back to the raw value. */\nexport function getInvestmentStageLabel(value: string | undefined | null): string | undefined {\n  return resolve(INVESTMENT_STAGE_LABELS, value);\n}\n\n/** Resolve a label for an investment-status token. Falls back to the raw value. */\nexport function getInvestmentStatusLabel(value: string | undefined | null): string | undefined {\n  return resolve(INVESTMENT_STATUS_LABELS, value);\n}\n","// Connector words kept lowercase in a title unless they lead the name. Includes\n// a few common non-English ones (Dutch/German/French/Spanish) since the company\n// data is international.\nconst SMALL_WORDS = new Set([\n  'a',\n  'an',\n  'and',\n  'the',\n  'of',\n  'for',\n  'to',\n  'in',\n  'on',\n  'at',\n  'by',\n  'or',\n  'nor',\n  'but',\n  'as',\n  'vs',\n  'via',\n  'with',\n  'de',\n  'del',\n  'van',\n  'von',\n  'der',\n  'den',\n  'het',\n  'la',\n  'le',\n  'y',\n]);\n\n/**\n * True when `value` contains at least one letter outside the ASCII range\n * (accented Latin, Cyrillic, Greek, CJK, Turkish dotted/dotless i, etc).\n *\n * Iterating by code point (not `.length`) matters for astral-plane\n * characters (e.g. some CJK), which are represented as surrogate pairs.\n */\nexport function hasNonAsciiLetter(value: string): boolean {\n  for (const char of value) {\n    const codePoint = char.codePointAt(0) ?? 0;\n    if (codePoint > 0x7f && /\\p{L}/u.test(char)) return true;\n  }\n  return false;\n}\n\nfunction capitalizeWord(word: string): string {\n  // Uppercase the first letter/digit, leaving any leading punctuation\n  // (quotes, parens) and the rest of the word untouched.\n  return word.replace(\n    /^([^\\p{L}\\p{N}]*)(\\p{L})/u,\n    (_m, lead: string, ch: string) => lead + ch.toUpperCase(),\n  );\n}\n\n/**\n * Best-effort title-case for a company display name.\n *\n * Company names from the PDL crawl are stored all-lowercase (\"spryker\",\n * \"spryker systems gmbh\"), which reads poorly in the UI. This capitalizes them\n * for display. Names that already carry any uppercase (ROR / Wikidata, e.g.\n * \"University of Testing\" or \"IBM\") are assumed correctly cased and returned\n * unchanged, so a proper name is never mangled (\"University Of Testing\").\n *\n * It is intentionally not a canonicalizer: acronyms it can't know about stay\n * word-cased (\"gmbh\" -> \"Gmbh\"). The user's own custom display name is the\n * escape hatch when the heuristic is wrong.\n *\n * Scoped to ASCII-Latin case-bearing strings (decision D8): any name\n * containing a non-ASCII letter (accented Latin, Cyrillic, Greek, CJK,\n * Turkish dotted/dotless i, etc) is returned unchanged. Locale-dependent\n * casing rules (Turkish i/İ vs ı/I is the canonical trap) make naive\n * `toUpperCase`/`toLowerCase` unsafe outside ASCII, and this formatter has\n * no reliable way to pick the right locale for an arbitrary company name.\n *\n * Known limitation: this does not (and cannot) distinguish an intentional\n * all-lowercase ASCII wordmark (\"adidas\", \"thyssenkrupp\") from a\n * PDL-lowercased name that should be title-cased (\"spryker\" -> \"Spryker\").\n * Both are pure ASCII, so both still get title-cased. See sifa-workspace#235.\n */\nexport function formatCompanyName(name: string): string {\n  const trimmed = name.trim();\n  if (!trimmed || hasNonAsciiLetter(trimmed) || trimmed !== trimmed.toLowerCase()) return trimmed;\n\n  let seenWord = false;\n  // Split on whitespace but keep the separators so original spacing survives.\n  return trimmed\n    .split(/(\\s+)/)\n    .map((token) => {\n      if (token.length === 0 || /^\\s+$/.test(token)) return token;\n      const isFirst = !seenWord;\n      seenWord = true;\n      if (!isFirst && SMALL_WORDS.has(token)) return token;\n      return capitalizeWord(token);\n    })\n    .join('');\n}\n","import { hasNonAsciiLetter } from './company-name.js';\n\n/**\n * Canonical casing for common legal-form designators, keyed by the token with\n * its dots stripped and lowercased (`n.v.` and `nv` both key to `nv`). The value\n * is the canonical LETTER sequence only -- dots are re-applied from the input, so\n * `n.v.` -> `N.V.` and `nv` -> `NV` from the single `nv` entry.\n *\n * Deliberately conservative. Designators whose canonical casing genuinely\n * depends on the dot style (Italian `srl`/`S.r.l.`, `spa`/`S.p.A.`) are OMITTED\n * rather than guessed -- see the module doc on `normalizeLegalForm`. Multi-word\n * forms (`Sp. z o.o.`, `Pty Ltd`) are out of scope for this single-token pass.\n */\nconst CANONICAL_LEGAL_FORMS: Readonly<Record<string, string>> = {\n  llc: 'LLC',\n  inc: 'Inc',\n  ltd: 'Ltd',\n  ltda: 'Ltda',\n  corp: 'Corp',\n  co: 'Co',\n  plc: 'PLC',\n  llp: 'LLP',\n  lp: 'LP',\n  gmbh: 'GmbH',\n  ag: 'AG',\n  ab: 'AB',\n  as: 'AS',\n  aps: 'ApS',\n  oy: 'Oy',\n  oyj: 'Oyj',\n  nv: 'NV',\n  bv: 'BV',\n  sa: 'SA',\n  sas: 'SAS',\n  sarl: 'SARL',\n  kk: 'KK',\n  sl: 'SL',\n  pty: 'Pty',\n};\n\n/**\n * Re-apply `canonical`'s casing onto `token`, letter by letter, keeping every\n * non-letter character (the dots) exactly where the input had them. `token` is\n * guaranteed ASCII (the caller bailed on non-ASCII names) and its letter count\n * equals `canonical.length`, so the index never runs past the end.\n */\nfunction recase(token: string, canonical: string): string {\n  let li = 0;\n  let out = '';\n  for (const ch of token) {\n    if (/[A-Za-z]/.test(ch)) {\n      out += canonical.charAt(li);\n      li += 1;\n    } else {\n      out += ch;\n    }\n  }\n  return out;\n}\n\n/** Normalize one candidate token, or return it unchanged if it isn't a designator. */\nfunction normalizeToken(token: string): string {\n  // Strip dots only; a clean designator token is then a pure ASCII-letter run.\n  // A hyphen, comma, paren, or digit means it isn't a bare designator -> skip.\n  const letters = token.replace(/\\./g, '');\n  if (!/^[A-Za-z]+$/.test(letters)) return token;\n\n  const key = letters.toLowerCase();\n  const canonical = CANONICAL_LEGAL_FORMS[key];\n  // Require a string value, not merely truthy: a bare `map[key]` lookup resolves\n  // inherited Object.prototype members, so a token like \"Constructor\" (key\n  // `constructor`) or \"__proto__\" returns a function/object that is truthy but\n  // not a string, and `recase` would then throw on `.charAt`. This also narrows\n  // away the `undefined` from a missing key.\n  if (typeof canonical !== 'string') return token;\n\n  return recase(token, canonical);\n}\n\n/**\n * Normalize the letter-case of a legal-form designator (GmbH, LLC, N.V., B.V.,\n * S.A., ...) appearing as the trailing whole-word token of a company\n * name. Only that one token is touched; the company name itself is never\n * recased, since brand-wordmark casing is not deterministic (see\n * sifa-workspace#235, deliberately distinct from this pass).\n *\n * The input's dot and spacing style is preserved verbatim -- dotted vs undotted\n * (`N.V.` vs `NV`) is a style choice, so the function never adds, removes, or\n * reorders dots. It only maps `gmbh`/`Gmbh`/`GMBH` -> `GmbH`, `nv` -> `NV`,\n * `n.v.` -> `N.V.`, and so on.\n *\n * Scoped to ASCII-Latin (decision D8, matching `formatCompanyName`): any name\n * containing a non-ASCII letter is returned unchanged, because locale-dependent\n * casing (Turkish i/İ) makes naive upper/lower unsafe. Idempotent: normalizing\n * an already-correct name is a no-op.\n */\nexport function normalizeLegalForm(name: string): string {\n  if (!name || hasNonAsciiLetter(name)) return name;\n\n  // Split into words and whitespace runs, keeping the separators so the exact\n  // original spacing (including leading/trailing) survives the round-trip.\n  const parts = name.split(/(\\s+)/);\n  const wordIndices: number[] = [];\n  for (let i = 0; i < parts.length; i += 1) {\n    const part = parts[i];\n    if (part !== undefined && part.length > 0 && !/^\\s+$/.test(part)) wordIndices.push(i);\n  }\n  if (wordIndices.length === 0) return name;\n\n  const lastIdx = wordIndices[wordIndices.length - 1];\n  if (lastIdx === undefined) return name;\n  // Only the TRAILING token is a candidate. Legal-form designators almost always\n  // trail the company name (Acme GmbH, Halma PLC); a LEADING designator token is\n  // far more likely part of the brand (\"INC Research\", \"AG Innovations\"), so\n  // recasing it would corrupt the name. Restricting to the trailing token avoids\n  // that whole class of false positives.\n  const original = parts[lastIdx];\n  if (original === undefined) return name;\n  const rewritten = normalizeToken(original);\n  if (rewritten === original) return name;\n  parts[lastIdx] = rewritten;\n  return parts.join('');\n}\n","// Combining diacritical marks (U+0300-U+036F) produced by NFD decomposition.\n// Stripping these after decomposing is the standard way to fold \"é\" -> \"e\"\n// without a per-character lookup table.\nconst COMBINING_MARKS = /[\\u0300-\\u036f]/g;\n\n/**\n * Build a stable dedup/prefix key for a company name (decision D8).\n *\n * NFC-normalizes, case-folds, and strips Latin diacritics so that visually\n * or logically equivalent spellings collapse to one key: \"Nestlé\", \"Nestle\",\n * and \"NESTLE\" all produce the same value. Non-Latin scripts (Cyrillic, CJK,\n * etc) have no Latin diacritics to strip, so they pass through case-folded\n * and NFC-normalized only.\n *\n * This is a pure SDK helper for the in-memory/dedup key. Persisting it as a\n * dedicated column on the sifa-api side is tracked separately\n * (sifa-workspace#229) and out of scope here.\n */\nexport function normalizeCompanyKey(name: string): string {\n  const trimmed = name.trim();\n  if (!trimmed) return '';\n\n  const caseFolded = trimmed.normalize('NFC').toLowerCase();\n  return caseFolded.normalize('NFD').replace(COMBINING_MARKS, '').normalize('NFC');\n}\n","/**\n * Format a date string as a relative time (e.g. \"5m ago\", \"3d ago\").\n * Returns an empty string for invalid or future dates.\n */\nexport function formatRelativeTime(dateString: string): string {\n  const date = new Date(dateString);\n  if (isNaN(date.getTime())) return '';\n\n  const now = Date.now();\n  const diffMs = now - date.getTime();\n  if (diffMs < 0) return '';\n\n  const seconds = Math.floor(diffMs / 1000);\n  if (seconds < 60) return `${seconds}s ago`;\n\n  const minutes = Math.floor(seconds / 60);\n  if (minutes < 60) return `${minutes}m ago`;\n\n  const hours = Math.floor(minutes / 60);\n  if (hours < 24) return `${hours}h ago`;\n\n  const days = Math.floor(hours / 24);\n  if (days < 30) return `${days}d ago`;\n\n  const months = Math.floor(days / 30);\n  if (months < 12) return `${months}mo ago`;\n\n  const years = Math.floor(months / 12);\n  return `${years}y ago`;\n}\n","import type { PresentationDuration } from '../schemas/profile-presentation.js';\n\n/**\n * Format a presentation duration for display. A fixed length renders as\n * \"30 min\"; a range renders as \"20-30 min\". Returns undefined when there is no\n * duration. A range whose bounds are equal, or whose max is missing, renders as\n * a single value.\n */\nexport function formatPresentationDuration(\n  duration: PresentationDuration | undefined | null,\n): string | undefined {\n  if (!duration) return undefined;\n  const { minMinutes, maxMinutes } = duration;\n  if (maxMinutes != null && maxMinutes !== minMinutes) {\n    return `${minMinutes}-${maxMinutes} min`;\n  }\n  return `${minMinutes} min`;\n}\n","/**\n * Server-safe timeline date formatters shared by every profile surface.\n */\n\nconst MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\n/** Format \"2007-01\" as \"Jan 2007\", pass through year-only strings. */\nexport function formatTimelineDate(dateStr: string): string {\n  if (dateStr.length === 4) return dateStr;\n  const [year, month] = dateStr.split('-');\n  if (!month) return year ?? dateStr;\n  const idx = parseInt(month, 10) - 1;\n  return `${MONTHS[idx]} ${year}`;\n}\n\n/**\n * Format a date range for display. Handles missing dates, equal start/end,\n * and ongoing entries (showPresent defaults to true).\n */\nexport function formatDateRange(start?: string, end?: string, showPresent = true): string {\n  if (!start && !end) return '';\n  if (!start) return end ? formatTimelineDate(end) : '';\n  const formattedStart = formatTimelineDate(start);\n  if (!end) return showPresent ? `${formattedStart} - Present` : formattedStart;\n  const formattedEnd = formatTimelineDate(end);\n  if (formattedStart === formattedEnd) return formattedStart;\n  return `${formattedStart} - ${formattedEnd}`;\n}\n","import type { ProfilePresentationDelivery } from '../types/index.js';\n\nconst CANCELLED_STATUS = 'community.lexicon.calendar.event#cancelled';\nconst KEYNOTE_ROLE = 'id.sifa.defs#keynote';\n\n/** A compact roll-up of a presentation's deliveries for the collapsed view. */\nexport interface PresentationDeliverySummary {\n  /** Times the talk was actually delivered (cancelled occasions excluded). */\n  count: number;\n  /** Most recent year among counted deliveries that carry a date. */\n  recentYear?: number;\n  /** How many counted deliveries were keynotes. */\n  keynoteCount: number;\n  /** Up to `venueLimit` distinct event names, most-recent first. */\n  venues: string[];\n  /** Distinct counted venues beyond the ones listed in `venues`. */\n  moreVenues: number;\n}\n\n/**\n * Summarize a talk's delivery history into the signals the profile shows in the\n * collapsed view: how many times it was given, the most recent year, how many\n * were keynotes, and a small sample of the most recent distinct venues.\n *\n * Cancelled occasions are excluded from every figure: a talk that was booked\n * then cancelled was not actually delivered, and counting it would inflate the\n * \"given Nx\" signal.\n */\nexport function summarizePresentationDeliveries(\n  deliveries: ProfilePresentationDelivery[] | undefined,\n  options: { venueLimit?: number } = {},\n): PresentationDeliverySummary {\n  const venueLimit = options.venueLimit ?? 3;\n  const counted = (deliveries ?? []).filter((delivery) => delivery.status !== CANCELLED_STATUS);\n  const sorted = [...counted].sort((a, b) => (b.date ?? '').localeCompare(a.date ?? ''));\n\n  let recentYear: number | undefined;\n  for (const delivery of counted) {\n    if (!delivery.date) continue;\n    const year = Number(delivery.date.slice(0, 4));\n    if (!Number.isNaN(year) && (recentYear === undefined || year > recentYear)) {\n      recentYear = year;\n    }\n  }\n\n  const seen = new Set<string>();\n  const distinctVenues: string[] = [];\n  for (const delivery of sorted) {\n    const name = delivery.eventName?.trim();\n    if (name && !seen.has(name)) {\n      seen.add(name);\n      distinctVenues.push(name);\n    }\n  }\n  const venues = distinctVenues.slice(0, venueLimit);\n\n  return {\n    count: counted.length,\n    recentYear,\n    keynoteCount: counted.filter((delivery) => delivery.role === KEYNOTE_ROLE).length,\n    venues,\n    moreVenues: distinctVenues.length - venues.length,\n  };\n}\n","/**\n * Sort profile section items from newest to oldest.\n *\n * Rules:\n * - Items with no end date (ongoing/current) sort to the top.\n * - Primary sort: end date descending (newest first).\n * - Secondary sort: start date descending (newest first).\n * - Items with no dates sort to the bottom.\n *\n * Date strings are ISO-ish (\"2024\", \"2024-03\", \"2024-03-15\") and\n * lexicographic comparison works correctly for them.\n */\n\ninterface DateRange {\n  startDate?: string;\n  endDate?: string;\n  current?: boolean;\n}\n\ntype DateExtractor<T> = (item: T) => DateRange;\n\nconst FAR_FUTURE = '9999-12-31';\nconst FAR_PAST = '0000-01-01';\n\nexport function sortByDateDesc<T>(items: T[], extract: DateExtractor<T>): T[] {\n  return [...items].sort((a, b) => {\n    const da = extract(a);\n    const db = extract(b);\n\n    const endA = da.current ? FAR_FUTURE : (da.endDate ?? '');\n    const endB = db.current ? FAR_FUTURE : (db.endDate ?? '');\n\n    // Items with any date beat items with no dates at all\n    const hasDateA = endA || da.startDate;\n    const hasDateB = endB || db.startDate;\n    if (hasDateA && !hasDateB) return -1;\n    if (!hasDateA && hasDateB) return 1;\n\n    // Primary: end date descending\n    if (endA !== endB) return endB.localeCompare(endA);\n\n    // Secondary: start date descending\n    const startA = da.startDate ?? FAR_PAST;\n    const startB = db.startDate ?? FAR_PAST;\n    return startB.localeCompare(startA);\n  });\n}\n\n/**\n * Convenience extractor for items that use `startDate` / `endDate` fields directly.\n * Used by volunteering, projects, and other sections that still use startDate/endDate.\n */\nexport function dateRangeExtractor<\n  T extends { startDate?: string; endDate?: string; current?: boolean },\n>(item: T): DateRange {\n  return { startDate: item.startDate, endDate: item.endDate, current: item.current };\n}\n\n/**\n * Extractor for lexicon-aligned items that use `startedAt` / `endedAt` fields.\n * Used by positions and education (current derived from !endedAt).\n */\nexport function lexiconDateExtractor<T extends { startedAt?: string; endedAt?: string }>(\n  item: T,\n): DateRange {\n  return { startDate: item.startedAt, endDate: item.endedAt, current: !item.endedAt };\n}\n\n/**\n * Convenience extractor for items with a single `date` field.\n */\nexport function singleDateExtractor<T extends { date?: string }>(item: T): DateRange {\n  return { endDate: item.date };\n}\n\n/**\n * Extractor for certifications which use `issueDate` / `expiryDate`.\n */\nexport function certDateExtractor<T extends { issueDate?: string; expiryDate?: string }>(\n  item: T,\n): DateRange {\n  return { startDate: item.issueDate, endDate: item.expiryDate ?? item.issueDate };\n}\n","/**\n * Reduce a DOI to its bare form: `10.1234/example`, never\n * `https://doi.org/10.1234/example` and never `doi:10.1234/example`.\n *\n * A DOI inside a URL is a link. Bare, it is an identifier, which is what lets\n * two records describing one publication be matched on it. The lexicon stores\n * the bare form for that reason.\n *\n * People paste the resolver URL, because that is what a publisher page and a\n * citation manager both hand you, and citations carry the `doi:` scheme.\n * Normalizing on the way in is the difference between a field that dedupes and\n * a field holding three spellings of one value.\n *\n * Input that is not a DOI at all is trimmed and returned as-is. This is a\n * normalizer, not a validator: rejecting here would fail a write over a field\n * nothing depends on, and older registrants produce shapes worth not policing.\n */\nexport function normalizeDoi(value: string): string {\n  return value\n    .trim()\n    .replace(/^https?:\\/\\/(dx\\.)?doi\\.org\\//i, '')\n    .replace(/^doi:\\s*/i, '');\n}\n","/**\n * Sanitize raw user input into a valid AT Protocol identifier (handle or DID).\n *\n * Handles common mistakes:\n * - Pasting a full Bluesky profile URL\n * - Pasting a raw HTTPS URL to a PDS domain\n * - Using an at:// URI\n * - Prefixing with @\n * - Entering a bare username without .bsky.social\n */\nexport function sanitizeHandleInput(raw: string): string {\n  let identifier = raw\n    .trim()\n    .replace(/^https?:\\/\\/bsky\\.app\\/profile\\//i, '')\n    .replace(/^at:\\/\\//i, '')\n    .replace(/^@/, '')\n    .replace(/^https?:\\/\\//i, '');\n  if (!identifier.startsWith('did:')) {\n    identifier = identifier.split('/')[0] ?? identifier;\n  }\n  identifier = identifier.replace(/\\.$/, '');\n  if (!identifier.startsWith('did:')) {\n    identifier = identifier.toLowerCase();\n  }\n\n  // Auto-append .bsky.social for bare usernames (no dots, not a DID)\n  if (identifier && !identifier.startsWith('did:') && !identifier.includes('.')) {\n    identifier = `${identifier}.bsky.social`;\n  }\n\n  return identifier;\n}\n","import type { LocationValue } from '../types/index.js';\n\n/**\n * Format a LocationValue for display.\n *\n * Prefers `locality` (the community.lexicon.location.address field) and\n * falls back to the legacy `city` slot so values produced before the\n * sifa-api alias migration still render correctly during the additive\n * transition window.\n */\nexport function formatLocation(loc: LocationValue | null | undefined): string {\n  if (!loc) return '';\n  const locality = loc.locality ?? loc.city;\n  const parts = [locality, loc.region, loc.country].filter(Boolean);\n  if (loc.postalCode && !locality) {\n    return `${loc.postalCode}, ${loc.country}`;\n  }\n  return parts.join(', ');\n}\n\n/** Parse a display string back into a LocationValue (best-effort for legacy data) */\nexport function parseLocationString(str: string): LocationValue | null {\n  if (!str.trim()) return null;\n  const parts = str\n    .split(',')\n    .map((p) => p.trim())\n    .filter(Boolean);\n  if (parts.length >= 3) {\n    return {\n      city: parts[0],\n      region: parts[1],\n      country: parts[parts.length - 1]!,\n    };\n  }\n  if (parts.length === 2) {\n    return {\n      city: parts[0],\n      country: parts[1]!,\n    };\n  }\n  return { country: parts[0]! };\n}\n\n/** Convert ISO 3166-1 alpha-2 country code to flag emoji */\nexport function countryCodeToFlag(code: string | undefined): string {\n  if (!code || code.length !== 2) return '';\n  const upper = code.toUpperCase();\n  const a = upper.codePointAt(0);\n  const b = upper.codePointAt(1);\n  if (a === undefined || b === undefined) return '';\n  return String.fromCodePoint(a - 0x41 + 0x1f1e6, b - 0x41 + 0x1f1e6);\n}\n","import type { LocationValue } from '../types/index.js';\n\nexport type LocationSegmentKind = 'locality' | 'region' | 'country';\n\nexport interface LocationSegment {\n  kind: LocationSegmentKind;\n  /** Text to render for this segment. */\n  label: string;\n  /** Search URL for this segment, or null when it should render as plain text. */\n  searchHref: string | null;\n}\n\nexport interface LocationSegmentsOptions {\n  /**\n   * Whether the country is one the search index can filter on. Profiles\n   * imported from LinkedIn sometimes hold a metro area (\"Greater Bielefeld\n   * Area\") in the country field; linking one promises a result set that does\n   * not exist, so those render as plain text. Defaults to true.\n   */\n  searchable?: boolean;\n}\n\nfunction clean(value: string | undefined): string | null {\n  const trimmed = value?.trim();\n  return trimmed ? trimmed : null;\n}\n\n/**\n * Split a location into the ordered segments shown on a profile, marking which\n * ones link to a search.\n *\n * Only the country links today. Region is the weakest of the three (free text,\n * no search filter) and locality has no filter yet, so both render as plain\n * text until those land.\n *\n * A segment equal to its neighbour is dropped: capital regions produce\n * \"Oslo, Oslo, Norway\", and repeating the word helps nobody. Blank segments are\n * dropped with their separator so nothing renders as \"Oslo, , Norway\".\n */\nexport function locationSegments(\n  loc: LocationValue | null | undefined,\n  options: LocationSegmentsOptions = {},\n): LocationSegment[] {\n  if (!loc) return [];\n\n  const ordered: Array<{ kind: LocationSegmentKind; value: string | null }> = [\n    { kind: 'locality', value: clean(loc.locality ?? loc.city) },\n    { kind: 'region', value: clean(loc.region) },\n    { kind: 'country', value: clean(loc.country) },\n  ];\n\n  const segments: LocationSegment[] = [];\n  for (const { kind, value } of ordered) {\n    if (value === null) continue;\n    const previous = segments[segments.length - 1];\n    if (previous && previous.label.toLowerCase() === value.toLowerCase()) continue;\n\n    segments.push({\n      kind,\n      label: value,\n      searchHref:\n        kind === 'country' && options.searchable !== false\n          ? `/search?${new URLSearchParams({ country: value }).toString()}`\n          : null,\n    });\n  }\n\n  return segments;\n}\n","import type { PdsProviderInfo } from '../types/index.js';\n\nexport interface PdsProvider {\n  name: string;\n  profileUrl: string;\n  host?: string;\n}\n\nconst BSKY_PROFILE_BASE = 'https://bsky.app/profile/';\n\nconst PDS_PROVIDERS: { suffix: string; name: string }[] = [\n  { suffix: '.bsky.social', name: 'bluesky' },\n  { suffix: '.blacksky.app', name: 'blacksky' },\n  { suffix: '.eurosky.social', name: 'eurosky' },\n  { suffix: '.northsky.social', name: 'northsky' },\n];\n\nconst KNOWN_PROVIDER_NAMES = new Set(PDS_PROVIDERS.map((p) => p.name));\n\nconst ICON_ONLY_PROVIDERS = new Set(['selfhosted-social', 'selfhosted']);\n\nexport function pdsProviderFromApi(\n  apiProvider: PdsProviderInfo | null | undefined,\n  handle: string,\n): PdsProvider | null {\n  if (!apiProvider) return null;\n  if (ICON_ONLY_PROVIDERS.has(apiProvider.name)) {\n    return { name: apiProvider.name, profileUrl: '', host: apiProvider.host };\n  }\n  if (!KNOWN_PROVIDER_NAMES.has(apiProvider.name)) return null;\n  return {\n    name: apiProvider.name,\n    profileUrl: `${BSKY_PROFILE_BASE}${handle}`,\n    host: apiProvider.host,\n  };\n}\n\nexport function getHandleStem(handle: string): string {\n  const lower = handle.toLowerCase();\n  for (const provider of PDS_PROVIDERS) {\n    if (lower.endsWith(provider.suffix) && lower.length > provider.suffix.length) {\n      return handle.slice(0, -provider.suffix.length);\n    }\n  }\n  return handle;\n}\n\nexport function getDisplayLabel(displayName: string | undefined, handle: string): string {\n  if (displayName) return displayName;\n  return getHandleStem(handle);\n}\n\n/**\n * Combine optional structured name fields (`id.sifa.profile.self.givenName`,\n * `familyName`) into a single string in Schema.org `Person` order — given\n * before family. Returns `undefined` when both are absent so callers can\n * fall back to `displayName`. Whitespace-only inputs are treated as absent.\n * Does not impose cultural ordering: users whose preferred presentation\n * differs (e.g. Eastern name order) should set `displayName` accordingly,\n * which this helper deliberately does not consult.\n */\nexport function formatStructuredName(\n  givenName: string | undefined,\n  familyName: string | undefined,\n): string | undefined {\n  const given = givenName?.trim();\n  const family = familyName?.trim();\n  if (given && family) return `${given} ${family}`;\n  return given || family || undefined;\n}\n\nconst PDS_DISPLAY_NAMES: Record<string, string> = {\n  bluesky: 'Bluesky',\n  blacksky: 'BlackSky',\n  eurosky: 'EuroSky',\n  northsky: 'NorthSky',\n  'selfhosted-social': 'Self-hosted',\n  selfhosted: 'Self-hosted',\n};\n\nexport function getPdsDisplayName(providerName: string): string {\n  return PDS_DISPLAY_NAMES[providerName] ?? providerName;\n}\n\nexport function detectPdsProvider(handle: string): PdsProvider | null {\n  const lower = handle.toLowerCase();\n  for (const provider of PDS_PROVIDERS) {\n    if (lower.endsWith(provider.suffix)) {\n      return {\n        name: provider.name,\n        profileUrl: `${BSKY_PROFILE_BASE}${handle}`,\n      };\n    }\n  }\n  return null;\n}\n","/**\n * Resolve a slide / video URL to an embed descriptor. Pure and offline.\n *\n * Three outcomes:\n * - `iframe`: the URL carries everything an embed needs, so the iframe `src` is\n *   known offline (YouTube, Vimeo, Google Slides, Loom, Canva).\n * - `oembed`: the URL is a known embeddable provider whose iframe `src` is NOT\n *   in the URL and needs a server-side oEmbed lookup (SlideShare, SpeakerDeck\n *   public deck URLs). The caller resolves the src via its own oEmbed step.\n * - `link`: not embeddable; render a plain link.\n */\n\n/**\n * A resolved embed: an iframe whose src is known offline, an `oembed` provider\n * whose src needs a server lookup (carries the original page URL), or a plain\n * link.\n */\nexport type EmbedResult =\n  | { kind: 'iframe'; provider: string; src: string; aspectRatio: '16:9' | '4:3' }\n  | { kind: 'oembed'; provider: string; aspectRatio: '16:9' | '4:3'; pageUrl: string }\n  | { kind: 'link' };\n\nconst LINK: EmbedResult = { kind: 'link' };\n\n/** YouTube video IDs: 11 chars in practice, but accept the documented charset. */\nconst YOUTUBE_ID = /^[A-Za-z0-9_-]{6,}$/;\n\n/**\n * Extract a YouTube video id from any recognized YouTube URL (`youtu.be/ID`,\n * `youtube.com/watch?v=ID`, `/embed/ID`, `/shorts/ID`), or null. Pure/offline.\n */\nexport function youtubeVideoId(url: string): string | null {\n  let parsed: URL;\n  try {\n    parsed = new URL(url);\n  } catch {\n    return null;\n  }\n  if (parsed.protocol !== 'https:') return null;\n  const host = bareHost(parsed.hostname);\n  const segments = parsed.pathname.split('/').filter(Boolean);\n  let id: string | null = null;\n  if (host === 'youtu.be') id = segments[0] ?? null;\n  else if (host === 'youtube.com' || host === 'm.youtube.com') {\n    if (parsed.pathname === '/watch') id = parsed.searchParams.get('v');\n    else if (segments[0] === 'embed' || segments[0] === 'shorts') id = segments[1] ?? null;\n  }\n  return id && YOUTUBE_ID.test(id) ? id : null;\n}\n\n/**\n * The public thumbnail URL for a YouTube video id (`i.ytimg.com`). Derivable\n * offline. NOTE: this host is Google — never load it directly in a privacy\n * context; fetch and re-serve it from your own origin.\n */\nexport function youtubeThumbnailUrl(videoId: string): string {\n  return `https://i.ytimg.com/vi/${videoId}/hqdefault.jpg`;\n}\n\n/** Strip a leading `www.` so host matching is scheme/subdomain tolerant. */\nfunction bareHost(hostname: string): string {\n  return hostname.toLowerCase().replace(/^www\\./, '');\n}\n\n/**\n * Recognize an embeddable URL and return its iframe descriptor, else a link.\n * Only https URLs are accepted.\n */\nexport function resolveEmbed(url: string): EmbedResult {\n  let parsed: URL;\n  try {\n    parsed = new URL(url);\n  } catch {\n    return LINK;\n  }\n  if (parsed.protocol !== 'https:') return LINK;\n\n  const host = bareHost(parsed.hostname);\n  const segments = parsed.pathname.split('/').filter(Boolean);\n\n  // --- YouTube -> privacy-enhanced nocookie embed ---\n  if (host === 'youtu.be' || host === 'youtube.com' || host === 'm.youtube.com') {\n    const id = youtubeVideoId(url);\n    return id ? youtubeEmbed(id) : LINK;\n  }\n\n  // --- Vimeo ---\n  if (host === 'vimeo.com') {\n    const id = segments[0];\n    if (id && /^\\d+$/.test(id)) {\n      return {\n        kind: 'iframe',\n        provider: 'vimeo',\n        src: `https://player.vimeo.com/video/${id}`,\n        aspectRatio: '16:9',\n      };\n    }\n    return LINK;\n  }\n  if (host === 'player.vimeo.com') {\n    if (segments[0] === 'video' && segments[1] && /^\\d+$/.test(segments[1])) {\n      return {\n        kind: 'iframe',\n        provider: 'vimeo',\n        src: `https://player.vimeo.com/video/${segments[1]}`,\n        aspectRatio: '16:9',\n      };\n    }\n    return LINK;\n  }\n\n  // --- SpeakerDeck ---\n  // An already-resolved `speakerdeck.com/player/HEXID` embed URL is embeddable\n  // offline. A public `speakerdeck.com/USER/SLUG` deck URL needs a server oEmbed\n  // lookup for the data-id, so it is `oembed`, not a dead link.\n  if (host === 'speakerdeck.com') {\n    if (segments[0] === 'player' && segments[1]) {\n      return { kind: 'iframe', provider: 'speakerdeck', src: parsed.href, aspectRatio: '4:3' };\n    }\n    if (segments.length >= 2) {\n      return { kind: 'oembed', provider: 'speakerdeck', aspectRatio: '4:3', pageUrl: parsed.href };\n    }\n    return LINK;\n  }\n\n  // --- SlideShare ---\n  // An already-resolved `slideshow/embed_code/...` URL is embeddable offline. A\n  // public deck URL needs a server oEmbed lookup for the embed_code id, so it is\n  // `oembed`.\n  if (host === 'slideshare.net') {\n    if (segments[0] === 'slideshow' && segments[1] === 'embed_code') {\n      return { kind: 'iframe', provider: 'slideshare', src: parsed.href, aspectRatio: '4:3' };\n    }\n    if (segments.length >= 2) {\n      return { kind: 'oembed', provider: 'slideshare', aspectRatio: '4:3', pageUrl: parsed.href };\n    }\n    return LINK;\n  }\n\n  // --- Google Slides ---\n  if (host === 'docs.google.com') {\n    if (segments[0] === 'presentation' && segments[1] === 'd' && segments[2]) {\n      return {\n        kind: 'iframe',\n        provider: 'googleslides',\n        src: `https://docs.google.com/presentation/d/${segments[2]}/embed`,\n        aspectRatio: '16:9',\n      };\n    }\n    return LINK;\n  }\n\n  // --- Loom ---\n  if (host === 'loom.com') {\n    if (segments[0] === 'share' && segments[1]) {\n      return {\n        kind: 'iframe',\n        provider: 'loom',\n        src: `https://www.loom.com/embed/${segments[1]}`,\n        aspectRatio: '16:9',\n      };\n    }\n    return LINK;\n  }\n\n  // --- Canva ---\n  if (host === 'canva.com') {\n    if (segments[0] === 'design' && segments[1] && segments[2] === 'view') {\n      return {\n        kind: 'iframe',\n        provider: 'canva',\n        src: `https://www.canva.com/design/${segments[1]}/view?embed`,\n        aspectRatio: '16:9',\n      };\n    }\n    return LINK;\n  }\n\n  return LINK;\n}\n\nfunction youtubeEmbed(id: string): EmbedResult {\n  return {\n    kind: 'iframe',\n    provider: 'youtube',\n    src: `https://www.youtube-nocookie.com/embed/${id}`,\n    aspectRatio: '16:9',\n  };\n}\n","/**\n * Slug helpers for talk-page URLs. Pure and offline: a talk page lives at a\n * path like `/{slug}-{rkey}`, where the slug is a human-readable, SEO-friendly\n * rendering of the title and the rkey is the record's stable identifier.\n * Because TIDs never contain a `-`, the rkey can always be recovered as the\n * substring after the final `-`.\n */\n\n/** Maximum slug length before the trailing rkey is appended. */\nconst MAX_SLUG_LENGTH = 60;\n\n/** Combining diacritical marks left behind by NFKD decomposition (U+0300–U+036F). */\nconst COMBINING_MARKS = /[̀-ͯ]/g;\n\n/**\n * Render a title as a URL slug: lowercased, diacritics stripped, runs of\n * non-alphanumerics collapsed to a single `-`, trimmed, and capped at 60 chars.\n * Returns `''` for an empty or whitespace-only title.\n */\nexport function slugifyTitle(title: string): string {\n  const slug = title\n    .normalize('NFKD')\n    // Strip combining marks left by NFKD decomposition (é -> e).\n    .replace(COMBINING_MARKS, '')\n    .toLowerCase()\n    // Collapse any run of non-alphanumerics into a single hyphen.\n    .replace(/[^a-z0-9]+/g, '-')\n    // Collapse repeated hyphens.\n    .replace(/-+/g, '-')\n    // Trim leading/trailing hyphens.\n    .replace(/^-+|-+$/g, '');\n  // Cap length, then trim a trailing hyphen the cut may have exposed.\n  return slug.slice(0, MAX_SLUG_LENGTH).replace(/-+$/g, '');\n}\n\n/**\n * Build the talk-page path segment `${slug}-${rkey}`, or just `rkey` when the\n * title produces an empty slug.\n */\nexport function buildTalkSlug(title: string, rkey: string): string {\n  const slug = slugifyTitle(title);\n  return slug ? `${slug}-${rkey}` : rkey;\n}\n\n/**\n * Recover the rkey from a talk-page segment: the substring after the final `-`\n * (TIDs contain no `-`). Returns the whole segment when there is no `-`.\n */\nexport function parseTalkRkey(segment: string): string {\n  const idx = segment.lastIndexOf('-');\n  return idx === -1 ? segment : segment.slice(idx + 1);\n}\n","/**\n * Canonical rule for picking the \"primary\" position to surface on profile cards,\n * social previews, and structured-data outputs.\n *\n * Without this shared helper, different surfaces (visible hero, OG image,\n * <meta description>, JSON-LD) re-derived \"primary\" inconsistently and diverged\n * for users with multiple concurrent roles.\n *\n * A `hidden` position is one the user chose not to show on their public profile.\n * It is never surfaced as the featured role — hidden wins over `primary`, so a\n * role flagged both hidden and primary is excluded rather than featured.\n *\n * Rules (in order):\n * 1. A position the user explicitly flagged `primary` AND that is still active AND not hidden.\n * 2. Otherwise, the active, non-hidden position with the most recent `startedAt`.\n * 3. Otherwise, undefined (no eligible position).\n */\n\nexport interface PrimaryPositionCandidate {\n  startedAt?: string;\n  endedAt?: string;\n  primary?: boolean;\n  hidden?: boolean;\n}\n\nexport function pickPrimaryPosition<T extends PrimaryPositionCandidate>(\n  positions: readonly T[] | undefined,\n): T | undefined {\n  if (!positions || positions.length === 0) return undefined;\n\n  const active = positions.filter((p) => !p.endedAt && !p.hidden);\n  if (active.length === 0) return undefined;\n\n  const flagged = active.find((p) => p.primary === true);\n  if (flagged) return flagged;\n\n  return [...active].sort((a, b) => (b.startedAt ?? '').localeCompare(a.startedAt ?? ''))[0];\n}\n","/**\n * Profiles carry both a freeform `headline` and a derived current-role line\n * (\"{title} at {company}\"). Most people write a headline distinct from their\n * job title, so both add information. But LinkedIn imports default the headline\n * to \"Title at Company\" -- which collides with the derived role line and renders\n * the same text twice (a doubled tagline).\n *\n * This predicate lets each surface (profile header, meta description, embed card)\n * suppress the role line when it merely repeats the headline. Callers compose the\n * role line themselves -- including any localized connector word (\"at\") -- and ask\n * whether it duplicates the headline. Comparison is case-, whitespace-, and\n * trailing-punctuation-insensitive; a headline that adds anything beyond the role\n * line is not treated as redundant.\n */\nfunction normalize(value: string): string {\n  return value\n    .trim()\n    .replace(/\\s+/g, ' ')\n    .replace(/[.,;:·|]+$/, '')\n    .trim()\n    .toLowerCase();\n}\n\nexport function isRoleLineRedundant(\n  headline: string | null | undefined,\n  roleLine: string | null | undefined,\n): boolean {\n  if (!headline || !roleLine) return false;\n  return normalize(headline) === normalize(roleLine);\n}\n","/**\n * Shared, single-source-of-truth model for which profile sections render, in\n * what order, their nav grouping, and which items a given viewer may see.\n *\n * Every Sifa profile surface builds on this: the HTML profile page, the\n * Markdown / DOCX / print exports, and the standalone personal-site renderer.\n * Adding a section to {@link ALL_SECTIONS} makes it appear everywhere (the\n * exports drive presence + order from here, and {@link SECTION_LABELS} is an\n * exhaustive `Record<SectionId, string>`, so a new id is a compile error until\n * it has a label).\n *\n * The per-section sorts live in `./section-sorts.js`, built on the same SDK\n * date extractors the HTML section components use, so the surfaces cannot\n * diverge on ordering.\n */\n\nimport type { Profile } from '../types/index.js';\n\n/**\n * Side-nav groups, in display order. Each labels a contiguous run of sections\n * in {@link ALL_SECTIONS}. `labelKey` resolves against the consumer's `sections`\n * i18n namespace.\n */\nexport const SECTION_GROUPS = [\n  { id: 'overview', labelKey: 'groupOverview' },\n  { id: 'experience', labelKey: 'groupExperience' },\n  { id: 'qualifications', labelKey: 'groupQualifications' },\n  { id: 'more', labelKey: 'groupMore' },\n] as const;\n\nexport type SectionGroupId = (typeof SECTION_GROUPS)[number]['id'];\n\n/**\n * Profile body sections in render + nav order (evidence-first): identity and\n * activity lead, then living work (career, skills, projects, talks,\n * publications), then the formal record (credentials, education, courses), then\n * the rest. `ns` selects the consumer's i18n namespace for `labelKey`; `group`\n * ties the section to a {@link SECTION_GROUPS} header.\n */\nexport const ALL_SECTIONS = [\n  { id: 'about', labelKey: 'about', ns: 'profile' as const, group: 'overview' as const },\n  { id: 'career', labelKey: 'career', ns: 'sections' as const, group: 'experience' as const },\n  { id: 'skills', labelKey: 'skills', ns: 'sections' as const, group: 'experience' as const },\n  { id: 'projects', labelKey: 'projects', ns: 'sections' as const, group: 'experience' as const },\n  {\n    id: 'presentations',\n    labelKey: 'talksAndSessions',\n    ns: 'sections' as const,\n    group: 'experience' as const,\n  },\n  {\n    id: 'publications',\n    labelKey: 'publications',\n    ns: 'sections' as const,\n    group: 'experience' as const,\n  },\n  {\n    id: 'credentials',\n    labelKey: 'credentials',\n    ns: 'sections' as const,\n    group: 'qualifications' as const,\n  },\n  {\n    id: 'education',\n    labelKey: 'education',\n    ns: 'sections' as const,\n    group: 'qualifications' as const,\n  },\n  { id: 'courses', labelKey: 'courses', ns: 'sections' as const, group: 'qualifications' as const },\n  { id: 'awards', labelKey: 'awards', ns: 'sections' as const, group: 'more' as const },\n  { id: 'involvement', labelKey: 'involvement', ns: 'sections' as const, group: 'more' as const },\n  // Its own section rather than a group under involvement: that record is about\n  // work contributed, this one about capital deployed.\n  { id: 'investments', labelKey: 'investments', ns: 'sections' as const, group: 'more' as const },\n  { id: 'languages', labelKey: 'languages', ns: 'sections' as const, group: 'more' as const },\n  {\n    id: 'other-profiles',\n    labelKey: 'otherProfiles',\n    ns: 'sections' as const,\n    group: 'more' as const,\n  },\n] as const;\n\n/** Every profile section id, in canonical render order. */\nexport type SectionId = (typeof ALL_SECTIONS)[number]['id'];\n\n/** Whether a section has content for a given profile (used to hide empty nav entries for visitors). */\nexport function isSectionPopulated(profile: Profile, id: string): boolean {\n  switch (id) {\n    case 'about':\n      return Boolean(profile.about && profile.headline);\n    case 'career':\n      return Boolean(profile.positions?.length);\n    case 'education':\n      return Boolean(profile.education?.length);\n    case 'courses':\n      return Boolean(profile.courses?.length);\n    case 'skills':\n      return Boolean(profile.skills?.length);\n    case 'projects':\n      return Boolean(profile.projects?.length);\n    case 'credentials':\n      return Boolean(profile.certifications?.length);\n    case 'publications':\n      return Boolean(profile.publications?.length);\n    case 'presentations':\n      return (\n        Boolean(profile.presentations?.length) || Boolean(profile.presentationDeliveries?.length)\n      );\n    case 'involvement':\n      return Boolean(profile.involvement?.length);\n    case 'investments':\n      return Boolean(profile.investments?.length);\n    case 'awards':\n      return Boolean(profile.honors?.length);\n    case 'languages':\n      return Boolean(profile.languages?.length);\n    case 'other-profiles':\n      return Boolean(profile.externalAccounts?.length);\n    default:\n      return false;\n  }\n}\n\n/**\n * The section ids a given viewer should see, in {@link ALL_SECTIONS} order.\n * Owners see every section; visitors only see populated ones.\n */\nexport function getVisibleSectionIds(profile: Profile, isOwnProfile: boolean): SectionId[] {\n  return ALL_SECTIONS.map((s) => s.id).filter(\n    (id) => isOwnProfile || isSectionPopulated(profile, id),\n  );\n}\n\n/** Drop items the owner has hidden from visitors. */\nexport function filterHidden<T extends { hidden?: boolean }>(items: T[] | undefined): T[] {\n  return (items ?? []).filter((i) => !i.hidden);\n}\n\n/**\n * Items visible to a given viewer: owners see their own hidden items, visitors\n * do not. Shared by every export format (markdown, docx, print) and the public\n * `.md` route so the hidden rule lives in one place.\n */\nexport function visibleItems<T extends { hidden?: boolean }>(\n  items: T[] | undefined,\n  isOwnProfile: boolean,\n): T[] {\n  return isOwnProfile ? (items ?? []) : filterHidden(items);\n}\n\n/**\n * English heading text for each section, keyed by {@link SectionId} (e.g.\n * `other-profiles` renders as \"Links\"). Exhaustive `Record<SectionId, string>`:\n * adding a section to {@link ALL_SECTIONS} without a label here is a compile\n * error, so a section can never silently render without (or with a stale)\n * heading. Consumers with i18n resolve their own localized labels via\n * `labelKey`; this is the canonical English fallback used by the exports.\n */\nexport const SECTION_LABELS: Record<SectionId, string> = {\n  about: 'About',\n  career: 'Career',\n  skills: 'Skills',\n  projects: 'Projects',\n  presentations: 'Talks & sessions',\n  publications: 'Publications',\n  credentials: 'Credentials',\n  education: 'Education',\n  courses: 'Courses',\n  awards: 'Awards',\n  involvement: 'Involvement',\n  investments: 'Investments',\n  languages: 'Languages',\n  'other-profiles': 'Links',\n};\n","/**\n * Meta description for a profile page.\n *\n * Ported from sifa-web so the description and the JSON-LD `jobTitle` are\n * derived from one place. They previously used different rules for \"which\n * position is current\" and could name different roles on the same page.\n */\n\nimport { pickPrimaryPosition } from '../logic/primary-position.js';\nimport { isRoleLineRedundant } from '../profile/headline-role-dedupe.js';\nimport { filterHidden } from '../profile/section-model.js';\nimport type { LocationValue } from '../types/index.js';\nimport { formatLocation } from './location-utils.js';\n\n/**\n * Treat a headline as meaningful only when it contains at least one letter or\n * digit. Profiles carry headlines that are a single emoji, which reads as\n * garbage in a search result snippet.\n */\nconst MEANINGFUL_TEXT_RE = /[\\p{L}\\p{N}]/u;\n\nexport interface MetaDescriptionPosition {\n  readonly company?: string;\n  /**\n   * Current canonical name of the linked company entity, resolved by the\n   * AppView at read time. Preferred over the free-text `company` snapshot so a\n   * corrected company name (and a decoded one) shows here, not the value frozen\n   * into the position record.\n   */\n  readonly entityName?: string;\n  readonly title?: string;\n  readonly startedAt?: string;\n  readonly endedAt?: string;\n  readonly primary?: boolean;\n  readonly hidden?: boolean;\n}\n\nexport interface MetaDescriptionInput {\n  readonly handle: string;\n  readonly displayName?: string;\n  readonly headline?: string;\n  readonly location?: LocationValue | null;\n  readonly positions?: readonly MetaDescriptionPosition[];\n}\n\nexport function buildMetaDescription(profile: MetaDescriptionInput): string {\n  const parts: string[] = [];\n\n  if (typeof profile.headline === 'string' && MEANINGFUL_TEXT_RE.test(profile.headline)) {\n    parts.push(profile.headline);\n  }\n\n  const positions = filterHidden(profile.positions ? [...profile.positions] : undefined);\n  const currentPosition = pickPrimaryPosition(positions);\n  if (currentPosition) {\n    const positionParts: string[] = [];\n    if (currentPosition.title) positionParts.push(currentPosition.title);\n    const company = currentPosition.entityName ?? currentPosition.company;\n    if (company) positionParts.push(`at ${company}`);\n    if (positionParts.length > 0) {\n      const roleLine = positionParts.join(' ');\n      // Skip the derived role line when the headline already says the same thing\n      // (common after LinkedIn import, where the headline is \"Title at Company\").\n      if (!isRoleLineRedundant(profile.headline, roleLine)) parts.push(roleLine);\n    }\n  }\n\n  if (profile.location) {\n    parts.push(formatLocation(profile.location));\n  }\n\n  if (parts.length === 0) {\n    return `${profile.displayName ?? profile.handle} on Sifa`;\n  }\n\n  return parts.join(' · ');\n}\n","const COMBINING_MARK = /\\p{M}/u;\nconst BIDI_CONTROLS = /[‎‏‪-‮⁦-⁩]/gu;\n\n/**\n * Limit runs of Unicode combining marks (`\\p{M}`) to at most `maxPerBase`\n * marks following any single base character. Defuses \"Zalgo\" text where\n * dozens of stacked combining marks render outside the line box and bleed\n * into neighbouring UI.\n *\n * `maxPerBase` defaults to 4 — high enough to preserve legitimate stacks\n * in Thai, Arabic, Vietnamese, and IPA, low enough to neutralise the\n * vertical-overflow attack vector.\n */\nexport function limitCombiningMarks(value: string, maxPerBase = 4): string {\n  if (!value || !COMBINING_MARK.test(value)) return value;\n\n  let out = '';\n  let combiningRun = 0;\n  for (const char of value) {\n    if (/\\p{M}/u.test(char)) {\n      if (combiningRun < maxPerBase) {\n        out += char;\n        combiningRun += 1;\n      }\n    } else {\n      out += char;\n      combiningRun = 0;\n    }\n  }\n  return out;\n}\n\n/**\n * Sanitise untrusted display text from PDS records before rendering in UI:\n * - strips bidi formatting controls (LRM/RLM/LRE/RLE/PDF/LRO/RLO/LRI/RLI/FSI/PDI)\n *   that can hijack reading order or crash `next/og` (see Satori LRM+emoji bug)\n * - limits stacked combining marks (Zalgo defence)\n *\n * Preserves ZWJ (U+200D) so emoji sequences keep rendering.\n */\nexport function sanitizeDisplayText(value: string, maxCombiningPerBase = 4): string {\n  if (!value) return value;\n  return limitCombiningMarks(value.replace(BIDI_CONTROLS, ''), maxCombiningPerBase);\n}\n","const ELLIPSIS = '\\u2026';\n\n/**\n * Truncate a string to at most `maxLen` grapheme clusters, appending an\n * ellipsis when the string was shortened. Grapheme-aware so it never splits\n * emoji sequences (ZWJ, regional indicators, combining marks, surrogate pairs).\n */\nexport function truncateGraphemes(value: string, maxLen: number): string {\n  if (maxLen <= 0) return '';\n  const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n  const graphemes = Array.from(segmenter.segment(value), (s) => s.segment);\n  if (graphemes.length <= maxLen) return value;\n  if (maxLen === 1) return ELLIPSIS;\n  return graphemes.slice(0, maxLen - 1).join('') + ELLIPSIS;\n}\n","/**\n * How much of the URL path to keep in the display string.\n *\n * - `full`: keep the whole pathname (the path is identity, e.g.\n *   `github.com/user/repo` or `mastodon.social/@handle`).\n * - `firstSegment`: keep only the first path segment (`gui.do/events`) -- enough\n *   to say \"which page\" without the deep-slug / marketing cruft.\n * - `none`: host only (`gui.do`).\n */\nexport type UrlPathPolicy = 'full' | 'firstSegment' | 'none';\n\nexport interface FormatDisplayUrlOptions {\n  path?: UrlPathPolicy;\n}\n\nexport interface DisplayUrl {\n  /** The cleaned label to show (no scheme, no `www.`, no query/hash). */\n  display: string;\n  /** The full, navigable URL for an `<a href>` / hover title. */\n  href: string;\n}\n\n/**\n * Best-effort parse. Tries the input as-is, then (for scheme-less input like\n * `example.com`) with an `https://` prefix. Returns `null` when neither parses,\n * so the caller can fall back instead of throwing -- an uncaught `new URL()`\n * throw inside a Server Component takes down the whole render.\n */\nfunction tryParseUrl(raw: string): URL | null {\n  try {\n    return new URL(raw);\n  } catch {\n    // fall through\n  }\n  if (!/^[a-z][a-z0-9+.-]*:/i.test(raw)) {\n    try {\n      return new URL(`https://${raw}`);\n    } catch {\n      // fall through\n    }\n  }\n  return null;\n}\n\n/**\n * Canonical URL display formatter, shared by every surface that shows a link\n * (profile projects, external accounts, identity-card website). Produces a tidy\n * label plus the real destination, so consumers never re-implement the strip.\n *\n * Rules: drop the scheme and a leading `www.`, drop the query string and hash,\n * drop a trailing slash, and apply the `path` policy. `display` is the label;\n * `href` is the full canonical URL (scheme + query + hash preserved) for the\n * anchor and its hover `title`.\n *\n * Truncation/ellipsis is deliberately NOT handled here -- it is a view concern\n * that depends on the rendered width, so consumers truncate with CSS\n * (`text-overflow: ellipsis`) and keep the full value in `href`/`title`.\n */\nexport function formatDisplayUrl(url: string, options: FormatDisplayUrlOptions = {}): DisplayUrl {\n  const { path = 'full' } = options;\n  const raw = (url ?? '').trim();\n  if (!raw) return { display: '', href: '' };\n\n  const parsed = tryParseUrl(raw);\n\n  // Unparseable even with a prepended scheme: return a best-effort label and\n  // keep the raw value as href. Never throw.\n  if (!parsed) {\n    return { display: raw.replace(/^dns:/i, ''), href: raw };\n  }\n\n  // Non-web scheme (`dns:`, `mailto:`, ...): keep it addressable, strip the\n  // scheme for display.\n  if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:') {\n    const display = raw.replace(/^[a-z][a-z0-9+.-]*:/i, '').replace(/^\\/\\//, '') || raw;\n    return { display, href: raw };\n  }\n\n  const host = parsed.hostname.replace(/^www\\./i, '');\n  const segments = parsed.pathname.split('/').filter(Boolean);\n\n  let pathPart = '';\n  if (path === 'full' && segments.length > 0) {\n    pathPart = `/${segments.join('/')}`;\n  } else if (path === 'firstSegment' && segments.length > 0) {\n    pathPart = `/${segments[0]}`;\n  }\n\n  return { display: `${host}${pathPart}`, href: parsed.href };\n}\n","/**\n * Format a date as a relative time string (e.g. \"2 minutes ago\", \"3 days ago\").\n */\nexport function formatDistanceToNow(date: Date): string {\n  const seconds = Math.floor((Date.now() - date.getTime()) / 1000);\n  if (seconds < 60) return 'just now';\n\n  const minutes = Math.floor(seconds / 60);\n  if (minutes < 60) return `${minutes}m ago`;\n\n  const hours = Math.floor(minutes / 60);\n  if (hours < 24) return `${hours}h ago`;\n\n  const days = Math.floor(hours / 24);\n  if (days < 7) return `${days}d ago`;\n\n  const weeks = Math.floor(days / 7);\n  if (weeks < 5) return `${weeks}w ago`;\n\n  const months = Math.floor(days / 30);\n  return `${months}mo ago`;\n}\n","/**\n * WCAG 2.2 contrast ratio utilities for validating publication theme colors.\n * Implements the relative luminance and contrast ratio formulas from\n * https://www.w3.org/TR/WCAG22/#dfn-relative-luminance\n */\n\nexport interface RgbColor {\n  r: number;\n  g: number;\n  b: number;\n}\n\n/**\n * Return true when the value is an RgbColor with all channels as integers in [0, 255].\n * Use this before passing untrusted data to the luminance / contrast functions.\n */\nexport function isValidRgbColor(value: unknown): value is RgbColor {\n  if (value == null || typeof value !== 'object') return false;\n  const { r, g, b } = value as Record<string, unknown>;\n  return (\n    typeof r === 'number' &&\n    typeof g === 'number' &&\n    typeof b === 'number' &&\n    Number.isFinite(r) &&\n    Number.isFinite(g) &&\n    Number.isFinite(b) &&\n    r >= 0 &&\n    r <= 255 &&\n    g >= 0 &&\n    g <= 255 &&\n    b >= 0 &&\n    b <= 255\n  );\n}\n\n/**\n * Serialize an RgbColor to a CSS `rgb(...)` string.\n * Channels are floored to integers to prevent sub-pixel drift.\n */\nexport function rgbToString(color: RgbColor): string {\n  return `rgb(${Math.floor(color.r)}, ${Math.floor(color.g)}, ${Math.floor(color.b)})`;\n}\n\n/**\n * Calculate relative luminance of an sRGB color per WCAG 2.2.\n * Input channels must be numbers in [0, 255].\n */\nexport function relativeLuminance(color: RgbColor): number {\n  const [rs, gs, bs] = [color.r / 255, color.g / 255, color.b / 255];\n\n  const r = rs <= 0.04045 ? rs / 12.92 : Math.pow((rs + 0.055) / 1.055, 2.4);\n  const g = gs <= 0.04045 ? gs / 12.92 : Math.pow((gs + 0.055) / 1.055, 2.4);\n  const b = bs <= 0.04045 ? bs / 12.92 : Math.pow((bs + 0.055) / 1.055, 2.4);\n\n  return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/**\n * Calculate WCAG 2.2 contrast ratio between two colors.\n * Returns a value between 1 (identical) and 21 (black/white).\n */\nexport function contrastRatio(color1: RgbColor, color2: RgbColor): number {\n  const l1 = relativeLuminance(color1);\n  const l2 = relativeLuminance(color2);\n  const lighter = Math.max(l1, l2);\n  const darker = Math.min(l1, l2);\n  return (lighter + 0.05) / (darker + 0.05);\n}\n\n/**\n * Check if two colors meet WCAG 2.2 AA contrast requirement (4.5:1 for normal text).\n */\nexport function meetsContrastAA(foreground: RgbColor, background: RgbColor): boolean {\n  return contrastRatio(foreground, background) >= 4.5;\n}\n","import type {\n  ProfilePresentationRecord,\n  ProfilePresentationDeliveryRecord,\n  PresentationLink,\n  PresentationDuration,\n} from '../schemas/index.js';\n\n/**\n * CSV parsers for the Talks & sessions import (two templates joined by a\n * presentation_key). The value parsers and row mappers are reusable and pure;\n * the actual PDS writing (create a presentation, then write its deliveries with\n * a presentationRef to it) is orchestrated by the consumer, which has the\n * created record's AT-URI.\n */\n\n/** A CSV row as a header-keyed map. Missing cells may be undefined or empty. */\nexport type CsvRow = Record<string, string | undefined>;\n\nfunction clean(value: string | undefined): string {\n  return (value ?? '').trim();\n}\n\n/**\n * Parse a free-text duration into minutes: a single value (\"30 min\", \"30\n * minutes\", \"30\") or a range (\"20-30 min\", \"20 to 30 minutes\", \"20-30\").\n * Returns undefined when no usable number is present. A second number is used\n * as the upper bound only when it is greater than or equal to the first.\n */\nexport function parsePresentationDuration(\n  input: string | undefined,\n): PresentationDuration | undefined {\n  const numbers = (clean(input).match(/\\d+/g) ?? [])\n    .map((n) => Number.parseInt(n, 10))\n    .filter((n) => Number.isInteger(n) && n > 0);\n  // `.at()` is typed `number | undefined`, which both tsc (under\n  // noUncheckedIndexedAccess) and eslint agree on, so the guards are clean.\n  const min = numbers.at(0);\n  if (min === undefined) return undefined;\n  const max = numbers.at(1);\n  return max !== undefined && max >= min\n    ? { minMinutes: min, maxMinutes: max }\n    : { minMinutes: min };\n}\n\n/** Build a duration from explicit min/max minute columns. */\nexport function durationFromMinutes(\n  minRaw: string | undefined,\n  maxRaw: string | undefined,\n): PresentationDuration | undefined {\n  const min = Number.parseInt(clean(minRaw), 10);\n  if (!Number.isInteger(min) || min < 1) return undefined;\n  const max = Number.parseInt(clean(maxRaw), 10);\n  return Number.isInteger(max) && max >= min\n    ? { minMinutes: min, maxMinutes: max }\n    : { minMinutes: min };\n}\n\n/** Split a delimited list into trimmed, non-empty values. Default delimiter \";\". */\nexport function parseIntendedAudiences(input: string | undefined, delimiter = ';'): string[] {\n  return clean(input)\n    .split(delimiter)\n    .map((s) => s.trim())\n    .filter(Boolean);\n}\n\n/**\n * Strip HTML to plain text and decode the common entities, for descriptions\n * exported as HTML (e.g. Webflow). The AppView re-sanitizes on write; this is\n * only to produce readable text.\n */\nexport function stripHtmlToText(input: string | undefined): string {\n  const text = clean(input)\n    .replace(/<\\s*br\\s*\\/?>/gi, '\\n')\n    .replace(/<\\/\\s*(p|div|li|h[1-6])\\s*>/gi, '\\n')\n    .replace(/<[^>]*>/g, '')\n    .replace(/&nbsp;/gi, ' ')\n    .replace(/&amp;/gi, '&')\n    .replace(/&lt;/gi, '<')\n    .replace(/&gt;/gi, '>')\n    .replace(/&quot;/gi, '\"')\n    .replace(/&#0*39;|&apos;/gi, \"'\");\n  return text\n    .replace(/[ \\t]+/g, ' ')\n    .replace(/ *\\n */g, '\\n')\n    .replace(/\\n{3,}/g, '\\n\\n')\n    .trim();\n}\n\nconst ROLE_TOKENS: Record<string, string> = {\n  presenter: 'id.sifa.defs#presenter',\n  speaker: 'id.sifa.defs#presenter',\n  panelist: 'id.sifa.defs#panelist',\n  keynote: 'id.sifa.defs#keynote',\n  workshop: 'id.sifa.defs#workshop',\n  host: 'id.sifa.defs#host',\n};\n\n/**\n * Map a friendly role value to its token. An existing token passes through.\n * Free-text or compound values (e.g. \"Organizer & co-host/moderator\") are\n * mapped to the nearest token by keyword. An organizer-only value has no\n * speaking token, so it, and any other unrecognized value, is dropped rather\n * than stored raw -- matching normalizePresentationMode's drop-unknown\n * behavior, so a fixed role dropdown never has to render arbitrary strings.\n */\nexport function normalizePresentationRole(value: string | undefined): string | undefined {\n  const v = clean(value).toLowerCase();\n  if (!v) return undefined;\n  if (v.startsWith('id.sifa.defs#')) return v;\n  const exact = ROLE_TOKENS[v];\n  if (exact) return exact;\n  if (v.includes('keynote')) return ROLE_TOKENS.keynote;\n  if (v.includes('workshop') || v.includes('masterclass') || v.includes('training'))\n    return ROLE_TOKENS.workshop;\n  if (v.includes('panel')) return ROLE_TOKENS.panelist;\n  if (v.includes('host') || v.includes('moderat') || v.includes('emcee') || v.includes('chair'))\n    return ROLE_TOKENS.host;\n  if (v.includes('speaker') || v.includes('present') || v.includes('talk'))\n    return ROLE_TOKENS.presenter;\n  return undefined;\n}\n\nconst MODE_FRAGMENTS: Record<string, string> = {\n  inperson: '#inperson',\n  'in person': '#inperson',\n  'in-person': '#inperson',\n  virtual: '#virtual',\n  online: '#virtual',\n  remote: '#virtual',\n  hybrid: '#hybrid',\n};\n\n/** Map a friendly mode value to the community calendar token; drops an unknown value. */\nexport function normalizePresentationMode(value: string | undefined): string | undefined {\n  const v = clean(value).toLowerCase();\n  if (!v) return undefined;\n  if (v.startsWith('community.lexicon.calendar.event#')) return v;\n  const fragment = MODE_FRAGMENTS[v];\n  return fragment ? `community.lexicon.calendar.event${fragment}` : undefined;\n}\n\nfunction link(uri: string | undefined, type: string): PresentationLink | undefined {\n  const u = clean(uri);\n  return u ? { uri: u, type } : undefined;\n}\n\nexport interface ParsedPresentation {\n  /** presentation_key used to link delivery rows to this presentation. */\n  key?: string;\n  record: Omit<ProfilePresentationRecord, 'createdAt'>;\n}\n\n/** Map a row of the presentations template to a presentation record (minus createdAt). */\nexport function presentationCsvRowToRecord(row: CsvRow): ParsedPresentation {\n  const description = stripHtmlToText(row.description);\n  const duration =\n    parsePresentationDuration(row.duration) ??\n    durationFromMinutes(row.duration_min_minutes, row.duration_max_minutes);\n  const intendedAudiences = parseIntendedAudiences(row.intended_audiences);\n  const links = [\n    link(row.slides_url, 'id.sifa.defs#linkSlides'),\n    link(row.recording_url, 'id.sifa.defs#linkRecording'),\n    link(row.writeup_url, 'id.sifa.defs#linkWriteup'),\n  ].filter((l): l is PresentationLink => l !== undefined);\n\n  const record: Omit<ProfilePresentationRecord, 'createdAt'> = { title: clean(row.title) };\n  if (description) record.description = description;\n  if (duration) record.duration = duration;\n  if (intendedAudiences.length) record.intendedAudiences = intendedAudiences;\n  if (links.length) record.links = links;\n\n  return { key: clean(row.presentation_key) || undefined, record };\n}\n\nexport interface ParsedDelivery {\n  /** presentation_key to resolve into a presentationRef once the presentation exists. */\n  presentationKey?: string;\n  record: Omit<ProfilePresentationDeliveryRecord, 'createdAt' | 'presentationRef'>;\n}\n\n/** Map a row of the deliveries template to a delivery record (minus createdAt and presentationRef). */\nexport function presentationDeliveryCsvRowToRecord(row: CsvRow): ParsedDelivery {\n  const links = [\n    link(row.event_url, 'id.sifa.defs#linkEvent'),\n    link(row.recording_url, 'id.sifa.defs#linkRecording'),\n  ].filter((l): l is PresentationLink => l !== undefined);\n\n  const record: Omit<ProfilePresentationDeliveryRecord, 'createdAt' | 'presentationRef'> = {};\n  const title = clean(row.title);\n  const eventName = clean(row.event_name);\n  const date = clean(row.date);\n  const location = clean(row.location);\n  const role = normalizePresentationRole(row.role);\n  const mode = normalizePresentationMode(row.mode);\n  if (title) record.title = title;\n  if (role) record.role = role;\n  if (eventName) record.eventName = eventName;\n  if (date) record.date = date;\n  if (location) record.location = location;\n  if (mode) record.mode = mode;\n  if (links.length) record.links = links;\n\n  return { presentationKey: clean(row.presentation_key) || undefined, record };\n}\n","/**\n * URL patterns per app, mirroring the sifa-web registry.\n *\n * These describe how to build a clickable URL for an activity card given\n * the author's handle/did and the record rkey. The patterns are templates\n * with `{handle}`, `{did}`, and `{rkey}` placeholders; each variable is\n * URI-encoded when interpolated.\n *\n * Tier semantics:\n * - `urlPattern`: per-item URL (a specific post/event/repo). Preferred.\n * - `profileUrlPattern`: per-user profile URL on the app. Fallback.\n *\n * Apps without either pattern are not clickable.\n */\nexport interface AppUrlPatterns {\n  urlPattern?: string;\n  profileUrlPattern?: string;\n}\n\nexport const APP_URL_PATTERNS: Readonly<Record<string, AppUrlPatterns>> = Object.freeze({\n  bluesky: {\n    urlPattern: 'https://bsky.app/profile/{handle}/post/{rkey}',\n    profileUrlPattern: 'https://bsky.app/profile/{handle}',\n  },\n  tangled: {\n    profileUrlPattern: 'https://tangled.sh/{handle}',\n  },\n  // Community-calendar events (community.lexicon.calendar.*, incl. records\n  // originally authored in the decommissioned Smoke Signal). atmo.rsvp resolves\n  // any such event by did+rkey, so links point there. Internal id kept as\n  // `smokesignal` for continuity with existing token/color keys.\n  smokesignal: {\n    urlPattern: 'https://atmo.rsvp/p/{did}/e/{rkey}',\n    profileUrlPattern: 'https://atmo.rsvp/p/{did}',\n  },\n  whitewind: {\n    urlPattern: 'https://whtwnd.com/{handle}/{rkey}',\n    profileUrlPattern: 'https://whtwnd.com/{handle}',\n  },\n  frontpage: {\n    urlPattern: 'https://frontpage.fyi/post/{did}/{rkey}',\n    profileUrlPattern: 'https://frontpage.fyi/profile/{did}',\n  },\n  linkat: {\n    profileUrlPattern: 'https://linkat.blue/{handle}',\n  },\n  pastesphere: {\n    urlPattern: 'https://pastesphere.link/user/{handle}/snippet/{rkey}',\n    profileUrlPattern: 'https://pastesphere.link/user/{handle}',\n  },\n  kipclip: {\n    profileUrlPattern: 'https://kipclip.com/{handle}',\n  },\n  keytrace: {\n    profileUrlPattern: 'https://keytrace.dev/@{handle}',\n  },\n  sifa: {\n    profileUrlPattern: 'https://sifa.id/p/{handle}',\n  },\n  popfeed: {\n    urlPattern: 'https://popfeed.social/profile/{handle}',\n    profileUrlPattern: 'https://popfeed.social/profile/{handle}',\n  },\n  streamplace: {\n    profileUrlPattern: 'https://stream.place/{handle}',\n  },\n  semble: {\n    profileUrlPattern: 'https://semble.so/profile/{handle}',\n  },\n  grain: {\n    urlPattern: 'https://grain.social/profile/{did}/gallery/{rkey}',\n    profileUrlPattern: 'https://grain.social/profile/{did}',\n  },\n  youandme: { profileUrlPattern: 'https://youandme.at' },\n  // atmoBB per-item thread/reply URLs are built bespoke in resolve-card-url.ts\n  // (raw-colon /t/{did}/{rkey}); this is only the member-profile fallback.\n  atmobb: { profileUrlPattern: 'https://atmobb.app/members/{did}' },\n  // anisota: upgraded with per-record URL pattern below.\n  margin: { profileUrlPattern: 'https://margin.at' },\n  beaconbits: { profileUrlPattern: 'https://beaconbits.app' },\n  bookhive: { profileUrlPattern: 'https://bookhive.buzz/profile/{handle}' },\n  colibri: { profileUrlPattern: 'https://colibri.social' },\n  collectivesocial: { profileUrlPattern: 'https://app.collectivesocial.app' },\n  github: {},\n  asq: {\n    // Questions live at /q/{did}/{rkey}. Answer cards build their own URL\n    // from the parsed subject.uri (which points to the question), so the\n    // pattern below is invoked only for question records.\n    urlPattern: 'https://asq.fyi/q/{did}/{rkey}',\n    profileUrlPattern: 'https://asq.fyi',\n  },\n  passports: {\n    // Per-record URLs don't exist on passports.social — its SvelteKit routes\n    // stop at /profile/{handle}/{passport_slug}. Profile-level fallback only.\n    profileUrlPattern: 'https://passports.social/profile/{handle}',\n  },\n  leaflet: {\n    // Per-document URLs are short and rkey-only: https://leaflet.pub/{rkey}.\n    // Each publication has its own base_path subdomain (e.g. zzstoatzz.leaflet.pub)\n    // but the canonical short URL renders the same document. There is no\n    // per-user profile route on leaflet.pub, so the profile fallback points\n    // at the marketing site.\n    urlPattern: 'https://leaflet.pub/{rkey}',\n    profileUrlPattern: 'https://leaflet.pub',\n  },\n  spark: {\n    // Verified live: GET /post/{did}/{rkey} returns 200.\n    urlPattern: 'https://sprk.so/post/{did}/{rkey}',\n    profileUrlPattern: 'https://sprk.so/profile/{handle}',\n  },\n  anisota: {\n    urlPattern: 'https://anisota.net/post/{did}/{rkey}',\n    profileUrlPattern: 'https://anisota.net/profile/{handle}',\n  },\n  nooki: {\n    // Per-post URLs use slug-based routing (e.g. /post/{slug}), not rkey —\n    // can't be constructed from a record. Profile fallback only.\n    profileUrlPattern: 'https://nooki.me/user/{handle}',\n  },\n  atstore: {\n    // atstore.fyi has no user-profile pages (the legacy `/@{handle}` pattern\n    // resolved to a 404), and no per-review deep link exists. The per-product\n    // page (https://atstore.fyi/products/{slug}) is the most specific URL\n    // available — resolveCardUrl builds it from record.listingMeta.slug,\n    // which sifa-api enriches by resolving the review's `subject` to the\n    // referenced listing.detail record.\n    profileUrlPattern: 'https://atstore.fyi',\n  },\n  plyr: {\n    // SPA — per-record URLs require JS routing. plyr.fm doesn't expose a\n    // public per-handle profile page server-side either; falls back to root.\n    profileUrlPattern: 'https://plyr.fm',\n  },\n  atfund: {\n    // at.fund is auth-gated — `/give/{did}` 307s to `/` when not signed in,\n    // and there's no public per-endorsement permalink. Profile fallback only,\n    // pointing at the main /give listing.\n    profileUrlPattern: 'https://www.at.fund/give',\n  },\n  crate: {\n    // Crate (app.crate.social) is an authoring dashboard with no public\n    // per-record viewer or per-handle profile page — records are designed to\n    // render on the maker's own site. `content` cards link out via\n    // record.canonicalUrl (handled in resolveCardUrl); `note` records have no\n    // public URL and render non-clickable. So no app-level pattern applies.\n  },\n  guestbook: {\n    // Guestbook (dev.baileytownsend.guestbook) is a self-hosted, cross-site\n    // widget: each site owner renders their own guestbook wherever they choose,\n    // so there is no canonical public per-entry viewer or per-handle profile\n    // page. Entries render non-clickable. Same shape as crate `note`.\n  },\n  atmorsvp: {\n    // atmo.rsvp events live at /p/{did}/e/{rkey}. The per-item pattern is used\n    // for the event record itself; checkin records build their URL from the\n    // referenced event uri in resolveCardUrl (mirrors smokesignal rsvp).\n    urlPattern: 'https://atmo.rsvp/p/{did}/e/{rkey}',\n    profileUrlPattern: 'https://atmo.rsvp/p/{did}',\n  },\n  opensocial: {\n    // Open Social (opensocial.community) is community-management infrastructure\n    // with no public per-membership permalink. Profile fallback only.\n    profileUrlPattern: 'https://opensocial.community',\n  },\n  kevara: {\n    // Kevara (professional network) has no live public web surface yet — its\n    // domain doesn't resolve and there's no per-record viewer. Recognized so\n    // the speaker-directory card renders with the right pill, but non-clickable.\n  },\n  atcr: {\n    // ATCR repositories live at /r/{handle}/{repository}, where the rkey of an\n    // io.atcr.repo.page record is the repository name. Verified live: GET\n    // /r/{handle}/{rkey} and /u/{handle} both return 200.\n    urlPattern: 'https://atcr.io/r/{handle}/{rkey}',\n    profileUrlPattern: 'https://atcr.io/u/{handle}',\n  },\n  kich: {\n    // Kich recipe viewer. Verified: GET /recipes/{rkey} returns 200 (the SPA\n    // renders the recipe by rkey); /recipe/{rkey} 404s. No public per-handle\n    // profile page, so the profile fallback points at the app root.\n    urlPattern: 'https://kich.io/recipes/{rkey}',\n    profileUrlPattern: 'https://kich.io',\n  },\n  pinksea: {\n    // PinkSea oekaki viewer. Verified live: GET /{did}/oekaki/{rkey} returns\n    // 200 AND its og:image resolves to harbor.pinksea.art/{did}/{blobCid}\n    // carrying the same CID as the record, so the route really is per-record\n    // and not just an SPA catch-all.\n    urlPattern: 'https://pinksea.art/{did}/oekaki/{rkey}',\n    profileUrlPattern: 'https://pinksea.art/{did}',\n  },\n  hypercerts: {\n    // No confirmed public per-record viewer. hyperscan.dev is a network-wide\n    // search explorer (its input takes \"DID, handle, AT-URI, or PDS host\"),\n    // and hypercerts.org 404s on every claim route tried. Recognized so the\n    // pill renders, but cards stay non-clickable.\n  },\n  certified: {\n    // certified.app is fully client-rendered and returns an identical\n    // \"Loading\" shell for a real DID and a nonsense one, so no per-record\n    // route could be verified. Non-clickable until one is confirmed.\n  },\n  impactindexer: {\n    // Reviews are surfaced through hyperscan.dev/review, which has no\n    // per-record route. Non-clickable.\n  },\n  recipe: {\n    // recipe.exchange viewer. Verified: GET /recipes/{rkey} returns 200 (rkey\n    // alone; no did needed) and /profiles/{handle} returns 200 for the author\n    // page. /recipe/{rkey} 404s.\n    urlPattern: 'https://recipe.exchange/recipes/{rkey}',\n    profileUrlPattern: 'https://recipe.exchange/profiles/{handle}',\n  },\n  aetherdocs: {\n    // Aether OS is a browser OS — presentations open inside it and there's no\n    // public per-record viewer. The card embeds the deck from the record; the\n    // outbound link points at the author's Aether OS space (mirrors aetheros).\n    profileUrlPattern: 'https://aetheros.computer/{handle}',\n  },\n  zeens: {\n    // Zeens (zeens.app) still uses its former app.photosky.* namespace. The\n    // app redirects /collection/{handle}/{rkey} to the canonical path below.\n    urlPattern: 'https://zeens.app/profile/{handle}/collections/{rkey}',\n    profileUrlPattern: 'https://zeens.app/profile/{handle}',\n  },\n  chive: {\n    // Chive's eprint route is a catch-all that decodes a single URI-encoded\n    // at-uri segment: /eprints/<encodeURIComponent(at://did/nsid/rkey)>.\n    // {did} and {rkey} are URI-encoded on interpolation, so the separators\n    // are pre-encoded as literals here rather than resolved bespoke.\n    urlPattern: 'https://chive.pub/eprints/at%3A%2F%2F{did}%2Fpub.chive.eprint.submission%2F{rkey}',\n    profileUrlPattern: 'https://chive.pub/authors/{did}',\n  },\n});\n\n/**\n * Map collection NSID prefixes to app ids. Order matters: longer / more\n * specific prefixes must come before broader ones.\n */\nexport const COLLECTION_TO_APP: ReadonlyArray<readonly [prefix: string, appId: string]> = [\n  ['app.bsky.', 'bluesky'],\n  ['sh.tangled.', 'tangled'],\n  ['events.smokesignal.', 'smokesignal'],\n  ['community.lexicon.calendar.', 'smokesignal'],\n  ['community.lexicon.bookmarks.', 'kipclip'],\n  ['com.kipclip.', 'kipclip'],\n  ['blue.flashes.', 'flashes'],\n  ['social.grain.', 'grain'],\n  ['pics.pixl.', 'pixl'],\n  ['com.whtwnd.', 'whitewind'],\n  ['fyi.unravel.frontpage.', 'frontpage'],\n  ['social.psky.', 'picosky'],\n  ['blue.linkat.', 'linkat'],\n  ['link.pastesphere.', 'pastesphere'],\n  ['site.standard.', 'standard'],\n  ['computer.aetheros.', 'aetheros'],\n  ['space.roomy.', 'roomy'],\n  ['dev.keytrace.', 'keytrace'],\n  ['social.popfeed.', 'popfeed'],\n  ['app.popsky.', 'popfeed'],\n  ['place.stream.', 'streamplace'],\n  ['app.sidetrail.', 'semble'],\n  ['network.cosmik.', 'cosmik'],\n  ['id.sifa.', 'sifa'],\n  ['forum.barazo.', 'barazo'],\n  ['xyz.statusphere.', 'statusphere'],\n  ['at.youandme.', 'youandme'],\n  ['net.anisota.', 'anisota'],\n  ['at.margin.', 'margin'],\n  ['app.beaconbits.', 'beaconbits'],\n  ['buzz.bookhive.', 'bookhive'],\n  ['social.colibri.', 'colibri'],\n  ['social.passports.', 'passports'],\n  ['fyi.asq.', 'asq'],\n  ['pub.leaflet.', 'leaflet'],\n  ['so.sprk.', 'spark'],\n  ['community.nooki.', 'nooki'],\n  ['fyi.atstore.', 'atstore'],\n  ['fm.plyr.', 'plyr'],\n  ['fund.at.', 'atfund'],\n  ['social.crate.', 'crate'],\n  ['quest.atmo.', 'atmorsvp'],\n  ['community.opensocial.', 'opensocial'],\n  ['is.kevara.', 'kevara'],\n  ['io.atcr.', 'atcr'],\n  // Batch onboard — named pills for apps that were leaking as raw NSIDs.\n  ['app.mcp.', 'mcp'],\n  ['app.userinput.', 'userinput'],\n  ['com.minomobi.', 'minomobi'],\n  ['com.voxport.', 'voxport'],\n  ['community.lexicon.badge.', 'badges'],\n  ['dev.atvouch.', 'atvouch'],\n  ['io.calabro.watsm.', 'watsm'],\n  ['li.plonk.', 'plonk'],\n  ['net.alternativeproto.', 'alternativeproto'],\n  ['one.papili.', 'papili'],\n  ['org.v-it.', 'vit'],\n  ['st.lifepo.', 'lifepo'],\n  ['stream.thought.', 'streamthought'],\n  ['tech.waow.', 'waow'],\n  ['wiki.lichen.', 'lichen'],\n  // Onboard from aramzs.xyz profile audit.\n  ['os.aether.', 'aetherdocs'],\n  ['io.kich.recipe.recipe', 'kich'],\n  // Onboard from moll.dev profile audit.\n  ['exchange.recipe.recipe', 'recipe'],\n  // Onboard from willow.sh profile audit.\n  ['dev.baileytownsend.guestbook.', 'guestbook'],\n  // Onboard from trezy.codes profile audit.\n  ['app.atmobb.', 'atmobb'],\n  // Onboard from aaronstevenwhite.io profile audit.\n  ['pub.chive.', 'chive'],\n  // Onboard from helene-cook.eu profile audit. Zeens kept its old NSID.\n  ['app.photosky.', 'zeens'],\n  // Onboard from the holke.xyz profile audit.\n  ['org.hypercerts.', 'hypercerts'],\n  ['app.certified.', 'certified'],\n  ['org.impactindexer.', 'impactindexer'],\n  ['com.shinolabs.pinksea.', 'pinksea'],\n];\n","import { APP_URL_PATTERNS, COLLECTION_TO_APP } from './app-url-patterns.js';\n\n/**\n * An activity item as consumed by the Sifa activity-card components and\n * the sifa-api external-URL health scanner. The shape mirrors the props\n * the cards already use, so the resolver returns the same URL the UI\n * renders.\n */\nexport interface ActivityItemForUrl {\n  /** Collection NSID, e.g. \"sh.tangled.graph.repo\". */\n  collection: string;\n  /** The raw record from the PDS / API. */\n  record: Record<string, unknown>;\n  /** Full at-uri of the record (used by collections that derive URL from uri). */\n  uri: string;\n  /** Record key. */\n  rkey: string;\n  /** DID of the author of the record. */\n  authorDid: string;\n  /** Optional handle (cards prefer handle in URL paths when available). */\n  authorHandle?: string;\n}\n\n/**\n * Map a collection NSID to its app id, mirroring the sifa-web prefix map.\n *\n * Falls back to the first two NSID segments (e.g. \"org.hyperboards\") when\n * the prefix is not registered, matching the existing card behaviour.\n */\nexport function getAppIdForCollection(collection: string): string {\n  for (const [prefix, appId] of COLLECTION_TO_APP) {\n    if (collection.startsWith(prefix)) return appId;\n  }\n  const parts = collection.split('.');\n  if (parts.length >= 2) return `${parts[0]}.${parts[1]}`;\n  return collection;\n}\n\n/**\n * How the activity-card health scanner should verify a card is still live.\n *\n * - `record`: the URL is a first-party permalink that renders THIS record\n *   (e.g. a Bluesky post at bsky.app, a tangled repo, a smokesignal event).\n *   The authoritative liveness check is \"does the record still exist on its\n *   PDS\" — `com.atproto.repo.getRecord` on the item's own at-uri — NOT an\n *   HTTP probe of the rendering app. Rendering apps (bsky.app, tangled.sh)\n *   frequently answer HEAD with 404/405 while serving GET fine, which\n *   false-positives every permalink as broken.\n * - `url`: the URL is a foreign or derived target — a bookmarked page, an\n *   external publisher, a *different* record's page, or a profile page.\n *   Its reachability is independent of this record, so probe the URL.\n * - `none`: the card has no clickable URL; nothing to check.\n */\nexport type CardHealthStrategy = 'record' | 'url' | 'none';\n\nexport interface CardHealth {\n  /** The clickable URL the card renders. Null when non-clickable. */\n  url: string | null;\n  /** How the scanner should verify liveness. See {@link CardHealthStrategy}. */\n  strategy: CardHealthStrategy;\n}\n\n/** Build a `url`-strategy result (foreign/derived/profile target). */\nfunction urlHealth(url: string | null): CardHealth {\n  return url ? { url, strategy: 'url' } : { url: null, strategy: 'none' };\n}\n\n/** Build a `record`-strategy result (self-permalink of this record). */\nfunction recordHealth(url: string | null): CardHealth {\n  return url ? { url, strategy: 'record' } : { url: null, strategy: 'none' };\n}\n\nfunction interpolate(pattern: string, vars: Record<string, string | undefined>): string | null {\n  let result = pattern;\n  for (const [key, value] of Object.entries(vars)) {\n    if (result.includes(`{${key}}`)) {\n      if (!value) return null;\n      result = result.replaceAll(`{${key}}`, encodeURIComponent(value));\n    }\n  }\n  return result;\n}\n\n/**\n * Whether the per-item `urlPattern` for `appId` is appropriate for `collection`.\n *\n * For bluesky, the per-item URL pattern only matches `app.bsky.feed.post` —\n * other `app.bsky.*` collections (`actor.status`, `graph.cancellation`, etc.)\n * use rkeys that would 404 at `bsky.app/profile/{handle}/post/{rkey}`. Fall\n * back to the profile URL for those. See sifa-web#1070 / sifa-web#1073.\n *\n * When `collection` is undefined we err on the safe side for bluesky and\n * prefer the profile URL.\n */\nfunction shouldUseItemPattern(appId: string, collection: string | undefined): boolean {\n  if (appId === 'bluesky') {\n    return collection === 'app.bsky.feed.post';\n  }\n  return true;\n}\n\n/**\n * Resolve a pattern-based URL, reporting which tier produced it:\n * - `item`: a per-item permalink (renders this specific record) -> record-checkable.\n * - `profile`: the app's profile page (not this record) -> url-checkable.\n * - `null`: no pattern applied.\n */\nfunction patternHealth(\n  appId: string,\n  vars: { handle?: string; did?: string; rkey?: string },\n  collection?: string,\n): CardHealth {\n  const patterns = APP_URL_PATTERNS[appId];\n  if (!patterns) return { url: null, strategy: 'none' };\n\n  if (patterns.urlPattern && shouldUseItemPattern(appId, collection)) {\n    const url = interpolate(patterns.urlPattern, vars);\n    if (url) return recordHealth(url);\n  }\n  if (patterns.profileUrlPattern) {\n    const url = interpolate(patterns.profileUrlPattern, vars);\n    if (url) return urlHealth(url);\n  }\n  return { url: null, strategy: 'none' };\n}\n\n/**\n * Valid tangled repo slug: alphanumeric, dot, dash, underscore. No whitespace,\n * slashes, or URL-encodable special characters. Multi-segment aggregate `name`\n * values produce 404 URLs, so callers fall back to the profile URL when\n * invalid. See sifa-web#1071 / sifa-web#1072.\n */\nconst TANGLED_REPO_SLUG = /^[a-zA-Z0-9._-]+$/;\n\nfunction stringOrNull(value: unknown): string | null {\n  if (typeof value !== 'string') return null;\n  const trimmed = value.trim();\n  return trimmed.length > 0 ? trimmed : null;\n}\n\n// at://did:plc:xxx/community.lexicon.calendar.event/rkey\n//   -> { did: \"did:plc:xxx\", rkey: \"rkey\" }\nfunction parseAtUri(atUri: string): { did: string; rkey: string } | null {\n  const match = atUri.match(/^at:\\/\\/(did:[^/]+)\\/[^/]+\\/(.+)$/);\n  if (!match || !match[1] || !match[2]) return null;\n  return { did: match[1], rkey: match[2] };\n}\n\n/**\n * Resolve the canonical clickable URL for an activity item **and** how its\n * liveness should be checked — the single source of truth shared by:\n * - sifa-web activity cards (which render `.url`), and\n * - the sifa-api link-health scanner (which switches on `.strategy`: probe the\n *   record's PDS for `record`-strategy cards, probe the URL for `url`).\n *\n * See {@link CardHealthStrategy} for why self-permalinks (bsky posts, etc.)\n * must be verified by record existence rather than an HTTP probe of the app.\n *\n * Resolution order:\n * 1. Per-collection bespoke logic (tangled, kipclip, margin, smokesignal\n *    rsvp, standard documents). These mirror the inline logic in the\n *    individual card components.\n * 2. Generic `record.url` field (used by hyperboards and similar).\n * 3. Pattern-based per-item / profile URL from the registry.\n */\nexport function resolveCardHealth(item: ActivityItemForUrl): CardHealth {\n  const { collection, record, uri, rkey, authorDid, authorHandle } = item;\n  const appId = getAppIdForCollection(collection);\n\n  // --- Per-collection bespoke logic (mirrors the card components) ---\n\n  // Tangled: prefer per-repo URL `https://tangled.sh/{handle}/{slug}`. The slug\n  // is `record.name` (legacy format) or — when `name` is absent — the record's\n  // rkey (newer repos use the slug as the rkey). The rkey fallback is scoped to\n  // `sh.tangled.repo`; other tangled collections (e.g. feed.star) use TID rkeys\n  // that are not repo slugs. Only when the slug is valid — multi-segment\n  // aggregate names (whitespace, slashes, special chars) would 404. See\n  // sifa-web#1071. The repo record itself is the card's subject, so it is\n  // verified by the record's existence.\n  if (collection.startsWith('sh.tangled.')) {\n    const repoName = stringOrNull(record.name) ?? (collection === 'sh.tangled.repo' ? rkey : null);\n    if (repoName && authorHandle && TANGLED_REPO_SLUG.test(repoName)) {\n      return recordHealth(`https://tangled.sh/${authorHandle}/${repoName}`);\n    }\n    return patternHealth('tangled', { handle: authorHandle, did: authorDid, rkey }, collection);\n  }\n\n  // Kipclip / community.lexicon.bookmarks: the bookmark subject IS the URL —\n  // a foreign page whose reachability is independent of the bookmark record.\n  if (\n    collection.startsWith('com.kipclip.') ||\n    collection.startsWith('community.lexicon.bookmarks.')\n  ) {\n    const subject = stringOrNull(record.subject);\n    if (subject) return urlHealth(subject);\n    return patternHealth('kipclip', { handle: authorHandle, did: authorDid, rkey });\n  }\n\n  // Margin bookmark: card returns null entirely without record.source\n  if (collection === 'at.margin.bookmark') {\n    return urlHealth(stringOrNull(record.source));\n  }\n\n  // Margin note / annotation: both are W3C web annotations whose `target.source`\n  // is the annotated page URL. Link to that source; fall back to the margin app.\n  if (collection === 'at.margin.annotation' || collection === 'at.margin.note') {\n    const target = record.target;\n    if (target != null && typeof target === 'object') {\n      const source = stringOrNull((target as Record<string, unknown>).source);\n      if (source) return urlHealth(source);\n    }\n    return urlHealth(APP_URL_PATTERNS.margin?.profileUrlPattern ?? null);\n  }\n\n  // Community-calendar RSVP: parse the linked event uri. The URL points at a\n  // *different* record (the event), so probe the URL, not this RSVP record.\n  // Rendered via atmo.rsvp, which resolves any community.lexicon.calendar event\n  // by did+rkey (Smoke Signal is decommissioned; its permalinks are retired).\n  if (collection === 'community.lexicon.calendar.rsvp') {\n    const subject = record.subject;\n    if (subject != null && typeof subject === 'object') {\n      const subjectUri = stringOrNull((subject as Record<string, unknown>).uri);\n      if (subjectUri) {\n        const parsed = parseAtUri(subjectUri);\n        if (parsed) {\n          return urlHealth(`https://atmo.rsvp/p/${parsed.did}/e/${parsed.rkey}`);\n        }\n      }\n    }\n    return { url: null, strategy: 'none' };\n  }\n\n  // Community-calendar event itself: use item's own uri -> self-permalink on\n  // atmo.rsvp (same rationale as the RSVP block above).\n  if (collection === 'community.lexicon.calendar.event') {\n    const parsed = parseAtUri(uri);\n    if (parsed) {\n      return recordHealth(`https://atmo.rsvp/p/${parsed.did}/e/${parsed.rkey}`);\n    }\n    return { url: null, strategy: 'none' };\n  }\n\n  // atmo.rsvp event itself: use item's own uri -> self-permalink.\n  if (collection === 'quest.atmo.event') {\n    const parsed = parseAtUri(uri);\n    if (parsed) {\n      return recordHealth(`https://atmo.rsvp/p/${parsed.did}/e/${parsed.rkey}`);\n    }\n    return { url: null, strategy: 'none' };\n  }\n\n  // atmo.rsvp checkin: parse the linked event uri (record.event) and link to\n  // that event's page (mirrors smokesignal rsvp). The URL points at a\n  // *different* record (the event), so probe the URL. The checkin's own rkey is\n  // not addressable, so without a valid event reference it's non-clickable.\n  if (collection === 'quest.atmo.checkin') {\n    const eventUri = stringOrNull(record.event);\n    if (eventUri) {\n      const parsed = parseAtUri(eventUri);\n      if (parsed) {\n        return urlHealth(`https://atmo.rsvp/p/${parsed.did}/e/${parsed.rkey}`);\n      }\n    }\n    return { url: null, strategy: 'none' };\n  }\n\n  // atmoBB forum (atmobb.app): the universal viewer renders any thread at\n  // /t/{thread-owner-did}/{thread-rkey}. A discussion reply has no own URL — it\n  // lives inside its parent thread, so parse record.thread.uri and link there.\n  // That URL points at a *different* record (the thread), so probe the URL.\n  if (collection === 'app.atmobb.discussion.reply') {\n    const thread = record.thread;\n    if (thread != null && typeof thread === 'object') {\n      const threadUri = stringOrNull((thread as Record<string, unknown>).uri);\n      if (threadUri) {\n        const parsed = parseAtUri(threadUri);\n        if (parsed) {\n          return urlHealth(`https://atmobb.app/t/${parsed.did}/${parsed.rkey}`);\n        }\n      }\n    }\n    return { url: null, strategy: 'none' };\n  }\n\n  // atmoBB thread itself: build the per-thread URL from the item's own uri — a\n  // self-permalink for this record (record-checkable). Other app.atmobb.*\n  // collections (actor.profile, forum.*) are excluded upstream by sifa-api and\n  // never reach the resolver.\n  if (collection === 'app.atmobb.discussion.thread') {\n    const parsed = parseAtUri(uri);\n    if (parsed) {\n      return recordHealth(`https://atmobb.app/t/${parsed.did}/${parsed.rkey}`);\n    }\n    return { url: null, strategy: 'none' };\n  }\n\n  // atstore reviews: no per-review URL exists on atstore.fyi, and user profile\n  // pages don't exist either. Deep-link to the reviewed product instead.\n  // The slug comes from record.listingMeta (enriched by sifa-api from the\n  // review's `subject` at-uri → fyi.atstore.listing.detail record). The product\n  // page is a *different* subject, so probe the URL.\n  if (collection === 'fyi.atstore.listing.review') {\n    const listingMeta = record.listingMeta;\n    if (listingMeta != null && typeof listingMeta === 'object') {\n      const slug = stringOrNull((listingMeta as Record<string, unknown>).slug);\n      if (slug) return urlHealth(`https://atstore.fyi/products/${encodeURIComponent(slug)}`);\n    }\n    return urlHealth(APP_URL_PATTERNS.atstore?.profileUrlPattern ?? null);\n  }\n\n  // Crate content: link to the canonical published location the maker\n  // recorded (a YouTube/podcast/personal-site URL) — a foreign page. Crate is\n  // an authoring dashboard with no public per-record viewer, so `note`\n  // records — which carry no canonicalUrl — render non-clickable (null).\n  if (collection === 'social.crate.content') {\n    return urlHealth(stringOrNull(record.canonicalUrl));\n  }\n  if (collection === 'social.crate.note') {\n    return { url: null, strategy: 'none' };\n  }\n\n  // Standard documents: siteUrl + path (or just siteUrl) — an external site.\n  if (collection.startsWith('site.standard.')) {\n    const siteUrl = stringOrNull(record.siteUrl);\n    const path = stringOrNull(record.path);\n    if (siteUrl && path) return urlHealth(`${siteUrl}${path}`);\n    if (siteUrl) return urlHealth(siteUrl);\n    // Fall through to generic record.url / patterns\n  }\n\n  // Kich recipe: always link to the Kich recipe page. record.url is the\n  // *source* the recipe was imported from (a YouTube video, a blog), which the\n  // card shows as secondary attribution — not the primary link. Must run before\n  // the generic record.url fallback below, which would otherwise hijack it. The\n  // recipe page is a first-party permalink for this record.\n  if (collection === 'io.kich.recipe.recipe') {\n    return patternHealth('kich', { handle: authorHandle, did: authorDid, rkey }, collection);\n  }\n\n  // recipe.exchange: same shape as Kich — the record's attribution.url points\n  // at the original source (a blog/video), not the app. Always link to the\n  // recipe.exchange page. Must run before the generic fallback below.\n  if (collection === 'exchange.recipe.recipe') {\n    return patternHealth('recipe', { handle: authorHandle, did: authorDid, rkey }, collection);\n  }\n\n  // --- Generic fallbacks ---\n\n  // record.url is a common ad-hoc per-item URL (hyperboards, etc.). It is an\n  // arbitrary foreign URL, so probe it directly.\n  const recordUrl = stringOrNull(record.url);\n  if (recordUrl) return urlHealth(recordUrl);\n\n  // Pattern-based fallback. Pass `collection` so app-specific guards (bluesky\n  // restricting /post/{rkey} to app.bsky.feed.post) can apply. The tier\n  // (per-item vs profile) decides record- vs url-strategy.\n  return patternHealth(appId, { handle: authorHandle, did: authorDid, rkey }, collection);\n}\n\n/**\n * Resolve the canonical clickable URL for an activity item — the same URL\n * the activity-card UI in sifa-web renders. Thin wrapper over\n * {@link resolveCardHealth}; returns `null` when no link is appropriate.\n */\nexport function resolveCardUrl(item: ActivityItemForUrl): string | null {\n  return resolveCardHealth(item).url;\n}\n","/**\n * Per-collection visibility rules for activity items.\n *\n * These rules express \"this record has nothing meaningful to render as a card\"\n * — e.g. a BookHive shelf-add with no review/stars, or a BeaconBits pin with\n * no shout. They are a UX/card concern, distinct from the api-side blocklists\n * in sifa-api/atproto-app-registry that exclude whole collections (likes,\n * follows, games) or filter spammy record shapes (empty quote posts).\n *\n * Used in two places:\n * - sifa-api's activity feed pagination, so a page-of-N returns N visible\n *   items rather than silently-dropped placeholders.\n * - sifa-web's activity-feed component (and as defense-in-depth in the card\n *   components themselves), so the client never relies on a stale api.\n *\n * Adding a new rule = one PR to this file. Unknown collections default to\n * visible, so the rule set is purely additive — adding a rule can only ever\n * hide more, never expose what was hidden before.\n */\n\ntype VisibilityPredicate = (record: Record<string, unknown>) => boolean;\n\nfunction isNonEmptyString(value: unknown): boolean {\n  return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction bookhiveHasOpinion(record: Record<string, unknown>): boolean {\n  const review = typeof record.review === 'string' ? record.review.trim() : '';\n  const stars = typeof record.stars === 'number' ? record.stars : 0;\n  return review.length > 0 || stars > 0;\n}\n\nfunction beaconbitsHasContent(record: Record<string, unknown>): boolean {\n  return isNonEmptyString(record.shout) || record.post != null;\n}\n\nfunction marginBookmarkHasSource(record: Record<string, unknown>): boolean {\n  return isNonEmptyString(record.source);\n}\n\nfunction marginAnnotationHasBody(record: Record<string, unknown>): boolean {\n  const body = record.body;\n  if (typeof body === 'string') return body.trim().length > 0;\n  if (body != null && typeof body === 'object') {\n    const value = (body as Record<string, unknown>).value;\n    return typeof value === 'string' && value.trim().length > 0;\n  }\n  return false;\n}\n\n/**\n * A badge response is the recipient's own accept/decline of a badge someone\n * else awarded them. An accepted one is a credential the person holds and is\n * worth surfacing; a rejected one is not, and publishing someone's declined\n * badges would be a poor call. Anything other than \"accepted\" stays hidden.\n */\nfunction certifiedBadgeAccepted(record: Record<string, unknown>): boolean {\n  return record.response === 'accepted';\n}\n\nexport const ACTIVITY_VISIBILITY_RULES: Readonly<Record<string, VisibilityPredicate>> =\n  Object.freeze({\n    'buzz.bookhive.book': bookhiveHasOpinion,\n    'app.beaconbits.beacon': beaconbitsHasContent,\n    'at.margin.bookmark': marginBookmarkHasSource,\n    'at.margin.annotation': marginAnnotationHasBody,\n    'app.certified.badge.response': certifiedBadgeAccepted,\n  });\n\n/**\n * Return true if the activity item should render a card in the timeline.\n * Records that fail the rule for their collection are dropped silently —\n * they exist in the user's PDS but carry no card-worthy content.\n *\n * Unknown collections (no registered rule) default to visible.\n */\nexport function isVisibleActivityItem(collection: string, record: unknown): boolean {\n  if (record === null || typeof record !== 'object') return false;\n  const rule = ACTIVITY_VISIBILITY_RULES[collection];\n  if (!rule) return true;\n  return rule(record as Record<string, unknown>);\n}\n","/**\n * Adult-content gating for Bluesky activity items.\n *\n * Bluesky's official moderation labeler attaches content labels to\n * `app.bsky.feed.defs#postView.labels`. The four sex-and-violence labels\n * below are the ones we hide by default on Sifa: media is replaced with an\n * `<AdultContentWarning>` placeholder card in sifa-web. Authenticated\n * viewers can reveal per-card; anonymous viewers cannot.\n *\n * The list mirrors Bluesky's own globalLabelStrings; if the official set\n * grows (e.g. a new `extreme-violence` label), update this constant.\n *\n * Why a constant + predicate live in the SDK: the same logic needs to run\n * in sifa-web today and sifa-app tomorrow, and the API only forwards the\n * raw labels — the hide decision is a client concern.\n */\n\nexport const ADULT_CONTENT_LABELS = ['porn', 'sexual', 'nudity', 'graphic-media'] as const;\n\nexport type AdultContentLabel = (typeof ADULT_CONTENT_LABELS)[number];\n\n/**\n * A single label entry as emitted by `app.bsky.feed.defs#postView.labels`.\n * Matches `com.atproto.label.defs#label` (the on-wire shape after the AppView\n * resolves a `postView`). `neg: true` marks a retraction.\n */\nexport interface ActivityLabel {\n  val: string;\n  src: string;\n  uri: string;\n  cts?: string;\n  neg?: boolean;\n}\n\n/**\n * Return true if the item carries at least one adult-content label that is\n * not negated. Items without a `labels` field (every non-Bluesky source,\n * legacy responses) are treated as safe.\n */\nexport function hasAdultContent(item: { labels?: ActivityLabel[] }): boolean {\n  const labels = item.labels;\n  if (!labels || labels.length === 0) return false;\n  return labels.some(\n    (label) => !label.neg && (ADULT_CONTENT_LABELS as readonly string[]).includes(label.val),\n  );\n}\n","/**\n * Publisher registry — single source of truth for apps that publish documents\n * through the shared `site.standard.*` namespace (Leaflet, Pckt, Offprint, …).\n *\n * Why this exists:\n * A document published via Leaflet, Pckt, Offprint, etc. lives canonically as a\n * `site.standard.document` record. The publisher is metadata, identifiable from\n * the publication's hostname. The activity-card, the publication merger in\n * sifa-api, and the external-URL health scanner all need the same hostname →\n * publisher mapping. Keeping it in one place stops the registry from drifting.\n *\n * What lives here:\n * - `id`     — stable appId, also keys sifa-web's branding (logo, color)\n * - `name`   — display name\n * - `hostSuffixes` — hostnames that identify a publication URL as this publisher\n * - `homeUrl` — last-resort URL when no per-document URL is available\n *\n * What does NOT live here:\n * - Logo components, color tokens, React chrome — those belong in sifa-web\n *   keyed by `id`.\n * - Per-document URL construction — Standard documents are always\n *   `${publication.url}${document.path}`. The publisher doesn't change that.\n */\n\nexport interface Publisher {\n  /**\n   * Stable identifier. Used as the `appId` across Sifa so that sifa-web's\n   * `getAppMeta(id)` lookup yields the right logo and color, and so that\n   * activity-stat rows tag correctly.\n   */\n  id: string;\n\n  /** Display name shown in pills and headers. */\n  name: string;\n\n  /**\n   * Hostnames that identify a publication URL as belonging to this publisher.\n   * Matches the publication URL's hostname when it equals the suffix\n   * (e.g. `leaflet.pub`) OR ends with it as a dotted suffix\n   * (e.g. `notesbyarielm.leaflet.pub`).\n   *\n   * Allow multiple entries to future-proof against rebrands or aliases.\n   */\n  hostSuffixes: readonly string[];\n\n  /** Public homepage of the publisher, used as a profile-level fallback URL. */\n  homeUrl: string;\n}\n\n/**\n * Neutral fallback used when no branded publisher matches.\n *\n * Synthetic publishers returned by `getPublisherFromSiteUrl` use this `id` but\n * carry the document's own hostname in `name`, so cards can still show e.g.\n * \"feeds.byarielm.fyi\" as the publisher label.\n */\nexport const STANDARD_PUBLISHER_ID = 'standard' as const;\n\nexport const PUBLISHERS: readonly Publisher[] = Object.freeze([\n  {\n    id: 'leaflet',\n    name: 'Leaflet',\n    hostSuffixes: ['leaflet.pub'],\n    homeUrl: 'https://leaflet.pub',\n  },\n  {\n    id: 'pckt',\n    name: 'pckt',\n    hostSuffixes: ['pckt.blog'],\n    homeUrl: 'https://pckt.blog',\n  },\n  {\n    id: 'offprint',\n    name: 'Offprint',\n    hostSuffixes: ['offprint.app'],\n    homeUrl: 'https://offprint.app',\n  },\n  {\n    id: 'whitewind',\n    name: 'WhiteWind',\n    hostSuffixes: ['whtwnd.com'],\n    homeUrl: 'https://whtwnd.com',\n  },\n  {\n    id: 'unthread',\n    name: 'Unthread',\n    hostSuffixes: ['unthread.at'],\n    homeUrl: 'https://unthread.at',\n  },\n  {\n    id: 'blento',\n    name: 'Blento',\n    hostSuffixes: ['blento.io'],\n    homeUrl: 'https://blento.io',\n  },\n]);\n\nconst PUBLISHERS_BY_ID: ReadonlyMap<string, Publisher> = new Map(PUBLISHERS.map((p) => [p.id, p]));\n\n/** Lookup a registered publisher by id. Returns `undefined` for unknown ids. */\nexport function getPublisherById(id: string): Publisher | undefined {\n  return PUBLISHERS_BY_ID.get(id);\n}\n\n/**\n * Match a hostname against the registry. Returns the registered publisher when\n * the hostname equals or is a dotted-subdomain of any of its `hostSuffixes`.\n * Returns `undefined` when no match is found (caller decides on the fallback).\n */\nexport function getPublisherByHost(hostname: string): Publisher | undefined {\n  const host = hostname.toLowerCase();\n  for (const publisher of PUBLISHERS) {\n    for (const suffix of publisher.hostSuffixes) {\n      if (host === suffix || host.endsWith(`.${suffix}`)) {\n        return publisher;\n      }\n    }\n  }\n  return undefined;\n}\n\n/**\n * Resolve the publisher for a publication's site URL.\n *\n * - On a branded host: returns the registered `Publisher` verbatim.\n * - On any other valid URL: returns a synthetic neutral publisher with\n *   `id: 'standard'`, `name: <hostname>`, `hostSuffixes: []`, and the URL\n *   as `homeUrl`. Cards can therefore always render a meaningful pill label.\n * - On an unparseable string: returns the same neutral shape with the raw\n *   input as `name` and `homeUrl` (defensive — should never happen for data\n *   coming from a valid `site.standard.publication`).\n */\nexport function getPublisherFromSiteUrl(siteUrl: string): Publisher {\n  let hostname: string;\n  let homeUrl: string;\n  try {\n    const parsed = new URL(siteUrl);\n    hostname = parsed.hostname;\n    homeUrl = `${parsed.protocol}//${parsed.hostname}`;\n  } catch {\n    return {\n      id: STANDARD_PUBLISHER_ID,\n      name: siteUrl,\n      hostSuffixes: [],\n      homeUrl: siteUrl,\n    };\n  }\n\n  const matched = getPublisherByHost(hostname);\n  if (matched) return matched;\n\n  return {\n    id: STANDARD_PUBLISHER_ID,\n    name: hostname,\n    hostSuffixes: [],\n    homeUrl,\n  };\n}\n","{\n  \"$schema\": \"https://sifa.id/schemas/activity-verbs/v1.json\",\n  \"version\": \"1.1.0\",\n  \"updated\": \"2026-07-19\",\n  \"defaultVerb\": \"created\",\n  \"verbs\": {\n    \"app.bsky.feed.post\": \"posted\",\n    \"blue.flashes.feed.post\": \"posted\",\n    \"social.psky.feed.post\": \"posted\",\n    \"social.popfeed.feed.post\": \"posted\",\n    \"social.popfeed.feed.note\": \"posted\",\n    \"social.popfeed.feed.review\": \"reviewed\",\n    \"buzz.bookhive.book\": \"reviewed\",\n    \"fyi.unravel.frontpage.post\": \"posted\",\n    \"forum.barazo.post\": \"posted\",\n    \"app.bsky.feed.repost\": \"reposted\",\n    \"com.whtwnd.blog.entry\": \"published\",\n    \"site.standard.document\": \"published\",\n    \"computer.aetheros.page\": \"published\",\n    \"link.pastesphere.snippet\": \"published\",\n    \"pub.leaflet.comment\": \"published\",\n    \"id.sifa.profile.presentation\": \"presented\",\n    \"id.sifa.profile.presentationDelivery\": \"presented\",\n    \"id.sifa.endorsement\": \"endorsed\",\n    \"sh.tangled.repo\": \"shipped\",\n    \"sh.tangled.repo.issue\": \"shipped\",\n    \"sh.tangled.repo.pull\": \"shipped\",\n    \"app.sidetrail.trail\": \"shipped\",\n    \"app.sidetrail.walk\": \"shipped\",\n    \"social.colibri.membership\": \"joined\",\n    \"community.lexicon.calendar.rsvp\": \"joined\",\n    \"at.youandme.connection\": \"joined\",\n    \"id.sifa.graph.connection\": \"joined\"\n  }\n}\n","import { z } from 'zod';\n\nimport rawVerbs from './verbs.json' with { type: 'json' };\n\n/**\n * The human action a stream item represents — a layer on top of `collection`\n * + `tier`. Groups semantically across apps (\"published\" spans WhiteWind and\n * standard-site; \"posted\" spans Bluesky and Picosky) so a day-grouped feed\n * reads like sentences.\n */\nexport const STREAM_VERBS = [\n  'posted',\n  'reposted',\n  'published',\n  'presented',\n  'endorsed',\n  'joined',\n  'shipped',\n  'reviewed',\n  'created',\n] as const;\n\nexport type StreamVerb = (typeof STREAM_VERBS)[number];\n\n/** Zod enum for a {@link StreamVerb}, shared with the view-model schema. */\nexport const streamVerbSchema = z.enum(STREAM_VERBS);\n\nexport interface ActivityVerbMap {\n  version: string;\n  updated: string;\n  /** Verb returned for any collection not present in `verbs`. */\n  defaultVerb: StreamVerb;\n  /** Verb keyed by lexicon NSID. */\n  verbs: Record<string, StreamVerb>;\n}\n\nconst verbMapSchema = z.object({\n  version: z.string(),\n  updated: z.string(),\n  defaultVerb: streamVerbSchema,\n  verbs: z.record(z.string(), streamVerbSchema),\n});\n\nconst parsed: ActivityVerbMap = verbMapSchema.parse(rawVerbs);\n\n/**\n * The verb map, keyed by lexicon NSID. Versioned independently from\n * `activity-tiers.json` so tier and verb evolve on their own cadence.\n */\nexport const ACTIVITY_VERBS: Readonly<ActivityVerbMap> = Object.freeze(parsed);\n\n/**\n * Returns the {@link StreamVerb} for an AT Protocol collection NSID. Unknown\n * or empty collections fall back to the map's `defaultVerb` (`created`).\n */\nexport function verbForCollection(collection: string): StreamVerb {\n  if (!collection) return ACTIVITY_VERBS.defaultVerb;\n  return ACTIVITY_VERBS.verbs[collection] ?? ACTIVITY_VERBS.defaultVerb;\n}\n\n/** Verb-map version + updated date, for diagnostics and version-skew checks. */\nexport function getActivityVerbsVersion(): { version: string; updated: string } {\n  return { version: ACTIVITY_VERBS.version, updated: ACTIVITY_VERBS.updated };\n}\n","import { z } from 'zod';\n\nimport type {\n  StreamAddress,\n  StreamAuthor,\n  StreamCardBody,\n  StreamCardSubject,\n  StreamCardVM,\n  StreamExternalLink,\n  StreamGeo,\n  StreamMedia,\n  StreamRichSegment,\n  StreamSource,\n  StreamTheme,\n} from './stream-card-vm.js';\nimport { streamVerbSchema } from './verbs.js';\n\n/** RGB channel: finite number in [0, 255] (mirrors `isValidRgbColor`). */\nconst rgbChannelSchema = z.number().min(0).max(255);\nconst rgbColorSchema = z.object({\n  r: rgbChannelSchema,\n  g: rgbChannelSchema,\n  b: rgbChannelSchema,\n});\n\nconst aspectRatioSchema = z.object({\n  width: z.number(),\n  height: z.number(),\n});\n\nexport const streamSourceSchema: z.ZodType<StreamSource> = z.object({\n  appId: z.string(),\n  label: z.string(),\n  color: z.string(),\n});\n\nexport const streamAuthorSchema: z.ZodType<StreamAuthor> = z.object({\n  did: z.string().optional(),\n  handle: z.string().optional(),\n  displayName: z.string().optional(),\n  avatar: z.string().optional(),\n});\n\nexport const streamThemeSchema: z.ZodType<StreamTheme> = z.object({\n  background: rgbColorSchema,\n  foreground: rgbColorSchema,\n  accent: rgbColorSchema,\n});\n\nconst streamMediaResolvedSchema = z.object({\n  url: z.string(),\n  alt: z.string(),\n  aspectRatio: aspectRatioSchema.optional(),\n  mimeType: z.string().optional(),\n});\n\nconst streamMediaBlobSchema = z.object({\n  did: z.string(),\n  cid: z.string(),\n  alt: z.string(),\n  aspectRatio: aspectRatioSchema.optional(),\n  mimeType: z.string().optional(),\n});\n\nexport const streamMediaSchema: z.ZodType<StreamMedia> = z.union([\n  streamMediaResolvedSchema,\n  streamMediaBlobSchema,\n]);\n\nexport const streamExternalLinkSchema: z.ZodType<StreamExternalLink> = z.object({\n  url: z.string(),\n  title: z.string().optional(),\n  thumb: z.string().optional(),\n});\n\nexport const streamGeoSchema: z.ZodType<StreamGeo> = z.object({\n  latitude: z.number(),\n  longitude: z.number(),\n});\n\nexport const streamAddressSchema: z.ZodType<StreamAddress> = z.object({\n  name: z.string().optional(),\n  street: z.string().optional(),\n  locality: z.string().optional(),\n  region: z.string().optional(),\n  country: z.string().optional(),\n  postalCode: z.string().optional(),\n});\n\nexport const streamRichSegmentSchema: z.ZodType<StreamRichSegment> = z.object({\n  text: z.string(),\n  link: z.string().optional(),\n  mention: z.string().optional(),\n  tag: z.string().optional(),\n});\n\nexport const streamCardBodySchema: z.ZodType<StreamCardBody> = z.discriminatedUnion('kind', [\n  z.object({\n    kind: z.literal('text'),\n    text: z.string(),\n    richSegments: z.array(streamRichSegmentSchema).optional(),\n    tags: z.array(z.string()).optional(),\n  }),\n  z.object({\n    kind: z.literal('media'),\n    text: z.string().optional(),\n    tags: z.array(z.string()).optional(),\n  }),\n  z.object({\n    kind: z.literal('link'),\n    text: z.string().optional(),\n    tags: z.array(z.string()).optional(),\n  }),\n  z.object({\n    kind: z.literal('track'),\n    text: z.string().optional(),\n    trackTitle: z.string().optional(),\n    artist: z.string().optional(),\n  }),\n  z.object({\n    kind: z.literal('generic'),\n    text: z.string().optional(),\n    tags: z.array(z.string()).optional(),\n  }),\n  z.object({\n    kind: z.literal('github-pr'),\n    repoOwner: z.string(),\n    repoName: z.string(),\n    prNumber: z.number(),\n    title: z.string(),\n    url: z.string().optional(),\n    language: z.string().optional(),\n    additions: z.number(),\n    deletions: z.number(),\n    mergedAt: z.string().optional(),\n  }),\n  z.object({\n    kind: z.literal('book'),\n    title: z.string(),\n    authors: z.array(z.string()),\n    stars: z.number().optional(),\n    status: z.string().optional(),\n    review: z.string().optional(),\n  }),\n  z.object({\n    kind: z.literal('media-review'),\n    reviewKind: z.enum(['review', 'post', 'note', 'other']),\n    title: z.string().optional(),\n    mediaType: z.string().optional(),\n    rating: z.number().optional(),\n    mainCredit: z.string().optional(),\n    reviewText: z.string().optional(),\n    isRevisit: z.boolean(),\n  }),\n  z.object({\n    kind: z.literal('event-rsvp'),\n    rsvpStatus: z.enum(['going', 'interested', 'notgoing', 'unknown']),\n    eventName: z.string().optional(),\n    startsAt: z.string().optional(),\n    endsAt: z.string().optional(),\n    mode: z.enum(['inperson', 'virtual', 'hybrid']).optional(),\n    locationName: z.string().optional(),\n    locationLocality: z.string().optional(),\n    locationCountry: z.string().optional(),\n  }),\n  z.object({\n    kind: z.literal('verification'),\n    platform: z.string(),\n    verified: z.boolean(),\n    subjectLabel: z.string().optional(),\n    handle: z.string().optional(),\n    profileUrl: z.string().optional(),\n  }),\n  z.object({\n    kind: z.literal('membership'),\n    communityName: z.string().optional(),\n    description: z.string().optional(),\n    communityUri: z.string().optional(),\n  }),\n  z.object({\n    kind: z.literal('location'),\n    venueName: z.string().optional(),\n    shout: z.string().optional(),\n    address: streamAddressSchema.optional(),\n    geo: streamGeoSchema.optional(),\n  }),\n  z.object({\n    kind: z.literal('travel'),\n    origin: z.string().optional(),\n    destination: z.string().optional(),\n    transportation: z.string().optional(),\n    carrier: z.string().optional(),\n    carrierCode: z.string().optional(),\n    startDate: z.string().optional(),\n    endDate: z.string().optional(),\n  }),\n  z.object({\n    kind: z.literal('standard-site'),\n    title: z.string().optional(),\n    description: z.string().optional(),\n    siteUrl: z.string().optional(),\n    path: z.string().optional(),\n    publisherName: z.string().optional(),\n    icon: z.string().optional(),\n    coverImageUrl: z.string().optional(),\n    readingTime: z.number().optional(),\n    publishedAt: z.string().optional(),\n  }),\n]);\n\n/**\n * A stream item's repost / reply / quote target. The `post` variant nests a\n * full {@link streamCardVMSchema} (deferred via `z.lazy` for recursion).\n */\nexport const streamCardSubjectSchema: z.ZodType<StreamCardSubject> = z.discriminatedUnion('kind', [\n  z.object({\n    kind: z.literal('post'),\n    post: z.lazy(() => streamCardVMSchema),\n  }),\n  z.object({\n    kind: z.literal('person'),\n    did: z.string(),\n    handle: z.string().optional(),\n    displayName: z.string().optional(),\n    avatar: z.string().optional(),\n  }),\n  z.object({\n    kind: z.literal('record'),\n    uri: z.string(),\n    title: z.string().optional(),\n  }),\n]);\n\n/** Hypercert credit roll + outbound links, hydrated by sifa-api. */\nconst hypercertDetailsSchema = z.object({\n  contributors: z.array(\n    z.object({\n      displayName: z.string(),\n      imageUrl: z.string().optional(),\n      identifier: z.string().optional(),\n      weight: z.number().optional(),\n    }),\n  ),\n  contributorCount: z.number(),\n  attachments: z.array(z.object({ title: z.string().optional(), url: z.string() })),\n});\n\n/** An account a Certified record points at. */\nconst certifiedActorSchema = z.object({\n  did: z.string(),\n  handle: z.string(),\n  displayName: z.string().optional(),\n  avatar: z.string().optional(),\n});\n\n/** Certified badge + resolved accounts, hydrated by sifa-api. */\nconst certifiedDetailsSchema = z.object({\n  badge: z\n    .object({\n      title: z.string(),\n      description: z.string().optional(),\n      icon: z.string().optional(),\n      badgeType: z.string().optional(),\n    })\n    .optional(),\n  recipient: certifiedActorSchema.optional(),\n  issuer: certifiedActorSchema.optional(),\n  group: certifiedActorSchema.optional(),\n  role: z.string().optional(),\n});\n\n/** Zod schema for a {@link StreamCardVM}. Recursive through `subject.post`. */\nexport const streamCardVMSchema: z.ZodType<StreamCardVM> = z.lazy(() =>\n  z.object({\n    uri: z.string(),\n    cid: z.string(),\n    verb: streamVerbSchema,\n    source: streamSourceSchema,\n    author: streamAuthorSchema.optional(),\n    tier: z.enum(['creation', 'action', 'filtered']),\n    timestamp: z.string(),\n    title: z.string(),\n    sourceUrl: z.string().optional(),\n    body: streamCardBodySchema.optional(),\n    media: z.array(streamMediaSchema).optional(),\n    externalLink: streamExternalLinkSchema.optional(),\n    theme: streamThemeSchema.optional(),\n    subject: z.lazy(() => streamCardSubjectSchema).optional(),\n    hypercertDetails: hypercertDetailsSchema.optional(),\n    certifiedDetails: certifiedDetailsSchema.optional(),\n  }),\n);\n","import { z } from 'zod';\n\n/**\n * Grapheme-aware refinement matching the AT Protocol lexicon `maxGraphemes`\n * constraint. JS strings are sequences of UTF-16 code units, but lexicon\n * `maxGraphemes` counts user-perceived characters (grapheme clusters), so\n * emoji sequences, regional indicators, ZWJ joins, and combining marks all\n * count as one unit each. We use `Intl.Segmenter` to enforce this correctly.\n */\nexport function maxGraphemes(max: number) {\n  return (value: string): boolean => {\n    const segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });\n    let count = 0;\n    for (const _ of segmenter.segment(value)) {\n      count++;\n      if (count > max) return false;\n    }\n    return true;\n  };\n}\n\n/** Decentralized identifier, AT Protocol `format: did`. */\nexport const didSchema = z.string().regex(/^did:[a-z]+:[a-zA-Z0-9._:%-]+$/, 'Invalid DID');\n\n/** RFC 3339 datetime with timezone offset, AT Protocol `format: datetime`. */\nexport const datetimeSchema = z.string().datetime({ offset: true });\n\n/**\n * Freeform calendar date for user-facing profile dates (start/end, issued,\n * completed, awarded, published, etc.). Accepts a bare year, year-month,\n * year-month-day, or a full datetime (so a legacy record's RFC-3339 date maps\n * through on backfill without loss). NOT strict `datetime` -- users typically\n * remember only month/year, and LinkedIn-importer writes carry partial dates,\n * so the lexicons document these as freeform `YYYY-MM` / `YYYY-MM-DD`. Record\n * metadata like `createdAt` stays on `datetimeSchema`.\n */\nexport const partialDateSchema = z\n  .string()\n  .regex(/^\\d{4}(-\\d{2}(-\\d{2}(T.+)?)?)?$/, 'Expected YYYY, YYYY-MM, YYYY-MM-DD, or a datetime');\n\n/** Generic AT-URI, AT Protocol `format: at-uri`. */\nexport const atUriSchema = z.string().regex(/^at:\\/\\/[^\\s]+$/, 'Invalid AT-URI');\n\n/** Content identifier, AT Protocol `format: cid`. Loose validation -- accepts CIDv0 and CIDv1. */\nexport const cidSchema = z\n  .string()\n  .regex(/^(Qm[1-9A-HJ-NP-Za-km-z]{44}|b[A-Za-z0-9+/=]+)$/, 'Invalid CID');\n\n/** BCP 47 language tag, AT Protocol `format: language`. */\nexport const languageTagSchema = z\n  .string()\n  .regex(/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/, 'Invalid BCP 47 language tag');\n\n/** Generic URI, AT Protocol `format: uri`. */\nexport const uriSchema = z.string().url();\n\n/**\n * StrongRef shape from `com.atproto.repo.strongRef` -- pins a record by both\n * AT-URI (identity) and CID (version).\n */\nexport const strongRefSchema = z.object({\n  uri: atUriSchema,\n  cid: cidSchema,\n});\n\n/**\n * Reference to an `id.sifa.profile.skill` record by AT-URI. Mirrors\n * `id.sifa.defs#skillRef`, which carries no CID at all: skills are mutable\n * records in the same user's repo, so the reference resolves live and tracks\n * edits to the target.\n */\nexport const skillRefSchema = z.object({\n  uri: atUriSchema,\n});\n\n/**\n * Reference to a record by AT-URI, with an optional CID. Mirrors\n * `id.sifa.defs#externalRecordRef`. Unlike a strongRef the CID is optional:\n * consumers resolve the AT-URI live so the reference tracks edits to the\n * target, and the CID is a best-effort integrity hint only.\n */\nexport const externalRecordRefSchema = z.object({\n  uri: atUriSchema,\n  cid: cidSchema.optional(),\n});\n\n/**\n * Self-labels shape from `com.atproto.label.defs#selfLabels`. Modelled\n * permissively because clients rarely construct this directly; the AppView\n * handles label validation.\n */\nexport const selfLabelsSchema = z.object({\n  $type: z.literal('com.atproto.label.defs#selfLabels').optional(),\n  values: z.array(z.object({ val: z.string() })),\n});\n","/**\n * Publisher allowlist for the Standard.site rich embed.\n *\n * Mirrors `bluesky-social/social-app`\n * `src/components/Post/Embed/StandardSiteEmbed/publishers.ts`. The only\n * gate this provides is which publishers get the highlighted\n * \"Subscribe on {Publisher}\" CTA with a publisher icon vs the plain\n * \"View publication\" fallback — any Standard.site embed renders\n * regardless of allowlist membership.\n *\n * Sync policy: review additions against the upstream bsky list weekly;\n * Singi Labs reviews before merge.\n */\n\nexport interface Publisher {\n  /** Lowercase host. Subdomains are matched via `hostMatches`. */\n  host: string;\n  /** Human-facing publisher name shown in CTA copy. */\n  name: string;\n  /**\n   * Stable identifier used by clients to look up brand icons. The SDK\n   * does not ship icon assets — sifa-web maintains them keyed by this\n   * id so React Native vs web rendering can diverge.\n   */\n  iconKey: 'leaflet' | 'pckt' | 'offprint';\n}\n\nexport const STANDARD_SITE_PUBLISHERS: readonly Publisher[] = Object.freeze([\n  { host: 'leaflet.pub', name: 'Leaflet', iconKey: 'leaflet' },\n  { host: 'pckt.blog', name: 'pckt', iconKey: 'pckt' },\n  { host: 'offprint.app', name: 'Offprint', iconKey: 'offprint' },\n]);\n\n/**\n * Returns true when `host` exactly matches `target` or is a subdomain of\n * it. Hosts are expected to be lowercase already.\n */\nexport function hostMatches(host: string, target: string): boolean {\n  return host === target || host.endsWith('.' + target);\n}\n\nfunction hostFromUri(uri: string | undefined | null): string | null {\n  if (!uri) return null;\n  try {\n    return new URL(uri).host.toLowerCase();\n  } catch {\n    return null;\n  }\n}\n\n/**\n * Match a publisher by host. Returns the publisher when `host` is on the\n * allowlist (exact or subdomain match), null otherwise. Host should be\n * lowercase.\n */\nexport function matchPublisherByHost(host: string | null | undefined): Publisher | null {\n  if (!host) return null;\n  const lower = host.toLowerCase();\n  return STANDARD_SITE_PUBLISHERS.find((p) => hostMatches(lower, p.host)) ?? null;\n}\n\n/**\n * Match a publisher by URI. Convenience wrapper around\n * `matchPublisherByHost` for callers that have a publication URL handy.\n */\nexport function matchPublisherByUri(uri: string | undefined | null): Publisher | null {\n  return matchPublisherByHost(hostFromUri(uri));\n}\n","import { resolveCardUrl } from '../cards/resolve-card-url.js';\nimport { isVisibleActivityItem } from '../cards/visibility.js';\nimport { isValidRgbColor } from '../format/wcag-contrast.js';\nimport { matchPublisherByUri } from '../publishing/index.js';\nimport { getActivityTier } from '../taxonomy/activity-tiers.js';\nimport type { ActivityItem } from './activity-item.js';\nimport type {\n  StreamAddress,\n  StreamAuthor,\n  StreamCardBody,\n  StreamCardSubject,\n  StreamCardVM,\n  StreamExternalLink,\n  StreamGeo,\n  StreamMedia,\n  StreamRichSegment,\n  StreamSource,\n  StreamTheme,\n} from './stream-card-vm.js';\nimport { verbForCollection, type StreamVerb } from './verbs.js';\n\n/** Neutral fallback token — matches sifa-api's synthetic app-registry entry. */\nconst DEFAULT_SOURCE_COLOR = 'slate';\n\n/**\n * Options for {@link toStreamCardVM}. Kept out of the record so the transform\n * stays pure (no I/O): the app registry is runtime data, so callers inject a\n * color resolver built from the registry they already fetched.\n */\nexport interface ToStreamCardVMOptions {\n  /**\n   * Resolve an app's design-token color NAME (not a hex literal) from its\n   * appId. Falls back to `slate` when unresolved.\n   */\n  resolveSourceColor?: (appId: string) => string | undefined;\n}\n\n// ---------------------------------------------------------------------------\n// Small pure helpers\n// ---------------------------------------------------------------------------\n\nfunction asRecord(value: unknown): Record<string, unknown> | null {\n  return value !== null && typeof value === 'object' ? (value as Record<string, unknown>) : null;\n}\n\nfunction asNonEmptyString(value: unknown): string | undefined {\n  return typeof value === 'string' && value.length > 0 ? value : undefined;\n}\n\n/** at://did:plc:xxx/collection/rkey → the authoring DID. */\nfunction didFromUri(uri: string): string | undefined {\n  const match = uri.match(/^at:\\/\\/(did:[^/]+)\\//);\n  return match?.[1];\n}\n\n/** Extract the CID from an AT Protocol blob ref (`ref.$link` or a bare string). */\nfunction blobCid(blob: unknown): string | undefined {\n  const rec = asRecord(blob);\n  if (!rec) return undefined;\n  const ref = rec.ref;\n  if (typeof ref === 'string') return ref;\n  const link = asRecord(ref)?.['$link'];\n  return typeof link === 'string' ? link : undefined;\n}\n\nfunction aspectRatio(value: unknown): { width: number; height: number } | undefined {\n  const rec = asRecord(value);\n  const width = rec?.width;\n  const height = rec?.height;\n  if (typeof width === 'number' && typeof height === 'number') return { width, height };\n  return undefined;\n}\n\nfunction asFiniteNumber(value: unknown): number | undefined {\n  return typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n}\n\n/**\n * Extract a blob CID tolerating both a proper blob (`ref.$link`) and the\n * denormalized `{ cid }` shape some apps (BookHive, Colibri) store.\n */\nfunction looseBlobCid(value: unknown): string | undefined {\n  const viaRef = blobCid(value);\n  if (viaRef) return viaRef;\n  const cid = asRecord(value)?.cid;\n  return typeof cid === 'string' && cid.length > 0 ? cid : undefined;\n}\n\n/** A single blob-ref media item from a blob value, or undefined when absent. */\nfunction blobMedia(value: unknown, did: string, alt: string): StreamMedia | undefined {\n  const cid = looseBlobCid(value);\n  if (!cid) return undefined;\n  const media: StreamMedia = { did, cid, alt };\n  const ratio = aspectRatio(asRecord(value)?.aspectRatio);\n  if (ratio) media.aspectRatio = ratio;\n  const mimeType = asNonEmptyString(asRecord(value)?.mimeType);\n  if (mimeType) media.mimeType = mimeType;\n  return media;\n}\n\n/** The `#suffix` of an NSID-with-hash value (`x#going` → `#going`), else ''. */\nfunction hashSuffix(value: string): string {\n  const i = value.lastIndexOf('#');\n  return i >= 0 ? value.slice(i) : '';\n}\n\nconst WORDS_PER_MINUTE = 200;\n\n/** Estimated reading time in minutes from body text (matches sifa-web). */\nfunction estimateReadingTime(text: string | undefined): number | undefined {\n  if (!text) return undefined;\n  const words = text.trim().split(/\\s+/).filter(Boolean).length;\n  if (words === 0) return undefined;\n  return Math.max(1, Math.round(words / WORDS_PER_MINUTE));\n}\n\n/** Parse a beacon `location` into numeric geo. Lat/long may be string or number. */\nfunction beaconGeo(value: unknown): StreamGeo | undefined {\n  const rec = asRecord(value);\n  if (!rec) return undefined;\n  const { latitude, longitude } = rec;\n  const okType = (v: unknown): v is string | number =>\n    typeof v === 'string' || typeof v === 'number';\n  if (!okType(latitude) || !okType(longitude)) return undefined;\n  const lat = Number(latitude);\n  const lng = Number(longitude);\n  if (!Number.isFinite(lat) || !Number.isFinite(lng)) return undefined;\n  return { latitude: lat, longitude: lng };\n}\n\n/** Parse a beacon `addressDetails` into a structured address, or undefined. */\nfunction beaconAddress(value: unknown): StreamAddress | undefined {\n  const rec = asRecord(value);\n  if (!rec) return undefined;\n  const address: StreamAddress = {};\n  const name = asNonEmptyString(rec.name);\n  if (name) address.name = name;\n  const street = asNonEmptyString(rec.street);\n  if (street) address.street = street;\n  const locality = asNonEmptyString(rec.locality);\n  if (locality) address.locality = locality;\n  const region = asNonEmptyString(rec.region);\n  if (region) address.region = region;\n  const country = asNonEmptyString(rec.country);\n  if (country) address.country = country;\n  const postalCode = asNonEmptyString(rec.postalCode);\n  if (postalCode) address.postalCode = postalCode;\n  return Object.keys(address).length > 0 ? address : undefined;\n}\n\n/** Split BookHive's tab-separated authors into a trimmed, non-empty list. */\nfunction parseAuthors(value: unknown): string[] {\n  if (typeof value !== 'string') return [];\n  return value\n    .split('\\t')\n    .map((a) => a.trim())\n    .filter((a) => a.length > 0);\n}\n\n// ---------------------------------------------------------------------------\n// Chrome\n// ---------------------------------------------------------------------------\n\nfunction buildSource(item: ActivityItem, options: ToStreamCardVMOptions): StreamSource {\n  return {\n    appId: item.appId,\n    label: item.appName,\n    color: options.resolveSourceColor?.(item.appId) ?? DEFAULT_SOURCE_COLOR,\n  };\n}\n\n/**\n * The author identity for a card, from the AppView-injected handle / display\n * name / avatar and the DID parsed from the record uri. Returns undefined when\n * nothing is known (e.g. a Fediverse post whose uri is an http permalink, not\n * an at-uri, and carries no injected author fields), so the field stays absent\n * rather than an empty object.\n */\nfunction buildAuthor(item: ActivityItem): StreamAuthor | undefined {\n  const did = didFromUri(item.uri);\n  const handle = asNonEmptyString(item.authorHandle);\n  const displayName = asNonEmptyString(item.authorDisplayName);\n  const avatar = asNonEmptyString(item.authorAvatar);\n  if (!did && !handle && !displayName && !avatar) return undefined;\n  const author: StreamAuthor = {};\n  if (did) author.did = did;\n  if (handle) author.handle = handle;\n  if (displayName) author.displayName = displayName;\n  if (avatar) author.avatar = avatar;\n  return author;\n}\n\n// Post-type verbs drop the app name (the source pill already shows it, so\n// \"Posted on Bluesky network\" reads as redundant); verbs where the platform\n// adds meaning keep \"on {App}\".\nconst TITLE_BY_VERB: Record<StreamVerb, (label: string) => string> = {\n  posted: () => 'Posted',\n  reposted: () => 'Reposted',\n  published: (label) => `Published on ${label}`,\n  presented: () => 'Gave a presentation',\n  endorsed: () => 'Wrote an endorsement',\n  joined: (label) => `Joined ${label}`,\n  shipped: (label) => `Shipped on ${label}`,\n  reviewed: (label) => `Reviewed on ${label}`,\n  created: (label) => `Shared on ${label}`,\n};\n\nfunction buildTitle(verb: StreamVerb, label: string): string {\n  return TITLE_BY_VERB[verb](label);\n}\n\n/**\n * The canonical http(s) permalink to this record on its source app, or\n * undefined. Delegates to the shared, pure {@link resolveCardUrl} using the\n * author DID parsed from the uri and the author handle — the AppView-injected\n * {@link ActivityItem.authorHandle}, falling back to a handle the record itself\n * carries. With a handle, handle-keyed apps (Bluesky, Popfeed, Tangled, ...)\n * resolve; did/uri/record.url-addressable apps (Smokesignal events, GitHub PRs,\n * Standard.site docs, ...) resolve from the uri alone. Only non-null http(s)\n * URLs are returned.\n */\nfunction resolveSourceUrl(item: ActivityItem, record: Record<string, unknown>): string | undefined {\n  const authorDid = didFromUri(item.uri);\n  if (!authorDid) return undefined;\n  const authorHandle = asNonEmptyString(item.authorHandle) ?? asNonEmptyString(record.handle);\n  const url = resolveCardUrl({\n    collection: item.collection,\n    record,\n    uri: item.uri,\n    rkey: item.rkey,\n    authorDid,\n    ...(authorHandle ? { authorHandle } : {}),\n  });\n  return url && /^https?:\\/\\//i.test(url) ? url : undefined;\n}\n\n/** Per-record RGB theme (publication / standard-site cards). Validated. */\nfunction readTheme(record: Record<string, unknown> | null): StreamTheme | undefined {\n  const theme = asRecord(record?.publicationTheme ?? record?.theme);\n  if (!theme) return undefined;\n  const { background, foreground, accent } = theme;\n  if (isValidRgbColor(background) && isValidRgbColor(foreground) && isValidRgbColor(accent)) {\n    return { background, foreground, accent };\n  }\n  return undefined;\n}\n\n// ---------------------------------------------------------------------------\n// Bluesky post body\n// ---------------------------------------------------------------------------\n\nfunction bskyImages(embed: Record<string, unknown>, did: string): StreamMedia[] {\n  const images = embed.images;\n  if (!Array.isArray(images)) return [];\n  const out: StreamMedia[] = [];\n  for (const raw of images) {\n    const img = asRecord(raw);\n    if (!img) continue;\n    const alt = asNonEmptyString(img.alt) ?? '';\n    const ratio = aspectRatio(img.aspectRatio);\n\n    // AppView-hydrated `app.bsky.embed.images#view`: the item carries resolved\n    // CDN URLs (`thumb`/`fullsize`) and no `image` blob. This is the shape\n    // sifa-api feeds the transform (mergeResolvedEmbed swaps the raw embed for\n    // the AppView view). Prefer the feed-sized `thumb`, matching sifa-web's\n    // `/activity` card.\n    const resolvedUrl = asNonEmptyString(img.thumb) ?? asNonEmptyString(img.fullsize);\n    if (resolvedUrl) {\n      const media: StreamMedia = { url: resolvedUrl, alt };\n      if (ratio) media.aspectRatio = ratio;\n      out.push(media);\n      continue;\n    }\n\n    // Raw record shape: images carry a blob ref; the host builds the CDN URL.\n    const cid = blobCid(img.image);\n    if (!cid) continue;\n    const media: StreamMedia = { did, cid, alt };\n    if (ratio) media.aspectRatio = ratio;\n    const mimeType = asNonEmptyString(asRecord(img.image)?.mimeType);\n    if (mimeType) media.mimeType = mimeType;\n    out.push(media);\n  }\n  return out;\n}\n\nfunction bskyExternal(embed: Record<string, unknown>): StreamExternalLink | undefined {\n  const external = asRecord(embed.external);\n  if (!external) return undefined;\n  const url = asNonEmptyString(external.uri);\n  if (!url) return undefined;\n  const link: StreamExternalLink = { url };\n  const title = asNonEmptyString(external.title);\n  if (title) link.title = title;\n  // AppView-hydrated `app.bsky.embed.external#view` carries a resolved CDN\n  // `thumb` URL (the raw record's thumb is a blob, but sifa-api's\n  // mergeResolvedEmbed swaps in the AppView view before the transform runs).\n  // Carrying it lets page.sifa.id render link/GIF posters instead of a bare\n  // text link. Only a string is accepted, so a raw blob ref is ignored.\n  const thumb = asNonEmptyString(external.thumb);\n  if (thumb) link.thumb = thumb;\n  return link;\n}\n\ninterface BskyEmbedContent {\n  media?: StreamMedia[];\n  externalLink?: StreamExternalLink;\n}\n\nfunction bskyEmbedContent(record: Record<string, unknown>, did: string): BskyEmbedContent {\n  const embed = asRecord(record.embed);\n  if (!embed) return {};\n\n  // recordWithMedia wraps the media (images/external) alongside a quoted record.\n  // Match both the raw record type and the AppView `#view` variant, since\n  // sifa-api feeds the hydrated view.\n  const type = asNonEmptyString(embed['$type']);\n  const isRecordWithMedia =\n    type === 'app.bsky.embed.recordWithMedia' || type === 'app.bsky.embed.recordWithMedia#view';\n  const target = isRecordWithMedia ? asRecord(embed.media) : embed;\n  if (!target) return {};\n\n  if (Array.isArray(target.images)) {\n    const media = bskyImages(target, did);\n    return media.length > 0 ? { media } : {};\n  }\n  if (target.external != null) {\n    const externalLink = bskyExternal(target);\n    return externalLink ? { externalLink } : {};\n  }\n  return {};\n}\n\nfunction applyBskyPost(\n  vm: StreamCardVM,\n  item: ActivityItem,\n  record: Record<string, unknown> | null,\n): StreamCardVM {\n  if (!record) {\n    vm.body = { kind: 'generic' };\n    return vm;\n  }\n\n  const did = didFromUri(item.uri);\n  const text = asNonEmptyString(record.text);\n  const { media, externalLink } = did ? bskyEmbedContent(record, did) : {};\n  if (media) vm.media = media;\n  if (externalLink) vm.externalLink = externalLink;\n\n  let body: StreamCardBody;\n  if (text) body = { kind: 'text', text };\n  else if (vm.media) body = { kind: 'media' };\n  else if (vm.externalLink) body = { kind: 'link' };\n  else body = { kind: 'generic' };\n  vm.body = body;\n  return vm;\n}\n\n// ---------------------------------------------------------------------------\n// App-specific body variants\n// ---------------------------------------------------------------------------\n\n/** Fall back to a generic body when the record is missing/invalid. */\nfunction withGeneric(vm: StreamCardVM): StreamCardVM {\n  vm.body = { kind: 'generic' };\n  return vm;\n}\n\n/**\n * Ingested Fediverse post (`fediverse.post`). Its `url` is the post's own\n * permalink, so it becomes the card's `sourceUrl` (the renderer makes the whole\n * card clickable) rather than an `externalLink` (which would render the raw URL\n * as visible text). The item uri is that http permalink, not an at-uri, so the\n * generic `resolveSourceUrl` path -- which parses a DID out of the uri -- can't\n * set it; do it here.\n */\nfunction applyFediversePost(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const url = httpUrl(record.url);\n  if (url) vm.sourceUrl = url;\n  const text = asNonEmptyString(record.excerpt);\n  vm.body = text ? { kind: 'text', text } : { kind: 'generic' };\n  return vm;\n}\n\nfunction applyGithubPr(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const body: Extract<StreamCardBody, { kind: 'github-pr' }> = {\n    kind: 'github-pr',\n    repoOwner: asNonEmptyString(record.repoOwner) ?? '',\n    repoName: asNonEmptyString(record.repoName) ?? '',\n    prNumber: asFiniteNumber(record.prNumber) ?? 0,\n    title: asNonEmptyString(record.title) ?? '',\n    additions: asFiniteNumber(record.additions) ?? 0,\n    deletions: asFiniteNumber(record.deletions) ?? 0,\n  };\n  const url = asNonEmptyString(record.url);\n  if (url) body.url = url;\n  const language = asNonEmptyString(record.language);\n  if (language) body.language = language;\n  const mergedAt = asNonEmptyString(record.mergedAt);\n  if (mergedAt) body.mergedAt = mergedAt;\n  vm.body = body;\n  return vm;\n}\n\nfunction applyBook(\n  vm: StreamCardVM,\n  item: ActivityItem,\n  record: Record<string, unknown>,\n): StreamCardVM {\n  const title = asNonEmptyString(record.title) ?? 'Untitled book';\n  const body: Extract<StreamCardBody, { kind: 'book' }> = {\n    kind: 'book',\n    title,\n    authors: parseAuthors(record.authors),\n  };\n  const stars = asFiniteNumber(record.stars);\n  if (stars !== undefined && stars > 0) body.stars = stars;\n  const status = asNonEmptyString(record.status);\n  if (status) body.status = status;\n  const review = asNonEmptyString(\n    typeof record.review === 'string' ? record.review.trim() : undefined,\n  );\n  if (review) body.review = review;\n  vm.body = body;\n\n  const did = didFromUri(item.uri);\n  if (did) {\n    const cover = blobMedia(record.cover, did, `The cover of ${title}`);\n    if (cover) vm.media = [cover];\n  }\n  return vm;\n}\n\nfunction popfeedReviewKind(collection: string): 'review' | 'post' | 'note' | 'other' {\n  if (collection.endsWith('.review')) return 'review';\n  if (collection.endsWith('.post')) return 'post';\n  if (collection.endsWith('.note')) return 'note';\n  return 'other';\n}\n\nfunction applyMediaReview(\n  vm: StreamCardVM,\n  item: ActivityItem,\n  record: Record<string, unknown>,\n): StreamCardVM {\n  const title = asNonEmptyString(record.title) ?? asNonEmptyString(record.name);\n  const body: Extract<StreamCardBody, { kind: 'media-review' }> = {\n    kind: 'media-review',\n    reviewKind: popfeedReviewKind(item.collection),\n    isRevisit: record.isRevisit === true,\n  };\n  if (title) body.title = title;\n  const mediaType = asNonEmptyString(record.creativeWorkType);\n  if (mediaType) body.mediaType = mediaType;\n  const rating = asFiniteNumber(record.rating);\n  if (rating !== undefined) body.rating = rating;\n  const mainCredit = asNonEmptyString(record.mainCredit);\n  if (mainCredit) body.mainCredit = mainCredit;\n  const reviewText = asNonEmptyString(record.text);\n  if (reviewText) body.reviewText = reviewText;\n  vm.body = body;\n\n  const posterUrl = asNonEmptyString(record.posterUrl);\n  if (posterUrl) vm.media = [{ url: posterUrl, alt: title ? `${title} poster` : '' }];\n  return vm;\n}\n\nconst RSVP_STATUS: Record<string, 'going' | 'interested' | 'notgoing'> = {\n  '#going': 'going',\n  '#interested': 'interested',\n  '#notgoing': 'notgoing',\n};\n\nconst RSVP_MODE: Record<string, 'inperson' | 'virtual' | 'hybrid'> = {\n  '#inperson': 'inperson',\n  '#virtual': 'virtual',\n  '#hybrid': 'hybrid',\n};\n\nfunction applyEventRsvp(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const status = asNonEmptyString(record.status);\n  const body: Extract<StreamCardBody, { kind: 'event-rsvp' }> = {\n    kind: 'event-rsvp',\n    rsvpStatus: (status ? RSVP_STATUS[hashSuffix(status)] : undefined) ?? 'unknown',\n  };\n  const meta = asRecord(record.eventMeta);\n  if (meta) {\n    const eventName = asNonEmptyString(meta.name);\n    if (eventName) body.eventName = eventName;\n    const startsAt = asNonEmptyString(meta.startsAt);\n    if (startsAt) body.startsAt = startsAt;\n    const endsAt = asNonEmptyString(meta.endsAt);\n    if (endsAt) body.endsAt = endsAt;\n    const mode = asNonEmptyString(meta.mode);\n    const modeEnum = mode ? RSVP_MODE[hashSuffix(mode)] : undefined;\n    if (modeEnum) body.mode = modeEnum;\n    const locationName = asNonEmptyString(meta.locationName);\n    if (locationName) body.locationName = locationName;\n    const locationLocality = asNonEmptyString(meta.locationLocality);\n    if (locationLocality) body.locationLocality = locationLocality;\n    const locationCountry = asNonEmptyString(meta.locationCountry);\n    if (locationCountry) body.locationCountry = locationCountry;\n  }\n  vm.body = body;\n  return vm;\n}\n\nfunction applyKeytraceVerification(\n  vm: StreamCardVM,\n  record: Record<string, unknown>,\n): StreamCardVM {\n  const identity = asRecord(record.identity) ?? {};\n  const subject = asNonEmptyString(identity.subject);\n  const displayName = asNonEmptyString(identity.displayName);\n  const body: Extract<StreamCardBody, { kind: 'verification' }> = {\n    kind: 'verification',\n    platform: asNonEmptyString(record.type) ?? 'unknown',\n    verified: record.status === 'verified',\n  };\n  const subjectLabel = displayName ?? subject;\n  if (subjectLabel) body.subjectLabel = subjectLabel;\n  const profileUrl = asNonEmptyString(identity.profileUrl);\n  if (profileUrl) body.profileUrl = profileUrl;\n  vm.body = body;\n  return vm;\n}\n\nfunction applyBskyVerification(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const handle = asNonEmptyString(record.handle);\n  const displayName = asNonEmptyString(record.displayName);\n  const body: Extract<StreamCardBody, { kind: 'verification' }> = {\n    kind: 'verification',\n    platform: 'bluesky',\n    verified: true,\n  };\n  const subjectLabel = displayName ?? handle;\n  if (subjectLabel) body.subjectLabel = subjectLabel;\n  if (handle) body.handle = handle;\n  vm.body = body;\n  return vm;\n}\n\nfunction applyMembership(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const body: Extract<StreamCardBody, { kind: 'membership' }> = { kind: 'membership' };\n  const communityUri = asNonEmptyString(record.community);\n  if (communityUri) body.communityUri = communityUri;\n\n  const meta = asRecord(record.communityMeta);\n  const communityName = meta ? asNonEmptyString(meta.name) : undefined;\n  if (communityName) body.communityName = communityName;\n  const description = meta ? asNonEmptyString(meta.description) : undefined;\n  if (description) body.description = description;\n  vm.body = body;\n\n  if (meta) {\n    const ownerDid =\n      asNonEmptyString(meta.ownerDid) ?? (communityUri ? didFromUri(communityUri) : undefined);\n    if (ownerDid) {\n      const picture = blobMedia(meta.picture, ownerDid, communityName ?? '');\n      if (picture) vm.media = [picture];\n    }\n  }\n  return vm;\n}\n\nfunction applyLocation(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const body: Extract<StreamCardBody, { kind: 'location' }> = { kind: 'location' };\n  const venueName = asNonEmptyString(record.venueName);\n  if (venueName) body.venueName = venueName;\n  const shout = asNonEmptyString(record.shout);\n  if (shout) body.shout = shout;\n  const address = beaconAddress(record.addressDetails);\n  if (address) body.address = address;\n  const geo = beaconGeo(record.location);\n  if (geo) body.geo = geo;\n  vm.body = body;\n  return vm;\n}\n\nfunction applyTravel(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const body: Extract<StreamCardBody, { kind: 'travel' }> = { kind: 'travel' };\n  const origin = asNonEmptyString(record.originTransportCode);\n  if (origin) body.origin = origin;\n  const destination = asNonEmptyString(record.destinationTransportCode);\n  if (destination) body.destination = destination;\n  const transportation = asNonEmptyString(record.transportation);\n  if (transportation) body.transportation = transportation;\n  const carrier = asNonEmptyString(record.carrier);\n  if (carrier) body.carrier = carrier;\n  const carrierCode = asNonEmptyString(record.carrierCode);\n  if (carrierCode) body.carrierCode = carrierCode;\n  const startDate = asNonEmptyString(record.startDate);\n  if (startDate) body.startDate = startDate;\n  const endDate = asNonEmptyString(record.endDate);\n  if (endDate) body.endDate = endDate;\n  vm.body = body;\n  return vm;\n}\n\nfunction applyStandardSite(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const body: Extract<StreamCardBody, { kind: 'standard-site' }> = { kind: 'standard-site' };\n  const title = asNonEmptyString(record.title);\n  if (title) body.title = title;\n  const description = asNonEmptyString(record.description);\n  if (description) body.description = description;\n  const siteUrl = asNonEmptyString(record.siteUrl);\n  if (siteUrl) {\n    body.siteUrl = siteUrl;\n    const publisherName = matchPublisherByUri(siteUrl)?.name;\n    if (publisherName) body.publisherName = publisherName;\n  }\n  const path = asNonEmptyString(record.path);\n  if (path) body.path = path;\n  const icon = asNonEmptyString(record.publicationIcon);\n  if (icon) body.icon = icon;\n  const coverImageUrl = asNonEmptyString(record.coverImageUrl);\n  if (coverImageUrl) body.coverImageUrl = coverImageUrl;\n  const readingTime = estimateReadingTime(asNonEmptyString(record.textContent));\n  if (readingTime !== undefined) body.readingTime = readingTime;\n  const publishedAt = asNonEmptyString(record.publishedAt);\n  if (publishedAt) body.publishedAt = publishedAt;\n  vm.body = body;\n  return vm;\n}\n\n/** at.youandme.connection: the record's `subject` is a bare person DID. */\nfunction applyYouAndMe(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const did = asNonEmptyString(record.subject);\n  if (did) vm.subject = { kind: 'person', did };\n  vm.body = { kind: 'generic' };\n  return vm;\n}\n\n/** fyi.asq.answer: the record's `subject.uri` is the answered question. */\nfunction applyAsqAnswer(vm: StreamCardVM, record: Record<string, unknown>): StreamCardVM {\n  const uri = asNonEmptyString(asRecord(record.subject)?.uri);\n  if (uri) vm.subject = { kind: 'record', uri };\n  vm.body = { kind: 'generic' };\n  return vm;\n}\n\n// ---------------------------------------------------------------------------\n// Generic content extraction (base collections + unknown / future apps)\n// ---------------------------------------------------------------------------\n//\n// Collections without a typed body variant (Margin, Tangled, KipClip, Grain,\n// asq questions, Semble, Passports fifty-states, Streamplace, and every\n// unrecognized/future app) fall here. The rules below are GROUNDED in the\n// sifa-web card sources so each base collection reproduces the visible content\n// its dedicated card renders; for genuinely unknown records the same shapes act\n// as a best-effort heuristic, degrading to an empty generic body when a record\n// carries no recognizable text, media, link, or subject.\n\n/** A string with at least one non-whitespace character, else undefined. */\nfunction nonBlankString(value: unknown): string | undefined {\n  return typeof value === 'string' && value.trim().length > 0 ? value : undefined;\n}\n\n/** Read a `body` field that is a plain string OR `{ value: string }` (Margin). */\nfunction readBodyField(value: unknown): string | undefined {\n  const direct = nonBlankString(value);\n  if (direct) return direct;\n  return nonBlankString(asRecord(value)?.value);\n}\n\n/** An http(s) URL string, else undefined. */\nfunction httpUrl(value: unknown): string | undefined {\n  return typeof value === 'string' && /^https?:\\/\\//i.test(value) ? value : undefined;\n}\n\n/**\n * Ordered human-visible text fields. `body` (handled specially for the\n * `{ value }` shape) follows `content` and `excerpt`, before `message`. Mirrors\n * the union of fields the base cards read (generic\n * `text|title|name|description|content`, Tangled `name|title|text|message`,\n * Margin `body`, asq `title|body`). `excerpt` carries the post text for\n * external-feed items (Fediverse `fediverse.post`, RSS), which have no\n * `text`/`content` field.\n */\nconst GENERIC_TEXT_ORDER = [\n  'text',\n  'title',\n  'name',\n  'description',\n  'content',\n  'excerpt',\n  'body',\n  'message',\n  'note',\n  'caption',\n  'summary',\n  'status',\n] as const;\n\n/** The record's primary human-visible text, or undefined. */\nfunction genericText(collection: string, record: Record<string, unknown>): string | undefined {\n  // Passports fifty-states carries no free-text field — its card composes\n  // \"Visited {city}, {state}\". Only `city` is a real record string; the state\n  // name mapping (US-NC → North Carolina) and the verb are surface concerns, so\n  // the VM text is just the city (intentionally partial, never invented).\n  if (collection === 'social.passports.fiftyStates.visit') {\n    return nonBlankString(record.city);\n  }\n  for (const field of GENERIC_TEXT_ORDER) {\n    if (field === 'body') {\n      const body = readBodyField(record.body);\n      if (body) return body;\n      continue;\n    }\n    const value = nonBlankString(record[field]);\n    if (value) return value;\n  }\n  return undefined;\n}\n\n/** Non-empty string tags off `record.tags`, or undefined. */\nfunction genericTags(record: Record<string, unknown>): string[] | undefined {\n  const tags = record.tags;\n  if (!Array.isArray(tags)) return undefined;\n  const out = tags.filter((t): t is string => typeof t === 'string' && t.length > 0);\n  return out.length > 0 ? out : undefined;\n}\n\n/**\n * Blob-ref image media from the common record shapes (reuses M1's blob helpers;\n * never builds a URL). Prefers an `images[]` / `embed.images[]` array (all\n * valid items), then single-blob fields, then Grain's bare `galleryMeta\n * .coverPhotoCid`.\n */\nfunction genericMedia(record: Record<string, unknown>, did: string, alt: string): StreamMedia[] {\n  const fromArray = (raw: unknown): StreamMedia | undefined => {\n    const img = asRecord(raw);\n    if (!img) return undefined;\n    return blobMedia(img.image ?? raw, did, asNonEmptyString(img.alt) ?? alt);\n  };\n\n  const images = record.images;\n  if (Array.isArray(images)) {\n    const out = images.map(fromArray).filter((m): m is StreamMedia => m !== undefined);\n    if (out.length > 0) return out;\n  }\n\n  const embed = asRecord(record.embed);\n  if (embed && Array.isArray(embed.images)) {\n    const out = embed.images.map(fromArray).filter((m): m is StreamMedia => m !== undefined);\n    if (out.length > 0) return out;\n  }\n\n  const single =\n    blobMedia(record.image, did, alt) ??\n    blobMedia(record.thumbnail, did, alt) ??\n    blobMedia(record.thumb, did, alt) ??\n    blobMedia(record.photo, did, alt) ??\n    (embed ? blobMedia(embed.thumbnail, did, alt) : undefined);\n  if (single) return [single];\n\n  // Grain galleries store the cover as a bare CID string, not a blob object.\n  const coverCid = asRecord(record.galleryMeta)?.coverPhotoCid;\n  if (typeof coverCid === 'string' && coverCid.length > 0) {\n    return [{ did, cid: coverCid, alt }];\n  }\n  return [];\n}\n\n/**\n * An outbound link from the common shapes: a Bluesky-style `embed.external`,\n * then a bare URL in `source` (Margin bookmark), `subject` (KipClip), or `url`.\n */\nfunction genericExternalLink(record: Record<string, unknown>): StreamExternalLink | undefined {\n  const embed = asRecord(record.embed);\n  if (embed) {\n    const fromEmbed = bskyExternal(embed);\n    if (fromEmbed) return fromEmbed;\n  }\n  const url = httpUrl(record.source) ?? httpUrl(record.subject) ?? httpUrl(record.url);\n  return url ? { url } : undefined;\n}\n\n/**\n * A reply/quote/answer target from common reference shapes: `subject` as an\n * `at://` uri or a bare `did:` (person), or `subject.uri` (strongRef). A bare\n * http(s) `subject` is a bookmark target, handled as `externalLink` instead.\n */\nfunction genericSubject(record: Record<string, unknown>): StreamCardSubject | undefined {\n  const subject = record.subject;\n  if (typeof subject === 'string') {\n    if (subject.startsWith('at://')) return { kind: 'record', uri: subject };\n    if (subject.startsWith('did:')) return { kind: 'person', did: subject };\n    return undefined;\n  }\n  const uri = nonBlankString(asRecord(subject)?.uri);\n  if (uri && uri.startsWith('at://')) return { kind: 'record', uri };\n  return undefined;\n}\n\n/** Recognize one facet feature (link / mention / tag), tolerating a missing $type. */\nfunction parseFacetFeature(\n  features: unknown[],\n): Pick<StreamRichSegment, 'link' | 'mention' | 'tag'> | undefined {\n  for (const raw of features) {\n    const feat = asRecord(raw);\n    if (!feat) continue;\n    const type = asNonEmptyString(feat['$type']) ?? '';\n    const uri = asNonEmptyString(feat.uri);\n    const did = asNonEmptyString(feat.did);\n    const tag = asNonEmptyString(feat.tag);\n    if (type.endsWith('#link') && uri) return { link: uri };\n    if (type.endsWith('#mention') && did) return { mention: did };\n    if (type.endsWith('#tag') && tag) return { tag };\n    // No / unknown $type: fall back to whichever identifying field is present.\n    if (uri) return { link: uri };\n    if (did) return { mention: did };\n    if (tag) return { tag };\n  }\n  return undefined;\n}\n\n/**\n * Slice `text` into rich segments using `app.bsky.richtext.facet`-style\n * byte-offset facets. Heuristic and additive: `body.text` always holds the full\n * plain string, so a renderer may ignore this. Returns undefined unless at least\n * one enriched (link/mention/tag) span is produced.\n */\nfunction genericRichSegments(\n  text: string,\n  record: Record<string, unknown>,\n): StreamRichSegment[] | undefined {\n  const facets = record.facets;\n  if (!Array.isArray(facets)) return undefined;\n\n  const parsed: { start: number; end: number; link?: string; mention?: string; tag?: string }[] =\n    [];\n  for (const raw of facets) {\n    const facet = asRecord(raw);\n    const index = asRecord(facet?.index);\n    const start = asFiniteNumber(index?.byteStart);\n    const end = asFiniteNumber(index?.byteEnd);\n    if (start === undefined || end === undefined || start < 0 || end <= start) continue;\n    const features = facet?.features;\n    if (!Array.isArray(features)) continue;\n    const feature = parseFacetFeature(features);\n    if (!feature) continue;\n    parsed.push({ start, end, ...feature });\n  }\n  if (parsed.length === 0) return undefined;\n\n  const bytes = new TextEncoder().encode(text);\n  const decoder = new TextDecoder();\n  parsed.sort((a, b) => a.start - b.start);\n\n  const segments: StreamRichSegment[] = [];\n  let cursor = 0;\n  for (const span of parsed) {\n    if (span.start < cursor || span.start > bytes.length) continue; // overlap / OOB\n    const end = Math.min(span.end, bytes.length);\n    if (span.start > cursor) {\n      const plain = decoder.decode(bytes.slice(cursor, span.start));\n      if (plain) segments.push({ text: plain });\n    }\n    const seg: StreamRichSegment = { text: decoder.decode(bytes.slice(span.start, end)) };\n    if (span.link) seg.link = span.link;\n    if (span.mention) seg.mention = span.mention;\n    if (span.tag) seg.tag = span.tag;\n    segments.push(seg);\n    cursor = end;\n  }\n  if (cursor < bytes.length) {\n    const rest = decoder.decode(bytes.slice(cursor));\n    if (rest) segments.push({ text: rest });\n  }\n\n  return segments.some((s) => s.link ?? s.mention ?? s.tag) ? segments : undefined;\n}\n\n/**\n * Populate a generic body with any real content the record carries — text,\n * media (blob refs), an external link, and a reply/quote/answer subject —\n * choosing `body.kind` the same way the Bluesky path does (text, else media,\n * else link, else generic).\n */\nfunction applyGeneric(\n  vm: StreamCardVM,\n  item: ActivityItem,\n  record: Record<string, unknown> | null,\n): StreamCardVM {\n  if (!record) return withGeneric(vm);\n\n  const text = genericText(item.collection, record);\n  const tags = genericTags(record);\n  const did = didFromUri(item.uri);\n  if (did) {\n    const media = genericMedia(record, did, text ?? '');\n    if (media.length > 0) vm.media = media;\n  }\n  const externalLink = genericExternalLink(record);\n  if (externalLink) vm.externalLink = externalLink;\n  // Don't clobber a repost/reply subject already normalized from item.subject.\n  if (!vm.subject) {\n    const subject = genericSubject(record);\n    if (subject) vm.subject = subject;\n  }\n\n  let body: StreamCardBody;\n  if (text) {\n    body = { kind: 'text', text };\n    const richSegments = genericRichSegments(text, record);\n    if (richSegments) body.richSegments = richSegments;\n    if (tags) body.tags = tags;\n  } else if (vm.media) {\n    body = { kind: 'media' };\n    if (tags) body.tags = tags;\n  } else if (vm.externalLink) {\n    body = { kind: 'link' };\n    if (tags) body.tags = tags;\n  } else {\n    body = { kind: 'generic' };\n    if (tags) body.tags = tags;\n  }\n  vm.body = body;\n  return vm;\n}\n\n// ---------------------------------------------------------------------------\n// Entry points\n// ---------------------------------------------------------------------------\n\n/**\n * Normalize one {@link ActivityItem} into a framework-free {@link StreamCardVM}.\n * Pure: no I/O, no React, no DOM, and no resolved CDN URLs (media carries raw\n * blob refs so each surface builds its own URL). Total: always returns a VM.\n *\n * Reference implementations: the generic/unknown case, `app.bsky.feed.post`\n * (text + images + external embed), and reposts (whose `subject` is normalized\n * through this same function). Collections with a typed body variant\n * (`github-pr`, `book`, `media-review`, `event-rsvp`, `verification`,\n * `membership`, `location`, `travel`, `standard-site`) are enriched from their\n * raw record below; `at.youandme.connection` and `fyi.asq.answer` populate a\n * person / record `subject`. Everything else (base collections + unknown apps)\n * flows through {@link applyGeneric}, which extracts text / media / link /\n * subject from common record shapes, degrading to an empty generic body.\n */\nexport function toStreamCardVM(\n  item: ActivityItem,\n  options: ToStreamCardVMOptions = {},\n): StreamCardVM {\n  const verb = verbForCollection(item.collection);\n  const source = buildSource(item, options);\n  const record = asRecord(item.record);\n  const timestamp = (record ? asNonEmptyString(record.createdAt) : undefined) ?? item.indexedAt;\n\n  const vm: StreamCardVM = {\n    uri: item.uri,\n    cid: item.cid,\n    verb,\n    source,\n    tier: getActivityTier(item.collection),\n    timestamp,\n    title: buildTitle(verb, source.label),\n  };\n\n  const author = buildAuthor(item);\n  if (author) vm.author = author;\n\n  const theme = readTheme(record);\n  if (theme) vm.theme = theme;\n\n  // Link to the record on its source app. Set before the switch so every\n  // body-variant return path (each mutates and returns this same vm) keeps it.\n  if (record) {\n    const sourceUrl = resolveSourceUrl(item, record);\n    if (sourceUrl) vm.sourceUrl = sourceUrl;\n  }\n\n  // Hypercert credit roll + outbound links, resolved by sifa-api out of\n  // sidecar records. Set before the switch, like sourceUrl above, so every\n  // body-variant return path keeps it.\n  if (item.hypercertDetails) vm.hypercertDetails = item.hypercertDetails;\n  if (item.certifiedDetails) vm.certifiedDetails = item.certifiedDetails;\n\n  // Repost / reply target, normalized through the same transform. Its own\n  // sourceUrl is computed by this recursion.\n  if (item.subject) {\n    vm.subject = { kind: 'post', post: toStreamCardVM(item.subject, options) };\n  }\n\n  switch (item.collection) {\n    case 'app.bsky.feed.post':\n      return applyBskyPost(vm, item, record);\n    case 'github.pull_request':\n      return record ? applyGithubPr(vm, record) : withGeneric(vm);\n    case 'buzz.bookhive.book':\n      return record ? applyBook(vm, item, record) : withGeneric(vm);\n    case 'community.lexicon.calendar.rsvp':\n      return record ? applyEventRsvp(vm, record) : withGeneric(vm);\n    case 'dev.keytrace.claim':\n      return record ? applyKeytraceVerification(vm, record) : withGeneric(vm);\n    case 'app.bsky.graph.verification':\n      return record ? applyBskyVerification(vm, record) : withGeneric(vm);\n    case 'social.colibri.membership':\n      return record ? applyMembership(vm, record) : withGeneric(vm);\n    case 'app.beaconbits.beacon':\n      return record ? applyLocation(vm, record) : withGeneric(vm);\n    case 'social.passports.travel.leg':\n      return record ? applyTravel(vm, record) : withGeneric(vm);\n    case 'site.standard.document':\n      return record ? applyStandardSite(vm, record) : withGeneric(vm);\n    case 'at.youandme.connection':\n      return record ? applyYouAndMe(vm, record) : withGeneric(vm);\n    case 'fyi.asq.answer':\n      return record ? applyAsqAnswer(vm, record) : withGeneric(vm);\n    case 'fediverse.post':\n      return record ? applyFediversePost(vm, record) : withGeneric(vm);\n  }\n\n  // social.popfeed.feed.{post,note,review} — registered by prefix in sifa-web.\n  if (record && item.collection.startsWith('social.popfeed.feed.')) {\n    return applyMediaReview(vm, item, record);\n  }\n\n  // Base collections + unknown / future apps: extract real content generically.\n  return applyGeneric(vm, item, record);\n}\n\n/**\n * Map a list of activity items to VMs, applying {@link isVisibleActivityItem}\n * first so both surfaces (sifa-web, page.sifa.id) filter identically — a\n * filtered item produces no VM rather than a null-rendering card.\n */\nexport function toStreamCardVMs(\n  items: ActivityItem[],\n  options: ToStreamCardVMOptions = {},\n): StreamCardVM[] {\n  const out: StreamCardVM[] = [];\n  for (const item of items) {\n    if (isVisibleActivityItem(item.collection, item.record)) {\n      out.push(toStreamCardVM(item, options));\n    }\n  }\n  return out;\n}\n","/**\n * Profile completeness scoring.\n *\n * Six binary signals, equal weight: headline filled, about filled, has at least\n * one position, education, skill, certification.\n *\n * Score: integer 0..6. Percent: round(score / 6 * 100) -- discrete values\n * {0, 17, 33, 50, 67, 83, 100}.\n *\n * Canonical source of truth for completeness scoring across Sifa clients.\n * sifa-api computes the underlying `ProfileCompletion` shape inline (in SQL\n * for admin-stats queries, in route handlers elsewhere) but defers scoring\n * to this module.\n */\n\nexport const COMPLETENESS_MAX_SCORE = 6;\n\nexport interface ProfileCompletion {\n  hasHeadline: boolean;\n  hasAbout: boolean;\n  positionCount: number;\n  educationCount: number;\n  skillCount: number;\n  certificationCount: number;\n}\n\n/** Pure-TS computation of the 0..6 score. */\nexport function completenessScore(c: ProfileCompletion): number {\n  let filled = 0;\n  if (c.hasHeadline) filled++;\n  if (c.hasAbout) filled++;\n  if (c.positionCount > 0) filled++;\n  if (c.educationCount > 0) filled++;\n  if (c.skillCount > 0) filled++;\n  if (c.certificationCount > 0) filled++;\n  return filled;\n}\n\n/** Completion as a rounded 0..100 integer percent (matches API serialisation). */\nexport function completenessPercent(c: ProfileCompletion): number {\n  return Math.round((completenessScore(c) / COMPLETENESS_MAX_SCORE) * 100);\n}\n","/**\n * Profile dimensions -- the routing signal used by the Sifa homepage to choose\n * between the V3 \"still building\" and V4 \"established\" variants.\n *\n * Six binary signals, equal weight: avatar, headline, about, current position,\n * minimum-skill threshold, and at least one education entry. The routing\n * threshold itself (e.g. \">= 4 of 6 -> ESTABLISHED\") lives in the consumer\n * because different surfaces may want to cut at different bars over time.\n *\n * Canonical source of truth for dimension scoring across Sifa clients.\n * sifa-api computes the underlying `ProfileDimensionInputs` shape inline\n * (in SQL on the session route) but defers scoring to this module so the\n * frontend and backend cannot drift on what \"filled\" means.\n *\n * See `docs/plans/2026-04-27-homepage-variants.md` (sifa-web) for the\n * history of why these six were chosen over the original eight.\n */\n\nimport type { Profile, ProfilePosition } from '../types/index.js';\n\nexport const DIMENSIONS_MAX_SCORE = 6;\nexport const MIN_SKILLS = 3;\n\nexport type DimensionKey =\n  'avatar' | 'headline' | 'about' | 'currentPosition' | 'skills' | 'education';\n\nexport type DimensionMap = Record<DimensionKey, boolean>;\n\n/**\n * Minimal raw inputs needed to compute the dimension map. sifa-api can\n * populate this from a single composite SQL query without loading the full\n * Profile shape, which is the whole point of putting this in the SDK.\n */\nexport interface ProfileDimensionInputs {\n  hasAvatar: boolean;\n  hasHeadline: boolean;\n  hasAbout: boolean;\n  currentPositionCount: number;\n  skillCount: number;\n  educationCount: number;\n}\n\nfunction nonEmptyString(value: string | undefined | null): boolean {\n  return typeof value === 'string' && value.trim().length > 0;\n}\n\n/**\n * Pure-TS computation of the 6-key boolean map from minimal inputs.\n * Use this when you already have aggregate counts (e.g. server-side).\n */\nexport function dimensionsFromInputs(inputs: ProfileDimensionInputs): DimensionMap {\n  return {\n    avatar: inputs.hasAvatar,\n    headline: inputs.hasHeadline,\n    about: inputs.hasAbout,\n    currentPosition: inputs.currentPositionCount > 0,\n    skills: inputs.skillCount >= MIN_SKILLS,\n    education: inputs.educationCount > 0,\n  };\n}\n\n/**\n * Derives `ProfileDimensionInputs` from a full Profile. Use this on the\n * client when you already have the profile loaded.\n */\nexport function profileToDimensionInputs(profile: Profile): ProfileDimensionInputs {\n  const positions = profile.positions ?? [];\n  const skills = profile.skills ?? [];\n  const education = profile.education ?? [];\n  const currentPositionCount = positions.filter((p: ProfilePosition) => !p.endedAt).length;\n  return {\n    hasAvatar: nonEmptyString(profile.avatar),\n    hasHeadline: nonEmptyString(profile.headline),\n    hasAbout: nonEmptyString(profile.about),\n    currentPositionCount,\n    skillCount: skills.length,\n    educationCount: education.length,\n  };\n}\n\n/** Convenience: full Profile -> dimension boolean map. */\nexport function getFilledDimensionsMap(profile: Profile): DimensionMap {\n  return dimensionsFromInputs(profileToDimensionInputs(profile));\n}\n\n/** Count of filled dimensions, 0..6. Accepts either raw inputs or a full Profile. */\nexport function countFilledDimensions(input: ProfileDimensionInputs | Profile): number {\n  const map = 'hasAvatar' in input ? dimensionsFromInputs(input) : getFilledDimensionsMap(input);\n  let n = 0;\n  for (const v of Object.values(map)) {\n    if (v) n++;\n  }\n  return n;\n}\n","/**\n * Compact professional summary derived from a {@link ProfileView}.\n *\n * The full `id.sifa.getProfileView` payload carries every section (all\n * positions, education, skills, publications, talks, and more). Third-party\n * surfaces that only want to show \"who is this, what do they do now\" — a badge,\n * a maintainer card, a byline — need a much smaller shape. This is that shape,\n * derived with the same canonical rules the Sifa web app uses (see\n * {@link pickPrimaryPosition}) so an embedded summary matches the profile page.\n *\n * Pure and I/O-free: pass it a view you already fetched. For the fetch +\n * summarize convenience, use `fetchProfileSummary` from `@singi-labs/sifa-sdk`.\n */\n\nimport type { ProfileView } from '../types/profile-view.js';\nimport { pickPrimaryPosition } from './primary-position.js';\n\nexport interface ProfileSummary {\n  did: string;\n  handle: string;\n  displayName?: string;\n  avatar?: string;\n  pronouns?: string;\n  headline?: string;\n  /** Title of the current primary role, if the person has an active position. */\n  currentTitle?: string;\n  /** Current employer: the resolved entity name when linked, else the free-text company. */\n  currentCompany?: string;\n  /** Skill names in the order the AppView returns them, capped by `maxSkills`. */\n  topSkills: string[];\n  /** Whether the profile is claimed by its owner (vs an unclaimed placeholder). */\n  claimed: boolean;\n}\n\nexport interface SummarizeProfileViewOptions {\n  /** Maximum number of skills to include in `topSkills`. Default 5; negatives clamp to 0. */\n  maxSkills?: number;\n}\n\nconst DEFAULT_MAX_SKILLS = 5;\n\nexport function summarizeProfileView(\n  view: ProfileView,\n  options: SummarizeProfileViewOptions = {},\n): ProfileSummary {\n  const limit = Math.max(0, options.maxSkills ?? DEFAULT_MAX_SKILLS);\n  const primary = pickPrimaryPosition(view.positions);\n\n  return {\n    did: view.did,\n    handle: view.handle,\n    displayName: view.displayName,\n    avatar: view.avatar,\n    pronouns: view.pronouns,\n    headline: view.headline,\n    currentTitle: primary?.title,\n    currentCompany: primary ? (primary.entityName ?? primary.company) : undefined,\n    topSkills: (view.skills ?? []).slice(0, limit).map((s) => s.name),\n    claimed: view.claimed ?? false,\n  };\n}\n","/**\n * Pseudo-employer detection (#159). Self-employment strings (\"self-employed\",\n * \"freelance\", \"independent\", ...) are NOT organizations: the position editor\n * routes them to the company-optional / \"Independent\" path instead of the entity\n * typeahead, and they are excluded from entity matching everywhere.\n *\n * Matching is on the WHOLE normalized string, not substrings, so real employers\n * that merely contain one of these words (\"Independent School District 191\")\n * are not misclassified. Mirrors the sifa-api matcher.\n */\nconst PSEUDO_EMPLOYERS = new Set<string>([\n  'self',\n  'self employed',\n  'selfemployed',\n  'self employment',\n  'self employed freelance',\n  'freelance',\n  'freelancer',\n  'freelancing',\n  'freelance work',\n  'independent',\n  'independent contractor',\n  'independent consultant',\n  'independent professional',\n  'sole proprietor',\n  'sole proprietorship',\n  'sole trader',\n  'own business',\n  'my own business',\n  'self employed consultant',\n]);\n\nfunction normalizePseudo(value: string): string {\n  return value\n    .toLowerCase()\n    .replace(/[^a-z0-9]+/g, ' ')\n    .trim()\n    .replace(/\\s+/g, ' ');\n}\n\n/** True when the whole employer string is a self-employment / pseudo employer. */\nexport function isPseudoEmployer(company: string): boolean {\n  const normalized = normalizePseudo(company);\n  if (!normalized) return false;\n  return PSEUDO_EMPLOYERS.has(normalized);\n}\n","/**\n * Lightweight \"does this typeahead query look like a domain?\" predicate, used to\n * decide whether to fire the domain grow-on-demand path (resolve-domain) on a\n * local typeahead miss. It is a heuristic, NOT a validator: the API re-validates\n * against the public suffix list. It only needs to distinguish \"randstad.com\"\n * (a domain) from \"Randstad\" / \"Acme Corp\" (a name) so a plain company name\n * never triggers a domain lookup.\n *\n * Accepts an optional scheme and path (`https://www.stripe.com/pricing`), a\n * leading `www.`, and multi-label hosts; requires at least one dot and a >=2\n * alpha final label (TLD-shaped); rejects whitespace and `@` (emails).\n *\n * Runs on uncontrolled typeahead input, so it is deliberately ReDoS-safe: the\n * input length is bounded up front (a domain is <=253 chars), the host is\n * extracted with plain string ops (no scheme/path/trailing-dot regex), and each\n * label is validated by a single anchored, bounded pattern. There is no\n * ambiguous or nested quantifier anywhere, so matching is linear in the input.\n */\n\n/** Max DNS name length; anything longer is rejected before any matching. */\nconst MAX_DOMAIN_LEN = 253;\n\n/**\n * One DNS label: 1-63 chars, alphanumeric, internal hyphens allowed. Anchored\n * and length-bounded, with a single optional group and no outer quantifier, so\n * it cannot backtrack polynomially.\n */\nconst LABEL = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;\n\n/** Final label must be TLD-shaped: 2-63 alphabetic chars. */\nconst TLD = /^[a-z]{2,63}$/;\n\n/** Strip trailing dots without a regex (avoids the `\\.+$` polynomial pattern). */\nfunction stripTrailingDots(s: string): string {\n  let end = s.length;\n  while (end > 0 && s.charCodeAt(end - 1) === 0x2e /* '.' */) end -= 1;\n  return s.slice(0, end);\n}\n\nexport function looksLikeDomain(query: string): boolean {\n  const q = query.trim().toLowerCase();\n  // Bound the input BEFORE any matching. A domain is <=253 chars; a longer\n  // typeahead value is never a domain, and this caps every check below to a\n  // constant amount of work (ReDoS guard).\n  if (!q || q.length > MAX_DOMAIN_LEN) return false;\n  if (q.includes(' ') || q.includes('\\t') || q.includes('@')) return false;\n\n  // Extract the host with plain string ops -- no backtracking regex on input.\n  let host = q;\n  const schemeAt = host.indexOf('://');\n  if (schemeAt !== -1) host = host.slice(schemeAt + 3);\n  // Cut at the first path / query / fragment delimiter.\n  for (let i = 0; i < host.length; i += 1) {\n    const ch = host[i];\n    if (ch === '/' || ch === '?' || ch === '#') {\n      host = host.slice(0, i);\n      break;\n    }\n  }\n  if (host.startsWith('www.')) host = host.slice(4);\n  // Strip a trailing :port.\n  const colonAt = host.lastIndexOf(':');\n  if (colonAt !== -1 && /^[0-9]{1,5}$/.test(host.slice(colonAt + 1))) {\n    host = host.slice(0, colonAt);\n  }\n  host = stripTrailingDots(host);\n  if (!host || host.length > MAX_DOMAIN_LEN) return false;\n\n  // Validate each label independently (split first, so no quantifier spans dots).\n  const labels = host.split('.');\n  if (labels.length < 2) return false;\n  const tld = labels[labels.length - 1];\n  if (tld === undefined || !TLD.test(tld)) return false;\n  for (let i = 0; i < labels.length - 1; i += 1) {\n    if (!LABEL.test(labels[i] as string)) return false;\n  }\n  return true;\n}\n","import type { EntitySearchResult } from '../schemas/entity.js';\n\n/**\n * Disambiguation-display helpers for the org typeahead (#159, Flow 1A-2). Two\n * same-name orgs must be told apart at a glance, so each row shows its domain,\n * country, and parent where known.\n */\n\nexport interface DisambiguationFields {\n  domain?: string | null;\n  country?: string | null;\n  parentName?: string | null;\n}\n\n/**\n * Build the muted secondary line for a typeahead row, e.g.\n * `spryker.com · DE · part of Spryker Holding`. Empty when nothing to show.\n */\nexport function entityDisambiguationLabel(fields: DisambiguationFields): string {\n  const parts: string[] = [];\n  if (fields.domain) parts.push(fields.domain);\n  if (fields.country) parts.push(fields.country);\n  if (fields.parentName) parts.push(`part of ${fields.parentName}`);\n  return parts.join(' · ');\n}\n\n/** Convenience over {@link entityDisambiguationLabel} for a search result row. */\nexport function searchResultDisambiguation(result: EntitySearchResult): string {\n  return entityDisambiguationLabel({\n    domain: result.domain,\n    country: result.country,\n    parentName: result.parentName,\n  });\n}\n\n/** Stable per-row identity for React keys and dedupe (entity id or PDL id). */\nexport function entityResultKey(result: EntitySearchResult): string {\n  return result.source === 'entity' ? `entity:${result.entityId}` : `pdl:${result.pdlId}`;\n}\n","/**\n * Anchor-quality classification for a position's `entityRef` pointer (#159).\n *\n * A durable company link tiers by the quality of its anchor, which drives the\n * link indicator in the UI (registry-backed reads stronger than a Sifa-scoped\n * PDL pointer, per the ratified D5 chip policy). The classification is derived\n * purely from the ref URI's host, so it is a shared, cross-platform predicate\n * (web today, the native app later).\n *\n *   registry  -- a portable external id any atproto app can resolve\n *                (Wikidata / ROR / GLEIF). Renders as a full \"Linked\" indicator.\n *   sifa      -- a Sifa-scoped `sifa.id/company/<publicId>` pointer for a\n *                PDL-only company. Renders as a muted \"Linked\" (no glyph).\n *   unlinked  -- no ref, a malformed URL, or an unrecognized host. Free text.\n *\n * NEVER surfaced as \"verified\": a link is not a verification.\n */\nexport const ENTITY_REF_ANCHORS = ['registry', 'sifa', 'unlinked'] as const;\nexport type EntityRefAnchor = (typeof ENTITY_REF_ANCHORS)[number];\n\n/** Hosts of portable, app-neutral company registries. */\nconst REGISTRY_HOSTS = new Set([\n  'wikidata.org',\n  'www.wikidata.org',\n  'ror.org',\n  'gleif.org',\n  'www.gleif.org',\n]);\n\nconst SIFA_HOST = 'sifa.id';\n\n/**\n * Classify an entityRef by anchor quality. Uses strict host parsing (never\n * substring matching) so a hostile URL that merely contains a registry host in a\n * query string is treated as unlinked, not falsely linked.\n */\nexport function classifyEntityRef(entityRef: string | null | undefined): EntityRefAnchor {\n  if (!entityRef || !entityRef.trim()) return 'unlinked';\n  let url: URL;\n  try {\n    url = new URL(entityRef.trim());\n  } catch {\n    return 'unlinked';\n  }\n  if (url.protocol !== 'https:' && url.protocol !== 'http:') return 'unlinked';\n  const host = url.hostname.toLowerCase();\n  if (REGISTRY_HOSTS.has(host)) return 'registry';\n  if (host === SIFA_HOST) return 'sifa';\n  return 'unlinked';\n}\n\n/** Whether a position carries a durable link of any anchor quality. */\nexport function isLinked(entityRef: string | null | undefined): boolean {\n  return classifyEntityRef(entityRef) !== 'unlinked';\n}\n","import type { OrgProfileRecord } from '../schemas/org-profile.js';\nimport { looksLikeDomain } from './domain-detect.js';\nimport type { AccountFacetMode } from '../types/index.js';\n\n/**\n * Handle hosts that are shared PDS / signup domains, never a single\n * organization's registrable identity. A handle under one of these (e.g.\n * `acme.bsky.social`) is a subdomain of someone else's domain, so it can never\n * satisfy the org rendering floor. Lowercased, leading-dot form for a suffix\n * match. Kept in sync with the PDS provider list in `format/pds-utils.ts`.\n */\nconst KNOWN_HANDLE_HOST_SUFFIXES = [\n  '.bsky.social',\n  '.blacksky.app',\n  '.eurosky.social',\n  '.northsky.social',\n] as const;\n\n/**\n * Approximate \"is this handle a custom registrable domain?\" check for the org\n * rendering floor.\n *\n * IMPORTANT -- this is deliberately NARROW, not authoritative. The SDK has no\n * public-suffix-list (PSL) dependency, so it cannot compute the true eTLD+1\n * apex: it cannot tell `acme.co.uk` (an apex) from `careers.acme.co.uk` (a\n * subdomain that routes to the subsidiary case), nor reject every PSL-private\n * host. It performs only the rejects it CAN make correctly with no PSL:\n *   - DIDs (never a domain handle),\n *   - bare / no-dot handles and non-TLD-shaped hosts (via `looksLikeDomain`),\n *   - known shared PDS / handle hosts (`*.bsky.social` and friends).\n *\n * The AUTHORITATIVE apex + eTLD+1 + confusable check is server-side in\n * sifa-api's `bind-domain-guard` (`isBindableHandleDomain`, backed by `tldts`);\n * `computeOrgFloorVerdict` there is the source of truth and is surfaced to\n * clients on the profile resolve (read it via `useOrgProfile`). Recompute here\n * only when a client-side floor gate is needed without a round-trip.\n *\n * TODO(#160): promote a shared PSL-backed eTLD+1 helper into the SDK (or vendor\n * a compact public-suffix table) and tighten this to a true apex check.\n *\n * Pure: no network, no I/O.\n */\nexport function isRegistrableDomainHandle(handle: string): boolean {\n  const h = handle.trim().toLowerCase();\n  if (!h) return false;\n  if (h.startsWith('did:')) return false;\n  // Requires >=1 dot and a TLD-shaped final label; rejects bare usernames.\n  if (!looksLikeDomain(h)) return false;\n  for (const suffix of KNOWN_HANDLE_HOST_SUFFIXES) {\n    if (h.endsWith(suffix)) return false;\n  }\n  return true;\n}\n\n/**\n * The org rendering floor (#160) -- the \"any AppView can evaluate\" promise made\n * executable. An account renders as an organization when BOTH:\n *   1. It has an `id.sifa.org.profile` record (record present), AND\n *   2. Its handle is a custom registrable domain\n *      ({@link isRegistrableDomainHandle}).\n *\n * Only the PRESENCE of the record matters here (declaration marks the account\n * as presenting-as-org; trust is layered separately). The handle check is LIVE:\n * evaluate it on every render so a lost domain drops org rendering\n * automatically.\n *\n * Pure: no network, no I/O. Pass the fetched record (or null) and the current\n * handle.\n */\nexport function qualifiesAsOrg(\n  record: OrgProfileRecord | null | undefined,\n  handle: string,\n): boolean {\n  if (record === null || record === undefined) return false;\n  return isRegistrableDomainHandle(handle);\n}\n\n/**\n * The person-facet fields that decide whether an account has a CV worth\n * keeping. A structural subset of `Profile`, so callers can pass a profile\n * straight in. Every list is optional; `positions`, `education`, and `skills`\n * are always present on a real profile but typed optional here so partial\n * fixtures and trimmed payloads work.\n */\nexport interface PersonalFacetContent {\n  headline?: string | null;\n  about?: string | null;\n  positions?: unknown[];\n  education?: unknown[];\n  skills?: unknown[];\n  certifications?: unknown[];\n  projects?: unknown[];\n  publications?: unknown[];\n  volunteering?: unknown[];\n  involvement?: unknown[];\n  honors?: unknown[];\n  courses?: unknown[];\n}\n\n/**\n * Does this account have a personal profile worth keeping visible?\n *\n * Decides the claim-flow default when an account claims its domain as an\n * organization. An empty account claiming a domain is a plain company signup:\n * present solely as an org, ask nothing. An account that already carries a CV\n * is the sole-trader case: keeping both facets is the default, and hiding the\n * person facet must be a deliberate choice rather than a silent side effect of\n * claiming.\n *\n * True when any profile section holds at least one record, or when the headline\n * or about text is non-blank. Whitespace-only text does not count.\n *\n * Pure: no network, no I/O.\n */\nexport function hasPersonalProfileContent(profile: PersonalFacetContent): boolean {\n  const filled = (text: string | null | undefined): boolean =>\n    typeof text === 'string' && text.trim() !== '';\n  if (filled(profile.headline) || filled(profile.about)) return true;\n  const sections = [\n    profile.positions,\n    profile.education,\n    profile.skills,\n    profile.certifications,\n    profile.projects,\n    profile.publications,\n    profile.volunteering,\n    profile.involvement,\n    profile.honors,\n    profile.courses,\n  ];\n  return sections.some((section) => Array.isArray(section) && section.length > 0);\n}\n\n/**\n * Should this account's personal profile render at `/p/`, given the org verdict?\n *\n * The single routing predicate behind the freelancer dual-identity case: a\n * claimed org that set `personalProfileVisible` renders both facets, so `/p/`\n * serves the person instead of redirecting to `/c/`. Every other account keeps\n * the exclusive behaviour -- an org (claimed or merely recognized) redirects\n * `/p/` to `/c/`, and a plain person renders at `/p/` as always.\n *\n * Pure: no network, no I/O.\n */\nexport function rendersPersonalProfile(\n  org: { isOrg: boolean; recognized: boolean; personalProfileVisible?: boolean } | null | undefined,\n  renderPreference?: 'person' | 'company' | null,\n): boolean {\n  // An explicit 'person' choice is the owner's own override and wins outright:\n  // it is what makes \"Person\" mean person, even for an account holding an org\n  // record (which stays in the PDS, inert).\n  if (renderPreference === 'person') return true;\n  if (org === null || org === undefined) return true;\n  if (!org.isOrg && !org.recognized) return true;\n  // Gated on isOrg, not merely on the flag: `personalProfileVisible` lives in\n  // the `id.sifa.org.profile` record, so an account that is only RECOGNIZED\n  // (known company domain, never claimed) has no record to carry it and keeps\n  // the redirect. Claiming is the way in.\n  return org.isOrg && org.personalProfileVisible === true;\n}\n\n/**\n * Should this account's company page render at `/c/`?\n *\n * The mirror of {@link rendersPersonalProfile}. True for any company account --\n * claimed or merely recognized -- EXCEPT when the owner explicitly chose to\n * present as a person, which suppresses the company page rather than deleting\n * anything. The org record stays in the PDS and the choice is reversible.\n *\n * Pure: no network, no I/O.\n */\nexport function rendersCompanyProfile(\n  org: { isOrg: boolean; recognized: boolean } | null | undefined,\n  renderPreference?: 'person' | 'company' | null,\n): boolean {\n  if (renderPreference === 'person') return false;\n  if (org === null || org === undefined) return false;\n  return org.isOrg || org.recognized;\n}\n\n/**\n * Resolve the three-way \"are you a person, a company, or both?\" answer that the\n * account settings switch presents, from the two places the answer is stored.\n *\n * Precedence, highest first:\n *   1. `renderPreference === 'person'` -- the owner's explicit local override.\n *      Wins even over a claimed org record, which stays inert in the PDS.\n *   2. A claimed org that declared `personalProfileVisible` -- `'both'`, the\n *      sole trader. Read from the PDS record, so it is portable.\n *   3. Any other company account (claimed, recognized, or `renderPreference`\n *      `'company'`) -- `'company'`.\n *   4. Everything else -- `'person'`.\n *\n * Pure: no network, no I/O.\n */\nexport function resolveAccountFacetMode(profile: {\n  org?: { isOrg: boolean; recognized: boolean; personalProfileVisible?: boolean } | null;\n  renderPreference?: 'person' | 'company' | null;\n}): AccountFacetMode {\n  if (profile.renderPreference === 'person') return 'person';\n  const org = profile.org;\n  if (org?.isOrg && org.personalProfileVisible === true) return 'both';\n  if (org?.isOrg || org?.recognized || profile.renderPreference === 'company') return 'company';\n  return 'person';\n}\n","/**\n * Firmographic subset of a company profile that decides whether its `/c/` page\n * is worth indexing. A minimal STRUCTURAL type on purpose -- it does not import\n * sifa-web's `CompanyProfile`, so this predicate stays importable by any\n * consumer (sifa-web, sifa-app, third parties). Fields mirror the external\n * firmographics that lead a `/c/` page (Wikidata / ROR / GLEIF derived), NOT\n * Sifa-aggregated stats.\n *\n * Deliberately ABSENT: claim status and Sifa-derived employee count. Company\n * page indexability is NEVER gated on either (product decision, 2026-07-16) --\n * a rich unclaimed page is indexable; a claimed but empty page is not.\n */\nexport interface CompanyFirmographics {\n  /** External canonical name (Wikidata label / registry name). */\n  canonicalName?: string | null;\n  /** Free-text description / about. */\n  description?: string | null;\n  /** Industry / sector label. */\n  industry?: string | null;\n  /** URL of the company logo. */\n  logoUrl?: string | null;\n  /** External headcount figure (e.g. Wikidata P1128). NOT the Sifa employee count. */\n  employeeCount?: number | null;\n  /** Founding year or date. */\n  founded?: string | number | null;\n}\n\n/**\n * Minimum number of the optional firmographic fields\n * ({@link CompanyFirmographics} minus `canonicalName`) that must be present for\n * a `/c/` company page to be indexable. Named + exported so the threshold is\n * tunable in one place.\n */\nexport const COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS = 2;\n\nfunction isNonEmptyString(value: unknown): boolean {\n  return typeof value === 'string' && value.trim().length > 0;\n}\n\n/** A number counts as present when finite; a founded-string counts when non-empty. */\nfunction isPresentNumber(value: unknown): boolean {\n  return typeof value === 'number' && Number.isFinite(value);\n}\n\n/**\n * Is a `/c/` company page worth indexing?\n *\n * True iff it has real firmographic content: a non-empty `canonicalName` AND at\n * least {@link COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS} of the optional firmographic\n * fields ({@link CompanyFirmographics.description | description},\n * `industry`, `logoUrl`, `employeeCount`, `founded`) present.\n *\n * NEVER gated on claim status or Sifa employee count -- there is no such\n * parameter (product decision, 2026-07-16). A rich unclaimed stub is indexable;\n * a name-only page (claimed or not) is not.\n *\n * Pure: no network, no I/O. Third-party importable.\n */\nexport function isCompanyPageIndexable(company: CompanyFirmographics): boolean {\n  if (!isNonEmptyString(company.canonicalName)) return false;\n\n  let present = 0;\n  if (isNonEmptyString(company.description)) present += 1;\n  if (isNonEmptyString(company.industry)) present += 1;\n  if (isNonEmptyString(company.logoUrl)) present += 1;\n  if (isPresentNumber(company.employeeCount)) present += 1;\n  if (isPresentNumber(company.founded) || isNonEmptyString(company.founded)) present += 1;\n\n  return present >= COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS;\n}\n","/**\n * Minimal per-day activity count. Structurally satisfied by the SDK's\n * `HeatmapDay` (query subpath), but defined here so this predicate stays\n * importable from the main entrypoint without pulling the query layer -- same\n * structural-type discipline as {@link isCompanyPageIndexable}.\n */\nexport interface DailyActivityCount {\n  /** Calendar day in `YYYY-MM-DD` (UTC). Compared lexicographically. */\n  date: string;\n  /** Number of activities recorded on that day. */\n  total: number;\n}\n\nconst DAY_MS = 86_400_000;\n\n/**\n * How many activities fall within the last `windowDays` calendar days.\n *\n * Sums {@link DailyActivityCount.total | total} for every day whose\n * {@link DailyActivityCount.date | date} is on or after the cutoff, where the\n * cutoff is `now` minus `windowDays` days (UTC calendar date). `YYYY-MM-DD`\n * strings sort chronologically, so the comparison is a plain string compare --\n * no per-day `Date` parsing, no timezone drift.\n *\n * The day exactly `windowDays` ago is INCLUDED (inclusive lower bound).\n *\n * Pure: no network, no I/O. `now` is injectable for deterministic tests and\n * defaults to the current time.\n */\nexport function countRecentActivity(\n  days: readonly DailyActivityCount[],\n  windowDays: number,\n  now: Date = new Date(),\n): number {\n  const cutoff = new Date(now.getTime() - windowDays * DAY_MS).toISOString().slice(0, 10);\n  return days.reduce((sum, day) => (day.date >= cutoff ? sum + day.total : sum), 0);\n}\n","import { sortByDateDesc } from '../format/sort-by-date.js';\n\nconst hasValue = (date?: string) => !!date;\n\n/**\n * Sort items by date range, floating ongoing entries (startDate present, endDate\n * absent) to the top. Items with no dates sink to the bottom.\n *\n * Used by sections whose lexicons have no explicit `current` flag -- ongoing is\n * implicit from a missing endDate. Without this wrapper, the shared\n * `dateRangeExtractor` reads `item.current` (always undefined for these items)\n * and sinks ongoing entries below completed ones.\n *\n * Sections using lexicon-aligned `startedAt`/`endedAt` fields (positions,\n * education) should use `lexiconDateExtractor` instead -- that extractor already\n * derives `current` correctly.\n */\nexport function sortByActiveDateRange<T extends { startDate?: string; endDate?: string }>(\n  items: T[],\n): T[] {\n  return sortByDateDesc(items, (p) => ({\n    startDate: p.startDate,\n    endDate: p.endDate,\n    current: !hasValue(p.endDate) && hasValue(p.startDate),\n  }));\n}\n","const PROFICIENCY_RANK: Record<string, number> = {\n  native: 5,\n  full_professional: 4,\n  professional_working: 3,\n  limited_working: 2,\n  elementary: 1,\n};\n\nfunction rank(proficiency: string | undefined): number {\n  if (!proficiency) return 0;\n  return PROFICIENCY_RANK[proficiency] ?? 0;\n}\n\n/** Sort languages by proficiency (native first), then alphabetically within a rank. */\nexport function sortLanguagesByProficiency<T extends { language?: string; proficiency?: string }>(\n  items: T[],\n): T[] {\n  return [...items].sort((a, b) => {\n    const diff = rank(b.proficiency) - rank(a.proficiency);\n    if (diff !== 0) return diff;\n    return (a.language ?? '').localeCompare(b.language ?? '');\n  });\n}\n","/**\n * Per-section item sorts, shared by every profile surface so ordering can't\n * diverge between the HTML page and the Markdown / DOCX / print exports and the\n * standalone personal-site renderer. Thin wrappers over the SDK date extractors\n * plus the range/language sorts in this directory.\n */\n\nimport type {\n  ProfilePosition,\n  ProfileEducation,\n  ProfileProject,\n  ProfilePublication,\n  ProfileCertification,\n  ProfileHonor,\n  ProfileLanguage,\n} from '../types/index.js';\nimport {\n  sortByDateDesc,\n  lexiconDateExtractor,\n  singleDateExtractor,\n  certDateExtractor,\n} from '../format/sort-by-date.js';\nimport { sortByActiveDateRange } from './range-sort.js';\nimport { sortLanguagesByProficiency } from './language-sort.js';\n\n/**\n * Move a `primary && !endedAt` position to the top, matching the HTML career\n * section, so the current primary role always leads.\n */\nexport function hoistPrimary(positions: ProfilePosition[]): ProfilePosition[] {\n  const idx = positions.findIndex((p) => p.primary && !p.endedAt);\n  if (idx <= 0) return positions;\n  const primary = positions[idx]!;\n  return [primary, ...positions.slice(0, idx), ...positions.slice(idx + 1)];\n}\n\nexport const sortPositions = (items: ProfilePosition[]): ProfilePosition[] =>\n  hoistPrimary(sortByDateDesc(items, lexiconDateExtractor));\n\nexport const sortEducation = (items: ProfileEducation[]): ProfileEducation[] =>\n  sortByDateDesc(items, lexiconDateExtractor);\n\nexport const sortProjects = (items: ProfileProject[]): ProfileProject[] =>\n  sortByActiveDateRange(items);\n\nexport const sortPublications = (items: ProfilePublication[]): ProfilePublication[] =>\n  sortByDateDesc(items, singleDateExtractor);\n\nexport const sortCertifications = (items: ProfileCertification[]): ProfileCertification[] =>\n  sortByDateDesc(items, certDateExtractor);\n\nexport const sortHonors = (items: ProfileHonor[]): ProfileHonor[] =>\n  sortByDateDesc(items, singleDateExtractor);\n\nexport const sortLanguages = (items: ProfileLanguage[]): ProfileLanguage[] =>\n  sortLanguagesByProficiency(items);\n","import { getInvolvementKindHeading } from '../taxonomy/involvement-kind.js';\nimport type { ProfileInvolvement } from '../types/index.js';\n\n/**\n * Fixed display order of involvement headings. A group renders only when it has\n * records. Charity + mapped legacy volunteering fall under \"Volunteering\".\n */\nexport const INVOLVEMENT_HEADING_ORDER = [\n  'Open Source',\n  'Community',\n  'Volunteering',\n  'Civic',\n  'Other',\n] as const;\n\nexport interface InvolvementGroup {\n  heading: string;\n  items: ProfileInvolvement[];\n}\n\n/**\n * Group involvement records by their kind's display heading, in the fixed order\n * above, most-recent first within a group. Empty groups are omitted. An unknown\n * kind falls under \"Other\" (via the shared heading map).\n */\nexport function groupInvolvementByHeading(items: ProfileInvolvement[]): InvolvementGroup[] {\n  const byHeading = new Map<string, ProfileInvolvement[]>();\n  for (const item of items) {\n    const heading = getInvolvementKindHeading(item.kind);\n    const bucket = byHeading.get(heading) ?? [];\n    bucket.push(item);\n    byHeading.set(heading, bucket);\n  }\n  const recency = (i: ProfileInvolvement) => i.endedAt ?? i.startedAt ?? '';\n  const groups: InvolvementGroup[] = [];\n  for (const heading of INVOLVEMENT_HEADING_ORDER) {\n    const bucket = byHeading.get(heading);\n    if (!bucket?.length) continue;\n    const sorted = [...bucket].sort((a, b) => recency(b).localeCompare(recency(a)));\n    groups.push({ heading, items: sorted });\n  }\n  return groups;\n}\n","import { z } from 'zod';\n\n/**\n * Blob-ref passthrough shared by records that carry an uploaded blob (org logo,\n * presentation cover image, ...). Mirrors the `blobRefSchema` validated by the\n * sifa-api write endpoints -- the shape is validated, then written to the PDS\n * verbatim.\n */\nexport const BlobRefSchema = z.object({\n  $type: z.literal('blob'),\n  ref: z.object({ $link: z.string().min(1) }),\n  mimeType: z.string().min(1).max(255),\n  size: z.number().int().nonnegative(),\n});\n\nexport type BlobRef = z.infer<typeof BlobRefSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, strongRefSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.endorsement.confirmation` records.\n * Lives in the endorsee's PDS to approve display of an endorsement.\n */\nexport const EndorsementConfirmationRecordSchema = z.object({\n  endorsement: strongRefSchema,\n  /**\n   * Skill record this endorsement applies to. Set when the endorsement proposed\n   * a skill: the subject creates the record and links it here, because the\n   * endorser cannot write to the subject's repository. Also set when a proposed\n   * name matched a skill the subject already had.\n   */\n  skill: strongRefSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type EndorsementConfirmationRecord = z.infer<typeof EndorsementConfirmationRecordSchema>;\n","import { z } from 'zod';\n\n/**\n * Organization entity-resolution payloads (#159). Shared by the typeahead,\n * selection, and grow-on-demand import-search endpoints on sifa-api.\n */\n\n/**\n * A nullable string constrained to an http(s) URL. Rejects `javascript:` and\n * other script-bearing schemes at the SDK boundary so a hostile API response\n * cannot smuggle an XSS payload into a rendered `href`/`src`. Note: Wikidata\n * entity URIs are canonically `http://`, so both http and https are allowed.\n */\nconst httpUrlNullable = z\n  .string()\n  .refine((s) => /^https?:\\/\\//i.test(s), { message: 'must be an http(s) URL' })\n  .nullable();\n\nconst searchResultCommon = {\n  kind: z.string(),\n  name: z.string(),\n  domain: z.string().nullable(),\n  country: z.string().nullable(),\n  logoUrl: httpUrlNullable,\n  parentName: z.string().nullable(),\n};\n\n/**\n * A single typeahead row. Discriminated on `source`: a curated `entity` row\n * carries `entityId`, a `pdl` staging row carries `pdlId`. The union guarantees\n * the identifier for the row's source is always present, so a stable React key\n * can never be `entity:undefined`. The disambiguation fields\n * (domain/country/parentName) drive the dropdown display.\n */\nexport const EntitySearchResultSchema = z.discriminatedUnion('source', [\n  z.object({\n    source: z.literal('entity'),\n    entityId: z.number().int().positive(),\n    ...searchResultCommon,\n  }),\n  z.object({\n    source: z.literal('pdl'),\n    pdlId: z.string().min(1),\n    ...searchResultCommon,\n  }),\n]);\nexport type EntitySearchResult = z.infer<typeof EntitySearchResultSchema>;\n\n/** Response of `GET /api/entities/search`. */\nexport const EntitySearchResponseSchema = z.object({\n  results: z.array(EntitySearchResultSchema),\n  hasMore: z.boolean(),\n});\nexport type EntitySearchResponse = z.infer<typeof EntitySearchResponseSchema>;\n\n/**\n * Body of `POST /api/entities/select`: promote a PDL row OR bump an entity.\n * Exactly one of `entityId`/`pdlId` must be present -- supplying both is\n * ambiguous (the server would have to silently pick one) and is rejected.\n */\nexport const EntitySelectRequestSchema = z\n  .object({\n    entityId: z.number().int().positive().optional(),\n    pdlId: z.string().min(1).optional(),\n  })\n  .refine((v) => (v.entityId != null) !== (v.pdlId != null), {\n    message: 'exactly one of entityId or pdlId is required',\n  });\nexport type EntitySelectRequest = z.infer<typeof EntitySelectRequestSchema>;\n\n/** Response of `POST /api/entities/select`. `entityRef` is the portable\n * Wikidata/ROR/LEI URI to write to the position record, or null for a\n * PDL-only entity (its resolution stays AppView-side). */\nexport const EntitySelectResponseSchema = z.object({\n  entityId: z.number().int().positive(),\n  slug: z.string(),\n  kind: z.string(),\n  canonicalName: z.string(),\n  domain: z.string().nullable(),\n  /**\n   * The entity's website, gated to sources trustworthy enough to prefill into a\n   * record the user signs. Narrower than `domain`, which is a display value and\n   * may come from a crawl. Null when the entity has no such source.\n   */\n  website: httpUrlNullable.default(null),\n  /** Which tier `website` came from. Crawled is never an accepted source. */\n  websiteTier: z.enum(['org', 'curated']).nullable().default(null),\n  entityRef: httpUrlNullable,\n});\nexport type EntitySelectResponse = z.infer<typeof EntitySelectResponseSchema>;\n\n/** Response of `POST /api/entities/import-search`. */\nexport const EntityImportSearchResponseSchema = z.object({\n  results: z.array(EntitySearchResultSchema),\n});\nexport type EntityImportSearchResponse = z.infer<typeof EntityImportSearchResponseSchema>;\n\n/**\n * Body of the domain grow-on-demand endpoints (`POST /api/entities/resolve-domain`\n * and `POST /api/entities/mint-domain`). The server re-validates the value as a\n * registrable domain; 253 is the max DNS name length.\n */\nexport const EntityResolveDomainRequestSchema = z.object({\n  domain: z.string().min(1).max(253),\n});\nexport type EntityResolveDomainRequest = z.infer<typeof EntityResolveDomainRequestSchema>;\n\n/**\n * Response of `POST /api/entities/resolve-domain` (grow-on-demand Branch 1). Any\n * notable companies whose official website is the domain, imported from Wikidata.\n * `canMint` is true when nothing notable matched AND the domain is eligible for\n * the user-initiated mint-from-domain path -- it drives the \"Add <domain>\"\n * affordance.\n */\nexport const EntityResolveDomainResponseSchema = z.object({\n  results: z.array(EntitySearchResultSchema),\n  canMint: z.boolean(),\n});\nexport type EntityResolveDomainResponse = z.infer<typeof EntityResolveDomainResponseSchema>;\n\n/**\n * Response of `POST /api/entities/mint-domain` (grow-on-demand Branch 2). The\n * linkable entity minted from (or already resolved for) the domain. A non-2xx\n * status (e.g. the domain is not mintable, a confusable look-alike, or the site\n * yielded nothing usable) surfaces as a thrown error, not a null result.\n *\n * `pending` is true when the entity is a fresh hidden-pending mint: the\n * requesting user's own link resolves to it immediately, but it stays out of\n * other users' typeahead + aggregation until an admin approves it. Clients should\n * reflect this (\"added -- pending review\") rather than \"added & live\".\n */\nexport const EntityMintDomainResponseSchema = z.object({\n  result: EntitySearchResultSchema,\n  pending: z.boolean(),\n});\nexport type EntityMintDomainResponse = z.infer<typeof EntityMintDomainResponseSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes, strongRefSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.endorsement` records. Lives in the endorser's PDS;\n * the endorser identity is implicit (whoever owns the repository).\n */\nexport const EndorsementRecordSchema = z.object({\n  subject: didSchema,\n  /**\n   * Absent when the endorser is proposing a skill the subject has not listed,\n   * named by `skillName`. The record it becomes is linked from the subject's\n   * confirmation, since only they can write to their own repository.\n   */\n  skill: strongRefSchema.optional(),\n  skillName: z.string().min(1).refine(maxGraphemes(64)).max(640),\n  comment: z.string().refine(maxGraphemes(300)).max(3000).optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type EndorsementRecord = z.infer<typeof EndorsementRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, maxGraphemes, selfLabelsSchema, uriSchema } from './shared.js';\n\n/**\n * Structured physical address for an organization. Mirrors\n * `community.lexicon.location.address` (all fields optional). Sifa enforces\n * ISO 3166-1 alpha-2 country codes at the app layer.\n */\nconst orgAddressSchema = z.object({\n  country: z.string().optional(),\n  postalCode: z.string().optional(),\n  region: z.string().optional(),\n  locality: z.string().optional(),\n  street: z.string().optional(),\n  name: z.string().optional(),\n});\n\n/** A featured link on the org profile. Both `name` and `url` are required. */\nconst orgLinkSchema = z.object({\n  name: z.string().refine(maxGraphemes(60)).max(600),\n  url: uriSchema.max(2048),\n});\n\n/**\n * Zod schema for `id.sifa.org.profile` records -- the self-declared\n * organization profile. Singleton (record key `self`), lives in the org's PDS.\n * Presence of this record marks the account as presenting as an organization;\n * trust is layered separately (rendering floor, verification labels).\n *\n * Mirrors the lexicon wire shape (grapheme + byte caps, blob logo, uri refs).\n * For the sifa-api write-endpoint contract, use the schemas under\n * `@singi-labs/sifa-sdk/schemas/write` instead.\n */\nexport const OrgProfileRecordSchema = z.object({\n  name: z.string().min(1).refine(maxGraphemes(200)).max(2000),\n  description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n  /** Blob ref for the org logo (`image/png` | `image/jpeg`). Not deeply validated client-side. */\n  logo: z.unknown().optional(),\n  website: uriSchema.optional(),\n  entityRefs: z.array(uriSchema).max(20).optional(),\n  /** Contact email. NOT rendered publicly; validated as email at the app layer. */\n  contact: z.string().optional(),\n  /** Physical addresses (headquarters, offices). */\n  addresses: z.array(orgAddressSchema).max(10).optional(),\n  /**\n   * Self-selected headcount range (a declared bucket, never a calculated count).\n   * Open enum (bare-string knownValues in the lexicon): `1-10`, `11-50`,\n   * `51-200`, `201-500`, `501-1000`, `1001-5000`, `5001-10000`, `10001+`. Any\n   * string is accepted so future ranges do not break older records.\n   */\n  companySize: z.string().optional(),\n  /** Featured links or content surfaced on the org profile. */\n  links: z.array(orgLinkSchema).max(10).optional(),\n  /**\n   * Whether the account holder's personal profile stays visible alongside this\n   * org profile. For sole traders whose personal domain is also their trade\n   * name: one account, two facets, both pages render. Absent or false means the\n   * account presents solely as an organization.\n   */\n  personalProfileVisible: z.boolean().optional(),\n  labels: selfLabelsSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type OrgProfileRecord = z.infer<typeof OrgProfileRecordSchema>;\n","import { z } from 'zod';\n\nimport {\n  datetimeSchema,\n  didSchema,\n  maxGraphemes,\n  partialDateSchema,\n  selfLabelsSchema,\n  strongRefSchema,\n  uriSchema,\n} from './shared.js';\n\n/**\n * Zod schema for `id.sifa.org.employmentAttestation` records -- an\n * organization's attestation that a person is or was employed in a specific\n * position. Lives in the org's PDS (the org is implicit: whoever owns the repo).\n *\n * The position identity is pinned via a snapshot triple (`title`, `startedAt`,\n * and the entity identifier `entityRef` | `companyDid`) so editing those pinned\n * fields on the referenced position record voids the attestation. The free-text\n * company name is never pinned (a rebrand must not invalidate the attestation).\n *\n * `startedAt` / `endedAt` mirror the position lexicon's freeform `YYYY-MM` /\n * `YYYY-MM-DD` date shape, not strict `datetime`.\n */\nexport const OrgEmploymentAttestationRecordSchema = z.object({\n  subject: didSchema,\n  position: strongRefSchema,\n  status: z.enum(['current', 'past']),\n  title: z.string().min(1).refine(maxGraphemes(256)).max(2560),\n  startedAt: partialDateSchema,\n  entityRef: uriSchema.optional(),\n  companyDid: didSchema.optional(),\n  endedAt: partialDateSchema.optional(),\n  comment: z.string().refine(maxGraphemes(300)).max(3000).optional(),\n  labels: selfLabelsSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type OrgEmploymentAttestationRecord = z.infer<typeof OrgEmploymentAttestationRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.graph.follow` records.\n *\n * One-way professional follow; the record lives in the follower's PDS. Per\n * iter-1 decisions (`plans/2026-06-01-in-sifa-follow-primitive.md`), this is\n * a **distinct** graph from `app.bsky.graph.follow`, not a superset — but\n * the required field shape (`subject` + `createdAt`) is intentionally\n * identical so generic Bluesky `listRecords` consumers get usable records.\n *\n * `note` is a Sifa addition: an optional reason for the follow (\"why I\n * followed\"). Capped at 200 graphemes to match other profile-flavored\n * lexicon fields.\n */\nexport const GraphFollowRecordSchema = z.object({\n  subject: didSchema,\n  createdAt: datetimeSchema,\n  note: z.string().refine(maxGraphemes(200), 'note must be at most 200 graphemes').optional(),\n});\n\nexport type GraphFollowRecord = z.infer<typeof GraphFollowRecordSchema>;\n\n/**\n * Build a `GraphFollowRecordSchema` that rejects self-follow at the Zod\n * layer (CLAUDE.md mandatory standards #3 — input validation; sifa-api#673\n * E8 — defence in depth).\n *\n * Use this on the **client side** when constructing a new follow record\n * (the follower DID is the authenticated user). The plain\n * {@link GraphFollowRecordSchema} stays without the refine so firehose\n * consumers can validate records without context.\n */\nexport function makeGraphFollowRecordSchema(followerDid: string) {\n  return GraphFollowRecordSchema.refine((record) => record.subject !== followerDid, {\n    message: 'Self-follow is not allowed',\n    path: ['subject'],\n  });\n}\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema } from './shared.js';\n\n/**\n * Profile row shared across `/api/following`, `/api/profile/:handleOrDid/mutuals`,\n * and `/api/me/bluesky-suggestions`. Matches the existing `FollowProfile` TS\n * interface byte-for-byte but adds runtime validation for the SDK's pagination\n * helpers and the upcoming `sifa-app` consumer (where we can't trust the wire).\n *\n * Per `sifa-api#674` PR body: mutuals + bluesky-suggestions reuse this shape\n * exactly, so a single Zod schema covers all three endpoints.\n */\nexport const FollowProfileSchema = z.object({\n  did: didSchema,\n  handle: z.string(),\n  displayName: z.string().optional(),\n  headline: z.string().optional(),\n  avatarUrl: z.string().optional(),\n  source: z.string(),\n  claimed: z.boolean(),\n  followedAt: datetimeSchema,\n  blueskyVerified: z.boolean().optional(),\n  blueskyVerifiedAt: datetimeSchema.nullable().optional(),\n});\n\nexport type FollowProfileItem = z.infer<typeof FollowProfileSchema>;\n\n/**\n * Cursor-paginated page of {@link FollowProfileSchema} rows. Used by mutuals\n * + bluesky-suggestions. The legacy `/api/following` endpoint uses a different\n * wrapper key (`follows` instead of `items`) and is intentionally NOT covered\n * by this schema.\n */\nexport const FollowProfilePageSchema = z.object({\n  items: z.array(FollowProfileSchema),\n  cursor: z.string().nullable(),\n});\n\nexport type FollowProfilePage = z.infer<typeof FollowProfilePageSchema>;\n\n/**\n * Per-flag allowlist row returned by `GET /api/admin/feature-allowlists/:flag`.\n * Mirrors the `feature_allowlists` table; `note` is optional free-form text.\n */\nexport const FeatureAllowlistEntrySchema = z.object({\n  did: didSchema,\n  addedAt: datetimeSchema,\n  note: z.string().nullable().optional(),\n});\n\nexport type FeatureAllowlistEntry = z.infer<typeof FeatureAllowlistEntrySchema>;\n\n/**\n * Known feature flags accepted by the admin allowlist endpoints. Mirrors the\n * server-side `FEATURE_FLAGS` const in `sifa-api`. Kept as a `const` tuple so\n * consumers can `as const`-narrow when building UIs.\n */\nexport const FEATURE_FLAGS = ['FEED_V5_ENABLED'] as const;\nexport type FeatureFlag = (typeof FEATURE_FLAGS)[number];\n","import { z } from 'zod';\n\nimport { atUriSchema, cidSchema, datetimeSchema, didSchema } from './shared.js';\n\n/**\n * Feed item from `GET /api/following/feed`. Discriminated on `source`:\n *\n * - `sifa`: a Sifa-native event (e.g. profile update, endorsement).\n * - `atmosphere`: a curated creation event from another ATproto app\n *   (Barazo post, etc.). Payload is the hydrated `app.bsky.embed.*#view`\n *   shape, NOT the raw record (per memory `sifa-hydrated-view-embed-types`).\n *\n * Both variants share `actor`, `indexedAt`, and `id` (the materialized\n * `feed_events.id` row identifier, used in the cursor).\n */\nexport const FeedActorSchema = z.object({\n  did: didSchema,\n  handle: z.string(),\n  displayName: z.string().optional(),\n  avatarUrl: z.string().optional(),\n});\n\nexport type FeedActor = z.infer<typeof FeedActorSchema>;\n\nconst FeedItemBaseSchema = z.object({\n  id: z.string(),\n  actor: FeedActorSchema,\n  indexedAt: datetimeSchema,\n  eventType: z.string(),\n});\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n *   Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n *   Stream are two distinct surfaces with different data paths (Barazo API\n *   for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n *   types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport const SifaFeedItemSchema = FeedItemBaseSchema.extend({\n  source: z.literal('sifa'),\n  appId: z.literal('sifa').optional(),\n  payload: z.record(z.string(), z.unknown()),\n});\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n *   Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n *   Stream are two distinct surfaces with different data paths (Barazo API\n *   for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n *   types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport type SifaFeedItem = z.infer<typeof SifaFeedItemSchema>;\n\n/**\n * ATmosphere feed item. `payload` is intentionally permissive: it carries\n * a hydrated `app.bsky.embed.*#view` shape that varies by source app. The\n * AppView resolves the hydration; clients render via the existing\n * embed-view union (mirrors `sifa-web/src/components/stream/`).\n *\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n *   Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n *   Stream are two distinct surfaces with different data paths (Barazo API\n *   for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n *   types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport const AtmosphereFeedItemSchema = FeedItemBaseSchema.extend({\n  source: z.literal('atmosphere'),\n  appId: z.string(),\n  uri: atUriSchema.optional(),\n  cid: cidSchema.optional(),\n  payload: z.record(z.string(), z.unknown()),\n});\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n *   Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n *   Stream are two distinct surfaces with different data paths (Barazo API\n *   for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n *   types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport type AtmosphereFeedItem = z.infer<typeof AtmosphereFeedItemSchema>;\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n *   Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n *   Stream are two distinct surfaces with different data paths (Barazo API\n *   for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n *   types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport const FollowFeedItemSchema = z.discriminatedUnion('source', [\n  SifaFeedItemSchema,\n  AtmosphereFeedItemSchema,\n]);\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n *   Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n *   Stream are two distinct surfaces with different data paths (Barazo API\n *   for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n *   types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport type FollowFeedItem = z.infer<typeof FollowFeedItemSchema>;\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n *   Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n *   Stream are two distinct surfaces with different data paths (Barazo API\n *   for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n *   types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport const FollowFeedPageSchema = z.object({\n  items: z.array(FollowFeedItemSchema),\n  cursor: z.string().nullable(),\n});\n\n/**\n * @deprecated The `/api/following/feed` surface was reverted (sifa-api#674).\n *   Per `decisions/activity-data-strategy.md` the Sifa Timeline + ATmosphere\n *   Stream are two distinct surfaces with different data paths (Barazo API\n *   for Timeline, live PDS reads + Valkey for Stream). These collapsed feed\n *   types are no longer consumed. Scheduled for removal in next major bump.\n */\nexport type FollowFeedPage = z.infer<typeof FollowFeedPageSchema>;\n\n/**\n * Composite feed cursor `(indexedAt DESC, source, id)`. Encoded as a\n * URL-safe base64 string so it survives `URLSearchParams` round-trips\n * without further encoding. Decoupling encode/decode from the API call\n * lets consumers persist cursors (e.g. for \"jump-back-here\" UX) and\n * lets us unit-test the format.\n */\nexport interface FeedCursor {\n  indexedAt: string;\n  source: 'sifa' | 'atmosphere';\n  id: string;\n}\n\nconst FeedCursorSchema = z.object({\n  indexedAt: datetimeSchema,\n  source: z.union([z.literal('sifa'), z.literal('atmosphere')]),\n  id: z.string().min(1),\n});\n\ninterface BufferLike {\n  from: (input: string, encoding: 'utf-8' | 'base64') => { toString: (encoding: string) => string };\n}\n\ninterface Base64Global {\n  btoa?: (input: string) => string;\n  atob?: (input: string) => string;\n  Buffer?: BufferLike;\n}\n\nfunction toBase64Url(input: string): string {\n  const g = globalThis as unknown as Base64Global;\n  const b64: string =\n    typeof g.btoa === 'function'\n      ? g.btoa(unescape(encodeURIComponent(input)))\n      : (g.Buffer as BufferLike).from(input, 'utf-8').toString('base64');\n  // Strip up to 2 trailing '=' (base64 padding). CodeQL flags `/=+$/` as a\n  // polynomial regex on tainted input; we don't accept tainted input here,\n  // but the deterministic loop sidesteps the alert.\n  let end = b64.length;\n  while (end > 0 && b64.charCodeAt(end - 1) === 61) end--;\n  return b64.slice(0, end).replace(/\\+/g, '-').replace(/\\//g, '_');\n}\n\nfunction fromBase64Url(input: string): string {\n  const padded = input.replace(/-/g, '+').replace(/_/g, '/') + '==='.slice((input.length + 3) % 4);\n  const g = globalThis as unknown as Base64Global;\n  if (typeof g.atob === 'function') {\n    return decodeURIComponent(escape(g.atob(padded)));\n  }\n  return (g.Buffer as BufferLike).from(padded, 'base64').toString('utf-8');\n}\n\nexport function encodeFeedCursor(cursor: FeedCursor): string {\n  return toBase64Url(JSON.stringify(cursor));\n}\n\nexport function decodeFeedCursor(encoded: string): FeedCursor {\n  const json = fromBase64Url(encoded);\n  const parsed: unknown = JSON.parse(json);\n  return FeedCursorSchema.parse(parsed);\n}\n","import { z } from 'zod';\n\nimport {\n  datetimeSchema,\n  didSchema,\n  maxGraphemes,\n  partialDateSchema,\n  selfLabelsSchema,\n  uriSchema,\n} from './shared.js';\n\n/** Zod schema for `id.sifa.profile.certification` records. */\nexport const ProfileCertificationRecordSchema = z.object({\n  name: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n  authority: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  authorityDid: didSchema.optional(),\n  // Portable org entity identifier (Wikidata/ROR/LEI URI) from the typeahead.\n  // Constrained to http(s) so a script-bearing scheme is never a valid ref (#159).\n  entityRef: z\n    .string()\n    .url()\n    .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n    .max(2048)\n    .optional(),\n  credentialId: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  credentialUrl: uriSchema.optional(),\n  issuedAt: partialDateSchema.optional(),\n  expiresAt: partialDateSchema.optional(),\n  labels: selfLabelsSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileCertificationRecord = z.infer<typeof ProfileCertificationRecordSchema>;\n","import { z } from 'zod';\n\nimport {\n  atUriSchema,\n  datetimeSchema,\n  maxGraphemes,\n  partialDateSchema,\n  strongRefSchema,\n} from './shared.js';\n\n/** Zod schema for `id.sifa.profile.course` records. */\nexport const ProfileCourseRecordSchema = z.object({\n  name: z.string().min(1).refine(maxGraphemes(200)).max(2000),\n  number: z.string().refine(maxGraphemes(50)).max(500).optional(),\n  institution: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  // Portable org entity identifier (Wikidata/ROR/LEI URI) from the typeahead.\n  // Constrained to http(s) so a script-bearing scheme is never a valid ref (#159).\n  entityRef: z\n    .string()\n    .url()\n    .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n    .max(2048)\n    .optional(),\n  education: strongRefSchema.optional(),\n  // AT-URI of the associated id.sifa.profile.certification record. Plain\n  // at-uri (not a strongRef) so the link tracks the live certification.\n  credential: atUriSchema.optional(),\n  completedAt: partialDateSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileCourseRecord = z.infer<typeof ProfileCourseRecordSchema>;\n","import { z } from 'zod';\n\nimport {\n  datetimeSchema,\n  didSchema,\n  maxGraphemes,\n  partialDateSchema,\n  selfLabelsSchema,\n} from './shared.js';\n\n/** Zod schema for `id.sifa.profile.education` records. */\nexport const ProfileEducationRecordSchema = z.object({\n  institution: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n  institutionDid: didSchema.optional(),\n  // Portable org entity identifier (Wikidata/ROR/LEI URI) from the typeahead.\n  // Constrained to http(s) so a script-bearing scheme is never a valid ref (#159).\n  entityRef: z\n    .string()\n    .url()\n    .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n    .max(2048)\n    .optional(),\n  degree: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  fieldOfStudy: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  grade: z.string().refine(maxGraphemes(50)).max(500).optional(),\n  activities: z.string().refine(maxGraphemes(1000)).max(10000).optional(),\n  description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n  location: z.unknown().optional(),\n  startedAt: partialDateSchema.optional(),\n  endedAt: partialDateSchema.optional(),\n  labels: selfLabelsSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileEducationRecord = z.infer<typeof ProfileEducationRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, maxGraphemes, uriSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.profile.externalAccount` records.\n *\n * `platform` is advisory (`knownValues` in the lexicon) -- known values live\n * under `id.sifa.defs#platform*` but unknown values are accepted.\n */\nexport const ProfileExternalAccountRecordSchema = z.object({\n  platform: z.string(),\n  url: uriSchema,\n  label: z.string().refine(maxGraphemes(64)).max(640).optional(),\n  feedUrl: uriSchema.optional(),\n  isPrimary: z.boolean().optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileExternalAccountRecord = z.infer<typeof ProfileExternalAccountRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes, partialDateSchema } from './shared.js';\n\n/** Zod schema for `id.sifa.profile.honor` records. */\nexport const ProfileHonorRecordSchema = z.object({\n  title: z.string().min(1).refine(maxGraphemes(200)).max(2000),\n  issuer: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  issuerDid: didSchema.optional(),\n  // Portable org entity identifier (Wikidata/ROR/LEI URI) from the typeahead.\n  // Constrained to http(s) so a script-bearing scheme is never a valid ref (#159).\n  entityRef: z\n    .string()\n    .url()\n    .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n    .max(2048)\n    .optional(),\n  description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n  awardedAt: partialDateSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileHonorRecord = z.infer<typeof ProfileHonorRecordSchema>;\n","import { z } from 'zod';\n\nimport {\n  datetimeSchema,\n  didSchema,\n  maxGraphemes,\n  partialDateSchema,\n  externalRecordRefSchema,\n  selfLabelsSchema,\n  strongRefSchema,\n  uriSchema,\n} from './shared.js';\n\n/**\n * A person named as a member of a project. Mirrors `id.sifa.defs#projectMemberRef`.\n *\n * A claim by the record author, not a fact: the named person carries a display\n * name, avatar, and profile link only once they publish a matching\n * `id.sifa.confirmation`. `role` is display only, since a record living in\n * someone else's repository cannot grant write access to anything.\n */\nexport const projectMemberRefSchema = z.object({\n  did: didSchema,\n  role: z.string().optional(),\n  title: z.string().refine(maxGraphemes(128)).max(1280).optional(),\n});\n\nexport type ProjectMemberRef = z.infer<typeof projectMemberRefSchema>;\n\n/** Zod schema for `id.sifa.profile.project` records. */\nexport const ProfileProjectRecordSchema = z.object({\n  name: z.string().min(1).refine(maxGraphemes(256)).max(2560),\n  description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n  url: uriSchema.optional(),\n  members: z.array(projectMemberRefSchema).max(50).optional(),\n  /**\n   * The canonical `id.sifa.project.self` this personal entry corresponds to.\n   * A composition link. For the same project recorded on someone else's\n   * profile, see `sameAs`.\n   */\n  projectRef: strongRefSchema.optional(),\n  /**\n   * The same project as recorded on another person's profile. Each side stays\n   * its own record; this only says the two describe one thing. Resolves by\n   * AT-URI, since they will keep editing their copy.\n   */\n  sameAs: externalRecordRefSchema.optional(),\n  position: strongRefSchema.optional(),\n  startedAt: partialDateSchema.optional(),\n  endedAt: partialDateSchema.optional(),\n  labels: selfLabelsSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileProjectRecord = z.infer<typeof ProfileProjectRecordSchema>;\n","import { z } from 'zod';\n\nimport {\n  datetimeSchema,\n  didSchema,\n  externalRecordRefSchema,\n  maxGraphemes,\n  partialDateSchema,\n  selfLabelsSchema,\n  uriSchema,\n} from './shared.js';\nimport { projectMemberRefSchema } from './profile-project.js';\n\n/** Collection NSID for involvement records. Pass to the generic record helpers. */\nexport const PROFILE_INVOLVEMENT_NSID = 'id.sifa.profile.involvement';\n\n/**\n * A public artifact proving a piece of work. Mirrors `id.sifa.defs#artifactLink`.\n * `kind` is an open enum (bare-string knownValues), so any string is accepted.\n * `.passthrough()` keeps unknown fields a newer client or co-writer may emit.\n */\nexport const ArtifactLinkSchema = z\n  .object({\n    url: uriSchema,\n    kind: z.string().optional(),\n    label: z.string().refine(maxGraphemes(200)).max(2000).optional(),\n  })\n  .passthrough();\n\nexport type ArtifactLink = z.infer<typeof ArtifactLinkSchema>;\n\n/**\n * Zod schema for `id.sifa.profile.involvement` records.\n *\n * `.passthrough()` (not `.strict()`): external apps (Verak, weareonhire)\n * co-write `id.sifa.*`, so an older SDK must not reject a record carrying a\n * field it doesn't know yet. `kind` is an open enum matching the lexicon's\n * knownValues but accepting any string for the same forward-compat reason.\n */\nexport const ProfileInvolvementRecordSchema = z\n  .object({\n    kind: z.string(),\n    upstream: z.string().refine(maxGraphemes(256)).max(2560).optional(),\n    upstreamDid: didSchema.optional(),\n    upstreamUrl: uriSchema.optional(),\n    role: z.string().refine(maxGraphemes(256)).max(2560).optional(),\n    description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n    startedAt: partialDateSchema.optional(),\n    endedAt: partialDateSchema.optional(),\n    links: z.array(ArtifactLinkSchema).max(50).optional(),\n    // Portable org entity identifier (Wikidata/ROR/LEI URI) from the resolver\n    // typeahead, constrained to http(s) so a script scheme is never a valid ref.\n    entityRef: z\n      .string()\n      .url()\n      .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n      .max(2048)\n      .optional(),\n    // community.lexicon.location.address — validated at the app layer.\n    location: z.unknown().optional(),\n    // id.sifa.defs#skillRef references (at-uri to a skill record in the same repo).\n    skills: z\n      .array(z.object({ uri: z.string() }))\n      .max(50)\n      .optional(),\n    labels: selfLabelsSchema.optional(),\n    collaborators: z.array(projectMemberRefSchema).max(50).optional(),\n    sameAs: externalRecordRefSchema.optional(),\n    createdAt: datetimeSchema,\n  })\n  .passthrough();\n\nexport type ProfileInvolvementRecord = z.infer<typeof ProfileInvolvementRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, maxGraphemes } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.profile.language` records.\n *\n * `proficiency` is advisory (`knownValues` in the lexicon) -- known values\n * are the five-level LinkedIn-compatible scale under `id.sifa.defs#*`.\n */\nexport const ProfileLanguageRecordSchema = z.object({\n  name: z.string().min(1).refine(maxGraphemes(64)).max(640),\n  proficiency: z.string().optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileLanguageRecord = z.infer<typeof ProfileLanguageRecordSchema>;\n","import { z } from 'zod';\n\nimport {\n  datetimeSchema,\n  didSchema,\n  maxGraphemes,\n  partialDateSchema,\n  selfLabelsSchema,\n  skillRefSchema,\n} from './shared.js';\n\n// Portable org entity identifier (Wikidata/ROR/LEI URI) from the typeahead.\n// Constrained to http(s) so a script-bearing scheme is never a valid ref (#159).\n// Shared by the two entity references on a position so the scheme check cannot\n// drift between them.\nconst entityRefField = z\n  .string()\n  .url()\n  .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n  .max(2048)\n  .optional();\n\n/** Zod schema for `id.sifa.profile.position` records. */\nexport const ProfilePositionRecordSchema = z\n  .object({\n    company: z.string().min(1).refine(maxGraphemes(100)).max(1000).optional(),\n    companyDid: didSchema.optional(),\n    entityRef: entityRefField,\n    title: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n    description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n    employmentType: z.string().optional(),\n    // Disclosure that the role is held as someone else's representative -- most often\n    // a fund whose board seat this is. Capped at the lexicon's 256 graphemes rather\n    // than the tighter limit used for `company`: a schema stricter than the lexicon\n    // would reject records other clients can legally write.\n    onBehalfOf: z.string().refine(maxGraphemes(256)).max(2560).optional(),\n    // May resolve to an organization or to a person (a family-office principal); a DID\n    // does not distinguish the two, so this stays permissive.\n    onBehalfOfDid: didSchema.optional(),\n    onBehalfOfEntityRef: entityRefField,\n    workplaceType: z.string().optional(),\n    location: z.unknown().optional(),\n    startedAt: partialDateSchema,\n    endedAt: partialDateSchema.optional(),\n    // id.sifa.defs#skillRef -- at-uri only, no cid. Skills are mutable records\n    // in the same repo, so the ref resolves live rather than pinning a version.\n    skills: z.array(skillRefSchema).max(50).optional(),\n    isPrimary: z.boolean().optional(),\n    labels: selfLabelsSchema.optional(),\n    createdAt: datetimeSchema,\n  })\n  .passthrough();\n\nexport type ProfilePositionRecord = z.infer<typeof ProfilePositionRecordSchema>;\n","import { z } from 'zod';\n\nimport { BlobRefSchema } from './blob-ref.js';\nimport { datetimeSchema, externalRecordRefSchema, maxGraphemes, uriSchema } from './shared.js';\n\n/**\n * Duration of a presentation, in minutes. Mirrors\n * `id.sifa.profile.presentation#duration`: a fixed length (minMinutes only) or\n * a range (minMinutes to maxMinutes).\n */\nexport const PresentationDurationSchema = z\n  .object({\n    minMinutes: z.number().int().min(1),\n    maxMinutes: z.number().int().min(1).optional(),\n  })\n  .refine((d) => d.maxMinutes === undefined || d.maxMinutes >= d.minMinutes, {\n    message: 'maxMinutes must be greater than or equal to minMinutes',\n    path: ['maxMinutes'],\n  });\n\nexport type PresentationDuration = z.infer<typeof PresentationDurationSchema>;\n\n/**\n * A related link for a presentation or one of its deliveries. Mirrors\n * `id.sifa.defs#presentationLink`. `type` is an open enum (knownValues), so any\n * string is accepted.\n */\nexport const PresentationLinkSchema = z.object({\n  uri: uriSchema,\n  label: z.string().refine(maxGraphemes(64)).max(640).optional(),\n  type: z.string().optional(),\n});\n\nexport type PresentationLink = z.infer<typeof PresentationLinkSchema>;\n\n/** Zod schema for `id.sifa.profile.presentation` records (the reusable content). */\nexport const ProfilePresentationRecordSchema = z.object({\n  title: z.string().min(1).refine(maxGraphemes(300)).max(3000),\n  description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n  duration: PresentationDurationSchema.optional(),\n  intendedAudiences: z\n    .array(z.string().refine(maxGraphemes(100)).max(1000))\n    .max(20)\n    .optional(),\n  links: z.array(PresentationLinkSchema).max(20).optional(),\n  // Optional reference to a long-form write-up (pub.leaflet.document or\n  // site.standard.document). Plain at-uri + optional cid so it tracks edits.\n  writeupRef: externalRecordRefSchema.optional(),\n  // Optional uploaded cover image for the talk page.\n  coverImage: BlobRefSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfilePresentationRecord = z.infer<typeof ProfilePresentationRecordSchema>;\n","import { z } from 'zod';\n\nimport { PresentationLinkSchema } from './profile-presentation.js';\nimport { datetimeSchema, externalRecordRefSchema, maxGraphemes } from './shared.js';\n\n/**\n * Structured address for a delivery occasion. Mirrors\n * `community.lexicon.location.address` (all fields optional).\n */\nconst communityAddressSchema = z.object({\n  country: z.string().optional(),\n  postalCode: z.string().optional(),\n  region: z.string().optional(),\n  locality: z.string().optional(),\n  street: z.string().optional(),\n  name: z.string().optional(),\n});\n\n/**\n * Zod schema for `id.sifa.profile.presentationDelivery` records (one occasion\n * on which a presentation was delivered). Works standalone or linked to a\n * presentation and/or a calendar event. `role`, `mode`, and `status` are open\n * enums (knownValues); `mode`/`status` store the full\n * `community.lexicon.calendar.event` token.\n */\nexport const ProfilePresentationDeliveryRecordSchema = z.object({\n  // Optional reference to the id.sifa.profile.presentation delivered here.\n  presentationRef: externalRecordRefSchema.optional(),\n  // Fallback title used when there is no presentationRef.\n  title: z.string().refine(maxGraphemes(300)).max(3000).optional(),\n  role: z.string().refine(maxGraphemes(64)).max(640).optional(),\n  eventName: z.string().refine(maxGraphemes(300)).max(3000).optional(),\n  // Calendar date as YYYY-MM-DD (day only).\n  date: z\n    .string()\n    .regex(/^\\d{4}-\\d{2}-\\d{2}$/, 'date must be YYYY-MM-DD')\n    .optional(),\n  location: z.string().refine(maxGraphemes(256)).max(2560).optional(),\n  // Structured community.lexicon.location.address for the occasion. The\n  // free-text `location` string above stays as a legacy fallback.\n  address: communityAddressSchema.optional(),\n  mode: z.string().optional(),\n  status: z.string().optional(),\n  links: z.array(PresentationLinkSchema).max(20).optional(),\n  // Optional reference to a community.lexicon.calendar.event for this occasion.\n  eventRef: externalRecordRefSchema.optional(),\n  // DIDs of co-speakers who presented alongside the author at this occasion.\n  coSpeakers: z\n    .array(z.string().regex(/^did:[a-z]+:[^\\s]+$/, 'must be a DID'))\n    .max(20)\n    .optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfilePresentationDeliveryRecord = z.infer<\n  typeof ProfilePresentationDeliveryRecordSchema\n>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes, partialDateSchema, uriSchema } from './shared.js';\n\n/** Author shape from `id.sifa.profile.publication#author`. */\nexport const PublicationAuthorSchema = z.object({\n  name: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n  did: didSchema.optional(),\n});\n\nexport type PublicationAuthor = z.infer<typeof PublicationAuthorSchema>;\n\n/** Zod schema for `id.sifa.profile.publication` records. */\nexport const ProfilePublicationRecordSchema = z.object({\n  title: z.string().min(1).refine(maxGraphemes(200)).max(2000),\n  subtitle: z.string().refine(maxGraphemes(200)).max(2000).optional(),\n  publisher: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  url: uriSchema.optional(),\n  description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n  authors: z.array(PublicationAuthorSchema).max(50).optional(),\n  publishedAt: partialDateSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfilePublicationRecord = z.infer<typeof ProfilePublicationRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, languageTagSchema, maxGraphemes, selfLabelsSchema } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.profile.self` records. Singleton (record key `self`).\n *\n * `knownValues` on `openTo` and `preferredWorkplace` are advisory per the\n * lexicon spec -- unknown values are allowed, but documented options live\n * under the `id.sifa.defs#*` namespace.\n */\nexport const ProfileSelfRecordSchema = z.object({\n  headline: z.string().refine(maxGraphemes(120)).max(1200).optional(),\n  about: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n  industry: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  givenName: z.string().refine(maxGraphemes(64)).max(640).optional(),\n  familyName: z.string().refine(maxGraphemes(64)).max(640).optional(),\n  namePronunciation: z.string().refine(maxGraphemes(64)).max(640).optional(),\n  location: z.unknown().optional(),\n  openTo: z.array(z.string()).max(10).optional(),\n  preferredWorkplace: z.array(z.string()).max(3).optional(),\n  langs: z.array(languageTagSchema).max(3).optional(),\n  labels: selfLabelsSchema.optional(),\n  discoverable: z.boolean().optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileSelfRecord = z.infer<typeof ProfileSelfRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, maxGraphemes } from './shared.js';\n\n/**\n * Zod schema for `id.sifa.profile.skill` records.\n *\n * `category` is advisory (`knownValues` in the lexicon) -- known values live\n * under `id.sifa.defs#*` but unknown values are accepted. `subCategory` is a\n * freeform user-defined grouping label nested under `category` (no known\n * values); renderers decide its display label.\n */\nexport const ProfileSkillRecordSchema = z.object({\n  name: z.string().min(1).refine(maxGraphemes(64)).max(640),\n  category: z.string().optional(),\n  subCategory: z.string().refine(maxGraphemes(64)).max(640).optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileSkillRecord = z.infer<typeof ProfileSkillRecordSchema>;\n","import { z } from 'zod';\n\nimport { datetimeSchema, didSchema, maxGraphemes, partialDateSchema } from './shared.js';\n\n/** Zod schema for `id.sifa.profile.volunteering` records. */\nexport const ProfileVolunteeringRecordSchema = z.object({\n  organization: z.string().min(1).refine(maxGraphemes(100)).max(1000),\n  organizationDid: didSchema.optional(),\n  // Portable org entity identifier (Wikidata/ROR/LEI URI) from the typeahead.\n  // Constrained to http(s) so a script-bearing scheme is never a valid ref (#159).\n  entityRef: z\n    .string()\n    .url()\n    .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n    .max(2048)\n    .optional(),\n  role: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  cause: z.string().refine(maxGraphemes(100)).max(1000).optional(),\n  description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n  startedAt: partialDateSchema.optional(),\n  endedAt: partialDateSchema.optional(),\n  createdAt: datetimeSchema,\n});\n\nexport type ProfileVolunteeringRecord = z.infer<typeof ProfileVolunteeringRecordSchema>;\n","import { z } from 'zod';\n\nimport { ArtifactLinkSchema } from './profile-involvement.js';\nimport {\n  datetimeSchema,\n  didSchema,\n  maxGraphemes,\n  partialDateSchema,\n  selfLabelsSchema,\n} from './shared.js';\n\n// Portable entity identifier (Wikidata/ROR/LEI URI) from the typeahead. Constrained\n// to http(s) so a script-bearing scheme is never a valid ref (#159). An investment\n// carries two of these -- the company and the vehicle -- so the check is shared.\nconst entityRefField = z\n  .string()\n  .url()\n  .refine((s) => /^https?:\\/\\//i.test(s), { message: 'entityRef must be an http(s) URL' })\n  .max(2048)\n  .optional();\n\n/**\n * A deliberately structured amount. Free text was rejected here: an unparseable\n * money string is worse than no amount at all, and cannot be repaired once people\n * have written them.\n */\nexport const InvestmentAmountSchema = z.object({\n  /** Whole major currency units (euros, not cents). Cheque sizes are round numbers. */\n  value: z.number().int().min(0),\n  /** ISO 4217 three-letter code, uppercase. */\n  currency: z.string().length(3),\n});\n\n/** Collection NSID for investment records. */\nexport const PROFILE_INVESTMENT_NSID = 'id.sifa.profile.investment';\n\n/** Zod schema for `id.sifa.profile.investment` records. */\nexport const ProfileInvestmentRecordSchema = z\n  .object({\n    /** For a limited-partner entry this names the fund, not a portfolio company. */\n    company: z.string().min(1).refine(maxGraphemes(256)).max(2560),\n    companyDid: didSchema.optional(),\n    entityRef: entityRefField,\n    role: z.string().optional(),\n    stage: z.string().optional(),\n    status: z.string().optional(),\n    /** The vehicle the capital went through. Absent for a cheque in the person's own name. */\n    via: z.string().refine(maxGraphemes(256)).max(2560).optional(),\n    viaDid: didSchema.optional(),\n    viaEntityRef: entityRefField,\n    /**\n     * Optional and empty by default. Cheque size is a personal financial disclosure,\n     * and clients must not prompt for it.\n     */\n    amount: InvestmentAmountSchema.optional(),\n    startedAt: partialDateSchema.optional(),\n    endedAt: partialDateSchema.optional(),\n    description: z.string().refine(maxGraphemes(5000)).max(50000).optional(),\n    links: z.array(ArtifactLinkSchema).max(50).optional(),\n    labels: selfLabelsSchema.optional(),\n    createdAt: datetimeSchema,\n  })\n  .passthrough();\n\nexport type ProfileInvestmentRecord = z.infer<typeof ProfileInvestmentRecordSchema>;\n","/**\n * Canonical metadata for the votable Sifa roadmap items: a one-line description\n * and the sifa-workspace issue(s) tracking each item. Single source of truth\n * shared by the sifa-web /roadmap page (labels come from i18n; description and\n * issue links come from here) and the sifa-api operator script that writes the\n * matching userinput.app discussion bodies, so the two surfaces cannot drift.\n *\n * Keys match VOTABLE_KEYS in sifa-api and the roadmap item keys in sifa-web.\n * Descriptions are product voice.\n */\n\n/** Repository whose issues track roadmap items. */\nexport const ROADMAP_ISSUES_REPO = 'singi-labs/sifa-workspace';\n\nexport interface RoadmapItemMeta {\n  /** One-line description of the item, in product voice. */\n  description: string;\n  /** sifa-workspace issue numbers tracking this item (may be empty). */\n  issues: number[];\n}\n\nexport const ROADMAP_ITEM_META: Record<string, RoadmapItemMeta> = {\n  endorsementsAttestations: {\n    description:\n      'Let colleagues vouch for your skills and experience, recorded as attestations you carry with you.',\n    issues: [3, 166],\n  },\n  notifications: {\n    description: 'Get told when someone endorses you, links a company, or acts on your profile.',\n    issues: [158],\n  },\n  verifiedConnections: {\n    description: 'Confirm real working relationships, not just follows.',\n    issues: [],\n  },\n  profileAnalytics: {\n    description: 'See who views your profile and how people find you.',\n    issues: [],\n  },\n  jobProfiles: {\n    description: 'Structured work history that stays with your identity across the network.',\n    issues: [102],\n  },\n  eventRsvp: {\n    description: \"Show the talks and events you're attending or speaking at.\",\n    issues: [214],\n  },\n  companyPages: {\n    description: 'Claimable organization pages that link the people who work there.',\n    issues: [73],\n  },\n  advancedSearch: {\n    description: 'Search across categories, with filters and forgiving name matching.',\n    issues: [5],\n  },\n  multiAccountLinking: {\n    description: 'Tie several atproto accounts to one professional identity.',\n    issues: [8],\n  },\n  mobileApps: {\n    description: 'Native iOS and Android apps.',\n    issues: [114],\n  },\n  atmosphereStream: {\n    description: 'One feed that gathers your activity from across the atproto network.',\n    issues: [7, 12],\n  },\n  localizationMultiLanguage: {\n    description: 'The interface in your own language.',\n    issues: [218],\n  },\n  rssFediverseIngestion: {\n    description: 'Fediverse posts are in your stream. RSS feeds are next.',\n    issues: [111, 153],\n  },\n  githubFeedIngestion: {\n    description:\n      'GitHub activity is in your track record. GitLab and org-owned repositories are next.',\n    issues: [391, 392],\n  },\n  compensationInformation: {\n    description: 'Add optional pay and compensation context to your roles.',\n    issues: [81],\n  },\n  embedCustomization: {\n    description: 'Choose which fields show in your embeddable profile card.',\n    issues: [117],\n  },\n  academicLexicon: {\n    description: 'Schema and features built for researchers and academics.',\n    issues: [119, 148],\n  },\n  journalismLexicon: {\n    description: 'Schema and features built for journalists.',\n    issues: [121],\n  },\n  skillEvidenceGithub: {\n    description: 'Back up skill claims with the languages in your GitHub repositories.',\n    issues: [107],\n  },\n  latexCvExport: {\n    description: 'Export your profile as a LaTeX CV.',\n    issues: [113],\n  },\n  jsonResumeImportExport: {\n    description: 'Move your profile in and out using the JSON Resume standard.',\n    issues: [151],\n  },\n  linkedClaimsResearch: {\n    description: 'Exploring the LinkedClaims spec for portable, verifiable endorsements.',\n    issues: [155],\n  },\n};\n\n/** The GitHub issue URL for a sifa-workspace issue number. */\nexport function roadmapIssueUrl(issue: number): string {\n  return `https://github.com/${ROADMAP_ISSUES_REPO}/issues/${issue}`;\n}\n","/**\n * The buckets a repo data-management UI shows instead of raw collections.\n *\n * \"id.sifa.profile.presentationDelivery\" means nothing to someone who has never\n * heard of a lexicon. Grouping is the whole difference between a developer tool\n * and something a user can act on, so it lives here rather than in one app: the\n * web settings page and a future native app must agree on what a bucket holds,\n * or the same repo reads differently depending where you look at it.\n *\n * Ids only, no display strings -- copy is translated at the surface.\n */\nexport type RepoGroupId =\n  | 'profile-basics'\n  | 'work-history'\n  | 'education'\n  | 'skills-endorsements'\n  | 'projects'\n  | 'publications-talks'\n  | 'people'\n  | 'meetings'\n  | 'other';\n\nexport interface RepoGroupDefinition {\n  id: RepoGroupId;\n  /** Collections this bucket claims, in the order a UI should list them. */\n  collections: readonly string[];\n}\n\n/**\n * Ordered so the buckets a user recognises come first and the machinery they\n * never think about (consents, access grants) comes last.\n *\n * `other` is deliberately absent: it is not a claim over a fixed set, it is\n * where anything unmapped lands. See {@link repoGroupForCollection}.\n */\nexport const SIFA_REPO_GROUPS: readonly RepoGroupDefinition[] = [\n  {\n    id: 'profile-basics',\n    collections: [\n      'id.sifa.profile.self',\n      'id.sifa.profile.location',\n      'id.sifa.profile.language',\n      'id.sifa.profile.externalAccount',\n      'id.sifa.org.profile',\n    ],\n  },\n  {\n    id: 'work-history',\n    collections: [\n      'id.sifa.profile.position',\n      'id.sifa.profile.volunteering',\n      'id.sifa.org.employmentAttestation',\n    ],\n  },\n  {\n    id: 'education',\n    collections: [\n      'id.sifa.profile.education',\n      'id.sifa.profile.course',\n      'id.sifa.profile.certification',\n    ],\n  },\n  {\n    id: 'skills-endorsements',\n    collections: [\n      'id.sifa.profile.skill',\n      'id.sifa.endorsement',\n      'id.sifa.endorsement.confirmation',\n    ],\n  },\n  {\n    id: 'projects',\n    collections: [\n      'id.sifa.profile.project',\n      'id.sifa.profile.involvement',\n      'id.sifa.project.self',\n      'id.sifa.project.member',\n      'id.sifa.project.membership',\n    ],\n  },\n  {\n    id: 'publications-talks',\n    collections: [\n      'id.sifa.profile.publication',\n      'id.sifa.profile.presentation',\n      'id.sifa.profile.presentationDelivery',\n      'id.sifa.profile.honor',\n    ],\n  },\n  {\n    id: 'people',\n    collections: ['id.sifa.graph.follow', 'id.sifa.graph.connection', 'id.sifa.confirmation'],\n  },\n  // The id.sifa.auth* lexicons are `permission-set` definitions -- OAuth scope\n  // identifiers published to the authority PDS and referenced from the API's\n  // scope builder. Nothing writes them into a user's repo, so listing them here\n  // promised a consent-management surface that could only ever be empty.\n  {\n    id: 'meetings',\n    collections: ['id.sifa.meeting'],\n  },\n];\n\nconst GROUP_BY_COLLECTION: ReadonlyMap<string, RepoGroupId> = new Map(\n  SIFA_REPO_GROUPS.flatMap((group) =>\n    group.collections.map((collection) => [collection, group.id] as const),\n  ),\n);\n\n/**\n * Which bucket a collection belongs to, or `other` when we have not mapped it.\n *\n * Unmapped falls through to a visible bucket rather than being filtered out. A\n * lexicon we mint later would otherwise be invisible on the one page whose job\n * is to show everything in the repo -- the user would be told their data is\n * accounted for while some of it was silently omitted.\n */\nexport function repoGroupForCollection(collection: string): RepoGroupId {\n  return GROUP_BY_COLLECTION.get(collection) ?? 'other';\n}\n","/**\n * One line of text identifying a record to the person who wrote it.\n *\n * Split into parts rather than one joined string: joining needs a connective\n * (\"Senior Engineer at Acme\") and a connective is copy, which is translated at\n * the surface. Every value here comes straight from the user's own record, so\n * the SDK contributes no language of its own.\n */\nexport interface RepoRecordLabel {\n  /** The record's own identifying text, or the collection leaf when it has none. */\n  primary: string;\n  /** Employer, institution, event, or publisher, when the record names one. */\n  secondary?: string;\n  /** The date the record is about, not when it was written. May be partial (\"2021-03\"). */\n  date?: string;\n  /**\n   * The person a record is about, for records whose meaning is a relationship\n   * rather than text: endorsements, follows, confirmations, attestations.\n   *\n   * Kept out of {@link primary} so a surface can resolve it to a handle and\n   * avatar without parsing a DID back out of display text.\n   */\n  subjectDid?: string;\n  /**\n   * Handle and display name for {@link subjectDid}, when a surface resolved it.\n   *\n   * Records whose whole meaning is a relationship -- follows, meetings,\n   * endorsements -- carry only a DID. A page listing 33 of them shows 33\n   * identical rows and a column of did:plc: strings, which is unusable for\n   * deciding which one to remove. Resolution has to be batched by the caller,\n   * so the SDK leaves room for the answer rather than fetching it.\n   */\n  subjectHandle?: string;\n  subjectName?: string;\n  /**\n   * Set when the record carried no readable text and {@link primary} is the\n   * collection leaf rather than the user's own data.\n   *\n   * A surface must substitute its own wording for these -- a row reading\n   * \"follow\" or \"location\" tells the reader nothing about which record they\n   * are about to delete. The flag exists because the leaf is indistinguishable\n   * from real content once it is a string: a headline that genuinely says\n   * \"location\" must not be relabelled.\n   */\n  isFallback?: true;\n}\n\ninterface LabelRule {\n  /**\n   * Candidate fields for {@link RepoRecordLabel.primary}, first non-blank wins.\n   *\n   * A field may be a dotted path into a nested object (\"address.locality\").\n   * Several lexicons nest their readable text one level down, and a rule that\n   * could only see the top level fell through to the collection leaf -- the\n   * user was shown the bare word \"location\" where their city should be.\n   */\n  primary?: readonly string[];\n  secondary?: readonly string[];\n  date?: readonly string[];\n  subjectDid?: readonly string[];\n}\n\n/**\n * Which fields carry the identifying text, per collection.\n *\n * A table rather than a function per lexicon: the extraction is the same shape\n * every time, and 30 near-identical functions would hide the two or three that\n * genuinely differ.\n *\n * Collections absent from this table fall back to the collection leaf. That is\n * the right answer for records with nothing human-readable in them at all --\n * consent grants, access tokens -- which is most of what is missing here.\n */\nconst LABEL_RULES: Readonly<Record<string, LabelRule>> = {\n  'id.sifa.profile.self': { primary: ['headline'] },\n  'id.sifa.profile.location': {\n    primary: ['address.locality', 'address.region', 'address.country'],\n    secondary: ['address.country'],\n  },\n  'id.sifa.profile.language': { primary: ['name'], secondary: ['proficiency'] },\n  'id.sifa.profile.externalAccount': { primary: ['label', 'platform'], secondary: ['url'] },\n  'id.sifa.org.profile': { primary: ['name'] },\n\n  'id.sifa.profile.position': {\n    primary: ['title'],\n    secondary: ['company'],\n    date: ['startedAt'],\n  },\n  'id.sifa.profile.volunteering': {\n    primary: ['role', 'organization'],\n    secondary: ['organization'],\n    date: ['startedAt'],\n  },\n  'id.sifa.org.employmentAttestation': {\n    primary: ['title'],\n    date: ['startedAt'],\n    subjectDid: ['subject'],\n  },\n\n  'id.sifa.profile.education': {\n    primary: ['degree', 'fieldOfStudy'],\n    secondary: ['institution'],\n    date: ['startedAt'],\n  },\n  'id.sifa.profile.course': {\n    primary: ['name'],\n    secondary: ['institution'],\n    date: ['completedAt'],\n  },\n  'id.sifa.profile.certification': {\n    primary: ['name'],\n    secondary: ['authority'],\n    date: ['issuedAt'],\n  },\n\n  'id.sifa.profile.skill': { primary: ['name'], secondary: ['category'] },\n  'id.sifa.endorsement': { primary: ['skillName'], subjectDid: ['subject'] },\n  'id.sifa.endorsement.confirmation': { primary: ['skill'] },\n\n  'id.sifa.profile.project': {\n    primary: ['title', 'name'],\n    secondary: ['role'],\n    date: ['startedAt'],\n  },\n  'id.sifa.profile.involvement': {\n    primary: ['role', 'upstream'],\n    secondary: ['upstream'],\n    date: ['startedAt'],\n  },\n  'id.sifa.project.self': { primary: ['name', 'title'] },\n  'id.sifa.project.member': { primary: ['role'], subjectDid: ['subject', 'did'] },\n  'id.sifa.project.membership': { primary: ['role'], subjectDid: ['subject', 'did'] },\n\n  'id.sifa.profile.publication': {\n    primary: ['title', 'name'],\n    secondary: ['publisher'],\n    date: ['publishedAt'],\n  },\n  'id.sifa.profile.presentation': { primary: ['title', 'label'] },\n  'id.sifa.profile.presentationDelivery': {\n    // A delivery without its own title is identified by the event it happened\n    // at. Falling straight to the leaf gave a run of rows all reading \"a time\n    // you gave a talk\", with the one distinguishing fact demoted underneath.\n    primary: ['title', 'eventName'],\n    secondary: ['eventName'],\n    date: ['date'],\n  },\n  'id.sifa.profile.honor': { primary: ['title'], secondary: ['issuer'], date: ['awardedAt'] },\n\n  'id.sifa.graph.follow': { subjectDid: ['subject'] },\n  'id.sifa.meeting': { subjectDid: ['subject'] },\n  'id.sifa.graph.connection': { subjectDid: ['subject'] },\n  'id.sifa.confirmation': {\n    primary: ['subjectName'],\n    secondary: ['relation'],\n    subjectDid: ['subject'],\n  },\n};\n\n/** The part of an NSID after the last dot: \"id.sifa.profile.position\" -> \"position\". */\nfunction collectionLeaf(collection: string): string {\n  return collection.slice(collection.lastIndexOf('.') + 1);\n}\n\n/** Walk a dotted path, stopping at the first step that is not an object. */\nfunction valueAtPath(record: Record<string, unknown>, path: string): unknown {\n  let current: unknown = record;\n  for (const segment of path.split('.')) {\n    if (typeof current !== 'object' || current === null) return undefined;\n    current = (current as Record<string, unknown>)[segment];\n  }\n  return current;\n}\n\n/**\n * First field holding a non-blank string, or undefined.\n *\n * Non-strings are skipped rather than coerced: a record that fails validation\n * still reaches this page (it is in the repo, so the user can see and delete\n * it), and \"[object Object]\" as a label helps nobody.\n */\nfunction pickString(\n  record: Record<string, unknown>,\n  fields: readonly string[],\n): string | undefined {\n  for (const field of fields) {\n    const raw = valueAtPath(record, field);\n    if (typeof raw !== 'string') continue;\n    const trimmed = raw.trim();\n    if (trimmed.length > 0) return trimmed;\n  }\n  return undefined;\n}\n\n/**\n * Describe one record from the user's repo in terms they will recognise.\n *\n * Never throws and never returns an empty primary. This runs over whatever is\n * actually in the repo, including records written by older versions of Sifa and\n * records hand-edited elsewhere. A page that crashes on one malformed record\n * would hide the rest, which is exactly the data the user came to manage.\n */\nexport function describeSifaRecord(collection: string, value: unknown): RepoRecordLabel {\n  const leaf = collectionLeaf(collection);\n  const rule = LABEL_RULES[collection];\n  if (!rule || typeof value !== 'object' || value === null) {\n    return { primary: leaf, isFallback: true };\n  }\n\n  const record = value as Record<string, unknown>;\n  const primary = rule.primary && pickString(record, rule.primary);\n  const label: RepoRecordLabel = primary ? { primary } : { primary: leaf, isFallback: true };\n\n  const secondary = rule.secondary && pickString(record, rule.secondary);\n  if (secondary !== undefined && secondary !== label.primary) label.secondary = secondary;\n\n  const date = rule.date && pickString(record, rule.date);\n  if (date !== undefined) label.date = date;\n\n  const subjectDid = rule.subjectDid && pickString(record, rule.subjectDid);\n  if (subjectDid !== undefined) label.subjectDid = subjectDid;\n\n  return label;\n}\n","/**\n * Sifa SDK -- public client library for the Sifa AppView on AT Protocol.\n *\n * Pre-1.0: the public API is unstable and may change in any minor release.\n *\n * @see https://github.com/singi-labs/sifa-sdk\n */\n\ndeclare const __SIFA_SDK_VERSION__: string;\n\nexport const SIFA_SDK_VERSION: string = __SIFA_SDK_VERSION__;\n\nexport type {\n  ActiveApp,\n  Endorsement,\n  EndorsementData,\n  ExternalAccount,\n  ExternalAccountKeytraceClaim,\n  FeedItem,\n  LanguageProficiency,\n  LocationValue,\n  OrgAddressView,\n  OrgFloorVerdict,\n  OrgLinkView,\n  OrgProfileView,\n  RecognizedEntity,\n  PdsProviderInfo,\n  PresentationLinkView,\n  Profile,\n  ProfileCertification,\n  ProfileCourse,\n  ProfileEducation,\n  ProfileHonor,\n  ProfileIndustry,\n  ProfileInvestment,\n  ProfileInvestmentLink,\n  ProfileInvolvement,\n  ProfileInvolvementLink,\n  ProfileLanguage,\n  ProfileLocation,\n  ProfileOverrideSource,\n  ProfilePosition,\n  ProfilePresentation,\n  CoSpeaker,\n  ActorCard,\n  AuthorSuggestion,\n  ProjectMemberCard,\n  ProjectRole,\n  ProfilePresentationDelivery,\n  ProfileProject,\n  ProfilePublication,\n  ProfileSkill,\n  ProfileVolunteering,\n  PublicationContributor,\n  SkillRef,\n  SkillSuggestion,\n  TrustStat,\n  VerifiedAccount,\n  AccountFacetMode,\n} from './types/index.js';\n\n// Aggregated public profile view (`id.sifa.getProfileView` XRPC query).\nexport type {\n  ProfileView,\n  IndustryDomain,\n  ProfileLocationView,\n  PositionView,\n  EducationView,\n  SkillView,\n  CertificationView,\n  ProjectView,\n  VolunteeringView,\n  InvolvementView,\n  InvolvementLinkView,\n  PublicationView,\n  ContributorView,\n  CourseView,\n  DurationView,\n  CoSpeakerView,\n  ProjectMemberView,\n  PresentationDeliveryView,\n  PresentationView,\n  HonorView,\n  LanguageView,\n  ExternalAccountView,\n  ActiveAppView,\n  AtfundLinkView,\n} from './types/profile-view.js';\n\nexport { PROJECT_ROLES } from './types/index.js';\n\nexport {\n  ACTIVITY_TIERS,\n  APP_CATEGORIES,\n  APP_CATEGORY_IDS,\n  APP_CATEGORY_MAP,\n  CATEGORY_LABELS,\n  normalizeSkillCategory,\n  CATEGORY_ORDER,\n  CONTINENTS,\n  COMPANY_OPTIONAL_EMPLOYMENT_TYPES,\n  COUNTRIES,\n  CALENDAR_EVENT_MODE_LABELS,\n  CALENDAR_EVENT_STATUS_LABELS,\n  PRESENTATION_LINK_TYPE_LABELS,\n  PRESENTATION_LINK_TYPE_OPTIONS,\n  PRESENTATION_ROLE_LABELS,\n  PRESENTATION_ROLE_OPTIONS,\n  PUBLICATION_TYPE_LABELS,\n  PUBLICATION_TYPE_OPTIONS,\n  EMPLOYMENT_TYPE_GROUPS,\n  INVESTMENT_ROLE_OPTIONS,\n  INVESTMENT_ROLE_LABELS,\n  INVESTMENT_STAGE_OPTIONS,\n  INVESTMENT_STAGE_LABELS,\n  INVESTMENT_STATUS_OPTIONS,\n  INVESTMENT_STATUS_LABELS,\n  ON_BEHALF_OF_EMPLOYMENT_TYPES,\n  EMPLOYMENT_TYPE_LABELS,\n  INDUSTRY_OPTIONS,\n  OPEN_TO_OPTIONS,\n  OPEN_TO_TOKENS,\n  OPEN_TO_TOKEN_TO_VALUE,\n  OPEN_TO_VALUE_TO_TOKEN,\n  categoryForApp,\n  findIndustry,\n  getActivityTaxonomyVersion,\n  getActivityTier,\n  getCalendarEventModeLabel,\n  getCalendarEventStatusLabel,\n  getPresentationLinkTypeLabel,\n  getPresentationRoleLabel,\n  getPublicationTypeLabel,\n  getAppCategoryIcon,\n  getEmploymentTypeLabel,\n  isCompanyRequired,\n  getInvestmentRoleLabel,\n  getInvestmentStageLabel,\n  getInvestmentStatusLabel,\n  isOnBehalfOfApplicable,\n  getIndustryLabelKey,\n  getLexiconEntry,\n  getOpenToLabelKey,\n  normalizeOpenTo,\n  openToTokenToValue,\n  openToValueToToken,\n  getTierMeta,\n  getWorkplaceTypeLabel,\n  normalizeWorkplaceTypes,\n  isAppCategory,\n  isKnownAppId,\n  PLATFORM_LABELS,\n  PLATFORM_OPTIONS,\n  SKILL_CATEGORIES,\n  WORKPLACE_TYPE_LABELS,\n  WORKPLACE_TYPE_OPTIONS,\n  dedupeSkills,\n  getContinent,\n  getFaviconUrl,\n  getPlatformLabel,\n  groupSkillsByCategory,\n  groupSkillsBySubCategory,\n  groupSkillsForDisplay,\n  isKnownPlatform,\n  normalizePlatformId,\n  type ActivityTaxonomy,\n  type ActivityTier,\n  type AppCategoryId,\n  type ContinentCode,\n  type EmploymentTypeGroup,\n  type EmploymentTypeOption,\n  type InvestmentOption,\n  type IndustryOption,\n  type KnownAppId,\n  type LexiconEntry,\n  type MergedProfileSkill,\n  type PresentationLinkTypeOption,\n  type PresentationRoleOption,\n  type PublicationTypeOption,\n  INVOLVEMENT_KIND_OPTIONS,\n  INVOLVEMENT_KIND_LABELS,\n  INVOLVEMENT_KIND_HEADINGS,\n  getInvolvementKindHeading,\n  getInvolvementKindLabel,\n  ARTIFACT_LINK_KIND_OPTIONS,\n  ARTIFACT_LINK_KIND_LABELS,\n  getArtifactLinkKindLabel,\n  VERIFICATION_PROVIDERS,\n  getVerificationProvider,\n  isKnownVerificationProvider,\n  resolveVerifierProvider,\n  primaryVerification,\n  type AccountVerification,\n  type VerificationProvider,\n  type VerificationProviderId,\n  type VerificationSource,\n  type InvolvementKindOption,\n  type ArtifactLinkKindOption,\n  type OpenToGroup,\n  type OpenToOption,\n  type PlatformId,\n  type SkillCategory,\n  type TierMeta,\n  type WorkplaceTypeOption,\n} from './taxonomy/index.js';\n\nexport {\n  certDateExtractor,\n  contrastRatio,\n  countryCodeToFlag,\n  dateRangeExtractor,\n  detectPdsProvider,\n  formatCompanyName,\n  formatDateRange,\n  formatDisplayUrl,\n  formatDistanceToNow,\n  formatLocation,\n  formatPresentationDuration,\n  formatRelativeTime,\n  formatTimelineDate,\n  getDisplayLabel,\n  getHandleStem,\n  getPdsDisplayName,\n  isValidRgbColor,\n  lexiconDateExtractor,\n  limitCombiningMarks,\n  locationSegments,\n  meetsContrastAA,\n  normalizeCompanyKey,\n  normalizeLegalForm,\n  parseLocationString,\n  parseTalkRkey,\n  pdsProviderFromApi,\n  relativeLuminance,\n  resolveEmbed,\n  youtubeVideoId,\n  youtubeThumbnailUrl,\n  rgbToString,\n  sanitizeDisplayText,\n  normalizeDoi,\n  sanitizeHandleInput,\n  singleDateExtractor,\n  slugifyTitle,\n  buildMetaDescription,\n  buildTalkSlug,\n  sortByDateDesc,\n  summarizePresentationDeliveries,\n  truncateGraphemes,\n  type EmbedResult,\n  type PdsProvider,\n  type PresentationDeliverySummary,\n  type RgbColor,\n} from './format/index.js';\n\nexport {\n  parsePresentationDuration,\n  durationFromMinutes,\n  parseIntendedAudiences,\n  stripHtmlToText,\n  normalizePresentationRole,\n  normalizePresentationMode,\n  presentationCsvRowToRecord,\n  presentationDeliveryCsvRowToRecord,\n  type CsvRow,\n  type ParsedPresentation,\n  type ParsedDelivery,\n} from './import/index.js';\n\nexport {\n  ACTIVITY_VISIBILITY_RULES,\n  ADULT_CONTENT_LABELS,\n  APP_URL_PATTERNS,\n  COLLECTION_TO_APP,\n  getAppIdForCollection,\n  hasAdultContent,\n  isVisibleActivityItem,\n  resolveCardHealth,\n  resolveCardUrl,\n  type ActivityItemForUrl,\n  type ActivityLabel,\n  type AdultContentLabel,\n  type AppUrlPatterns,\n  type CardHealth,\n  type CardHealthStrategy,\n} from './cards/index.js';\n\nexport {\n  PUBLISHERS,\n  STANDARD_PUBLISHER_ID,\n  getPublisherById,\n  getPublisherByHost,\n  getPublisherFromSiteUrl,\n  type Publisher,\n} from './publishers/index.js';\n\n// Shared activity-stream view-model: the normalized, framework-free feed both\n// sifa-web (React cards) and page.sifa.id (string-HTML renderer) consume.\nexport {\n  ACTIVITY_VERBS,\n  STREAM_VERBS,\n  getActivityVerbsVersion,\n  streamVerbSchema,\n  verbForCollection,\n  streamAddressSchema,\n  streamAuthorSchema,\n  streamCardBodySchema,\n  streamCardSubjectSchema,\n  streamCardVMSchema,\n  streamExternalLinkSchema,\n  streamGeoSchema,\n  streamMediaSchema,\n  streamRichSegmentSchema,\n  streamSourceSchema,\n  streamThemeSchema,\n  toStreamCardVM,\n  toStreamCardVMs,\n  type ActivityItem,\n  type ActivityVerbMap,\n  type StreamAddress,\n  type StreamAuthor,\n  type StreamCardBody,\n  type StreamCardSubject,\n  type StreamCardVM,\n  type StreamExternalLink,\n  type StreamGeo,\n  type StreamMedia,\n  type StreamMediaBase,\n  type StreamMediaBlob,\n  type StreamMediaResolved,\n  type StreamRichSegment,\n  type StreamSource,\n  type StreamTheme,\n  type StreamVerb,\n  type ToStreamCardVMOptions,\n} from './stream/index.js';\n\nexport {\n  COMPLETENESS_MAX_SCORE,\n  completenessPercent,\n  completenessScore,\n  DIMENSIONS_MAX_SCORE,\n  MIN_SKILLS,\n  countFilledDimensions,\n  dimensionsFromInputs,\n  getFilledDimensionsMap,\n  pickPrimaryPosition,\n  summarizeProfileView,\n  profileToDimensionInputs,\n  isPseudoEmployer,\n  looksLikeDomain,\n  entityDisambiguationLabel,\n  searchResultDisambiguation,\n  entityResultKey,\n  classifyEntityRef,\n  isLinked,\n  ENTITY_REF_ANCHORS,\n  qualifiesAsOrg,\n  isRegistrableDomainHandle,\n  hasPersonalProfileContent,\n  rendersPersonalProfile,\n  rendersCompanyProfile,\n  resolveAccountFacetMode,\n  isCompanyPageIndexable,\n  COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS,\n  countRecentActivity,\n  type DailyActivityCount,\n  type DimensionKey,\n  type DimensionMap,\n  type PrimaryPositionCandidate,\n  type ProfileSummary,\n  type SummarizeProfileViewOptions,\n  type ProfileCompletion,\n  type ProfileDimensionInputs,\n  type DisambiguationFields,\n  type EntityRefAnchor,\n  type CompanyFirmographics,\n  type PersonalFacetContent,\n} from './logic/index.js';\n\n// Profile section model: which sections render, in what order, their nav\n// grouping, per-section sorts, and involvement grouping. Shared by the HTML\n// profile page, the Markdown/DOCX/print exports, and the personal-site renderer.\nexport {\n  ALL_SECTIONS,\n  INVOLVEMENT_HEADING_ORDER,\n  SECTION_GROUPS,\n  SECTION_LABELS,\n  filterHidden,\n  getVisibleSectionIds,\n  groupInvolvementByHeading,\n  hoistPrimary,\n  isRoleLineRedundant,\n  isSectionPopulated,\n  sortByActiveDateRange,\n  sortCertifications,\n  sortEducation,\n  sortHonors,\n  sortLanguages,\n  sortLanguagesByProficiency,\n  sortPositions,\n  sortProjects,\n  sortPublications,\n  visibleItems,\n  type InvolvementGroup,\n  type SectionGroupId,\n  type SectionId,\n} from './profile/index.js';\n\nexport {\n  AtmosphereFeedItemSchema,\n  BlobRefSchema,\n  EndorsementConfirmationRecordSchema,\n  EndorsementRecordSchema,\n  OrgProfileRecordSchema,\n  OrgEmploymentAttestationRecordSchema,\n  EntitySearchResultSchema,\n  EntitySearchResponseSchema,\n  EntitySelectRequestSchema,\n  EntitySelectResponseSchema,\n  EntityImportSearchResponseSchema,\n  EntityResolveDomainRequestSchema,\n  EntityResolveDomainResponseSchema,\n  EntityMintDomainResponseSchema,\n  FEATURE_FLAGS,\n  FeatureAllowlistEntrySchema,\n  FeedActorSchema,\n  FollowFeedItemSchema,\n  FollowFeedPageSchema,\n  FollowProfilePageSchema,\n  FollowProfileSchema,\n  GraphFollowRecordSchema,\n  PresentationDurationSchema,\n  PresentationLinkSchema,\n  ProfileCertificationRecordSchema,\n  ProfileCourseRecordSchema,\n  ProfileEducationRecordSchema,\n  ProfileExternalAccountRecordSchema,\n  ProfileHonorRecordSchema,\n  ProfileInvestmentRecordSchema,\n  InvestmentAmountSchema,\n  PROFILE_INVESTMENT_NSID,\n  ProfileInvolvementRecordSchema,\n  ArtifactLinkSchema,\n  PROFILE_INVOLVEMENT_NSID,\n  ProfileLanguageRecordSchema,\n  ProfilePositionRecordSchema,\n  ProfilePresentationDeliveryRecordSchema,\n  ProfilePresentationRecordSchema,\n  ProfileProjectRecordSchema,\n  ProfilePublicationRecordSchema,\n  ProfileSelfRecordSchema,\n  ProfileSkillRecordSchema,\n  ProfileVolunteeringRecordSchema,\n  PublicationAuthorSchema,\n  SifaFeedItemSchema,\n  atUriSchema,\n  cidSchema,\n  datetimeSchema,\n  decodeFeedCursor,\n  didSchema,\n  encodeFeedCursor,\n  externalRecordRefSchema,\n  languageTagSchema,\n  makeGraphFollowRecordSchema,\n  maxGraphemes,\n  partialDateSchema,\n  selfLabelsSchema,\n  skillRefSchema,\n  strongRefSchema,\n  uriSchema,\n  type AtmosphereFeedItem,\n  type BlobRef,\n  type EndorsementConfirmationRecord,\n  type EndorsementRecord,\n  type OrgProfileRecord,\n  type OrgEmploymentAttestationRecord,\n  type EntitySearchResult,\n  type EntitySearchResponse,\n  type EntitySelectRequest,\n  type EntitySelectResponse,\n  type EntityImportSearchResponse,\n  type EntityResolveDomainRequest,\n  type EntityResolveDomainResponse,\n  type EntityMintDomainResponse,\n  type FeatureAllowlistEntry,\n  type FeatureFlag,\n  type FeedActor,\n  type FeedCursor,\n  type FollowFeedItem,\n  type FollowFeedPage,\n  type FollowProfileItem,\n  type FollowProfilePage,\n  type GraphFollowRecord,\n  type SifaFeedItem,\n  type ProfileCertificationRecord,\n  type ProfileCourseRecord,\n  type ProfileEducationRecord,\n  type ProfileExternalAccountRecord,\n  type ProfileHonorRecord,\n  type ProfileInvolvementRecord,\n  type ArtifactLink,\n  type ProfileLanguageRecord,\n  type PresentationDuration,\n  type PresentationLink,\n  type ProfilePositionRecord,\n  type ProfilePresentationDeliveryRecord,\n  type ProfilePresentationRecord,\n  type ProfileProjectRecord,\n  type ProfilePublicationRecord,\n  type ProfileSelfRecord,\n  type ProfileSkillRecord,\n  type ProfileVolunteeringRecord,\n  type PublicationAuthor,\n} from './schemas/index.js';\n\nexport {\n  ROADMAP_ITEM_META,\n  ROADMAP_ISSUES_REPO,\n  roadmapIssueUrl,\n  type RoadmapItemMeta,\n} from './roadmap/index.js';\n\nexport type {\n  LocationSegment,\n  LocationSegmentKind,\n  LocationSegmentsOptions,\n} from './format/index.js';\n\nexport type { DisplayUrl, FormatDisplayUrlOptions, UrlPathPolicy } from './format/index.js';\n\nexport { SIFA_REPO_GROUPS, describeSifaRecord, repoGroupForCollection } from './repo/index.js';\nexport type {\n  RepoCollectionGroup,\n  RepoDeleteOutcome,\n  RepoDeleteRecordResult,\n  RepoDeleteResult,\n  RepoGroupDefinition,\n  RepoGroupId,\n  RepoInventory,\n  RepoRecordLabel,\n  RepoRecordSummary,\n} from './repo/index.js';\n"]}