{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "session-composer",
  "type": "registry:ui",
  "title": "Session Composer",
  "description": "Build a session out of modules: pick what goes in, put it in order, and see at every step how long it runs against the time you have. For a workshop host planning a morning, a community lead booking a session, a teacher putting a lesson together. Modules a…",
  "author": "ofri-peretz <https://github.com/ofri-peretz>",
  "categories": [
    "form",
    "pattern"
  ],
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "https://ds.interlace.tools/r/interlace-base.json",
    "https://ds.interlace.tools/r/button.json",
    "https://ds.interlace.tools/r/cn.json",
    "https://ds.interlace.tools/r/meter.json",
    "https://ds.interlace.tools/r/motion-token.json",
    "https://ds.interlace.tools/r/use-reduced-motion.json"
  ],
  "files": [
    {
      "path": "registry/interlace-ui/patterns/session-composer.tsx",
      "target": "components/ui/patterns/session-composer.tsx",
      "type": "registry:ui",
      "content": "'use client';\n\nimport * as React from 'react';\n\n// @interlace/session-composer v1.0.1 — Interlace design system.\n// Docs, props and live preview: https://ds.interlace.tools/c/session-composer\n// What changed since: https://ds.interlace.tools/c/session-composer#history\n// Generated banner — keep it, the upgrade diff reads this version.\n\n/**\n * @interlace/ui — SessionComposer\n *\n * Build a session out of modules: pick what goes in, put it in order, and\n * see at every step how long it runs against the time you have. For a\n * workshop host planning a morning, a community lead booking a session, a\n * teacher putting a lesson together. Modules a group has already had are\n * marked, so nobody sits through the same hour twice.\n *\n * ## Anatomy\n *\n *   SessionComposer                (div @container — data-slot=\"session-composer\", data-over)\n *     ├─ section                   (data-slot=\"session-composer-catalogue\")\n *     │   ├─ h2|h3                 (catalogue heading)\n *     │   └─ ul\n *     │       └─ li × n            (data-slot=\"session-composer-module\", data-in, data-seen, data-fits)\n *     │           ├─ p             (title; minutes, \"Seen before\", \"Always included\")\n *     │           ├─ p?            (summary)\n *     │           └─ Button        (data-slot=\"session-composer-toggle\": Add / Remove, aria-pressed)\n *     ├─ section                   (data-slot=\"session-composer-plan\")\n *     │   ├─ h2|h3                 (plan heading)\n *     │   ├─ Meter                 (data-slot=\"meter\": minutes of the limit, negative tone when over)\n *     │   ├─ ol                    (data-slot=\"session-composer-plan-list\")\n *     │   │   └─ li × n            (data-slot=\"session-composer-step\", data-required)\n *     │   │       ├─ span          (position, title, minutes)\n *     │   │       └─ div role=group (move up, move down, remove; none on a required module)\n *     │   ├─ p                     (data-slot=\"session-composer-empty\", before anything is in)\n *     │   └─ div?                  (data-slot=\"session-composer-footer\": e.g. \"Request this session\")\n *     └─ span aria-live            (data-slot=\"session-composer-announce\": \"Added Logs. 75 of 90 minutes.\")\n *\n * ## Data\n *\n * A plan is an ordered list of module ids: `value` / `defaultValue` /\n * `onValueChange`. The rules (what fits, where an added module goes, how a\n * move clamps, which modules can never leave) are in\n * `patterns/session-plan-model`, so a server can check a submitted plan the\n * same way. `required` modules (an opening, a close) are always in and stay\n * where they are. `seen` ids are modules the group had before.\n *\n * ## Motion\n *\n * A module added to the plan grows in by scale (240ms). Transform only; off\n * under reduced motion. Moving keeps focus on the moved module's control.\n *\n * ## MIN_VIEWPORT — 320\n *\n * One column under 48rem of its own width; catalogue and plan side by side\n * from there.\n *\n * | Rule | Concept                   | Where in this file                                   |\n * | ---- | ------------------------- | ---------------------------------------------------- |\n * | R4   | Extends native el         | `React.ComponentProps<'div'>`                        |\n * | R6   | data-slot per part        | session-composer-*                                   |\n * | R7   | cn + ...rest              | `cn(…, className)` + `{...props}`                    |\n * | R9   | Controlled + uncontrolled | `value` / `defaultValue` / `onValueChange`           |\n * | R14  | Declares min viewport     | `data-min-viewport` + exported const                 |\n * | R26  | A11y                      | named controls per module; every change announced    |\n */\n\nimport { ArrowDown, ArrowUp, Check, Plus, X } from 'lucide-react';\n\nimport { cn } from '@/lib/utils';\nimport { useReducedMotion } from '@/hooks/use-reduced-motion';\nimport { motionEase } from '@/lib/motion-token';\nimport { Button } from '@/components/ui/button';\nimport { Meter } from '@/components/ui/meter';\nimport {\n  addToPlan,\n  canMove,\n  cleanPlan,\n  fitsPlan,\n  movePlan,\n  removeFromPlan,\n  summarizePlan,\n  type PlanOptions,\n} from '@/components/ui/patterns/session-plan-model';\n\nexport const MIN_VIEWPORT = 320 as const;\n\n\ninterface SessionModule {\n  id: string;\n  title: string;\n  minutes: number;\n  summary?: React.ReactNode;\n}\n\ninterface SessionComposerLabels {\n  /** @default 'Modules' */\n  catalogue?: string;\n  /** @default 'Your session' */\n  plan?: string;\n  /** @default 'Add' */\n  add?: string;\n  /** @default 'Remove' */\n  remove?: string;\n  /** @default (title) => `Move ${title} up` */\n  moveUp?: (title: string) => string;\n  /** @default (title) => `Move ${title} down` */\n  moveDown?: (title: string) => string;\n  /** @default (title) => `Remove ${title}` */\n  removeNamed?: (title: string) => string;\n  /** @default (n) => `${n} min` */\n  minutes?: (minutes: number, formatted: string) => string;\n  /** @default 'Seen before' */\n  seen?: string;\n  /** @default 'Always included' */\n  required?: string;\n  /** @default 'Session length' */\n  length?: string;\n  /** The meter's printed value. */\n  total?: (minutes: string, max: string | null) => string;\n  /** Under the meter when the plan runs long. */\n  over?: (minutes: string) => string;\n  /** Why a module cannot be added. */\n  noRoom?: (needs: string, left: string) => string;\n  /** @default 'Add modules to build the session.' */\n  empty?: string;\n  /** Announced after a change. */\n  added?: (title: string, total: string) => string;\n  removed?: (title: string, total: string) => string;\n  moved?: (title: string, position: number, count: number) => string;\n}\n\ntype SessionComposerProps = Omit<React.ComponentProps<'div'>, 'children' | 'defaultValue' | 'onChange'> & {\n  modules: readonly SessionModule[];\n  value?: readonly string[];\n  defaultValue?: readonly string[];\n  onValueChange?: (ids: string[]) => void;\n  /** The most minutes the session may run. */\n  maxMinutes?: number | null;\n  /** Always in, in place, and not removable. */\n  required?: readonly string[];\n  /** Modules this group had before. */\n  seen?: readonly string[];\n  /** Under the plan: the next step, e.g. a request button. */\n  footer?: React.ReactNode;\n  /** Heading level for the two sections. @default 'h2' */\n  headingAs?: 'h2' | 'h3' | 'h4';\n  locale?: string;\n  labels?: SessionComposerLabels;\n};\n\nfunction SessionComposer({\n  modules,\n  value: valueProp,\n  defaultValue = [],\n  onValueChange,\n  maxMinutes = null,\n  required = [],\n  seen = [],\n  footer,\n  headingAs: Heading = 'h2',\n  locale,\n  labels,\n  className,\n  ...props\n}: SessionComposerProps) {\n  const options: PlanOptions = { maxMinutes, required };\n  const [uncontrolled, setUncontrolled] = React.useState<string[]>(() => cleanPlan(modules, defaultValue, options));\n  const ids = cleanPlan(modules, valueProp ?? uncontrolled, options);\n  const summary = summarizePlan(modules, ids, options);\n  const byId = new Map(modules.map((m) => [m.id, m]));\n  const seenSet = new Set(seen);\n  const requiredSet = new Set(required);\n  const reduced = useReducedMotion();\n  const [announce, setAnnounce] = React.useState('');\n  const planRef = React.useRef<HTMLOListElement>(null);\n  const planHeadingRef = React.useRef<HTMLHeadingElement>(null);\n  const grow = React.useRef<string | null>(null);\n  const focusAfter = React.useRef<{ id: string; control: 'up' | 'down' | 'remove' } | 'heading' | null>(null);\n  const catalogueId = React.useId();\n  const planId = React.useId();\n  const nf = React.useMemo(() => new Intl.NumberFormat(locale), [locale]);\n\n  const min = (n: number) => (labels?.minutes ?? ((_: number, f: string) => `${f} min`))(n, nf.format(n));\n  const limit = typeof maxMinutes === 'number' && Number.isFinite(maxMinutes) && maxMinutes > 0 ? maxMinutes : null;\n  const maxText = limit === null ? null : min(limit);\n  const totalLabel = labels?.total ?? ((t: string, max: string | null) => (max ? `${t} of ${max}` : t));\n  const stepEl = (id: string) =>\n    [...(planRef.current?.querySelectorAll<HTMLElement>('[data-step-id]') ?? [])].find((el) => el.dataset.stepId === id);\n\n  const commit = (next: string[]) => {\n    if (valueProp === undefined) setUncontrolled(next);\n    onValueChange?.(next);\n  };\n\n  React.useLayoutEffect(() => {\n    const id = grow.current;\n    grow.current = null;\n    if (id && !reduced) {\n      const el = stepEl(id);\n      if (el && typeof el.animate === 'function') {\n        el.animate([{ transform: 'scale(0.92)' }, { transform: 'scale(1)' }], { duration: 240, easing: motionEase(el, 'enter') });\n      }\n    }\n    const f = focusAfter.current;\n    focusAfter.current = null;\n    if (f === 'heading') planHeadingRef.current?.focus();\n    else if (f) {\n      const step = stepEl(f.id);\n      const want = step?.querySelector<HTMLButtonElement>(`[data-control=\"${f.control}\"]`);\n      const fallback = step?.querySelector<HTMLButtonElement>('[data-control]:not(:disabled)');\n      (want && !want.disabled ? want : fallback)?.focus();\n    }\n  });\n\n  const totalAfter = (next: string[]) => totalLabel(min(summarizePlan(modules, next, options).minutes), maxText);\n\n  const add = (m: SessionModule) => {\n    const next = addToPlan(modules, ids, m.id, options);\n    grow.current = m.id;\n    setAnnounce((labels?.added ?? ((t, total) => `Added ${t}. ${total}.`))(m.title, totalAfter(next)));\n    commit(next);\n  };\n\n  const remove = (m: SessionModule, from: 'catalogue' | 'plan') => {\n    const next = removeFromPlan(modules, ids, m.id, options);\n    if (from === 'plan') {\n      const at = ids.indexOf(m.id);\n      const neighbour = next.slice(at).find((x) => !requiredSet.has(x)) ?? next.slice(0, at).reverse().find((x) => !requiredSet.has(x));\n      focusAfter.current = neighbour ? { id: neighbour, control: 'remove' } : 'heading';\n    }\n    setAnnounce((labels?.removed ?? ((t, total) => `Removed ${t}. ${total}.`))(m.title, totalAfter(next)));\n    commit(next);\n  };\n\n  const move = (m: SessionModule, delta: -1 | 1) => {\n    const next = movePlan(modules, ids, m.id, delta, options);\n    focusAfter.current = { id: m.id, control: delta < 0 ? 'up' : 'down' };\n    setAnnounce(\n      (labels?.moved ?? ((t, p, n) => `${t} moved to ${p} of ${n}.`))(m.title, next.indexOf(m.id) + 1, next.length),\n    );\n    commit(next);\n  };\n\n  return (\n    <div\n      data-slot=\"session-composer\"\n      data-over={summary.over > 0 ? '' : undefined}\n      data-min-viewport={String(MIN_VIEWPORT)}\n      className={cn('@container', className)}\n      {...props}\n    >\n      <div className=\"grid gap-8 @3xl:grid-cols-2 @3xl:gap-10\">\n        <section data-slot=\"session-composer-catalogue\" aria-labelledby={catalogueId} className=\"grid content-start gap-4\">\n          <Heading id={catalogueId} className=\"font-heading text-lg font-semibold\">\n            {labels?.catalogue ?? 'Modules'}\n          </Heading>\n          <ul className=\"grid gap-3\">\n            {modules.map((m) => {\n              const isIn = ids.includes(m.id);\n              const isRequired = requiredSet.has(m.id);\n              const fits = isIn || fitsPlan(modules, ids, m.id, options);\n              const titleId = `${catalogueId}-${m.id}`;\n              const noRoom =\n                !fits && summary.remaining !== null\n                  ? (labels?.noRoom ?? ((needs, left) => `Needs ${needs}; ${left} left.`))(min(m.minutes), min(summary.remaining))\n                  : null;\n              return (\n                <li\n                  key={m.id}\n                  data-slot=\"session-composer-module\"\n                  data-in={isIn ? '' : undefined}\n                  data-seen={seenSet.has(m.id) ? '' : undefined}\n                  data-fits={fits ? '' : undefined}\n                  className={cn(\n                    'bg-card text-card-foreground grid grid-cols-[1fr_auto] items-start gap-x-4 gap-y-1 rounded-xl border p-4',\n                    isIn && 'border-primary',\n                  )}\n                >\n                  <p id={titleId} className=\"min-w-0 font-medium text-pretty\">\n                    {m.title}\n                  </p>\n                  <div className=\"row-span-3 self-center\">\n                    {isRequired ? null : (\n                      <Button\n                        type=\"button\"\n                        size=\"sm\"\n                        variant={isIn ? 'secondary' : 'outline'}\n                        data-slot=\"session-composer-toggle\"\n                        aria-describedby={titleId}\n                        disabled={!isIn && !fits}\n                        onClick={() => (isIn ? remove(m, 'catalogue') : add(m))}\n                      >\n                        {isIn ? <Check aria-hidden=\"true\" /> : <Plus aria-hidden=\"true\" />}\n                        {isIn ? (labels?.remove ?? 'Remove') : (labels?.add ?? 'Add')}\n                      </Button>\n                    )}\n                  </div>\n                  <p className=\"text-muted-foreground flex flex-wrap gap-x-3 text-sm\">\n                    <span className=\"tabular-nums\">{min(m.minutes)}</span>\n                    {seenSet.has(m.id) ? <span>{labels?.seen ?? 'Seen before'}</span> : null}\n                    {isRequired ? <span>{labels?.required ?? 'Always included'}</span> : null}\n                    {noRoom ? <span>{noRoom}</span> : null}\n                  </p>\n                  {m.summary ? <p className=\"text-muted-foreground text-sm text-pretty\">{m.summary}</p> : null}\n                </li>\n              );\n            })}\n          </ul>\n        </section>\n\n        <section data-slot=\"session-composer-plan\" aria-labelledby={planId} className=\"grid content-start gap-4\">\n          <Heading\n            ref={planHeadingRef as React.Ref<HTMLHeadingElement>}\n            id={planId}\n            tabIndex={-1}\n            className=\"font-heading focus-visible:outline-ring rounded-sm text-lg font-semibold outline-offset-4 focus-visible:outline-2\"\n          >\n            {labels?.plan ?? 'Your session'}\n          </Heading>\n          {limit === null ? (\n            <p data-slot=\"session-composer-length\" className=\"text-sm\">\n              <span className=\"text-muted-foreground\">{labels?.length ?? 'Session length'}: </span>\n              <span className=\"font-medium tabular-nums\">{min(summary.minutes)}</span>\n            </p>\n          ) : (\n            <Meter\n              label={labels?.length ?? 'Session length'}\n              value={summary.minutes}\n              max={limit}\n              tone={summary.over > 0 ? 'negative' : 'default'}\n              display={totalLabel(min(summary.minutes), maxText)}\n              note={\n                summary.over > 0\n                  ? (labels?.over ?? ((t) => `${t} over. Remove a module to fit.`))(min(summary.over))\n                  : undefined\n              }\n            />\n          )}\n          {ids.length ? (\n            <ol ref={planRef} data-slot=\"session-composer-plan-list\" className=\"grid gap-2\">\n              {ids.map((id, i) => {\n                const m = byId.get(id)!;\n                const isRequired = requiredSet.has(id);\n                return (\n                  <li\n                    key={id}\n                    data-slot=\"session-composer-step\"\n                    data-step-id={id}\n                    data-required={isRequired ? '' : undefined}\n                    className=\"bg-card text-card-foreground flex items-center gap-3 rounded-lg border px-3 py-2\"\n                  >\n                    <span aria-hidden=\"true\" className=\"text-muted-foreground w-5 text-end text-sm tabular-nums\">\n                      {nf.format(i + 1)}\n                    </span>\n                    <span className=\"min-w-0 flex-1\">\n                      <span className=\"block font-medium text-pretty\">{m.title}</span>\n                      <span className=\"text-muted-foreground block text-sm tabular-nums\">\n                        {min(m.minutes)}\n                        {isRequired ? ` · ${labels?.required ?? 'Always included'}` : ''}\n                      </span>\n                    </span>\n                    {isRequired ? null : (\n                      <div role=\"group\" aria-label={m.title} className=\"flex shrink-0 gap-1\">\n                        <Button\n                          type=\"button\"\n                          size=\"icon-sm\"\n                          variant=\"ghost\"\n                          data-control=\"up\"\n                          aria-label={(labels?.moveUp ?? ((t) => `Move ${t} up`))(m.title)}\n                          disabled={!canMove(modules, ids, id, -1, options)}\n                          onClick={() => move(m, -1)}\n                        >\n                          <ArrowUp aria-hidden=\"true\" />\n                        </Button>\n                        <Button\n                          type=\"button\"\n                          size=\"icon-sm\"\n                          variant=\"ghost\"\n                          data-control=\"down\"\n                          aria-label={(labels?.moveDown ?? ((t) => `Move ${t} down`))(m.title)}\n                          disabled={!canMove(modules, ids, id, 1, options)}\n                          onClick={() => move(m, 1)}\n                        >\n                          <ArrowDown aria-hidden=\"true\" />\n                        </Button>\n                        <Button\n                          type=\"button\"\n                          size=\"icon-sm\"\n                          variant=\"ghost\"\n                          data-control=\"remove\"\n                          aria-label={(labels?.removeNamed ?? ((t) => `Remove ${t}`))(m.title)}\n                          onClick={() => remove(m, 'plan')}\n                        >\n                          <X aria-hidden=\"true\" />\n                        </Button>\n                      </div>\n                    )}\n                  </li>\n                );\n              })}\n            </ol>\n          ) : (\n            <p data-slot=\"session-composer-empty\" className=\"text-muted-foreground text-sm\">\n              {labels?.empty ?? 'Add modules to build the session.'}\n            </p>\n          )}\n          {footer ? <div data-slot=\"session-composer-footer\">{footer}</div> : null}\n        </section>\n      </div>\n      <span data-slot=\"session-composer-announce\" aria-live=\"polite\" className=\"sr-only\">\n        {announce}\n      </span>\n    </div>\n  );\n}\nSessionComposer.displayName = 'SessionComposer';\n\nexport { SessionComposer };\nexport type { SessionComposerProps, SessionComposerLabels, SessionModule };\n"
    },
    {
      "path": "registry/interlace-ui/patterns/session-plan-model.ts",
      "target": "components/ui/patterns/session-plan-model.ts",
      "type": "registry:ui",
      "content": "export interface PlanModule {\n  id: string;\n  /** How long the module runs. */\n  minutes: number;\n}\n\nexport interface PlanOptions {\n  /** The most minutes the session may run. Omit for no limit. */\n  maxMinutes?: number | null;\n  /** Ids that are always in the plan. */\n  required?: readonly string[];\n}\n\nexport interface PlanSummary {\n  /** The plan, cleaned: known ids only, no repeats, required ones included. */\n  ids: string[];\n  minutes: number;\n  /** Minutes left under `maxMinutes`; null with no limit. Never below 0. */\n  remaining: number | null;\n  /** Minutes past `maxMinutes`; 0 when it fits. */\n  over: number;\n}\n\nconst minutesOf = (m: PlanModule | undefined) =>\n  m && Number.isFinite(m.minutes) && m.minutes > 0 ? m.minutes : 0;\n\nconst limitOf = (max: number | null | undefined) =>\n  typeof max === 'number' && Number.isFinite(max) && max > 0 ? max : null;\n\n/** Drops unknown and repeated ids and puts missing required ones where they belong. */\nexport function cleanPlan(modules: readonly PlanModule[], ids: readonly string[], { required = [] }: PlanOptions = {}): string[] {\n  const known = new Set(modules.map((m) => m.id));\n  const out: string[] = [];\n  for (const id of ids) if (known.has(id) && !out.includes(id)) out.push(id);\n  // A missing required module goes back in the place the catalogue gives it.\n  const order = new Map(modules.map((m, i) => [m.id, i]));\n  for (const id of required) {\n    if (!known.has(id) || out.includes(id)) continue;\n    const at = out.findIndex((x) => order.get(x)! > order.get(id)!);\n    if (at === -1) out.push(id);\n    else out.splice(at, 0, id);\n  }\n  return out;\n}\n\nexport function summarizePlan(modules: readonly PlanModule[], ids: readonly string[], options: PlanOptions = {}): PlanSummary {\n  const clean = cleanPlan(modules, ids, options);\n  const byId = new Map(modules.map((m) => [m.id, m]));\n  const minutes = clean.reduce((sum, id) => sum + minutesOf(byId.get(id)), 0);\n  const max = limitOf(options.maxMinutes);\n  return {\n    ids: clean,\n    minutes,\n    remaining: max === null ? null : Math.max(0, max - minutes),\n    over: max === null ? 0 : Math.max(0, minutes - max),\n  };\n}\n\n/** Whether `id` can be added without running past `maxMinutes`. */\nexport function fitsPlan(modules: readonly PlanModule[], ids: readonly string[], id: string, options: PlanOptions = {}): boolean {\n  const { ids: clean, remaining } = summarizePlan(modules, ids, options);\n  const m = modules.find((x) => x.id === id);\n  if (!m || clean.includes(id)) return false;\n  return remaining === null || minutesOf(m) <= remaining;\n}\n\n/** Adds `id` at the end, or before the first required module that closes the plan. */\nexport function addToPlan(modules: readonly PlanModule[], ids: readonly string[], id: string, options: PlanOptions = {}): string[] {\n  const clean = cleanPlan(modules, ids, options);\n  if (!modules.some((m) => m.id === id) || clean.includes(id)) return clean;\n  // After the last module the host chose, so a required close stays last. With only\n  // required modules in, the catalogue's order places it (after an opening, before a close).\n  const required = new Set(options.required ?? []);\n  let at = -1;\n  for (let i = clean.length - 1; i >= 0; i--) {\n    if (!required.has(clean[i]!)) {\n      at = i + 1;\n      break;\n    }\n  }\n  if (at === -1) {\n    const order = new Map(modules.map((m, i) => [m.id, i]));\n    const own = order.get(id)!;\n    at = clean.findIndex((x) => order.get(x)! > own);\n    if (at === -1) at = clean.length;\n  }\n  return [...clean.slice(0, at), id, ...clean.slice(at)];\n}\n\nexport function removeFromPlan(modules: readonly PlanModule[], ids: readonly string[], id: string, options: PlanOptions = {}): string[] {\n  if ((options.required ?? []).includes(id)) return cleanPlan(modules, ids, options);\n  return cleanPlan(\n    modules,\n    ids.filter((x) => x !== id),\n    options,\n  );\n}\n\n/** Moves `id` by `delta` places (−1 up, +1 down), clamped to the ends. Required modules stay put. */\nexport function movePlan(\n  modules: readonly PlanModule[],\n  ids: readonly string[],\n  id: string,\n  delta: number,\n  options: PlanOptions = {},\n): string[] {\n  const clean = cleanPlan(modules, ids, options);\n  const required = new Set(options.required ?? []);\n  const from = clean.indexOf(id);\n  if (from === -1 || required.has(id)) return clean;\n  let to = from + Math.trunc(delta);\n  to = Math.max(0, Math.min(clean.length - 1, to));\n  // A free module never jumps over a required one.\n  const step = to > from ? 1 : -1;\n  for (let i = from + step; step > 0 ? i <= to : i >= to; i += step) {\n    if (required.has(clean[i]!)) {\n      to = i - step;\n      break;\n    }\n  }\n  if (to === from) return clean;\n  const out = clean.filter((x) => x !== id);\n  out.splice(to, 0, id);\n  return out;\n}\n\n/** Whether `id` can move by `delta` at all. */\nexport function canMove(modules: readonly PlanModule[], ids: readonly string[], id: string, delta: number, options: PlanOptions = {}): boolean {\n  const before = cleanPlan(modules, ids, options);\n  const after = movePlan(modules, before, id, delta, options);\n  return after.indexOf(id) !== before.indexOf(id);\n}\n\n/**\n * @interlace/ui — session-plan-model\n *\n * The rules for building a session out of modules: which ones are in, in\n * what order, how long it runs, and whether one more fits. Pure, so the\n * composer a host clicks through, the booking form that sends the plan and\n * the server that checks it agree on every minute.\n *\n * A plan is an ordered list of module ids. `required` ids (an opening, a\n * close) are always in and cannot be removed; the rest are the host's.\n */\n"
    }
  ],
  "meta": {
    "tier": "pattern",
    "client": true,
    "minViewport": 320,
    "loading": false,
    "version": "1.0.1",
    "since": "2.0.0"
  },
  "docs": "## @interlace/session-composer\n\nInstalled to `components/ui/patterns/session-composer.tsx`.\n\n```tsx\nimport { /* … */ } from '@/components/ui/patterns/session-composer';\n```\n\nProps, a11y contract, live preview and source: https://ds.interlace.tools/c/session-composer\n\nRequires the `@interlace/interlace-base` CSS baseline (installed automatically as a registry dependency). For the Interlace look, also add `@interlace/theme`."
}
