@a-company/paradigm 6.6.6 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/{accept-orchestration-JHDCVHB2.js → accept-orchestration-WMGFGYDK.js} +1 -1
  2. package/dist/{agent-loader-VGBPL3TH.js → agent-loader-Z753DQWH.js} +1 -1
  3. package/dist/{agents-suggest-IKY6VD2R.js → agents-suggest-WZEGQT5E.js} +1 -1
  4. package/dist/{ambient-FNNFB4AP.js → ambient-HAXPDIWK.js} +1 -1
  5. package/dist/ambient-OW5M5LVN.js +2 -0
  6. package/dist/ambient-QB7V4TBR.js +6 -0
  7. package/dist/calibrate-PHVP7RPH.js +4 -0
  8. package/dist/captain-3COP6YTD.js +2 -0
  9. package/dist/chunk-33ERV2MW.js +18 -0
  10. package/dist/chunk-4CGPLLWQ.js +30 -0
  11. package/dist/chunk-6HVOZANP.js +4 -0
  12. package/dist/chunk-ACJWUOMA.js +3 -0
  13. package/dist/chunk-B5KLSBOZ.js +2 -0
  14. package/dist/chunk-CHSU6LTR.js +2 -0
  15. package/dist/chunk-DLMDHS2X.js +10 -0
  16. package/dist/chunk-ECO3LHCE.js +2 -0
  17. package/dist/chunk-EG22HDXI.js +33 -0
  18. package/dist/{chunk-5RFISGUW.js → chunk-G6DK3ND3.js} +250 -25
  19. package/dist/{chunk-GD4F2HC6.js → chunk-H55W26AR.js} +1 -1
  20. package/dist/chunk-HSY75GRR.js +6 -0
  21. package/dist/chunk-KAUGQMXU.js +4 -0
  22. package/dist/chunk-KP5VOYAH.js +20 -0
  23. package/dist/chunk-OIYJUU6T.js +25 -0
  24. package/dist/chunk-RDWWSQGH.js +142 -0
  25. package/dist/chunk-RVXQNS6K.js +30 -0
  26. package/dist/chunk-VPNJL4LS.js +93 -0
  27. package/dist/{chunk-XKNJSPB5.js → chunk-W4BW7GXA.js} +1 -1
  28. package/dist/chunk-XPPFILCM.js +2 -0
  29. package/dist/chunk-YCDOA5IQ.js +18 -0
  30. package/dist/chunk-YQK3XU63.js +504 -0
  31. package/dist/{chunk-TQOT2LBO.js → chunk-YXLGVOZO.js} +1 -1
  32. package/dist/chunk-ZSWXLFN7.js +12 -0
  33. package/dist/{compliance-J3VOV445.js → compliance-4P3EE5OA.js} +1 -1
  34. package/dist/{diff-ANKTFDRA.js → diff-VBVIUNL5.js} +1 -1
  35. package/dist/{docs-TSAAS4W3.js → docs-NTP6UENF.js} +1 -1
  36. package/dist/doctor-CBZYYQQH.js +2 -0
  37. package/dist/{hooks-45WDP6QS.js → hooks-AXBWYJ5V.js} +1 -1
  38. package/dist/index.js +6 -6
  39. package/dist/journal-loader-CNNA4EAU.js +2 -0
  40. package/dist/lore-loader-HAZ5FRLP.js +2 -0
  41. package/dist/mcp.js +3 -3
  42. package/dist/{migrate-R64OQGSM.js → migrate-5M4KUQ2L.js} +1 -1
  43. package/dist/nomination-engine-ORHH4L2W.js +2 -0
  44. package/dist/{nomination-engine-NCLTGMAK.js → nomination-engine-YRHZZZUN.js} +1 -1
  45. package/dist/notebook-loader-TZVIMNDJ.js +2 -0
  46. package/dist/orchestrate-MLUGQOEJ.js +8 -0
  47. package/dist/orchestration-O2OVPTIZ.js +2 -0
  48. package/dist/{platform-server-ANOALDPL.js → platform-server-Y6TLEXR2.js} +1 -1
  49. package/dist/propose-block-ZEMEWJQF.js +2 -0
  50. package/dist/{providers-TBPOE4DI.js → providers-5EHD45C6.js} +1 -1
  51. package/dist/reindex-ZLDQBFUR.js +2 -0
  52. package/dist/{serve-3FMUWW5K.js → serve-XZ6GBUS3.js} +1 -1
  53. package/dist/session-tracker-BZ7FU4AT.js +2 -0
  54. package/dist/session-work-log-FF7CKMWP.js +2 -0
  55. package/dist/session-work-log-T2IE4Y4T.js +2 -0
  56. package/dist/{shift-TNA2E5O7.js → shift-PM4GI736.js} +2 -2
  57. package/dist/solo-OWR3MX74.js +3 -0
  58. package/dist/{spawn-KKDDR6UR.js → spawn-PHA2SVQ3.js} +1 -1
  59. package/dist/{symphony-G6IENE4K.js → symphony-CFAYJGLF.js} +1 -1
  60. package/dist/{symphony-7INZR43F.js → symphony-L56O5ZG3.js} +3 -3
  61. package/dist/{symphony-relay-2RHG25Z4.js → symphony-relay-Y2UR3YNR.js} +1 -1
  62. package/dist/task-loader-H7HQAYGL.js +2 -0
  63. package/dist/task-loader-YZME4RKE.js +2 -0
  64. package/dist/task-settlement-HINBVZBE.js +3 -0
  65. package/dist/task-settlement-XC6E6JNT.js +3 -0
  66. package/dist/team-25LK6CWM.js +2 -0
  67. package/dist/team-funnel-RAJ6EDG3.js +2 -0
  68. package/dist/tools-GAU5WOEI.js +2 -0
  69. package/dist/university-content/notes/N-para-801-cid-becomes-real.md +60 -0
  70. package/dist/university-content/notes/N-para-801-falsifiable-self-improvement.md +66 -0
  71. package/dist/university-content/notes/N-para-801-honest-routing-and-the-method.md +57 -0
  72. package/dist/university-content/notes/N-para-801-orchestration-emits-dag.md +60 -0
  73. package/dist/university-content/notes/N-para-801-settlement-closes-the-loop.md +64 -0
  74. package/dist/university-content/notes/N-para-801-the-task-dag.md +93 -0
  75. package/dist/university-content/paths/LP-para-801.yaml +43 -0
  76. package/dist/university-content/quizzes/Q-para-801-cid-becomes-real.yaml +54 -0
  77. package/dist/university-content/quizzes/Q-para-801-falsifiable-self-improvement.yaml +54 -0
  78. package/dist/university-content/quizzes/Q-para-801-honest-routing-and-the-method.yaml +54 -0
  79. package/dist/university-content/quizzes/Q-para-801-orchestration-emits-dag.yaml +54 -0
  80. package/dist/university-content/quizzes/Q-para-801-settlement-closes-the-loop.yaml +54 -0
  81. package/dist/university-content/quizzes/Q-para-801-the-task-dag.yaml +54 -0
  82. package/dist/university-ui/assets/{index-DrtbBC21.js → index-AbTjHBCf.js} +2 -2
  83. package/dist/university-ui/assets/{index-DrtbBC21.js.map → index-AbTjHBCf.js.map} +1 -1
  84. package/dist/university-ui/index.html +1 -1
  85. package/dist/work-log-loader-CRVTOMVB.js +2 -0
  86. package/package.json +1 -1
  87. package/dist/ambient-AI42BOM5.js +0 -35
  88. package/dist/chunk-3OXR6F65.js +0 -666
  89. package/dist/chunk-4N56FRNE.js +0 -29
  90. package/dist/chunk-6QXBXZF6.js +0 -3
  91. package/dist/chunk-AMLD7IYC.js +0 -10
  92. package/dist/chunk-DVZWCXB6.js +0 -2
  93. package/dist/chunk-F6E3HW45.js +0 -14
  94. package/dist/chunk-K7X3Z3GL.js +0 -4
  95. package/dist/chunk-LAYBUKMB.js +0 -14
  96. package/dist/chunk-MU5YWTNE.js +0 -24
  97. package/dist/chunk-PMKZMCTS.js +0 -111
  98. package/dist/chunk-QGZRM6ZB.js +0 -2
  99. package/dist/chunk-XQLO5URP.js +0 -11
  100. package/dist/doctor-L5XZENCF.js +0 -2
  101. package/dist/journal-loader-GLH7XFTK.js +0 -2
  102. package/dist/lore-loader-D2ISOASW.js +0 -2
  103. package/dist/notebook-loader-3J2OFMS3.js +0 -2
  104. package/dist/orchestrate-UG5QXNAU.js +0 -8
  105. package/dist/reindex-PTIQ2UGY.js +0 -2
  106. package/dist/session-tracker-HHNY6J4I.js +0 -2
  107. package/dist/session-work-log-MEJ33TYD.js +0 -2
  108. package/dist/session-work-log-ZVVJGO7X.js +0 -2
  109. package/dist/task-loader-NZFDTUQ5.js +0 -2
  110. package/dist/team-PEGP6F7S.js +0 -2
  111. package/dist/tools-PUSDXUYE.js +0 -2
  112. /package/dist/{chunk-HXGYVS2N.js → chunk-ECLUYHAR.js} +0 -0
  113. /package/dist/{chunk-CVPKQ3JH.js → chunk-HE2NA5QF.js} +0 -0
@@ -0,0 +1,54 @@
1
+ id: Q-para-801-orchestration-emits-dag
2
+ title: 'PARA 801: Closing the Loop — Lesson 2: Orchestration Emits the DAG'
3
+ description: 'Quiz for lesson: Orchestration Emits the DAG'
4
+ author: paradigm
5
+ created: '2026-06-13'
6
+ updated: '2026-06-13'
7
+ tags:
8
+ - course
9
+ - para-801
10
+ symbols: []
11
+ difficulty: intermediate
12
+ passThreshold: 0.7
13
+ category: paradigm-core
14
+ questions:
15
+ - id: q1
16
+ question: Before v7, what happened to the handoff graph that orchestration computed for a multi-agent run?
17
+ choices:
18
+ A: It was persisted as tasks and tracked to completion
19
+ B: 'It was computed and then discarded — only a frozen `status: pending` blob was logged, which nothing ever advanced'
20
+ C: It was written to portal.yaml
21
+ D: It was emailed to the user for approval
22
+ E: It was stored as a SQLite graph
23
+ correct: B
24
+ explanation: 'The orchestration audit found the handoff graph computed (around `orchestration.ts:1780-1830`) and then dropped, with only a frozen `logOrchestration` `status: pending` blob recorded and never advanced. This was the orchestration-to-task disconnect v7 fixes — orchestration now emits the graph as real tasks via `emitTaskDag()`.'
25
+ - id: q2
26
+ question: What does `emitTaskDag()` persist, and in which orchestration mode?
27
+ choices:
28
+ A: One flat task per run, in every mode
29
+ B: One epic task (claimant orchestrator, external_ref orchestration) plus one child per stage-agent (parentTaskId, stage, dependsOn, archetype claimant) — in execute mode only
30
+ C: A child task per file edited, in plan mode
31
+ D: Nothing — it only logs to the console
32
+ E: A full SQLite snapshot in quick mode
33
+ correct: B
34
+ explanation: 'In `execute` mode only (plan and quick emit nothing), `emitTaskDag()` persists one epic task — the orchestration root with `claimant: orchestrator` and `external_ref: { kind: orchestration }` — plus one child task per stage-agent carrying parentTaskId, stage, dependsOn, and a `{ kind: archetype }` claimant. Emission degrades gracefully if a write fails; it never gates the work.'
35
+ - id: q3
36
+ question: In v7.0, how does a stage task's status flow back as the agent works, and what is the scope caveat?
37
+ choices:
38
+ A: A background daemon polls the filesystem; all execution paths are covered equally
39
+ B: Each spawned agent's prompt carries its taskId with instructions to flip in-progress/done via paradigm_task_update; v7.0 scopes loop-closure to the MCP path, with Symphony and CLI flow-back as fast-follows
40
+ C: The orchestrator marks everything done at the end regardless of agent output
41
+ D: Status never flows back; the DAG is write-once
42
+ E: Status flows back only through Git hooks
43
+ correct: B
44
+ explanation: 'v7 threads each agent''s taskId into its prompt with instructions to flip in-progress on start and done on finish via paradigm_task_update. v7.0 honestly scopes loop-closure to the dominant MCP (Claude-Code-agent) path; the Symphony/Cursor watcher and the standalone CLI orchestrate binary''s task-bridge are stated as fast-follows rather than claimed as covered.'
45
+ - id: q4
46
+ question: What did the typed `AgentRelay` contract replace, and what was deleted as a result?
47
+ choices:
48
+ A: It replaced portal.yaml; the gates were deleted
49
+ B: It replaced free-text prose handoffs between stages; the hand-rolled regex parsers (parseFilePlan / parseFilePlanFromResponse) were deleted, and planBuilderStages now consumes the typed filePlan field directly
50
+ C: It replaced the task loader; the YAML store was deleted
51
+ D: It replaced SQLite; the database was deleted
52
+ E: Nothing was deleted — AgentRelay is purely additive logging
53
+ correct: B
54
+ explanation: 'AgentRelay is a typed completion contract (artifacts, decisions, handoffTo, filePlan, blockedOn). It replaces the free-text prose handoff and lets v7 delete the brittle regex parsers that used to scrape structure out of that prose — planBuilderStages now reads the typed `filePlan` field directly. TaskPayload (assignment) and AgentRelay (completion) are the request/response halves, bound by `relay.taskId + status → updateTask`.'
@@ -0,0 +1,54 @@
1
+ id: Q-para-801-settlement-closes-the-loop
2
+ title: 'PARA 801: Closing the Loop — Lesson 3: Settlement Closes the Loop'
3
+ description: 'Quiz for lesson: Settlement Closes the Loop'
4
+ author: paradigm
5
+ created: '2026-06-13'
6
+ updated: '2026-06-13'
7
+ tags:
8
+ - course
9
+ - para-801
10
+ symbols: []
11
+ difficulty: intermediate
12
+ passThreshold: 0.7
13
+ category: paradigm-core
14
+ questions:
15
+ - id: q1
16
+ question: What is the settlement trigger in v7 — when does a parent task settle and run the learning chain?
17
+ choices:
18
+ A: As soon as the first child reaches `done`
19
+ B: When every sibling sharing the parentTaskId reaches a terminal state (all-siblings-terminal) — exactly once, idempotent via settledAt
20
+ C: On a fixed 30-minute timer regardless of child status
21
+ D: Only when the human manually calls settle
22
+ E: When the parent task itself is marked done by hand
23
+ correct: B
24
+ explanation: 'Settlement fires on all-siblings-terminal: when every task sharing a parentTaskId reaches a terminal state ({done, shelved, crashed} in v7.0), the parent settles exactly once, made idempotent by stamping settledAt. The original design fired only on `done`, which the adversarial review caught as re-creating the open-loop bug — one shelved or crashed sibling would leave the parent unsettled forever.'
25
+ - id: q2
26
+ question: Where is the settlement hook placed, and why there?
27
+ choices:
28
+ A: Only inside completeTask, so done is the only path that settles
29
+ B: Inside updateTask (the real chokepoint), gated on isTerminal(status) && parentTaskId — so completeTask, shelveTask, and any direct status set all fire it and none can drift
30
+ C: In a Git post-commit hook
31
+ D: In the orchestrator's plan mode
32
+ E: In the Stop hook only
33
+ correct: B
34
+ explanation: 'The hook lives inside updateTask — the real chokepoint — gated on isTerminal(status) && parentTaskId. Putting it at the chokepoint (rather than in completeTask alone) means completeTask, shelveTask, and direct status sets all settle, with no path able to drift. A reaper also crashes abandoned in-progress tasks stale past a window, and orphans (missing parent) self-settle with a warn.'
35
+ - id: q3
36
+ question: 'The v7 thesis is "Cid writes the present tense; Loid writes the past tense; they never co-write a field." Which field does settlement write, holding that boundary?'
37
+ choices:
38
+ A: Settlement writes `status` live-transitions
39
+ B: Settlement writes `claimant`
40
+ C: Settlement only ever writes settledAt (and crash markers) — never live status; Cid owns live status/claimant/edges, Loid owns settledAt and the learning stores
41
+ D: Settlement writes the DAG edges
42
+ E: Settlement co-writes status and settledAt together
43
+ correct: C
44
+ explanation: 'Settlement writes only settledAt and crash markers, never live status. This holds the load-bearing Cid↔Loid boundary: Cid (present tense) writes status live-transitions, claimant, and the DAG edges at emission; Loid (past tense) writes settledAt and the learning stores. The dependency points one way — status → settlement → learning — and settlement never calls back to change status.'
45
+ - id: q4
46
+ question: 'Why did v7.0 drop the original belief-delta promotion gate (confidence_after − confidence_before ≥ 0.15) in favor of keeping the absolute ≥ 0.8 gate with a *real* confidence_after?'
47
+ choices:
48
+ A: The delta gate was too slow to compute
49
+ B: Both confidence numbers were hardcoded branch literals, so a delta gate promotes on the difference of two constants (numerology); v7.0 keeps the absolute gate but makes confidence_after a real agent output, deferring the belief-delta honestly to v7.x
50
+ C: The team preferred round numbers
51
+ D: Belief-deltas are mathematically impossible
52
+ E: The absolute gate was removed entirely and replaced by manual approval
53
+ correct: B
54
+ explanation: 'The adversarial review proved both confidence_before and confidence_after were branch literals, so promoting on their difference is numerology. v7.0''s honest fix: keep the existing absolute ≥0.8 gate but make confidence_after real (agents emit an optional `confidence` that runPostflightLearning prefers, falling back to the literal only when absent). confidence_before stays, explicitly marked not-gated-on; the belief-delta gate is deferred to v7.x because a real pre-task prior needs unbuilt elicitation infrastructure.'
@@ -0,0 +1,54 @@
1
+ id: Q-para-801-the-task-dag
2
+ title: 'PARA 801: Closing the Loop — Lesson 1: The Spine'
3
+ description: 'Quiz for lesson: The Spine — A Claimant-Owned Task DAG'
4
+ author: paradigm
5
+ created: '2026-06-13'
6
+ updated: '2026-06-13'
7
+ tags:
8
+ - course
9
+ - para-801
10
+ symbols: []
11
+ difficulty: intermediate
12
+ passThreshold: 0.7
13
+ category: paradigm-core
14
+ questions:
15
+ - id: q1
16
+ question: 'In v7, a task''s owner is recorded as `claimant: { kind, ref }` rather than a flat `assignee: "builder"` string. Why is the typed claim the right design?'
17
+ choices:
18
+ A: It is shorter to serialize in YAML
19
+ B: A flat name throws away whether the owner is a role, a specific human, or a remote peer — the very distinction the learning loop needs (archetype-fit signal, churn-vs-handoff)
20
+ C: Tagged unions are required by the YAML loader
21
+ D: It lets two owners write the same field safely
22
+ E: It encrypts the owner's identity
23
+ correct: B
24
+ explanation: 'The claimant is a tagged union (`kind: archetype | human | peer`). That `kind` is load-bearing: archetype-fit analytics compare the predicted role-owner against the closing owner, and reassignment-churn detection must distinguish a healthy peer handoff (`kind: peer`) from under-specified-blurb churn. A flat name string cannot answer "is this a role, a human, or a peer?" — so it discards exactly the signal the loop is built to learn from.'
25
+ - id: q2
26
+ question: How are the DAG edges (parentTaskId / dependsOn / stage) stored in v7?
27
+ choices:
28
+ A: In a new SQLite database alongside the task store
29
+ B: In a separate central edges.yaml file that must be kept in sync
30
+ C: Edge-list-in-node — each task's own YAML carries its edges; the graph is reconstructed by loading the node set, with no separate edges file and no SQLite
31
+ D: Only in memory during an orchestration run
32
+ E: As Git commit metadata
33
+ correct: C
34
+ explanation: 'The DAG uses edge-list-in-node: every task''s YAML carries its own parentTaskId/dependsOn/stage, and the graph is rebuilt simply by loading the nodes. This needs no separate edges file and no SQLite, survives the existing date-partitioned loader with zero loader changes, and supports cross-date edges because each task id embeds its date.'
35
+ - id: q3
36
+ question: Which statement about v7.0's task status set and state machine is correct?
37
+ choices:
38
+ A: v7.0 ships all six states (open, claimed, in-progress, blocked, done, shelved) at launch
39
+ B: v7.0 ships four states (open, in-progress, done, shelved); claimed and blocked are deferred to a fast-follow because they are justified only by Symphony peer-claims
40
+ C: Any status can transition to any other status freely
41
+ D: '`done` can transition back to `in-progress`'
42
+ E: '`started_at` is stamped when the task is first created'
43
+ correct: B
44
+ explanation: 'v7.0 ships four states. `claimed` and `blocked` are deferred because they are only justified by Symphony peer-claims, which are themselves fast-follow. Transitions are enforced by a single `assertTransition` guard inside `updateTask` (done is terminal), and `started_at` is stamped on *entering* `in-progress`, not at creation.'
45
+ - id: q4
46
+ question: How does the v7 schema migration treat existing pre-v7 task YAML?
47
+ choices:
48
+ A: A mandatory bulk migration script must rewrite every file before v7 can load
49
+ B: Old files are rejected until manually upgraded
50
+ C: Every new field is optional, so old YAML loads unchanged; the orphan `session_link` is healed into `external_ref` by a read-side `normalizeTask` shim, and files migrate on their next write
51
+ D: Old tasks are silently deleted
52
+ E: Migration requires a database export and re-import
53
+ correct: C
54
+ explanation: 'The migration is additive and lazy-healing: every v7 field is optional so old YAML loads as-is, MCP enums widen non-breakingly, and the orphaned `session_link` is normalized into the typed `external_ref` by a read-side shim at the load chokepoint — files heal on their next write with no bulk step.'
@@ -83,5 +83,5 @@ Error generating stack: `+i.message+`
83
83
  */var Dl=S,hm=pm;function mm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vm=typeof Object.is=="function"?Object.is:mm,gm=hm.useSyncExternalStore,ym=Dl.useRef,xm=Dl.useEffect,wm=Dl.useMemo,Sm=Dl.useDebugValue;xf.useSyncExternalStoreWithSelector=function(e,t,n,r,l){var i=ym(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=wm(function(){function u(y){if(!c){if(c=!0,m=y,y=r(y),l!==void 0&&o.hasValue){var x=o.value;if(l(x,y))return p=x}return p=y}if(x=p,vm(m,y))return x;var w=r(y);return l!==void 0&&l(x,w)?(m=y,x):(m=y,p=w)}var c=!1,m,p,v=n===void 0?null:n;return[function(){return u(t())},v===null?void 0:function(){return u(v())}]},[t,n,r,l]);var s=gm(e,i[0],i[1]);return xm(function(){o.hasValue=!0,o.value=s},[s]),Sm(s),s};yf.exports=xf;var km=yf.exports;const Cm=Qu(km),kf={},{useDebugValue:jm}=xo,{useSyncExternalStoreWithSelector:Em}=Cm;let Mu=!1;const Nm=e=>e;function Pm(e,t=Nm,n){(kf?"production":void 0)!=="production"&&n&&!Mu&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Mu=!0);const r=Em(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return jm(r),r}const Du=e=>{(kf?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?rm(e):e,n=(r,l)=>Pm(t,r,l);return Object.assign(n,t),n},Al=e=>e?Du(e):Du,_m={mode:"paradigm",branding:{name:"Paradigm University",tagline:"Lux in Codice",logo:null,institution:null,favicon:null,tabs:["campus","courses","plsat","library","certificates"],startCourse:null},theme:null,version:"6.4.0",hasProjectLibrary:!1,sections:[]},Ut=Al(e=>({config:null,isLoaded:!1,loadPackConfig:async()=>{try{const t=await fetch("/api/pack-config");if(!t.ok)throw new Error("Failed to load pack config");const n=await t.json();e({config:n,isLoaded:!0})}catch{e({config:_m,isLoaded:!0})}}}));function yl({size:e=36,className:t}){const n=Ut(l=>l.config),r=n==null?void 0:n.branding.logo;return r?a.jsx("img",{src:r,alt:(n==null?void 0:n.branding.name)??"Logo",style:{width:e,height:e,objectFit:"contain"},className:t}):a.jsx(po,{size:e,className:t})}const Au="paradigm-university-theme",Lm={campus:{label:"Campus",path:"/"},courses:{label:"Courses",path:"/courses"},plsat:{label:"PLSAT",path:"/plsat"},library:{label:"Library",path:"/reference"},certificates:{label:"Certificates",path:"/certificate"}};function Tm(e,t){return e==="campus"?t==="/":e==="courses"?t.startsWith("/course")||t==="/courses":e==="plsat"?t.startsWith("/plsat"):e==="library"?t.startsWith("/reference"):e==="certificates"?t.startsWith("/certificate"):!1}function zm({version:e}){const t=pr(),n=Ut(c=>c.config),[r,l]=S.useState(()=>{try{return localStorage.getItem(Au)==="dark"}catch{return!1}});S.useEffect(()=>{document.documentElement.setAttribute("data-theme",r?"dark":"light");try{localStorage.setItem(Au,r?"dark":"light")}catch{}},[r]);const i=(n==null?void 0:n.branding.name)??"Paradigm University",o=(n==null?void 0:n.branding.tagline)??"Lux in Codice",s=(n==null?void 0:n.version)??e,u=(n==null?void 0:n.branding.tabs)??["campus","courses","plsat","library","certificates"];return a.jsxs("header",{className:"header",children:[a.jsx("div",{className:"header-left",children:a.jsxs(se,{to:"/",className:"header-brand",children:[a.jsx(yl,{size:36}),a.jsx("h1",{children:i}),a.jsx("span",{className:"subtitle",children:o})]})}),a.jsx("nav",{className:"header-nav",children:u.map(c=>{const m=Lm[c];return m?a.jsx(se,{to:m.path,className:Tm(c,t.pathname)?"active":"",children:m.label},c):null})}),a.jsxs("div",{className:"header-right",children:[a.jsxs("span",{className:"version-badge",children:["v",s]}),a.jsx("button",{className:"theme-toggle",onClick:()=>l(c=>!c),"aria-label":r?"Switch to light mode":"Switch to dark mode",title:r?"Switch to light mode":"Switch to dark mode",children:r?"☀":"☾"})]})]})}const hr=Al((e,t)=>({courses:[],courseCache:{},isLoading:!1,error:null,loadCourses:async()=>{e({isLoading:!0,error:null});try{const n=await fetch("/api/courses");if(!n.ok)throw new Error("Failed to load courses");const r=await n.json();e({courses:r.courses,isLoading:!1})}catch(n){e({error:n.message,isLoading:!1})}},loadCourse:async n=>{const r=t().courseCache[n];if(r)return r;try{const l=await fetch(`/api/courses/${n}`);if(!l.ok)return null;const i=await l.json();return e(o=>({courseCache:{...o.courseCache,[n]:i}})),i}catch{return null}}})),Rm=(e,t)=>e.filter(n=>n.section===t),Cf="paradigm-university-progress";function Im(){try{const e=localStorage.getItem(Cf);return e?JSON.parse(e):{}}catch{return{}}}function mi(e){try{localStorage.setItem(Cf,JSON.stringify(e))}catch{}}const mr=Al((e,t)=>({progress:Im(),completeLesson:(n,r)=>{e(l=>{const i=l.progress[n]||{courseId:n,completedLessons:[],quizResults:{}};if(i.completedLessons.includes(r))return l;const o={...l.progress,[n]:{...i,completedLessons:[...i.completedLessons,r]}};return mi(o),{progress:o}})},recordQuiz:n=>{e(r=>{const l=r.progress[n.courseId]||{courseId:n.courseId,completedLessons:[],quizResults:{}},i={...r.progress,[n.courseId]:{...l,quizResults:{...l.quizResults,[n.lessonId]:n}}};return mi(i),{progress:i}})},getCourseProgress:n=>t().progress[n]||{courseId:n,completedLessons:[],quizResults:{}},isLessonCompleted:(n,r)=>{const l=t().progress[n];return l?l.completedLessons.includes(r):!1},getCoursePercentage:(n,r)=>{if(r===0)return 0;const l=t().progress[n];return l?Math.round(l.completedLessons.length/r*100):0},resetProgress:()=>{mi({}),e({progress:{}})}})),jf="paradigm-university-plsat";function Om(){try{const e=localStorage.getItem(jf);return e?JSON.parse(e):{certificates:[],studentName:""}}catch{return{certificates:[],studentName:""}}}function Fu(e){try{localStorage.setItem(jf,JSON.stringify(e))}catch{}}const ps=Al((e,t)=>{const n=Om();return{certificates:n.certificates,studentName:n.studentName,setStudentName:r=>{e({studentName:r});const l=t();Fu({certificates:l.certificates,studentName:r})},addCertificate:r=>{e(l=>{const i=[...l.certificates,r];return Fu({certificates:i,studentName:l.studentName}),{certificates:i}})},getLatestCertificate:()=>{const r=t().certificates;return r.length===0?null:r.reduce((l,i)=>new Date(i.date)>new Date(l.date)?i:l)},getCertificateForVersion:r=>t().certificates.find(l=>l.plsatVersion===r&&l.passed)||null,hasPassed:()=>t().certificates.some(r=>r.passed)}});function hs({percentage:e,size:t=48,strokeWidth:n=4}){const r=(t-n)/2,l=2*Math.PI*r,i=l-e/100*l;return a.jsxs("div",{className:"progress-ring",style:{width:t,height:t},children:[a.jsxs("svg",{width:t,height:t,children:[a.jsx("circle",{className:"ring-bg",cx:t/2,cy:t/2,r,fill:"none",strokeWidth:n}),a.jsx("circle",{className:"ring-fill",cx:t/2,cy:t/2,r,fill:"none",strokeWidth:n,strokeLinecap:"round",strokeDasharray:l,strokeDashoffset:i})]}),a.jsxs("span",{className:"ring-label",children:[e,"%"]})]})}function Mm(){const{courses:e,isLoading:t,loadCourses:n}=hr(),r=mr(p=>p.getCoursePercentage),l=ps(p=>p.hasPassed),i=Ut(p=>p.config);if(S.useEffect(()=>{n()},[n]),t)return a.jsx("div",{className:"loading",children:"Opening the campus gates..."});const o=(i==null?void 0:i.branding.name)??"Paradigm University",s=(i==null?void 0:i.branding.tagline)??"Lux in Codice",u=(i==null?void 0:i.branding.tabs)??["campus","courses","plsat","library","certificates"],c=i!=null&&i.branding.startCourse?`/course/${i.branding.startCourse}`:"/courses",m=!i||i.mode==="paradigm";return a.jsxs("div",{className:"home",children:[a.jsxs("div",{className:"home-hero",children:[a.jsx(yl,{size:140}),a.jsx("h1",{children:o}),a.jsx("p",{className:"motto",children:m?`Universitas Paradigmatica — ${s}`:s}),m&&a.jsx("p",{className:"description",children:"Master the Paradigm framework through structured courses, hands-on quizzes, and the legendary PLSAT certification exam."})]}),a.jsx("div",{className:"gold-divider"}),a.jsxs("section",{className:"course-catalog",children:[a.jsx("h2",{children:"Course Catalog"}),e.map(p=>{const v=r(p.id,p.lessonCount);return a.jsxs(se,{to:`/course/${p.id}`,className:"course-card",children:[a.jsxs("div",{className:"course-card-header",children:[a.jsx("div",{className:"course-card-title",children:a.jsx("h3",{children:p.title})}),a.jsx(hs,{percentage:v})]}),a.jsx("p",{className:"course-description",children:p.description}),a.jsx("div",{className:"course-topics",children:p.lessons.map(y=>a.jsx("span",{className:"course-topic-tag",children:y.title},y.id))}),a.jsxs("div",{className:"course-meta",children:[a.jsxs("span",{children:[p.lessonCount," lessons"]}),a.jsx("span",{className:"course-meta-cta",children:"Start course →"})]})]},p.id)})]}),a.jsx("div",{className:"gold-divider"}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-lg",children:"Quick Links"}),a.jsxs("div",{className:"quick-links",children:[u.includes("plsat")&&a.jsx(se,{to:"/plsat",className:"quick-link",children:l()?"Retake the PLSAT":"Take the PLSAT"}),u.includes("library")&&a.jsx(se,{to:"/reference",className:"quick-link",children:"Reference Library"}),u.includes("certificates")&&a.jsx(se,{to:"/certificate",className:"quick-link",children:"View Certificates"}),u.includes("courses")&&a.jsx(se,{to:c,className:"quick-link",children:"Start Learning"})]})]})]})}function Dm({sections:e,activeId:t,onSelect:n}){var l;if(e.length<=1&&((l=e[0])==null?void 0:l.default)===!0)return null;const r=[...e].sort((i,o)=>i.order-o.order);return a.jsx("nav",{className:"section-nav","aria-label":"Course sections",children:r.map(i=>{const o=i.id===t;return a.jsxs("button",{type:"button",className:`section-nav-tab${o?" active":""}`,onClick:()=>n(i.id),"aria-current":o?"page":void 0,children:[a.jsx("span",{className:"section-nav-name",children:i.name}),i.description?a.jsx("span",{className:"section-nav-description",children:i.description}):null]},i.id)})})}const $u=new Set;function Am(e){$u.has(e)||($u.add(e),console.warn(`[university] section style "${e}" not yet implemented; rendering as track`))}function Uu({courses:e}){const t=mr(n=>n.getCoursePercentage);return a.jsx("section",{className:"course-catalog",children:e.map(n=>{const r=t(n.id,n.lessonCount);return a.jsxs(se,{to:`/course/${n.id}`,className:"course-card",children:[a.jsx("h3",{children:n.title}),a.jsx("p",{className:"course-description",children:n.description}),a.jsxs("div",{className:"course-meta",children:[a.jsxs("span",{children:[n.lessonCount," lessons"]}),a.jsx(hs,{percentage:r})]})]},n.id)})})}function Fm(){const e=Ut(u=>{var c;return((c=u.config)==null?void 0:c.sections)??[]}),t=hr(u=>u.courses),n=S.useMemo(()=>[...e].sort((u,c)=>u.order-c.order),[e]),r=S.useMemo(()=>{var c;const u=n.find(m=>m.default===!0);return(u==null?void 0:u.id)??((c=n[0])==null?void 0:c.id)??""},[n]),[l,i]=S.useState(r),o=n.find(u=>u.id===l)??n[0];if(!o)return a.jsx(Uu,{courses:t});const s=Rm(t,o.id);return o.style!=="track"&&Am(o.style),a.jsxs("div",{className:"section-view",children:[a.jsx(Dm,{sections:n,activeId:o.id,onSelect:i}),a.jsx(Uu,{courses:s})]})}function $m({courses:e}){const t=mr(n=>n.getCoursePercentage);return a.jsxs("section",{className:"course-catalog",children:[a.jsx("h2",{children:"Course Catalog"}),e.map(n=>{const r=t(n.id,n.lessonCount);return a.jsxs(se,{to:`/course/${n.id}`,className:"course-card",children:[a.jsx("h3",{children:n.title}),a.jsx("p",{className:"course-description",children:n.description}),a.jsxs("div",{className:"course-meta",children:[a.jsxs("span",{children:[n.lessonCount," lessons"]}),a.jsx(hs,{percentage:r})]})]},n.id)})]})}function Um(){const{courses:e,isLoading:t,loadCourses:n}=hr(),r=Ut(i=>{var o;return((o=i.config)==null?void 0:o.sections)??[]});if(S.useEffect(()=>{n()},[n]),t)return a.jsx("div",{className:"loading",children:"Loading courses..."});const l=r.length>1;return a.jsx("div",{className:"home",children:l?a.jsx(Fm,{}):a.jsx($m,{courses:e})})}function Bu(e){return e.replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>")}function Bm(e){const t=e.trim().split(`
84
84
  `);if(t.length<2)return e;const n=o=>o.split("|").map(s=>s.trim()).filter(s=>s.length>0),r=n(t[0]),l=t.slice(2).map(n);let i="<table><thead><tr>";for(const o of r)i+=`<th>${Bu(o)}</th>`;i+="</tr></thead><tbody>";for(const o of l){i+="<tr>";for(const s of o)i+=`<td>${Bu(s)}</td>`;i+="</tr>"}return i+="</tbody></table>",i}function Wt(e){const t=[];let n=e.replace(/```(\w*)\n([\s\S]*?)```/g,(r,l,i)=>{const o=t.length;return t.push(`<pre><code>${i}</code></pre>`),`\0BLOCK${o}\0`});return n=n.replace(/((?:^\|.+\|\n?)+)/gm,r=>{const l=r.trim().split(`
85
85
  `);if(l.length>=3&&/^[\s-:|]+$/.test(l[1])){const i=t.length;return t.push(Bm(r)),`\0BLOCK${i}\0`}return r}),n=n.replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^#### (.+)$/gm,"<h4>$1</h4>").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/^> (.+)$/gm,"<blockquote>$1</blockquote>").replace(/^\d+\.\s+(.+)$/gm,"<oli>$1</oli>").replace(/((?:<oli>.*<\/oli>\n?)+)/g,r=>"<ol>"+r.replace(/<\/?oli>/g,l=>l.replace("oli","li"))+"</ol>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/((?:<li>.*<\/li>\n?)+)/g,"<ul>$1</ul>").replace(/^(?!<(?:h[1-6]|ul|ol|li|p|blockquote|pre|table|thead|tbody|tr|td|th|\x00)).+$/gm,"<p>$&</p>").replace(/\n{2,}/g,`
86
- `),n=n.replace(/\x00BLOCK(\d+)\x00/g,(r,l)=>t[Number(l)]),n}function Wu(){var h,f;const{courseId:e,lessonId:t}=pf(),n=df(),r=hr(d=>d.loadCourse),[l,i]=S.useState(null),[o,s]=S.useState(null),[u,c]=S.useState(!0),{isLessonCompleted:m,completeLesson:p}=mr();if(S.useEffect(()=>{e&&(c(!0),r(e).then(d=>{if(i(d),d&&d.lessons.length>0){const g=t?d.lessons.find(C=>C.id===t):null;g?s(g):(s(d.lessons[0]),n(`/course/${e}/${d.lessons[0].id}`,{replace:!0}))}c(!1)}))},[e,t,r,n]),u)return a.jsx("div",{className:"loading",children:"Opening the textbook..."});if(!l)return a.jsxs("div",{className:"empty-state",children:[a.jsx("h3",{children:"Course not found"}),a.jsx("p",{children:"The requested course does not exist."}),a.jsx(se,{to:"/",className:"btn btn-primary mt-lg",children:"Return to Campus"})]});const v=o?l.lessons.findIndex(d=>d.id===o.id):0,y=()=>{o&&e&&p(e,o.id)},x=(d,g=!1)=>{s(d),n(`/course/${e}/${d.id}`),g&&window.scrollTo(0,0)},w=()=>{v<l.lessons.length-1&&x(l.lessons[v+1],!0)},P=()=>{v>0&&x(l.lessons[v-1],!0)};return a.jsxs("div",{className:"course-layout",children:[a.jsxs("aside",{className:"course-sidebar",children:[a.jsx("h2",{children:l.title}),a.jsx("nav",{className:"lesson-nav",children:l.lessons.map(d=>{const g=e?m(e,d.id):!1,C=(o==null?void 0:o.id)===d.id;let k="lesson-nav-item";return C&&(k+=" active"),g&&!C&&(k+=" completed"),a.jsx("button",{className:k,onClick:()=>x(d),children:d.title},d.id)})})]}),a.jsx("div",{className:"course-content",children:o&&a.jsxs(a.Fragment,{children:[a.jsx("h1",{children:o.title}),(((h=o.keyConcepts)==null?void 0:h.length)??0)>0&&a.jsx("div",{className:"key-concepts",children:o.keyConcepts.map(d=>a.jsx("span",{className:"concept-tag",children:d},d))}),a.jsx("div",{className:"lesson-content",dangerouslySetInnerHTML:{__html:Wt(o.content)}}),a.jsxs("div",{className:"lesson-actions",children:[a.jsx("div",{children:v>0&&a.jsx("button",{className:"btn btn-secondary",onClick:P,children:"Previous"})}),a.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[e&&!m(e,o.id)&&a.jsx("button",{className:"btn btn-secondary",onClick:y,children:"Mark Complete"}),(((f=o.quiz)==null?void 0:f.length)??0)>0&&e&&a.jsx(se,{to:`/course/${e}/quiz/${o.id}`,className:"btn btn-gold",children:"Take Quiz"}),v<l.lessons.length-1&&a.jsx("button",{className:"btn btn-primary",onClick:w,children:"Next Lesson"})]})]})]})})]})}function ho({number:e,question:t,scenario:n,choices:r,correct:l,explanation:i,selectedAnswer:o,onSelect:s,showResult:u,onAnswered:c,splitLayout:m}){const[p,v]=S.useState(null),[y,x]=S.useState(!1),w=s!==void 0,P=w?o||null:p,h=w?u:y,f=E=>{h&&!w||(w?s==null||s(E):(v(E),x(!0),c==null||c(E)))},d=P===l,g=Object.keys(r).sort(),C=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"question-number",children:["Question ",e]}),n&&a.jsx("div",{className:"scenario",dangerouslySetInnerHTML:{__html:Wt(n)}}),a.jsx("div",{className:"question-text",dangerouslySetInnerHTML:{__html:Wt(t)}})]}),k=a.jsx("div",{className:"choices",children:g.map(E=>{let N="choice-btn";return P===E&&(N+=" selected"),h&&E===l&&(N+=" correct"),h&&P===E&&E!==l&&(N+=" incorrect"),a.jsxs("button",{className:N,onClick:()=>f(E),disabled:h&&!w,children:[a.jsxs("span",{className:"choice-letter",children:[E,"."]}),a.jsx("span",{dangerouslySetInnerHTML:{__html:Wt(r[E])}})]},E)})});return m?a.jsxs("div",{className:"question-card",children:[a.jsxs("div",{className:"question-split-layout",children:[a.jsx("div",{className:"question-content",children:C}),a.jsx("div",{className:"answer-choices",children:k})]}),h&&a.jsxs("div",{className:`explanation ${d?"":"wrong"}`,children:[a.jsx("strong",{children:d?"Correct!":`Incorrect. The answer is ${l}.`}),a.jsx("br",{}),a.jsx("span",{dangerouslySetInnerHTML:{__html:Wt(i)}})]})]}):a.jsxs("div",{className:"question-card",children:[C,k,h&&a.jsxs("div",{className:`explanation ${d?"":"wrong"}`,children:[a.jsx("strong",{children:d?"Correct!":`Incorrect. The answer is ${l}.`}),a.jsx("br",{}),a.jsx("span",{dangerouslySetInnerHTML:{__html:Wt(i)}})]})]})}function Wm(){const{courseId:e,lessonId:t}=pf(),n=hr(g=>g.loadCourse),{recordQuiz:r,completeLesson:l,getCourseProgress:i}=mr(),[o,s]=S.useState(null),[u,c]=S.useState(null),[m,p]=S.useState(!0),[v,y]=S.useState(!1),[x,w]=S.useState(0),P=e&&t?i(e).quizResults[t]:void 0;S.useEffect(()=>{e&&(p(!0),n(e).then(g=>{if(g&&t){const C=g.lessons.findIndex(k=>k.id===t);s(C>=0?g.lessons[C]:null),C>=0&&C<g.lessons.length-1&&c(g.lessons[C+1].id)}p(!1)}))},[e,t,n]);const[h,f]=S.useState({}),d=(g,C)=>{if(f(k=>({...k,[g]:C})),o){const k={...h,[g]:C};if(Object.keys(k).length===o.quiz.length){const E=o.quiz.filter(N=>k[N.id]===N.correct).length;if(w(E),y(!0),e&&t){const N={courseId:e,lessonId:t,score:E,total:o.quiz.length,answers:k,date:new Date().toISOString()};r(N),l(e,t)}}}};return m?a.jsx("div",{className:"loading",children:"Preparing your examination..."}):!o||o.quiz.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx("h3",{children:"No quiz available"}),a.jsx("p",{children:"This lesson does not have a quiz."}),a.jsx(se,{to:`/course/${e}`,className:"btn btn-primary mt-lg",children:"Back to Course"})]}):a.jsxs("div",{className:"quiz-container",children:[a.jsxs("div",{className:"quiz-header",children:[a.jsxs("h1",{children:[o.title," — Quiz"]}),a.jsx("p",{className:"quiz-progress",children:v?`Score: ${x}/${o.quiz.length} (${Math.round(x/o.quiz.length*100)}%)`:`${Object.keys(h).length}/${o.quiz.length} answered`}),P&&!v&&a.jsxs("p",{className:"text-muted mt-sm",children:["Previous best: ",P.score,"/",P.total]})]}),o.quiz.map((g,C)=>a.jsx(ho,{number:C+1,question:g.question,choices:g.choices,correct:g.correct,explanation:g.explanation,onAnswered:k=>d(g.id,k)},g.id)),v&&a.jsxs("div",{className:"text-center mt-xl",children:[a.jsx("p",{className:"mb-lg",style:{fontSize:"1.25rem",fontFamily:"var(--font-serif)"},children:x===o.quiz.length?"Perfect score! Exemplary scholarship.":x>=o.quiz.length*.8?"Well done, scholar. You have demonstrated understanding.":"Review the material and try again. Persistence is the path to mastery."}),u?a.jsx(se,{to:`/course/${e}/${u}`,className:"btn btn-primary",children:"Next Lesson"}):a.jsx(se,{to:`/course/${e}`,className:"btn btn-primary",children:"Return to Course"})]})]})}function Vm({totalSeconds:e,onTimeUp:t,running:n}){const[r,l]=S.useState(e),i=S.useCallback(()=>{t()},[t]);S.useEffect(()=>{if(!n)return;const m=setInterval(()=>{l(p=>p<=1?(clearInterval(m),i(),0):p-1)},1e3);return()=>clearInterval(m)},[n,i]);const o=Math.floor(r/60),s=r%60,u=r/e*100;let c="timer-display";return u<20?c+=" critical":u<40&&(c+=" warning"),a.jsxs("span",{className:c,children:[String(o).padStart(2,"0"),":",String(s).padStart(2,"0")]})}function Vu({text:e}){const t=e.split(/(```[\s\S]*?```)/g);return a.jsx("div",{className:"passage-block",children:a.jsx("div",{className:"passage-content",children:t.map((n,r)=>{if(n.startsWith("```")){const l=n.match(/^```(\w*)\n?([\s\S]*?)```$/),i=l?l[2]:n.slice(3,-3);return a.jsx("pre",{children:a.jsx("code",{children:i})},r)}return n.split(/\n\n+/).map((l,i)=>a.jsx("p",{children:l},`${r}-${i}`))})})})}function Hu(e,t,n){if(!t)return null;const r=e[n];return r.passageId?t[r.passageId]??null:null}function Hm(){const[e,t]=S.useState(null),[n,r]=S.useState("intro"),[l,i]=S.useState({}),[o,s]=S.useState(0),[u,c]=S.useState(!0),[m,p]=S.useState(null),{studentName:v,setStudentName:y,addCertificate:x}=ps(),[w,P]=S.useState(v);S.useEffect(()=>{async function k(){var E,N;try{const ee=(N=(E=(await(await fetch("/api/plsat")).json()).versions)==null?void 0:E[0])==null?void 0:N.version;if(!ee)return;const be=await fetch(`/api/plsat/${ee}`);if(!be.ok)return;t(await be.json())}catch{}finally{c(!1)}}k()},[]);const h=S.useCallback(()=>{if(!e)return;const k=e.questions.filter(ee=>l[ee.id]===ee.correct).length,E=e.questions.length,N=Math.round(k/E*100),M=N>=e.passThreshold*100,z={name:w||"Anonymous Scholar",score:k,total:E,percentage:N,passed:M,plsatVersion:e.version,frameworkVersion:e.frameworkVersion,date:new Date().toISOString()};p(z),x(z),w&&y(w),r("results")},[e,l,w,x,y]),f=S.useCallback(()=>{h()},[h]),d=()=>{h()},g=()=>{i({}),s(0),r("exam")},C=S.useMemo(()=>!e||n!=="exam"?null:Hu(e.questions,e.passages,o),[e,n,o]);if(u)return a.jsx("div",{className:"loading",children:"The examination board is convening..."});if(!e)return a.jsxs("div",{className:"empty-state",children:[a.jsx("h3",{children:"PLSAT Unavailable"}),a.jsx("p",{children:"Could not load the examination. Please try again."})]});if(n==="intro")return a.jsxs("div",{className:"plsat-container",children:[a.jsxs("div",{className:"plsat-intro",children:[a.jsx(po,{size:100}),a.jsx("h1",{children:"The PLSAT"}),a.jsx("p",{className:"plsat-subtitle",children:"Paradigm Licensure Standardized Assessment Test"}),a.jsxs("p",{className:"text-muted",children:["Version ",e.version]})]}),a.jsxs("div",{className:"plsat-rules",children:[a.jsx("h3",{children:"Examination Rules"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsxs("strong",{children:[e.questions.length," questions"]})," covering all aspects of the Paradigm framework"]}),a.jsxs("li",{children:[a.jsxs("strong",{children:[Math.floor(e.timeLimit/60)," minutes"]})," to complete the examination"]}),a.jsxs("li",{children:[a.jsxs("strong",{children:[e.passThreshold*100,"%"]})," required to pass and receive certification"]}),a.jsx("li",{children:"All questions are multiple choice (A through E)"}),a.jsx("li",{children:"Some questions reference a shared passage — read it carefully"}),a.jsx("li",{children:"You may navigate between questions freely"}),a.jsx("li",{children:"There is no penalty for guessing — answer every question"}),a.jsx("li",{children:"Your certificate will display the PLSAT version for posterity"})]})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"mb-lg",children:a.jsx("input",{type:"text",className:"name-input",placeholder:"Enter your name, scholar",value:w,onChange:k=>P(k.target.value)})}),a.jsx("button",{className:"btn btn-primary btn-lg",onClick:g,children:"Begin Examination"})]})]});if(n==="exam"){const k=e.questions[o],E=Object.keys(l).length;return a.jsxs("div",{className:"plsat-container",children:[a.jsxs("div",{className:"plsat-timer",children:[a.jsx(Vm,{totalSeconds:e.timeLimit,onTimeUp:f,running:!0}),a.jsxs("span",{className:"plsat-progress-text",children:["Question ",o+1," of ",e.questions.length," | ",E," answered"]})]}),a.jsxs("div",{style:{marginTop:"var(--space-lg)"},children:[C&&a.jsx(Vu,{text:C}),a.jsx(ho,{number:o+1,question:k.question,scenario:k.scenario,choices:k.choices,correct:k.correct,explanation:k.explanation,selectedAnswer:l[k.id],onSelect:N=>i(M=>({...M,[k.id]:N})),showResult:!1,splitLayout:!0})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"var(--space-lg)"},children:[a.jsx("button",{className:"btn btn-secondary",disabled:o===0,onClick:()=>s(N=>N-1),children:"Previous"}),a.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[E===e.questions.length&&a.jsx("button",{className:"btn btn-gold",onClick:d,children:"Submit Examination"}),a.jsx("button",{className:"btn btn-primary",disabled:o===e.questions.length-1,onClick:()=>s(N=>N+1),children:"Next"})]})]}),a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginTop:"var(--space-xl)",justifyContent:"center"},children:e.questions.map((N,M)=>a.jsx("button",{onClick:()=>s(M),style:{width:28,height:28,borderRadius:"50%",border:M===o?"2px solid var(--burgundy)":"1px solid var(--parchment-dark)",background:l[N.id]?"var(--gold-bg)":"var(--cream)",color:"var(--ink)",fontSize:"0.6875rem",cursor:"pointer",fontWeight:M===o?600:400},children:M+1},N.id))})]})}return n==="results"&&m?a.jsx("div",{className:"plsat-container",children:a.jsxs("div",{className:"plsat-results",children:[a.jsx(po,{size:80}),a.jsxs("div",{className:`score-display ${m.passed?"passed":"failed"}`,children:[m.percentage,"%"]}),a.jsx("p",{className:"verdict",children:m.passed?"Congratulations! You have passed the PLSAT.":"The examination board regrets to inform you that you did not pass."}),a.jsxs("p",{className:"text-muted mb-lg",children:["Score: ",m.score,"/",m.total," | PLSAT v",m.plsatVersion," | ",new Date(m.date).toLocaleDateString()]}),a.jsxs("div",{style:{display:"flex",gap:"1rem",justifyContent:"center"},children:[m.passed&&a.jsx(se,{to:"/certificate",className:"btn btn-gold btn-lg",children:"View Certificate"}),a.jsx("button",{className:"btn btn-secondary",onClick:()=>r("review"),children:"Review Answers"}),a.jsx("button",{className:"btn btn-primary",onClick:()=>r("intro"),children:m.passed?"Retake":"Try Again"})]})]})}):n==="review"?a.jsxs("div",{className:"plsat-container",children:[a.jsxs("div",{className:"quiz-header",children:[a.jsx("h1",{children:"PLSAT Review"}),a.jsx("p",{className:"quiz-progress",children:m?`Score: ${m.score}/${m.total} (${m.percentage}%)`:""})]}),e.questions.map((k,E)=>{const N=Hu(e.questions,e.passages,E);return a.jsxs("div",{children:[N&&a.jsx(Vu,{text:N}),a.jsx(ho,{number:E+1,question:k.question,scenario:k.scenario,choices:k.choices,correct:k.correct,explanation:k.explanation,selectedAnswer:l[k.id],onSelect:()=>{},showResult:!0,splitLayout:!0})]},k.id)}),a.jsx("div",{className:"text-center mt-xl",children:a.jsx("button",{className:"btn btn-primary",onClick:()=>r("results"),children:"Back to Results"})})]}):null}function Qm(){const[e,t]=S.useState(null),[n,r]=S.useState(!0),[l,i]=S.useState(null);return S.useEffect(()=>{fetch("/api/reference").then(async o=>{if(!o.ok){const u=await o.json().catch(()=>({}));i(typeof u.error=="string"?u.error:"Could not load reference data."),r(!1);return}const s=await o.json();t(s),r(!1)}).catch(()=>{i("Could not load reference data."),r(!1)})},[]),n?a.jsx("div",{className:"loading",children:"Opening the reference library..."}):e?a.jsxs("div",{className:"reference-container",children:[a.jsx("h1",{className:"mb-lg",children:"Reference Library"}),e.sections.map(o=>a.jsxs("section",{className:"reference-section",children:[a.jsx("h2",{children:o.title}),a.jsx("div",{className:"reference-grid",children:o.cards.map(s=>a.jsxs("div",{className:"ref-card",children:[s.symbol&&a.jsx("div",{className:"ref-symbol",children:s.symbol}),a.jsx("h4",{children:s.name}),a.jsx("p",{children:s.description}),s.examples&&s.examples.length>0&&a.jsx("div",{className:"ref-examples",children:s.examples.map(u=>a.jsx("span",{className:"ref-example",children:u},u))}),s.logger&&a.jsx("p",{style:{marginTop:"0.5rem"},children:a.jsx("code",{children:s.logger})}),s.when&&a.jsx("p",{className:"text-muted",style:{fontSize:"0.8125rem",marginTop:"0.25rem"},children:a.jsx("em",{children:s.when})}),s.command&&a.jsx("p",{style:{marginTop:"0.5rem"},children:a.jsx("code",{children:s.command})}),s.steps&&s.steps.length>0&&a.jsx("ol",{style:{fontSize:"0.875rem",paddingLeft:"1.25rem",marginTop:"0.5rem"},children:s.steps.map((u,c)=>a.jsx("li",{style:{marginBottom:"0.25rem"},children:u},c))})]},s.id))})]},o.id))]}):a.jsxs("div",{className:"empty-state",children:[a.jsx("h3",{children:"Reference library unavailable"}),a.jsx("p",{children:l??"Could not load reference data."})]})}function Km(){const{certificates:e}=ps(),t=Ut(u=>u.config),n=(t==null?void 0:t.branding.name)??"Paradigm University",r=(t==null?void 0:t.branding.tagline)??"Lux in Codice",i=!t||t.mode==="paradigm"?`Universitas Paradigmatica — ${r}`:r,o=e.filter(u=>u.passed),s=o.length>0?o.reduce((u,c)=>new Date(c.date)>new Date(u.date)?c:u):null;return s?a.jsxs("div",{className:"certificate-container",children:[a.jsx("div",{className:"no-print text-center mb-lg",children:a.jsx("button",{className:"btn btn-gold",onClick:()=>window.print(),children:"Print Certificate"})}),a.jsxs("div",{className:"certificate",children:[a.jsx(yl,{size:100,className:"cert-seal"}),a.jsx("h1",{children:n}),a.jsx("p",{className:"cert-title",children:i}),a.jsx("div",{className:"gold-divider"}),a.jsx("p",{style:{fontSize:"0.875rem",color:"var(--ink-muted)",marginTop:"var(--space-lg)"},children:"This is to certify that"}),a.jsx("div",{className:"cert-name",children:s.name}),a.jsxs("p",{className:"cert-body",children:["has successfully completed the",a.jsx("br",{}),a.jsx("strong",{children:"Paradigm Licensure Standardized Assessment Test"}),a.jsx("br",{}),"and is hereby recognized as a certified Paradigm practitioner."]}),a.jsxs("p",{className:"cert-score",children:["Score: ",s.score,"/",s.total," (",s.percentage,"%)"]}),a.jsx("div",{className:"gold-divider"}),a.jsxs("dl",{className:"cert-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"PLSAT Version"}),a.jsxs("dd",{children:["v",s.plsatVersion]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Framework Version"}),a.jsxs("dd",{children:["v",s.frameworkVersion]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Date Issued"}),a.jsx("dd",{children:new Date(s.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),e.length>1&&a.jsxs("div",{className:"no-print mt-xl",children:[a.jsx("h3",{className:"mb-md",children:"All Attempts"}),[...e].reverse().map((u,c)=>a.jsx("div",{className:"ref-card",style:{marginBottom:"0.5rem"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("span",{children:["PLSAT v",u.plsatVersion," — ",u.score,"/",u.total," (",u.percentage,"%)",u.passed?" ✓":""]}),a.jsx("span",{className:"text-muted",children:new Date(u.date).toLocaleDateString()})]})},c))]})]}):a.jsxs("div",{className:"certificate-container",children:[a.jsxs("div",{className:"empty-state",children:[a.jsx(yl,{size:80}),a.jsx("h3",{className:"mt-lg",children:"No Certificates Yet"}),a.jsx("p",{children:"Pass the PLSAT examination to earn your certification."}),a.jsx(se,{to:"/plsat",className:"btn btn-primary mt-lg",children:"Take the PLSAT"})]}),e.length>0&&a.jsxs("div",{className:"mt-xl",children:[a.jsx("h3",{className:"mb-md",children:"Previous Attempts"}),e.map((u,c)=>a.jsx("div",{className:"ref-card",style:{marginBottom:"0.5rem"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("span",{children:["PLSAT v",u.plsatVersion," — ",u.score,"/",u.total," (",u.percentage,"%)"]}),a.jsx("span",{className:"text-muted",children:new Date(u.date).toLocaleDateString()})]})},c))]})]})}function Ym(){const{loadPackConfig:e,config:t}=Ut();return S.useEffect(()=>{e()},[e]),S.useEffect(()=>{if(t&&(document.title=t.branding.name,t.branding.favicon)){const n=document.querySelector('link[rel~="icon"]');n&&(n.href=t.branding.favicon)}},[t]),a.jsxs("div",{className:"app",children:[a.jsx(zm,{version:"6.5.1"}),a.jsx("main",{className:"main-content",children:a.jsxs(Qh,{children:[a.jsx(We,{path:"/",element:a.jsx(Mm,{})}),a.jsx(We,{path:"/courses",element:a.jsx(Um,{})}),a.jsx(We,{path:"/course/:courseId",element:a.jsx(Wu,{})}),a.jsx(We,{path:"/course/:courseId/:lessonId",element:a.jsx(Wu,{})}),a.jsx(We,{path:"/course/:courseId/quiz/:lessonId",element:a.jsx(Wm,{})}),a.jsx(We,{path:"/plsat",element:a.jsx(Hm,{})}),a.jsx(We,{path:"/reference",element:a.jsx(Qm,{})}),a.jsx(We,{path:"/certificate",element:a.jsx(Km,{})})]})})]})}vi.createRoot(document.getElementById("root")).render(a.jsx(xo.StrictMode,{children:a.jsx(Zh,{children:a.jsx(Ym,{})})}));
87
- //# sourceMappingURL=index-DrtbBC21.js.map
86
+ `),n=n.replace(/\x00BLOCK(\d+)\x00/g,(r,l)=>t[Number(l)]),n}function Wu(){var h,f;const{courseId:e,lessonId:t}=pf(),n=df(),r=hr(d=>d.loadCourse),[l,i]=S.useState(null),[o,s]=S.useState(null),[u,c]=S.useState(!0),{isLessonCompleted:m,completeLesson:p}=mr();if(S.useEffect(()=>{e&&(c(!0),r(e).then(d=>{if(i(d),d&&d.lessons.length>0){const g=t?d.lessons.find(C=>C.id===t):null;g?s(g):(s(d.lessons[0]),n(`/course/${e}/${d.lessons[0].id}`,{replace:!0}))}c(!1)}))},[e,t,r,n]),u)return a.jsx("div",{className:"loading",children:"Opening the textbook..."});if(!l)return a.jsxs("div",{className:"empty-state",children:[a.jsx("h3",{children:"Course not found"}),a.jsx("p",{children:"The requested course does not exist."}),a.jsx(se,{to:"/",className:"btn btn-primary mt-lg",children:"Return to Campus"})]});const v=o?l.lessons.findIndex(d=>d.id===o.id):0,y=()=>{o&&e&&p(e,o.id)},x=(d,g=!1)=>{s(d),n(`/course/${e}/${d.id}`),g&&window.scrollTo(0,0)},w=()=>{v<l.lessons.length-1&&x(l.lessons[v+1],!0)},P=()=>{v>0&&x(l.lessons[v-1],!0)};return a.jsxs("div",{className:"course-layout",children:[a.jsxs("aside",{className:"course-sidebar",children:[a.jsx("h2",{children:l.title}),a.jsx("nav",{className:"lesson-nav",children:l.lessons.map(d=>{const g=e?m(e,d.id):!1,C=(o==null?void 0:o.id)===d.id;let k="lesson-nav-item";return C&&(k+=" active"),g&&!C&&(k+=" completed"),a.jsx("button",{className:k,onClick:()=>x(d),children:d.title},d.id)})})]}),a.jsx("div",{className:"course-content",children:o&&a.jsxs(a.Fragment,{children:[a.jsx("h1",{children:o.title}),(((h=o.keyConcepts)==null?void 0:h.length)??0)>0&&a.jsx("div",{className:"key-concepts",children:o.keyConcepts.map(d=>a.jsx("span",{className:"concept-tag",children:d},d))}),a.jsx("div",{className:"lesson-content",dangerouslySetInnerHTML:{__html:Wt(o.content)}}),a.jsxs("div",{className:"lesson-actions",children:[a.jsx("div",{children:v>0&&a.jsx("button",{className:"btn btn-secondary",onClick:P,children:"Previous"})}),a.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[e&&!m(e,o.id)&&a.jsx("button",{className:"btn btn-secondary",onClick:y,children:"Mark Complete"}),(((f=o.quiz)==null?void 0:f.length)??0)>0&&e&&a.jsx(se,{to:`/course/${e}/quiz/${o.id}`,className:"btn btn-gold",children:"Take Quiz"}),v<l.lessons.length-1&&a.jsx("button",{className:"btn btn-primary",onClick:w,children:"Next Lesson"})]})]})]})})]})}function ho({number:e,question:t,scenario:n,choices:r,correct:l,explanation:i,selectedAnswer:o,onSelect:s,showResult:u,onAnswered:c,splitLayout:m}){const[p,v]=S.useState(null),[y,x]=S.useState(!1),w=s!==void 0,P=w?o||null:p,h=w?u:y,f=E=>{h&&!w||(w?s==null||s(E):(v(E),x(!0),c==null||c(E)))},d=P===l,g=Object.keys(r).sort(),C=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"question-number",children:["Question ",e]}),n&&a.jsx("div",{className:"scenario",dangerouslySetInnerHTML:{__html:Wt(n)}}),a.jsx("div",{className:"question-text",dangerouslySetInnerHTML:{__html:Wt(t)}})]}),k=a.jsx("div",{className:"choices",children:g.map(E=>{let N="choice-btn";return P===E&&(N+=" selected"),h&&E===l&&(N+=" correct"),h&&P===E&&E!==l&&(N+=" incorrect"),a.jsxs("button",{className:N,onClick:()=>f(E),disabled:h&&!w,children:[a.jsxs("span",{className:"choice-letter",children:[E,"."]}),a.jsx("span",{dangerouslySetInnerHTML:{__html:Wt(r[E])}})]},E)})});return m?a.jsxs("div",{className:"question-card",children:[a.jsxs("div",{className:"question-split-layout",children:[a.jsx("div",{className:"question-content",children:C}),a.jsx("div",{className:"answer-choices",children:k})]}),h&&a.jsxs("div",{className:`explanation ${d?"":"wrong"}`,children:[a.jsx("strong",{children:d?"Correct!":`Incorrect. The answer is ${l}.`}),a.jsx("br",{}),a.jsx("span",{dangerouslySetInnerHTML:{__html:Wt(i)}})]})]}):a.jsxs("div",{className:"question-card",children:[C,k,h&&a.jsxs("div",{className:`explanation ${d?"":"wrong"}`,children:[a.jsx("strong",{children:d?"Correct!":`Incorrect. The answer is ${l}.`}),a.jsx("br",{}),a.jsx("span",{dangerouslySetInnerHTML:{__html:Wt(i)}})]})]})}function Wm(){const{courseId:e,lessonId:t}=pf(),n=hr(g=>g.loadCourse),{recordQuiz:r,completeLesson:l,getCourseProgress:i}=mr(),[o,s]=S.useState(null),[u,c]=S.useState(null),[m,p]=S.useState(!0),[v,y]=S.useState(!1),[x,w]=S.useState(0),P=e&&t?i(e).quizResults[t]:void 0;S.useEffect(()=>{e&&(p(!0),n(e).then(g=>{if(g&&t){const C=g.lessons.findIndex(k=>k.id===t);s(C>=0?g.lessons[C]:null),C>=0&&C<g.lessons.length-1&&c(g.lessons[C+1].id)}p(!1)}))},[e,t,n]);const[h,f]=S.useState({}),d=(g,C)=>{if(f(k=>({...k,[g]:C})),o){const k={...h,[g]:C};if(Object.keys(k).length===o.quiz.length){const E=o.quiz.filter(N=>k[N.id]===N.correct).length;if(w(E),y(!0),e&&t){const N={courseId:e,lessonId:t,score:E,total:o.quiz.length,answers:k,date:new Date().toISOString()};r(N),l(e,t)}}}};return m?a.jsx("div",{className:"loading",children:"Preparing your examination..."}):!o||o.quiz.length===0?a.jsxs("div",{className:"empty-state",children:[a.jsx("h3",{children:"No quiz available"}),a.jsx("p",{children:"This lesson does not have a quiz."}),a.jsx(se,{to:`/course/${e}`,className:"btn btn-primary mt-lg",children:"Back to Course"})]}):a.jsxs("div",{className:"quiz-container",children:[a.jsxs("div",{className:"quiz-header",children:[a.jsxs("h1",{children:[o.title," — Quiz"]}),a.jsx("p",{className:"quiz-progress",children:v?`Score: ${x}/${o.quiz.length} (${Math.round(x/o.quiz.length*100)}%)`:`${Object.keys(h).length}/${o.quiz.length} answered`}),P&&!v&&a.jsxs("p",{className:"text-muted mt-sm",children:["Previous best: ",P.score,"/",P.total]})]}),o.quiz.map((g,C)=>a.jsx(ho,{number:C+1,question:g.question,choices:g.choices,correct:g.correct,explanation:g.explanation,onAnswered:k=>d(g.id,k)},g.id)),v&&a.jsxs("div",{className:"text-center mt-xl",children:[a.jsx("p",{className:"mb-lg",style:{fontSize:"1.25rem",fontFamily:"var(--font-serif)"},children:x===o.quiz.length?"Perfect score! Exemplary scholarship.":x>=o.quiz.length*.8?"Well done, scholar. You have demonstrated understanding.":"Review the material and try again. Persistence is the path to mastery."}),u?a.jsx(se,{to:`/course/${e}/${u}`,className:"btn btn-primary",children:"Next Lesson"}):a.jsx(se,{to:`/course/${e}`,className:"btn btn-primary",children:"Return to Course"})]})]})}function Vm({totalSeconds:e,onTimeUp:t,running:n}){const[r,l]=S.useState(e),i=S.useCallback(()=>{t()},[t]);S.useEffect(()=>{if(!n)return;const m=setInterval(()=>{l(p=>p<=1?(clearInterval(m),i(),0):p-1)},1e3);return()=>clearInterval(m)},[n,i]);const o=Math.floor(r/60),s=r%60,u=r/e*100;let c="timer-display";return u<20?c+=" critical":u<40&&(c+=" warning"),a.jsxs("span",{className:c,children:[String(o).padStart(2,"0"),":",String(s).padStart(2,"0")]})}function Vu({text:e}){const t=e.split(/(```[\s\S]*?```)/g);return a.jsx("div",{className:"passage-block",children:a.jsx("div",{className:"passage-content",children:t.map((n,r)=>{if(n.startsWith("```")){const l=n.match(/^```(\w*)\n?([\s\S]*?)```$/),i=l?l[2]:n.slice(3,-3);return a.jsx("pre",{children:a.jsx("code",{children:i})},r)}return n.split(/\n\n+/).map((l,i)=>a.jsx("p",{children:l},`${r}-${i}`))})})})}function Hu(e,t,n){if(!t)return null;const r=e[n];return r.passageId?t[r.passageId]??null:null}function Hm(){const[e,t]=S.useState(null),[n,r]=S.useState("intro"),[l,i]=S.useState({}),[o,s]=S.useState(0),[u,c]=S.useState(!0),[m,p]=S.useState(null),{studentName:v,setStudentName:y,addCertificate:x}=ps(),[w,P]=S.useState(v);S.useEffect(()=>{async function k(){var E,N;try{const ee=(N=(E=(await(await fetch("/api/plsat")).json()).versions)==null?void 0:E[0])==null?void 0:N.version;if(!ee)return;const be=await fetch(`/api/plsat/${ee}`);if(!be.ok)return;t(await be.json())}catch{}finally{c(!1)}}k()},[]);const h=S.useCallback(()=>{if(!e)return;const k=e.questions.filter(ee=>l[ee.id]===ee.correct).length,E=e.questions.length,N=Math.round(k/E*100),M=N>=e.passThreshold*100,z={name:w||"Anonymous Scholar",score:k,total:E,percentage:N,passed:M,plsatVersion:e.version,frameworkVersion:e.frameworkVersion,date:new Date().toISOString()};p(z),x(z),w&&y(w),r("results")},[e,l,w,x,y]),f=S.useCallback(()=>{h()},[h]),d=()=>{h()},g=()=>{i({}),s(0),r("exam")},C=S.useMemo(()=>!e||n!=="exam"?null:Hu(e.questions,e.passages,o),[e,n,o]);if(u)return a.jsx("div",{className:"loading",children:"The examination board is convening..."});if(!e)return a.jsxs("div",{className:"empty-state",children:[a.jsx("h3",{children:"PLSAT Unavailable"}),a.jsx("p",{children:"Could not load the examination. Please try again."})]});if(n==="intro")return a.jsxs("div",{className:"plsat-container",children:[a.jsxs("div",{className:"plsat-intro",children:[a.jsx(po,{size:100}),a.jsx("h1",{children:"The PLSAT"}),a.jsx("p",{className:"plsat-subtitle",children:"Paradigm Licensure Standardized Assessment Test"}),a.jsxs("p",{className:"text-muted",children:["Version ",e.version]})]}),a.jsxs("div",{className:"plsat-rules",children:[a.jsx("h3",{children:"Examination Rules"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsxs("strong",{children:[e.questions.length," questions"]})," covering all aspects of the Paradigm framework"]}),a.jsxs("li",{children:[a.jsxs("strong",{children:[Math.floor(e.timeLimit/60)," minutes"]})," to complete the examination"]}),a.jsxs("li",{children:[a.jsxs("strong",{children:[e.passThreshold*100,"%"]})," required to pass and receive certification"]}),a.jsx("li",{children:"All questions are multiple choice (A through E)"}),a.jsx("li",{children:"Some questions reference a shared passage — read it carefully"}),a.jsx("li",{children:"You may navigate between questions freely"}),a.jsx("li",{children:"There is no penalty for guessing — answer every question"}),a.jsx("li",{children:"Your certificate will display the PLSAT version for posterity"})]})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"mb-lg",children:a.jsx("input",{type:"text",className:"name-input",placeholder:"Enter your name, scholar",value:w,onChange:k=>P(k.target.value)})}),a.jsx("button",{className:"btn btn-primary btn-lg",onClick:g,children:"Begin Examination"})]})]});if(n==="exam"){const k=e.questions[o],E=Object.keys(l).length;return a.jsxs("div",{className:"plsat-container",children:[a.jsxs("div",{className:"plsat-timer",children:[a.jsx(Vm,{totalSeconds:e.timeLimit,onTimeUp:f,running:!0}),a.jsxs("span",{className:"plsat-progress-text",children:["Question ",o+1," of ",e.questions.length," | ",E," answered"]})]}),a.jsxs("div",{style:{marginTop:"var(--space-lg)"},children:[C&&a.jsx(Vu,{text:C}),a.jsx(ho,{number:o+1,question:k.question,scenario:k.scenario,choices:k.choices,correct:k.correct,explanation:k.explanation,selectedAnswer:l[k.id],onSelect:N=>i(M=>({...M,[k.id]:N})),showResult:!1,splitLayout:!0})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"var(--space-lg)"},children:[a.jsx("button",{className:"btn btn-secondary",disabled:o===0,onClick:()=>s(N=>N-1),children:"Previous"}),a.jsxs("div",{style:{display:"flex",gap:"0.5rem"},children:[E===e.questions.length&&a.jsx("button",{className:"btn btn-gold",onClick:d,children:"Submit Examination"}),a.jsx("button",{className:"btn btn-primary",disabled:o===e.questions.length-1,onClick:()=>s(N=>N+1),children:"Next"})]})]}),a.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",marginTop:"var(--space-xl)",justifyContent:"center"},children:e.questions.map((N,M)=>a.jsx("button",{onClick:()=>s(M),style:{width:28,height:28,borderRadius:"50%",border:M===o?"2px solid var(--burgundy)":"1px solid var(--parchment-dark)",background:l[N.id]?"var(--gold-bg)":"var(--cream)",color:"var(--ink)",fontSize:"0.6875rem",cursor:"pointer",fontWeight:M===o?600:400},children:M+1},N.id))})]})}return n==="results"&&m?a.jsx("div",{className:"plsat-container",children:a.jsxs("div",{className:"plsat-results",children:[a.jsx(po,{size:80}),a.jsxs("div",{className:`score-display ${m.passed?"passed":"failed"}`,children:[m.percentage,"%"]}),a.jsx("p",{className:"verdict",children:m.passed?"Congratulations! You have passed the PLSAT.":"The examination board regrets to inform you that you did not pass."}),a.jsxs("p",{className:"text-muted mb-lg",children:["Score: ",m.score,"/",m.total," | PLSAT v",m.plsatVersion," | ",new Date(m.date).toLocaleDateString()]}),a.jsxs("div",{style:{display:"flex",gap:"1rem",justifyContent:"center"},children:[m.passed&&a.jsx(se,{to:"/certificate",className:"btn btn-gold btn-lg",children:"View Certificate"}),a.jsx("button",{className:"btn btn-secondary",onClick:()=>r("review"),children:"Review Answers"}),a.jsx("button",{className:"btn btn-primary",onClick:()=>r("intro"),children:m.passed?"Retake":"Try Again"})]})]})}):n==="review"?a.jsxs("div",{className:"plsat-container",children:[a.jsxs("div",{className:"quiz-header",children:[a.jsx("h1",{children:"PLSAT Review"}),a.jsx("p",{className:"quiz-progress",children:m?`Score: ${m.score}/${m.total} (${m.percentage}%)`:""})]}),e.questions.map((k,E)=>{const N=Hu(e.questions,e.passages,E);return a.jsxs("div",{children:[N&&a.jsx(Vu,{text:N}),a.jsx(ho,{number:E+1,question:k.question,scenario:k.scenario,choices:k.choices,correct:k.correct,explanation:k.explanation,selectedAnswer:l[k.id],onSelect:()=>{},showResult:!0,splitLayout:!0})]},k.id)}),a.jsx("div",{className:"text-center mt-xl",children:a.jsx("button",{className:"btn btn-primary",onClick:()=>r("results"),children:"Back to Results"})})]}):null}function Qm(){const[e,t]=S.useState(null),[n,r]=S.useState(!0),[l,i]=S.useState(null);return S.useEffect(()=>{fetch("/api/reference").then(async o=>{if(!o.ok){const u=await o.json().catch(()=>({}));i(typeof u.error=="string"?u.error:"Could not load reference data."),r(!1);return}const s=await o.json();t(s),r(!1)}).catch(()=>{i("Could not load reference data."),r(!1)})},[]),n?a.jsx("div",{className:"loading",children:"Opening the reference library..."}):e?a.jsxs("div",{className:"reference-container",children:[a.jsx("h1",{className:"mb-lg",children:"Reference Library"}),e.sections.map(o=>a.jsxs("section",{className:"reference-section",children:[a.jsx("h2",{children:o.title}),a.jsx("div",{className:"reference-grid",children:o.cards.map(s=>a.jsxs("div",{className:"ref-card",children:[s.symbol&&a.jsx("div",{className:"ref-symbol",children:s.symbol}),a.jsx("h4",{children:s.name}),a.jsx("p",{children:s.description}),s.examples&&s.examples.length>0&&a.jsx("div",{className:"ref-examples",children:s.examples.map(u=>a.jsx("span",{className:"ref-example",children:u},u))}),s.logger&&a.jsx("p",{style:{marginTop:"0.5rem"},children:a.jsx("code",{children:s.logger})}),s.when&&a.jsx("p",{className:"text-muted",style:{fontSize:"0.8125rem",marginTop:"0.25rem"},children:a.jsx("em",{children:s.when})}),s.command&&a.jsx("p",{style:{marginTop:"0.5rem"},children:a.jsx("code",{children:s.command})}),s.steps&&s.steps.length>0&&a.jsx("ol",{style:{fontSize:"0.875rem",paddingLeft:"1.25rem",marginTop:"0.5rem"},children:s.steps.map((u,c)=>a.jsx("li",{style:{marginBottom:"0.25rem"},children:u},c))})]},s.id))})]},o.id))]}):a.jsxs("div",{className:"empty-state",children:[a.jsx("h3",{children:"Reference library unavailable"}),a.jsx("p",{children:l??"Could not load reference data."})]})}function Km(){const{certificates:e}=ps(),t=Ut(u=>u.config),n=(t==null?void 0:t.branding.name)??"Paradigm University",r=(t==null?void 0:t.branding.tagline)??"Lux in Codice",i=!t||t.mode==="paradigm"?`Universitas Paradigmatica — ${r}`:r,o=e.filter(u=>u.passed),s=o.length>0?o.reduce((u,c)=>new Date(c.date)>new Date(u.date)?c:u):null;return s?a.jsxs("div",{className:"certificate-container",children:[a.jsx("div",{className:"no-print text-center mb-lg",children:a.jsx("button",{className:"btn btn-gold",onClick:()=>window.print(),children:"Print Certificate"})}),a.jsxs("div",{className:"certificate",children:[a.jsx(yl,{size:100,className:"cert-seal"}),a.jsx("h1",{children:n}),a.jsx("p",{className:"cert-title",children:i}),a.jsx("div",{className:"gold-divider"}),a.jsx("p",{style:{fontSize:"0.875rem",color:"var(--ink-muted)",marginTop:"var(--space-lg)"},children:"This is to certify that"}),a.jsx("div",{className:"cert-name",children:s.name}),a.jsxs("p",{className:"cert-body",children:["has successfully completed the",a.jsx("br",{}),a.jsx("strong",{children:"Paradigm Licensure Standardized Assessment Test"}),a.jsx("br",{}),"and is hereby recognized as a certified Paradigm practitioner."]}),a.jsxs("p",{className:"cert-score",children:["Score: ",s.score,"/",s.total," (",s.percentage,"%)"]}),a.jsx("div",{className:"gold-divider"}),a.jsxs("dl",{className:"cert-meta",children:[a.jsxs("div",{children:[a.jsx("dt",{children:"PLSAT Version"}),a.jsxs("dd",{children:["v",s.plsatVersion]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Framework Version"}),a.jsxs("dd",{children:["v",s.frameworkVersion]})]}),a.jsxs("div",{children:[a.jsx("dt",{children:"Date Issued"}),a.jsx("dd",{children:new Date(s.date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),e.length>1&&a.jsxs("div",{className:"no-print mt-xl",children:[a.jsx("h3",{className:"mb-md",children:"All Attempts"}),[...e].reverse().map((u,c)=>a.jsx("div",{className:"ref-card",style:{marginBottom:"0.5rem"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("span",{children:["PLSAT v",u.plsatVersion," — ",u.score,"/",u.total," (",u.percentage,"%)",u.passed?" ✓":""]}),a.jsx("span",{className:"text-muted",children:new Date(u.date).toLocaleDateString()})]})},c))]})]}):a.jsxs("div",{className:"certificate-container",children:[a.jsxs("div",{className:"empty-state",children:[a.jsx(yl,{size:80}),a.jsx("h3",{className:"mt-lg",children:"No Certificates Yet"}),a.jsx("p",{children:"Pass the PLSAT examination to earn your certification."}),a.jsx(se,{to:"/plsat",className:"btn btn-primary mt-lg",children:"Take the PLSAT"})]}),e.length>0&&a.jsxs("div",{className:"mt-xl",children:[a.jsx("h3",{className:"mb-md",children:"Previous Attempts"}),e.map((u,c)=>a.jsx("div",{className:"ref-card",style:{marginBottom:"0.5rem"},children:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("span",{children:["PLSAT v",u.plsatVersion," — ",u.score,"/",u.total," (",u.percentage,"%)"]}),a.jsx("span",{className:"text-muted",children:new Date(u.date).toLocaleDateString()})]})},c))]})]})}function Ym(){const{loadPackConfig:e,config:t}=Ut();return S.useEffect(()=>{e()},[e]),S.useEffect(()=>{if(t&&(document.title=t.branding.name,t.branding.favicon)){const n=document.querySelector('link[rel~="icon"]');n&&(n.href=t.branding.favicon)}},[t]),a.jsxs("div",{className:"app",children:[a.jsx(zm,{version:"6.6.0"}),a.jsx("main",{className:"main-content",children:a.jsxs(Qh,{children:[a.jsx(We,{path:"/",element:a.jsx(Mm,{})}),a.jsx(We,{path:"/courses",element:a.jsx(Um,{})}),a.jsx(We,{path:"/course/:courseId",element:a.jsx(Wu,{})}),a.jsx(We,{path:"/course/:courseId/:lessonId",element:a.jsx(Wu,{})}),a.jsx(We,{path:"/course/:courseId/quiz/:lessonId",element:a.jsx(Wm,{})}),a.jsx(We,{path:"/plsat",element:a.jsx(Hm,{})}),a.jsx(We,{path:"/reference",element:a.jsx(Qm,{})}),a.jsx(We,{path:"/certificate",element:a.jsx(Km,{})})]})})]})}vi.createRoot(document.getElementById("root")).render(a.jsx(xo.StrictMode,{children:a.jsx(Zh,{children:a.jsx(Ym,{})})}));
87
+ //# sourceMappingURL=index-AbTjHBCf.js.map