@epic-web/workshop-app 5.6.0 → 5.7.1
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.
- package/build/client/assets/{_-hAKYb2AG.js → _-CjjFMNGC.js} +2 -2
- package/build/client/assets/{_-hAKYb2AG.js.map → _-CjjFMNGC.js.map} +1 -1
- package/build/client/assets/_exerciseNumber-CqkGzsgV.js +2 -0
- package/build/client/assets/{_exerciseNumber-PTdG9GGB.js.map → _exerciseNumber-CqkGzsgV.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_._stepNumber-03erOIGo.js → _exerciseNumber_._stepNumber-BNWGPi9m.js} +2 -2
- package/build/client/assets/{_exerciseNumber_._stepNumber-03erOIGo.js.map → _exerciseNumber_._stepNumber-BNWGPi9m.js.map} +1 -1
- package/build/client/assets/_exerciseNumber_.finished-CdNhLhKg.js +2 -0
- package/build/client/assets/{_exerciseNumber_.finished-DQg4F1NL.js.map → _exerciseNumber_.finished-CdNhLhKg.js.map} +1 -1
- package/build/client/assets/_layout-BMa5nZcJ.js +2 -0
- package/build/client/assets/{_layout-DHoH74NH.js.map → _layout-BMa5nZcJ.js.map} +1 -1
- package/build/client/assets/{_layout-B4JGpA3A.js → _layout-CwTidn3v.js} +2 -2
- package/build/client/assets/{_layout-B4JGpA3A.js.map → _layout-CwTidn3v.js.map} +1 -1
- package/build/client/assets/{_layout-BJbMl6SJ.js → _layout-DV29dlKr.js} +2 -2
- package/build/client/assets/{_layout-BJbMl6SJ.js.map → _layout-DV29dlKr.js.map} +1 -1
- package/build/client/assets/{_layout-Bu0lel3p.js → _layout-Muw3ERYT.js} +3 -3
- package/build/client/assets/{_layout-Bu0lel3p.js.map → _layout-Muw3ERYT.js.map} +1 -1
- package/build/client/assets/{accordion-DLg7gJkp.js → accordion-C-sW--in.js} +2 -2
- package/build/client/assets/{accordion-DLg7gJkp.js.map → accordion-C-sW--in.js.map} +1 -1
- package/build/client/assets/account-Cc968svU.js +2 -0
- package/build/client/assets/account-Cc968svU.js.map +1 -0
- package/build/client/assets/app-BOqXK9hi.js +2 -0
- package/build/client/assets/{app-DJDjmdlu.js.map → app-BOqXK9hi.js.map} +1 -1
- package/build/client/assets/{app-b7uXHF5m.css → app-C3e6tFRf.css} +1 -1
- package/build/client/assets/{button-39zQyNX6.js → button-BS845Tjo.js} +2 -2
- package/build/client/assets/{button-39zQyNX6.js.map → button-BS845Tjo.js.map} +1 -1
- package/build/client/assets/{components-DUNtf72c.js → components-DrvY4pal.js} +4 -4
- package/build/client/assets/{components-DUNtf72c.js.map → components-DrvY4pal.js.map} +1 -1
- package/build/client/assets/diff-D0e_PrB7.js +2 -0
- package/build/client/assets/{diff-B3oaU_KB.js.map → diff-D0e_PrB7.js.map} +1 -1
- package/build/client/assets/{diff-BNCREJvf.js → diff-DtvfyjPI.js} +2 -2
- package/build/client/assets/{diff-BNCREJvf.js.map → diff-DtvfyjPI.js.map} +1 -1
- package/build/client/assets/{discord-CEOqKs_c.js → discord-BfP_Rny5.js} +2 -2
- package/build/client/assets/{discord-CEOqKs_c.js.map → discord-BfP_Rny5.js.map} +1 -1
- package/build/client/assets/discord-DILzAZN8.js +2 -0
- package/build/client/assets/discord-DILzAZN8.js.map +1 -0
- package/build/client/assets/{entry.client-CrlHhRMR.js → entry.client-CQusg5Iz.js} +2 -2
- package/build/client/assets/{entry.client-CrlHhRMR.js.map → entry.client-CQusg5Iz.js.map} +1 -1
- package/build/client/assets/epic-video-qHKPWPt1.js +3053 -0
- package/build/client/assets/epic-video-qHKPWPt1.js.map +1 -0
- package/build/client/assets/error-boundary-Beul7lrT.js +2 -0
- package/build/client/assets/{error-boundary-3zItlMUO.js.map → error-boundary-Beul7lrT.js.map} +1 -1
- package/build/client/assets/finished-DUKfL220.js +2 -0
- package/build/client/assets/{finished-rUzUjnEm.js.map → finished-DUKfL220.js.map} +1 -1
- package/build/client/assets/{index-CV3nxGFp.js → index-BHwOR8R1.js} +2 -2
- package/build/client/assets/{index-CV3nxGFp.js.map → index-BHwOR8R1.js.map} +1 -1
- package/build/client/assets/index-BOQWfIQC.js +36 -0
- package/build/client/assets/index-BOQWfIQC.js.map +1 -0
- package/build/client/assets/{index-DFqQCjCw.js → index-BPegC-d3.js} +2 -2
- package/build/client/assets/{index-DFqQCjCw.js.map → index-BPegC-d3.js.map} +1 -1
- package/build/client/assets/{index-LjRZeU7x.js → index-CB8bjE90.js} +2 -2
- package/build/client/assets/{index-LjRZeU7x.js.map → index-CB8bjE90.js.map} +1 -1
- package/build/client/assets/{index-C_B1-9rF.js → index-CGzylDPY.js} +2 -2
- package/build/client/assets/{index-C_B1-9rF.js.map → index-CGzylDPY.js.map} +1 -1
- package/build/client/assets/index-DbCT6N5p.js +2 -0
- package/build/client/assets/{index-DE-jwnOP.js.map → index-DbCT6N5p.js.map} +1 -1
- package/build/client/assets/{index-DDqzbGM2.js → index-cZQeGrqL.js} +2 -2
- package/build/client/assets/{index-DDqzbGM2.js.map → index-cZQeGrqL.js.map} +1 -1
- package/build/client/assets/{index-CLNXC84j.js → index-egcHQOpF.js} +2 -2
- package/build/client/assets/{index-CLNXC84j.js.map → index-egcHQOpF.js.map} +1 -1
- package/build/client/assets/index-oED4uZLa.js +2 -0
- package/build/client/assets/{index-mivnjq36.js.map → index-oED4uZLa.js.map} +1 -1
- package/build/client/assets/{loading-DW_I206H.js → loading-C2wPVvQw.js} +2 -2
- package/build/client/assets/{loading-DW_I206H.js.map → loading-C2wPVvQw.js.map} +1 -1
- package/build/client/assets/login-DoU7gifi.js +2 -0
- package/build/client/assets/{login-CdNej0Z7.js.map → login-DoU7gifi.js.map} +1 -1
- package/build/client/assets/manifest-3096dc61.js +1 -0
- package/build/client/assets/mdx-CsS30JUo.js +2 -0
- package/build/client/assets/{mdx-C9dqA6IZ.js.map → mdx-CsS30JUo.js.map} +1 -1
- package/build/client/assets/{misc-DIdEn_jt.js → misc-BtjCSy-T.js} +2 -2
- package/build/client/assets/{misc-DIdEn_jt.js.map → misc-BtjCSy-T.js.map} +1 -1
- package/build/client/assets/{nav-chevrons-B3SvZV8B.js → nav-chevrons-2hLTwAZb.js} +2 -2
- package/build/client/assets/{nav-chevrons-B3SvZV8B.js.map → nav-chevrons-2hLTwAZb.js.map} +1 -1
- package/build/client/assets/onboarding-Cu6eD7KS.js +2 -0
- package/build/client/assets/{onboarding-CC9zz4rl.js.map → onboarding-Cu6eD7KS.js.map} +1 -1
- package/build/client/assets/{pe-D5h19vSo.js → pe-DXT2FOp1.js} +2 -2
- package/build/client/assets/{pe-D5h19vSo.js.map → pe-DXT2FOp1.js.map} +1 -1
- package/build/client/assets/preferences-br0VSK51.js +2 -0
- package/build/client/assets/preferences-br0VSK51.js.map +1 -0
- package/build/client/assets/{presence-D1DPz__2.js → presence-CrYBA3ta.js} +3 -3
- package/build/client/assets/{presence-D1DPz__2.js.map → presence-CrYBA3ta.js.map} +1 -1
- package/build/client/assets/preview-C2y4Z0qO.js +2 -0
- package/build/client/assets/{preview-BEtmdi0E.js.map → preview-C2y4Z0qO.js.map} +1 -1
- package/build/client/assets/{product-CYOFfeJM.js → product-gqq_YQBW.js} +2 -2
- package/build/client/assets/{product-CYOFfeJM.js.map → product-gqq_YQBW.js.map} +1 -1
- package/build/client/assets/{progress-D6SP0Gec.js → progress-D-HsH4j3.js} +2 -2
- package/build/client/assets/{progress-D6SP0Gec.js.map → progress-D-HsH4j3.js.map} +1 -1
- package/build/client/assets/{progress-bar-CBDBzRQ2.js → progress-bar-CTPCfvDi.js} +2 -2
- package/build/client/assets/{progress-bar-CBDBzRQ2.js.map → progress-bar-CTPCfvDi.js.map} +1 -1
- package/build/client/assets/revalidation-ws-DYaJNyw1.js +2 -0
- package/build/client/assets/{revalidation-ws-DK5QOPlL.js.map → revalidation-ws-DYaJNyw1.js.map} +1 -1
- package/build/client/assets/{root-Bg-hxaOK.js → root-C1pLsthM.js} +3 -3
- package/build/client/assets/{root-Bg-hxaOK.js.map → root-C1pLsthM.js.map} +1 -1
- package/build/client/assets/{set-playground-CMoUFgkO.js → set-playground-DQzAhC0t.js} +2 -2
- package/build/client/assets/{set-playground-CMoUFgkO.js.map → set-playground-DQzAhC0t.js.map} +1 -1
- package/build/client/assets/{support-CPzYlWkd.js → support-lgEG2piy.js} +2 -2
- package/build/client/assets/{support-CPzYlWkd.js.map → support-lgEG2piy.js.map} +1 -1
- package/build/client/assets/tailwind-CRGTilRc.css +1 -0
- package/build/client/assets/test-CDWRwwO-.js +2 -0
- package/build/client/assets/{test-C8wkLh9a.js.map → test-CDWRwwO-.js.map} +1 -1
- package/build/client/assets/{tests-CiM4RPOf.js → tests-LWW8wCYZ.js} +3 -3
- package/build/client/assets/{tests-CiM4RPOf.js.map → tests-LWW8wCYZ.js.map} +1 -1
- package/build/client/assets/{tooltip-BoVikCa-.js → tooltip-Bp9KHnLy.js} +2 -2
- package/build/client/assets/{tooltip-BoVikCa-.js.map → tooltip-Bp9KHnLy.js.map} +1 -1
- package/build/client/assets/{use-event-source-M87p8Tme.js → use-event-source-AZJtQsFX.js} +2 -2
- package/build/client/assets/{use-event-source-M87p8Tme.js.map → use-event-source-AZJtQsFX.js.map} +1 -1
- package/build/client/assets/{user-CbbIYEs8.js → user-C0j04V55.js} +2 -2
- package/build/client/assets/{user-CbbIYEs8.js.map → user-C0j04V55.js.map} +1 -1
- package/build/client/assets/{version-CIF3cX3N.js → version-D61Qvt0X.js} +2 -2
- package/build/client/assets/{version-CIF3cX3N.js.map → version-D61Qvt0X.js.map} +1 -1
- package/build/client/assets/{workshop-config-C5sYl312.js → workshop-config-oL_FWDKq.js} +2 -2
- package/build/client/assets/{workshop-config-C5sYl312.js.map → workshop-config-oL_FWDKq.js.map} +1 -1
- package/build/server/index.js +517 -445
- package/build/server/index.js.map +1 -1
- package/package.json +3 -3
- package/build/client/assets/_exerciseNumber-PTdG9GGB.js +0 -2
- package/build/client/assets/_exerciseNumber_.finished-DQg4F1NL.js +0 -2
- package/build/client/assets/_layout-DHoH74NH.js +0 -2
- package/build/client/assets/account-DLDPrc9J.js +0 -2
- package/build/client/assets/account-DLDPrc9J.js.map +0 -1
- package/build/client/assets/app-DJDjmdlu.js +0 -2
- package/build/client/assets/diff-B3oaU_KB.js +0 -2
- package/build/client/assets/discord-CpIgvYus.js +0 -2
- package/build/client/assets/discord-CpIgvYus.js.map +0 -1
- package/build/client/assets/epic-video-D8ex9vao.js +0 -2
- package/build/client/assets/epic-video-D8ex9vao.js.map +0 -1
- package/build/client/assets/error-boundary-3zItlMUO.js +0 -2
- package/build/client/assets/finished-rUzUjnEm.js +0 -2
- package/build/client/assets/index-BajUQsFT.js +0 -3053
- package/build/client/assets/index-BajUQsFT.js.map +0 -1
- package/build/client/assets/index-DE-jwnOP.js +0 -2
- package/build/client/assets/index-DH1w3QmP.js +0 -36
- package/build/client/assets/index-DH1w3QmP.js.map +0 -1
- package/build/client/assets/index-mivnjq36.js +0 -2
- package/build/client/assets/login-CdNej0Z7.js +0 -2
- package/build/client/assets/manifest-62ea49c4.js +0 -1
- package/build/client/assets/mdx-C9dqA6IZ.js +0 -2
- package/build/client/assets/onboarding-CC9zz4rl.js +0 -2
- package/build/client/assets/preview-BEtmdi0E.js +0 -2
- package/build/client/assets/request-info-vBkaf3Rk.js +0 -2
- package/build/client/assets/request-info-vBkaf3Rk.js.map +0 -1
- package/build/client/assets/revalidation-ws-DK5QOPlL.js +0 -2
- package/build/client/assets/tailwind-B5AAMtGC.css +0 -1
- package/build/client/assets/test-C8wkLh9a.js +0 -2
- /package/build/client/assets/{index-DUnRvy1A.css → epic-video-DUnRvy1A.css} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epic-web/workshop-app",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@epic-web/invariant": "^1.0.0",
|
|
45
45
|
"@epic-web/remember": "^1.1.0",
|
|
46
46
|
"@epic-web/restore-scroll": "^1.1.1",
|
|
47
|
-
"@epic-web/workshop-presence": "5.
|
|
48
|
-
"@epic-web/workshop-utils": "5.
|
|
47
|
+
"@epic-web/workshop-presence": "5.7.1",
|
|
48
|
+
"@epic-web/workshop-utils": "5.7.1",
|
|
49
49
|
"@mdx-js/mdx": "^3.0.1",
|
|
50
50
|
"@mux/mux-player-react": "^3.0.0",
|
|
51
51
|
"@nasa-gcn/remix-seo": "^2.0.1",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as r,b as l,i as c}from"./index-C_B1-9rF.js";import{E as m}from"./index-CLNXC84j.js";import{E as a}from"./epic-video-D8ex9vao.js";import{u as d}from"./revalidation-ws-DK5QOPlL.js";import{M as p,E as x}from"./mdx-C9dqA6IZ.js";import{P as u}from"./progress-D6SP0Gec.js";import{g as f}from"./misc-DIdEn_jt.js";import{g as h}from"./seo-pBpFCWsy.js";import{u as b,L as j}from"./components-DUNtf72c.js";import"./index-DH1w3QmP.js";import"./request-info-vBkaf3Rk.js";import"./tooltip-BoVikCa-.js";import"./pe-D5h19vSo.js";import"./index-BajUQsFT.js";import"./loading-DW_I206H.js";import"./user-CbbIYEs8.js";import"./workshop-config-C5sYl312.js";import"./progress-bar-CBDBzRQ2.js";const D=({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 F(){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(a,{epicVideoInfosPromise:e.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(p,{code:e.exercise.instructionsCode,components:g})})}):"No instructions yet..."})]},e.articleId),r.jsx(m,{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(x,{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 G(){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{G as ErrorBoundary,F as default,D as meta};
|
|
2
|
-
//# sourceMappingURL=_exerciseNumber-PTdG9GGB.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,r as n}from"./index-C_B1-9rF.js";import{E as a}from"./index-CLNXC84j.js";import{E as c}from"./epic-video-D8ex9vao.js";import{L as m}from"./loading-DW_I206H.js";import{N as x}from"./nav-chevrons-B3SvZV8B.js";import{u as d}from"./revalidation-ws-DK5QOPlL.js";import{M as f,E as p}from"./mdx-C9dqA6IZ.js";import{P as u}from"./progress-D6SP0Gec.js";import{a as h}from"./misc-DIdEn_jt.js";import{g as b}from"./seo-pBpFCWsy.js";import{u as j,L as g}from"./components-DUNtf72c.js";import"./index-DH1w3QmP.js";import"./request-info-vBkaf3Rk.js";import"./tooltip-BoVikCa-.js";import"./pe-D5h19vSo.js";import"./index-BajUQsFT.js";import"./user-CbbIYEs8.js";import"./workshop-config-C5sYl312.js";import"./progress-bar-CBDBzRQ2.js";const z=({data:r,matches:i})=>{var o;const t=r==null?void 0:r.exercise.exerciseNumber.toString().padStart(2,"0"),s=(o=i.find(l=>l.id==="root"))==null?void 0:o.data;return!r||!s?[{title:"🦉 | Error"}]:b({title:`🦉 | ${t}. ${r.exercise.title} | ${s==null?void 0:s.workshopTitle}`,description:`Elaboration for ${t}. ${r.exercise.title}`,ogTitle:`Finished: ${r.exercise.title}`,ogDescription:`Elaboration for exercise ${Number(t)}`,instructor:s.instructor,requestInfo:s.requestInfo})},N={h1:()=>null};function G(){const r=j(),i=r.exercise.exerciseNumber.toString().padStart(2,"0");return d({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(g,{to:`/${i}`,className:"hover:underline",children:`${i}. ${r.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:r.articleId,children:r.exercise.finishedCode?e.jsx(c,{epicVideoInfosPromise:r.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(f,{code:r.exercise.finishedCode,components:N})})}):"No finished instructions yet..."}),e.jsx(a,{elementQuery:`#${r.articleId}`}),e.jsx(u,{type:"finished",exerciseNumber:r.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:r.exerciseFinished.file,relativePath:r.exerciseFinished.relativePath}),e.jsx(x,{prev:r.prevStepLink,next:r.nextStepLink})]})]}),e.jsx(v,{exerciseFormEmbedUrl:r.exerciseFormEmbedUrl,exerciseTitle:r.exercise.title})]})})}function v({exerciseFormEmbedUrl:r,exerciseTitle:i}){const[t,s]=n.useState(!1);return e.jsxs("div",{className:"relative min-h-full sm:min-h-[unset] sm:flex-shrink-0",children:[t?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(m,{children:e.jsxs("span",{children:["Loading ",i," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>s(!0),onError:()=>s(!0),title:"Elaboration",src:r,className:h("absolute inset-0 flex h-full w-full transition-opacity duration-300",t?"opacity-100":"opacity-0")})]})}export{G as default,z as meta};
|
|
2
|
-
//# sourceMappingURL=_exerciseNumber_.finished-DQg4F1NL.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as p,j as r,O as Q}from"./index-C_B1-9rF.js";import{E as Z}from"./index-CLNXC84j.js";import{G as J}from"./error-boundary-3zItlMUO.js";import{N as X}from"./nav-chevrons-B3SvZV8B.js";import{u as ee}from"./revalidation-ws-DK5QOPlL.js";import{M as re,L as b,E as te}from"./mdx-C9dqA6IZ.js";import{P as oe}from"./progress-D6SP0Gec.js";import{S as D}from"./set-playground-CMoUFgkO.js";import{g as ne}from"./seo-pBpFCWsy.js";import{b as se,a as A,I as C,i as ie}from"./misc-DIdEn_jt.js";import{E as ae}from"./epic-video-D8ex9vao.js";import{S,d as le,j as k,A as _,h as I,P as L,f as j,g as F,k as ce,D as pe,C as ue,l as de,u as fe,R as me,e as xe}from"./tooltip-BoVikCa-.js";import{u as he}from"./request-info-vBkaf3Rk.js";import{u as P,L as v,e as ve,A as ge}from"./components-DUNtf72c.js";import{h as Pe,R as je,u as Ne,F as be,P as Ce}from"./index-CV3nxGFp.js";import"./progress-bar-CBDBzRQ2.js";import"./pe-D5h19vSo.js";import"./index-DFqQCjCw.js";import"./index-DH1w3QmP.js";import"./index-BajUQsFT.js";import"./loading-DW_I206H.js";import"./user-CbbIYEs8.js";import"./workshop-config-C5sYl312.js";const $=p.createContext(null);function Se(){const e=p.useContext($);if(!e)throw new Error("useStepContext must be used within a StepContext.Provider");return e}function Ee({children:e,inBrowserBrowserRef:o}){return r.jsx($.Provider,{value:{inBrowserBrowserRef:o},children:e})}const we={DiffLink:E,PrevDiffLink:Re,NextDiffLink:Oe,InlineFile:Ae,LinkToApp:ke};function ye({inBrowserBrowserRef:e}){const o=P();return o.exerciseStepApp.instructionsCode?r.jsx(Ee,{inBrowserBrowserRef:e,children:r.jsx(ae,{epicVideoInfosPromise:o.epicVideoInfosPromise,children:r.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:r.jsx(re,{code:o.exerciseStepApp.instructionsCode,components:we})})})}):null}function T(e,o,t){const n=new URLSearchParams(e);return t===null?n.delete(o):n.set(o,t),n}function Oe({app:e=0,fullPage:o=!1,children:t}){return r.jsx(E,{app1:e,app2:e+1,fullPage:o,children:t})}function Re({app:e=-1,fullPage:o=!1,children:t}){return r.jsx(E,{app1:e,app2:e+1,fullPage:o,children:t})}function E({app1:e=0,app2:o=1,children:t,fullPage:n=!1,to:i}){const s=P();if(!i&&!e&&!o)return r.jsx("callout-danger",{className:"notification",children:r.jsx("div",{className:"title",children:"DiffLink Error: invalid input"})});function a(d){var f;if(typeof d=="number"){const m=s.exerciseIndex+d;return(f=s.allApps[m])==null?void 0:f.name}if(!d)return null;for(const{name:m,stepName:x}of s.allApps)if(d===m||d===x)return m;return null}if(i){const d=new URLSearchParams(i);e=d.get("app1"),o=d.get("app2")}const l=a(e),c=a(o);if(!l||!c)return r.jsxs("callout-danger",{className:"notification",children:[r.jsx("div",{className:"title",children:"DiffLink Error: invalid input"}),!l&&r.jsxs("div",{children:['app1: "',e,'" is not a valid app name']}),!c&&r.jsxs("div",{children:['app2: "',o,'" is not a valid app name']})]});i||(i=`app1=${l}&app2=${c}`);const u=n?`/diff?${i}`:`?${decodeURIComponent(T(new URLSearchParams,"preview",`diff&${i}`).toString())}`;return t||(t=r.jsxs("span",{children:["Go to Diff ",n?"":"Preview"," from: ",r.jsx("code",{children:l})," to:"," ",r.jsx("code",{children:c})]})),r.jsx(v,{to:u,children:t})}function Ae({file:e,type:o="playground",children:t=r.jsx("code",{children:e}),...n}){const i=P(),s=i[o]||i[i.type],a=r.jsxs("div",{className:"launch-editor-button-wrapper flex underline underline-offset-4",children:[t," ",r.jsx("svg",{height:24,width:24,children:r.jsx("use",{href:`${ie}#Keyboard`})})]});return ENV.EPICSHOP_DEPLOYED&&s?r.jsx("div",{className:"inline-block grow",children:r.jsx(b,{appFile:e,appName:s.name,...n,children:a})}):s?r.jsx("div",{className:"inline-block grow",children:r.jsx(b,{appFile:e,appName:s.name,...n,children:a})}):o==="playground"?r.jsx(S,{content:"You must 'Set to Playground' before opening a file",children:r.jsx("div",{className:"inline-block grow cursor-not-allowed",children:a})}):r.jsx(r.Fragment,{children:"children"})}function De(e){return e==="problem"?"problem":e==="solution"?"solution":"playground"}function ke({to:e,children:o=r.jsx("code",{children:e.toString()}),...t}){var m;const[n]=ve(),i=`?${T(n,"pathname",e.toString()).toString()}`,s=P(),a=De(n.get("preview")),l=he(),c=s[a],u=(c==null?void 0:c.dev.type)==="script"?se({domain:l.domain,port:c.dev.portNumber}):((m=s.playground)==null?void 0:m.dev.type)==="browser"?s.playground.dev.pathname:null,{inBrowserBrowserRef:d}=Se(),f=u?u.slice(0,-1)+e.toString():null;return r.jsxs("div",{className:"inline-flex items-center justify-between gap-1",children:[r.jsx(v,{to:i,...t,className:A(t.className,{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":void 0,onClick:x=>{var O,R;ENV.EPICSHOP_DEPLOYED&&x.preventDefault(),(O=t.onClick)==null||O.call(t,x),(R=d.current)==null||R.handleExtrnalNavigation(e.toString())},children:o}),f?r.jsx(S,{content:"Open in new tab",children:r.jsx("a",{href:f,target:"_blank",rel:"noreferrer",className:A("flex aspect-square items-center justify-center",{"cursor-not-allowed":ENV.EPICSHOP_DEPLOYED}),title:ENV.EPICSHOP_DEPLOYED?"Cannot link to app in deployed version":"Open in new tab",onClick:x=>{ENV.EPICSHOP_DEPLOYED&&x.preventDefault()},children:r.jsx(C,{name:"ExternalLink"})})}):null]})}var w="Popover",[M,hr]=le(w,[k]),N=k(),[_e,h]=M(w),H=e=>{const{__scopePopover:o,children:t,open:n,defaultOpen:i,onOpenChange:s,modal:a=!1}=e,l=N(o),c=p.useRef(null),[u,d]=p.useState(!1),[f=!1,m]=fe({prop:n,defaultProp:i,onChange:s});return r.jsx(me,{...l,children:r.jsx(_e,{scope:o,contentId:xe(),triggerRef:c,open:f,onOpenChange:m,onOpenToggle:p.useCallback(()=>m(x=>!x),[m]),hasCustomAnchor:u,onCustomAnchorAdd:p.useCallback(()=>d(!0),[]),onCustomAnchorRemove:p.useCallback(()=>d(!1),[]),modal:a,children:t})})};H.displayName=w;var U="PopoverAnchor",Ie=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=h(U,t),s=N(t),{onCustomAnchorAdd:a,onCustomAnchorRemove:l}=i;return p.useEffect(()=>(a(),()=>l()),[a,l]),r.jsx(_,{...s,...n,ref:o})});Ie.displayName=U;var V="PopoverTrigger",Y=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=h(V,t),s=N(t),a=I(o,i.triggerRef),l=r.jsx(L.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":W(i.open),...n,ref:a,onClick:j(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:r.jsx(_,{asChild:!0,...s,children:l})});Y.displayName=V;var y="PopoverPortal",[Le,Fe]=M(y,{forceMount:void 0}),B=e=>{const{__scopePopover:o,forceMount:t,children:n,container:i}=e,s=h(y,o);return r.jsx(Le,{scope:o,forceMount:t,children:r.jsx(F,{present:t||s.open,children:r.jsx(Ce,{asChild:!0,container:i,children:n})})})};B.displayName=y;var g="PopoverContent",G=p.forwardRef((e,o)=>{const t=Fe(g,e.__scopePopover),{forceMount:n=t.forceMount,...i}=e,s=h(g,e.__scopePopover);return r.jsx(F,{present:n||s.open,children:s.modal?r.jsx($e,{...i,ref:o}):r.jsx(Te,{...i,ref:o})})});G.displayName=g;var $e=p.forwardRef((e,o)=>{const t=h(g,e.__scopePopover),n=p.useRef(null),i=I(o,n),s=p.useRef(!1);return p.useEffect(()=>{const a=n.current;if(a)return Pe(a)},[]),r.jsx(je,{as:ce,allowPinchZoom:!0,children:r.jsx(q,{...e,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:j(e.onCloseAutoFocus,a=>{var l;a.preventDefault(),s.current||(l=t.triggerRef.current)==null||l.focus()}),onPointerDownOutside:j(e.onPointerDownOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;s.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:j(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),Te=p.forwardRef((e,o)=>{const t=h(g,e.__scopePopover),n=p.useRef(!1),i=p.useRef(!1);return r.jsx(q,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,l;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(n.current||(l=t.triggerRef.current)==null||l.focus(),s.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:s=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(n.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((u=t.triggerRef.current)==null?void 0:u.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),q=p.forwardRef((e,o)=>{const{__scopePopover:t,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,m=h(g,t),x=N(t);return Ne(),r.jsx(be,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:s,children:r.jsx(pe,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:r.jsx(ue,{"data-state":W(m.open),role:"dialog",id:m.contentId,...x,...f,ref:o,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),K="PopoverClose",Me=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=h(K,t);return r.jsx(L.button,{type:"button",...n,ref:o,onClick:j(e.onClick,()=>i.onOpenChange(!1))})});Me.displayName=K;var He="PopoverArrow",Ue=p.forwardRef((e,o)=>{const{__scopePopover:t,...n}=e,i=N(t);return r.jsx(de,{...i,...n,ref:o})});Ue.displayName=He;function W(e){return e?"open":"closed"}var Ve=H,Ye=Y,Be=B,Ge=G;function qe({diffFilesPromise:e}){var l,c;const o=P(),[t,n]=p.useState(!1),i=p.useRef(null);function s(){n(!1)}const a=(l=o.playground)==null?void 0:l.appName;return r.jsx(r.Fragment,{children:r.jsxs(Ve,{open:t,onOpenChange:n,children:[r.jsx(Ye,{asChild:!0,children:r.jsxs("button",{className:"flex h-full items-center gap-1 border-r px-6 py-3 font-mono text-sm uppercase","aria-label":"Relevant Files",children:[r.jsx(C,{name:"Files"}),"Files"]})}),r.jsx(Be,{children:r.jsx(Ge,{ref:i,className:"slideRightContent lg:slideUpContent invert-theme z-10 select-none rounded bg-background px-9 py-8 text-foreground",align:"start",sideOffset:5,children:r.jsxs("div",{className:"launch-editor-wrapper",children:[r.jsx("strong",{className:"inline-block px-2 pb-4 font-semibold uppercase",children:"Relevant Files"}),o.problem&&((c=o.playground)==null?void 0:c.appName)!==o.problem.name?r.jsx("div",{className:"mb-2 rounded p-1 font-mono font-medium",children:r.jsx(D,{appName:o.problem.name})}):null,r.jsx("div",{id:"files",children:r.jsx(p.Suspense,{fallback:r.jsx(S,{content:"Loading diff",children:r.jsx("div",{className:"flex justify-center",children:r.jsx(C,{name:"Refresh",className:"h-8 w-8 animate-spin"})})}),children:r.jsx(ge,{resolve:e,errorElement:r.jsx("div",{className:"text-foreground-danger",children:"Something went wrong."}),children:u=>{if(!u)return r.jsx("p",{className:"text-foreground-danger",children:"Unable to determine diff"});if(typeof u=="string")return r.jsx("p",{className:"text-foreground-danger",children:u});if(!u.length)return r.jsx("p",{children:"No files changed"});const d=a||ENV.EPICSHOP_GITHUB_ROOT?{}:{title:"You must 'Set to Playground' before opening a file",className:"not-allowed"};return r.jsxs("ul",{...d,children:[u.length>1&&!ENV.EPICSHOP_DEPLOYED?r.jsx("div",{className:"mb-2 border-b border-b-gray-50 border-opacity-50 pb-2 font-sans",children:r.jsx(b,{appFile:u.map(f=>`${f.path},${f.line},1`),appName:"playground",onUpdate:s,children:r.jsx("p",{children:"Open All Files"})})}):null,u.map(f=>{var m;return r.jsx("li",{"data-state":f.status,children:r.jsx(b,{appFile:`${f.path},${f.line},1`,appName:ENV.EPICSHOP_DEPLOYED?((m=o.problem)==null?void 0:m.name)??"playground":"playground",onUpdate:s,children:r.jsx("code",{children:f.path})})},f.path)})]})}})})})]})})})]})})}function z(e,o){var a;const t=(e==null?void 0:e.exerciseStepApp.exerciseNumber.toString().padStart(2,"0"))??"00",n=(e==null?void 0:e.exerciseStepApp.stepNumber.toString().padStart(2,"0"))??"00",i={problem:"💪",solution:"🏁"}[(e==null?void 0:e.type)??"problem"],s=((a=e==null?void 0:e[e.type])==null?void 0:a.title)??"N/A";return{emoji:i,stepNumber:n,title:s,exerciseNumber:t,exerciseTitle:(e==null?void 0:e.exerciseTitle)??"Unknown exercise",workshopTitle:o,type:(e==null?void 0:e.type)??"problem"}}const vr=({data:e,matches:o,params:t})=>{var u;const n=(u=o.find(d=>d.id==="root"))==null?void 0:u.data;if(!e||!n)return[{title:"🦉 | Error"}];const{emoji:i,stepNumber:s,title:a,exerciseNumber:l,exerciseTitle:c}=z(e);return ne({title:`${i} | ${s}. ${a} | ${l}. ${c} | ${n.workshopTitle}`,description:`${t.type} step for exercise ${l}. ${c}`,ogTitle:a,ogDescription:`${c} step ${Number(s)} ${t.type}`,instructor:n.instructor,requestInfo:n.requestInfo})};function gr(){var n;const e=P(),o=p.useRef(null),t=z(e);return ee({watchPaths:[`${e.exerciseStepApp.relativePath}/README.mdx`]}),r.jsx("div",{className:"flex max-w-full flex-grow flex-col",children:r.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:[r.jsxs("div",{className:"relative flex flex-col sm:col-span-1 sm:row-span-1 sm:h-full lg:border-r",children:[r.jsx("h1",{className:"h-14 border-b pl-10 pr-5 text-sm font-medium leading-tight",children:r.jsxs("div",{className:"flex h-14 flex-wrap items-center justify-between gap-x-2 py-2",children:[r.jsxs("div",{className:"flex items-center justify-start gap-x-2 uppercase",children:[r.jsxs(v,{to:`/${t.exerciseNumber}`,className:"hover:underline",children:[t.exerciseNumber,". ",t.exerciseTitle]}),"/",r.jsxs(v,{to:".",className:"hover:underline",children:[t.stepNumber,". ",t.title," (",t.emoji," ",t.type,")"]})]}),e.problem&&((n=e.playground)==null?void 0:n.appName)!==e.problem.name?r.jsx("div",{className:"hidden md:block",children:r.jsx(D,{appName:e.problem.name})}):null]})}),r.jsxs("article",{id:e.articleId,className:"shadow-on-scrollbox flex h-full w-full max-w-none flex-1 scroll-pt-6 flex-col justify-between space-y-6 overflow-y-auto p-2 scrollbar-thin scrollbar-thumb-scrollbar sm:p-10 sm:pt-8",children:[e.exerciseStepApp.instructionsCode?r.jsx(ye,{inBrowserBrowserRef:o}):r.jsx("div",{className:"flex h-full items-center justify-center text-lg",children:r.jsx("p",{children:"No instructions yet..."})}),r.jsxs("div",{className:"mt-auto flex justify-between",children:[e.prevStepLink?r.jsx(v,{to:e.prevStepLink.to,"aria-label":"Previous Step",prefetch:"intent",children:"← Previous"}):r.jsx("span",{}),e.nextStepLink?r.jsx(v,{to:e.nextStepLink.to,"aria-label":"Next Step",prefetch:"intent",children:"Next →"}):r.jsx("span",{})]})]},e.articleId),r.jsx(Z,{elementQuery:`#${e.articleId}`},`scroll-${e.articleId}`),e.type==="solution"?r.jsx(oe,{type:"step",exerciseNumber:e.exerciseStepApp.exerciseNumber,stepNumber:e.exerciseStepApp.stepNumber,className:"h-14 border-t px-6"}):null,r.jsxs("div",{className:"flex h-16 justify-between border-b-4 border-t lg:border-b-0",children:[r.jsx("div",{children:r.jsx("div",{className:"h-full",children:r.jsx(qe,{diffFilesPromise:e.diffFiles})})}),r.jsx(te,{appName:e.exerciseStepApp.name,relativePath:e.exerciseStepApp.relativePath}),r.jsx(X,{prev:e.prevStepLink?{to:e.prevStepLink.to,"aria-label":"Previous Step"}:null,next:e.nextStepLink?{to:e.nextStepLink.to,"aria-label":"Next Step"}:null})]})]}),r.jsx(Q,{})]})})}function Pr(){return r.jsx(J,{statusHandlers:{404:()=>r.jsx("p",{children:"Sorry, we couldn't find an app here."})}})}export{Pr as ErrorBoundary,gr as default,vr as meta};
|
|
2
|
-
//# sourceMappingURL=_layout-DHoH74NH.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u,j as e}from"./index-C_B1-9rF.js";import{B as a}from"./button-39zQyNX6.js";import{I as o}from"./misc-DIdEn_jt.js";import{S as l}from"./tooltip-BoVikCa-.js";import{u as x,a as h}from"./user-CbbIYEs8.js";import{u as p}from"./workshop-config-C5sYl312.js";import{u as j}from"./presence-D1DPz__2.js";import{u as g}from"./index-BajUQsFT.js";import{L as r,F as c}from"./components-DUNtf72c.js";import"./request-info-vBkaf3Rk.js";const S={getSitemapEntries:()=>null};function f(){const{product:{host:s}}=p();return`https://${s}/discord`}function A(){const s=x(),n=h(),i=j(),t=g(),m=f(),d=u().state==="submitting";return e.jsxs("main",{className:"container flex h-full w-full max-w-3xl flex-grow flex-col items-center justify-center gap-4",children:[s.imageUrlLarge?e.jsx("img",{className:"h-36 w-36 rounded-full",alt:(n==null?void 0:n.displayName)??s.name??s.email,src:s.imageUrlLarge}):e.jsx(o,{name:"User",className:"flex-shrink-0",size:"lg"}),e.jsx("h1",{className:"mb-1 text-2xl",children:"Your Account"}),e.jsx("p",{className:"text-center text-gray-700 dark:text-gray-300",children:s.name?`Hi ${(n==null?void 0:n.displayName)??s.name}, your device is logged in with ${s.email}.`:`Your device is logged in with ${s.email}.`}),n?e.jsx(e.Fragment,{children:e.jsxs("p",{className:"text-center text-gray-700 dark:text-gray-300",children:["And you are connected to discord as"," ",e.jsx("a",{href:`https://discord.com/users/${n.id}`,target:"_blank",rel:"noopener noreferrer",className:"underline",children:n.displayName}),"."]})}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(r,{to:m,className:"inline-flex items-center gap-2 underline",children:[e.jsx(o,{name:"Discord",size:"lg"}),"Connect Discord"]}),e.jsx(l,{content:"This will give you access to the exclusive Discord channels for Epic Web",children:e.jsx(o,{name:"Question",tabIndex:0})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(c,{method:"POST",children:[e.jsx("input",{name:"optOut",type:"hidden",value:i!=null&&i.optOut?"false":"true"}),e.jsxs(a,{varient:"mono",name:"intent",value:"presence-opt-out",children:[i!=null&&i.optOut?"Opt in to":"Opt out of"," presence"]})]}),e.jsx(l,{content:"This controls whether your name and avatar are displayed in the pile of faces in navigation",children:e.jsx(o,{name:"Question",tabIndex:0})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(c,{method:"post",children:e.jsx(a,{varient:"mono",name:"intent",value:"logout",children:"Log device out"})}),e.jsx(l,{content:e.jsxs("div",{children:["Note: it is your ",e.jsx("i",{className:"italic",children:"device"})," that's logged in, not your browser.",e.jsx("br",{}),"So all browsers on this device will be logged in with the same account on this device."]}),children:e.jsx(o,{name:"Question",tabIndex:0})})]}),e.jsx("hr",{className:"w-full"}),e.jsxs("div",{children:[e.jsx("h2",{className:"mb-2 text-xl",children:"Video Player Preferences"}),e.jsxs(c,{method:"post",className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:"minResolution",children:"Minimum Resolution:"}),e.jsxs("select",{id:"minResolution",name:"minResolution",defaultValue:t==null?void 0:t.minResolution,children:[e.jsx("option",{value:"",children:"Auto"}),e.jsx("option",{value:"480",children:"480p"}),e.jsx("option",{value:"720",children:"720p"}),e.jsx("option",{value:"1080",children:"1080p"}),e.jsx("option",{value:"1440",children:"1440p"}),e.jsx("option",{value:"2160",children:"2160p (4K)"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("label",{htmlFor:"maxResolution",children:"Maximum Resolution:"}),e.jsxs("select",{id:"maxResolution",name:"maxResolution",defaultValue:t==null?void 0:t.maxResolution,children:[e.jsx("option",{value:"",children:"Auto"}),e.jsx("option",{value:"720",children:"720p"}),e.jsx("option",{value:"1080",children:"1080p"}),e.jsx("option",{value:"1440",children:"1440p"}),e.jsx("option",{value:"2160",children:"2160p (4K)"})]})]}),e.jsx(a,{varient:"mono",type:"submit",name:"intent",value:"update-player-preferences",disabled:d,children:d?"Updating...":"Update Player Preferences"})]})]}),e.jsx("hr",{className:"w-full"}),e.jsxs("p",{children:["Check"," ",e.jsx(r,{to:"/onboarding",className:"underline",children:"/onboarding"})," ","if you'd like to review onboarding again."]}),e.jsxs("p",{children:["Check"," ",e.jsx(r,{to:"/support",className:"underline",children:"/support"})," ","if you need support."]})]})}export{A as default,S as handle};
|
|
2
|
-
//# sourceMappingURL=account-DLDPrc9J.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"account-DLDPrc9J.js","sources":["../../../app/routes/_app+/account.tsx"],"sourcesContent":["import { deleteCache } from '@epic-web/workshop-utils/cache.server'\nimport {\n\tdeleteDb,\n\trequireAuthInfo,\n\tsetPlayerPreferences,\n\tsetPresencePreferences,\n} from '@epic-web/workshop-utils/db.server'\nimport { type SEOHandle } from '@nasa-gcn/remix-seo'\nimport { redirect, type LoaderFunctionArgs } from '@remix-run/node'\nimport { Form, Link, useNavigation } from '@remix-run/react'\nimport { Button } from '#app/components/button.tsx'\nimport { Icon } from '#app/components/icons.tsx'\nimport { SimpleTooltip } from '#app/components/ui/tooltip.js'\nimport { useOptionalDiscordMember, useUser } from '#app/components/user.tsx'\nimport { useWorkshopConfig } from '#app/components/workshop-config.tsx'\nimport { ensureUndeployed } from '#app/utils/misc.tsx'\nimport { usePresencePreferences } from '#app/utils/presence.tsx'\nimport { redirectWithToast } from '#app/utils/toast.server.ts'\nimport { usePlayerPreferences } from '../video-player/index.tsx'\n\nexport const handle: SEOHandle = {\n\tgetSitemapEntries: () => null,\n}\n\nexport async function loader({ request }: LoaderFunctionArgs) {\n\tensureUndeployed()\n\tawait requireAuthInfo({ request })\n\treturn {}\n}\n\nexport async function action({ request }: { request: Request }) {\n\tensureUndeployed()\n\tconst formData = await request.formData()\n\tconst intent = formData.get('intent')\n\tif (intent === 'logout') {\n\t\tawait deleteDb()\n\t\tawait deleteCache()\n\t\treturn redirectWithToast('/login', {\n\t\t\ttype: 'success',\n\t\t\ttitle: 'Logged out',\n\t\t\tdescription: 'Goodbye! Come back soon!',\n\t\t})\n\t} else if (intent === 'presence-opt-out') {\n\t\tconst optOut = formData.get('optOut') === 'true'\n\t\tawait setPresencePreferences({ optOut })\n\t\treturn redirectWithToast('/account', {\n\t\t\ttitle: optOut ? 'Opted out' : 'Opted in',\n\t\t\tdescription: `You are now ${optOut ? 'invisible' : 'visible'}.`,\n\t\t\ttype: 'success',\n\t\t})\n\t} else if (intent === 'update-player-preferences') {\n\t\tconst minResolution = formData.get('minResolution')\n\t\tconst maxResolution = formData.get('maxResolution')\n\t\tawait setPlayerPreferences({\n\t\t\tminResolution: minResolution ? Number(minResolution) : undefined,\n\t\t\tmaxResolution: maxResolution ? Number(maxResolution) : undefined,\n\t\t})\n\t\treturn redirectWithToast('/account', {\n\t\t\ttitle: 'Preferences updated',\n\t\t\tdescription: 'Your video player preferences have been updated.',\n\t\t\ttype: 'success',\n\t\t})\n\t}\n\n\treturn redirect('/account')\n}\n\nfunction useConnectDiscordURL() {\n\tconst {\n\t\tproduct: { host },\n\t} = useWorkshopConfig()\n\treturn `https://${host}/discord`\n}\n\nexport default function Account() {\n\tconst user = useUser()\n\tconst discordMember = useOptionalDiscordMember()\n\tconst presencePreferences = usePresencePreferences()\n\tconst playerPreferences = usePlayerPreferences()\n\tconst connectDiscordURL = useConnectDiscordURL()\n\tconst navigation = useNavigation()\n\n\tconst isSubmitting = navigation.state === 'submitting'\n\n\treturn (\n\t\t<main className=\"container flex h-full w-full max-w-3xl flex-grow flex-col items-center justify-center gap-4\">\n\t\t\t{user.imageUrlLarge ? (\n\t\t\t\t<img\n\t\t\t\t\tclassName=\"h-36 w-36 rounded-full\"\n\t\t\t\t\talt={discordMember?.displayName ?? user.name ?? user.email}\n\t\t\t\t\tsrc={user.imageUrlLarge}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Icon name=\"User\" className=\"flex-shrink-0\" size=\"lg\" />\n\t\t\t)}\n\t\t\t<h1 className=\"mb-1 text-2xl\">Your Account</h1>\n\t\t\t<p className=\"text-center text-gray-700 dark:text-gray-300\">\n\t\t\t\t{user.name\n\t\t\t\t\t? `Hi ${\n\t\t\t\t\t\t\tdiscordMember?.displayName ?? user.name\n\t\t\t\t\t\t}, your device is logged in with ${user.email}.`\n\t\t\t\t\t: `Your device is logged in with ${user.email}.`}\n\t\t\t</p>\n\t\t\t{discordMember ? (\n\t\t\t\t<>\n\t\t\t\t\t<p className=\"text-center text-gray-700 dark:text-gray-300\">\n\t\t\t\t\t\tAnd you are connected to discord as{' '}\n\t\t\t\t\t\t<a\n\t\t\t\t\t\t\thref={`https://discord.com/users/${discordMember.id}`}\n\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\tclassName=\"underline\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{discordMember.displayName}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t.\n\t\t\t\t\t</p>\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t<Link\n\t\t\t\t\t\tto={connectDiscordURL}\n\t\t\t\t\t\tclassName=\"inline-flex items-center gap-2 underline\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<Icon name=\"Discord\" size=\"lg\" />\n\t\t\t\t\t\tConnect Discord\n\t\t\t\t\t</Link>\n\t\t\t\t\t<SimpleTooltip content=\"This will give you access to the exclusive Discord channels for Epic Web\">\n\t\t\t\t\t\t<Icon name=\"Question\" tabIndex={0} />\n\t\t\t\t\t</SimpleTooltip>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t<Form method=\"POST\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tname=\"optOut\"\n\t\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\t\tvalue={presencePreferences?.optOut ? 'false' : 'true'}\n\t\t\t\t\t/>\n\t\t\t\t\t<Button varient=\"mono\" name=\"intent\" value=\"presence-opt-out\">\n\t\t\t\t\t\t{presencePreferences?.optOut ? 'Opt in to' : 'Opt out of'} presence\n\t\t\t\t\t</Button>\n\t\t\t\t</Form>\n\t\t\t\t<SimpleTooltip content=\"This controls whether your name and avatar are displayed in the pile of faces in navigation\">\n\t\t\t\t\t<Icon name=\"Question\" tabIndex={0} />\n\t\t\t\t</SimpleTooltip>\n\t\t\t</div>\n\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t<Form method=\"post\">\n\t\t\t\t\t<Button varient=\"mono\" name=\"intent\" value=\"logout\">\n\t\t\t\t\t\tLog device out\n\t\t\t\t\t</Button>\n\t\t\t\t</Form>\n\t\t\t\t<SimpleTooltip\n\t\t\t\t\tcontent={\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\tNote: it is your <i className=\"italic\">device</i> that's logged\n\t\t\t\t\t\t\tin, not your browser.\n\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\tSo all browsers on this device will be logged in with the same\n\t\t\t\t\t\t\taccount on this device.\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t<Icon name=\"Question\" tabIndex={0} />\n\t\t\t\t</SimpleTooltip>\n\t\t\t</div>\n\t\t\t<hr className=\"w-full\" />\n\t\t\t<div>\n\t\t\t\t<h2 className=\"mb-2 text-xl\">Video Player Preferences</h2>\n\t\t\t\t<Form method=\"post\" className=\"flex flex-col gap-4\">\n\t\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t\t<label htmlFor=\"minResolution\">Minimum Resolution:</label>\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\tid=\"minResolution\"\n\t\t\t\t\t\t\tname=\"minResolution\"\n\t\t\t\t\t\t\tdefaultValue={playerPreferences?.minResolution}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<option value=\"\">Auto</option>\n\t\t\t\t\t\t\t<option value=\"480\">480p</option>\n\t\t\t\t\t\t\t<option value=\"720\">720p</option>\n\t\t\t\t\t\t\t<option value=\"1080\">1080p</option>\n\t\t\t\t\t\t\t<option value=\"1440\">1440p</option>\n\t\t\t\t\t\t\t<option value=\"2160\">2160p (4K)</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"flex items-center gap-2\">\n\t\t\t\t\t\t<label htmlFor=\"maxResolution\">Maximum Resolution:</label>\n\t\t\t\t\t\t<select\n\t\t\t\t\t\t\tid=\"maxResolution\"\n\t\t\t\t\t\t\tname=\"maxResolution\"\n\t\t\t\t\t\t\tdefaultValue={playerPreferences?.maxResolution}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<option value=\"\">Auto</option>\n\t\t\t\t\t\t\t<option value=\"720\">720p</option>\n\t\t\t\t\t\t\t<option value=\"1080\">1080p</option>\n\t\t\t\t\t\t\t<option value=\"1440\">1440p</option>\n\t\t\t\t\t\t\t<option value=\"2160\">2160p (4K)</option>\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvarient=\"mono\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\tname=\"intent\"\n\t\t\t\t\t\tvalue=\"update-player-preferences\"\n\t\t\t\t\t\tdisabled={isSubmitting}\n\t\t\t\t\t>\n\t\t\t\t\t\t{isSubmitting ? 'Updating...' : 'Update Player Preferences'}\n\t\t\t\t\t</Button>\n\t\t\t\t</Form>\n\t\t\t</div>\n\t\t\t<hr className=\"w-full\" />\n\t\t\t<p>\n\t\t\t\tCheck{' '}\n\t\t\t\t<Link to=\"/onboarding\" className=\"underline\">\n\t\t\t\t\t/onboarding\n\t\t\t\t</Link>{' '}\n\t\t\t\tif you'd like to review onboarding again.\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\tCheck{' '}\n\t\t\t\t<Link to=\"/support\" className=\"underline\">\n\t\t\t\t\t/support\n\t\t\t\t</Link>{' '}\n\t\t\t\tif you need support.\n\t\t\t</p>\n\t\t</main>\n\t)\n}\n"],"names":["handle","getSitemapEntries","useConnectDiscordURL","product","host","useWorkshopConfig","Account","user","useUser","discordMember","useOptionalDiscordMember","presencePreferences","usePresencePreferences","playerPreferences","usePlayerPreferences","connectDiscordURL","isSubmitting","useNavigation","state","jsxs","className","children","imageUrlLarge","jsx","alt","displayName","name","email","src","Icon","size","Fragment","href","id","target","rel","Link","to","SimpleTooltip","content","tabIndex","Form","method","type","value","optOut","Button","varient","htmlFor","defaultValue","minResolution","maxResolution","disabled"],"mappings":"mbAoBO,MAAMA,EAAoB,CAChCC,kBAAmBA,IAAM,IAC1B,EA6CA,SAASC,GAAuB,CACzB,KAAA,CACLC,QAAS,CAAEC,KAAAA,CAAK,GACbC,EAAkB,EACtB,MAAO,WAAWD,CAAI,UACvB,CAEA,SAAwBE,GAAU,CACjC,MAAMC,EAAOC,IACPC,EAAgBC,IAChBC,EAAsBC,IACtBC,EAAoBC,IACpBC,EAAoBb,IAGpBc,EAFaC,IAEaC,QAAU,aAGzC,OAAAC,EAAAA,KAAC,OAAK,CAAAC,UAAU,8FACdC,SAAA,CAAAd,EAAKe,cACLC,EAAAA,IAAC,MAAA,CACAH,UAAU,yBACVI,KAAKf,GAAAA,YAAAA,EAAegB,cAAelB,EAAKmB,MAAQnB,EAAKoB,MACrDC,IAAKrB,EAAKe,aAAA,CACX,QAECO,EAAK,CAAAH,KAAK,OAAON,UAAU,gBAAgBU,KAAK,IAAK,CAAA,EAEtDP,EAAA,IAAA,KAAA,CAAGH,UAAU,gBAAgBC,SAAY,cAAA,CAAA,QACzC,IAAE,CAAAD,UAAU,+CACXC,SAAKd,EAAAmB,KACH,OACAjB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-
import{r as t,j as s}from"./index-C_B1-9rF.js";import{P as e}from"./preview-BEtmdi0E.js";import{u as i}from"./components-DUNtf72c.js";import"./misc-DIdEn_jt.js";import"./request-info-vBkaf3Rk.js";import"./button-39zQyNX6.js";import"./loading-DW_I206H.js";import"./index-DH1w3QmP.js";import"./tooltip-BoVikCa-.js";import"./pe-D5h19vSo.js";import"./progress-bar-CBDBzRQ2.js";function R(){const{appInfo:r}=i(),o=t.useRef(null);return s.jsx(e,{appInfo:r,inBrowserBrowserRef:o})}export{R as default};
|
|
2
|
-
//# sourceMappingURL=app-DJDjmdlu.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as o,j as r}from"./index-C_B1-9rF.js";import{d as e,a as m}from"./misc-DIdEn_jt.js";import{D as p}from"./diff-BNCREJvf.js";import{N as n}from"./nav-chevrons-B3SvZV8B.js";import{u as f,e as d}from"./components-DUNtf72c.js";import"./accordion-DLg7gJkp.js";import"./tooltip-BoVikCa-.js";import"./index-DFqQCjCw.js";import"./index-CV3nxGFp.js";import"./mdx-C9dqA6IZ.js";import"./epic-video-D8ex9vao.js";import"./index-DH1w3QmP.js";import"./request-info-vBkaf3Rk.js";import"./pe-D5h19vSo.js";import"./index-BajUQsFT.js";import"./loading-DW_I206H.js";import"./user-CbbIYEs8.js";import"./workshop-config-C5sYl312.js";import"./progress-bar-CBDBzRQ2.js";import"./revalidation-ws-DK5QOPlL.js";function b(){const i=f(),[t]=d();new URLSearchParams(t).set("forceFresh","diff");const a=o(),s=e.useSpinDelay(a.state!=="idle",{delay:200,minDuration:200});return r.jsxs("div",{className:m("grid h-full grid-rows-[1fr,auto]",{"cursor-wait opacity-30":s}),children:[r.jsx("div",{className:"overflow-y-auto",children:r.jsx(p,{diff:i.diff,allApps:i.allApps})}),r.jsx("div",{className:"flex h-16 items-center justify-end border-t",children:r.jsx(n,{prev:i.prevLink,next:i.nextLink})})]})}export{b as default};
|
|
2
|
-
//# sourceMappingURL=diff-B3oaU_KB.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e,h as d}from"./discord-CEOqKs_c.js";import"./index-C_B1-9rF.js";import"./misc-DIdEn_jt.js";import"./components-DUNtf72c.js";import"./user-CbbIYEs8.js";import"./workshop-config-C5sYl312.js";export{e as default,d as handle};
|
|
2
|
-
//# sourceMappingURL=discord-CpIgvYus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discord-CpIgvYus.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as p,j as e}from"./index-C_B1-9rF.js";import{u as L}from"./index-DH1w3QmP.js";import{M as S}from"./index-BajUQsFT.js";import{a as I,I as C}from"./misc-DIdEn_jt.js";import{L as v}from"./loading-DW_I206H.js";import{b as R}from"./user-CbbIYEs8.js";import{u as T}from"./workshop-config-C5sYl312.js";import{A as k,L as f}from"./components-DUNtf72c.js";const b=p.createContext(null);function $({children:r,epicVideoInfosPromise:s}){return e.jsx(b.Provider,{value:s,children:r})}function N(r){let s=new URL("https://epicweb.dev");try{s=new URL(r)}catch(u){return console.error(u),"EpicWeb.dev Video"}const i=s.pathname.split("/").filter(Boolean),t=i.includes("solution");let n=i.pop();const x=["problem","solution","embed","exercise"],a=u=>u&&!x.includes(u);for(;!a(n);)n=i.pop();if(!n)return"EpicWeb.dev Video";const l=n.split("-"),d=["the","a","an","and","but","or","for","nor","on","at","to","from","by","of","in","with","as","npm","git","ssh","cli"],c=["OAuth","UI","UX","API","CSS","HTML","JS","TS","SVG","AI","CSRF","CORS","HTTP","HTTPS","URL","URI","DB","SQL","JSON","YAML","YML","useActionData","useAsyncError","useAsyncValue","useBeforeUnload","useFetcher","useFetchers","useFormAction","useHref","useLoaderData","useLocation","useMatches","useNavigate","useNavigation","useNavigationType","useOutlet","useOutletContext","useParams","useResolvedPath","useRevalidator","useRouteError","useRouteLoaderData","useSearchParams","useSubmit","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useSyncExternalStore","useTransition","useForm","useFieldset","useFieldList","useEventSource","useHydrated","useAuthenticityToken","useShouldHydrate","useGlobalNavigationState","useLocales","useDelegatedAnchors","useDebounceFetcher","useFetcherType"],o=l.filter(Boolean).map((u,j)=>{var y;const h=u.toLowerCase(),g=c.find(E=>E.toLowerCase()===h);return g||(d.includes(h)&&j>0?h:((y=h[0])==null?void 0:y.toUpperCase())+h.slice(1))}).join(" ");return t?`${o} (🏁 solution)`:o}function P({url:r,title:s="Video Embed",loadingContent:i=e.jsx(v,{children:e.jsxs("span",{children:['Loading "',s,'"']})})}){const[t,n]=p.useState(!1);return e.jsxs("div",{className:"relative aspect-video w-full flex-shrink-0 shadow-lg dark:shadow-gray-800",children:[t?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:i}),e.jsx("iframe",{onLoad:()=>n(!0),onError:()=>n(!0),src:r,className:I("absolute inset-0 flex h-full w-full transition-opacity duration-300",t?"opacity-100":"opacity-0"),title:s,sandbox:"allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",allowFullScreen:!0})]})}function w({url:r,title:s}){return e.jsxs("a",{href:r,target:"_blank",className:"flex items-center gap-1 text-base no-underline opacity-70 transition hover:underline hover:opacity-100",rel:"noreferrer",children:[e.jsx(C,{className:"flex-shrink-0",name:"Video",size:"lg"}),s," ",e.jsx("span",{"aria-hidden":!0,children:"↗︎"})]})}function _({url:r,title:s=N(r)}){const{product:{host:i,displayName:t}}=T(),n=R(),x=p.useContext(b),a=e.jsx("div",{children:e.jsx(w,{url:r,title:s})});return e.jsx("div",{children:e.jsx(p.Suspense,{fallback:e.jsxs("div",{children:[e.jsx("div",{className:"flex aspect-video w-full items-center justify-center",children:e.jsx(v,{children:s})}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[a,e.jsx("div",{className:"h-[32px]"})]})]}),children:e.jsx(k,{errorElement:e.jsx("div",{children:"Sorry, failed loading videos. Check the terminal output?"}),resolve:x,children:l=>{const d=l==null?void 0:l[r],c=ENV.EPICSHOP_DEPLOYED?e.jsxs("div",{children:[e.jsx(f,{to:ENV.EPICSHOP_GITHUB_REPO,className:"underline",children:"Run locally"})," for transcripts"]}):e.jsxs("div",{children:[e.jsx(f,{to:"/login",className:"underline",children:n?"Upgrade":"Login"})," for transcripts"]});if(!d)return e.jsxs("div",{children:[e.jsx(m,{url:r,title:s}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[a,c]})]});const o=d;return o.status==="success"?e.jsx(U,{url:r,title:s,muxPlaybackId:o.muxPlaybackId,transcript:o.transcript}):o.type==="region-restricted"?e.jsxs("div",{children:[e.jsxs("div",{className:"flex aspect-video min-h-full min-w-full flex-col items-center justify-start gap-2 overflow-y-scroll border-2 p-4 lg:justify-center lg:gap-4 lg:text-xl",children:[e.jsx("div",{className:"!text-foreground-danger",children:"Error: Region Restricted"}),e.jsxs("div",{children:["We've detected you're connecting from"," ",o.requestCountry," but your license has restricted access to ",o.restrictedCountry]}),e.jsxs("div",{children:["To continue watching uninterrupted, please"," ",e.jsxs("a",{href:`https://${i}/products`,className:"underline",children:["upgrade your ",t," license"]})," ","to a full Pro license."]})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[a,e.jsxs("div",{children:[e.jsx(f,{to:`https://${i}/products`,className:"underline",children:"Upgrade"})," for transcripts"]})]})]}):o.statusCode===401?e.jsxs("div",{children:[e.jsx(m,{url:r,title:s}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[a,c]})]}):o.statusCode===403?e.jsxs("div",{children:[e.jsx(m,{url:r,title:s}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[a,e.jsxs("div",{children:[e.jsx(f,{to:`https://${i}/products`,className:"underline",children:"Upgrade"})," for transcripts"]})]})]}):o.statusCode===404?e.jsxs("div",{children:[e.jsx(m,{url:r,title:s}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[a,e.jsx("div",{children:"Transcripts not found"})]})]}):(console.error(o),e.jsxs("div",{children:[e.jsx(m,{url:r,title:s}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[a,e.jsx("div",{className:"!text-foreground-danger",children:"Unknown error (check console)"})]})]}))}})})})}function U({url:r,title:s=N(r),muxPlaybackId:i,transcript:t}){const n=p.useRef(null),x=/(\d+:\d+)/g,a=[];let l,d=0;for(;l=x.exec(t);){const c=l[1];if(!x.lastIndex||!c)break;const o=l.index,u=x.lastIndex,j=t.slice(d+1,o-1);a.push(e.jsx("span",{children:j},o)),a.push(e.jsx("button",{className:"underline",onClick:h=>{n.current&&(n.current.currentTime=V(c),n.current.play(),n.current.scrollIntoView({behavior:"smooth",inline:"center",block:"start"}),h.currentTarget.blur())},children:c},c)),d=u}return a.push(e.jsx("span",{children:t.slice(d+1,t.length)},t.length)),e.jsxs("div",{children:[e.jsx("div",{className:"shadow-lg dark:shadow-gray-800",children:e.jsx(S,{playbackId:i,muxPlayerRef:n,title:s})}),e.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[e.jsx(w,{url:r,title:s}),e.jsxs("details",{children:[e.jsx("summary",{children:"Transcript"}),e.jsx("div",{className:"whitespace-pre-line rounded-md bg-accent p-2 text-accent-foreground",children:a})]})]})]})}function V(r){const s=r.split(":");let i=0,t=1;for(;s.length>0;)i+=t*parseInt(s.pop()??"0",10),t*=60;return i}function m({url:r,title:s}){const i=L();let t=new URL("https://epicweb.dev");try{t=new URL(r)}catch(n){return console.error(n),e.jsxs("div",{children:['Invalid URL: "',r,'"']})}return t.pathname=t.pathname.endsWith("/")?`${t.pathname}embed`:`${t.pathname}/embed`,t.searchParams.set("theme",i),e.jsx(P,{url:t.toString(),title:s,loadingContent:e.jsx(v,{children:e.jsxs("span",{children:['Loading "',e.jsx("a",{className:"underline",href:r,children:s}),'"']})})})}export{_ as D,$ as E,P as V};
|
|
2
|
-
//# sourceMappingURL=epic-video-D8ex9vao.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"epic-video-D8ex9vao.js","sources":["../../../app/components/epic-video.tsx"],"sourcesContent":["import { type EpicVideoInfos } from '@epic-web/workshop-utils/epic-api.server'\nimport { type MuxPlayerRefAttributes } from '@mux/mux-player-react'\nimport { Await, Link } from '@remix-run/react'\nimport * as React from 'react'\nimport { useTheme } from '#app/routes/theme/index.tsx'\nimport { MuxPlayer } from '#app/routes/video-player/index.tsx'\nimport { cn } from '#app/utils/misc.tsx'\nimport { Icon } from './icons.tsx'\nimport { Loading } from './loading.tsx'\nimport { useOptionalUser } from './user.tsx'\nimport { useWorkshopConfig } from './workshop-config.tsx'\n\nconst EpicVideoInfoContext = React.createContext<\n\tPromise<EpicVideoInfos> | null | undefined\n>(null)\n\nexport function EpicVideoInfoProvider({\n\tchildren,\n\tepicVideoInfosPromise,\n}: {\n\tchildren: React.ReactNode\n\tepicVideoInfosPromise?: Promise<EpicVideoInfos> | null\n}) {\n\treturn (\n\t\t<EpicVideoInfoContext.Provider value={epicVideoInfosPromise}>\n\t\t\t{children}\n\t\t</EpicVideoInfoContext.Provider>\n\t)\n}\n\nfunction extractEpicTitle(urlString: string) {\n\tlet url: URL = new URL('https://epicweb.dev')\n\ttry {\n\t\turl = new URL(urlString)\n\t} catch (error) {\n\t\tconsole.error(error)\n\t\treturn 'EpicWeb.dev Video'\n\t}\n\tconst urlSegments = url.pathname.split('/').filter(Boolean)\n\tconst isSolution = urlSegments.includes('solution')\n\tlet titleSegment = urlSegments.pop()\n\tconst nonTitles = ['problem', 'solution', 'embed', 'exercise']\n\tconst isTitleSegment = (str?: string) => str && !nonTitles.includes(str)\n\twhile (!isTitleSegment(titleSegment)) titleSegment = urlSegments.pop()\n\n\tif (!titleSegment) return 'EpicWeb.dev Video'\n\n\tconst titleWords = titleSegment.split('-')\n\t// prettier-ignore\n\tconst lowerCaseWords = [\n\t\t'the', 'a', 'an', 'and', 'but', 'or', 'for', 'nor', 'on', 'at', 'to',\n\t\t'from', 'by', 'of', 'in', 'with', 'as', 'npm', 'git', 'ssh', 'cli'\n\t]\n\t// prettier-ignore\n\tconst literalWords = [\n\t\t'OAuth', 'UI', 'UX', 'API', 'CSS', 'HTML', 'JS', 'TS', 'SVG', 'AI', 'CSRF',\n\t\t'CORS', 'HTTP', 'HTTPS', 'URL', 'URI', 'DB', 'SQL', 'JSON', 'YAML', 'YML',\n\n\t\t'useActionData', 'useAsyncError', 'useAsyncValue', 'useBeforeUnload',\n\t\t'useFetcher', 'useFetchers', 'useFormAction', 'useHref', 'useLoaderData',\n\t\t'useLocation', 'useMatches', 'useNavigate', 'useNavigation',\n\t\t'useNavigationType', 'useOutlet', 'useOutletContext', 'useParams',\n\t\t'useResolvedPath', 'useRevalidator', 'useRouteError', 'useRouteLoaderData',\n\t\t'useSearchParams', 'useSubmit', 'useCallback', 'useContext',\n\t\t'useDebugValue', 'useDeferredValue', 'useEffect', 'useId',\n\t\t'useImperativeHandle', 'useInsertionEffect', 'useLayoutEffect', 'useMemo',\n\t\t'useReducer', 'useRef', 'useState', 'useSyncExternalStore', 'useTransition',\n\t\t'useForm','useFieldset', 'useFieldList', 'useEventSource', 'useHydrated',\n\t\t'useAuthenticityToken', 'useShouldHydrate', 'useGlobalNavigationState',\n\t\t'useLocales', 'useDelegatedAnchors', 'useDebounceFetcher', 'useFetcherType',\n\t]\n\tconst title = titleWords\n\t\t.filter(Boolean)\n\t\t.map((word, index) => {\n\t\t\tconst lowerWord = word.toLowerCase()\n\t\t\tconst literalWord = literalWords.find(\n\t\t\t\t(w) => w.toLowerCase() === lowerWord,\n\t\t\t)\n\t\t\tif (literalWord) return literalWord\n\t\t\tif (lowerCaseWords.includes(lowerWord) && index > 0) {\n\t\t\t\treturn lowerWord\n\t\t\t}\n\t\t\treturn lowerWord[0]?.toUpperCase() + lowerWord.slice(1)\n\t\t})\n\t\t.join(' ')\n\tif (isSolution) {\n\t\treturn `${title} (🏁 solution)`\n\t}\n\treturn title\n}\n\nexport function VideoEmbed({\n\turl,\n\ttitle = 'Video Embed',\n\tloadingContent = (\n\t\t<Loading>\n\t\t\t<span>Loading \"{title}\"</span>\n\t\t</Loading>\n\t),\n}: {\n\turl: string\n\ttitle?: string\n\tloadingContent?: React.ReactNode\n}) {\n\tconst [iframeLoaded, setIframeLoaded] = React.useState(false)\n\n\treturn (\n\t\t<div className=\"relative aspect-video w-full flex-shrink-0 shadow-lg dark:shadow-gray-800\">\n\t\t\t{iframeLoaded ? null : (\n\t\t\t\t<div className=\"absolute inset-0 z-10 flex items-center justify-center\">\n\t\t\t\t\t{loadingContent}\n\t\t\t\t</div>\n\t\t\t)}\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\tsrc={url}\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\ttitle={title}\n\t\t\t\tsandbox=\"allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox\"\n\t\t\t\tallowFullScreen\n\t\t\t/>\n\t\t</div>\n\t)\n}\n\nfunction VideoLink({ url, title }: { url: string; title: string }) {\n\treturn (\n\t\t<a\n\t\t\thref={url}\n\t\t\ttarget=\"_blank\"\n\t\t\tclassName=\"flex items-center gap-1 text-base no-underline opacity-70 transition hover:underline hover:opacity-100\"\n\t\t\trel=\"noreferrer\"\n\t\t>\n\t\t\t<Icon className=\"flex-shrink-0\" name=\"Video\" size=\"lg\" />\n\t\t\t{title} <span aria-hidden>↗︎</span>\n\t\t</a>\n\t)\n}\nexport function DeferredEpicVideo({\n\turl,\n\ttitle = extractEpicTitle(url),\n}: {\n\turl: string\n\ttitle?: string\n}) {\n\tconst {\n\t\tproduct: { host, displayName },\n\t} = useWorkshopConfig()\n\tconst user = useOptionalUser()\n\tconst epicVideoInfosPromise = React.useContext(EpicVideoInfoContext)\n\tconst linkUI = (\n\t\t<div>\n\t\t\t<VideoLink url={url} title={title} />\n\t\t</div>\n\t)\n\treturn (\n\t\t<div>\n\t\t\t<React.Suspense\n\t\t\t\tfallback={\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div className=\"flex aspect-video w-full items-center justify-center\">\n\t\t\t\t\t\t\t<Loading>{title}</Loading>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"mt-4 flex flex-col gap-2\">\n\t\t\t\t\t\t\t{linkUI}\n\t\t\t\t\t\t\t<div className=\"h-[32px]\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Await\n\t\t\t\t\terrorElement={\n\t\t\t\t\t\t<div>Sorry, failed loading videos. Check the terminal output?</div>\n\t\t\t\t\t}\n\t\t\t\t\tresolve={epicVideoInfosPromise}\n\t\t\t\t>\n\t\t\t\t\t{(epicVideoInfos) => {\n\t\t\t\t\t\tconst epicVideoInfo = epicVideoInfos?.[url]\n\t\t\t\t\t\tconst transcriptUI = ENV.EPICSHOP_DEPLOYED ? (\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<Link to={ENV.EPICSHOP_GITHUB_REPO} className=\"underline\">\n\t\t\t\t\t\t\t\t\tRun locally\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t{' for transcripts'}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<Link to=\"/login\" className=\"underline\">\n\t\t\t\t\t\t\t\t\t{user ? 'Upgrade' : 'Login'}\n\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t{' for transcripts'}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)\n\t\t\t\t\t\tif (!epicVideoInfo) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<EpicVideoEmbed url={url} title={title} />\n\t\t\t\t\t\t\t\t\t<div className=\"mt-4 flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t\t\t{linkUI}\n\t\t\t\t\t\t\t\t\t\t{transcriptUI}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst info = epicVideoInfo\n\t\t\t\t\t\tif (info.status === 'success') {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<EpicVideo\n\t\t\t\t\t\t\t\t\turl={url}\n\t\t\t\t\t\t\t\t\ttitle={title}\n\t\t\t\t\t\t\t\t\tmuxPlaybackId={info.muxPlaybackId}\n\t\t\t\t\t\t\t\t\ttranscript={info.transcript}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else if (info.type === 'region-restricted') {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<div className=\"flex aspect-video min-h-full min-w-full flex-col items-center justify-start gap-2 overflow-y-scroll border-2 p-4 lg:justify-center lg:gap-4 lg:text-xl\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"!text-foreground-danger\">\n\t\t\t\t\t\t\t\t\t\t\tError: Region Restricted\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\tWe've detected you're connecting from{' '}\n\t\t\t\t\t\t\t\t\t\t\t{info.requestCountry} but your license has restricted\n\t\t\t\t\t\t\t\t\t\t\taccess to {info.restrictedCountry}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\tTo continue watching uninterrupted, please{' '}\n\t\t\t\t\t\t\t\t\t\t\t<a\n\t\t\t\t\t\t\t\t\t\t\t\thref={`https://${host}/products`}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"underline\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tupgrade your {displayName} license\n\t\t\t\t\t\t\t\t\t\t\t</a>{' '}\n\t\t\t\t\t\t\t\t\t\t\tto a full Pro license.\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div className=\"mt-4 flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t\t\t{linkUI}\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\tto={`https://${host}/products`}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"underline\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tUpgrade\n\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t{' for transcripts'}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else if (info.statusCode === 401) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<EpicVideoEmbed url={url} title={title} />\n\t\t\t\t\t\t\t\t\t<div className=\"mt-4 flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t\t\t{linkUI}\n\t\t\t\t\t\t\t\t\t\t{transcriptUI}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else if (info.statusCode === 403) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<EpicVideoEmbed url={url} title={title} />\n\t\t\t\t\t\t\t\t\t<div className=\"mt-4 flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t\t\t{linkUI}\n\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\t\t\tto={`https://${host}/products`}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"underline\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tUpgrade\n\t\t\t\t\t\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t\t\t\t\t\t{' for transcripts'}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else if (info.statusCode === 404) {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<EpicVideoEmbed url={url} title={title} />\n\t\t\t\t\t\t\t\t\t<div className=\"mt-4 flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t\t\t{linkUI}\n\t\t\t\t\t\t\t\t\t\t<div>Transcripts not found</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.error(info)\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t<EpicVideoEmbed url={url} title={title} />\n\t\t\t\t\t\t\t\t\t<div className=\"mt-4 flex flex-col gap-2\">\n\t\t\t\t\t\t\t\t\t\t{linkUI}\n\t\t\t\t\t\t\t\t\t\t<div className=\"!text-foreground-danger\">\n\t\t\t\t\t\t\t\t\t\t\tUnknown error (check console)\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}}\n\t\t\t\t</Await>\n\t\t\t</React.Suspense>\n\t\t</div>\n\t)\n}\n\nfunction EpicVideo({\n\turl: urlString,\n\ttitle = extractEpicTitle(urlString),\n\tmuxPlaybackId,\n\ttranscript,\n}: {\n\turl: string\n\ttitle?: string\n\tmuxPlaybackId: string\n\ttranscript: string\n}) {\n\tconst muxPlayerRef = React.useRef<MuxPlayerRefAttributes>(null)\n\tconst timestampRegex = /(\\d+:\\d+)/g\n\t// turn the transcript into an array of React elements\n\tconst transcriptElements: Array<React.ReactNode> = []\n\tlet match\n\tlet prevIndex = 0\n\twhile ((match = timestampRegex.exec(transcript))) {\n\t\tconst timestamp = match[1]\n\t\tif (!timestampRegex.lastIndex || !timestamp) break\n\n\t\tconst timestampIndexStart = match.index\n\t\tconst timestampIndexEnd = timestampRegex.lastIndex\n\t\tconst textBeforeTimestamp = transcript.slice(\n\t\t\tprevIndex + 1,\n\t\t\ttimestampIndexStart - 1,\n\t\t)\n\t\ttranscriptElements.push(\n\t\t\t<span key={timestampIndexStart}>{textBeforeTimestamp}</span>,\n\t\t)\n\t\ttranscriptElements.push(\n\t\t\t<button\n\t\t\t\tkey={timestamp}\n\t\t\t\tclassName=\"underline\"\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tif (muxPlayerRef.current) {\n\t\t\t\t\t\tmuxPlayerRef.current.currentTime = hmsToSeconds(timestamp)\n\t\t\t\t\t\tvoid muxPlayerRef.current.play()\n\t\t\t\t\t\tmuxPlayerRef.current.scrollIntoView({\n\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\tinline: 'center',\n\t\t\t\t\t\t\tblock: 'start',\n\t\t\t\t\t\t})\n\t\t\t\t\t\tevent.currentTarget.blur()\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{timestamp}\n\t\t\t</button>,\n\t\t)\n\t\tprevIndex = timestampIndexEnd\n\t}\n\ttranscriptElements.push(\n\t\t<span key={transcript.length}>\n\t\t\t{transcript.slice(prevIndex + 1, transcript.length)}\n\t\t</span>,\n\t)\n\treturn (\n\t\t<div>\n\t\t\t<div className=\"shadow-lg dark:shadow-gray-800\">\n\t\t\t\t<MuxPlayer\n\t\t\t\t\tplaybackId={muxPlaybackId}\n\t\t\t\t\tmuxPlayerRef={muxPlayerRef}\n\t\t\t\t\ttitle={title}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div className=\"mt-4 flex flex-col gap-2\">\n\t\t\t\t<VideoLink url={urlString} title={title} />\n\t\t\t\t<details>\n\t\t\t\t\t<summary>Transcript</summary>\n\t\t\t\t\t<div className=\"whitespace-pre-line rounded-md bg-accent p-2 text-accent-foreground\">\n\t\t\t\t\t\t{transcriptElements}\n\t\t\t\t\t</div>\n\t\t\t\t</details>\n\t\t\t</div>\n\t\t</div>\n\t)\n}\n\nfunction hmsToSeconds(str: string) {\n\tconst p = str.split(':')\n\tlet s = 0\n\tlet m = 1\n\n\twhile (p.length > 0) {\n\t\ts += m * parseInt(p.pop() ?? '0', 10)\n\t\tm *= 60\n\t}\n\treturn s\n}\n\nfunction EpicVideoEmbed({\n\turl: urlString,\n\ttitle,\n}: {\n\turl: string\n\ttitle: string\n}) {\n\tconst theme = useTheme()\n\tlet url: URL = new URL('https://epicweb.dev')\n\ttry {\n\t\turl = new URL(urlString)\n\t} catch (error) {\n\t\tconsole.error(error)\n\t\treturn <div>Invalid URL: \"{urlString}\"</div>\n\t}\n\turl.pathname = url.pathname.endsWith('/')\n\t\t? `${url.pathname}embed`\n\t\t: `${url.pathname}/embed`\n\turl.searchParams.set('theme', theme)\n\treturn (\n\t\t<VideoEmbed\n\t\t\turl={url.toString()}\n\t\t\ttitle={title}\n\t\t\tloadingContent={\n\t\t\t\t<Loading>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t{'Loading \"'}\n\t\t\t\t\t\t<a className=\"underline\" href={urlString}>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t{'\"'}\n\t\t\t\t\t</span>\n\t\t\t\t</Loading>\n\t\t\t}\n\t\t/>\n\t)\n}\n"],"names":["EpicVideoInfoContext","React.createContext","EpicVideoInfoProvider","children","epicVideoInfosPromise","extractEpicTitle","urlString","url","error","urlSegments","isSolution","titleSegment","nonTitles","isTitleSegment","str","titleWords","lowerCaseWords","literalWords","title","word","index","lowerWord","literalWord","w","_a","VideoEmbed","loadingContent","jsx","Loading","jsxs","iframeLoaded","setIframeLoaded","React.useState","cn","VideoLink","Icon","DeferredEpicVideo","host","displayName","useWorkshopConfig","user","useOptionalUser","React.useContext","linkUI","React.Suspense","Await","epicVideoInfos","epicVideoInfo","transcriptUI","Link","EpicVideoEmbed","info","EpicVideo","muxPlaybackId","transcript","muxPlayerRef","React.useRef","timestampRegex","transcriptElements","match","prevIndex","timestamp","timestampIndexStart","timestampIndexEnd","textBeforeTimestamp","event","hmsToSeconds","MuxPlayer","p","s","m","theme","useTheme"],"mappings":"oWAYA,MAAMA,EAAuBC,EAAAA,cAE3B,IAAI,EAEC,SAASC,EAAsB,CACrC,SAAAC,EACA,sBAAAC,CACD,EAGG,CACF,aACEJ,EAAqB,SAArB,CAA8B,MAAOI,EACpC,SAAAD,CACF,CAAA,CAEF,CAEA,SAASE,EAAiBC,EAAmB,CACxC,IAAAC,EAAW,IAAI,IAAI,qBAAqB,EACxC,GAAA,CACGA,EAAA,IAAI,IAAID,CAAS,QACfE,EAAO,CACf,eAAQ,MAAMA,CAAK,EACZ,mBACR,CACA,MAAMC,EAAcF,EAAI,SAAS,MAAM,GAAG,EAAE,OAAO,OAAO,EACpDG,EAAaD,EAAY,SAAS,UAAU,EAC9C,IAAAE,EAAeF,EAAY,MAC/B,MAAMG,EAAY,CAAC,UAAW,WAAY,QAAS,UAAU,EACvDC,EAAkBC,GAAiBA,GAAO,CAACF,EAAU,SAASE,CAAG,EACvE,KAAO,CAACD,EAAeF,CAAY,GAAGA,EAA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c,j as o,i as a}from"./index-C_B1-9rF.js";import{g as m}from"./misc-DIdEn_jt.js";function f({defaultStatusHandler:s=({error:r})=>o.jsxs("p",{children:[r.status," ",r.data]}),statusHandlers:e,unexpectedErrorHandler:t=r=>o.jsx("p",{children:m(r)})}){const r=i(),n=c();return typeof document<"u"&&console.error(r),o.jsx("div",{className:"container flex items-center justify-center p-20 text-h2",children:a(r)?((e==null?void 0:e[r.status])??s)({error:r,params:n}):t(r)})}export{f as G};
|
|
2
|
-
//# sourceMappingURL=error-boundary-3zItlMUO.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,r as t}from"./index-C_B1-9rF.js";import{E as l}from"./index-CLNXC84j.js";import{E as n}from"./epic-video-D8ex9vao.js";import{L as a}from"./loading-DW_I206H.js";import{N as d}from"./nav-chevrons-B3SvZV8B.js";import{u as c}from"./revalidation-ws-DK5QOPlL.js";import{M as m,E as p}from"./mdx-C9dqA6IZ.js";import{a as f}from"./misc-DIdEn_jt.js";import{g as h}from"./seo-pBpFCWsy.js";import{P as x}from"./progress-D6SP0Gec.js";import{u,L as j}from"./components-DUNtf72c.js";import"./index-DH1w3QmP.js";import"./request-info-vBkaf3Rk.js";import"./tooltip-BoVikCa-.js";import"./pe-D5h19vSo.js";import"./index-BajUQsFT.js";import"./user-CbbIYEs8.js";import"./workshop-config-C5sYl312.js";import"./progress-bar-CBDBzRQ2.js";const U={getSitemapEntries:()=>[{route:"/finished"}]},z=({matches:s})=>{var i;const r=(i=s.find(o=>o.id==="root"))==null?void 0:i.data;return r?h({title:`🎉 ${r==null?void 0:r.workshopTitle}`,description:`Elaboration for ${r==null?void 0:r.workshopTitle}`,ogTitle:`Finished ${r==null?void 0:r.workshopTitle}`,ogDescription:"You finished! Time to submit feedback.",instructor:r.instructor,requestInfo:r.requestInfo}):[]},b={h1:()=>null};function G(){const s=u();return c({watchPaths:["./exercises/FINISHED.mdx"]}),e.jsx("div",{className:"flex h-full flex-grow flex-col",children:e.jsxs("main",{className:"grid h-full flex-grow grid-cols-1 grid-rows-2 lg:grid-cols-2 lg:grid-rows-1",children:[e.jsxs("div",{className:"relative col-span-1 row-span-1 flex h-full flex-col lg:border-r",children:[e.jsx("h1",{className:"h-14 border-b pl-10 pr-5 text-sm font-medium uppercase leading-none",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(j,{to:"/",className:"hover:underline",children:s.workshopTitle}),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.finishedCode?e.jsx(n,{epicVideoInfosPromise:s.epicVideoInfosPromise,children:e.jsx("div",{className:"prose dark:prose-invert sm:prose-lg",children:e.jsx(m,{code:s.finishedCode,components:b})})}):"No finished instructions yet..."}),e.jsx(l,{elementQuery:`#${s.articleId}`}),e.jsx(x,{type:"workshop-finished",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",{}),s.workshopFinished.status==="success"?e.jsx(p,{file:s.workshopFinished.file,relativePath:s.workshopFinished.relativePath}):null,e.jsx(d,{prev:s.prevStepLink,next:{to:"/"}})]})]}),e.jsx(g,{workshopTitle:s.workshopTitle,workshopFormEmbedUrl:s.workshopFormEmbedUrl})]})})}function g({workshopTitle:s,workshopFormEmbedUrl:r}){const[i,o]=t.useState(!1);return e.jsxs("div",{className:"relative flex-shrink-0",children:[i?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:e.jsx(a,{children:e.jsxs("span",{children:["Loading ",s," Elaboration form"]})})}),e.jsx("iframe",{onLoad:()=>o(!0),onError:()=>o(!0),title:"Elaboration",src:r,className:f("absolute inset-0 flex h-full w-full transition-opacity duration-300",i?"opacity-100":"opacity-0")})]})}export{G as default,U as handle,z as meta};
|
|
2
|
-
//# sourceMappingURL=finished-rUzUjnEm.js.map
|