@epic-web/workshop-app 5.22.3 → 5.22.5

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 (106) hide show
  1. package/build/client/assets/{_-BDcQ_M2J.js → _-CHaVBRQw.js} +2 -2
  2. package/build/client/assets/{_-BDcQ_M2J.js.map → _-CHaVBRQw.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber-CG2AFTtQ.js → _exerciseNumber-CoBfhQjJ.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber-CG2AFTtQ.js.map → _exerciseNumber-CoBfhQjJ.js.map} +1 -1
  5. package/build/client/assets/{_exerciseNumber_._stepNumber-COWC332q.js → _exerciseNumber_._stepNumber-D5VDI7vZ.js} +2 -2
  6. package/build/client/assets/{_exerciseNumber_._stepNumber-COWC332q.js.map → _exerciseNumber_._stepNumber-D5VDI7vZ.js.map} +1 -1
  7. package/build/client/assets/{_exerciseNumber_.finished-BgGBYU74.js → _exerciseNumber_.finished-Y4uCc3KH.js} +2 -2
  8. package/build/client/assets/{_exerciseNumber_.finished-BgGBYU74.js.map → _exerciseNumber_.finished-Y4uCc3KH.js.map} +1 -1
  9. package/build/client/assets/_layout-CkabS-6c.js +9 -0
  10. package/build/client/assets/_layout-CkabS-6c.js.map +1 -0
  11. package/build/client/assets/_layout-D25fx677.js +5 -0
  12. package/build/client/assets/_layout-D25fx677.js.map +1 -0
  13. package/build/client/assets/accordion-BjQ-5Z44.js +2 -0
  14. package/build/client/assets/accordion-BjQ-5Z44.js.map +1 -0
  15. package/build/client/assets/{account-BwQvf4AS.js → account-CN4B8rm4.js} +2 -2
  16. package/build/client/assets/{account-BwQvf4AS.js.map → account-CN4B8rm4.js.map} +1 -1
  17. package/build/client/assets/app-lUkT_xku.js +2 -0
  18. package/build/client/assets/{app-XHqxOZfy.js.map → app-lUkT_xku.js.map} +1 -1
  19. package/build/client/assets/{button-DVPKzWkn.js → button-ChOzbirS.js} +2 -2
  20. package/build/client/assets/{button-DVPKzWkn.js.map → button-ChOzbirS.js.map} +1 -1
  21. package/build/client/assets/{diff-C7Zh3uuA.js → diff-DX_Noxwr.js} +2 -2
  22. package/build/client/assets/{diff-C7Zh3uuA.js.map → diff-DX_Noxwr.js.map} +1 -1
  23. package/build/client/assets/diff-KLlexrTJ.js +2 -0
  24. package/build/client/assets/{diff-DVOUmaq6.js.map → diff-KLlexrTJ.js.map} +1 -1
  25. package/build/client/assets/discord-Cl4hiMqz.js +2 -0
  26. package/build/client/assets/discord-Cl4hiMqz.js.map +1 -0
  27. package/build/client/assets/{discord-CoBo5eVK.js → discord-gROK6Zn6.js} +2 -2
  28. package/build/client/assets/{discord-CoBo5eVK.js.map → discord-gROK6Zn6.js.map} +1 -1
  29. package/build/client/assets/{epic-video-DRZssA4U.js → epic-video-CqPr1EqP.js} +3 -3
  30. package/build/client/assets/{epic-video-DRZssA4U.js.map → epic-video-CqPr1EqP.js.map} +1 -1
  31. package/build/client/assets/{error-boundary-De7jJlR5.js → error-boundary-CAu3AmhN.js} +2 -2
  32. package/build/client/assets/{error-boundary-De7jJlR5.js.map → error-boundary-CAu3AmhN.js.map} +1 -1
  33. package/build/client/assets/{finished-6JNE1a1E.js → finished-B4dkglFg.js} +2 -2
  34. package/build/client/assets/{finished-6JNE1a1E.js.map → finished-B4dkglFg.js.map} +1 -1
  35. package/build/client/assets/index-BZ4hC2RQ.js +2 -0
  36. package/build/client/assets/{index-M647UyZv.js.map → index-BZ4hC2RQ.js.map} +1 -1
  37. package/build/client/assets/{index-CyFsiCNp.js → index-BmmH8jFA.js} +2 -2
  38. package/build/client/assets/{index-CyFsiCNp.js.map → index-BmmH8jFA.js.map} +1 -1
  39. package/build/client/assets/index-BncqUVfr.js +39 -0
  40. package/build/client/assets/index-BncqUVfr.js.map +1 -0
  41. package/build/client/assets/{index-BZWIdOoA.js → index-CMYl882D.js} +2 -2
  42. package/build/client/assets/{index-BZWIdOoA.js.map → index-CMYl882D.js.map} +1 -1
  43. package/build/client/assets/index-CSGHuBiw.js +5 -0
  44. package/build/client/assets/index-CSGHuBiw.js.map +1 -0
  45. package/build/client/assets/{index-Cnxrq9Ny.js → index-CYZfnGWa.js} +2 -2
  46. package/build/client/assets/{index-Cnxrq9Ny.js.map → index-CYZfnGWa.js.map} +1 -1
  47. package/build/client/assets/{loading-ClL22bF9.js → loading-CPEkK5hO.js} +2 -2
  48. package/build/client/assets/{loading-ClL22bF9.js.map → loading-CPEkK5hO.js.map} +1 -1
  49. package/build/client/assets/{login-C3I5NCrj.js → login-C9JmYc0v.js} +2 -2
  50. package/build/client/assets/{login-C3I5NCrj.js.map → login-C9JmYc0v.js.map} +1 -1
  51. package/build/client/assets/{manifest-6899d50c.js → manifest-a707abb0.js} +1 -1
  52. package/build/client/assets/{mdx-Z4bEoKXn.js → mdx-6d6l1jm2.js} +2 -2
  53. package/build/client/assets/{mdx-Z4bEoKXn.js.map → mdx-6d6l1jm2.js.map} +1 -1
  54. package/build/client/assets/{misc-BK2EiKtY.js → misc-CQmANiHr.js} +2 -2
  55. package/build/client/assets/{misc-BK2EiKtY.js.map → misc-CQmANiHr.js.map} +1 -1
  56. package/build/client/assets/{nav-chevrons-DVD_0i2a.js → nav-chevrons-DCuva9-Q.js} +2 -2
  57. package/build/client/assets/{nav-chevrons-DVD_0i2a.js.map → nav-chevrons-DCuva9-Q.js.map} +1 -1
  58. package/build/client/assets/{onboarding-DjyKxkKx.js → onboarding-Cr6zRXFc.js} +2 -2
  59. package/build/client/assets/{onboarding-DjyKxkKx.js.map → onboarding-Cr6zRXFc.js.map} +1 -1
  60. package/build/client/assets/{online-CHlOuJG-.js → online-BsTX44az.js} +2 -2
  61. package/build/client/assets/{online-CHlOuJG-.js.map → online-BsTX44az.js.map} +1 -1
  62. package/build/client/assets/{preferences-BmwlU5EC.js → preferences-BYBJKp8k.js} +2 -2
  63. package/build/client/assets/{preferences-BmwlU5EC.js.map → preferences-BYBJKp8k.js.map} +1 -1
  64. package/build/client/assets/{presence-CPOTHCHm.js → presence-D5UF-NOM.js} +2 -2
  65. package/build/client/assets/{presence-CPOTHCHm.js.map → presence-D5UF-NOM.js.map} +1 -1
  66. package/build/client/assets/{preview-B2BxDDhi.js → preview-DaTpH6lj.js} +2 -2
  67. package/build/client/assets/{preview-B2BxDDhi.js.map → preview-DaTpH6lj.js.map} +1 -1
  68. package/build/client/assets/{product-BkDgAOLQ.js → product-BKhLQKd7.js} +2 -2
  69. package/build/client/assets/{product-BkDgAOLQ.js.map → product-BKhLQKd7.js.map} +1 -1
  70. package/build/client/assets/{progress-CnHFlUmF.js → progress-DwE8EkAa.js} +2 -2
  71. package/build/client/assets/{progress-CnHFlUmF.js.map → progress-DwE8EkAa.js.map} +1 -1
  72. package/build/client/assets/{progress-bar-Q9l2dtTg.js → progress-bar-ZCHf2Y4W.js} +2 -2
  73. package/build/client/assets/{progress-bar-Q9l2dtTg.js.map → progress-bar-ZCHf2Y4W.js.map} +1 -1
  74. package/build/client/assets/{revalidation-ws-CLolY6Iu.js → revalidation-ws-BoJZTvOQ.js} +2 -2
  75. package/build/client/assets/{revalidation-ws-CLolY6Iu.js.map → revalidation-ws-BoJZTvOQ.js.map} +1 -1
  76. package/build/client/assets/{root-BIqtHKak.js → root-4MvCzrFd.js} +2 -2
  77. package/build/client/assets/{root-BIqtHKak.js.map → root-4MvCzrFd.js.map} +1 -1
  78. package/build/client/assets/{set-playground-ZcPraYj5.js → set-playground-IUJCGVu2.js} +2 -2
  79. package/build/client/assets/{set-playground-ZcPraYj5.js.map → set-playground-IUJCGVu2.js.map} +1 -1
  80. package/build/client/assets/test-BLgbkpIE.js +2 -0
  81. package/build/client/assets/{test-Bt9AuCey.js.map → test-BLgbkpIE.js.map} +1 -1
  82. package/build/client/assets/{tests-CmjMQrMj.js → tests-CtkPy7b6.js} +2 -2
  83. package/build/client/assets/{tests-CmjMQrMj.js.map → tests-CtkPy7b6.js.map} +1 -1
  84. package/build/client/assets/tooltip-Cd0yJoQb.js +2 -0
  85. package/build/client/assets/tooltip-Cd0yJoQb.js.map +1 -0
  86. package/build/server/index.js +7 -3
  87. package/build/server/index.js.map +1 -1
  88. package/package.json +3 -3
  89. package/build/client/assets/_layout-DKC1JUTc.js +0 -2
  90. package/build/client/assets/_layout-DKC1JUTc.js.map +0 -1
  91. package/build/client/assets/_layout-DuDUPWax.js +0 -6
  92. package/build/client/assets/_layout-DuDUPWax.js.map +0 -1
  93. package/build/client/assets/accordion-BPyhq471.js +0 -2
  94. package/build/client/assets/accordion-BPyhq471.js.map +0 -1
  95. package/build/client/assets/app-XHqxOZfy.js +0 -2
  96. package/build/client/assets/diff-DVOUmaq6.js +0 -2
  97. package/build/client/assets/discord-CFZUT74L.js +0 -2
  98. package/build/client/assets/discord-CFZUT74L.js.map +0 -1
  99. package/build/client/assets/index-6Hu4Lmzn.js +0 -2
  100. package/build/client/assets/index-6Hu4Lmzn.js.map +0 -1
  101. package/build/client/assets/index-BE3KRz8n.js +0 -42
  102. package/build/client/assets/index-BE3KRz8n.js.map +0 -1
  103. package/build/client/assets/index-M647UyZv.js +0 -2
  104. package/build/client/assets/test-Bt9AuCey.js +0 -2
  105. package/build/client/assets/tooltip-leWCE50J.js +0 -2
  106. package/build/client/assets/tooltip-leWCE50J.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import{j as e,u as a}from"./index-CGzylDPY.js";import{G as s}from"./error-boundary-De7jJlR5.js";import{I as o}from"./misc-BK2EiKtY.js";import{L as n}from"./components-DrvY4pal.js";function m(){return e.jsx(t,{})}function t(){const r=a();return e.jsx(s,{statusHandlers:{404:()=>e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{children:"We can't find this page:"}),e.jsx("pre",{className:"whitespace-pre-wrap break-all text-body-lg",children:r.pathname})]}),e.jsx(n,{to:"/",className:"text-body-md underline",children:e.jsx(o,{name:"ArrowLeft",children:"Back to home"})})]})}})}export{t as ErrorBoundary,m as default};
2
- //# sourceMappingURL=_-BDcQ_M2J.js.map
1
+ import{j as e,u as a}from"./index-CGzylDPY.js";import{G as s}from"./error-boundary-CAu3AmhN.js";import{I as o}from"./misc-CQmANiHr.js";import{L as n}from"./components-DrvY4pal.js";function m(){return e.jsx(t,{})}function t(){const r=a();return e.jsx(s,{statusHandlers:{404:()=>e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("h1",{children:"We can't find this page:"}),e.jsx("pre",{className:"whitespace-pre-wrap break-all text-body-lg",children:r.pathname})]}),e.jsx(n,{to:"/",className:"text-body-md underline",children:e.jsx(o,{name:"ArrowLeft",children:"Back to home"})})]})}})}export{t as ErrorBoundary,m as default};
2
+ //# sourceMappingURL=_-CHaVBRQw.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_-BDcQ_M2J.js","sources":["../../../app/routes/$.tsx"],"sourcesContent":["// This is called a \"splat route\" and as it's in the root `/app/routes/`\n// directory, it's a catchall. If no other routes match, this one will and we\n// can know that the user is hitting a URL that doesn't exist. By throwing a\n// 404 from the loader, we can force the error boundary to render which will\n// ensure the user gets the right status code and we can display a nicer error\n// message for them than the Remix and/or browser default.\n\nimport { type LoaderFunctionArgs } from '@remix-run/node'\nimport { Link, useLocation } from '@remix-run/react'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { Icon } from '#app/components/icons.tsx'\n\nexport async function loader({ params }: LoaderFunctionArgs) {\n\tconst splat = params['*']\n\tconst segments = splat?.split('/') ?? []\n\tif (segments.length > 0 && !isNaN(Number(segments[0]))) {\n\t\tconst newPath = `/exercise/${splat}`\n\t\treturn new Response(null, {\n\t\t\tstatus: 302,\n\t\t\theaders: {\n\t\t\t\tLocation: newPath,\n\t\t\t},\n\t\t})\n\t}\n\n\tthrow new Response('Not found', { status: 404 })\n}\n\nexport default function NotFound() {\n\t// due to the loader, this component will never be rendered, but we'll return\n\t// the error boundary just in case.\n\treturn <ErrorBoundary />\n}\n\nexport function ErrorBoundary() {\n\tconst location = useLocation()\n\treturn (\n\t\t<GeneralErrorBoundary\n\t\t\tstatusHandlers={{\n\t\t\t\t404: () => (\n\t\t\t\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-3\">\n\t\t\t\t\t\t\t<h1>We can't find this page:</h1>\n\t\t\t\t\t\t\t<pre className=\"whitespace-pre-wrap break-all text-body-lg\">\n\t\t\t\t\t\t\t\t{location.pathname}\n\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Link to=\"/\" className=\"text-body-md underline\">\n\t\t\t\t\t\t\t<Icon name=\"ArrowLeft\">Back to home</Icon>\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t</div>\n\t\t\t\t),\n\t\t\t}}\n\t\t/>\n\t)\n}\n"],"names":["NotFound","ErrorBoundary","location","useLocation","jsx","GeneralErrorBoundary","statusHandlers","jsxs","className","children","pathname","Link","to","Icon","name"],"mappings":"oLA4BA,SAAwBA,GAAW,CAGlC,aAAQC,EAAc,CAAA,CAAA,CACvB,CAEO,SAASA,GAAgB,CAC/B,MAAMC,EAAWC,IAEhB,OAAAC,EAAAA,IAACC,EAAA,CACAC,eAAgB,CACf,IAAK,IACHC,EAAA,KAAA,MAAA,CAAIC,UAAU,sBACdC,SAAA,CAACF,EAAA,KAAA,MAAA,CAAIC,UAAU,sBACdC,SAAA,CAAAL,EAAA,IAAC,MAAGK,SAAwB,0BAAA,CAAA,EAC3BL,EAAA,IAAA,MAAA,CAAII,UAAU,6CACbC,WAASC,QACX,CAAA,CAAA,CACD,CAAA,EACAN,EAAA,IAACO,EAAK,CAAAC,GAAG,IAAIJ,UAAU,yBACtBC,SAAAL,EAAA,IAACS,EAAK,CAAAC,KAAK,YAAYL,SAAA,eAAY,CACpC,CAAA,CAAA,EACD,CAEF,CAAA,CACD,CAEF"}
1
+ {"version":3,"file":"_-CHaVBRQw.js","sources":["../../../app/routes/$.tsx"],"sourcesContent":["// This is called a \"splat route\" and as it's in the root `/app/routes/`\n// directory, it's a catchall. If no other routes match, this one will and we\n// can know that the user is hitting a URL that doesn't exist. By throwing a\n// 404 from the loader, we can force the error boundary to render which will\n// ensure the user gets the right status code and we can display a nicer error\n// message for them than the Remix and/or browser default.\n\nimport { type LoaderFunctionArgs } from '@remix-run/node'\nimport { Link, useLocation } from '@remix-run/react'\nimport { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'\nimport { Icon } from '#app/components/icons.tsx'\n\nexport async function loader({ params }: LoaderFunctionArgs) {\n\tconst splat = params['*']\n\tconst segments = splat?.split('/') ?? []\n\tif (segments.length > 0 && !isNaN(Number(segments[0]))) {\n\t\tconst newPath = `/exercise/${splat}`\n\t\treturn new Response(null, {\n\t\t\tstatus: 302,\n\t\t\theaders: {\n\t\t\t\tLocation: newPath,\n\t\t\t},\n\t\t})\n\t}\n\n\tthrow new Response('Not found', { status: 404 })\n}\n\nexport default function NotFound() {\n\t// due to the loader, this component will never be rendered, but we'll return\n\t// the error boundary just in case.\n\treturn <ErrorBoundary />\n}\n\nexport function ErrorBoundary() {\n\tconst location = useLocation()\n\treturn (\n\t\t<GeneralErrorBoundary\n\t\t\tstatusHandlers={{\n\t\t\t\t404: () => (\n\t\t\t\t\t<div className=\"flex flex-col gap-6\">\n\t\t\t\t\t\t<div className=\"flex flex-col gap-3\">\n\t\t\t\t\t\t\t<h1>We can't find this page:</h1>\n\t\t\t\t\t\t\t<pre className=\"whitespace-pre-wrap break-all text-body-lg\">\n\t\t\t\t\t\t\t\t{location.pathname}\n\t\t\t\t\t\t\t</pre>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Link to=\"/\" className=\"text-body-md underline\">\n\t\t\t\t\t\t\t<Icon name=\"ArrowLeft\">Back to home</Icon>\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t</div>\n\t\t\t\t),\n\t\t\t}}\n\t\t/>\n\t)\n}\n"],"names":["NotFound","ErrorBoundary","location","useLocation","jsx","GeneralErrorBoundary","statusHandlers","jsxs","className","children","pathname","Link","to","Icon","name"],"mappings":"oLA4BA,SAAwBA,GAAW,CAGlC,aAAQC,EAAc,CAAA,CAAA,CACvB,CAEO,SAASA,GAAgB,CAC/B,MAAMC,EAAWC,IAEhB,OAAAC,EAAAA,IAACC,EAAA,CACAC,eAAgB,CACf,IAAK,IACHC,EAAA,KAAA,MAAA,CAAIC,UAAU,sBACdC,SAAA,CAACF,EAAA,KAAA,MAAA,CAAIC,UAAU,sBACdC,SAAA,CAAAL,EAAA,IAAC,MAAGK,SAAwB,0BAAA,CAAA,EAC3BL,EAAA,IAAA,MAAA,CAAII,UAAU,6CACbC,WAASC,QACX,CAAA,CAAA,CACD,CAAA,EACAN,EAAA,IAACO,EAAK,CAAAC,GAAG,IAAIJ,UAAU,yBACtBC,SAAAL,EAAA,IAACS,EAAK,CAAAC,KAAK,YAAYL,SAAA,eAAY,CACpC,CAAA,CAAA,EACD,CAEF,CAAA,CACD,CAEF"}
@@ -1,2 +1,2 @@
1
- import{j as r,a as l,i as c}from"./index-CGzylDPY.js";import{E as a}from"./index-egcHQOpF.js";import{E as m}from"./epic-video-DRZssA4U.js";import{u as d}from"./revalidation-ws-CLolY6Iu.js";import{M as x,E as p}from"./mdx-Z4bEoKXn.js";import{P as u}from"./progress-CnHFlUmF.js";import{g as f}from"./misc-BK2EiKtY.js";import{g as h}from"./seo-pBpFCWsy.js";import{u as b,L as j}from"./components-DrvY4pal.js";import"./index-BZWIdOoA.js";import"./tooltip-leWCE50J.js";import"./pe-DXT2FOp1.js";import"./online-CHlOuJG-.js";import"./loading-ClL22bF9.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./progress-bar-Q9l2dtTg.js";const B=({data:e,matches:o})=>{var i;const t=e==null?void 0:e.exercise.exerciseNumber.toString().padStart(2,"0"),s=(i=o.find(n=>n.id==="root"))==null?void 0:i.data;return!e||!s?[{title:"🦉 | Error"}]:h({title:`📝 | ${t}. ${e.exercise.title} | ${s==null?void 0:s.workshopTitle}`,description:`Introduction for ${t}. ${e.exercise.title}`,ogTitle:e.exercise.title,ogDescription:`Introduction for exercise ${Number(t)}`,instructor:s.instructor,requestInfo:s.requestInfo})},g={h1:()=>null};function D(){var t;const e=b();d({watchPaths:[e.exerciseReadme.file]});const o=String(((t=e.firstStep)==null?void 0:t.stepNumber)??"01").padStart(2,"0");return r.jsxs("main",{className:"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3",children:[r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 scrollbar-thin scrollbar-thumb-scrollbar md:px-10 md:py-12 md:pt-16",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-[clamp(3rem,6vw,7.5rem)] font-extrabold leading-none",children:e.exercise.title})}),r.jsx("div",{children:e.exercise.instructionsCode?r.jsx(m,{epicVideoInfosPromise:e.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(x,{code:e.exercise.instructionsCode,components:g})})}):"No instructions yet..."})]},e.articleId),r.jsx(a,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),r.jsx(u,{type:"instructions",exerciseNumber:e.exerciseNumber,className:"h-14 border-t px-6"}),r.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[r.jsx("div",{}),r.jsx(p,{file:e.exerciseReadme.file,relativePath:e.exerciseReadme.relativePath}),r.jsx(j,{to:`${o}/${e.firstType}`,prefetch:"intent",className:"flex h-full items-center justify-center bg-foreground px-7 text-background",children:"Start Learning"})]})]})}function F(){const e=l();return typeof document<"u"&&console.error(e),c(e)?e.status===404?r.jsx("p",{children:"Sorry, we couldn't find that step."}):r.jsxs("p",{children:[e.status," ",e.data]}):r.jsx("p",{children:f(e)})}export{F as ErrorBoundary,D as default,B as meta};
2
- //# sourceMappingURL=_exerciseNumber-CG2AFTtQ.js.map
1
+ import{j as r,a as l,i as c}from"./index-CGzylDPY.js";import{E as a}from"./index-egcHQOpF.js";import{E as m}from"./epic-video-CqPr1EqP.js";import{u as d}from"./revalidation-ws-BoJZTvOQ.js";import{M as x,E as p}from"./mdx-6d6l1jm2.js";import{P as u}from"./progress-DwE8EkAa.js";import{g as f}from"./misc-CQmANiHr.js";import{g as h}from"./seo-pBpFCWsy.js";import{u as b,L as j}from"./components-DrvY4pal.js";import"./index-CMYl882D.js";import"./tooltip-Cd0yJoQb.js";import"./pe-DXT2FOp1.js";import"./online-BsTX44az.js";import"./loading-CPEkK5hO.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./progress-bar-ZCHf2Y4W.js";const B=({data:e,matches:o})=>{var i;const t=e==null?void 0:e.exercise.exerciseNumber.toString().padStart(2,"0"),s=(i=o.find(n=>n.id==="root"))==null?void 0:i.data;return!e||!s?[{title:"🦉 | Error"}]:h({title:`📝 | ${t}. ${e.exercise.title} | ${s==null?void 0:s.workshopTitle}`,description:`Introduction for ${t}. ${e.exercise.title}`,ogTitle:e.exercise.title,ogDescription:`Introduction for exercise ${Number(t)}`,instructor:s.instructor,requestInfo:s.requestInfo})},g={h1:()=>null};function D(){var t;const e=b();d({watchPaths:[e.exerciseReadme.file]});const o=String(((t=e.firstStep)==null?void 0:t.stepNumber)??"01").padStart(2,"0");return r.jsxs("main",{className:"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3",children:[r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 scrollbar-thin scrollbar-thumb-scrollbar md:px-10 md:py-12 md:pt-16",children:[r.jsx("div",{children:r.jsx("h1",{className:"text-[clamp(3rem,6vw,7.5rem)] font-extrabold leading-none",children:e.exercise.title})}),r.jsx("div",{children:e.exercise.instructionsCode?r.jsx(m,{epicVideoInfosPromise:e.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(x,{code:e.exercise.instructionsCode,components:g})})}):"No instructions yet..."})]},e.articleId),r.jsx(a,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),r.jsx(u,{type:"instructions",exerciseNumber:e.exerciseNumber,className:"h-14 border-t px-6"}),r.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[r.jsx("div",{}),r.jsx(p,{file:e.exerciseReadme.file,relativePath:e.exerciseReadme.relativePath}),r.jsx(j,{to:`${o}/${e.firstType}`,prefetch:"intent",className:"flex h-full items-center justify-center bg-foreground px-7 text-background",children:"Start Learning"})]})]})}function F(){const e=l();return typeof document<"u"&&console.error(e),c(e)?e.status===404?r.jsx("p",{children:"Sorry, we couldn't find that step."}):r.jsxs("p",{children:[e.status," ",e.data]}):r.jsx("p",{children:f(e)})}export{F as ErrorBoundary,D as default,B as meta};
2
+ //# sourceMappingURL=_exerciseNumber-CoBfhQjJ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber-CG2AFTtQ.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetExercises,\n\tgetWorkshopRoot,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n\ttime,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n\ttype MetaFunction,\n} from '@remix-run/node'\nimport {\n\tLink,\n\tisRouteErrorResponse,\n\tuseLoaderData,\n\tuseRouteError,\n} from '@remix-run/react'\nimport slugify from '@sindresorhus/slugify'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.js'\nimport { type loader as rootLoader } from '#app/root.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { getErrorMessage } from '#app/utils/misc.tsx'\nimport { getSeoMetaTags } from '#app/utils/seo.js'\n\nexport const meta: MetaFunction<typeof loader, { root: typeof rootLoader }> = ({\n\tdata,\n\tmatches,\n}) => {\n\tconst number = data?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = matches.find((m) => m.id === 'root')?.data\n\tif (!data || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📝 | ${number}. ${data.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Introduction for ${number}. ${data.exercise.title}`,\n\t\togTitle: data.exercise.title,\n\t\togDescription: `Introduction for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('exerciseNumberLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercises = await time(() => getExercises({ request, timings }), {\n\t\ttimings,\n\t\ttype: 'getExercises',\n\t\tdesc: 'getExercises in $exerciseNumber.tsx',\n\t})\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'README.mdx',\n\t)\n\n\tconst firstStep = exercise.steps.find(Boolean)\n\n\tconst articleId = `workshop-${slugify(workshopTitle)}-${\n\t\texercise.exerciseNumber\n\t}-instructions`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\texercise,\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}`,\n\t\t\t},\n\t\t\texerciseTitle: exercise.title,\n\t\t\tfirstStep,\n\t\t\tfirstType: firstStep?.problem ? 'problem' : 'solution',\n\t\t\ttitle: workshopTitle,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.instructionsEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\n// we'll render the title ourselves thank you\nconst mdxComponents = { h1: () => null }\n\nexport default function ExerciseNumberRoute() {\n\tconst data = useLoaderData<typeof loader>()\n\tuseRevalidationWS({\n\t\twatchPaths: [data.exerciseReadme.file],\n\t})\n\n\tconst firstStepNumber = String(data.firstStep?.stepNumber ?? '01').padStart(\n\t\t2,\n\t\t'0',\n\t)\n\treturn (\n\t\t<main className=\"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3\">\n\t\t\t<article\n\t\t\t\tid={data.articleId}\n\t\t\t\tkey={data.articleId}\n\t\t\t\tclassName=\"shadow-on-scrollbox flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 scrollbar-thin scrollbar-thumb-scrollbar md:px-10 md:py-12 md:pt-16\"\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<h1 className=\"text-[clamp(3rem,6vw,7.5rem)] font-extrabold leading-none\">\n\t\t\t\t\t\t{data.exercise.title}\n\t\t\t\t\t</h1>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t{data.exercise.instructionsCode ? (\n\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\tcode={data.exercise.instructionsCode}\n\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t'No instructions yet...'\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</article>\n\t\t\t<ElementScrollRestoration\n\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\tkey={`scroll-${data.articleId}`}\n\t\t\t/>\n\t\t\t<ProgressToggle\n\t\t\t\ttype=\"instructions\"\n\t\t\t\texerciseNumber={data.exerciseNumber}\n\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t/>\n\t\t\t<div className=\"flex h-16 justify-between border-b-4 border-t lg:border-b-0\">\n\t\t\t\t<div />\n\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\tfile={data.exerciseReadme.file}\n\t\t\t\t\trelativePath={data.exerciseReadme.relativePath}\n\t\t\t\t/>\n\t\t\t\t<Link\n\t\t\t\t\tto={`${firstStepNumber}/${data.firstType}`}\n\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\tclassName=\"flex h-full items-center justify-center bg-foreground px-7 text-background\"\n\t\t\t\t>\n\t\t\t\t\tStart Learning\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t</main>\n\t)\n}\n\nexport function ErrorBoundary() {\n\tconst error = useRouteError()\n\n\tif (typeof document !== 'undefined') {\n\t\tconsole.error(error)\n\t}\n\n\treturn isRouteErrorResponse(error) ? (\n\t\terror.status === 404 ? (\n\t\t\t<p>Sorry, we couldn't find that step.</p>\n\t\t) : (\n\t\t\t<p>\n\t\t\t\t{error.status} {error.data}\n\t\t\t</p>\n\t\t)\n\t) : (\n\t\t<p>{getErrorMessage(error)}</p>\n\t)\n}\n"],"names":["meta","data","matches","number","exercise","exerciseNumber","toString","padStart","rootData","find","m","id","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","ExerciseNumberRoute","useLoaderData","useRevalidationWS","watchPaths","exerciseReadme","file","firstStepNumber","String","firstStep","stepNumber","jsxs","className","children","articleId","jsx","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","relativePath","Link","to","firstType","prefetch","ErrorBoundary","error","useRouteError","document","console","isRouteErrorResponse","status","getErrorMessage"],"mappings":"woBAqCO,MAAMA,EAAiEA,CAAC,CAC9EC,KAAAA,EACAC,QAAAA,CACD,IAAM,OACC,MAAAC,EAASF,GAAAA,YAAAA,EAAMG,SAASC,eAAeC,WAAWC,SAAS,EAAG,KAE9DC,GAAWN,EAAAA,EAAQO,KAAMC,GAAMA,EAAEC,KAAO,MAAM,IAAnCT,YAAAA,EAAsCD,KACnD,MAAA,CAACA,GAAQ,CAACO,EAAiB,CAAC,CAAEI,MAAO,YAAa,CAAC,EAEhDC,EAAe,CACrBD,MAAO,QAAQT,CAAM,KAAKF,EAAKG,SAASQ,KAAK,MAAMJ,GAAAA,YAAAA,EAAUM,aAAa,GAC1EC,YAAa,oBAAoBZ,CAAM,KAAKF,EAAKG,SAASQ,KAAK,GAC/DI,QAASf,EAAKG,SAASQ,MACvBK,cAAe,6BAA6BC,OAAOf,CAAM,CAAC,GAC1DgB,WAAYX,EAASW,WACrBC,YAAaZ,EAASY,WACvB,CAAC,CACF,EAkEMC,EAAgB,CAAEC,GAAIA,IAAM,IAAK,EAEvC,SAAwBC,GAAsB,OAC7C,MAAMtB,EAAOuB,IACKC,EAAA,CACjBC,WAAY,CAACzB,EAAK0B,eAAeC,IAAI,CACtC,CAAC,EAED,MAAMC,EAAkBC,SAAO7B,EAAAA,EAAK8B,YAAL9B,YAAAA,EAAgB+B,aAAc,IAAI,EAAEzB,SAClE,EACA,GACD,EAEC,OAAA0B,EAAAA,KAAC,OAAK,CAAAC,UAAU,4FACfC,SAAA,CAAAF,EAAA,KAAC,UAAA,CACAtB,GAAIV,EAAKmC,UAETF,UAAU,8JAEVC,SAAA,CAACE,EAAA,IAAA,MAAA,CACAF,eAAC,KAAG,CAAAD,UAAU,4DACZC,SAAAlC,EAAKG,SAASQ,MAChB,CACD,CAAA,EACCyB,EAAA,IAAA,MAAA,CACCF,SAAAlC,EAAKG,SAASkC,iBACdD,EAAAA,IAACE,EAAA,CACAC,sBAAuBvC,EAAKuC,sBAE5BL,SAAAE,EAAA,IAAC,MAAI,CAAAH,UAAU,sCACdC,SAAAE,EAAA,IAACI,EAAA,CACAC,KAAMzC,EAAKG,SAASkC,iBACpBK,WAAYtB,EACb,EACD,CACD,CAAA,EAEA,wBAEF,CAAA,CAAA,CAAA,EAvBKpB,EAAKmC,SAwBX,EACAC,EAAAA,IAACO,EAAA,CACAC,aAAc,IAAI5C,EAAKmC,SAAS,EAAA,EAC3B,UAAUnC,EAAKmC,SAAS,EAC9B,EACAC,EAAA,IAACS,EAAA,CACAC,KAAK,eACL1C,eAAgBJ,EAAKI,eACrB6B,UAAU,oBAAA,CACX,EACAD,EAAA,KAAC,MAAI,CAAAC,UAAU,8DACdC,SAAA,CAAAE,EAAAA,IAAC,MAAI,CAAA,CAAA,EACLA,EAAA,IAACW,EAAA,CACApB,KAAM3B,EAAK0B,eAAeC,KAC1BqB,aAAchD,EAAK0B,eAAesB,YAAA,CACnC,EACAZ,EAAA,IAACa,EAAA,CACAC,GAAI,GAAGtB,CAAe,IAAI5B,EAAKmD,SAAS,GACxCC,SAAS,SACTnB,UAAU,6EACVC,SAAA,gBAAA,CAED,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CAEF,CAEO,SAASmB,GAAgB,CAC/B,MAAMC,EAAQC,IAEV,OAAA,OAAOC,SAAa,KACvBC,QAAQH,MAAMA,CAAK,EAGbI,EAAqBJ,CAAK,EAChCA,EAAMK,SAAW,IAChBvB,EAAA,IAAC,IAAE,CAAAF,SAAA,oCAAA,CAAkC,EAErCF,EAAA,KAAC,IACC,CAAAE,SAAA,CAAMoB,EAAAK,OAAO,IAAEL,EAAMtD,IAAA,CAAA,CACvB,EAGDoC,EAAA,IAAC,IAAG,CAAAF,SAAA0B,EAAgBN,CAAK,CAAE,CAAA,CAE7B"}
1
+ {"version":3,"file":"_exerciseNumber-CoBfhQjJ.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetExercises,\n\tgetWorkshopRoot,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n\ttime,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n\ttype MetaFunction,\n} from '@remix-run/node'\nimport {\n\tLink,\n\tisRouteErrorResponse,\n\tuseLoaderData,\n\tuseRouteError,\n} from '@remix-run/react'\nimport slugify from '@sindresorhus/slugify'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.js'\nimport { type loader as rootLoader } from '#app/root.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { getErrorMessage } from '#app/utils/misc.tsx'\nimport { getSeoMetaTags } from '#app/utils/seo.js'\n\nexport const meta: MetaFunction<typeof loader, { root: typeof rootLoader }> = ({\n\tdata,\n\tmatches,\n}) => {\n\tconst number = data?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = matches.find((m) => m.id === 'root')?.data\n\tif (!data || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `📝 | ${number}. ${data.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Introduction for ${number}. ${data.exercise.title}`,\n\t\togTitle: data.exercise.title,\n\t\togDescription: `Introduction for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('exerciseNumberLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercises = await time(() => getExercises({ request, timings }), {\n\t\ttimings,\n\t\ttype: 'getExercises',\n\t\tdesc: 'getExercises in $exerciseNumber.tsx',\n\t})\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\n\tconst readmeFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'README.mdx',\n\t)\n\n\tconst firstStep = exercise.steps.find(Boolean)\n\n\tconst articleId = `workshop-${slugify(workshopTitle)}-${\n\t\texercise.exerciseNumber\n\t}-instructions`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\texercise,\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseReadme: {\n\t\t\t\tfile: readmeFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}`,\n\t\t\t},\n\t\t\texerciseTitle: exercise.title,\n\t\t\tfirstStep,\n\t\t\tfirstType: firstStep?.problem ? 'problem' : 'solution',\n\t\t\ttitle: workshopTitle,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.instructionsEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\n// we'll render the title ourselves thank you\nconst mdxComponents = { h1: () => null }\n\nexport default function ExerciseNumberRoute() {\n\tconst data = useLoaderData<typeof loader>()\n\tuseRevalidationWS({\n\t\twatchPaths: [data.exerciseReadme.file],\n\t})\n\n\tconst firstStepNumber = String(data.firstStep?.stepNumber ?? '01').padStart(\n\t\t2,\n\t\t'0',\n\t)\n\treturn (\n\t\t<main className=\"relative flex h-full w-full max-w-5xl flex-col justify-between border-r md:w-3/4 xl:w-2/3\">\n\t\t\t<article\n\t\t\t\tid={data.articleId}\n\t\t\t\tkey={data.articleId}\n\t\t\t\tclassName=\"shadow-on-scrollbox flex w-full flex-1 flex-col gap-12 overflow-y-scroll px-3 py-4 pt-6 scrollbar-thin scrollbar-thumb-scrollbar md:px-10 md:py-12 md:pt-16\"\n\t\t\t>\n\t\t\t\t<div>\n\t\t\t\t\t<h1 className=\"text-[clamp(3rem,6vw,7.5rem)] font-extrabold leading-none\">\n\t\t\t\t\t\t{data.exercise.title}\n\t\t\t\t\t</h1>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t{data.exercise.instructionsCode ? (\n\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\tcode={data.exercise.instructionsCode}\n\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t'No instructions yet...'\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</article>\n\t\t\t<ElementScrollRestoration\n\t\t\t\telementQuery={`#${data.articleId}`}\n\t\t\t\tkey={`scroll-${data.articleId}`}\n\t\t\t/>\n\t\t\t<ProgressToggle\n\t\t\t\ttype=\"instructions\"\n\t\t\t\texerciseNumber={data.exerciseNumber}\n\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t/>\n\t\t\t<div className=\"flex h-16 justify-between border-b-4 border-t lg:border-b-0\">\n\t\t\t\t<div />\n\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\tfile={data.exerciseReadme.file}\n\t\t\t\t\trelativePath={data.exerciseReadme.relativePath}\n\t\t\t\t/>\n\t\t\t\t<Link\n\t\t\t\t\tto={`${firstStepNumber}/${data.firstType}`}\n\t\t\t\t\tprefetch=\"intent\"\n\t\t\t\t\tclassName=\"flex h-full items-center justify-center bg-foreground px-7 text-background\"\n\t\t\t\t>\n\t\t\t\t\tStart Learning\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t</main>\n\t)\n}\n\nexport function ErrorBoundary() {\n\tconst error = useRouteError()\n\n\tif (typeof document !== 'undefined') {\n\t\tconsole.error(error)\n\t}\n\n\treturn isRouteErrorResponse(error) ? (\n\t\terror.status === 404 ? (\n\t\t\t<p>Sorry, we couldn't find that step.</p>\n\t\t) : (\n\t\t\t<p>\n\t\t\t\t{error.status} {error.data}\n\t\t\t</p>\n\t\t)\n\t) : (\n\t\t<p>{getErrorMessage(error)}</p>\n\t)\n}\n"],"names":["meta","data","matches","number","exercise","exerciseNumber","toString","padStart","rootData","find","m","id","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","ExerciseNumberRoute","useLoaderData","useRevalidationWS","watchPaths","exerciseReadme","file","firstStepNumber","String","firstStep","stepNumber","jsxs","className","children","articleId","jsx","instructionsCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","relativePath","Link","to","firstType","prefetch","ErrorBoundary","error","useRouteError","document","console","isRouteErrorResponse","status","getErrorMessage"],"mappings":"woBAqCO,MAAMA,EAAiEA,CAAC,CAC9EC,KAAAA,EACAC,QAAAA,CACD,IAAM,OACC,MAAAC,EAASF,GAAAA,YAAAA,EAAMG,SAASC,eAAeC,WAAWC,SAAS,EAAG,KAE9DC,GAAWN,EAAAA,EAAQO,KAAMC,GAAMA,EAAEC,KAAO,MAAM,IAAnCT,YAAAA,EAAsCD,KACnD,MAAA,CAACA,GAAQ,CAACO,EAAiB,CAAC,CAAEI,MAAO,YAAa,CAAC,EAEhDC,EAAe,CACrBD,MAAO,QAAQT,CAAM,KAAKF,EAAKG,SAASQ,KAAK,MAAMJ,GAAAA,YAAAA,EAAUM,aAAa,GAC1EC,YAAa,oBAAoBZ,CAAM,KAAKF,EAAKG,SAASQ,KAAK,GAC/DI,QAASf,EAAKG,SAASQ,MACvBK,cAAe,6BAA6BC,OAAOf,CAAM,CAAC,GAC1DgB,WAAYX,EAASW,WACrBC,YAAaZ,EAASY,WACvB,CAAC,CACF,EAkEMC,EAAgB,CAAEC,GAAIA,IAAM,IAAK,EAEvC,SAAwBC,GAAsB,OAC7C,MAAMtB,EAAOuB,IACKC,EAAA,CACjBC,WAAY,CAACzB,EAAK0B,eAAeC,IAAI,CACtC,CAAC,EAED,MAAMC,EAAkBC,SAAO7B,EAAAA,EAAK8B,YAAL9B,YAAAA,EAAgB+B,aAAc,IAAI,EAAEzB,SAClE,EACA,GACD,EAEC,OAAA0B,EAAAA,KAAC,OAAK,CAAAC,UAAU,4FACfC,SAAA,CAAAF,EAAA,KAAC,UAAA,CACAtB,GAAIV,EAAKmC,UAETF,UAAU,8JAEVC,SAAA,CAACE,EAAA,IAAA,MAAA,CACAF,eAAC,KAAG,CAAAD,UAAU,4DACZC,SAAAlC,EAAKG,SAASQ,MAChB,CACD,CAAA,EACCyB,EAAA,IAAA,MAAA,CACCF,SAAAlC,EAAKG,SAASkC,iBACdD,EAAAA,IAACE,EAAA,CACAC,sBAAuBvC,EAAKuC,sBAE5BL,SAAAE,EAAA,IAAC,MAAI,CAAAH,UAAU,sCACdC,SAAAE,EAAA,IAACI,EAAA,CACAC,KAAMzC,EAAKG,SAASkC,iBACpBK,WAAYtB,EACb,EACD,CACD,CAAA,EAEA,wBAEF,CAAA,CAAA,CAAA,EAvBKpB,EAAKmC,SAwBX,EACAC,EAAAA,IAACO,EAAA,CACAC,aAAc,IAAI5C,EAAKmC,SAAS,EAAA,EAC3B,UAAUnC,EAAKmC,SAAS,EAC9B,EACAC,EAAA,IAACS,EAAA,CACAC,KAAK,eACL1C,eAAgBJ,EAAKI,eACrB6B,UAAU,oBAAA,CACX,EACAD,EAAA,KAAC,MAAI,CAAAC,UAAU,8DACdC,SAAA,CAAAE,EAAAA,IAAC,MAAI,CAAA,CAAA,EACLA,EAAA,IAACW,EAAA,CACApB,KAAM3B,EAAK0B,eAAeC,KAC1BqB,aAAchD,EAAK0B,eAAesB,YAAA,CACnC,EACAZ,EAAA,IAACa,EAAA,CACAC,GAAI,GAAGtB,CAAe,IAAI5B,EAAKmD,SAAS,GACxCC,SAAS,SACTnB,UAAU,6EACVC,SAAA,gBAAA,CAED,CAAA,CACD,CAAA,CAAA,CACD,CAAA,CAEF,CAEO,SAASmB,GAAgB,CAC/B,MAAMC,EAAQC,IAEV,OAAA,OAAOC,SAAa,KACvBC,QAAQH,MAAMA,CAAK,EAGbI,EAAqBJ,CAAK,EAChCA,EAAMK,SAAW,IAChBvB,EAAA,IAAC,IAAE,CAAAF,SAAA,oCAAA,CAAkC,EAErCF,EAAA,KAAC,IACC,CAAAE,SAAA,CAAMoB,EAAAK,OAAO,IAAEL,EAAMtD,IAAA,CAAA,CACvB,EAGDoC,EAAA,IAAC,IAAG,CAAAF,SAAA0B,EAAgBN,CAAK,CAAE,CAAA,CAE7B"}
@@ -1,2 +1,2 @@
1
- import{j as t,O as e,a as o,i as s}from"./index-CGzylDPY.js";import{g as n}from"./misc-BK2EiKtY.js";import"./components-DrvY4pal.js";function p(){return t.jsx(e,{})}function d(){const r=o();return typeof document<"u"&&console.error(r),s(r)?r.status===404?t.jsx("p",{children:"Sorry, we couldn't find that step."}):t.jsxs("p",{children:[r.status," ",r.data]}):t.jsx("p",{children:n(r)})}export{d as ErrorBoundary,p as default};
2
- //# sourceMappingURL=_exerciseNumber_._stepNumber-COWC332q.js.map
1
+ import{j as t,O as e,a as o,i as s}from"./index-CGzylDPY.js";import{g as n}from"./misc-CQmANiHr.js";import"./components-DrvY4pal.js";function p(){return t.jsx(e,{})}function d(){const r=o();return typeof document<"u"&&console.error(r),s(r)?r.status===404?t.jsx("p",{children:"Sorry, we couldn't find that step."}):t.jsxs("p",{children:[r.status," ",r.data]}):t.jsx("p",{children:n(r)})}export{d as ErrorBoundary,p as default};
2
+ //# sourceMappingURL=_exerciseNumber_._stepNumber-D5VDI7vZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber_._stepNumber-COWC332q.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.tsx"],"sourcesContent":["import { invariantResponse } from '@epic-web/invariant'\nimport { getExercises } from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n} from '@remix-run/node'\nimport { Outlet, isRouteErrorResponse, useRouteError } from '@remix-run/react'\nimport { getErrorMessage } from '#app/utils/misc.tsx'\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('stepLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercises = await getExercises({ request, timings })\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\n\tconst result = data(\n\t\t{\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseTitle: exercise.title,\n\t\t\ttitle: workshopTitle,\n\t\t\texercises: exercises.map((e) => ({\n\t\t\t\texerciseNumber: e.exerciseNumber,\n\t\t\t\ttitle: e.title,\n\t\t\t})),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n\treturn result\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nexport default function StepRoute() {\n\treturn <Outlet />\n}\n\nexport function ErrorBoundary() {\n\tconst error = useRouteError()\n\n\tif (typeof document !== 'undefined') {\n\t\tconsole.error(error)\n\t}\n\n\treturn isRouteErrorResponse(error) ? (\n\t\terror.status === 404 ? (\n\t\t\t<p>Sorry, we couldn't find that step.</p>\n\t\t) : (\n\t\t\t<p>\n\t\t\t\t{error.status} {error.data}\n\t\t\t</p>\n\t\t)\n\t) : (\n\t\t<p>{getErrorMessage(error)}</p>\n\t)\n}\n"],"names":["StepRoute","Outlet","ErrorBoundary","error","useRouteError","document","console","isRouteErrorResponse","status","jsx","children","jsxs","data","getErrorMessage"],"mappings":"qIAuDA,SAAwBA,GAAY,CACnC,aAAQC,EAAO,CAAA,CAAA,CAChB,CAEO,SAASC,GAAgB,CAC/B,MAAMC,EAAQC,IAEV,OAAA,OAAOC,SAAa,KACvBC,QAAQH,MAAMA,CAAK,EAGbI,EAAqBJ,CAAK,EAChCA,EAAMK,SAAW,IAChBC,EAAA,IAAC,IAAE,CAAAC,SAAA,oCAAA,CAAkC,EAErCC,EAAA,KAAC,IACC,CAAAD,SAAA,CAAMP,EAAAK,OAAO,IAAEL,EAAMS,IAAA,CAAA,CACvB,EAGDH,EAAA,IAAC,IAAG,CAAAC,SAAAG,EAAgBV,CAAK,CAAE,CAAA,CAE7B"}
1
+ {"version":3,"file":"_exerciseNumber_._stepNumber-D5VDI7vZ.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.$stepNumber.tsx"],"sourcesContent":["import { invariantResponse } from '@epic-web/invariant'\nimport { getExercises } from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n} from '@remix-run/node'\nimport { Outlet, isRouteErrorResponse, useRouteError } from '@remix-run/react'\nimport { getErrorMessage } from '#app/utils/misc.tsx'\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('stepLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercises = await getExercises({ request, timings })\n\tconst { title: workshopTitle } = getWorkshopConfig()\n\tconst exercise = exercises.find(\n\t\t(e) => e.exerciseNumber === Number(params.exerciseNumber),\n\t)\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\n\tconst result = data(\n\t\t{\n\t\t\texerciseNumber: exercise.exerciseNumber,\n\t\t\texerciseTitle: exercise.title,\n\t\t\ttitle: workshopTitle,\n\t\t\texercises: exercises.map((e) => ({\n\t\t\t\texerciseNumber: e.exerciseNumber,\n\t\t\t\ttitle: e.title,\n\t\t\t})),\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n\treturn result\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nexport default function StepRoute() {\n\treturn <Outlet />\n}\n\nexport function ErrorBoundary() {\n\tconst error = useRouteError()\n\n\tif (typeof document !== 'undefined') {\n\t\tconsole.error(error)\n\t}\n\n\treturn isRouteErrorResponse(error) ? (\n\t\terror.status === 404 ? (\n\t\t\t<p>Sorry, we couldn't find that step.</p>\n\t\t) : (\n\t\t\t<p>\n\t\t\t\t{error.status} {error.data}\n\t\t\t</p>\n\t\t)\n\t) : (\n\t\t<p>{getErrorMessage(error)}</p>\n\t)\n}\n"],"names":["StepRoute","Outlet","ErrorBoundary","error","useRouteError","document","console","isRouteErrorResponse","status","jsx","children","jsxs","data","getErrorMessage"],"mappings":"qIAuDA,SAAwBA,GAAY,CACnC,aAAQC,EAAO,CAAA,CAAA,CAChB,CAEO,SAASC,GAAgB,CAC/B,MAAMC,EAAQC,IAEV,OAAA,OAAOC,SAAa,KACvBC,QAAQH,MAAMA,CAAK,EAGbI,EAAqBJ,CAAK,EAChCA,EAAMK,SAAW,IAChBC,EAAA,IAAC,IAAE,CAAAC,SAAA,oCAAA,CAAkC,EAErCC,EAAA,KAAC,IACC,CAAAD,SAAA,CAAMP,EAAAK,OAAO,IAAEL,EAAMS,IAAA,CAAA,CACvB,EAGDH,EAAA,IAAC,IAAG,CAAAC,SAAAG,EAAgBV,CAAK,CAAE,CAAA,CAE7B"}
@@ -1,2 +1,2 @@
1
- import{j as e,r as n}from"./index-CGzylDPY.js";import{E as a}from"./index-egcHQOpF.js";import{E as c}from"./epic-video-DRZssA4U.js";import{I as m,a as d}from"./misc-BK2EiKtY.js";import{L as x}from"./loading-ClL22bF9.js";import{N as f}from"./nav-chevrons-DVD_0i2a.js";import{u as h}from"./revalidation-ws-CLolY6Iu.js";import{M as u,E as p}from"./mdx-Z4bEoKXn.js";import{P as j}from"./progress-CnHFlUmF.js";import{u as b}from"./index-BZWIdOoA.js";import{u as g}from"./online-CHlOuJG-.js";import{g as N}from"./seo-pBpFCWsy.js";import{u as v,L as E}from"./components-DrvY4pal.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./progress-bar-Q9l2dtTg.js";import"./pe-DXT2FOp1.js";import"./tooltip-leWCE50J.js";const W=({data:s,matches:i})=>{var o;const t=s==null?void 0:s.exercise.exerciseNumber.toString().padStart(2,"0"),r=(o=i.find(l=>l.id==="root"))==null?void 0:o.data;return!s||!r?[{title:"🦉 | Error"}]:N({title:`🦉 | ${t}. ${s.exercise.title} | ${r==null?void 0:r.workshopTitle}`,description:`Elaboration for ${t}. ${s.exercise.title}`,ogTitle:`Finished: ${s.exercise.title}`,ogDescription:`Elaboration for exercise ${Number(t)}`,instructor:r.instructor,requestInfo:r.requestInfo})},w={h1:()=>null};function G(){const s=v(),i=s.exercise.exerciseNumber.toString().padStart(2,"0");return h({watchPaths:[`./exercises/${i}/FINISHED.mdx`]}),e.jsx("div",{className:"flex max-w-full flex-grow flex-col",children:e.jsxs("main",{className:"flex flex-grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1",children:[e.jsxs("div",{className:"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r",children:[e.jsx("h1",{className:"h-14 border-b pl-10 pr-5 text-sm font-medium leading-tight",children:e.jsx("div",{className:"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2",children:e.jsxs("div",{className:"flex items-center justify-start gap-x-2",children:[e.jsx(E,{to:`/${i}`,className:"hover:underline",children:`${i}. ${s.exercise.title}`}),e.jsx("span",{children:"/"}),e.jsx("span",{children:"Elaboration"})]})})}),e.jsx("article",{className:"shadow-on-scrollbox h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8",id:s.articleId,children:s.exercise.finishedCode?e.jsx(c,{epicVideoInfosPromise:s.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(u,{code:s.exercise.finishedCode,components:w})})}):"No finished instructions yet..."}),e.jsx(a,{elementQuery:`#${s.articleId}`}),e.jsx(j,{type:"finished",exerciseNumber:s.exercise.exerciseNumber,className:"h-14 border-t px-6"}),e.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[e.jsx("div",{}),e.jsx(p,{file:s.exerciseFinished.file,relativePath:s.exerciseFinished.relativePath}),e.jsx(f,{prev:s.prevStepLink,next:s.nextStepLink})]})]}),e.jsx(y,{exerciseFormEmbedUrl:s.exerciseFormEmbedUrl,exerciseTitle:s.exercise.title})]})})}function y({exerciseFormEmbedUrl:s,exerciseTitle:i}){const t=b(),[r,o]=n.useState(!1);return g()?e.jsxs("div",{className:"relative min-h-full sm:min-h-[unset] sm:flex-shrink-0",children:[r?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(x,{children:e.jsxs("span",{children:["Loading ",i," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>o(!0),onError:()=>o(!0),title:"Elaboration",src:s,className:d("absolute inset-0 flex h-full w-full transition-opacity duration-300",r?"opacity-100":"opacity-0"),style:{colorScheme:t}})]}):e.jsx("div",{className:"relative flex-shrink-0",children:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center text-body-md text-foreground-destructive",children:e.jsx(m,{name:"WifiNoConnection",size:"xl",children:e.jsxs("span",{children:["Unable to load the ",e.jsx("a",{href:s,className:"underline",children:`${i} feedback form`})," when offline"]})})})})}export{G as default,W as meta};
2
- //# sourceMappingURL=_exerciseNumber_.finished-BgGBYU74.js.map
1
+ import{j as e,r as n}from"./index-CGzylDPY.js";import{E as a}from"./index-egcHQOpF.js";import{E as c}from"./epic-video-CqPr1EqP.js";import{I as m,a as d}from"./misc-CQmANiHr.js";import{L as x}from"./loading-CPEkK5hO.js";import{N as f}from"./nav-chevrons-DCuva9-Q.js";import{u as h}from"./revalidation-ws-BoJZTvOQ.js";import{M as u,E as p}from"./mdx-6d6l1jm2.js";import{P as j}from"./progress-DwE8EkAa.js";import{u as b}from"./index-CMYl882D.js";import{u as g}from"./online-BsTX44az.js";import{g as N}from"./seo-pBpFCWsy.js";import{u as v,L as E}from"./components-DrvY4pal.js";import"./user-C0j04V55.js";import"./workshop-config-oL_FWDKq.js";import"./progress-bar-ZCHf2Y4W.js";import"./pe-DXT2FOp1.js";import"./tooltip-Cd0yJoQb.js";const W=({data:s,matches:i})=>{var o;const t=s==null?void 0:s.exercise.exerciseNumber.toString().padStart(2,"0"),r=(o=i.find(l=>l.id==="root"))==null?void 0:o.data;return!s||!r?[{title:"🦉 | Error"}]:N({title:`🦉 | ${t}. ${s.exercise.title} | ${r==null?void 0:r.workshopTitle}`,description:`Elaboration for ${t}. ${s.exercise.title}`,ogTitle:`Finished: ${s.exercise.title}`,ogDescription:`Elaboration for exercise ${Number(t)}`,instructor:r.instructor,requestInfo:r.requestInfo})},w={h1:()=>null};function G(){const s=v(),i=s.exercise.exerciseNumber.toString().padStart(2,"0");return h({watchPaths:[`./exercises/${i}/FINISHED.mdx`]}),e.jsx("div",{className:"flex max-w-full flex-grow flex-col",children:e.jsxs("main",{className:"flex flex-grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1",children:[e.jsxs("div",{className:"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r",children:[e.jsx("h1",{className:"h-14 border-b pl-10 pr-5 text-sm font-medium leading-tight",children:e.jsx("div",{className:"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2",children:e.jsxs("div",{className:"flex items-center justify-start gap-x-2",children:[e.jsx(E,{to:`/${i}`,className:"hover:underline",children:`${i}. ${s.exercise.title}`}),e.jsx("span",{children:"/"}),e.jsx("span",{children:"Elaboration"})]})})}),e.jsx("article",{className:"shadow-on-scrollbox h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8",id:s.articleId,children:s.exercise.finishedCode?e.jsx(c,{epicVideoInfosPromise:s.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(u,{code:s.exercise.finishedCode,components:w})})}):"No finished instructions yet..."}),e.jsx(a,{elementQuery:`#${s.articleId}`}),e.jsx(j,{type:"finished",exerciseNumber:s.exercise.exerciseNumber,className:"h-14 border-t px-6"}),e.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[e.jsx("div",{}),e.jsx(p,{file:s.exerciseFinished.file,relativePath:s.exerciseFinished.relativePath}),e.jsx(f,{prev:s.prevStepLink,next:s.nextStepLink})]})]}),e.jsx(y,{exerciseFormEmbedUrl:s.exerciseFormEmbedUrl,exerciseTitle:s.exercise.title})]})})}function y({exerciseFormEmbedUrl:s,exerciseTitle:i}){const t=b(),[r,o]=n.useState(!1);return g()?e.jsxs("div",{className:"relative min-h-full sm:min-h-[unset] sm:flex-shrink-0",children:[r?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(x,{children:e.jsxs("span",{children:["Loading ",i," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>o(!0),onError:()=>o(!0),title:"Elaboration",src:s,className:d("absolute inset-0 flex h-full w-full transition-opacity duration-300",r?"opacity-100":"opacity-0"),style:{colorScheme:t}})]}):e.jsx("div",{className:"relative flex-shrink-0",children:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center text-body-md text-foreground-destructive",children:e.jsx(m,{name:"WifiNoConnection",size:"xl",children:e.jsxs("span",{children:["Unable to load the ",e.jsx("a",{href:s,className:"underline",children:`${i} feedback form`})," when offline"]})})})})}export{G as default,W as meta};
2
+ //# sourceMappingURL=_exerciseNumber_.finished-Y4uCc3KH.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_exerciseNumber_.finished-BgGBYU74.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.finished.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppPageRoute,\n\tgetApps,\n\tgetExercise,\n\tgetWorkshopRoot,\n\tisExerciseStepApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n\ttype MetaFunction,\n} from '@remix-run/node'\nimport { Link, useLoaderData } from '@remix-run/react'\nimport slugify from '@sindresorhus/slugify'\nimport * as React from 'react'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.js'\nimport { type loader as rootLoader } from '#app/root.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { useTheme } from '#app/routes/theme/index.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { useIsOnline } from '#app/utils/online.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.js'\n\nexport const meta: MetaFunction<typeof loader, { root: typeof rootLoader }> = ({\n\tdata,\n\tmatches,\n}) => {\n\tconst number = data?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = matches.find((m) => m.id === 'root')?.data\n\tif (!data || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `🦉 | ${number}. ${data.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Elaboration for ${number}. ${data.exercise.title}`,\n\t\togTitle: `Finished: ${data.exercise.title}`,\n\t\togDescription: `Elaboration for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('exerciseFinishedLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercise = await getExercise(params.exerciseNumber, {\n\t\ttimings,\n\t\trequest,\n\t})\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\tconst workshopConfig = getWorkshopConfig()\n\tconst exerciseFormTemplate = workshopConfig.forms.exercise\n\tconst exerciseFormEmbedUrl = exerciseFormTemplate\n\t\t.replace('{workshopTitle}', encodeURIComponent(workshopConfig.title))\n\t\t.replace('{exerciseTitle}', encodeURIComponent(exercise.title))\n\tconst nextExercise = await getExercise(exercise.exerciseNumber + 1, {\n\t\ttimings,\n\t\trequest,\n\t})\n\n\tconst finishedFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'FINISHED.mdx',\n\t)\n\n\tconst apps = await getApps({ request, timings })\n\tconst exerciseApps = apps\n\t\t.filter(isExerciseStepApp)\n\t\t.filter((app) => app.exerciseNumber === exercise.exerciseNumber)\n\tconst prevApp = exerciseApps[exerciseApps.length - 1]\n\n\tconst articleId = `workshop-${slugify(workshopConfig.title)}-${\n\t\texercise.exerciseNumber\n\t}-finished`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\tworkshopTitle: workshopConfig.title,\n\t\t\texercise,\n\t\t\texerciseFormEmbedUrl,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.finishedEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t\texerciseFinished: {\n\t\t\t\tfile: finishedFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/FINISHED.mdx`,\n\t\t\t},\n\t\t\tprevStepLink: prevApp\n\t\t\t\t? {\n\t\t\t\t\t\tto: getAppPageRoute(prevApp),\n\t\t\t\t\t\t'aria-label': `${prevApp.title} (${prevApp.type})`,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t\tnextStepLink: nextExercise\n\t\t\t\t? {\n\t\t\t\t\t\tto: `/exercise/${nextExercise.exerciseNumber.toString().padStart(2, '0')}`,\n\t\t\t\t\t\t'aria-label': `${nextExercise.title}`,\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tto: '/finished',\n\t\t\t\t\t\t'aria-label': 'Finished! 🎉',\n\t\t\t\t\t},\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst mdxComponents = { h1: () => null }\nexport default function ExerciseFinished() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst exerciseNumber = data.exercise.exerciseNumber\n\t\t.toString()\n\t\t.padStart(2, '0')\n\n\tuseRevalidationWS({\n\t\twatchPaths: [`./exercises/${exerciseNumber}/FINISHED.mdx`],\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full flex-grow flex-col\">\n\t\t\t<main className=\"flex flex-grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1\">\n\t\t\t\t<div className=\"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r\">\n\t\t\t\t\t<h1 className=\"h-14 border-b pl-10 pr-5 text-sm font-medium leading-tight\">\n\t\t\t\t\t\t<div className=\"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2\">\n\t\t\t\t\t\t\t\t<Link to={`/${exerciseNumber}`} className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t{`${exerciseNumber}. ${data.exercise.title}`}\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<span>Elaboration</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\n\t\t\t\t\t<article\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8\"\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.exercise.finishedCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.exercise.finishedCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t// TODO: render a random dad joke...\n\t\t\t\t\t\t\t'No finished instructions yet...'\n\t\t\t\t\t\t)}\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration elementQuery={`#${data.articleId}`} />\n\t\t\t\t\t<ProgressToggle\n\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\texerciseNumber={data.exercise.exerciseNumber}\n\t\t\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"flex h-16 justify-between border-b-4 border-t lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tfile={data.exerciseFinished.file}\n\t\t\t\t\t\t\trelativePath={data.exerciseFinished.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={data.prevStepLink} next={data.nextStepLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<Survey\n\t\t\t\t\texerciseFormEmbedUrl={data.exerciseFormEmbedUrl}\n\t\t\t\t\texerciseTitle={data.exercise.title}\n\t\t\t\t/>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nfunction Survey({\n\texerciseFormEmbedUrl,\n\texerciseTitle,\n}: {\n\texerciseFormEmbedUrl: string\n\texerciseTitle: string\n}) {\n\tconst theme = useTheme()\n\tconst [iframeLoaded, setIframeLoaded] = React.useState(false)\n\tconst isOnline = useIsOnline()\n\tif (!isOnline) {\n\t\treturn (\n\t\t\t<div className=\"relative flex-shrink-0\">\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center text-body-md text-foreground-destructive\">\n\t\t\t\t\t<Icon name=\"WifiNoConnection\" size=\"xl\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{'Unable to load the '}\n\t\t\t\t\t\t\t<a href={exerciseFormEmbedUrl} className=\"underline\">\n\t\t\t\t\t\t\t\t{`${exerciseTitle} feedback form`}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{' when offline'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Icon>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\treturn (\n\t\t<div className=\"relative min-h-full sm:min-h-[unset] sm:flex-shrink-0\">\n\t\t\t{!iframeLoaded ? (\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Loading>\n\t\t\t\t\t\t<span>Loading {exerciseTitle} Elaboration form</span>\n\t\t\t\t\t</Loading>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<iframe\n\t\t\t\tonLoad={() => setIframeLoaded(true)}\n\t\t\t\t// show what would have shown if there is an error\n\t\t\t\tonError={() => setIframeLoaded(true)}\n\t\t\t\ttitle=\"Elaboration\"\n\t\t\t\tsrc={exerciseFormEmbedUrl}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute inset-0 flex h-full w-full transition-opacity duration-300',\n\t\t\t\t\tiframeLoaded ? 'opacity-100' : 'opacity-0',\n\t\t\t\t)}\n\t\t\t\tstyle={{ colorScheme: theme }}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n"],"names":["meta","data","matches","number","exercise","exerciseNumber","toString","padStart","rootData","find","m","id","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","ExerciseFinished","useLoaderData","useRevalidationWS","watchPaths","className","children","jsxs","jsx","Link","to","articleId","finishedCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","file","exerciseFinished","relativePath","NavChevrons","prev","prevStepLink","next","nextStepLink","Survey","exerciseFormEmbedUrl","exerciseTitle","theme","useTheme","iframeLoaded","setIframeLoaded","React","useIsOnline","Loading","onLoad","onError","src","cn","style","colorScheme","Icon","name","size","href"],"mappings":"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"}
1
+ {"version":3,"file":"_exerciseNumber_.finished-Y4uCc3KH.js","sources":["../../../app/routes/_app+/exercise+/$exerciseNumber_.finished.tsx"],"sourcesContent":["import path from 'path'\nimport { invariantResponse } from '@epic-web/invariant'\nimport { ElementScrollRestoration } from '@epic-web/restore-scroll'\nimport {\n\tgetAppPageRoute,\n\tgetApps,\n\tgetExercise,\n\tgetWorkshopRoot,\n\tisExerciseStepApp,\n} from '@epic-web/workshop-utils/apps.server'\nimport { getWorkshopConfig } from '@epic-web/workshop-utils/config.server'\nimport { getEpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport {\n\tcombineServerTimings,\n\tgetServerTimeHeader,\n\tmakeTimings,\n} from '@epic-web/workshop-utils/timing.server'\nimport {\n\tunstable_data as data,\n\ttype HeadersFunction,\n\ttype LoaderFunctionArgs,\n\ttype MetaFunction,\n} from '@remix-run/node'\nimport { Link, useLoaderData } from '@remix-run/react'\nimport slugify from '@sindresorhus/slugify'\nimport * as React from 'react'\nimport { EpicVideoInfoProvider } from '#app/components/epic-video.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { Loading } from '#app/components/loading.tsx'\nimport { NavChevrons } from '#app/components/nav-chevrons.tsx'\nimport { useRevalidationWS } from '#app/components/revalidation-ws.js'\nimport { type loader as rootLoader } from '#app/root.tsx'\nimport { EditFileOnGitHub } from '#app/routes/launch-editor.tsx'\nimport { ProgressToggle } from '#app/routes/progress.tsx'\nimport { useTheme } from '#app/routes/theme/index.tsx'\nimport { Mdx } from '#app/utils/mdx.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { useIsOnline } from '#app/utils/online.ts'\nimport { getSeoMetaTags } from '#app/utils/seo.js'\n\nexport const meta: MetaFunction<typeof loader, { root: typeof rootLoader }> = ({\n\tdata,\n\tmatches,\n}) => {\n\tconst number = data?.exercise.exerciseNumber.toString().padStart(2, '0')\n\n\tconst rootData = matches.find((m) => m.id === 'root')?.data\n\tif (!data || !rootData) return [{ title: '🦉 | Error' }]\n\n\treturn getSeoMetaTags({\n\t\ttitle: `🦉 | ${number}. ${data.exercise.title} | ${rootData?.workshopTitle}`,\n\t\tdescription: `Elaboration for ${number}. ${data.exercise.title}`,\n\t\togTitle: `Finished: ${data.exercise.title}`,\n\t\togDescription: `Elaboration for exercise ${Number(number)}`,\n\t\tinstructor: rootData.instructor,\n\t\trequestInfo: rootData.requestInfo,\n\t})\n}\n\nexport async function loader({ request, params }: LoaderFunctionArgs) {\n\tconst timings = makeTimings('exerciseFinishedLoader')\n\tinvariantResponse(params.exerciseNumber, 'exerciseNumber is required')\n\tconst exercise = await getExercise(params.exerciseNumber, {\n\t\ttimings,\n\t\trequest,\n\t})\n\tif (!exercise) {\n\t\tthrow new Response('Not found', { status: 404 })\n\t}\n\tconst workshopConfig = getWorkshopConfig()\n\tconst exerciseFormTemplate = workshopConfig.forms.exercise\n\tconst exerciseFormEmbedUrl = exerciseFormTemplate\n\t\t.replace('{workshopTitle}', encodeURIComponent(workshopConfig.title))\n\t\t.replace('{exerciseTitle}', encodeURIComponent(exercise.title))\n\tconst nextExercise = await getExercise(exercise.exerciseNumber + 1, {\n\t\ttimings,\n\t\trequest,\n\t})\n\n\tconst finishedFilepath = path.join(\n\t\tgetWorkshopRoot(),\n\t\t'exercises',\n\t\texercise.dirName,\n\t\t'FINISHED.mdx',\n\t)\n\n\tconst apps = await getApps({ request, timings })\n\tconst exerciseApps = apps\n\t\t.filter(isExerciseStepApp)\n\t\t.filter((app) => app.exerciseNumber === exercise.exerciseNumber)\n\tconst prevApp = exerciseApps[exerciseApps.length - 1]\n\n\tconst articleId = `workshop-${slugify(workshopConfig.title)}-${\n\t\texercise.exerciseNumber\n\t}-finished`\n\n\treturn data(\n\t\t{\n\t\t\tarticleId,\n\t\t\tworkshopTitle: workshopConfig.title,\n\t\t\texercise,\n\t\t\texerciseFormEmbedUrl,\n\t\t\tepicVideoInfosPromise: getEpicVideoInfos(\n\t\t\t\texercise.finishedEpicVideoEmbeds,\n\t\t\t\t{ request },\n\t\t\t),\n\t\t\texerciseFinished: {\n\t\t\t\tfile: finishedFilepath,\n\t\t\t\trelativePath: `exercises/${exercise.dirName}/FINISHED.mdx`,\n\t\t\t},\n\t\t\tprevStepLink: prevApp\n\t\t\t\t? {\n\t\t\t\t\t\tto: getAppPageRoute(prevApp),\n\t\t\t\t\t\t'aria-label': `${prevApp.title} (${prevApp.type})`,\n\t\t\t\t\t}\n\t\t\t\t: null,\n\t\t\tnextStepLink: nextExercise\n\t\t\t\t? {\n\t\t\t\t\t\tto: `/exercise/${nextExercise.exerciseNumber.toString().padStart(2, '0')}`,\n\t\t\t\t\t\t'aria-label': `${nextExercise.title}`,\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tto: '/finished',\n\t\t\t\t\t\t'aria-label': 'Finished! 🎉',\n\t\t\t\t\t},\n\t\t},\n\t\t{\n\t\t\theaders: {\n\t\t\t\t'Server-Timing': getServerTimeHeader(timings),\n\t\t\t},\n\t\t},\n\t)\n}\n\nexport const headers: HeadersFunction = ({ loaderHeaders, parentHeaders }) => {\n\tconst headers = {\n\t\t'Cache-Control': loaderHeaders.get('Cache-Control') ?? '',\n\t\t'Server-Timing': combineServerTimings(loaderHeaders, parentHeaders),\n\t}\n\treturn headers\n}\n\nconst mdxComponents = { h1: () => null }\nexport default function ExerciseFinished() {\n\tconst data = useLoaderData<typeof loader>()\n\tconst exerciseNumber = data.exercise.exerciseNumber\n\t\t.toString()\n\t\t.padStart(2, '0')\n\n\tuseRevalidationWS({\n\t\twatchPaths: [`./exercises/${exerciseNumber}/FINISHED.mdx`],\n\t})\n\n\treturn (\n\t\t<div className=\"flex max-w-full flex-grow flex-col\">\n\t\t\t<main className=\"flex flex-grow flex-col sm:grid sm:h-full sm:min-h-[800px] sm:grid-cols-1 sm:grid-rows-2 md:min-h-[unset] lg:grid-cols-2 lg:grid-rows-1\">\n\t\t\t\t<div className=\"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r\">\n\t\t\t\t\t<h1 className=\"h-14 border-b pl-10 pr-5 text-sm font-medium leading-tight\">\n\t\t\t\t\t\t<div className=\"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-start gap-x-2\">\n\t\t\t\t\t\t\t\t<Link to={`/${exerciseNumber}`} className=\"hover:underline\">\n\t\t\t\t\t\t\t\t\t{`${exerciseNumber}. ${data.exercise.title}`}\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t<span>/</span>\n\t\t\t\t\t\t\t\t<span>Elaboration</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</h1>\n\n\t\t\t\t\t<article\n\t\t\t\t\t\tclassName=\"shadow-on-scrollbox h-full w-full max-w-none flex-1 scroll-pt-6 space-y-6 overflow-y-auto p-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8\"\n\t\t\t\t\t\tid={data.articleId}\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.exercise.finishedCode ? (\n\t\t\t\t\t\t\t<EpicVideoInfoProvider\n\t\t\t\t\t\t\t\tepicVideoInfosPromise={data.epicVideoInfosPromise}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div className=\"prose dark:prose-invert sm:prose-lg\">\n\t\t\t\t\t\t\t\t\t<Mdx\n\t\t\t\t\t\t\t\t\t\tcode={data.exercise.finishedCode}\n\t\t\t\t\t\t\t\t\t\tcomponents={mdxComponents}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</EpicVideoInfoProvider>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t// TODO: render a random dad joke...\n\t\t\t\t\t\t\t'No finished instructions yet...'\n\t\t\t\t\t\t)}\n\t\t\t\t\t</article>\n\t\t\t\t\t<ElementScrollRestoration elementQuery={`#${data.articleId}`} />\n\t\t\t\t\t<ProgressToggle\n\t\t\t\t\t\ttype=\"finished\"\n\t\t\t\t\t\texerciseNumber={data.exercise.exerciseNumber}\n\t\t\t\t\t\tclassName=\"h-14 border-t px-6\"\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"flex h-16 justify-between border-b-4 border-t lg:border-b-0\">\n\t\t\t\t\t\t<div />\n\t\t\t\t\t\t<EditFileOnGitHub\n\t\t\t\t\t\t\tfile={data.exerciseFinished.file}\n\t\t\t\t\t\t\trelativePath={data.exerciseFinished.relativePath}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NavChevrons prev={data.prevStepLink} next={data.nextStepLink} />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<Survey\n\t\t\t\t\texerciseFormEmbedUrl={data.exerciseFormEmbedUrl}\n\t\t\t\t\texerciseTitle={data.exercise.title}\n\t\t\t\t/>\n\t\t\t</main>\n\t\t</div>\n\t)\n}\n\nfunction Survey({\n\texerciseFormEmbedUrl,\n\texerciseTitle,\n}: {\n\texerciseFormEmbedUrl: string\n\texerciseTitle: string\n}) {\n\tconst theme = useTheme()\n\tconst [iframeLoaded, setIframeLoaded] = React.useState(false)\n\tconst isOnline = useIsOnline()\n\tif (!isOnline) {\n\t\treturn (\n\t\t\t<div className=\"relative flex-shrink-0\">\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center text-body-md text-foreground-destructive\">\n\t\t\t\t\t<Icon name=\"WifiNoConnection\" size=\"xl\">\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t{'Unable to load the '}\n\t\t\t\t\t\t\t<a href={exerciseFormEmbedUrl} className=\"underline\">\n\t\t\t\t\t\t\t\t{`${exerciseTitle} feedback form`}\n\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t{' when offline'}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Icon>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t)\n\t}\n\treturn (\n\t\t<div className=\"relative min-h-full sm:min-h-[unset] sm:flex-shrink-0\">\n\t\t\t{!iframeLoaded ? (\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t<Loading>\n\t\t\t\t\t\t<span>Loading {exerciseTitle} Elaboration form</span>\n\t\t\t\t\t</Loading>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<iframe\n\t\t\t\tonLoad={() => setIframeLoaded(true)}\n\t\t\t\t// show what would have shown if there is an error\n\t\t\t\tonError={() => setIframeLoaded(true)}\n\t\t\t\ttitle=\"Elaboration\"\n\t\t\t\tsrc={exerciseFormEmbedUrl}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t'absolute inset-0 flex h-full w-full transition-opacity duration-300',\n\t\t\t\t\tiframeLoaded ? 'opacity-100' : 'opacity-0',\n\t\t\t\t)}\n\t\t\t\tstyle={{ colorScheme: theme }}\n\t\t\t/>\n\t\t</div>\n\t)\n}\n"],"names":["meta","data","matches","number","exercise","exerciseNumber","toString","padStart","rootData","find","m","id","title","getSeoMetaTags","workshopTitle","description","ogTitle","ogDescription","Number","instructor","requestInfo","mdxComponents","h1","ExerciseFinished","useLoaderData","useRevalidationWS","watchPaths","className","children","jsxs","jsx","Link","to","articleId","finishedCode","EpicVideoInfoProvider","epicVideoInfosPromise","Mdx","code","components","ElementScrollRestoration","elementQuery","ProgressToggle","type","EditFileOnGitHub","file","exerciseFinished","relativePath","NavChevrons","prev","prevStepLink","next","nextStepLink","Survey","exerciseFormEmbedUrl","exerciseTitle","theme","useTheme","iframeLoaded","setIframeLoaded","React","useIsOnline","Loading","onLoad","onError","src","cn","style","colorScheme","Icon","name","size","href"],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ import{r as i,j as r,B as Fe,O as Tt,b as Me}from"./index-CGzylDPY.js";import{a as S,I as k,c as P,f as M,h as A}from"./misc-CQmANiHr.js";import{a as Lt}from"./pe-DXT2FOp1.js";import{L as oe}from"./product-BKhLQKd7.js";import{u as _t}from"./revalidation-ws-BoJZTvOQ.js";import{r as At,R as It,u as pe,L as j,N as L}from"./components-DrvY4pal.js";import{c as Ot,_ as Ft,u as Mt,a as V,f as Wt,z as Ut,s as $t,b as Bt,R as Vt,e as Ht,h as Yt}from"./index-BncqUVfr.js";import{S as H,T as zt,a as ye,b as we,c as Ne}from"./tooltip-Cd0yJoQb.js";import{c as J,b as Kt}from"./user-C0j04V55.js";import{u as We}from"./workshop-config-oL_FWDKq.js";import{u as Ue}from"./online-BsTX44az.js";import{u as ve}from"./presence-D5UF-NOM.js";import{b as Gt,s as $e,c as Xt,d as Zt,e as Be,m as D,u as Qt,f as qt}from"./progress-DwE8EkAa.js";import{T as Ve}from"./index-CMYl882D.js";function Jt(e){e.values.forEach(t=>t.stop())}function de(e,t){[...t].reverse().forEach(o=>{const a=e.getVariant(o);a&&$e(e,a),e.variantChildren&&e.variantChildren.forEach(s=>{de(s,t)})})}function en(e,t){if(Array.isArray(t))return de(e,t);if(typeof t=="string")return de(e,[t]);$e(e,t)}function tn(){const e=new Set,t={subscribe(n){return e.add(n),()=>void e.delete(n)},start(n,o){const a=[];return e.forEach(s=>{a.push(Gt(s,n,{transitionOverride:o}))}),Promise.all(a)},set(n){return e.forEach(o=>{en(o,n)})},stop(){e.forEach(n=>{Jt(n)})},mount(){return()=>{t.stop()}}};return t}function fe(){const e=Xt(tn);return Zt(e.mount,[]),e}function nn(e,t){function n(){return window.matchMedia(e).matches}function o(a){const s=window.matchMedia(e);return s.addEventListener("change",a),()=>{s.removeEventListener("change",a)}}return function(){return i.useSyncExternalStore(o,n,()=>t)}}function F(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Ee(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function He(...e){return t=>{let n=!1;const o=e.map(a=>{const s=Ee(a,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let a=0;a<o.length;a++){const s=o[a];typeof s=="function"?s():Ee(e[a],null)}}}}function U(...e){return i.useCallback(He(...e),e)}function rn(e,t){const n=i.createContext(t),o=s=>{const{children:u,...l}=s,d=i.useMemo(()=>l,Object.values(l));return r.jsx(n.Provider,{value:d,children:u})};o.displayName=e+"Provider";function a(s){const u=i.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[o,a]}function on(e,t=[]){let n=[];function o(s,u){const l=i.createContext(u),d=n.length;n=[...n,u];const c=x=>{var b;const{scope:p,children:m,...y}=x,f=((b=p==null?void 0:p[e])==null?void 0:b[d])||l,v=i.useMemo(()=>y,Object.values(y));return r.jsx(f.Provider,{value:v,children:m})};c.displayName=s+"Provider";function h(x,p){var f;const m=((f=p==null?void 0:p[e])==null?void 0:f[d])||l,y=i.useContext(m);if(y)return y;if(u!==void 0)return u;throw new Error(`\`${x}\` must be used within \`${s}\``)}return[c,h]}const a=()=>{const s=n.map(u=>i.createContext(u));return function(l){const d=(l==null?void 0:l[e])||s;return i.useMemo(()=>({[`__scope${e}`]:{...l,[e]:d}}),[l,d])}};return a.scopeName=e,[o,an(a,...t)]}function an(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(s){const u=o.reduce((l,{useScope:d,scopeName:c})=>{const x=d(s)[`__scope${c}`];return{...l,...x}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}var K=globalThis!=null&&globalThis.document?i.useLayoutEffect:()=>{},sn=Fe[" useId ".trim().toString()]||(()=>{}),ln=0;function ae(e){const[t,n]=i.useState(sn());return K(()=>{e||n(o=>o??String(ln++))},[e]),e||(t?`radix-${t}`:"")}var cn=Fe[" useInsertionEffect ".trim().toString()]||K;function un({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,s,u]=dn({defaultProp:t,onChange:n}),l=e!==void 0,d=l?e:a;{const h=i.useRef(e!==void 0);i.useEffect(()=>{const x=h.current;x!==l&&console.warn(`${o} is changing from ${x?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,o])}const c=i.useCallback(h=>{var x;if(l){const p=fn(h)?h(e):h;p!==e&&((x=u.current)==null||x.call(u,p))}else s(h)},[l,e,s,u]);return[d,c]}function dn({defaultProp:e,onChange:t}){const[n,o]=i.useState(e),a=i.useRef(n),s=i.useRef(t);return cn(()=>{s.current=t},[t]),i.useEffect(()=>{var u;a.current!==n&&((u=s.current)==null||u.call(s,n),a.current=n)},[n,a]),[n,o,s]}function fn(e){return typeof e=="function"}function Ye(e){const t=mn(e),n=i.forwardRef((o,a)=>{const{children:s,...u}=o,l=i.Children.toArray(s),d=l.find(pn);if(d){const c=d.props.children,h=l.map(x=>x===d?i.Children.count(c)>1?i.Children.only(null):i.isValidElement(c)?c.props.children:null:x);return r.jsx(t,{...u,ref:a,children:i.isValidElement(c)?i.cloneElement(c,void 0,h):null})}return r.jsx(t,{...u,ref:a,children:s})});return n.displayName=`${e}.Slot`,n}function mn(e){const t=i.forwardRef((n,o)=>{const{children:a,...s}=n;if(i.isValidElement(a)){const u=xn(a),l=vn(s,a.props);return a.type!==i.Fragment&&(l.ref=o?He(o,u):u),i.cloneElement(a,l)}return i.Children.count(a)>1?i.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hn=Symbol("radix.slottable");function pn(e){return i.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hn}function vn(e,t){const n={...t};for(const o in t){const a=e[o],s=t[o];/^on[A-Z]/.test(o)?a&&s?n[o]=(...l)=>{const d=s(...l);return a(...l),d}:a&&(n[o]=a):o==="style"?n[o]={...a,...s}:o==="className"&&(n[o]=[a,s].filter(Boolean).join(" "))}return{...e,...n}}function xn(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var gn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],I=gn.reduce((e,t)=>{const n=Ye(`Primitive.${t}`),o=i.forwardRef((a,s)=>{const{asChild:u,...l}=a,d=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),r.jsx(d,{...l,ref:s})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function bn(e,t){e&&At.flushSync(()=>e.dispatchEvent(t))}function G(e){const t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[])}function yn(e,t=globalThis==null?void 0:globalThis.document){const n=G(e);i.useEffect(()=>{const o=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var wn="DismissableLayer",me="dismissableLayer.update",Nn="dismissableLayer.pointerDownOutside",En="dismissableLayer.focusOutside",je,ze=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ke=i.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:u,onDismiss:l,...d}=e,c=i.useContext(ze),[h,x]=i.useState(null),p=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=i.useState({}),y=U(t,w=>x(w)),f=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=f.indexOf(v),g=h?f.indexOf(h):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,N=g>=b,C=Sn(w=>{const _=w.target,z=[...c.branches].some(re=>re.contains(_));!N||z||(a==null||a(w),u==null||u(w),w.defaultPrevented||l==null||l())},p),R=Pn(w=>{const _=w.target;[...c.branches].some(re=>re.contains(_))||(s==null||s(w),u==null||u(w),w.defaultPrevented||l==null||l())},p);return yn(w=>{g===c.layers.size-1&&(o==null||o(w),!w.defaultPrevented&&l&&(w.preventDefault(),l()))},p),i.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(je=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),Ce(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=je)}},[h,p,n,c]),i.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),Ce())},[h,c]),i.useEffect(()=>{const w=()=>m({});return document.addEventListener(me,w),()=>document.removeEventListener(me,w)},[]),r.jsx(I.div,{...d,ref:y,style:{pointerEvents:E?N?"auto":"none":void 0,...e.style},onFocusCapture:F(e.onFocusCapture,R.onFocusCapture),onBlurCapture:F(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:F(e.onPointerDownCapture,C.onPointerDownCapture)})});Ke.displayName=wn;var jn="DismissableLayerBranch",Cn=i.forwardRef((e,t)=>{const n=i.useContext(ze),o=i.useRef(null),a=U(t,o);return i.useEffect(()=>{const s=o.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),r.jsx(I.div,{...e,ref:a})});Cn.displayName=jn;function Sn(e,t=globalThis==null?void 0:globalThis.document){const n=G(e),o=i.useRef(!1),a=i.useRef(()=>{});return i.useEffect(()=>{const s=l=>{if(l.target&&!o.current){let d=function(){Ge(Nn,n,c,{discrete:!0})};const c={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);o.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",s),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function Pn(e,t=globalThis==null?void 0:globalThis.document){const n=G(e),o=i.useRef(!1);return i.useEffect(()=>{const a=s=>{s.target&&!o.current&&Ge(En,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Ce(){const e=new CustomEvent(me);document.dispatchEvent(e)}function Ge(e,t,n,{discrete:o}){const a=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),o?bn(a,s):a.dispatchEvent(s)}var se="focusScope.autoFocusOnMount",ie="focusScope.autoFocusOnUnmount",Se={bubbles:!1,cancelable:!0},Dn="FocusScope",Xe=i.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...u}=e,[l,d]=i.useState(null),c=G(a),h=G(s),x=i.useRef(null),p=U(t,f=>d(f)),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect(()=>{if(o){let f=function(E){if(m.paused||!l)return;const N=E.target;l.contains(N)?x.current=N:O(x.current,{select:!0})},v=function(E){if(m.paused||!l)return;const N=E.relatedTarget;N!==null&&(l.contains(N)||O(x.current,{select:!0}))},b=function(E){if(document.activeElement===document.body)for(const C of E)C.removedNodes.length>0&&O(l)};document.addEventListener("focusin",f),document.addEventListener("focusout",v);const g=new MutationObserver(b);return l&&g.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",v),g.disconnect()}}},[o,l,m.paused]),i.useEffect(()=>{if(l){De.add(m);const f=document.activeElement;if(!l.contains(f)){const b=new CustomEvent(se,Se);l.addEventListener(se,c),l.dispatchEvent(b),b.defaultPrevented||(Rn(An(Ze(l)),{select:!0}),document.activeElement===f&&O(l))}return()=>{l.removeEventListener(se,c),setTimeout(()=>{const b=new CustomEvent(ie,Se);l.addEventListener(ie,h),l.dispatchEvent(b),b.defaultPrevented||O(f??document.body,{select:!0}),l.removeEventListener(ie,h),De.remove(m)},0)}}},[l,c,h,m]);const y=i.useCallback(f=>{if(!n&&!o||m.paused)return;const v=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,b=document.activeElement;if(v&&b){const g=f.currentTarget,[E,N]=kn(g);E&&N?!f.shiftKey&&b===N?(f.preventDefault(),n&&O(E,{select:!0})):f.shiftKey&&b===E&&(f.preventDefault(),n&&O(N,{select:!0})):b===g&&f.preventDefault()}},[n,o,m.paused]);return r.jsx(I.div,{tabIndex:-1,...u,ref:p,onKeyDown:y})});Xe.displayName=Dn;function Rn(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(O(o,{select:t}),document.activeElement!==n)return}function kn(e){const t=Ze(e),n=Pe(t,e),o=Pe(t.reverse(),e);return[n,o]}function Ze(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Pe(e,t){for(const n of e)if(!Tn(n,{upTo:t}))return n}function Tn(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ln(e){return e instanceof HTMLInputElement&&"select"in e}function O(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ln(e)&&t&&e.select()}}var De=_n();function _n(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Re(e,t),e.unshift(t)},remove(t){var n;e=Re(e,t),(n=e[0])==null||n.resume()}}}function Re(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function An(e){return e.filter(t=>t.tagName!=="A")}var In="Portal",Qe=i.forwardRef((e,t)=>{var l;const{container:n,...o}=e,[a,s]=i.useState(!1);K(()=>s(!0),[]);const u=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return u?It.createPortal(r.jsx(I.div,{...o,ref:t}),u):null});Qe.displayName=In;function On(e,t){return i.useReducer((n,o)=>t[n][o]??n,e)}var ee=e=>{const{present:t,children:n}=e,o=Fn(t),a=typeof n=="function"?n({present:o.isPresent}):i.Children.only(n),s=U(o.ref,Mn(a));return typeof n=="function"||o.isPresent?i.cloneElement(a,{ref:s}):null};ee.displayName="Presence";function Fn(e){const[t,n]=i.useState(),o=i.useRef(null),a=i.useRef(e),s=i.useRef("none"),u=e?"mounted":"unmounted",[l,d]=On(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const c=X(o.current);s.current=l==="mounted"?c:"none"},[l]),K(()=>{const c=o.current,h=a.current;if(h!==e){const p=s.current,m=X(c);e?d("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?d("UNMOUNT"):d(h&&p!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),K(()=>{if(t){let c;const h=t.ownerDocument.defaultView??window,x=m=>{const f=X(o.current).includes(m.animationName);if(m.target===t&&f&&(d("ANIMATION_END"),!a.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=m=>{m.target===t&&(s.current=X(o.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",x),t.addEventListener("animationend",x),()=>{h.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",x),t.removeEventListener("animationend",x)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:i.useCallback(c=>{o.current=c?getComputedStyle(c):null,n(c)},[])}}function X(e){return(e==null?void 0:e.animationName)||"none"}function Mn(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var le=0;function Wn(){i.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ke()),document.body.insertAdjacentElement("beforeend",e[1]??ke()),le++,()=>{le===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),le--}},[])}function ke(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qe=Ot(),ce=function(){},te=i.forwardRef(function(e,t){var n=i.useRef(null),o=i.useState({onScrollCapture:ce,onWheelCapture:ce,onTouchMoveCapture:ce}),a=o[0],s=o[1],u=e.forwardProps,l=e.children,d=e.className,c=e.removeScrollBar,h=e.enabled,x=e.shards,p=e.sideCar,m=e.noRelative,y=e.noIsolation,f=e.inert,v=e.allowPinchZoom,b=e.as,g=b===void 0?"div":b,E=e.gapMode,N=Ft(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,R=Mt([n,t]),w=V(V({},N),a);return i.createElement(i.Fragment,null,h&&i.createElement(C,{sideCar:qe,removeScrollBar:c,shards:x,noRelative:m,noIsolation:y,inert:f,setCallbacks:s,allowPinchZoom:!!v,lockRef:n,gapMode:E}),u?i.cloneElement(i.Children.only(l),V(V({},w),{ref:R})):i.createElement(g,V({},w,{className:d,ref:R}),l))});te.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};te.classNames={fullWidth:Wt,zeroRight:Ut};var he=!1;if(typeof window<"u")try{var Z=Object.defineProperty({},"passive",{get:function(){return he=!0,!0}});window.addEventListener("test",Z,Z),window.removeEventListener("test",Z,Z)}catch{he=!1}var $=he?{passive:!1}:!1,Un=function(e){return e.tagName==="TEXTAREA"},Je=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Un(e)&&n[t]==="visible")},$n=function(e){return Je(e,"overflowY")},Bn=function(e){return Je(e,"overflowX")},Te=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=et(e,o);if(a){var s=tt(e,o),u=s[1],l=s[2];if(u>l)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Vn=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},Hn=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},et=function(e,t){return e==="v"?$n(t):Bn(t)},tt=function(e,t){return e==="v"?Vn(t):Hn(t)},Yn=function(e,t){return e==="h"&&t==="rtl"?-1:1},zn=function(e,t,n,o,a){var s=Yn(e,window.getComputedStyle(t).direction),u=s*o,l=n.target,d=t.contains(l),c=!1,h=u>0,x=0,p=0;do{if(!l)break;var m=tt(e,l),y=m[0],f=m[1],v=m[2],b=f-v-s*y;(y||b)&&et(e,l)&&(x+=b,p+=y);var g=l.parentNode;l=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!d&&l!==document.body||d&&(t.contains(l)||t===l));return(h&&(Math.abs(x)<1||!a)||!h&&(Math.abs(p)<1||!a))&&(c=!0),c},Q=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Le=function(e){return[e.deltaX,e.deltaY]},_e=function(e){return e&&"current"in e?e.current:e},Kn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Gn=function(e){return`
2
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
3
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
4
+ `)},Xn=0,B=[];function Zn(e){var t=i.useRef([]),n=i.useRef([0,0]),o=i.useRef(),a=i.useState(Xn++)[0],s=i.useState($t)[0],u=i.useRef(e);i.useEffect(function(){u.current=e},[e]),i.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var f=Bt([e.lockRef.current],(e.shards||[]).map(_e),!0).filter(Boolean);return f.forEach(function(v){return v.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),f.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=i.useCallback(function(f,v){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!u.current.allowPinchZoom;var b=Q(f),g=n.current,E="deltaX"in f?f.deltaX:g[0]-b[0],N="deltaY"in f?f.deltaY:g[1]-b[1],C,R=f.target,w=Math.abs(E)>Math.abs(N)?"h":"v";if("touches"in f&&w==="h"&&R.type==="range")return!1;var _=Te(w,R);if(!_)return!0;if(_?C=w:(C=w==="v"?"h":"v",_=Te(w,R)),!_)return!1;if(!o.current&&"changedTouches"in f&&(E||N)&&(o.current=C),!C)return!0;var z=o.current||C;return zn(z,v,f,z==="h"?E:N,!0)},[]),d=i.useCallback(function(f){var v=f;if(!(!B.length||B[B.length-1]!==s)){var b="deltaY"in v?Le(v):Q(v),g=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&Kn(C.delta,b)})[0];if(g&&g.should){v.cancelable&&v.preventDefault();return}if(!g){var E=(u.current.shards||[]).map(_e).filter(Boolean).filter(function(C){return C.contains(v.target)}),N=E.length>0?l(v,E[0]):!u.current.noIsolation;N&&v.cancelable&&v.preventDefault()}}},[]),c=i.useCallback(function(f,v,b,g){var E={name:f,delta:v,target:b,should:g,shadowParent:Qn(b)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(N){return N!==E})},1)},[]),h=i.useCallback(function(f){n.current=Q(f),o.current=void 0},[]),x=i.useCallback(function(f){c(f.type,Le(f),f.target,l(f,e.lockRef.current))},[]),p=i.useCallback(function(f){c(f.type,Q(f),f.target,l(f,e.lockRef.current))},[]);i.useEffect(function(){return B.push(s),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:p}),document.addEventListener("wheel",d,$),document.addEventListener("touchmove",d,$),document.addEventListener("touchstart",h,$),function(){B=B.filter(function(f){return f!==s}),document.removeEventListener("wheel",d,$),document.removeEventListener("touchmove",d,$),document.removeEventListener("touchstart",h,$)}},[]);var m=e.removeScrollBar,y=e.inert;return i.createElement(i.Fragment,null,y?i.createElement(s,{styles:Gn(a)}):null,m?i.createElement(Vt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Qn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const qn=Ht(qe,Zn);var nt=i.forwardRef(function(e,t){return i.createElement(te,V({},e,{ref:t,sideCar:qn}))});nt.classNames=te.classNames;var ne="Dialog",[rt,Ar]=on(ne),[Jn,T]=rt(ne),ot=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:a,onOpenChange:s,modal:u=!0}=e,l=i.useRef(null),d=i.useRef(null),[c,h]=un({prop:o,defaultProp:a??!1,onChange:s,caller:ne});return r.jsx(Jn,{scope:t,triggerRef:l,contentRef:d,contentId:ae(),titleId:ae(),descriptionId:ae(),open:c,onOpenChange:h,onOpenToggle:i.useCallback(()=>h(x=>!x),[h]),modal:u,children:n})};ot.displayName=ne;var at="DialogTrigger",st=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=T(at,n),s=U(t,a.triggerRef);return r.jsx(I.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":be(a.open),...o,ref:s,onClick:F(e.onClick,a.onOpenToggle)})});st.displayName=at;var xe="DialogPortal",[er,it]=rt(xe,{forceMount:void 0}),lt=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:a}=e,s=T(xe,t);return r.jsx(er,{scope:t,forceMount:n,children:i.Children.map(o,u=>r.jsx(ee,{present:n||s.open,children:r.jsx(Qe,{asChild:!0,container:a,children:u})}))})};lt.displayName=xe;var q="DialogOverlay",ct=i.forwardRef((e,t)=>{const n=it(q,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,s=T(q,e.__scopeDialog);return s.modal?r.jsx(ee,{present:o||s.open,children:r.jsx(nr,{...a,ref:t})}):null});ct.displayName=q;var tr=Ye("DialogOverlay.RemoveScroll"),nr=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=T(q,n);return r.jsx(nt,{as:tr,allowPinchZoom:!0,shards:[a.contentRef],children:r.jsx(I.div,{"data-state":be(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),W="DialogContent",ut=i.forwardRef((e,t)=>{const n=it(W,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,s=T(W,e.__scopeDialog);return r.jsx(ee,{present:o||s.open,children:s.modal?r.jsx(rr,{...a,ref:t}):r.jsx(or,{...a,ref:t})})});ut.displayName=W;var rr=i.forwardRef((e,t)=>{const n=T(W,e.__scopeDialog),o=i.useRef(null),a=U(t,n.contentRef,o);return i.useEffect(()=>{const s=o.current;if(s)return Yt(s)},[]),r.jsx(dt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:F(e.onCloseAutoFocus,s=>{var u;s.preventDefault(),(u=n.triggerRef.current)==null||u.focus()}),onPointerDownOutside:F(e.onPointerDownOutside,s=>{const u=s.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0;(u.button===2||l)&&s.preventDefault()}),onFocusOutside:F(e.onFocusOutside,s=>s.preventDefault())})}),or=i.forwardRef((e,t)=>{const n=T(W,e.__scopeDialog),o=i.useRef(!1),a=i.useRef(!1);return r.jsx(dt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var u,l;(u=e.onCloseAutoFocus)==null||u.call(e,s),s.defaultPrevented||(o.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:s=>{var d,c;(d=e.onInteractOutside)==null||d.call(e,s),s.defaultPrevented||(o.current=!0,s.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const u=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(u))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&a.current&&s.preventDefault()}})}),dt=i.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:s,...u}=e,l=T(W,n),d=i.useRef(null),c=U(t,d);return Wn(),r.jsxs(r.Fragment,{children:[r.jsx(Xe,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:s,children:r.jsx(Ke,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":be(l.open),...u,ref:c,onDismiss:()=>l.onOpenChange(!1)})}),r.jsxs(r.Fragment,{children:[r.jsx(ar,{titleId:l.titleId}),r.jsx(ir,{contentRef:d,descriptionId:l.descriptionId})]})]})}),ge="DialogTitle",ft=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=T(ge,n);return r.jsx(I.h2,{id:a.titleId,...o,ref:t})});ft.displayName=ge;var mt="DialogDescription",ht=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=T(mt,n);return r.jsx(I.p,{id:a.descriptionId,...o,ref:t})});ht.displayName=mt;var pt="DialogClose",vt=i.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,a=T(pt,n);return r.jsx(I.button,{type:"button",...o,ref:t,onClick:F(e.onClick,()=>a.onOpenChange(!1))})});vt.displayName=pt;function be(e){return e?"open":"closed"}var xt="DialogTitleWarning",[Ir,gt]=rn(xt,{contentName:W,titleName:ge,docsSlug:"dialog"}),ar=({titleId:e})=>{const t=gt(xt),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
5
+
6
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
7
+
8
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},sr="DialogDescriptionWarning",ir=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${gt(sr).contentName}}.`;return i.useEffect(()=>{var s;const a=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},lr=ot,cr=st,ur=lt,bt=ct,yt=ut,dr=ft,wt=ht,fr=vt;const mr=lr,hr=cr,pr=ur;function Nt({className:e,ref:t,...n}){return r.jsx(bt,{ref:t,className:S("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n})}Nt.displayName=bt.displayName;function Et({className:e,children:t,ref:n,...o}){return r.jsxs(pr,{children:[r.jsx(Nt,{}),r.jsxs(yt,{ref:n,className:S("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...o,children:[t,r.jsxs(fr,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[r.jsx(k,{name:"Close"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}Et.displayName=yt.displayName;function jt({className:e,...t}){return r.jsx("div",{className:S("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}jt.displayName="DialogHeader";dr.displayName;function Ct({className:e,ref:t,...n}){return r.jsx(wt,{ref:t,className:S("text-sm text-muted-foreground",e),...n})}Ct.displayName=wt.displayName;const Ae=["opacity-70","opacity-80","opacity-90","opacity-100"],Ie=["shadow-[0_0_2px_0_rgba(0,0,0,0.3)]","shadow-[0_0_4px_0_rgba(0,0,0,0.3)]","shadow-[0_0_7px_0_rgba(0,0,0,0.3)]","shadow-[0_0_10px_0_rgba(0,0,0,0.3)]"];function Oe(e){const t=Math.round(e*Ae.length-1),n=Math.round(e*Ie.length-1);return S("shadow-purple-700 hover:opacity-100 focus:opacity-100 dark:shadow-purple-200",Ae[t]??"opacity-60",Ie[n]??"shadow-none",e===1?"animate-pulse hover:animate-none focus:animate-none":null)}function St({isMenuOpened:e}){const t=J(),{users:n}=ve(),{product:{displayNameShort:o}}=We(),a=e?17:0,s=n.length-a,u=s>(e?1:0);if(!n.length)return null;const l=e&&n.length===1?r.jsx(j,{target:"_blank",rel:"noopener noreferrer",to:"https://www.youtube.com/watch?v=w6Q3mHyzn78",children:r.jsx("img",{alt:"Tiffany Tunes",className:S("h-8 w-8 rounded-full border object-cover",Oe(1)),src:"/img/tiffany.png"})}):null,d=`${s}${e?" more ":" "}${o} Dev${s===1?"":"s"} working now`;return r.jsx("div",{className:"flex flex-wrap items-center gap-2",children:r.jsxs(zt,{children:[(u?n.slice(0,a):n).map(({user:c,score:h})=>{var b,g;const x=Oe(h),p=vr(c.location),m=c.imageUrlSmall||c.avatarUrl,y=c.hasAccess,f=(g=(b=c.location)==null?void 0:b.origin)==null?void 0:g.includes("localhost");let v;return y?v=f?"working":"referencing":v=f?"previewing":"reviewing",r.jsxs(ye,{children:[r.jsx(we,{asChild:!0,children:m?r.jsx("img",{tabIndex:0,alt:c.name||o,className:S("h-8 w-8 rounded-full border object-cover",x),src:m}):r.jsx("div",{tabIndex:0,"aria-label":c.name||`${o} Dev`,className:S("flex h-8 w-8 items-center justify-center rounded-full border",x),children:r.jsx(k,{name:"User"})})}),r.jsx(Ne,{children:r.jsxs("span",{className:"flex flex-col items-center justify-center gap-1",children:[r.jsxs("span",{children:[c.name||`${o} Dev`," ",p?` is ${v} ${h===1&&(t==null?void 0:t.id)!==c.id?"with you":""} on`:null]}),p!=null&&p.line1?r.jsx("span",{children:p.line1}):null,p!=null&&p.line2?r.jsx("span",{children:p.line2}):null]})})]},c.id)}),l,u?r.jsxs(ye,{children:[r.jsx(we,{asChild:!0,children:r.jsx("div",{tabIndex:0,"aria-label":d,className:S("flex items-center justify-center rounded-full border bg-accent text-xs text-accent-foreground",e?"h-8 w-8":"h-6 w-6"),children:r.jsx("span",{className:S("pointer-events-none overflow-hidden text-ellipsis whitespace-nowrap text-center",e?"w-8":"w-6"),children:e?`+${s}`:s})})}),r.jsx(Ne,{children:d})]}):null]})})}const Pt=nn("(min-width: 640px)",!0);function Or(){const e=pe(),t=J(),n=Pt(),o=Lt(),[a,s]=i.useState(e.isMenuOpened);_t({watchPaths:["./exercises/README.mdx"]});function u(l){s(l),document.cookie=`es_menu_open=${l.toString()}; path=/; SameSite=Lax;`}return r.jsxs("div",{className:"flex flex-col",children:[t?null:r.jsx(xr,{}),o&&n?null:r.jsx(gr,{isMenuOpened:a,onMenuOpenChange:u}),r.jsxs("div",{className:S("flex flex-grow flex-col sm:flex-row",{"h-[calc(100vh-128px-env(safe-area-inset-top)-env(safe-area-inset-bottom))] sm:h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":!t,"h-[calc(100vh-64px-env(safe-area-inset-top)-env(safe-area-inset-bottom))] sm:h-[calc(100vh-env(safe-area-inset-top)-env(safe-area-inset-bottom))]":t,"h-[unset]":!n&&a}),children:[n?r.jsx(br,{isMenuOpened:a,onMenuOpenChange:u}):null,r.jsx("div",{className:S("h-full w-full max-w-full sm:max-w-[calc(100%-56px)]",a?"hidden md:block":""),children:r.jsx(Tt,{})})]})]})}function vr(e){if(!e)return null;const{exercise:t}=e,n=[t?[t.exerciseNumber,t.stepNumber].filter(Boolean).map(o=>o.toString().padStart(2,"0")).join("/"):null,t==null?void 0:t.type].filter(Boolean).join(" - ");return{line1:e.workshopTitle,line2:n}}function xr(){const e=Pt(),{product:{host:t,displayName:n}}=We(),o=Kt(),a=r.jsx("div",{children:ENV.EPICSHOP_DEPLOYED?r.jsxs("div",{children:["This is the deployed version. ",r.jsxs(r.Fragment,{children:[r.jsx(j,{className:"underline",target:"_blank",rel:"noopener noreferrer",to:ENV.EPICSHOP_GITHUB_REPO,children:"Run locally"})," for full experience."]})," "]}):o?r.jsxs("div",{children:[r.jsx(j,{to:"/login",className:"underline",children:"Login"})," ","or"," ",r.jsx("a",{href:`https://${t}/login`,className:"underline",children:"join for free"})," ","for the full experience."]}):null});return r.jsx("div",{className:"z-10 flex h-16 items-center justify-between border-b bg-gradient-to-tr from-blue-500 to-indigo-500 pl-4 text-white",children:e?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"hidden flex-1 flex-wrap items-center gap-4 sm:flex",children:[r.jsx(oe,{size:"lg",style:"monochrome"}),r.jsxs("div",{className:"flex flex-1 flex-wrap items-center",children:[r.jsxs("p",{className:"mr-2",children:["Welcome to the"," ",r.jsx(j,{to:`https://${t}`,className:"underline",target:"_blank",children:n})," ","Workshop app!"]}),a]})]}),o?null:r.jsxs("div",{className:"hidden h-full flex-col items-center sm:flex md:flex-row",children:[r.jsxs(j,{to:`https://${t}`,target:"_blank",className:"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold",children:[r.jsxs("span",{className:"drop-shadow-sm",children:["Join ",n]}),r.jsx("span",{children:"↗︎"})]}),r.jsxs(j,{to:ENV.EPICSHOP_DEPLOYED?`https://${t}/login`:"/login",className:"flex h-full items-center justify-center space-x-1.5 bg-white/20 px-5 text-sm font-semibold shadow-md transition hover:bg-white/30",children:[r.jsx(k,{name:"User",size:"lg"}),r.jsx("span",{className:"drop-shadow-sm",children:"Login"})]})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex flex-1 flex-wrap items-center gap-4 sm:hidden",children:[r.jsx("a",{href:`https://${t}`,children:r.jsx(oe,{size:"lg",style:"monochrome"})}),r.jsxs(mr,{children:[r.jsx(hr,{children:r.jsx(k,{name:"Question",size:"lg",className:"animate-pulse"})}),r.jsxs(Et,{children:[r.jsxs(jt,{children:[r.jsx(oe,{size:"lg",style:"monochrome"}),r.jsx("span",{className:"text-lg font-semibold",children:n})]}),r.jsxs(Ct,{children:["Welcome to the"," ",r.jsx(j,{to:`https://${t}`,className:"underline",children:n})," ","Workshop app!"]}),a]})]})]}),o?null:r.jsxs("div",{className:"flex h-full items-center",children:[r.jsxs(j,{to:`https://${t}`,target:"_blank",className:"flex h-full items-center justify-center space-x-1.5 px-5 text-sm font-semibold",children:[r.jsx("span",{className:"drop-shadow-sm",children:"Join"}),r.jsx("span",{children:"↗︎"})]}),r.jsxs(j,{to:ENV.EPICSHOP_DEPLOYED?`https://${t}/login`:"/login",className:"flex h-full items-center justify-center space-x-1.5 bg-white/20 px-5 text-sm font-semibold shadow-md transition hover:bg-white/30",children:[r.jsx(k,{name:"User",size:"lg"}),r.jsx("span",{className:"drop-shadow-sm",children:"Login"})]})]})]})})}const Dt={hidden:{opacity:0,x:-20},visible:{opacity:1,x:0}};function Rt({exerciseNumber:e,children:t}){const n=Qt(e);return r.jsx(D.li,{variants:Dt,className:S("py-[6px] first:pt-3 last:pb-3",n?`${n} before:border-t`:null),children:r.jsx("span",{className:"inline-block pl-2",children:t})})}function Y({children:e,...t}){const n=qt(t);return r.jsx(D.li,{variants:Dt,className:S("py-[6px] first:pt-3 last:pb-3",n?`${n} before:border-t`:null),children:r.jsx("span",{className:"inline-block pl-2",children:e})})}function gr({isMenuOpened:e,onMenuOpenChange:t}){const n=pe(),o=J(),a=Be(),s=Me(),u=Ue(),{users:l}=ve(),d={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}};return r.jsx("nav",{className:"flex w-full border-b sm:hidden",children:r.jsx("div",{className:"w-full",children:r.jsxs("div",{className:S("flex items-center",{"flex-col":e,"h-14":!e}),children:[r.jsx(kt,{title:n.workshopTitle,isMenuOpened:e,setMenuOpened:t}),e&&r.jsxs(D.div,{className:"flex w-full flex-grow flex-col justify-between overflow-x-auto p-6 scrollbar-thin scrollbar-thumb-scrollbar",initial:{opacity:0},animate:{opacity:1},children:[r.jsxs(D.ul,{variants:d,initial:"hidden",animate:"visible",className:"flex flex-col",children:[r.jsx("span",{children:r.jsx(L,{prefetch:"intent",to:"/",className:({isActive:c})=>P("relative whitespace-nowrap px-2 py-0.5 pr-3 text-2xl font-bold outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":c}),children:"Home"})}),n.exercises.map(({exerciseNumber:c,title:h,steps:x})=>{const p=Number(s.exerciseNumber)===c,m=!p&&n.playground.exerciseNumber===c;return r.jsxs(Rt,{exerciseNumber:c,children:[r.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[r.jsx(j,{prefetch:"intent",to:M(c),className:P("relative whitespace-nowrap px-2 py-0.5 pr-3 outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":p}),children:h}),m?r.jsx(j,{to:A(n.playground.exerciseNumber,n.playground.stepNumber,n.playground.type),prefetch:"intent",children:"🛝"}):null]}),p?r.jsxs(D.ul,{variants:d,initial:"hidden",animate:"visible",className:"ml-4 mt-2 flex flex-col",children:[r.jsx(Y,{type:"instructions",exerciseNumber:c,children:r.jsx(j,{to:M(c),prefetch:"intent",className:P('relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!s.stepNumber}),children:"Intro"})},c),x.filter(Boolean).map(({stepNumber:y,title:f,problem:v,solution:b})=>r.jsx(Y,{type:"step",stepNumber:y,exerciseNumber:c,children:r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsxs(j,{to:A(c,y),prefetch:"intent",className:"font-semibold leading-tight",children:[y.toString().padStart(2,"0"),"."," ",f]}),r.jsxs("div",{className:"ml-3 mt-0.5 flex gap-1",children:[v&&r.jsxs(L,{to:A(c,y,"problem"),prefetch:"intent",className:({isActive:g})=>P("relative whitespace-nowrap px-2 py-0.5 pr-3 outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":g}),children:["Problem",v.name===n.playground.appName?" 🛝":""]}),b&&r.jsxs(L,{to:A(c,y,"solution"),prefetch:"intent",className:({isActive:g})=>P("relative whitespace-nowrap px-2 py-0.5 pr-3 outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":g}),children:["Solution",b.name===n.playground.appName?" 🛝":""]})]})]})},y)),r.jsx(Y,{type:"finished",exerciseNumber:c,children:r.jsx(L,{to:M(c,"finished"),prefetch:"intent",className:({isActive:y})=>P('relative whitespace-nowrap px-2 py-0.5 pr-3 text-base font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":y}),children:"📝 Elaboration"})})]}):null]},c)})]}),r.jsx("div",{className:"mt-6",children:r.jsx(L,{to:"/finished",className:({isActive:c})=>P("relative whitespace-nowrap text-lg font-bold outline-none hover:underline focus:underline",{'bg-black text-white after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""]':c}),children:"📝 Workshop Feedback"})})]}),r.jsx("div",{className:"flex-grow"}),u?null:r.jsx(H,{content:e?null:"You are offline",children:r.jsx("div",{className:S("flex h-14 animate-pulse items-center justify-start p-4",e?"w-full border-t":"border-l"),children:r.jsx(k,{name:"WifiNoConnection",className:"text-foreground-destructive",children:e?"You are offline":null})})}),r.jsx("div",{className:S("flex items-center justify-start p-4",e&&l.length>4?"min-h-14":"h-14",e?"w-full border-t":"border-l"),children:r.jsx(St,{isMenuOpened:e})}),ENV.EPICSHOP_DEPLOYED?null:o?r.jsx(H,{content:e?null:"Your account",children:r.jsxs(j,{className:S("flex h-14 flex-shrink-0 items-center justify-start space-x-3 px-4 py-4 text-center no-underline hover:underline",{"border-l":!e,"w-full border-t":e}),to:"/account",children:[o.imageUrlSmall?r.jsx("img",{alt:o.name??o.email,src:o.imageUrlSmall,className:"h-full rounded-full"}):r.jsx(k,{name:"User",className:"flex-shrink-0",size:"lg"}),e?r.jsx(D.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Your Account"}):r.jsx("span",{className:"sr-only",children:"Your account"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:o&&a?r.jsx(H,{content:e?null:"Continue to next lesson",children:r.jsxs(j,{to:a,prefetch:"intent",className:P("flex h-14 w-full items-center space-x-3 border-l px-4 py-4 pl-[18px] no-underline hover:underline"),state:{from:"continue next lesson button"},children:[r.jsx(k,{name:"FastForward",className:"flex-shrink-0",size:"md"}),e?r.jsx(D.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Continue to next lesson"}):r.jsx("span",{className:"sr-only",children:"Continue to next lesson"})]})}):null,r.jsx("div",{className:S("flex h-14 w-14 items-center justify-center self-start p-4 sm:mb-4 sm:w-full",{"w-full border-t":e,"border-l":!e}),children:r.jsx(Ve,{})})]})})})}const ue=400;function br({isMenuOpened:e,onMenuOpenChange:t}){const n=pe(),o=J(),a=Be(),s=Me(),u=Ue(),{users:l}=ve(),d=n.exercises.find(m=>m.exerciseNumber===Number(s.exerciseNumber)),c=s.type==="solution"?d==null?void 0:d.solutions.find(m=>m.stepNumber===Number(s.stepNumber)):s.type==="problem"?d==null?void 0:d.problems.find(m=>m.stepNumber===Number(s.stepNumber)):null,h=fe(),x={close:{width:56},open:{width:ue}},p={visible:{opacity:1,transition:{duration:.05,when:"beforeChildren",staggerChildren:.03}},hidden:{opacity:0}};return r.jsx("nav",{className:"hidden border-r sm:flex",children:r.jsx(D.div,{initial:e?"open":"close",variants:x,animate:h,children:r.jsxs("div",{className:"flex h-full flex-col items-center justify-between",children:[r.jsx(kt,{title:n.workshopTitle,menuControls:h,isMenuOpened:e,setMenuOpened:t}),e&&r.jsxs(D.div,{style:{width:ue},className:"flex flex-grow flex-col justify-between overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-scrollbar",initial:{opacity:0},animate:{opacity:1},children:[r.jsxs(D.ul,{variants:p,initial:"hidden",animate:"visible",className:"flex flex-col",children:[r.jsx("span",{children:r.jsx(L,{prefetch:"intent",to:"/",className:({isActive:m})=>P("relative whitespace-nowrap px-2 py-0.5 pr-3 text-2xl font-bold outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":m}),children:"Home"})}),n.exercises.map(({exerciseNumber:m,title:y,steps:f})=>{const v=Number(s.exerciseNumber)===m,b=!v&&n.playground.exerciseNumber===m;return r.jsxs(Rt,{exerciseNumber:m,children:[r.jsxs("span",{className:"flex items-center gap-1 text-2xl font-bold",children:[r.jsx(j,{prefetch:"intent",to:M(m),className:P("relative whitespace-nowrap px-2 py-0.5 pr-3 outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":v}),children:y}),b?r.jsx(j,{to:A(n.playground.exerciseNumber,n.playground.stepNumber,n.playground.type),prefetch:"intent",children:"🛝"}):null]}),v?r.jsxs(D.ul,{variants:p,initial:"hidden",animate:"visible",className:"ml-4 mt-2 flex flex-col",children:[r.jsx(Y,{type:"instructions",exerciseNumber:m,children:r.jsx(j,{to:M(m),prefetch:"intent",className:P('relative whitespace-nowrap px-2 py-0.5 pr-3 text-xl font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":!s.stepNumber}),children:"Intro"})},m),f.filter(Boolean).map(({stepNumber:g,title:E,problem:N,solution:C})=>r.jsx(Y,{type:"step",stepNumber:g,exerciseNumber:m,children:r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsxs(j,{to:A(m,g),prefetch:"intent",className:"font-semibold leading-tight",children:[g.toString().padStart(2,"0"),"."," ",E]}),r.jsxs("div",{className:"ml-3 mt-0.5 flex gap-1",children:[N&&r.jsxs(L,{to:A(m,g,"problem"),prefetch:"intent",className:({isActive:R})=>P("relative whitespace-nowrap px-2 py-0.5 pr-3 outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":R}),children:["Problem",N.name===n.playground.appName?" 🛝":""]}),C&&r.jsxs(L,{to:A(m,g,"solution"),prefetch:"intent",className:({isActive:R})=>P("relative whitespace-nowrap px-2 py-0.5 pr-3 outline-none hover:underline focus:underline",'after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":R}),children:["Solution",C.name===n.playground.appName?" 🛝":""]})]})]})},g)),r.jsx(Y,{type:"finished",exerciseNumber:m,children:r.jsx(L,{to:M(m,"finished"),prefetch:"intent",className:({isActive:g})=>P('relative whitespace-nowrap px-2 py-0.5 pr-3 text-base font-medium outline-none after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""] hover:underline focus:underline',{"bg-foreground text-background":g}),children:"📝 Elaboration"})})]}):null]},m)})]}),r.jsx("div",{className:"mt-6",children:r.jsx(L,{to:"/finished",className:({isActive:m})=>P("relative whitespace-nowrap text-lg font-bold outline-none hover:underline focus:underline",{'bg-black text-white after:absolute after:-bottom-2.5 after:-right-2.5 after:h-5 after:w-5 after:rotate-45 after:scale-75 after:bg-background after:content-[""]':m}),children:"📝 Workshop Feedback"})})]}),!e&&r.jsx("div",{className:"flex flex-grow flex-col justify-center",children:r.jsxs("div",{className:"orientation-sideways w-full font-mono text-sm font-medium uppercase leading-none",children:[d!=null&&d.title?r.jsx(j,{to:M(Number(s.exerciseNumber)),children:d.title}):null,d!=null&&d.title&&(c!=null&&c.title)?" — ":null,c!=null&&c.title?r.jsx(j,{to:A(Number(s.exerciseNumber),c.stepNumber),children:c.title}):null]})}),u?null:r.jsx(H,{content:e?null:"You are offline",children:r.jsx("div",{className:S("flex w-full animate-pulse items-center border-t p-4",e?"justify-start":"justify-center"),children:r.jsx(k,{name:"WifiNoConnection",className:"text-foreground-destructive",children:e?r.jsx("span",{className:"whitespace-nowrap",children:"You are offline"}):null})})}),r.jsx("div",{className:S("flex w-full items-center justify-start border-t p-4 transition-[height]",e&&l.length>4?"h-28":"h-14"),style:e?{width:ue}:{},children:r.jsx(St,{isMenuOpened:e})}),ENV.EPICSHOP_DEPLOYED?null:o?r.jsx(H,{content:e?null:"Your account",children:r.jsxs(j,{className:"flex h-14 w-full flex-shrink-0 items-center justify-start space-x-3 border-t px-4 py-4 text-center no-underline hover:underline",to:"/account",children:[o.imageUrlSmall?r.jsx("img",{alt:o.name??o.email,src:o.imageUrlSmall,className:"h-full rounded-full"}):r.jsx(k,{name:"User",className:"flex-shrink-0",size:"lg"}),e?r.jsx(D.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Your Account"}):r.jsx("span",{className:"sr-only",children:"Your account"})]})}):null,ENV.EPICSHOP_DEPLOYED?null:o&&a?r.jsx(H,{content:e?null:"Continue to next lesson",children:r.jsxs(j,{to:a,prefetch:"intent",className:P("flex h-14 w-full items-center space-x-3 border-t px-4 py-4 pl-[18px] no-underline hover:underline"),state:{from:"continue next lesson button"},children:[r.jsx(k,{name:"FastForward",className:"flex-shrink-0",size:"md"}),e?r.jsx(D.div,{className:"flex items-center whitespace-nowrap",initial:{opacity:0},animate:{opacity:1},children:"Continue to next lesson"}):r.jsx("span",{className:"sr-only",children:"Continue to next lesson"})]})}):null,r.jsx("div",{className:"mb-4 w-full self-start border-t pl-3 pt-[15px]",children:r.jsx(Ve,{})})]})})})}function kt({title:e,isMenuOpened:t,setMenuOpened:n,menuControls:o}){const a=i.useRef(t),s=i.useRef(null),u={open:{d:"M3.06061 2.99999L21.0606 21"},closed:{d:"M0 9.5L24 9.5"}},l={open:{d:"M3.00006 21.0607L21 3.06064"},moving:{d:"M0 14.5L24 14.5"},closed:{d:"M0 14.5L15 14.5"}},d=fe(),c=fe();async function h(){o==null||o.start(t?"close":"open"),n(!t),t?(d.start(u.closed),await c.start(l.moving),c.start(l.closed)):(await c.start(l.moving),d.start(u.open),c.start(l.open))}return i.useEffect(()=>{if(!t)return;function x(p){var m;p.key==="Escape"&&((m=s.current)==null||m.click())}return document.addEventListener("keyup",x),()=>document.removeEventListener("keyup",x)},[t]),r.jsxs("div",{className:S("relative inline-flex h-14 flex-shrink-0 items-center justify-between overflow-hidden border-r sm:w-full sm:border-b sm:border-r-0",{"w-full":t}),children:[r.jsx("button",{ref:s,className:"flex h-14 w-14 items-center justify-center","aria-label":"Open Navigation menu",onClick:h,children:r.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",children:[r.jsx(D.path,{...u[a.current?"open":"closed"],animate:d,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5}),r.jsx(D.path,{...l[a.current?"open":"closed"],animate:c,transition:{duration:.2},stroke:"currentColor",strokeWidth:1.5})]})}),t&&r.jsx(D.p,{transition:{delay:.2},initial:{opacity:0,y:5},animate:{opacity:1,y:0},className:"absolute right-5 whitespace-nowrap font-mono text-sm uppercase",children:r.jsx(j,{to:"/",children:e})})]})}export{Or as default};
9
+ //# sourceMappingURL=_layout-CkabS-6c.js.map