@epic-web/workshop-app 5.22.4 → 5.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/{_-CHaVBRQw.js → _-BaHOmd8F.js} +2 -2
- package/build/client/assets/{_-CHaVBRQw.js.map → _-BaHOmd8F.js.map} +1 -1
- package/build/client/assets/_basePickBy-B3Ji82Lk.js +2 -0
- package/build/client/assets/_basePickBy-B3Ji82Lk.js.map +1 -0
- package/build/client/assets/_baseUniq-BoGoqSUm.js +2 -0
- package/build/client/assets/_baseUniq-BoGoqSUm.js.map +1 -0
- package/build/client/assets/{_exerciseNumber-3uq8PYSd.js → _exerciseNumber-DtILU6SM.js} +2 -2
- package/build/client/assets/{_exerciseNumber-3uq8PYSd.js.map → _exerciseNumber-DtILU6SM.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_._stepNumber-D5VDI7vZ.js → _exerciseNumber_._stepNumber-DoOFEk-P.js} +2 -2
- package/build/client/assets/{_exerciseNumber_._stepNumber-D5VDI7vZ.js.map → _exerciseNumber_._stepNumber-DoOFEk-P.js.map} +1 -1
- package/build/client/assets/{_exerciseNumber_.finished-3Iv9ikNq.js → _exerciseNumber_.finished-CEK9anWX.js} +2 -2
- package/build/client/assets/{_exerciseNumber_.finished-3Iv9ikNq.js.map → _exerciseNumber_.finished-CEK9anWX.js.map} +1 -1
- package/build/client/assets/{_layout-DV29dlKr.js → _layout-B_BIIcpM.js} +2 -2
- package/build/client/assets/{_layout-DV29dlKr.js.map → _layout-B_BIIcpM.js.map} +1 -1
- package/build/client/assets/_layout-D1r_62oj.js +6 -0
- package/build/client/assets/_layout-D1r_62oj.js.map +1 -0
- package/build/client/assets/{_layout-CwTidn3v.js → _layout-D7_F6t3x.js} +2 -2
- package/build/client/assets/{_layout-CwTidn3v.js.map → _layout-D7_F6t3x.js.map} +1 -1
- package/build/client/assets/_layout-DzlTTMQ0.js +2 -0
- package/build/client/assets/_layout-DzlTTMQ0.js.map +1 -0
- package/build/client/assets/accordion-CpiLc1m2.js +2 -0
- package/build/client/assets/accordion-CpiLc1m2.js.map +1 -0
- package/build/client/assets/{account-CN4B8rm4.js → account-CbFDiVNd.js} +2 -2
- package/build/client/assets/{account-CN4B8rm4.js.map → account-CbFDiVNd.js.map} +1 -1
- package/build/client/assets/app-CQvK51s0.js +2 -0
- package/build/client/assets/{app-lUkT_xku.js.map → app-CQvK51s0.js.map} +1 -1
- package/build/client/assets/{app-DGPT3Jy6.css → app-DSmkkXO5.css} +1 -1
- package/build/client/assets/arc-rF8TbXNV.js +2 -0
- package/build/client/assets/arc-rF8TbXNV.js.map +1 -0
- package/build/client/assets/architectureDiagram-IEHRJDOE-D7gCCmY9.js +37 -0
- package/build/client/assets/architectureDiagram-IEHRJDOE-D7gCCmY9.js.map +1 -0
- package/build/client/assets/blockDiagram-JOT3LUYC-yGQOzhkw.js +122 -0
- package/build/client/assets/blockDiagram-JOT3LUYC-yGQOzhkw.js.map +1 -0
- package/build/client/assets/{button-ChOzbirS.js → button-Dt4EcDfR.js} +2 -2
- package/build/client/assets/{button-ChOzbirS.js.map → button-Dt4EcDfR.js.map} +1 -1
- package/build/client/assets/c4Diagram-VJAJSXHY-CTFjYF37.js +11 -0
- package/build/client/assets/c4Diagram-VJAJSXHY-CTFjYF37.js.map +1 -0
- package/build/client/assets/channel-5s71-OE9.js +2 -0
- package/build/client/assets/channel-5s71-OE9.js.map +1 -0
- package/build/client/assets/chunk-4BMEZGHF-BIe0IUDz.js +2 -0
- package/build/client/assets/chunk-4BMEZGHF-BIe0IUDz.js.map +1 -0
- package/build/client/assets/chunk-A2AXSNBT-B-nCbUBj.js +165 -0
- package/build/client/assets/chunk-A2AXSNBT-B-nCbUBj.js.map +1 -0
- package/build/client/assets/chunk-AEK57VVT-B-cCHPs2.js +221 -0
- package/build/client/assets/chunk-AEK57VVT-B-cCHPs2.js.map +1 -0
- package/build/client/assets/chunk-D6G4REZN-EQ3R8OZx.js +2 -0
- package/build/client/assets/chunk-D6G4REZN-EQ3R8OZx.js.map +1 -0
- package/build/client/assets/chunk-RZ5BOZE2-h6svq8Xk.js +2 -0
- package/build/client/assets/chunk-RZ5BOZE2-h6svq8Xk.js.map +1 -0
- package/build/client/assets/chunk-XZIHB7SX-74-HFRcU.js +2 -0
- package/build/client/assets/chunk-XZIHB7SX-74-HFRcU.js.map +1 -0
- package/build/client/assets/classDiagram-GIVACNV2-CWogZCzR.js +2 -0
- package/build/client/assets/classDiagram-GIVACNV2-CWogZCzR.js.map +1 -0
- package/build/client/assets/classDiagram-v2-COTLJTTW-CWogZCzR.js +2 -0
- package/build/client/assets/classDiagram-v2-COTLJTTW-CWogZCzR.js.map +1 -0
- package/build/client/assets/clone-nHZ14b_E.js +2 -0
- package/build/client/assets/clone-nHZ14b_E.js.map +1 -0
- package/build/client/assets/{components-DrvY4pal.js → components-5arJTWsS.js} +5 -5
- package/build/client/assets/{components-DrvY4pal.js.map → components-5arJTWsS.js.map} +1 -1
- package/build/client/assets/cytoscape.esm-BY7v1xhs.js +332 -0
- package/build/client/assets/cytoscape.esm-BY7v1xhs.js.map +1 -0
- package/build/client/assets/dagre-OKDRZEBW-Bq-HgVN8.js +5 -0
- package/build/client/assets/dagre-OKDRZEBW-Bq-HgVN8.js.map +1 -0
- package/build/client/assets/diagram-SSKATNLV-Cls675Lh.js +44 -0
- package/build/client/assets/diagram-SSKATNLV-Cls675Lh.js.map +1 -0
- package/build/client/assets/diagram-VNBRO52H-CJDqBhLa.js +25 -0
- package/build/client/assets/diagram-VNBRO52H-CJDqBhLa.js.map +1 -0
- package/build/client/assets/diff-8N5KyD7o.js +2 -0
- package/build/client/assets/{diff-CVrsnWqw.js.map → diff-8N5KyD7o.js.map} +1 -1
- package/build/client/assets/{diff-CTHVtVGQ.js → diff-Bu4t2NGL.js} +2 -2
- package/build/client/assets/{diff-CTHVtVGQ.js.map → diff-Bu4t2NGL.js.map} +1 -1
- package/build/client/assets/{discord-gROK6Zn6.js → discord-BU7RzE6-.js} +2 -2
- package/build/client/assets/{discord-gROK6Zn6.js.map → discord-BU7RzE6-.js.map} +1 -1
- package/build/client/assets/discord-ut4t-aMQ.js +2 -0
- package/build/client/assets/discord-ut4t-aMQ.js.map +1 -0
- package/build/client/assets/entry.client-BLUlgPHE.js +44 -0
- package/build/client/assets/{entry.client-CQusg5Iz.js.map → entry.client-BLUlgPHE.js.map} +1 -1
- package/build/client/assets/epic-video-DN9DRRHf.js +3206 -0
- package/build/client/assets/epic-video-DN9DRRHf.js.map +1 -0
- package/build/client/assets/erDiagram-Q7BY3M3F-DdKn4jVQ.js +61 -0
- package/build/client/assets/erDiagram-Q7BY3M3F-DdKn4jVQ.js.map +1 -0
- package/build/client/assets/{error-boundary-CAu3AmhN.js → error-boundary-B07cWiEy.js} +2 -2
- package/build/client/assets/{error-boundary-CAu3AmhN.js.map → error-boundary-B07cWiEy.js.map} +1 -1
- package/build/client/assets/{finished-9PhQncNF.js → finished-B3G1RUDO.js} +2 -2
- package/build/client/assets/{finished-9PhQncNF.js.map → finished-B3G1RUDO.js.map} +1 -1
- package/build/client/assets/flowDiagram-4HSFHLVR-5Mg796nh.js +162 -0
- package/build/client/assets/flowDiagram-4HSFHLVR-5Mg796nh.js.map +1 -0
- package/build/client/assets/ganttDiagram-APWFNJXF-YO2fxWzG.js +258 -0
- package/build/client/assets/ganttDiagram-APWFNJXF-YO2fxWzG.js.map +1 -0
- package/build/client/assets/gitGraphDiagram-7IBYFJ6S-DQCZvhP_.js +66 -0
- package/build/client/assets/gitGraphDiagram-7IBYFJ6S-DQCZvhP_.js.map +1 -0
- package/build/client/assets/graph-BFAO9Sgp.js +2 -0
- package/build/client/assets/graph-BFAO9Sgp.js.map +1 -0
- package/build/client/assets/{index-egcHQOpF.js → index-B8yUFowV.js} +2 -2
- package/build/client/assets/{index-egcHQOpF.js.map → index-B8yUFowV.js.map} +1 -1
- package/build/client/assets/{index-qo6WmPUa.js → index-BfCSiT_X.js} +2 -2
- package/build/client/assets/{index-qo6WmPUa.js.map → index-BfCSiT_X.js.map} +1 -1
- package/build/client/assets/index-BmMpCvYx.js +2 -0
- package/build/client/assets/index-BmMpCvYx.js.map +1 -0
- package/build/client/assets/index-CEP3Xxa0.js +36 -0
- package/build/client/assets/index-CEP3Xxa0.js.map +1 -0
- package/build/client/assets/index-Dkt2MSig.js +2 -0
- package/build/client/assets/index-Dkt2MSig.js.map +1 -0
- package/build/client/assets/index-Do-KWT0a.js +42 -0
- package/build/client/assets/index-Do-KWT0a.js.map +1 -0
- package/build/client/assets/index-Dsusf_Av.js +38 -0
- package/build/client/assets/{index-CGzylDPY.js.map → index-Dsusf_Av.js.map} +1 -1
- package/build/client/assets/index-DvQyydjU.js +3 -0
- package/build/client/assets/index-DvQyydjU.js.map +1 -0
- package/build/client/assets/{index-CYZfnGWa.js → index-Fw2eA3AF.js} +2 -2
- package/build/client/assets/{index-CYZfnGWa.js.map → index-Fw2eA3AF.js.map} +1 -1
- package/build/client/assets/infoDiagram-PH2N3AL5-x87RxSs8.js +3 -0
- package/build/client/assets/infoDiagram-PH2N3AL5-x87RxSs8.js.map +1 -0
- package/build/client/assets/init-Gi6I4Gst.js +2 -0
- package/build/client/assets/init-Gi6I4Gst.js.map +1 -0
- package/build/client/assets/journeyDiagram-U35MCT3I-D5yGbOLJ.js +139 -0
- package/build/client/assets/journeyDiagram-U35MCT3I-D5yGbOLJ.js.map +1 -0
- package/build/client/assets/kanban-definition-NDS4AKOZ-BM6KyRww.js +89 -0
- package/build/client/assets/kanban-definition-NDS4AKOZ-BM6KyRww.js.map +1 -0
- package/build/client/assets/katex-ChWnQ-fc.js +262 -0
- package/build/client/assets/katex-ChWnQ-fc.js.map +1 -0
- package/build/client/assets/layout-qCiM2Jgn.js +2 -0
- package/build/client/assets/layout-qCiM2Jgn.js.map +1 -0
- package/build/client/assets/linear-B3zp51yW.js +2 -0
- package/build/client/assets/linear-B3zp51yW.js.map +1 -0
- package/build/client/assets/{loading-CPEkK5hO.js → loading-BPTYJOXN.js} +2 -2
- package/build/client/assets/{loading-CPEkK5hO.js.map → loading-BPTYJOXN.js.map} +1 -1
- package/build/client/assets/login-CfyUfm-m.js +2 -0
- package/build/client/assets/{login-C9JmYc0v.js.map → login-CfyUfm-m.js.map} +1 -1
- package/build/client/assets/{manifest-4acdd3e2.js → manifest-fe4b7228.js} +1 -1
- package/build/client/assets/mdx-Dfsh6Vjk.js +3 -0
- package/build/client/assets/mdx-Dfsh6Vjk.js.map +1 -0
- package/build/client/assets/mermaid.core-ZaxoMXOj.js +214 -0
- package/build/client/assets/mermaid.core-ZaxoMXOj.js.map +1 -0
- package/build/client/assets/mindmap-definition-ALO5MXBD-CF3siXp6.js +96 -0
- package/build/client/assets/mindmap-definition-ALO5MXBD-CF3siXp6.js.map +1 -0
- package/build/client/assets/misc-2sBiisF5.js +2 -0
- package/build/client/assets/misc-2sBiisF5.js.map +1 -0
- package/build/client/assets/{nav-chevrons-DCuva9-Q.js → nav-chevrons-CV-dpXNR.js} +2 -2
- package/build/client/assets/{nav-chevrons-DCuva9-Q.js.map → nav-chevrons-CV-dpXNR.js.map} +1 -1
- package/build/client/assets/{onboarding-DzfDHJg_.js → onboarding-5LC4kIVW.js} +2 -2
- package/build/client/assets/{onboarding-DzfDHJg_.js.map → onboarding-5LC4kIVW.js.map} +1 -1
- package/build/client/assets/{online-BsTX44az.js → online-IWqRB9zP.js} +2 -2
- package/build/client/assets/{online-BsTX44az.js.map → online-IWqRB9zP.js.map} +1 -1
- package/build/client/assets/ordinal-Cboi1Yqb.js +2 -0
- package/build/client/assets/ordinal-Cboi1Yqb.js.map +1 -0
- package/build/client/assets/{pe-DXT2FOp1.js → pe-BShc2dvc.js} +2 -2
- package/build/client/assets/{pe-DXT2FOp1.js.map → pe-BShc2dvc.js.map} +1 -1
- package/build/client/assets/pieDiagram-IB7DONF6-B-gWQIHI.js +31 -0
- package/build/client/assets/pieDiagram-IB7DONF6-B-gWQIHI.js.map +1 -0
- package/build/client/assets/{preferences-BYBJKp8k.js → preferences-BkWQyRCq.js} +2 -2
- package/build/client/assets/{preferences-BYBJKp8k.js.map → preferences-BkWQyRCq.js.map} +1 -1
- package/build/client/assets/presence-BAL3jDku.js +28 -0
- package/build/client/assets/presence-BAL3jDku.js.map +1 -0
- package/build/client/assets/preview-D4amucCL.js +2 -0
- package/build/client/assets/{preview-DaTpH6lj.js.map → preview-D4amucCL.js.map} +1 -1
- package/build/client/assets/{product-BKhLQKd7.js → product-Cyum2biy.js} +2 -2
- package/build/client/assets/{product-BKhLQKd7.js.map → product-Cyum2biy.js.map} +1 -1
- package/build/client/assets/progress-BJ4ADF-s.js +2 -0
- package/build/client/assets/progress-BJ4ADF-s.js.map +1 -0
- package/build/client/assets/{progress-bar-ZCHf2Y4W.js → progress-bar-DgnkQxQw.js} +2 -2
- package/build/client/assets/{progress-bar-ZCHf2Y4W.js.map → progress-bar-DgnkQxQw.js.map} +1 -1
- package/build/client/assets/quadrantDiagram-7GDLP6J5-BQzo7p61.js +8 -0
- package/build/client/assets/quadrantDiagram-7GDLP6J5-BQzo7p61.js.map +1 -0
- package/build/client/assets/radar-MK3ICKWK-CM-Iz9PA.js +129 -0
- package/build/client/assets/radar-MK3ICKWK-CM-Iz9PA.js.map +1 -0
- package/build/client/assets/requirementDiagram-KVF5MWMF-DzaHc66R.js +65 -0
- package/build/client/assets/requirementDiagram-KVF5MWMF-DzaHc66R.js.map +1 -0
- package/build/client/assets/revalidation-ws-ho-umDqd.js +2 -0
- package/build/client/assets/{revalidation-ws-BoJZTvOQ.js.map → revalidation-ws-ho-umDqd.js.map} +1 -1
- package/build/client/assets/{root-4MvCzrFd.js → root-tJmOmO9T.js} +3 -3
- package/build/client/assets/{root-4MvCzrFd.js.map → root-tJmOmO9T.js.map} +1 -1
- package/build/client/assets/sankeyDiagram-QLVOVGJD-DfAVeZCk.js +11 -0
- package/build/client/assets/sankeyDiagram-QLVOVGJD-DfAVeZCk.js.map +1 -0
- package/build/client/assets/sequenceDiagram-X6HHIX6F-CljZRLoS.js +123 -0
- package/build/client/assets/sequenceDiagram-X6HHIX6F-CljZRLoS.js.map +1 -0
- package/build/client/assets/{set-playground-IUJCGVu2.js → set-playground-DW2Ys-rV.js} +2 -2
- package/build/client/assets/{set-playground-IUJCGVu2.js.map → set-playground-DW2Ys-rV.js.map} +1 -1
- package/build/client/assets/stateDiagram-DGXRK772-BzVfGv3W.js +2 -0
- package/build/client/assets/stateDiagram-DGXRK772-BzVfGv3W.js.map +1 -0
- package/build/client/assets/stateDiagram-v2-YXO3MK2T-8oX001yq.js +2 -0
- package/build/client/assets/stateDiagram-v2-YXO3MK2T-8oX001yq.js.map +1 -0
- package/build/client/assets/{support-CW3-Iilk.js → support-Bg0iSyle.js} +2 -2
- package/build/client/assets/{support-CW3-Iilk.js.map → support-Bg0iSyle.js.map} +1 -1
- package/build/client/assets/tailwind-DtnE_2an.css +1 -0
- package/build/client/assets/test-C14D-N72.js +2 -0
- package/build/client/assets/{test-B8jDo0X4.js.map → test-C14D-N72.js.map} +1 -1
- package/build/client/assets/tests-6__AtHpI.js +4 -0
- package/build/client/assets/{tests-y-atkhWB.js.map → tests-6__AtHpI.js.map} +1 -1
- package/build/client/assets/timeline-definition-BDJGKUSR-2TO9MtLY.js +62 -0
- package/build/client/assets/timeline-definition-BDJGKUSR-2TO9MtLY.js.map +1 -0
- package/build/client/assets/tooltip-Bzd6O8vq.js +2 -0
- package/build/client/assets/tooltip-Bzd6O8vq.js.map +1 -0
- package/build/client/assets/{use-event-source-AZJtQsFX.js → use-event-source-Dar8h_B8.js} +2 -2
- package/build/client/assets/{use-event-source-AZJtQsFX.js.map → use-event-source-Dar8h_B8.js.map} +1 -1
- package/build/client/assets/{user-C0j04V55.js → user-DNSnhqGn.js} +2 -2
- package/build/client/assets/{user-C0j04V55.js.map → user-DNSnhqGn.js.map} +1 -1
- package/build/client/assets/{version-D61Qvt0X.js → version-DriSvNMy.js} +2 -2
- package/build/client/assets/{version-D61Qvt0X.js.map → version-DriSvNMy.js.map} +1 -1
- package/build/client/assets/{workshop-config-oL_FWDKq.js → workshop-config-DchzGYJM.js} +2 -2
- package/build/client/assets/{workshop-config-oL_FWDKq.js.map → workshop-config-DchzGYJM.js.map} +1 -1
- package/build/client/assets/xychartDiagram-VJFVF3MP-Dh4nsbBT.js +8 -0
- package/build/client/assets/xychartDiagram-VJFVF3MP-Dh4nsbBT.js.map +1 -0
- package/build/server/index.js +50 -58
- package/build/server/index.js.map +1 -1
- package/dist/server/index.js +6 -0
- package/package.json +6 -5
- package/build/client/assets/_layout-Brb3LPqZ.js +0 -5
- package/build/client/assets/_layout-Brb3LPqZ.js.map +0 -1
- package/build/client/assets/_layout-CkabS-6c.js +0 -9
- package/build/client/assets/_layout-CkabS-6c.js.map +0 -1
- package/build/client/assets/accordion-BjQ-5Z44.js +0 -2
- package/build/client/assets/accordion-BjQ-5Z44.js.map +0 -1
- package/build/client/assets/app-lUkT_xku.js +0 -2
- package/build/client/assets/diff-CVrsnWqw.js +0 -2
- package/build/client/assets/discord-Cl4hiMqz.js +0 -2
- package/build/client/assets/discord-Cl4hiMqz.js.map +0 -1
- package/build/client/assets/entry.client-CQusg5Iz.js +0 -44
- package/build/client/assets/epic-video-BQtjG_Y0.js +0 -3053
- package/build/client/assets/epic-video-BQtjG_Y0.js.map +0 -1
- package/build/client/assets/index-BncqUVfr.js +0 -39
- package/build/client/assets/index-BncqUVfr.js.map +0 -1
- package/build/client/assets/index-CB8bjE90.js +0 -3
- package/build/client/assets/index-CB8bjE90.js.map +0 -1
- package/build/client/assets/index-CGzylDPY.js +0 -38
- package/build/client/assets/index-CMYl882D.js +0 -36
- package/build/client/assets/index-CMYl882D.js.map +0 -1
- package/build/client/assets/index-CSGHuBiw.js +0 -5
- package/build/client/assets/index-CSGHuBiw.js.map +0 -1
- package/build/client/assets/index-mZJ8sz9i.js +0 -2
- package/build/client/assets/index-mZJ8sz9i.js.map +0 -1
- package/build/client/assets/login-C9JmYc0v.js +0 -2
- package/build/client/assets/mdx-CnaWQCDw.js +0 -2
- package/build/client/assets/mdx-CnaWQCDw.js.map +0 -1
- package/build/client/assets/misc-CQmANiHr.js +0 -2
- package/build/client/assets/misc-CQmANiHr.js.map +0 -1
- package/build/client/assets/presence-D5UF-NOM.js +0 -28
- package/build/client/assets/presence-D5UF-NOM.js.map +0 -1
- package/build/client/assets/preview-DaTpH6lj.js +0 -2
- package/build/client/assets/progress-DwE8EkAa.js +0 -2
- package/build/client/assets/progress-DwE8EkAa.js.map +0 -1
- package/build/client/assets/revalidation-ws-BoJZTvOQ.js +0 -2
- package/build/client/assets/tailwind-O9k3JIDs.css +0 -1
- package/build/client/assets/test-B8jDo0X4.js +0 -2
- package/build/client/assets/tests-y-atkhWB.js +0 -4
- package/build/client/assets/tooltip-Cd0yJoQb.js +0 -2
- package/build/client/assets/tooltip-Cd0yJoQb.js.map +0 -1
- /package/build/client/assets/{epic-video-DUnRvy1A.css → epic-video-D2Xftn6t.css} +0 -0
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
var I=Object.defineProperty;var A=(t,o,e)=>o in t?I(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e;var c=(t,o,e)=>A(t,typeof o!="symbol"?o+"":o,e);import{r as p,j as w,b as q}from"./index-CGzylDPY.js";import{z as a,a as F}from"./index-CMYl882D.js";import{u as G}from"./online-BsTX44az.js";import{b as v}from"./components-DrvY4pal.js";const N="epic-web-presence",$=`https://epic-web-presence.kentcdodds.partykit.dev/parties/main/${N}`,C=a.object({id:a.string(),hasAccess:a.boolean().nullable().optional(),avatarUrl:a.string().nullable().optional(),imageUrlSmall:a.string().nullable().optional(),imageUrlLarge:a.string().nullable().optional(),name:a.string().nullable().optional(),location:a.object({workshopTitle:a.string().nullable().optional(),origin:a.string().nullable().optional(),exercise:a.object({type:a.union([a.literal("problem"),a.literal("solution")]).nullable().optional(),exerciseNumber:a.number().nullable().optional(),stepNumber:a.number().nullable().optional()}).nullable().optional()}).nullable().optional()}),Q=a.object({type:a.literal("remove-user"),payload:a.object({id:a.string()})}).or(a.object({type:a.literal("add-user"),payload:C})).or(a.object({type:a.literal("presence"),payload:a.object({users:a.array(C)})}));a.object({users:a.array(C)});(!globalThis.EventTarget||!globalThis.Event)&&console.error(`
|
|
2
|
-
PartySocket requires a global 'EventTarget' class to be available!
|
|
3
|
-
You can polyfill this global by adding this to your code before any partysocket imports:
|
|
4
|
-
|
|
5
|
-
\`\`\`
|
|
6
|
-
import 'partysocket/event-target-polyfill';
|
|
7
|
-
\`\`\`
|
|
8
|
-
Please file an issue at https://github.com/partykit/partykit if you're still having trouble.
|
|
9
|
-
`);var O=class extends Event{constructor(o,e){super("error",e);c(this,"message");c(this,"error");this.message=o.message,this.error=o}},R=class extends Event{constructor(o=1e3,e="",s){super("close",s);c(this,"code");c(this,"reason");c(this,"wasClean",!0);this.code=o,this.reason=e}},E={Event,ErrorEvent:O,CloseEvent:R};function J(t,o){if(!t)throw new Error(o)}function z(t){return new t.constructor(t.type,t)}function B(t){return"data"in t?new MessageEvent(t.type,t):"code"in t||"reason"in t?new R(t.code||1999,t.reason||"unknown reason",t):"error"in t?new O(t.error,t):new Event(t.type,t)}var P,H=typeof process<"u"&&typeof((P=process.versions)==null?void 0:P.node)<"u"&&typeof document>"u",b=H?B:z,f={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},k=!1,K=class _ extends EventTarget{constructor(e,s,r={}){super();c(this,"_ws");c(this,"_retryCount",-1);c(this,"_uptimeTimeout");c(this,"_connectTimeout");c(this,"_shouldReconnect",!0);c(this,"_connectLock",!1);c(this,"_binaryType","blob");c(this,"_closeCalled",!1);c(this,"_messageQueue",[]);c(this,"_debugLogger",console.log.bind(console));c(this,"_url");c(this,"_protocols");c(this,"_options");c(this,"onclose",null);c(this,"onerror",null);c(this,"onmessage",null);c(this,"onopen",null);c(this,"_handleOpen",e=>{this._debug("open event");const{minUptime:s=f.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),s),J(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(r=>{var n;return(n=this._ws)==null?void 0:n.send(r)}),this._messageQueue=[],this.onopen&&this.onopen(e),this.dispatchEvent(b(e))});c(this,"_handleMessage",e=>{this._debug("message event"),this.onmessage&&this.onmessage(e),this.dispatchEvent(b(e))});c(this,"_handleError",e=>{this._debug("error event",e.message),this._disconnect(void 0,e.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(e),this._debug("exec error listeners"),this.dispatchEvent(b(e)),this._connect()});c(this,"_handleClose",e=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(e),this.dispatchEvent(b(e))});this._url=e,this._protocols=s,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return _.CONNECTING}get OPEN(){return _.OPEN}get CLOSING(){return _.CLOSING}get CLOSED(){return _.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((s,r)=>(typeof r=="string"?s+=r.length:r instanceof Blob?s+=r.size:s+=r.byteLength,s),0)+(this._ws?this._ws.bufferedAmount:0)}get extensions(){return this._ws?this._ws.extensions:""}get protocol(){return this._ws?this._ws.protocol:""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?_.CLOSED:_.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(e=1e3,s){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(e,s)}reconnect(e,s){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(e,s),this._connect())}send(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{const{maxEnqueuedMessages:s=f.maxEnqueuedMessages}=this._options;this._messageQueue.length<s&&(this._debug("enqueue",e),this._messageQueue.push(e))}}_debug(...e){this._options.debug&&this._debugLogger("RWS>",...e)}_getNextDelay(){const{reconnectionDelayGrowFactor:e=f.reconnectionDelayGrowFactor,minReconnectionDelay:s=f.minReconnectionDelay,maxReconnectionDelay:r=f.maxReconnectionDelay}=this._options;let n=0;return this._retryCount>0&&(n=s*Math.pow(e,this._retryCount-1),n>r&&(n=r)),this._debug("next delay",n),n}_wait(){return new Promise(e=>{setTimeout(e,this._getNextDelay())})}_getNextProtocols(e){if(!e)return Promise.resolve(null);if(typeof e=="string"||Array.isArray(e))return Promise.resolve(e);if(typeof e=="function"){const s=e();if(!s)return Promise.resolve(null);if(typeof s=="string"||Array.isArray(s))return Promise.resolve(s);if(s.then)return s}throw Error("Invalid protocols")}_getNextUrl(e){if(typeof e=="string")return Promise.resolve(e);if(typeof e=="function"){const s=e();if(typeof s=="string")return Promise.resolve(s);if(s.then)return s}throw Error("Invalid URL")}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:e=f.maxRetries,connectionTimeout:s=f.connectionTimeout}=this._options;if(this._retryCount>=e){this._debug("max retries reached",this._retryCount,">=",e);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>Promise.all([this._getNextUrl(this._url),this._getNextProtocols(this._protocols||null)])).then(([r,n])=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!k&&(console.error(`‼️ No WebSocket implementation available. You should define options.WebSocket.
|
|
10
|
-
|
|
11
|
-
For example, if you're using node.js, run \`npm install ws\`, and then in your code:
|
|
12
|
-
|
|
13
|
-
import PartySocket from 'partysocket';
|
|
14
|
-
import WS from 'ws';
|
|
15
|
-
|
|
16
|
-
const partysocket = new PartySocket({
|
|
17
|
-
host: "127.0.0.1:1999",
|
|
18
|
-
room: "test-room",
|
|
19
|
-
WebSocket: WS
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
`),k=!0);const d=this._options.WebSocket||WebSocket;this._debug("connect",{url:r,protocols:n}),this._ws=n?new d(r,n):new d(r),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),s)}).catch(r=>{this._connectLock=!1,this._handleError(new E.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new E.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(e=1e3,s){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(e,s),this._handleClose(new E.CloseEvent(e,s,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}};/*!
|
|
23
|
-
* Reconnecting WebSocket
|
|
24
|
-
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
25
|
-
* https://github.com/pladaria/reconnecting-websocket
|
|
26
|
-
* License MIT
|
|
27
|
-
*/var Y=t=>t[1]!==null&&t[1]!==void 0;function X(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();let t=new Date().getTime(),o=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let s=Math.random()*16;return t>0?(s=(t+s)%16|0,t=Math.floor(t/16)):(s=(o+s)%16|0,o=Math.floor(o/16)),(e==="x"?s:s&3|8).toString(16)})}function U(t,o,e={}){const{host:s,path:r,protocol:n,room:d,party:l,prefix:i,query:u}=t;let h=s.replace(/^(http|https|ws|wss):\/\//,"");if(h.endsWith("/")&&(h=h.slice(0,-1)),r&&r.startsWith("/"))throw new Error("path must not start with a slash");const m=l??"main",x=r?`/${r}`:"",g=n||(h.startsWith("localhost:")||h.startsWith("127.0.0.1:")||h.startsWith("192.168.")||h.startsWith("10.")||h.startsWith("172.")&&h.split(".")[1]>="16"&&h.split(".")[1]<="31"||h.startsWith("[::ffff:7f00:1]:")?o:o+"s"),y=`${g}://${h}/${i||`parties/${m}/${d}`}${x}`,T=(j={})=>`${y}?${new URLSearchParams([...Object.entries(e),...Object.entries(j).filter(Y)])}`,M=typeof u=="function"?async()=>T(await u()):T(u);return{host:h,path:x,room:d,name:m,protocol:g,partyUrl:y,urlProvider:M}}var Z=class extends K{constructor(o){const e=L(o);super(e.urlProvider,e.protocols,e.socketOptions);c(this,"_pk");c(this,"_pkurl");c(this,"name");c(this,"room");c(this,"host");c(this,"path");this.partySocketOptions=o,this.setWSProperties(e)}updateProperties(o){const e=L({...this.partySocketOptions,...o,host:o.host??this.host,room:o.room??this.room,path:o.path??this.path});this._url=e.urlProvider,this._protocols=e.protocols,this._options=e.socketOptions,this.setWSProperties(e)}setWSProperties(o){const{_pk:e,_pkurl:s,name:r,room:n,host:d,path:l}=o;this._pk=e,this._pkurl=s,this.name=r,this.room=n,this.host=d,this.path=l}reconnect(o,e){if(!this.room||!this.host)throw new Error("The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.");super.reconnect(o,e)}get id(){return this._pk}get roomUrl(){return this._pkurl}static async fetch(o,e){const s=U(o,"http"),r=typeof s.urlProvider=="string"?s.urlProvider:await s.urlProvider();return(o.fetch??fetch)(r,e)}};function L(t){const{id:o,host:e,path:s,party:r,room:n,protocol:d,query:l,protocols:i,...u}=t,h=o||X(),m=U(t,"ws",{_pk:h});return{_pk:h,_pkurl:m.partyUrl,name:m.name,room:m.room,host:m.host,path:m.path,protocols:i,socketOptions:u,urlProvider:m.urlProvider}}var V=(t,o)=>{const e=p.useRef(o);e.current=o,p.useEffect(()=>{const s=l=>{var i,u;return(u=(i=e.current)==null?void 0:i.onOpen)==null?void 0:u.call(i,l)},r=l=>{var i,u;return(u=(i=e.current)==null?void 0:i.onMessage)==null?void 0:u.call(i,l)},n=l=>{var i,u;return(u=(i=e.current)==null?void 0:i.onClose)==null?void 0:u.call(i,l)},d=l=>{var i,u;return(u=(i=e.current)==null?void 0:i.onError)==null?void 0:u.call(i,l)};return t.addEventListener("open",s),t.addEventListener("close",n),t.addEventListener("error",d),t.addEventListener("message",r),()=>{t.removeEventListener("open",s),t.removeEventListener("close",n),t.removeEventListener("error",d),t.removeEventListener("message",r)}},[t])},ee=t=>[t.startClosed,t.minUptime,t.maxRetries,t.connectionTimeout,t.maxEnqueuedMessages,t.maxReconnectionDelay,t.minReconnectionDelay,t.reconnectionDelayGrowFactor,t.debug];function te({options:t,createSocket:o,createSocketMemoKey:e}){const s=e(t),r=p.useMemo(()=>t,[s]),[n,d]=p.useState(()=>o({...r,startClosed:!0})),l=p.useRef(null),i=p.useRef(o);return i.current=o,p.useEffect(()=>{if(l.current===n){const u=i.current({...r,startClosed:!1});d(u)}else return!l.current&&r.startClosed!==!0&&n.reconnect(),l.current=n,()=>{n.close()}},[n,r]),n}function se(t){const{host:o,...e}=t,s=te({options:{host:o||(typeof window<"u"?window.location.host:"dummy-domain.com"),...e},createSocket:r=>new Z(r),createSocketMemoKey:r=>JSON.stringify([r.query,r.id,r.host,r.room,r.party,r.path,r.protocol,r.protocols,...ee(r)])});return V(s,t),s}const S=p.createContext(null);function re(){var o;const t=v("root");return((o=t==null?void 0:t.preferences)==null?void 0:o.presence)??null}function oe(){const t=v("root");return(t==null?void 0:t.workshopTitle)??null}const ne=a.object({type:a.union([a.literal("problem"),a.literal("solution")]).optional(),exerciseNumber:a.coerce.number().finite(),stepNumber:a.coerce.number().finite().optional()});function ie(t,o){const[e]=p.useState(()=>new Promise(l=>setTimeout(l,o))),s=p.useRef(!0),r=p.useRef(null),n=p.useRef(t);return p.useEffect(()=>{n.current=t},[t]),p.useCallback((...l)=>{const i=Symbol();r.current=i,e.then(()=>{s.current&&r.current===i&&n.current(...l)})},[e])}function W(){const t=oe(),o=F(),e=q(),s=ne.safeParse(e),r=s.success?s.data:null;return{workshopTitle:t,origin:o.origin,...r?{exercise:{type:r.type,exerciseNumber:r.exerciseNumber,stepNumber:r.stepNumber}}:null}}function ae(t){const o=re(),{userHasAccess:e=!1,userId:s,presence:r}=v("root")??{},[n,d]=p.useState((r==null?void 0:r.users)??[]),l=W(),i=ie(g=>{const y=Q.safeParse(JSON.parse(String(g.data)));y.success&&y.data.type==="presence"&&d(y.data.payload.users)},2e3),u=se({host:new URL($).host,room:N,onMessage:i});let h=null;t?o!=null&&o.optOut?h={type:"remove-user",payload:{id:t.id}}:h={type:"add-user",payload:{id:t.id,name:t.name,hasAccess:e,imageUrlSmall:t.imageUrlSmall,imageUrlLarge:t.imageUrlLarge,location:l}}:s!=null&&s.id&&(h={type:"add-user",payload:{id:s.id,location:l}});const m=h?JSON.stringify(h):null;return p.useEffect(()=>{m&&u.send(m)},[m,u]),{users:D({id:s==null?void 0:s.id,location:l},n)}}function D(t,o){const{location:e}=t;return o.map(r=>{var l,i,u,h;let n=0;const d=5;return r.hasAccess&&(n+=1),(e==null?void 0:e.workshopTitle)===((l=r.location)==null?void 0:l.workshopTitle)&&(n+=1,(i=e==null?void 0:e.exercise)!=null&&i.exerciseNumber&&e.exercise.exerciseNumber===((h=(u=r.location)==null?void 0:u.exercise)==null?void 0:h.exerciseNumber)&&(n+=1,e.exercise.stepNumber&&e.exercise.stepNumber===r.location.exercise.stepNumber&&(n+=1,e.exercise.type&&e.exercise.type===r.location.exercise.type&&(n+=1)))),{user:r,score:Math.floor(n/d*10)/10}}).sort((r,n)=>r.user.id===(t==null?void 0:t.id)?-1:n.user.id===(t==null?void 0:t.id)?1:r.score===n.score?0:r.score>n.score?-1:1)}function ce({user:t,children:o}){return w.jsx(S.Provider,{value:ae(t),children:o})}function le({user:t,children:o}){const e=W(),{presence:s}=v("root")??{};return w.jsx(S.Provider,{value:{users:D({id:t==null?void 0:t.id,location:e},(s==null?void 0:s.users)??[])},children:o})}function fe({user:t,children:o}){return G()?w.jsx(ce,{user:t,children:o}):w.jsx(le,{user:t,children:o})}function _e(){const t=p.useContext(S);if(!t)throw new Error("usePresence must be used within a PresenceProvider");return t}export{fe as P,_e as u};
|
|
28
|
-
//# sourceMappingURL=presence-D5UF-NOM.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presence-D5UF-NOM.js","sources":["../../../../workshop-presence/src/presence.ts","../../../../../node_modules/partysocket/dist/chunk-4SNNYC7I.mjs","../../../../../node_modules/partysocket/dist/chunk-H3IJA3WK.mjs","../../../../../node_modules/partysocket/dist/chunk-WTCYYULC.mjs","../../../../../node_modules/partysocket/dist/react.mjs","../../../app/utils/presence.tsx"],"sourcesContent":["import { z } from 'zod'\n\nexport const partykitRoom = 'epic-web-presence'\n// export const partykitBaseUrl = `http://127.0.0.1:1999/parties/main/${partykitRoom}`\nexport const partykitBaseUrl = `https://epic-web-presence.kentcdodds.partykit.dev/parties/main/${partykitRoom}`\n\nexport const UserSchema = z.object({\n\tid: z.string(),\n\thasAccess: z.boolean().nullable().optional(),\n\t// TODO: remove the avatarUrl field once people have updated their workshops\n\tavatarUrl: z.string().nullable().optional(),\n\timageUrlSmall: z.string().nullable().optional(),\n\timageUrlLarge: z.string().nullable().optional(),\n\tname: z.string().nullable().optional(),\n\tlocation: z\n\t\t.object({\n\t\t\tworkshopTitle: z.string().nullable().optional(),\n\t\t\torigin: z.string().nullable().optional(),\n\t\t\texercise: z\n\t\t\t\t.object({\n\t\t\t\t\ttype: z\n\t\t\t\t\t\t.union([z.literal('problem'), z.literal('solution')])\n\t\t\t\t\t\t.nullable()\n\t\t\t\t\t\t.optional(),\n\t\t\t\t\texerciseNumber: z.number().nullable().optional(),\n\t\t\t\t\tstepNumber: z.number().nullable().optional(),\n\t\t\t\t})\n\t\t\t\t.nullable()\n\t\t\t\t.optional(),\n\t\t})\n\t\t.nullable()\n\t\t.optional(),\n})\n\nexport const MessageSchema = z\n\t.object({\n\t\ttype: z.literal('remove-user'),\n\t\tpayload: z.object({ id: z.string() }),\n\t})\n\t.or(z.object({ type: z.literal('add-user'), payload: UserSchema }))\n\t.or(\n\t\tz.object({\n\t\t\ttype: z.literal('presence'),\n\t\t\tpayload: z.object({ users: z.array(UserSchema) }),\n\t\t}),\n\t)\n\nexport type Message = z.infer<typeof MessageSchema>\n\nexport type User = z.infer<typeof UserSchema>\n\nexport const PresenceSchema = z.object({ users: z.array(UserSchema) })\n","// src/ws.ts\nif (!globalThis.EventTarget || !globalThis.Event) {\n console.error(`\n PartySocket requires a global 'EventTarget' class to be available!\n You can polyfill this global by adding this to your code before any partysocket imports: \n \n \\`\\`\\`\n import 'partysocket/event-target-polyfill';\n \\`\\`\\`\n Please file an issue at https://github.com/partykit/partykit if you're still having trouble.\n`);\n}\nvar ErrorEvent = class extends Event {\n message;\n error;\n constructor(error, target) {\n super(\"error\", target);\n this.message = error.message;\n this.error = error;\n }\n};\nvar CloseEvent = class extends Event {\n code;\n reason;\n wasClean = true;\n constructor(code = 1e3, reason = \"\", target) {\n super(\"close\", target);\n this.code = code;\n this.reason = reason;\n }\n};\nvar Events = {\n Event,\n ErrorEvent,\n CloseEvent\n};\nfunction assert(condition, msg) {\n if (!condition) {\n throw new Error(msg);\n }\n}\nfunction cloneEventBrowser(e) {\n return new e.constructor(e.type, e);\n}\nfunction cloneEventNode(e) {\n if (\"data\" in e) {\n const evt2 = new MessageEvent(e.type, e);\n return evt2;\n }\n if (\"code\" in e || \"reason\" in e) {\n const evt2 = new CloseEvent(\n // @ts-expect-error we need to fix event/listener types\n e.code || 1999,\n // @ts-expect-error we need to fix event/listener types\n e.reason || \"unknown reason\",\n e\n );\n return evt2;\n }\n if (\"error\" in e) {\n const evt2 = new ErrorEvent(e.error, e);\n return evt2;\n }\n const evt = new Event(e.type, e);\n return evt;\n}\nvar isNode = typeof process !== \"undefined\" && typeof process.versions?.node !== \"undefined\" && typeof document === \"undefined\";\nvar cloneEvent = isNode ? cloneEventNode : cloneEventBrowser;\nvar DEFAULT = {\n maxReconnectionDelay: 1e4,\n minReconnectionDelay: 1e3 + Math.random() * 4e3,\n minUptime: 5e3,\n reconnectionDelayGrowFactor: 1.3,\n connectionTimeout: 4e3,\n maxRetries: Infinity,\n maxEnqueuedMessages: Infinity,\n startClosed: false,\n debug: false\n};\nvar didWarnAboutMissingWebSocket = false;\nvar ReconnectingWebSocket = class _ReconnectingWebSocket extends EventTarget {\n _ws;\n _retryCount = -1;\n _uptimeTimeout;\n _connectTimeout;\n _shouldReconnect = true;\n _connectLock = false;\n _binaryType = \"blob\";\n _closeCalled = false;\n _messageQueue = [];\n _debugLogger = console.log.bind(console);\n _url;\n _protocols;\n _options;\n constructor(url, protocols, options = {}) {\n super();\n this._url = url;\n this._protocols = protocols;\n this._options = options;\n if (this._options.startClosed) {\n this._shouldReconnect = false;\n }\n if (this._options.debugLogger) {\n this._debugLogger = this._options.debugLogger;\n }\n this._connect();\n }\n static get CONNECTING() {\n return 0;\n }\n static get OPEN() {\n return 1;\n }\n static get CLOSING() {\n return 2;\n }\n static get CLOSED() {\n return 3;\n }\n get CONNECTING() {\n return _ReconnectingWebSocket.CONNECTING;\n }\n get OPEN() {\n return _ReconnectingWebSocket.OPEN;\n }\n get CLOSING() {\n return _ReconnectingWebSocket.CLOSING;\n }\n get CLOSED() {\n return _ReconnectingWebSocket.CLOSED;\n }\n get binaryType() {\n return this._ws ? this._ws.binaryType : this._binaryType;\n }\n set binaryType(value) {\n this._binaryType = value;\n if (this._ws) {\n this._ws.binaryType = value;\n }\n }\n /**\n * Returns the number or connection retries\n */\n get retryCount() {\n return Math.max(this._retryCount, 0);\n }\n /**\n * The number of bytes of data that have been queued using calls to send() but not yet\n * transmitted to the network. This value resets to zero once all queued data has been sent.\n * This value does not reset to zero when the connection is closed; if you keep calling send(),\n * this will continue to climb. Read only\n */\n get bufferedAmount() {\n const bytes = this._messageQueue.reduce((acc, message) => {\n if (typeof message === \"string\") {\n acc += message.length;\n } else if (message instanceof Blob) {\n acc += message.size;\n } else {\n acc += message.byteLength;\n }\n return acc;\n }, 0);\n return bytes + (this._ws ? this._ws.bufferedAmount : 0);\n }\n /**\n * The extensions selected by the server. This is currently only the empty string or a list of\n * extensions as negotiated by the connection\n */\n get extensions() {\n return this._ws ? this._ws.extensions : \"\";\n }\n /**\n * A string indicating the name of the sub-protocol the server selected;\n * this will be one of the strings specified in the protocols parameter when creating the\n * WebSocket object\n */\n get protocol() {\n return this._ws ? this._ws.protocol : \"\";\n }\n /**\n * The current state of the connection; this is one of the Ready state constants\n */\n get readyState() {\n if (this._ws) {\n return this._ws.readyState;\n }\n return this._options.startClosed ? _ReconnectingWebSocket.CLOSED : _ReconnectingWebSocket.CONNECTING;\n }\n /**\n * The URL as resolved by the constructor\n */\n get url() {\n return this._ws ? this._ws.url : \"\";\n }\n /**\n * Whether the websocket object is now in reconnectable state\n */\n get shouldReconnect() {\n return this._shouldReconnect;\n }\n /**\n * An event listener to be called when the WebSocket connection's readyState changes to CLOSED\n */\n onclose = null;\n /**\n * An event listener to be called when an error occurs\n */\n onerror = null;\n /**\n * An event listener to be called when a message is received from the server\n */\n onmessage = null;\n /**\n * An event listener to be called when the WebSocket connection's readyState changes to OPEN;\n * this indicates that the connection is ready to send and receive data\n */\n onopen = null;\n /**\n * Closes the WebSocket connection or connection attempt, if any. If the connection is already\n * CLOSED, this method does nothing\n */\n close(code = 1e3, reason) {\n this._closeCalled = true;\n this._shouldReconnect = false;\n this._clearTimeouts();\n if (!this._ws) {\n this._debug(\"close enqueued: no ws instance\");\n return;\n }\n if (this._ws.readyState === this.CLOSED) {\n this._debug(\"close: already closed\");\n return;\n }\n this._ws.close(code, reason);\n }\n /**\n * Closes the WebSocket connection or connection attempt and connects again.\n * Resets retry counter;\n */\n reconnect(code, reason) {\n this._shouldReconnect = true;\n this._closeCalled = false;\n this._retryCount = -1;\n if (!this._ws || this._ws.readyState === this.CLOSED) {\n this._connect();\n } else {\n this._disconnect(code, reason);\n this._connect();\n }\n }\n /**\n * Enqueue specified data to be transmitted to the server over the WebSocket connection\n */\n send(data) {\n if (this._ws && this._ws.readyState === this.OPEN) {\n this._debug(\"send\", data);\n this._ws.send(data);\n } else {\n const { maxEnqueuedMessages = DEFAULT.maxEnqueuedMessages } = this._options;\n if (this._messageQueue.length < maxEnqueuedMessages) {\n this._debug(\"enqueue\", data);\n this._messageQueue.push(data);\n }\n }\n }\n _debug(...args) {\n if (this._options.debug) {\n this._debugLogger(\"RWS>\", ...args);\n }\n }\n _getNextDelay() {\n const {\n reconnectionDelayGrowFactor = DEFAULT.reconnectionDelayGrowFactor,\n minReconnectionDelay = DEFAULT.minReconnectionDelay,\n maxReconnectionDelay = DEFAULT.maxReconnectionDelay\n } = this._options;\n let delay = 0;\n if (this._retryCount > 0) {\n delay = minReconnectionDelay * Math.pow(reconnectionDelayGrowFactor, this._retryCount - 1);\n if (delay > maxReconnectionDelay) {\n delay = maxReconnectionDelay;\n }\n }\n this._debug(\"next delay\", delay);\n return delay;\n }\n _wait() {\n return new Promise((resolve) => {\n setTimeout(resolve, this._getNextDelay());\n });\n }\n _getNextProtocols(protocolsProvider) {\n if (!protocolsProvider) return Promise.resolve(null);\n if (typeof protocolsProvider === \"string\" || Array.isArray(protocolsProvider)) {\n return Promise.resolve(protocolsProvider);\n }\n if (typeof protocolsProvider === \"function\") {\n const protocols = protocolsProvider();\n if (!protocols) return Promise.resolve(null);\n if (typeof protocols === \"string\" || Array.isArray(protocols)) {\n return Promise.resolve(protocols);\n }\n if (protocols.then) {\n return protocols;\n }\n }\n throw Error(\"Invalid protocols\");\n }\n _getNextUrl(urlProvider) {\n if (typeof urlProvider === \"string\") {\n return Promise.resolve(urlProvider);\n }\n if (typeof urlProvider === \"function\") {\n const url = urlProvider();\n if (typeof url === \"string\") {\n return Promise.resolve(url);\n }\n if (url.then) {\n return url;\n }\n }\n throw Error(\"Invalid URL\");\n }\n _connect() {\n if (this._connectLock || !this._shouldReconnect) {\n return;\n }\n this._connectLock = true;\n const {\n maxRetries = DEFAULT.maxRetries,\n connectionTimeout = DEFAULT.connectionTimeout\n } = this._options;\n if (this._retryCount >= maxRetries) {\n this._debug(\"max retries reached\", this._retryCount, \">=\", maxRetries);\n return;\n }\n this._retryCount++;\n this._debug(\"connect\", this._retryCount);\n this._removeListeners();\n this._wait().then(\n () => Promise.all([\n this._getNextUrl(this._url),\n this._getNextProtocols(this._protocols || null)\n ])\n ).then(([url, protocols]) => {\n if (this._closeCalled) {\n this._connectLock = false;\n return;\n }\n if (!this._options.WebSocket && typeof WebSocket === \"undefined\" && !didWarnAboutMissingWebSocket) {\n console.error(`\\u203C\\uFE0F No WebSocket implementation available. You should define options.WebSocket. \n\nFor example, if you're using node.js, run \\`npm install ws\\`, and then in your code:\n\nimport PartySocket from 'partysocket';\nimport WS from 'ws';\n\nconst partysocket = new PartySocket({\n host: \"127.0.0.1:1999\",\n room: \"test-room\",\n WebSocket: WS\n});\n\n`);\n didWarnAboutMissingWebSocket = true;\n }\n const WS = this._options.WebSocket || WebSocket;\n this._debug(\"connect\", { url, protocols });\n this._ws = protocols ? new WS(url, protocols) : new WS(url);\n this._ws.binaryType = this._binaryType;\n this._connectLock = false;\n this._addListeners();\n this._connectTimeout = setTimeout(\n () => this._handleTimeout(),\n connectionTimeout\n );\n }).catch((err) => {\n this._connectLock = false;\n this._handleError(new Events.ErrorEvent(Error(err.message), this));\n });\n }\n _handleTimeout() {\n this._debug(\"timeout event\");\n this._handleError(new Events.ErrorEvent(Error(\"TIMEOUT\"), this));\n }\n _disconnect(code = 1e3, reason) {\n this._clearTimeouts();\n if (!this._ws) {\n return;\n }\n this._removeListeners();\n try {\n this._ws.close(code, reason);\n this._handleClose(new Events.CloseEvent(code, reason, this));\n } catch (error) {\n }\n }\n _acceptOpen() {\n this._debug(\"accept open\");\n this._retryCount = 0;\n }\n _handleOpen = (event) => {\n this._debug(\"open event\");\n const { minUptime = DEFAULT.minUptime } = this._options;\n clearTimeout(this._connectTimeout);\n this._uptimeTimeout = setTimeout(() => this._acceptOpen(), minUptime);\n assert(this._ws, \"WebSocket is not defined\");\n this._ws.binaryType = this._binaryType;\n this._messageQueue.forEach((message) => this._ws?.send(message));\n this._messageQueue = [];\n if (this.onopen) {\n this.onopen(event);\n }\n this.dispatchEvent(cloneEvent(event));\n };\n _handleMessage = (event) => {\n this._debug(\"message event\");\n if (this.onmessage) {\n this.onmessage(event);\n }\n this.dispatchEvent(cloneEvent(event));\n };\n _handleError = (event) => {\n this._debug(\"error event\", event.message);\n this._disconnect(\n void 0,\n event.message === \"TIMEOUT\" ? \"timeout\" : void 0\n );\n if (this.onerror) {\n this.onerror(event);\n }\n this._debug(\"exec error listeners\");\n this.dispatchEvent(cloneEvent(event));\n this._connect();\n };\n _handleClose = (event) => {\n this._debug(\"close event\");\n this._clearTimeouts();\n if (this._shouldReconnect) {\n this._connect();\n }\n if (this.onclose) {\n this.onclose(event);\n }\n this.dispatchEvent(cloneEvent(event));\n };\n _removeListeners() {\n if (!this._ws) {\n return;\n }\n this._debug(\"removeListeners\");\n this._ws.removeEventListener(\"open\", this._handleOpen);\n this._ws.removeEventListener(\"close\", this._handleClose);\n this._ws.removeEventListener(\"message\", this._handleMessage);\n this._ws.removeEventListener(\"error\", this._handleError);\n }\n _addListeners() {\n if (!this._ws) {\n return;\n }\n this._debug(\"addListeners\");\n this._ws.addEventListener(\"open\", this._handleOpen);\n this._ws.addEventListener(\"close\", this._handleClose);\n this._ws.addEventListener(\"message\", this._handleMessage);\n this._ws.addEventListener(\"error\", this._handleError);\n }\n _clearTimeouts() {\n clearTimeout(this._connectTimeout);\n clearTimeout(this._uptimeTimeout);\n }\n};\n\nexport {\n ErrorEvent,\n CloseEvent,\n ReconnectingWebSocket\n};\n/*!\n * Reconnecting WebSocket\n * by Pedro Ladaria <pedro.ladaria@gmail.com>\n * https://github.com/pladaria/reconnecting-websocket\n * License MIT\n */\n","import {\n ReconnectingWebSocket\n} from \"./chunk-4SNNYC7I.mjs\";\n\n// src/index.ts\nvar valueIsNotNil = (keyValuePair) => keyValuePair[1] !== null && keyValuePair[1] !== void 0;\nfunction generateUUID() {\n if (typeof crypto !== \"undefined\" && crypto.randomUUID) {\n return crypto.randomUUID();\n }\n let d = (/* @__PURE__ */ new Date()).getTime();\n let d2 = typeof performance !== \"undefined\" && performance.now && performance.now() * 1e3 || 0;\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function(c) {\n let r = Math.random() * 16;\n if (d > 0) {\n r = (d + r) % 16 | 0;\n d = Math.floor(d / 16);\n } else {\n r = (d2 + r) % 16 | 0;\n d2 = Math.floor(d2 / 16);\n }\n return (c === \"x\" ? r : r & 3 | 8).toString(16);\n });\n}\nfunction getPartyInfo(partySocketOptions, defaultProtocol, defaultParams = {}) {\n const {\n host: rawHost,\n path: rawPath,\n protocol: rawProtocol,\n room,\n party,\n prefix,\n query\n } = partySocketOptions;\n let host = rawHost.replace(/^(http|https|ws|wss):\\/\\//, \"\");\n if (host.endsWith(\"/\")) {\n host = host.slice(0, -1);\n }\n if (rawPath && rawPath.startsWith(\"/\")) {\n throw new Error(\"path must not start with a slash\");\n }\n const name = party ?? \"main\";\n const path = rawPath ? `/${rawPath}` : \"\";\n const protocol = rawProtocol || (host.startsWith(\"localhost:\") || host.startsWith(\"127.0.0.1:\") || host.startsWith(\"192.168.\") || host.startsWith(\"10.\") || host.startsWith(\"172.\") && host.split(\".\")[1] >= \"16\" && host.split(\".\")[1] <= \"31\" || host.startsWith(\"[::ffff:7f00:1]:\") ? (\n // http / ws\n defaultProtocol\n ) : (\n // https / wss\n defaultProtocol + \"s\"\n ));\n const baseUrl = `${protocol}://${host}/${prefix || `parties/${name}/${room}`}${path}`;\n const makeUrl = (query2 = {}) => `${baseUrl}?${new URLSearchParams([\n ...Object.entries(defaultParams),\n ...Object.entries(query2).filter(valueIsNotNil)\n ])}`;\n const urlProvider = typeof query === \"function\" ? async () => makeUrl(await query()) : makeUrl(query);\n return {\n host,\n path,\n room,\n name,\n protocol,\n partyUrl: baseUrl,\n urlProvider\n };\n}\nvar PartySocket = class extends ReconnectingWebSocket {\n constructor(partySocketOptions) {\n const wsOptions = getWSOptions(partySocketOptions);\n super(wsOptions.urlProvider, wsOptions.protocols, wsOptions.socketOptions);\n this.partySocketOptions = partySocketOptions;\n this.setWSProperties(wsOptions);\n }\n _pk;\n _pkurl;\n name;\n room;\n host;\n path;\n updateProperties(partySocketOptions) {\n const wsOptions = getWSOptions({\n ...this.partySocketOptions,\n ...partySocketOptions,\n host: partySocketOptions.host ?? this.host,\n room: partySocketOptions.room ?? this.room,\n path: partySocketOptions.path ?? this.path\n });\n this._url = wsOptions.urlProvider;\n this._protocols = wsOptions.protocols;\n this._options = wsOptions.socketOptions;\n this.setWSProperties(wsOptions);\n }\n setWSProperties(wsOptions) {\n const { _pk, _pkurl, name, room, host, path } = wsOptions;\n this._pk = _pk;\n this._pkurl = _pkurl;\n this.name = name;\n this.room = room;\n this.host = host;\n this.path = path;\n }\n reconnect(code, reason) {\n if (!this.room || !this.host) {\n throw new Error(\n \"The room and host must be set before connecting, use `updateProperties` method to set them or pass them to the constructor.\"\n );\n }\n super.reconnect(code, reason);\n }\n get id() {\n return this._pk;\n }\n /**\n * Exposes the static PartyKit room URL without applying query parameters.\n * To access the currently connected WebSocket url, use PartySocket#url.\n */\n get roomUrl() {\n return this._pkurl;\n }\n // a `fetch` method that uses (almost) the same options as `PartySocket`\n static async fetch(options, init) {\n const party = getPartyInfo(options, \"http\");\n const url = typeof party.urlProvider === \"string\" ? party.urlProvider : await party.urlProvider();\n const doFetch = options.fetch ?? fetch;\n return doFetch(url, init);\n }\n};\nfunction getWSOptions(partySocketOptions) {\n const {\n id,\n host: _host,\n path: _path,\n party: _party,\n room: _room,\n protocol: _protocol,\n query: _query,\n protocols,\n ...socketOptions\n } = partySocketOptions;\n const _pk = id || generateUUID();\n const party = getPartyInfo(partySocketOptions, \"ws\", { _pk });\n return {\n _pk,\n _pkurl: party.partyUrl,\n name: party.name,\n room: party.room,\n host: party.host,\n path: party.path,\n protocols,\n socketOptions,\n urlProvider: party.urlProvider\n };\n}\n\nexport {\n PartySocket\n};\n","import {\n ReconnectingWebSocket\n} from \"./chunk-4SNNYC7I.mjs\";\n\n// src/use-handlers.ts\nimport { useEffect, useRef } from \"react\";\nvar useAttachWebSocketEventHandlers = (socket, options) => {\n const handlersRef = useRef(options);\n handlersRef.current = options;\n useEffect(() => {\n const onOpen = (event) => handlersRef.current?.onOpen?.(event);\n const onMessage = (event) => handlersRef.current?.onMessage?.(event);\n const onClose = (event) => handlersRef.current?.onClose?.(event);\n const onError = (event) => handlersRef.current?.onError?.(event);\n socket.addEventListener(\"open\", onOpen);\n socket.addEventListener(\"close\", onClose);\n socket.addEventListener(\"error\", onError);\n socket.addEventListener(\"message\", onMessage);\n return () => {\n socket.removeEventListener(\"open\", onOpen);\n socket.removeEventListener(\"close\", onClose);\n socket.removeEventListener(\"error\", onError);\n socket.removeEventListener(\"message\", onMessage);\n };\n }, [socket]);\n};\n\n// src/use-socket.ts\nimport { useEffect as useEffect2, useMemo, useRef as useRef2, useState } from \"react\";\nvar getOptionsThatShouldCauseRestartWhenChanged = (options) => [\n options.startClosed,\n options.minUptime,\n options.maxRetries,\n options.connectionTimeout,\n options.maxEnqueuedMessages,\n options.maxReconnectionDelay,\n options.minReconnectionDelay,\n options.reconnectionDelayGrowFactor,\n options.debug\n];\nfunction useStableSocket({\n options,\n createSocket,\n createSocketMemoKey: createOptionsMemoKey\n}) {\n const shouldReconnect = createOptionsMemoKey(options);\n const socketOptions = useMemo(() => {\n return options;\n }, [shouldReconnect]);\n const [socket, setSocket] = useState(\n () => (\n // only connect on first mount\n createSocket({ ...socketOptions, startClosed: true })\n )\n );\n const socketInitializedRef = useRef2(null);\n const createSocketRef = useRef2(createSocket);\n createSocketRef.current = createSocket;\n useEffect2(() => {\n if (socketInitializedRef.current === socket) {\n const newSocket = createSocketRef.current({\n ...socketOptions,\n // when reconnecting because of options change, we always reconnect\n // (startClosed only applies to initial mount)\n startClosed: false\n });\n setSocket(newSocket);\n } else {\n if (!socketInitializedRef.current && socketOptions.startClosed !== true) {\n socket.reconnect();\n }\n socketInitializedRef.current = socket;\n return () => {\n socket.close();\n };\n }\n }, [socket, socketOptions]);\n return socket;\n}\n\n// src/use-ws.ts\nfunction useWebSocket(url, protocols, options = {}) {\n const socket = useStableSocket({\n options,\n createSocket: (options2) => new ReconnectingWebSocket(url, protocols, options2),\n createSocketMemoKey: (options2) => JSON.stringify([\n // will reconnect if url or protocols are specified as a string.\n // if they are functions, the WebSocket will handle reconnection\n url,\n protocols,\n ...getOptionsThatShouldCauseRestartWhenChanged(options2)\n ])\n });\n useAttachWebSocketEventHandlers(socket, options);\n return socket;\n}\n\nexport {\n useAttachWebSocketEventHandlers,\n getOptionsThatShouldCauseRestartWhenChanged,\n useStableSocket,\n useWebSocket\n};\n","import {\n PartySocket\n} from \"./chunk-H3IJA3WK.mjs\";\nimport {\n getOptionsThatShouldCauseRestartWhenChanged,\n useAttachWebSocketEventHandlers,\n useStableSocket,\n useWebSocket\n} from \"./chunk-WTCYYULC.mjs\";\nimport \"./chunk-4SNNYC7I.mjs\";\n\n// src/react.ts\nfunction usePartySocket(options) {\n const { host, ...otherOptions } = options;\n const socket = useStableSocket({\n options: {\n host: host || (typeof window !== \"undefined\" ? window.location.host : \"dummy-domain.com\"),\n ...otherOptions\n },\n createSocket: (options2) => new PartySocket(options2),\n createSocketMemoKey: (options2) => JSON.stringify([\n // NOTE: if query is defined as a function, the socket\n // won't reconnect when you change the function identity\n options2.query,\n options2.id,\n options2.host,\n options2.room,\n options2.party,\n options2.path,\n options2.protocol,\n options2.protocols,\n ...getOptionsThatShouldCauseRestartWhenChanged(options2)\n ])\n });\n useAttachWebSocketEventHandlers(socket, options);\n return socket;\n}\nexport {\n usePartySocket as default,\n usePartySocket,\n useWebSocket\n};\n","import {\n\tMessageSchema,\n\tpartykitBaseUrl,\n\tpartykitRoom,\n\ttype Message,\n\ttype User,\n} from '@epic-web/workshop-presence/presence'\nimport { useParams, useRouteLoaderData } from '@remix-run/react'\nimport { usePartySocket } from 'partysocket/react'\nimport {\n\tcreateContext,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react'\nimport { z } from 'zod'\nimport { type loader as rootLoader } from '#app/root.tsx'\nimport { useIsOnline } from './online.ts'\nimport { useRequestInfo } from './request-info.ts'\n\nexport * from '@epic-web/workshop-presence/presence'\n\nconst PresenceContext = createContext<ReturnType<\n\ttypeof usePresenceSocket\n> | null>(null)\n\nexport function usePresencePreferences() {\n\tconst data = useRouteLoaderData<typeof rootLoader>('root')\n\treturn data?.preferences?.presence ?? null\n}\n\nexport function useOptionalWorkshopTitle() {\n\tconst data = useRouteLoaderData<typeof rootLoader>('root')\n\treturn data?.workshopTitle ?? null\n}\n\nconst ExerciseAppParamsSchema = z.object({\n\ttype: z.union([z.literal('problem'), z.literal('solution')]).optional(),\n\texerciseNumber: z.coerce.number().finite(),\n\tstepNumber: z.coerce.number().finite().optional(),\n})\n\n/**\n * useFirstCallDelayedCallback\n *\n * This hook creates a callback that is delayed on its first call.\n * It's useful for scenarios where you want to delay the execution of a function\n * for a certain amount of time, but only on the initial call.\n *\n * If it's called again before the delay expires, then the prior call is ignored\n * and when the delay expires, the latest call is executed.\n *\n * The motivation here is that the server may get one set of presence and by the\n * time it shows up on the client it's stale. This delays the re-rendering of\n * the UI to avoid a flicker as soon as you land on the page.\n *\n * @param cb The callback function to be delayed\n * @param delay The delay in milliseconds before the callback is executed\n * @returns A new function that wraps the original callback with the delay logic\n */\nfunction useFirstCallDelayedCallback<Args extends unknown[]>(\n\tcb: (...args: Args) => void,\n\tdelay: number,\n) {\n\tconst [timedPromise] = useState(\n\t\t() => new Promise((resolve) => setTimeout(resolve, delay)),\n\t)\n\tconst mounted = useRef(true)\n\tconst currentCallRef = useRef<symbol | null>(null)\n\tconst lastCbRef = useRef(cb)\n\n\tuseEffect(() => {\n\t\tlastCbRef.current = cb\n\t}, [cb])\n\n\tconst delayedCb = useCallback(\n\t\t(...args: Args) => {\n\t\t\tconst thisOne = Symbol()\n\t\t\tcurrentCallRef.current = thisOne\n\t\t\tvoid timedPromise.then(() => {\n\t\t\t\tif (!mounted.current) return\n\t\t\t\tif (currentCallRef.current !== thisOne) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tlastCbRef.current(...args)\n\t\t\t})\n\t\t},\n\t\t[timedPromise],\n\t)\n\n\treturn delayedCb\n}\n\nfunction useUsersLocation() {\n\tconst workshopTitle = useOptionalWorkshopTitle()\n\tconst requestInfo = useRequestInfo()\n\tconst rawParams = useParams()\n\tconst paramsResult = ExerciseAppParamsSchema.safeParse(rawParams)\n\tconst params = paramsResult.success ? paramsResult.data : null\n\n\treturn {\n\t\tworkshopTitle,\n\t\torigin: requestInfo.origin,\n\t\t...(params\n\t\t\t? {\n\t\t\t\t\texercise: {\n\t\t\t\t\t\ttype: params.type,\n\t\t\t\t\t\texerciseNumber: params.exerciseNumber,\n\t\t\t\t\t\tstepNumber: params.stepNumber,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t: null),\n\t} satisfies User['location']\n}\n\nfunction usePresenceSocket(user?: User | null) {\n\tconst prefs = usePresencePreferences()\n\tconst {\n\t\tuserHasAccess = false,\n\t\tuserId,\n\t\tpresence,\n\t} = useRouteLoaderData<typeof rootLoader>('root') ?? {}\n\tconst [users, setUsers] = useState(presence?.users ?? [])\n\tconst usersLocation = useUsersLocation()\n\n\tconst handleMessage = useFirstCallDelayedCallback((evt: MessageEvent) => {\n\t\tconst messageResult = MessageSchema.safeParse(JSON.parse(String(evt.data)))\n\t\tif (!messageResult.success) return\n\t\tif (messageResult.data.type === 'presence') {\n\t\t\tsetUsers(messageResult.data.payload.users)\n\t\t}\n\t}, 2000)\n\n\tconst socket = usePartySocket({\n\t\thost: new URL(partykitBaseUrl).host,\n\t\troom: partykitRoom,\n\t\tonMessage: handleMessage,\n\t})\n\n\tlet message: Message | null = null\n\tif (user) {\n\t\tif (prefs?.optOut) {\n\t\t\tmessage = { type: 'remove-user', payload: { id: user.id } }\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\ttype: 'add-user',\n\t\t\t\tpayload: {\n\t\t\t\t\tid: user.id,\n\t\t\t\t\tname: user.name,\n\t\t\t\t\thasAccess: userHasAccess,\n\t\t\t\t\timageUrlSmall: user.imageUrlSmall,\n\t\t\t\t\timageUrlLarge: user.imageUrlLarge,\n\t\t\t\t\tlocation: usersLocation,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\t} else if (userId?.id) {\n\t\tmessage = {\n\t\t\ttype: 'add-user',\n\t\t\tpayload: { id: userId.id, location: usersLocation },\n\t\t}\n\t}\n\n\tconst messageJson = message ? JSON.stringify(message) : null\n\tuseEffect(() => {\n\t\tif (messageJson) socket.send(messageJson)\n\t}, [messageJson, socket])\n\n\tconst scoredUsers = scoreUsers(\n\t\t{ id: userId?.id, location: usersLocation },\n\t\tusers,\n\t)\n\n\treturn { users: scoredUsers }\n}\n\nfunction scoreUsers(\n\tuser: { id?: string | null; location: User['location'] },\n\tusers: Array<User>,\n) {\n\tconst { location } = user\n\tconst scoredUsers = users.map((user) => {\n\t\tlet score = 0\n\t\tconst available = 5\n\t\tif (user.hasAccess) {\n\t\t\tscore += 1\n\t\t}\n\t\tif (location?.workshopTitle === user.location?.workshopTitle) {\n\t\t\tscore += 1\n\t\t\tif (\n\t\t\t\tlocation?.exercise?.exerciseNumber &&\n\t\t\t\tlocation.exercise.exerciseNumber ===\n\t\t\t\t\tuser.location?.exercise?.exerciseNumber\n\t\t\t) {\n\t\t\t\tscore += 1\n\t\t\t\tif (\n\t\t\t\t\tlocation.exercise.stepNumber &&\n\t\t\t\t\tlocation.exercise.stepNumber === user.location.exercise.stepNumber\n\t\t\t\t) {\n\t\t\t\t\tscore += 1\n\t\t\t\t\tif (\n\t\t\t\t\t\tlocation.exercise.type &&\n\t\t\t\t\t\tlocation.exercise.type === user.location.exercise.type\n\t\t\t\t\t) {\n\t\t\t\t\t\tscore += 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn { user, score: Math.floor((score / available) * 10) / 10 }\n\t})\n\treturn scoredUsers.sort((a, b) => {\n\t\tif (a.user.id === user?.id) return -1\n\t\tif (b.user.id === user?.id) return 1\n\t\tif (a.score === b.score) return 0\n\t\treturn a.score > b.score ? -1 : 1\n\t})\n}\n\nfunction PresenceOnline({\n\tuser,\n\tchildren,\n}: {\n\tuser?: User | null\n\tchildren: React.ReactNode\n}) {\n\treturn (\n\t\t<PresenceContext.Provider value={usePresenceSocket(user)}>\n\t\t\t{children}\n\t\t</PresenceContext.Provider>\n\t)\n}\n\nfunction PresenceOffline({\n\tuser,\n\tchildren,\n}: {\n\tuser?: User | null\n\tchildren: React.ReactNode\n}) {\n\tconst usersLocation = useUsersLocation()\n\tconst { presence } = useRouteLoaderData<typeof rootLoader>('root') ?? {}\n\treturn (\n\t\t<PresenceContext.Provider\n\t\t\tvalue={{\n\t\t\t\tusers: scoreUsers(\n\t\t\t\t\t{ id: user?.id, location: usersLocation },\n\t\t\t\t\tpresence?.users ?? [],\n\t\t\t\t),\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</PresenceContext.Provider>\n\t)\n}\n\nexport function Presence({\n\tuser,\n\tchildren,\n}: {\n\tuser?: User | null\n\tchildren: React.ReactNode\n}) {\n\tconst isOnline = useIsOnline()\n\tif (isOnline) {\n\t\treturn <PresenceOnline user={user}>{children}</PresenceOnline>\n\t} else {\n\t\treturn <PresenceOffline user={user}>{children}</PresenceOffline>\n\t}\n}\n\nexport function usePresence() {\n\tconst presence = useContext(PresenceContext)\n\tif (!presence) {\n\t\tthrow new Error('usePresence must be used within a PresenceProvider')\n\t}\n\treturn presence\n}\n"],"names":["partykitRoom","partykitBaseUrl","UserSchema","z","MessageSchema","ErrorEvent","error","target","__publicField","CloseEvent","code","reason","Events","assert","condition","msg","cloneEventBrowser","e","cloneEventNode","isNode","_a","cloneEvent","DEFAULT","didWarnAboutMissingWebSocket","ReconnectingWebSocket","_ReconnectingWebSocket","url","protocols","options","event","minUptime","message","value","acc","data","maxEnqueuedMessages","args","reconnectionDelayGrowFactor","minReconnectionDelay","maxReconnectionDelay","delay","resolve","protocolsProvider","urlProvider","maxRetries","connectionTimeout","WS","err","valueIsNotNil","keyValuePair","generateUUID","d","d2","c","r","getPartyInfo","partySocketOptions","defaultProtocol","defaultParams","rawHost","rawPath","rawProtocol","room","party","prefix","query","host","name","path","protocol","baseUrl","makeUrl","query2","PartySocket","wsOptions","getWSOptions","_pk","_pkurl","init","id","_host","_path","_party","_room","_protocol","_query","socketOptions","useAttachWebSocketEventHandlers","socket","handlersRef","useRef","useEffect","onOpen","_b","onMessage","onClose","onError","getOptionsThatShouldCauseRestartWhenChanged","useStableSocket","createSocket","createOptionsMemoKey","shouldReconnect","useMemo","setSocket","useState","socketInitializedRef","useRef2","createSocketRef","useEffect2","newSocket","usePartySocket","otherOptions","options2","PresenceContext","createContext","usePresencePreferences","useRouteLoaderData","useOptionalWorkshopTitle","ExerciseAppParamsSchema","useFirstCallDelayedCallback","cb","timedPromise","mounted","currentCallRef","lastCbRef","useCallback","thisOne","useUsersLocation","workshopTitle","requestInfo","useRequestInfo","rawParams","useParams","paramsResult","params","usePresenceSocket","user","prefs","userHasAccess","userId","presence","users","setUsers","usersLocation","handleMessage","evt","messageResult","messageJson","scoreUsers","location","score","available","a","b","PresenceOnline","children","jsx","PresenceOffline","Presence","useIsOnline","usePresence","useContext"],"mappings":"+VAEO,MAAMA,EAAe,oBAEfC,EAAkB,kEAAkED,CAAY,GAEhGE,EAAaC,EAAE,OAAO,CAClC,GAAIA,EAAE,OAAO,EACb,UAAWA,EAAE,QAAU,EAAA,SAAA,EAAW,SAAS,EAE3C,UAAWA,EAAE,OAAS,EAAA,SAAA,EAAW,SAAS,EAC1C,cAAeA,EAAE,OAAS,EAAA,SAAA,EAAW,SAAS,EAC9C,cAAeA,EAAE,OAAS,EAAA,SAAA,EAAW,SAAS,EAC9C,KAAMA,EAAE,OAAS,EAAA,SAAA,EAAW,SAAS,EACrC,SAAUA,EACR,OAAO,CACP,cAAeA,EAAE,OAAS,EAAA,SAAA,EAAW,SAAS,EAC9C,OAAQA,EAAE,OAAS,EAAA,SAAA,EAAW,SAAS,EACvC,SAAUA,EACR,OAAO,CACP,KAAMA,EACJ,MAAM,CAACA,EAAE,QAAQ,SAAS,EAAGA,EAAE,QAAQ,UAAU,CAAC,CAAC,EACnD,SAAA,EACA,SAAS,EACX,eAAgBA,EAAE,OAAS,EAAA,SAAA,EAAW,SAAS,EAC/C,WAAYA,EAAE,OAAS,EAAA,SAAA,EAAW,SAAS,CAAA,CAC3C,EACA,SAAS,EACT,SAAS,CAAA,CACX,EACA,SAAS,EACT,SAAS,CACZ,CAAC,EAEYC,EAAgBD,EAC3B,OAAO,CACP,KAAMA,EAAE,QAAQ,aAAa,EAC7B,QAASA,EAAE,OAAO,CAAE,GAAIA,EAAE,OAAA,EAAU,CACrC,CAAC,EACA,GAAGA,EAAE,OAAO,CAAE,KAAMA,EAAE,QAAQ,UAAU,EAAG,QAASD,CAAY,CAAA,CAAC,EACjE,GACAC,EAAE,OAAO,CACR,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EAAM,IAAW,GAC/BiB,EAAE,KAAK,MAAOjB,GAAA,YAAAA,EAAM,IAAW,EAC/BgB,EAAE,QAAUC,EAAE,MAAc,EACzBD,EAAE,MAAQC,EAAE,MAAQ,GAAK,CAChC,CACF,CAEA,SAASC,GAAe,CACvB,KAAAlB,EACA,SAAAmB,CACD,EAGG,CAED,OAAAC,EAAA,IAAC3C,EAAgB,SAAhB,CAAyB,MAAOsB,GAAkBC,CAAI,EACrD,SAAAmB,CACF,CAAA,CAEF,CAEA,SAASE,GAAgB,CACxB,KAAArB,EACA,SAAAmB,CACD,EAGG,CACF,MAAMZ,EAAgBhB,IAChB,CAAE,SAAAa,CAAS,EAAIxB,EAAsC,MAAM,GAAK,CAAA,EAErE,OAAAwC,EAAA,IAAC3C,EAAgB,SAAhB,CACA,MAAO,CACN,MAAOmC,EACN,CAAE,GAAIZ,GAAA,YAAAA,EAAM,GAAI,SAAUO,CAAc,GACxCH,GAAA,YAAAA,EAAU,QAAS,CAAC,CACrB,CACD,EAEC,SAAAe,CAAA,CAAA,CAGJ,CAEO,SAASG,GAAS,CACxB,KAAAtB,EACA,SAAAmB,CACD,EAGG,CAEF,OADiBI,IAETH,EAAA,IAACF,GAAe,CAAA,KAAAlB,EAAa,SAAAmB,CAAS,CAAA,EAEtCC,EAAA,IAACC,GAAgB,CAAA,KAAArB,EAAa,SAAAmB,CAAS,CAAA,CAEhD,CAEO,SAASK,IAAc,CACvB,MAAApB,EAAWqB,aAAWhD,CAAe,EAC3C,GAAI,CAAC2B,EACE,MAAA,IAAI,MAAM,oDAAoD,EAE9D,OAAAA,CACR","x_google_ignoreList":[1,2,3,4]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as e,r as a}from"./index-CGzylDPY.js";import{u as oe,b as X,I,c as le,a as Z}from"./misc-CQmANiHr.js";import{z as t,a as C,u as O}from"./index-CMYl882D.js";import{B as ee,L as ce}from"./button-ChOzbirS.js";import{L as te}from"./loading-CPEkK5hO.js";import{s as z}from"./progress-bar-ZCHf2Y4W.js";import{u as q}from"./pe-DXT2FOp1.js";import{a as H,e as ue,F as de}from"./components-DrvY4pal.js";import{T as he,a as v,b as E,c as B}from"./tooltip-Cd0yJoQb.js";function me({name:i}){var l;const r=H(),o=q(),c=(l=r.formData)==null?void 0:l.get("intent"),u=c==="stop"?"Stopping App":c==="restart"?"Restarting App":null,d=oe();return e.jsxs(r.Form,{method:"POST",action:"/start",children:[o,z,e.jsx("input",{type:"hidden",name:"name",value:i}),e.jsx("button",{type:"submit",name:"intent",value:d?"restart":"stop",className:"h-full border-r px-3 py-4 font-mono text-xs uppercase leading-none",children:u||(d?"Restart App":"Stop App")})]})}function re({port:i}){const r=H(),o=q();return e.jsxs(r.Form,{method:"POST",action:"/start",children:[o,z,e.jsx("input",{type:"hidden",name:"port",value:i}),e.jsx(ee,{varient:"mono",type:"submit",name:"intent",value:"stop-port",children:r.state==="idle"?"Stop Port":"Stopping Port"})]})}function fe({name:i}){var c;const r=H(),o=q();return((c=r.data)==null?void 0:c.status)==="app-not-started"?r.data.error==="port-unavailable"?e.jsxs("div",{children:["The port is unavailable. Would you like to stop whatever is running on that port and try again?",e.jsx(re,{port:r.data.port})]}):e.jsx("div",{children:"An unknown error has happened."}):e.jsxs(r.Form,{method:"POST",action:"/start",children:[o,z,e.jsx("input",{type:"hidden",name:"name",value:i}),r.state==="idle"?e.jsx(ee,{type:"submit",name:"intent",value:"start",varient:"mono",children:"Start App"}):e.jsx("div",{children:e.jsx(te,{children:"Starting App"})})]})}const pe=t.intersection(t.object({type:t.literal("epicshop:history-call")}),t.union([t.object({method:t.literal("pushState"),args:t.union([t.tuple([t.object({}).passthrough(),t.unknown()]),t.tuple([t.object({}).passthrough(),t.unknown(),t.string()])])}),t.object({method:t.literal("replaceState"),args:t.union([t.tuple([t.object({}).passthrough(),t.unknown()]),t.tuple([t.object({}).passthrough(),t.unknown(),t.string()])])}),t.object({method:t.literal("go"),args:t.tuple([t.number().optional()])}),t.object({method:t.literal("forward"),args:t.tuple([])}),t.object({method:t.literal("back"),args:t.tuple([])}),t.object({method:t.literal("popstate"),pathname:t.string(),delta:t.number()})])),xe=t.object({type:t.literal("epicshop:loaded"),url:t.string()}),ge=t.union([pe,xe]);function Q(i,r,o){return Math.min(Math.max(i+r,0),o)}const je=a.forwardRef(we);function we({name:i,port:r,portIsAvailable:o,isRunning:c,baseUrl:u,id:d,initialRoute:l},x){const j=C(),[g,p]=a.useState(!1);return c||g?e.jsx(be,{baseUrl:u,id:d,name:i,ref:x,initialRoute:l}):o===!1?e.jsxs("div",{className:"flex flex-col items-center justify-center",children:[e.jsxs("p",{className:"max-w-xs pb-5 text-center",role:"status",children:["The port for this app is unavailable. It could be that you're running it ",e.jsx("a",{href:X({domain:j.domain,port:r}),className:"underline",target:"_blank",rel:"noreferrer",children:"elsewhere"}),". ",e.jsx(ce,{onClick:()=>p(!0),children:"Show here anyway"})]}),e.jsx(re,{port:r})]}):e.jsx(fe,{name:i})}const be=a.forwardRef(ye);function ye({baseUrl:i,id:r,name:o,initialRoute:c},u){const d=O(),[l,x]=ue(),j=l.get("pathname")??c,[g,p]=a.useState(0),se=r+g,S=a.useRef("new"),L=a.useRef(null),[w,U]=a.useState({history:[j],index:0}),[_,T]=a.useState(j),A=a.useRef(null),b=new URL(j,i),M=a.useRef(b);a.useEffect(()=>{M.current=b});const[W,K]=a.useState(b),F=a.useRef(r);F.current!==r&&(F.current=r,K(M.current)),a.useEffect(()=>{F.current=r}),a.useEffect(()=>{function n(h){var $;if(h.source!==(($=A.current)==null?void 0:$.contentWindow))return;const R=ge.safeParse(h.data,{path:["messageEvent","data"]});if(!R.success)return;const{data:m}=R;if(m.type==="epicshop:loaded"){U(s=>{const y=N=>Q(s.index,N,s.history.length-1);if(S.current==="back")return{...s,index:y(-1)};if(S.current==="forward")return{...s,index:y(1)};if(S.current==="new"){const N=s.history[s.index],f=new URL(m.url),P=f.pathname+f.search;if(N===P)return s;const J=[...s.history.slice(0,s.index+1),P];return{history:J,index:J.length-1}}else throw new Error("Unexpected lastDirectionRef value")});return}const{method:ie}=m;U(s=>{const y=f=>Q(s.index,f,s.history.length-1),N=s.history[s.index];switch(ie){case"popstate":return{...s,index:y(m.delta)};case"forward":return{...s,index:y(1)};case"back":return{...s,index:y(-1)};case"pushState":{const f=m.args[2]??N,P=[...s.history.slice(0,s.index+1),f].filter(Boolean);return{...s,history:P,index:P.length-1}}case"replaceState":{const f=m.args[2]??N;return{...s,history:[...s.history.slice(0,s.index),f,...s.history.slice(s.index+1)].filter(Boolean)}}case"go":{const[f=0]=m.args;return{...s,index:y(f)}}}})}return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[]);const G=a.useRef(x);a.useEffect(()=>{G.current=x},[x]);const k=w.history[w.index];a.useEffect(()=>{if(!k)return;T(k);const n=new URLSearchParams(window.location.search);k==="/"?n.delete("pathname"):n.set("pathname",k),`?${n.toString()}`!==window.location.search&&G.current(n,{replace:!0})},[k]);const D=(...n)=>{var R,m;const h=n[0];typeof h=="number"?S.current=h>0?"forward":"back":S.current="new",L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{S.current="new"},100),(m=(R=A.current)==null?void 0:R.contentWindow)==null||m.postMessage({type:"epicshop:navigate-call",params:n},"*")};function V(n=_){T(n);const h=w.history[w.index];D(n,{replace:h===n})}a.useImperativeHandle(u,()=>({handleExtrnalNavigation:V}));const ne=w.index===w.history.length-1,ae=w.index<=0,Y=[];for(const[n,h]of l.entries())n!=="pathname"&&Y.push(e.jsx("input",{type:"hidden",name:n,value:h},n));return e.jsx(he,{children:e.jsxs("div",{className:"flex h-full flex-grow flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between border-b pl-1.5",children:[e.jsxs("div",{className:"mr-2 flex items-center justify-center gap-2 px-1",children:[e.jsxs(v,{children:[e.jsx(E,{asChild:!0,children:e.jsx("button",{type:"button",className:"hidden aspect-square h-full w-full items-center justify-center p-1 transition disabled:opacity-40 sm:flex",disabled:ae,onClick:()=>D(-1),children:e.jsx(I,{name:"ArrowLeft","aria-hidden":"true"})})}),e.jsx(B,{children:"Go back"})]}),e.jsxs(v,{children:[e.jsx(E,{asChild:!0,children:e.jsx("button",{type:"button",className:"hidden aspect-square h-full w-full items-center justify-center p-1 transition disabled:opacity-40 sm:flex",disabled:ne,onClick:()=>D(1),children:e.jsx(I,{name:"ArrowRight","aria-hidden":"true"})})}),e.jsx(B,{children:"Go forward"})]}),e.jsxs(v,{children:[e.jsx(E,{asChild:!0,children:e.jsx("button",{type:"button",className:"flex aspect-square h-full w-full items-center justify-center p-1 transition disabled:opacity-40",onClick:()=>{K(b),p(g+1),U({history:[b.pathname],index:0})},children:e.jsx(I,{name:"Refresh","aria-hidden":"true"})})}),e.jsx(B,{children:"Refresh"})]})]}),e.jsxs(de,{method:"get",replace:!0,className:"flex flex-1 gap-2",onSubmit:()=>V(),children:[Y,e.jsxs("div",{className:"flex flex-1 items-center border-x bg-background p-3 leading-none text-foreground",children:[e.jsx("a",{href:b.toString(),target:"_blank",rel:"noreferrer",children:W.host}),e.jsx("input",{"aria-label":"pathname",className:"w-full flex-1 bg-background focus-visible:outline-none",value:_,name:"pathname",onChange:n=>T(n.currentTarget.value)})]})]}),e.jsx(me,{name:o}),e.jsxs(v,{children:[e.jsx(E,{asChild:!0,children:e.jsx("a",{href:b.toString(),target:"_blank",rel:"noreferrer",className:le("flex aspect-square items-center justify-center px-3.5"),children:e.jsx(I,{name:"ExternalLink"})})}),e.jsx(B,{children:"Open in new tab"})]})]}),e.jsx("div",{className:"flex h-full w-full flex-grow dark:bg-white",children:e.jsx("iframe",{title:o,ref:A,src:W.toString(),className:"h-full w-full flex-grow bg-white",style:{colorScheme:d}},se)})]})})}function Ue({id:i,appInfo:r,inBrowserBrowserRef:o}){const c=C(),u=O();if(!r)return e.jsx("p",{children:"No app here. Sorry."});const{isRunning:d,dev:l,name:x,portIsAvailable:j,title:g}=r;if(ENV.EPICSHOP_DEPLOYED&&r.stackBlitzUrl){const p=new URL(r.stackBlitzUrl);return p.searchParams.set("embed","1"),p.searchParams.set("theme",u),e.jsx(Se,{title:g,url:p.toString(),loadingContent:e.jsx(te,{children:e.jsxs("span",{children:["Loading"," ",e.jsxs("a",{className:"underline",href:r.stackBlitzUrl,children:['"',g,'"']})]})})})}if(l.type==="script"){const p=X({domain:c.domain,port:l.portNumber});return e.jsx(je,{ref:o,isRunning:d,id:i??x,name:x,portIsAvailable:j,port:l.portNumber,baseUrl:p,initialRoute:l.initialRoute})}else return l.type==="browser"?e.jsxs("div",{className:"relative h-full flex-grow overflow-y-auto scrollbar-thin scrollbar-thumb-scrollbar",children:[e.jsxs("a",{href:l.pathname,target:"_blank",rel:"noreferrer",className:Z("absolute bottom-5 right-5 flex items-center justify-center rounded-full bg-gray-100 p-2.5 transition hover:bg-gray-200 dark:bg-gray-800 hover:dark:bg-gray-600"),children:[e.jsx(I,{name:"ExternalLink","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Open in New Window"})]}),e.jsx("iframe",{title:g,src:l.pathname,className:"yo yo h-full w-full flex-grow bg-white",style:{colorScheme:u}})]}):e.jsx("div",{className:"flex h-full items-center justify-center text-lg",children:e.jsxs("p",{children:["Preview for dev type of ",e.jsx("code",{children:l.type})," not supported."]})})}function Se({url:i,title:r,loadingContent:o}){const c=O(),[u,d]=a.useState(!1);return e.jsxs("div",{className:"h-full w-full flex-grow",children:[u?null:e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center",children:o}),e.jsx("iframe",{onLoad:()=>d(!0),onError:()=>d(!0),src:i,className:Z("h-full w-full flex-grow transition-opacity duration-300",u?"opacity-100":"opacity-0"),title:r,sandbox:"allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",style:{colorScheme:c}})]})}export{Ue as P};
|
|
2
|
-
//# sourceMappingURL=preview-DaTpH6lj.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as T,j as U,u as Ts,c as to}from"./index-CGzylDPY.js";import{c as rn}from"./misc-CQmANiHr.js";import{u as eo}from"./pe-DXT2FOp1.js";import{b as no,c as so,a as io}from"./components-DrvY4pal.js";function oo(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>t(...s);return new Proxy(n,{get:(s,i)=>i==="create"?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}function bt(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const he=t=>Array.isArray(t);function bs(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function St(t){return typeof t=="string"||Array.isArray(t)}function an(t){const e=[{},{}];return t==null||t.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Ce(t,e,n,s){if(typeof e=="function"){const[i,r]=an(s);e=e(n!==void 0?n:t.custom,i,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[i,r]=an(s);e=e(n!==void 0?n:t.custom,i,r)}return e}function Wt(t,e,n){const s=t.getProps();return Ce(s,e,n!==void 0?n:s.custom,t)}const De=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Me=["initial",...De],Ct=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Q=new Set(Ct),G=t=>t*1e3,z=t=>t/1e3,ro={type:"spring",stiffness:500,damping:25,restSpeed:10},ao=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),lo={type:"keyframes",duration:.8},uo={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},co=(t,{keyframes:e})=>e.length>2?lo:Q.has(t)?t.startsWith("scale")?ao(e[1]):ro:uo;function Re(t,e){return t[e]||t.default||t}const ho={skipAnimations:!1,useManualTiming:!1},fo=t=>t!==null;function $t(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(fo),r=e&&n!=="loop"&&e%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const L=t=>t;function po(t){let e=new Set,n=new Set,s=!1,i=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){r.has(u)&&(l.schedule(u),t()),u(o)}const l={schedule:(u,c=!1,h=!1)=>{const d=h&&s?e:n;return c&&r.add(u),d.has(u)||d.add(u),u},cancel:u=>{n.delete(u),r.delete(u)},process:u=>{if(o=u,s){i=!0;return}s=!0,[e,n]=[n,e],n.clear(),e.forEach(a),s=!1,i&&(i=!1,l.process(u))}};return l}const Rt=["read","resolveKeyframes","update","preRender","render","postRender"],mo=40;function Ss(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=Rt.reduce((g,v)=>(g[v]=po(r),g),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:h,postRender:f}=o,d=()=>{const g=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(g-i.timestamp,mo),1),i.timestamp=g,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),h.process(i),f.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(d))},p=()=>{n=!0,s=!0,i.isProcessing||t(d)};return{schedule:Rt.reduce((g,v)=>{const x=o[v];return g[v]=(b,S=!1,D=!1)=>(n||p(),x.schedule(b,S,D)),g},{}),cancel:g=>{for(let v=0;v<Rt.length;v++)o[Rt[v]].cancel(g)},state:i,steps:o}}const{schedule:w,cancel:q,state:M,steps:Zt}=Ss(typeof requestAnimationFrame<"u"?requestAnimationFrame:L,!0),As=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,go=1e-7,yo=12;function vo(t,e,n,s,i){let r,o,a=0;do o=e+(n-e)/2,r=As(o,s,i)-t,r>0?n=o:e=o;while(Math.abs(r)>go&&++a<yo);return o}function Dt(t,e,n,s){if(t===e&&n===s)return L;const i=r=>vo(r,0,1,t,n);return r=>r===0||r===1?r:As(i(r),e,s)}const ws=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Vs=t=>e=>1-t(1-e),Cs=Dt(.33,1.53,.69,.99),Ee=Vs(Cs),Ds=ws(Ee),Ms=t=>(t*=2)<1?.5*Ee(t):.5*(2-Math.pow(2,-10*(t-1))),Le=t=>1-Math.sin(Math.acos(t)),Rs=Vs(Le),Es=ws(Le),Ls=t=>/^0[^.\s]+$/u.test(t);function xo(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Ls(t):!0}let fe=L;const Fs=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ks=t=>e=>typeof e=="string"&&e.startsWith(t),Bs=ks("--"),Po=ks("var(--"),Fe=t=>Po(t)?To.test(t.split("/*")[0].trim()):!1,To=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,bo=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function So(t){const e=bo.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}function js(t,e,n=1){const[s,i]=So(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const o=r.trim();return Fs(o)?parseFloat(o):o}return Fe(i)?js(i,e,n+1):i}const Z=(t,e,n)=>n>e?e:n<t?t:n,mt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},At={...mt,transform:t=>Z(0,1,t)},Et={...mt,default:1},Mt=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Y=Mt("deg"),_=Mt("%"),P=Mt("px"),Ao=Mt("vh"),wo=Mt("vw"),ln={..._,parse:t=>_.parse(t)/100,transform:t=>_.transform(t*100)},Vo=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),un=t=>t===mt||t===P,cn=(t,e)=>parseFloat(t.split(", ")[e]),hn=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/u);if(i)return cn(i[1],e);{const r=s.match(/^matrix\((.+)\)$/u);return r?cn(r[1],t):0}},Co=new Set(["x","y","z"]),Do=Ct.filter(t=>!Co.has(t));function Mo(t){const e=[];return Do.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const ft={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:hn(4,13),y:hn(5,14)};ft.translateX=ft.x;ft.translateY=ft.y;const Os=t=>e=>e.test(t),Ro={test:t=>t==="auto",parse:t=>t},Is=[mt,P,_,Y,wo,Ao,Ro],fn=t=>Is.find(Os(t)),ot=new Set;let de=!1,pe=!1;function Ns(){if(pe){const t=Array.from(ot).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const i=Mo(s);i.length&&(n.set(s,i),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const i=n.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}pe=!1,de=!1,ot.forEach(t=>t.complete()),ot.clear()}function Us(){ot.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(pe=!0)})}function Eo(){Us(),Ns()}class ke{constructor(e,n,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ot.add(this),de||(de=!0,w.read(Us),w.resolveKeyframes(Ns))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:i}=this;for(let r=0;r<e.length;r++)if(e[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=e[e.length-1];if(o!==void 0)e[0]=o;else if(s&&n){const l=s.readValue(n,a);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=a),i&&o===void 0&&i.set(e[0])}else e[r]=e[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ot.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ot.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const xt=t=>Math.round(t*1e5)/1e5,Be=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Lo(t){return t==null}const Fo=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,je=(t,e)=>n=>!!(typeof n=="string"&&Fo.test(n)&&n.startsWith(t)||e&&!Lo(n)&&Object.prototype.hasOwnProperty.call(n,e)),_s=(t,e,n)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(Be);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},ko=t=>Z(0,255,t),Jt={...mt,transform:t=>Math.round(ko(t))},it={test:je("rgb","red"),parse:_s("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Jt.transform(t)+", "+Jt.transform(e)+", "+Jt.transform(n)+", "+xt(At.transform(s))+")"};function Bo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const me={test:je("#"),parse:Bo,transform:it.transform},at={test:je("hsl","hue"),parse:_s("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+_.transform(xt(e))+", "+_.transform(xt(n))+", "+xt(At.transform(s))+")"},R={test:t=>it.test(t)||me.test(t)||at.test(t),parse:t=>it.test(t)?it.parse(t):at.test(t)?at.parse(t):me.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?it.transform(t):at.transform(t)},jo=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Oo(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Be))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(jo))===null||n===void 0?void 0:n.length)||0)>0}const Ks="number",Ws="color",Io="var",No="var(",dn="${}",Uo=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wt(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=e.replace(Uo,l=>(R.test(l)?(s.color.push(r),i.push(Ws),n.push(R.parse(l))):l.startsWith(No)?(s.var.push(r),i.push(Io),n.push(l)):(s.number.push(r),i.push(Ks),n.push(parseFloat(l))),++r,dn)).split(dn);return{values:n,split:a,indexes:s,types:i}}function $s(t){return wt(t).values}function Gs(t){const{split:e,types:n}=wt(t),s=e.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=e[o],i[o]!==void 0){const a=n[o];a===Ks?r+=xt(i[o]):a===Ws?r+=R.transform(i[o]):r+=i[o]}return r}}const _o=t=>typeof t=="number"?0:t;function Ko(t){const e=$s(t);return Gs(t)(e.map(_o))}const J={test:Oo,parse:$s,createTransformer:Gs,getAnimatableNone:Ko},Wo=new Set(["brightness","contrast","saturate","opacity"]);function $o(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Be)||[];if(!s)return t;const i=n.replace(s,"");let r=Wo.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const Go=/\b([a-z-]*)\(.*?\)/gu,ge={...J,getAnimatableNone:t=>{const e=t.match(Go);return e?e.map($o).join(" "):t}},zo={borderWidth:P,borderTopWidth:P,borderRightWidth:P,borderBottomWidth:P,borderLeftWidth:P,borderRadius:P,radius:P,borderTopLeftRadius:P,borderTopRightRadius:P,borderBottomRightRadius:P,borderBottomLeftRadius:P,width:P,maxWidth:P,height:P,maxHeight:P,top:P,right:P,bottom:P,left:P,padding:P,paddingTop:P,paddingRight:P,paddingBottom:P,paddingLeft:P,margin:P,marginTop:P,marginRight:P,marginBottom:P,marginLeft:P,backgroundPositionX:P,backgroundPositionY:P},Ho={rotate:Y,rotateX:Y,rotateY:Y,rotateZ:Y,scale:Et,scaleX:Et,scaleY:Et,scaleZ:Et,skew:Y,skewX:Y,skewY:Y,distance:P,translateX:P,translateY:P,translateZ:P,x:P,y:P,z:P,perspective:P,transformPerspective:P,opacity:At,originX:ln,originY:ln,originZ:P},pn={...mt,transform:Math.round},Oe={...zo,...Ho,zIndex:pn,size:P,fillOpacity:At,strokeOpacity:At,numOctaves:pn},Xo={...Oe,color:R,backgroundColor:R,outlineColor:R,fill:R,stroke:R,borderColor:R,borderTopColor:R,borderRightColor:R,borderBottomColor:R,borderLeftColor:R,filter:ge,WebkitFilter:ge},Ie=t=>Xo[t];function zs(t,e){let n=Ie(t);return n!==ge&&(n=J),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Yo=new Set(["auto","none","0"]);function qo(t,e,n){let s=0,i;for(;s<t.length&&!i;){const r=t[s];typeof r=="string"&&!Yo.has(r)&&wt(r).values.length&&(i=t[s]),s++}if(i&&n)for(const r of e)t[r]=zs(n,i)}class Hs extends ke{constructor(e,n,s,i,r){super(e,n,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<e.length;l++){let u=e[l];if(typeof u=="string"&&(u=u.trim(),Fe(u))){const c=js(u,n.current);c!==void 0&&(e[l]=c),l===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Vo.has(s)||e.length!==2)return;const[i,r]=e,o=fn(i),a=fn(r);if(o!==a)if(un(o)&&un(a))for(let l=0;l<e.length;l++){const u=e[l];typeof u=="string"&&(e[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let i=0;i<e.length;i++)xo(e[i])&&s.push(i);s.length&&qo(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ft[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&e.getValue(s,i).jump(i,!1)}measureEndState(){var e;const{element:n,name:s,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const r=n.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=ft[s](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function Ne(t){return typeof t=="function"}let Ft;function Zo(){Ft=void 0}const K={now:()=>(Ft===void 0&&K.set(M.isProcessing||ho.useManualTiming?M.timestamp:performance.now()),Ft),set:t=>{Ft=t,queueMicrotask(Zo)}},mn=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(J.test(t)||t==="0")&&!t.startsWith("url("));function Jo(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function Qo(t,e,n,s){const i=t[0];if(i===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=mn(i,e),a=mn(r,e);return!o||!a?!1:Jo(t)||(n==="spring"||Ne(n))&&s}const tr=40;class Xs{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=K.now(),this.options={autoplay:e,delay:n,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>tr?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&Eo(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=K.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!Qo(e,s,i,r))if(o)this.options.duration=0;else{l==null||l($t(e,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const c=this.initPlayback(e,n);c!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...c},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}function Ys(t,e){return e?t*(1e3/e):0}const er=5;function qs(t,e,n){const s=Math.max(e-er,0);return Ys(n-t(s),e-s)}const Qt=.001,nr=.01,sr=10,ir=.05,or=1;function rr({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let i,r,o=1-e;o=Z(ir,or,o),t=Z(nr,sr,z(t)),o<1?(i=u=>{const c=u*o,h=c*t,f=c-n,d=ye(u,o),p=Math.exp(-h);return Qt-f/d*p},r=u=>{const h=u*o*t,f=h*n+n,d=Math.pow(o,2)*Math.pow(u,2)*t,p=Math.exp(-h),m=ye(Math.pow(u,2),o);return(-i(u)+Qt>0?-1:1)*((f-d)*p)/m}):(i=u=>{const c=Math.exp(-u*t),h=(u-n)*t+1;return-Qt+c*h},r=u=>{const c=Math.exp(-u*t),h=(n-u)*(t*t);return c*h});const a=5/t,l=lr(i,r,a);if(t=G(t),isNaN(l))return{stiffness:100,damping:10,duration:t};{const u=Math.pow(l,2)*s;return{stiffness:u,damping:o*2*Math.sqrt(s*u),duration:t}}}const ar=12;function lr(t,e,n){let s=n;for(let i=1;i<ar;i++)s=s-t(s)/e(s);return s}function ye(t,e){return t*Math.sqrt(1-e*e)}const ur=["duration","bounce"],cr=["stiffness","damping","mass"];function gn(t,e){return e.some(n=>t[n]!==void 0)}function hr(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!gn(t,cr)&&gn(t,ur)){const n=rr(t);e={...e,...n,mass:1},e.isResolvedFromDuration=!0}return e}function Zs({keyframes:t,restDelta:e,restSpeed:n,...s}){const i=t[0],r=t[t.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:h,isResolvedFromDuration:f}=hr({...s,velocity:-z(s.velocity||0)}),d=h||0,p=l/(2*Math.sqrt(a*u)),m=r-i,y=z(Math.sqrt(a/u)),g=Math.abs(m)<5;n||(n=g?.01:2),e||(e=g?.005:.5);let v;if(p<1){const x=ye(y,p);v=b=>{const S=Math.exp(-p*y*b);return r-S*((d+p*y*m)/x*Math.sin(x*b)+m*Math.cos(x*b))}}else if(p===1)v=x=>r-Math.exp(-y*x)*(m+(d+y*m)*x);else{const x=y*Math.sqrt(p*p-1);v=b=>{const S=Math.exp(-p*y*b),D=Math.min(x*b,300);return r-S*((d+p*y*m)*Math.sinh(D)+x*m*Math.cosh(D))/x}}return{calculatedDuration:f&&c||null,next:x=>{const b=v(x);if(f)o.done=x>=c;else{let S=0;p<1&&(S=x===0?G(d):qs(v,x,b));const D=Math.abs(S)<=n,N=Math.abs(r-b)<=e;o.done=D&&N}return o.value=o.done?r:b,o}}}function yn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const h=t[0],f={done:!1,value:h},d=A=>a!==void 0&&A<a||l!==void 0&&A>l,p=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let m=n*e;const y=h+m,g=o===void 0?y:o(y);g!==y&&(m=g-h);const v=A=>-m*Math.exp(-A/s),x=A=>g+v(A),b=A=>{const B=v(A),j=x(A);f.done=Math.abs(B)<=u,f.value=f.done?g:j};let S,D;const N=A=>{d(f.value)&&(S=A,D=Zs({keyframes:[f.value,p(f.value)],velocity:qs(x,A,f.value),damping:i,stiffness:r,restDelta:u,restSpeed:c}))};return N(0),{calculatedDuration:null,next:A=>{let B=!1;return!D&&S===void 0&&(B=!0,b(A),N(A)),S!==void 0&&A>=S?D.next(A-S):(!B&&b(A),f)}}}const fr=Dt(.42,0,1,1),dr=Dt(0,0,.58,1),Js=Dt(.42,0,.58,1),pr=t=>Array.isArray(t)&&typeof t[0]!="number",vn={linear:L,easeIn:fr,easeInOut:Js,easeOut:dr,circIn:Le,circInOut:Es,circOut:Rs,backIn:Ee,backInOut:Ds,backOut:Cs,anticipate:Ms},xn=t=>{if(Array.isArray(t)){fe(t.length===4);const[e,n,s,i]=t;return Dt(e,n,s,i)}else if(typeof t=="string")return fe(vn[t]!==void 0),vn[t];return t},mr=(t,e)=>n=>e(t(n)),H=(...t)=>t.reduce(mr),dt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},V=(t,e,n)=>t+(e-t)*n;function te(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function gr({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,r=0,o=0;if(!e)i=r=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;i=te(l,a,t+1/3),r=te(l,a,t),o=te(l,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function jt(t,e){return n=>n>0?e:t}const ee=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},yr=[me,it,at],vr=t=>yr.find(e=>e.test(t));function Pn(t){const e=vr(t);if(!e)return!1;let n=e.parse(t);return e===at&&(n=gr(n)),n}const Tn=(t,e)=>{const n=Pn(t),s=Pn(e);if(!n||!s)return jt(t,e);const i={...n};return r=>(i.red=ee(n.red,s.red,r),i.green=ee(n.green,s.green,r),i.blue=ee(n.blue,s.blue,r),i.alpha=V(n.alpha,s.alpha,r),it.transform(i))},ve=new Set(["none","hidden"]);function xr(t,e){return ve.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function Pr(t,e){return n=>V(t,e,n)}function Ue(t){return typeof t=="number"?Pr:typeof t=="string"?Fe(t)?jt:R.test(t)?Tn:Sr:Array.isArray(t)?Qs:typeof t=="object"?R.test(t)?Tn:Tr:jt}function Qs(t,e){const n=[...t],s=n.length,i=t.map((r,o)=>Ue(r)(r,e[o]));return r=>{for(let o=0;o<s;o++)n[o]=i[o](r);return n}}function Tr(t,e){const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=Ue(t[i])(t[i],e[i]));return i=>{for(const r in s)n[r]=s[r](i);return n}}function br(t,e){var n;const s=[],i={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][i[o]],l=(n=t.values[a])!==null&&n!==void 0?n:0;s[r]=l,i[o]++}return s}const Sr=(t,e)=>{const n=J.createTransformer(e),s=wt(t),i=wt(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?ve.has(t)&&!i.values.length||ve.has(e)&&!s.values.length?xr(t,e):H(Qs(br(s,i),i.values),n):jt(t,e)};function ti(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?V(t,e,n):Ue(t)(t,e)}function Ar(t,e,n){const s=[],i=n||ti,r=t.length-1;for(let o=0;o<r;o++){let a=i(t[o],t[o+1]);if(e){const l=Array.isArray(e)?e[o]||L:e;a=H(l,a)}s.push(a)}return s}function wr(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(fe(r===e.length),r===1)return()=>e[0];if(r===2&&t[0]===t[1])return()=>e[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=Ar(e,s,i),a=o.length,l=u=>{let c=0;if(a>1)for(;c<t.length-2&&!(u<t[c+1]);c++);const h=dt(t[c],t[c+1],u);return o[c](h)};return n?u=>l(Z(t[0],t[r-1],u)):l}function Vr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=dt(0,e,s);t.push(V(n,1,i))}}function Cr(t){const e=[0];return Vr(e,t.length-1),e}function Dr(t,e){return t.map(n=>n*e)}function Mr(t,e){return t.map(()=>e||Js).splice(0,t.length-1)}function Ot({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=pr(s)?s.map(xn):xn(s),r={done:!1,value:e[0]},o=Dr(n&&n.length===e.length?n:Cr(e),t),a=wr(o,e,{ease:Array.isArray(i)?i:Mr(e,i)});return{calculatedDuration:t,next:l=>(r.value=a(l),r.done=l>=t,r)}}const bn=2e4;function Rr(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<bn;)e+=n,s=t.next(e);return e>=bn?1/0:e}const Er=t=>{const e=({timestamp:n})=>t(n);return{start:()=>w.update(e,!0),stop:()=>q(e),now:()=>M.isProcessing?M.timestamp:K.now()}},Lr={decay:yn,inertia:yn,tween:Ot,keyframes:Ot,spring:Zs},Fr=t=>t/100;class _e extends Xs{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:s,element:i,keyframes:r}=this.options,o=(i==null?void 0:i.KeyframeResolver)||ke,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(r,a,n,s,i),this.resolver.scheduleResolve()}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,a=Ne(n)?n:Lr[n]||Ot;let l,u;a!==Ot&&typeof e[0]!="number"&&(l=H(Fr,ti(e[0],e[1])),e=[0,100]);const c=a({...this.options,keyframes:e});r==="mirror"&&(u=a({...this.options,keyframes:[...e].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Rr(c));const{calculatedDuration:h}=c,f=h+i,d=f*(s+1)-i;return{generator:c,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:f,totalDuration:d}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:c,resolvedDuration:h}=s;if(this.startTime===null)return r.next(0);const{delay:f,repeat:d,repeatType:p,repeatDelay:m,onUpdate:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-f*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=c);let x=this.currentTime,b=r;if(d){const A=Math.min(this.currentTime,c)/h;let B=Math.floor(A),j=A%1;!j&&A>=1&&(j=1),j===1&&B--,B=Math.min(B,d+1),!!(B%2)&&(p==="reverse"?(j=1-j,m&&(j-=m/h)):p==="mirror"&&(b=o)),x=Z(0,1,j)*h}const S=v?{done:!1,value:l[0]}:b.next(x);a&&(S.value=a(S.value));let{done:D}=S;!v&&u!==null&&(D=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const N=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return N&&i!==void 0&&(S.value=$t(l,this.options,i)),y&&y(S.value),N&&this.finish(),S}get duration(){const{resolved:e}=this;return e?z(e.calculatedDuration):0}get time(){return z(this.currentTime)}set time(e){e=G(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=z(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=Er,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(r=>this.tick(r))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const ei=new Set(["opacity","clipPath","filter","transform"]),ni=t=>Array.isArray(t)&&typeof t[0]=="number",kr=10,Br=(t,e)=>{let n="";const s=Math.max(Math.round(e/kr),2);for(let i=0;i<s;i++)n+=t(dt(0,s-1,i))+", ";return`linear(${n.substring(0,n.length-2)})`};function Ke(t){let e;return()=>(e===void 0&&(e=t()),e)}const jr={linearEasing:void 0};function Or(t,e){const n=Ke(t);return()=>{var s;return(s=jr[e])!==null&&s!==void 0?s:n()}}const It=Or(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function si(t){return!!(typeof t=="function"&&It()||!t||typeof t=="string"&&(t in xe||It())||ni(t)||Array.isArray(t)&&t.every(si))}const yt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,xe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yt([0,.65,.55,1]),circOut:yt([.55,0,1,.45]),backIn:yt([.31,.01,.66,-.59]),backOut:yt([.33,1.53,.69,.99])};function ii(t,e){if(t)return typeof t=="function"&&It()?Br(t,e):ni(t)?yt(t):Array.isArray(t)?t.map(n=>ii(n,e)||xe.easeOut):xe[t]}function Ir(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=ii(a,i);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:s,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}function Sn(t,e){t.timeline=e,t.onfinish=null}const Nr=Ke(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Nt=10,Ur=2e4;function _r(t){return Ne(t.type)||t.type==="spring"||!si(t.ease)}function Kr(t,e){const n=new _e({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const i=[];let r=0;for(;!s.done&&r<Ur;)s=n.sample(r),i.push(s.value),r+=Nt;return{times:void 0,keyframes:i,duration:r-Nt,ease:"linear"}}const oi={anticipate:Ms,backInOut:Ds,circInOut:Es};function Wr(t){return t in oi}class An extends Xs{constructor(e){super(e);const{name:n,motionValue:s,element:i,keyframes:r}=this.options;this.resolver=new Hs(r,(o,a)=>this.onKeyframesResolved(o,a),n,s,i),this.resolver.scheduleResolve()}initPlayback(e,n){var s;let{duration:i=300,times:r,ease:o,type:a,motionValue:l,name:u,startTime:c}=this.options;if(!(!((s=l.owner)===null||s===void 0)&&s.current))return!1;if(typeof o=="string"&&It()&&Wr(o)&&(o=oi[o]),_r(this.options)){const{onComplete:f,onUpdate:d,motionValue:p,element:m,...y}=this.options,g=Kr(e,y);e=g.keyframes,e.length===1&&(e[1]=e[0]),i=g.duration,r=g.times,o=g.ease,a="keyframes"}const h=Ir(l.owner.current,u,e,{...this.options,duration:i,times:r,ease:o});return h.startTime=c??this.calcStartTime(),this.pendingTimeline?(Sn(h,this.pendingTimeline),this.pendingTimeline=void 0):h.onfinish=()=>{const{onComplete:f}=this.options;l.set($t(e,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:h,duration:i,times:r,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return z(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return z(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=G(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return L;const{animation:s}=n;Sn(s,e)}return L}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:i,type:r,ease:o,times:a}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:c,onComplete:h,element:f,...d}=this.options,p=new _e({...d,keyframes:s,duration:i,type:r,ease:o,times:a,isGenerator:!0}),m=G(this.time);u.setWithVelocity(p.sample(m-Nt).value,p.sample(m).value,Nt)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:i,repeatType:r,damping:o,type:a}=e;return Nr()&&s&&ei.has(s)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}}const $r=Ke(()=>window.ScrollTimeline!==void 0);class Gr{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,n){return Promise.all(this.animations).then(e).catch(n)}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e,n){const s=this.animations.map(i=>$r()&&i.attachTimeline?i.attachTimeline(e):n(i));return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function zr({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}const We=(t,e,n,s={},i,r)=>o=>{const a=Re(s,t)||{},l=a.delay||s.delay||0;let{elapsed:u=0}=s;u=u-G(l);let c={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};zr(a)||(c={...c,...co(t,c)}),c.duration&&(c.duration=G(c.duration)),c.repeatDelay&&(c.repeatDelay=G(c.repeatDelay)),c.from!==void 0&&(c.keyframes[0]=c.from);let h=!1;if((c.type===!1||c.duration===0&&!c.repeatDelay)&&(c.duration=0,c.delay===0&&(h=!0)),h&&!r&&e.get()!==void 0){const f=$t(c.keyframes,a);if(f!==void 0)return w.update(()=>{c.onUpdate(f),c.onComplete()}),new Gr([])}return!r&&An.supports(c)?new An(c):new _e(c)},Hr=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Xr=t=>he(t)?t[t.length-1]||0:t;function $e(t,e){t.indexOf(e)===-1&&t.push(e)}function Ge(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ze{constructor(){this.subscriptions=[]}add(e){return $e(this.subscriptions,e),()=>Ge(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const wn=30,Yr=t=>!isNaN(parseFloat(t));class qr{constructor(e,n={}){this.version="11.11.1",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=K.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=K.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Yr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new ze);const s=this.events[e].add(n);return e==="change"?()=>{s(),w.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=K.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>wn)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wn);return Ys(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vt(t,e){return new qr(t,e)}function Zr(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vt(n))}function Jr(t,e){const n=Wt(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const o in r){const a=Xr(r[o]);Zr(t,o,a)}}const Gt=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Qr="framerAppearId",ri="data-"+Gt(Qr);function ai(t){return t.props[ri]}const E=t=>!!(t&&t.getVelocity);function ta(t){return!!(E(t)&&t.add)}function li(t){if(Q.has(t))return"transform";if(ei.has(t))return Gt(t)}function Pe(t,e){var n;if(!t.applyWillChange)return;const s=t.getValue("willChange");if(ta(s))return s.add(e);!(!((n=t.props.style)===null||n===void 0)&&n.willChange)&&li(e)&&t.setStaticValue("willChange","transform")}function ea({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function ui(t,e,{delay:n=0,transitionOverride:s,type:i}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);const u=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const h in l){const f=t.getValue(h,(r=t.latestValues[h])!==null&&r!==void 0?r:null),d=l[h];if(d===void 0||c&&ea(c,h))continue;const p={delay:n,...Re(o||{},h)};let m=!1;if(window.MotionHandoffAnimation){const g=ai(t);if(g){const v=window.MotionHandoffAnimation(g,h,w);v!==null&&(p.startTime=v,m=!0)}}Pe(t,h),f.start(We(h,f,d,t.shouldReduceMotion&&Q.has(h)?{type:!1}:p,t,m));const y=f.animation;y&&u.push(y)}return a&&Promise.all(u).then(()=>{w.update(()=>{a&&Jr(t,a)})}),u}function Te(t,e,n={}){var s;const i=Wt(t,e,n.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(ui(t,i,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:c=0,staggerChildren:h,staggerDirection:f}=r;return na(t,e,c+u,h,f,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[u,c]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>c())}else return Promise.all([o(),a(n.delay)])}function na(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,l=i===1?(u=0)=>u*s:(u=0)=>a-u*s;return Array.from(t.variantChildren).sort(sa).forEach((u,c)=>{u.notify("AnimationStart",e),o.push(Te(u,e,{...r,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(o)}function sa(t,e){return t.sortNodePosition(e)}function ia(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(r=>Te(t,r,n));s=Promise.all(i)}else if(typeof e=="string")s=Te(t,e,n);else{const i=typeof e=="function"?Wt(t,e,n.custom):e;s=Promise.all(ui(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}const oa=Me.length;function ci(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?ci(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<oa;n++){const s=Me[n],i=t.props[s];(St(i)||i===!1)&&(e[s]=i)}return e}const ra=[...De].reverse(),aa=De.length;function la(t){return e=>Promise.all(e.map(({animation:n,options:s})=>ia(t,n,s)))}function ua(t){let e=la(t),n=Vn(),s=!0;const i=l=>(u,c)=>{var h;const f=Wt(t,c,l==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(f){const{transition:d,transitionEnd:p,...m}=f;u={...u,...m,...p}}return u};function r(l){e=l(t)}function o(l){const{props:u}=t,c=ci(t.parent)||{},h=[],f=new Set;let d={},p=1/0;for(let y=0;y<aa;y++){const g=ra[y],v=n[g],x=u[g]!==void 0?u[g]:c[g],b=St(x),S=g===l?v.isActive:null;S===!1&&(p=y);let D=x===c[g]&&x!==u[g]&&b;if(D&&s&&t.manuallyAnimateOnMount&&(D=!1),v.protectedKeys={...d},!v.isActive&&S===null||!x&&!v.prevProp||bt(x)||typeof x=="boolean")continue;const N=ca(v.prevProp,x);let A=N||g===l&&v.isActive&&!D&&b||y>p&&b,B=!1;const j=Array.isArray(x)?x:[x];let rt=j.reduce(i(g),{});S===!1&&(rt={});const{prevResolvedValues:sn={}}=v,Qi={...sn,...rt},on=F=>{A=!0,f.has(F)&&(B=!0,f.delete(F)),v.needsAnimating[F]=!0;const W=t.getValue(F);W&&(W.liveStyle=!1)};for(const F in Qi){const W=rt[F],Yt=sn[F];if(d.hasOwnProperty(F))continue;let qt=!1;he(W)&&he(Yt)?qt=!bs(W,Yt):qt=W!==Yt,qt?W!=null?on(F):f.add(F):W!==void 0&&f.has(F)?on(F):v.protectedKeys[F]=!0}v.prevProp=x,v.prevResolvedValues=rt,v.isActive&&(d={...d,...rt}),s&&t.blockInitialAnimation&&(A=!1),A&&(!(D&&N)||B)&&h.push(...j.map(F=>({animation:F,options:{type:g}})))}if(f.size){const y={};f.forEach(g=>{const v=t.getBaseTarget(g),x=t.getValue(g);x&&(x.liveStyle=!0),y[g]=v??null}),h.push({animation:y})}let m=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(m=!1),s=!1,m?e(h):Promise.resolve()}function a(l,u){var c;if(n[l].isActive===u)return Promise.resolve();(c=t.variantChildren)===null||c===void 0||c.forEach(f=>{var d;return(d=f.animationState)===null||d===void 0?void 0:d.setActive(l,u)}),n[l].isActive=u;const h=o(l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:r,getState:()=>n,reset:()=>{n=Vn(),s=!0}}}function ca(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!bs(e,t):!1}function et(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Vn(){return{animate:et(!0),whileInView:et(),whileHover:et(),whileTap:et(),whileDrag:et(),whileFocus:et(),exit:et()}}class tt{constructor(e){this.isMounted=!1,this.node=e}update(){}}class ha extends tt{constructor(e){super(e),e.animationState||(e.animationState=ua(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();bt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let fa=0;class da extends tt{constructor(){super(...arguments),this.id=fa++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const i=this.node.animationState.setActive("exit",!e);n&&!e&&i.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const pa={animation:{Feature:ha},exit:{Feature:da}},hi=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function zt(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}const ma=t=>e=>hi(e)&&t(e,zt(e));function $(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function X(t,e,n,s){return $(t,e,ma(n),s)}const Cn=(t,e)=>Math.abs(t-e);function ga(t,e){const n=Cn(t.x,e.x),s=Cn(t.y,e.y);return Math.sqrt(n**2+s**2)}class fi{constructor(e,n,{transformPagePoint:s,contextWindow:i,dragSnapToOrigin:r=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=se(this.lastMoveEventInfo,this.history),f=this.startEvent!==null,d=ga(h.offset,{x:0,y:0})>=3;if(!f&&!d)return;const{point:p}=h,{timestamp:m}=M;this.history.push({...p,timestamp:m});const{onStart:y,onMove:g}=this.handlers;f||(y&&y(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,h)},this.handlePointerMove=(h,f)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=ne(f,this.transformPagePoint),w.update(this.updatePoint,!0)},this.handlePointerUp=(h,f)=>{this.end();const{onEnd:d,onSessionEnd:p,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=se(h.type==="pointercancel"?this.lastMoveEventInfo:ne(f,this.transformPagePoint),this.history);this.startEvent&&d&&d(h,y),p&&p(h,y)},!hi(e))return;this.dragSnapToOrigin=r,this.handlers=n,this.transformPagePoint=s,this.contextWindow=i||window;const o=zt(e),a=ne(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=M;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(e,se(a,this.history)),this.removeListeners=H(X(this.contextWindow,"pointermove",this.handlePointerMove),X(this.contextWindow,"pointerup",this.handlePointerUp),X(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),q(this.updatePoint)}}function ne(t,e){return e?{point:e(t.point)}:t}function Dn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function se({point:t},e){return{point:t,delta:Dn(t,di(e)),offset:Dn(t,ya(e)),velocity:va(e,.1)}}function ya(t){return t[0]}function di(t){return t[t.length-1]}function va(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=di(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>G(e)));)n--;if(!s)return{x:0,y:0};const r=z(i.timestamp-s.timestamp);if(r===0)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function pi(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const Mn=pi("dragHorizontal"),Rn=pi("dragVertical");function mi(t){let e=!1;if(t==="y")e=Rn();else if(t==="x")e=Mn();else{const n=Mn(),s=Rn();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function gi(){const t=mi(!0);return t?(t(),!1):!0}function lt(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}const yi=1e-4,xa=1-yi,Pa=1+yi,vi=.01,Ta=0-vi,ba=0+vi;function k(t){return t.max-t.min}function Sa(t,e,n){return Math.abs(t-e)<=n}function En(t,e,n,s=.5){t.origin=s,t.originPoint=V(e.min,e.max,t.origin),t.scale=k(n)/k(e),t.translate=V(n.min,n.max,t.origin)-t.originPoint,(t.scale>=xa&&t.scale<=Pa||isNaN(t.scale))&&(t.scale=1),(t.translate>=Ta&&t.translate<=ba||isNaN(t.translate))&&(t.translate=0)}function Pt(t,e,n,s){En(t.x,e.x,n.x,s?s.originX:void 0),En(t.y,e.y,n.y,s?s.originY:void 0)}function Ln(t,e,n){t.min=n.min+e.min,t.max=t.min+k(e)}function Aa(t,e,n){Ln(t.x,e.x,n.x),Ln(t.y,e.y,n.y)}function Fn(t,e,n){t.min=e.min-n.min,t.max=t.min+k(e)}function Tt(t,e,n){Fn(t.x,e.x,n.x),Fn(t.y,e.y,n.y)}function wa(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?V(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?V(n,t,s.max):Math.min(t,n)),t}function kn(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Va(t,{top:e,left:n,bottom:s,right:i}){return{x:kn(t.x,n,i),y:kn(t.y,e,s)}}function Bn(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Ca(t,e){return{x:Bn(t.x,e.x),y:Bn(t.y,e.y)}}function Da(t,e){let n=.5;const s=k(t),i=k(e);return i>s?n=dt(e.min,e.max-s,t.min):s>i&&(n=dt(t.min,t.max-i,e.min)),Z(0,1,n)}function Ma(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const be=.35;function Ra(t=be){return t===!1?t=0:t===!0&&(t=be),{x:jn(t,"left","right"),y:jn(t,"top","bottom")}}function jn(t,e,n){return{min:On(t,e),max:On(t,n)}}function On(t,e){return typeof t=="number"?t:t[e]||0}const In=()=>({translate:0,scale:1,origin:0,originPoint:0}),ut=()=>({x:In(),y:In()}),Nn=()=>({min:0,max:0}),C=()=>({x:Nn(),y:Nn()});function I(t){return[t("x"),t("y")]}function xi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Ea({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function La(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ie(t){return t===void 0||t===1}function Se({scale:t,scaleX:e,scaleY:n}){return!ie(t)||!ie(e)||!ie(n)}function nt(t){return Se(t)||Pi(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Pi(t){return Un(t.x)||Un(t.y)}function Un(t){return t&&t!=="0%"}function Ut(t,e,n){const s=t-n,i=e*s;return n+i}function _n(t,e,n,s,i){return i!==void 0&&(t=Ut(t,i,s)),Ut(t,n,s)+e}function Ae(t,e=0,n=1,s,i){t.min=_n(t.min,e,n,s,i),t.max=_n(t.max,e,n,s,i)}function Ti(t,{x:e,y:n}){Ae(t.x,e.translate,e.scale,e.originPoint),Ae(t.y,n.translate,n.scale,n.originPoint)}const Kn=.999999999999,Wn=1.0000000000001;function Fa(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let r,o;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:l}=r.options;l&&l.props.style&&l.props.style.display==="contents"||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&ht(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Ti(t,o)),s&&nt(r.latestValues)&&ht(t,r.latestValues))}e.x<Wn&&e.x>Kn&&(e.x=1),e.y<Wn&&e.y>Kn&&(e.y=1)}function ct(t,e){t.min=t.min+e,t.max=t.max+e}function $n(t,e,n,s,i=.5){const r=V(t.min,t.max,i);Ae(t,e,n,r,s)}function ht(t,e){$n(t.x,e.x,e.scaleX,e.scale,e.originX),$n(t.y,e.y,e.scaleY,e.scale,e.originY)}function bi(t,e){return xi(La(t.getBoundingClientRect(),e))}function ka(t,e,n){const s=bi(t,n),{scroll:i}=e;return i&&(ct(s.x,i.offset.x),ct(s.y,i.offset.y)),s}const Si=({current:t})=>t?t.ownerDocument.defaultView:null,Ba=new WeakMap;class ja{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=C(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(zt(c,"page").point)},r=(c,h)=>{const{drag:f,dragPropagation:d,onDragStart:p}=this.getProps();if(f&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=mi(f),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),I(y=>{let g=this.getAxisMotionValue(y).get()||0;if(_.test(g)){const{projection:v}=this.visualElement;if(v&&v.layout){const x=v.layout.layoutBox[y];x&&(g=k(x)*(parseFloat(g)/100))}}this.originPoint[y]=g}),p&&w.postRender(()=>p(c,h)),Pe(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},o=(c,h)=>{const{dragPropagation:f,dragDirectionLock:d,onDirectionLock:p,onDrag:m}=this.getProps();if(!f&&!this.openGlobalLock)return;const{offset:y}=h;if(d&&this.currentDirection===null){this.currentDirection=Oa(y),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,y),this.updateAxis("y",h.point,y),this.visualElement.render(),m&&m(c,h)},a=(c,h)=>this.stop(c,h),l=()=>I(c=>{var h;return this.getAnimationState(c)==="paused"&&((h=this.getAxisMotionValue(c).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new fi(e,{onSessionStart:i,onStart:r,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:Si(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:r}=this.getProps();r&&w.postRender(()=>r(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Lt(e,i,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(o=wa(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var e;const{dragConstraints:n,dragElastic:s}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,r=this.constraints;n&<(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=Va(i.layoutBox,n):this.constraints=!1,this.elastic=Ra(s),r!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&I(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Ma(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!lt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const r=ka(s,i.root,this.visualElement.getTransformPagePoint());let o=Ca(i.layout.layoutBox,r);if(n){const a=n(Ea(o));this.hasMutatedConstraints=!!a,a&&(o=xi(a))}return o}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=I(c=>{if(!Lt(c,n,this.currentDirection))return;let h=l&&l[c]||{};o&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:s?e[c]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...r,...h};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Pe(this.visualElement,e),s.start(We(e,s,0,n,this.visualElement,!1))}stopAnimation(){I(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){I(e=>{var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){I(n=>{const{drag:s}=this.getProps();if(!Lt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,r=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];r.set(e[n]-V(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!lt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};I(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=Da({min:l,max:l},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),I(o=>{if(!Lt(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(V(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;Ba.set(this.visualElement,this);const e=this.visualElement.current,n=X(e,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),s=()=>{const{dragConstraints:l}=this.getProps();lt(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),w.read(s);const o=$(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(I(c=>{const h=this.getAxisMotionValue(c);h&&(this.originPoint[c]+=l[c].translate,h.set(h.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),r(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:r=!1,dragElastic:o=be,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:r,dragElastic:o,dragMomentum:a}}}function Lt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Oa(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Ia extends tt{constructor(e){super(e),this.removeGroupControls=L,this.removeListeners=L,this.controls=new ja(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||L}unmount(){this.removeGroupControls(),this.removeListeners()}}const Gn=t=>(e,n)=>{t&&w.postRender(()=>t(e,n))};class Na extends tt{constructor(){super(...arguments),this.removePointerDownListener=L}onPointerDown(e){this.session=new fi(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Si(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Gn(e),onStart:Gn(n),onMove:s,onEnd:(r,o)=>{delete this.session,i&&w.postRender(()=>i(r,o))}}}mount(){this.removePointerDownListener=X(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const He=T.createContext(null);function Ua(){const t=T.useContext(He);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=T.useId();T.useEffect(()=>s(i),[]);const r=T.useCallback(()=>n&&n(i),[i,n]);return!e&&n?[!1,r]:[!0]}const Ai=T.createContext({}),wi=T.createContext({}),kt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function zn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const gt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(P.test(t))t=parseFloat(t);else return t;const n=zn(t,e.target.x),s=zn(t,e.target.y);return`${n}% ${s}%`}},_a={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=J.parse(t);if(i.length>5)return s;const r=J.createTransformer(t),o=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const u=V(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),r(i)}},_t={};function Ka(t){Object.assign(_t,t)}const{schedule:Xe,cancel:Bu}=Ss(queueMicrotask,!1);class Wa extends T.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:r}=e;Ka($a),r&&(n.group&&n.group.add(r),s&&s.register&&i&&s.register(r),r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,onExitComplete:()=>this.safeToRemove()})),kt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:r}=this.props,o=s.projection;return o&&(o.isPresent=r,i||e.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||w.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Xe.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Vi(t){const[e,n]=Ua(),s=T.useContext(Ai);return U.jsx(Wa,{...t,layoutGroup:s,switchLayoutGroup:T.useContext(wi),isPresent:e,safeToRemove:n})}const $a={borderRadius:{...gt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:gt,borderTopRightRadius:gt,borderBottomLeftRadius:gt,borderBottomRightRadius:gt,boxShadow:_a},Ci=["TopLeft","TopRight","BottomLeft","BottomRight"],Ga=Ci.length,Hn=t=>typeof t=="string"?parseFloat(t):t,Xn=t=>typeof t=="number"||P.test(t);function za(t,e,n,s,i,r){i?(t.opacity=V(0,n.opacity!==void 0?n.opacity:1,Ha(s)),t.opacityExit=V(e.opacity!==void 0?e.opacity:1,0,Xa(s))):r&&(t.opacity=V(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let o=0;o<Ga;o++){const a=`border${Ci[o]}Radius`;let l=Yn(e,a),u=Yn(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Xn(l)===Xn(u)?(t[a]=Math.max(V(Hn(l),Hn(u),s),0),(_.test(u)||_.test(l))&&(t[a]+="%")):t[a]=u}(e.rotate||n.rotate)&&(t.rotate=V(e.rotate||0,n.rotate||0,s))}function Yn(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Ha=Di(0,.5,Rs),Xa=Di(.5,.95,L);function Di(t,e,n){return s=>s<t?0:s>e?1:n(dt(t,e,s))}function qn(t,e){t.min=e.min,t.max=e.max}function O(t,e){qn(t.x,e.x),qn(t.y,e.y)}function Zn(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Jn(t,e,n,s,i){return t-=e,t=Ut(t,1/n,s),i!==void 0&&(t=Ut(t,1/i,s)),t}function Ya(t,e=0,n=1,s=.5,i,r=t,o=t){if(_.test(e)&&(e=parseFloat(e),e=V(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=V(r.min,r.max,s);t===r&&(a-=e),t.min=Jn(t.min,e,n,a,i),t.max=Jn(t.max,e,n,a,i)}function Qn(t,e,[n,s,i],r,o){Ya(t,e[n],e[s],e[i],e.scale,r,o)}const qa=["x","scaleX","originX"],Za=["y","scaleY","originY"];function ts(t,e,n,s){Qn(t.x,e,qa,n?n.x:void 0,s?s.x:void 0),Qn(t.y,e,Za,n?n.y:void 0,s?s.y:void 0)}function es(t){return t.translate===0&&t.scale===1}function Mi(t){return es(t.x)&&es(t.y)}function ns(t,e){return t.min===e.min&&t.max===e.max}function Ja(t,e){return ns(t.x,e.x)&&ns(t.y,e.y)}function ss(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ri(t,e){return ss(t.x,e.x)&&ss(t.y,e.y)}function is(t){return k(t.x)/k(t.y)}function os(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Qa{constructor(){this.members=[]}add(e){$e(this.members,e),e.scheduleRender()}remove(e){if(Ge(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const r=this.members[i];if(r.isPresent!==!1){s=r;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function tl(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:c,rotateX:h,rotateY:f,skewX:d,skewY:p}=n;u&&(s=`perspective(${u}px) ${s}`),c&&(s+=`rotate(${c}deg) `),h&&(s+=`rotateX(${h}deg) `),f&&(s+=`rotateY(${f}deg) `),d&&(s+=`skewX(${d}deg) `),p&&(s+=`skewY(${p}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(s+=`scale(${a}, ${l})`),s||"none"}const el=(t,e)=>t.depth-e.depth;class nl{constructor(){this.children=[],this.isDirty=!1}add(e){$e(this.children,e),this.isDirty=!0}remove(e){Ge(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(el),this.isDirty=!1,this.children.forEach(e)}}function Bt(t){const e=E(t)?t.get():t;return Hr(e)?e.toValue():e}function sl(t,e){const n=K.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(q(s),t(r-e))};return w.read(s,!0),()=>q(s)}function il(t){return t instanceof SVGElement&&t.tagName!=="svg"}function ol(t,e,n){const s=E(t)?t:Vt(t);return s.start(We("",s,e,n)),s.animation}const st={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},vt=typeof window<"u"&&window.MotionDebug!==void 0,oe=["","X","Y","Z"],rl={visibility:"hidden"},rs=1e3;let al=0;function re(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function Ei(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=ai(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",w,!(i||r))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&Ei(s)}function Li({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(o={},a=e==null?void 0:e()){this.id=al++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,vt&&(st.totalNodes=st.resolvedTargetDeltas=st.recalculatedProjection=0),this.nodes.forEach(cl),this.nodes.forEach(ml),this.nodes.forEach(gl),this.nodes.forEach(hl),vt&&window.MotionDebug.record(st)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new nl)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ze),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=il(o),this.instance=o;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),t){let h;const f=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=sl(f,250),kt.hasAnimatedSinceResize&&(kt.hasAnimatedSinceResize=!1,this.nodes.forEach(ls))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeTargetChanged:d,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Tl,{onLayoutAnimationStart:y,onLayoutAnimationComplete:g}=c.getProps(),v=!this.targetLayout||!Ri(this.targetLayout,p)||d,x=!f&&d;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||x||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,x);const b={...Re(m,"layout"),onPlay:y,onComplete:g};(c.shouldReduceMotion||this.options.layoutRoot)&&(b.delay=0,b.type=!1),this.startAnimation(b)}else f||ls(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,q(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(yl),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ei(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const h=this.path[c];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(as);return}this.isUpdating||this.nodes.forEach(dl),this.isUpdating=!1,this.nodes.forEach(pl),this.nodes.forEach(ll),this.nodes.forEach(ul),this.clearAllSnapshots();const a=K.now();M.delta=Z(0,1e3/60,a-M.timestamp),M.timestamp=a,M.isProcessing=!0,Zt.update.process(M),Zt.preRender.process(M),Zt.render.process(M),M.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Xe.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(fl),this.sharedNodes.forEach(vl)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,w.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){w.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=C(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=s(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Mi(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;o&&(a||nt(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),bl(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return C();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Sl))){const{scroll:c}=this.root;c&&(ct(l.x,c.offset.x),ct(l.y,c.offset.y))}return l}removeElementScroll(o){var a;const l=C();if(O(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const c=this.path[u],{scroll:h,options:f}=c;c!==this.root&&h&&f.layoutScroll&&(h.wasRoot&&O(l,o),ct(l.x,h.offset.x),ct(l.y,h.offset.y))}return l}applyTransform(o,a=!1){const l=C();O(l,o);for(let u=0;u<this.path.length;u++){const c=this.path[u];!a&&c.options.layoutScroll&&c.scroll&&c!==c.root&&ht(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),nt(c.latestValues)&&ht(l,c.latestValues)}return nt(this.latestValues)&&ht(l,this.latestValues),l}removeTransform(o){const a=C();O(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!nt(u.latestValues))continue;Se(u.latestValues)&&u.updateSnapshot();const c=C(),h=u.measurePageBox();O(c,h),ts(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return nt(this.latestValues)&&ts(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==M.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:f}=this.options;if(!(!this.layout||!(h||f))){if(this.resolvedRelativeTargetAt=M.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=C(),this.relativeTargetOrigin=C(),Tt(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),O(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=C(),this.targetWithTransforms=C()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Aa(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):O(this.target,this.layout.layoutBox),Ti(this.target,this.targetDelta)):O(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=C(),this.relativeTargetOrigin=C(),Tt(this.relativeTargetOrigin,this.target,d.target),O(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}vt&&st.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Se(this.parent.latestValues)||Pi(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===M.timestamp&&(u=!1),u)return;const{layout:c,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||h))return;O(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;Fa(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=C());const{target:p}=a;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Zn(this.prevProjectionDelta.x,this.projectionDelta.x),Zn(this.prevProjectionDelta.y,this.projectionDelta.y)),Pt(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==d||!os(this.projectionDelta.x,this.prevProjectionDelta.x)||!os(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),vt&&st.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ut(),this.projectionDelta=ut(),this.projectionDeltaWithTransform=ut()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},h=ut();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=C(),d=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=d!==p,y=this.getStack(),g=!y||y.members.length<=1,v=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(Pl));this.animationProgress=0;let x;this.mixTargetDelta=b=>{const S=b/1e3;us(h.x,o.x,S),us(h.y,o.y,S),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),xl(this.relativeTarget,this.relativeTargetOrigin,f,S),x&&Ja(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=C()),O(x,this.relativeTarget)),m&&(this.animationValues=c,za(c,u,this.latestValues,S,v,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(q(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=w.update(()=>{kt.hasAnimatedSinceResize=!0,this.currentAnimation=ol(0,rs,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(rs),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&Fi(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||C();const h=k(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=k(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}O(a,l),ht(a,c),Pt(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Qa),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&re("z",o,u,this.animationValues);for(let c=0;c<oe.length;c++)re(`rotate${oe[c]}`,o,u,this.animationValues),re(`skew${oe[c]}`,o,u,this.animationValues);o.render();for(const c in u)o.setStaticValue(c,u[c]),this.animationValues&&(this.animationValues[c]=u[c]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return rl;const u={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=Bt(o==null?void 0:o.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=Bt(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!nt(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const f=h.animationValues||h.latestValues;this.applyTransformsToTarget(),u.transform=tl(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:d,y:p}=this.projectionDelta;u.transformOrigin=`${d.origin*100}% ${p.origin*100}% 0`,h.animationValues?u.opacity=h===this?(l=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=h===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const m in _t){if(f[m]===void 0)continue;const{correct:y,applyTo:g}=_t[m],v=u.transform==="none"?f[m]:y(f[m],h);if(g){const x=g.length;for(let b=0;b<x;b++)u[g[b]]=v}else u[m]=v}return this.options.layoutId&&(u.pointerEvents=h===this?Bt(o==null?void 0:o.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(as),this.root.sharedNodes.clear()}}}function ll(t){t.updateLayout()}function ul(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:r}=t.options,o=n.source!==t.layout.source;r==="size"?I(h=>{const f=o?n.measuredBox[h]:n.layoutBox[h],d=k(f);f.min=s[h].min,f.max=f.min+d}):Fi(r,n.layoutBox,s)&&I(h=>{const f=o?n.measuredBox[h]:n.layoutBox[h],d=k(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=ut();Pt(a,s,n.layoutBox);const l=ut();o?Pt(l,t.applyTransform(i,!0),n.measuredBox):Pt(l,s,n.layoutBox);const u=!Mi(a);let c=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const p=C();Tt(p,n.layoutBox,f.layoutBox);const m=C();Tt(m,s,d.layoutBox),Ri(p,m)||(c=!0),h.options.layoutRoot&&(t.relativeTarget=m,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function cl(t){vt&&st.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function hl(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function fl(t){t.clearSnapshot()}function as(t){t.clearMeasurements()}function dl(t){t.isLayoutDirty=!1}function pl(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ls(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ml(t){t.resolveTargetDelta()}function gl(t){t.calcProjection()}function yl(t){t.resetSkewAndRotation()}function vl(t){t.removeLeadSnapshot()}function us(t,e,n){t.translate=V(e.translate,0,n),t.scale=V(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function cs(t,e,n,s){t.min=V(e.min,n.min,s),t.max=V(e.max,n.max,s)}function xl(t,e,n,s){cs(t.x,e.x,n.x,s),cs(t.y,e.y,n.y,s)}function Pl(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Tl={duration:.45,ease:[.4,0,.1,1]},hs=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),fs=hs("applewebkit/")&&!hs("chrome/")?Math.round:L;function ds(t){t.min=fs(t.min),t.max=fs(t.max)}function bl(t){ds(t.x),ds(t.y)}function Fi(t,e,n){return t==="position"||t==="preserve-aspect"&&!Sa(is(e),is(n),.2)}function Sl(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const Al=Li({attachResizeListener:(t,e)=>$(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ae={current:void 0},ki=Li({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ae.current){const t=new Al({});t.mount(window),t.setOptions({layoutScroll:!0}),ae.current=t}return ae.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),wl={pan:{Feature:Na},drag:{Feature:Ia,ProjectionNode:ki,MeasureLayout:Vi}};function ps(t,e){const n=e?"pointerenter":"pointerleave",s=e?"onHoverStart":"onHoverEnd",i=(r,o)=>{if(r.pointerType==="touch"||gi())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e);const l=a[s];l&&w.postRender(()=>l(r,o))};return X(t.current,n,i,{passive:!t.getProps()[s]})}class Vl extends tt{mount(){this.unmount=H(ps(this.node,!0),ps(this.node,!1))}unmount(){}}class Cl extends tt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=H($(this.node.current,"focus",()=>this.onFocus()),$(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Bi=(t,e)=>e?t===e?!0:Bi(t,e.parentElement):!1;function le(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,zt(n))}class Dl extends tt{constructor(){super(...arguments),this.removeStartListeners=L,this.removeEndListeners=L,this.removeAccessibleListeners=L,this.startPointerPress=(e,n)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),r=X(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:h}=this.node.getProps(),f=!h&&!Bi(this.node.current,a.target)?c:u;f&&w.update(()=>f(a,l))},{passive:!(s.onTap||s.onPointerUp)}),o=X(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=H(r,o),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=r=>{if(r.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||le("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&w.postRender(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=$(this.node.current,"keyup",o),le("down",(a,l)=>{this.startPress(a,l)})},n=$(this.node.current,"keydown",e),s=()=>{this.isPressing&&le("cancel",(r,o)=>this.cancelPress(r,o))},i=$(this.node.current,"blur",s);this.removeAccessibleListeners=H(n,i)}}startPress(e,n){this.isPressing=!0;const{onTapStart:s,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&w.postRender(()=>s(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!gi()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&w.postRender(()=>s(e,n))}mount(){const e=this.node.getProps(),n=X(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),s=$(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=H(n,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const we=new WeakMap,ue=new WeakMap,Ml=t=>{const e=we.get(t.target);e&&e(t)},Rl=t=>{t.forEach(Ml)};function El({root:t,...e}){const n=t||document;ue.has(n)||ue.set(n,{});const s=ue.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Rl,{root:t,...e})),s[i]}function Ll(t,e,n){const s=El(e);return we.set(t,n),s.observe(t),()=>{we.delete(t),s.unobserve(t)}}const Fl={some:0,all:1};class kl extends tt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:r}=e,o={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Fl[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:h}=this.node.getProps(),f=u?c:h;f&&f(l)};return Ll(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(Bl(e,n))&&this.startObserver()}unmount(){}}function Bl({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const jl={inView:{Feature:kl},tap:{Feature:Dl},focus:{Feature:Cl},hover:{Feature:Vl}},Ol={layout:{ProjectionNode:ki,MeasureLayout:Vi}},ji=T.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),Ht=T.createContext({}),Ye=typeof window<"u",Il=Ye?T.useLayoutEffect:T.useEffect,Oi=T.createContext({strict:!1});function Nl(t,e,n,s,i){var r,o;const{visualElement:a}=T.useContext(Ht),l=T.useContext(Oi),u=T.useContext(He),c=T.useContext(ji).reducedMotion,h=T.useRef();s=s||l.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:c}));const f=h.current,d=T.useContext(wi);f&&!f.projection&&i&&(f.type==="html"||f.type==="svg")&&Ul(h.current,n,i,d),T.useInsertionEffect(()=>{f&&f.update(n,u)});const p=n[ri],m=T.useRef(!!p&&!(!((r=window.MotionHandoffIsComplete)===null||r===void 0)&&r.call(window,p))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,p)));return Il(()=>{f&&(window.MotionIsMounted=!0,f.updateFeatures(),Xe.render(f.render),m.current&&f.animationState&&f.animationState.animateChanges())}),T.useEffect(()=>{f&&(!m.current&&f.animationState&&f.animationState.animateChanges(),m.current&&(queueMicrotask(()=>{var y;(y=window.MotionHandoffMarkAsComplete)===null||y===void 0||y.call(window,p)}),m.current=!1))}),f}function Ul(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ii(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:!!o||a&<(a),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:u})}function Ii(t){if(t)return t.options.allowProjection!==!1?t.projection:Ii(t.parent)}function _l(t,e,n){return T.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):lt(n)&&(n.current=s))},[e])}function Xt(t){return bt(t.animate)||Me.some(e=>St(t[e]))}function Ni(t){return!!(Xt(t)||t.variants)}function Kl(t,e){if(Xt(t)){const{initial:n,animate:s}=t;return{initial:n===!1||St(n)?n:void 0,animate:St(s)?s:void 0}}return t.inherit!==!1?e:{}}function Wl(t){const{initial:e,animate:n}=Kl(t,T.useContext(Ht));return T.useMemo(()=>({initial:e,animate:n}),[ms(e),ms(n)])}function ms(t){return Array.isArray(t)?t.join(" "):t}const gs={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},pt={};for(const t in gs)pt[t]={isEnabled:e=>gs[t].some(n=>!!e[n])};function $l(t){for(const e in t)pt[e]={...pt[e],...t[e]}}const Gl=Symbol.for("motionComponentSymbol");function zl({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&$l(t);function r(a,l){let u;const c={...T.useContext(ji),...a,layoutId:Hl(a)},{isStatic:h}=c,f=Wl(a),d=s(a,h);if(!h&&Ye){Xl();const p=Yl(c);u=p.MeasureLayout,f.visualElement=Nl(i,d,c,e,p.ProjectionNode)}return U.jsxs(Ht.Provider,{value:f,children:[u&&f.visualElement?U.jsx(u,{visualElement:f.visualElement,...c}):null,n(i,a,_l(d,f.visualElement,l),d,h,f.visualElement)]})}const o=T.forwardRef(r);return o[Gl]=i,o}function Hl({layoutId:t}){const e=T.useContext(Ai).id;return e&&t!==void 0?e+"-"+t:t}function Xl(t,e){T.useContext(Oi).strict}function Yl(t){const{drag:e,layout:n}=pt;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const ql=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function qe(t){return typeof t!="string"||t.includes("-")?!1:!!(ql.indexOf(t)>-1||/[A-Z]/u.test(t))}function Ui(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const r in n)t.style.setProperty(r,n[r])}const _i=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ki(t,e,n,s){Ui(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(_i.has(i)?i:Gt(i),e.attrs[i])}function Wi(t,{layout:e,layoutId:n}){return Q.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!_t[t]||t==="opacity")}function Ze(t,e,n){var s;const{style:i}=t,r={};for(const o in i)(E(i[o])||e.style&&E(e.style[o])||Wi(o,t)||((s=n==null?void 0:n.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return n&&i&&typeof i.willChange=="string"&&(n.applyWillChange=!1),r}function $i(t,e,n){const s=Ze(t,e,n);for(const i in t)if(E(t[i])||E(e[i])){const r=Ct.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=t[i]}return s}function Zl(t){const e=T.useRef(null);return e.current===null&&(e.current=t()),e.current}function Jl({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:n,onMount:s},i,r,o,a){const l={latestValues:Ql(i,r,o,a?!1:t,e),renderState:n()};return s&&(l.mount=u=>s(i,u,l)),l}const Gi=t=>(e,n)=>{const s=T.useContext(Ht),i=T.useContext(He),r=()=>Jl(t,e,s,i,n);return n?r():Zl(r)};function ys(t,e,n){const s=Array.isArray(e)?e:[e];for(let i=0;i<s.length;i++){const r=Ce(t,s[i]);if(r){const{transitionEnd:o,transition:a,...l}=r;n(l,o)}}}function Ql(t,e,n,s,i){var r;const o={};let a=s&&((r=t.style)===null||r===void 0?void 0:r.willChange)===void 0;const l=i(t,{});for(const m in l)o[m]=Bt(l[m]);let{initial:u,animate:c}=t;const h=Xt(t),f=Ni(t);e&&f&&!h&&t.inherit!==!1&&(u===void 0&&(u=e.initial),c===void 0&&(c=e.animate));let d=n?n.initial===!1:!1;d=d||u===!1;const p=d?c:u;return p&&typeof p!="boolean"&&!bt(p)&&ys(t,p,(m,y)=>{for(const g in m){let v=m[g];if(Array.isArray(v)){const x=d?v.length-1:0;v=v[x]}v!==null&&(o[g]=v)}for(const g in y)o[g]=y[g]}),a&&c&&u!==!1&&!bt(c)&&ys(t,c,m=>{for(const y in m)if(li(y)){o.willChange="transform";return}}),o}const Je=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),zi=()=>({...Je(),attrs:{}}),Hi=(t,e)=>e&&typeof t=="number"?e.transform(t):t,tu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eu=Ct.length;function nu(t,e,n){let s="",i=!0;for(let r=0;r<eu;r++){const o=Ct[r],a=t[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=Hi(a,Oe[o]);if(!l){i=!1;const c=tu[o]||o;s+=`${c}(${u}) `}n&&(e[o]=u)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}function Qe(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const l in e){const u=e[l];if(Q.has(l)){o=!0;continue}else if(Bs(l)){i[l]=u;continue}else{const c=Hi(u,Oe[l]);l.startsWith("origin")?(a=!0,r[l]=c):s[l]=c}}if(e.transform||(o||n?s.transform=nu(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:c=0}=r;s.transformOrigin=`${l} ${u} ${c}`}}function vs(t,e,n){return typeof t=="string"?t:P.transform(e+n*t)}function su(t,e,n){const s=vs(e,t.x,t.width),i=vs(n,t.y,t.height);return`${s} ${i}`}const iu={offset:"stroke-dashoffset",array:"stroke-dasharray"},ou={offset:"strokeDashoffset",array:"strokeDasharray"};function ru(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?iu:ou;t[r.offset]=P.transform(-s);const o=P.transform(e),a=P.transform(n);t[r.array]=`${o} ${a}`}function tn(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,h){if(Qe(t,u,h),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:p}=t;f.transform&&(p&&(d.transform=f.transform),delete f.transform),p&&(i!==void 0||r!==void 0||d.transform)&&(d.transformOrigin=su(p,i!==void 0?i:.5,r!==void 0?r:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),s!==void 0&&(f.scale=s),o!==void 0&&ru(f,o,a,l,!1)}const en=t=>typeof t=="string"&&t.toLowerCase()==="svg",au={useVisualState:Gi({scrapeMotionValuesFromProps:$i,createRenderState:zi,onMount:(t,e,{renderState:n,latestValues:s})=>{w.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),w.render(()=>{tn(n,s,en(e.tagName),t.transformTemplate),Ki(e,n)})}})},lu={useVisualState:Gi({applyWillChange:!0,scrapeMotionValuesFromProps:Ze,createRenderState:Je})};function Xi(t,e,n){for(const s in e)!E(e[s])&&!Wi(s,n)&&(t[s]=e[s])}function uu({transformTemplate:t},e){return T.useMemo(()=>{const n=Je();return Qe(n,e,t),Object.assign({},n.vars,n.style)},[e])}function cu(t,e){const n=t.style||{},s={};return Xi(s,n,t),Object.assign(s,uu(t,e)),s}function hu(t,e){const n={},s=cu(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const fu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Kt(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||fu.has(t)}let Yi=t=>!Kt(t);function du(t){t&&(Yi=e=>e.startsWith("on")?!Kt(e):t(e))}try{du(require("@emotion/is-prop-valid").default)}catch{}function pu(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(Yi(i)||n===!0&&Kt(i)||!e&&!Kt(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function mu(t,e,n,s){const i=T.useMemo(()=>{const r=zi();return tn(r,e,en(s),t.transformTemplate),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};Xi(r,t.style,t),i.style={...r,...i.style}}return i}function gu(t=!1){return(n,s,i,{latestValues:r},o)=>{const l=(qe(n)?mu:hu)(s,r,o,n),u=pu(s,typeof n=="string",t),c=n!==T.Fragment?{...u,...l,ref:i}:{},{children:h}=s,f=T.useMemo(()=>E(h)?h.get():h,[h]);return T.createElement(n,{...c,children:f})}}function yu(t,e){return function(s,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...qe(s)?au:lu,preloadedFeatures:t,useRender:gu(i),createVisualElement:e,Component:s};return zl(o)}}const Ve={current:null},qi={current:!1};function vu(){if(qi.current=!0,!!Ye)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ve.current=t.matches;t.addListener(e),e()}else Ve.current=!1}function xu(t,e,n){for(const s in e){const i=e[s],r=n[s];if(E(i))t.addValue(s,i);else if(E(r))t.addValue(s,Vt(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const o=t.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=t.getStaticValue(s);t.addValue(s,Vt(o!==void 0?o:i,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const xs=new WeakMap,Pu=[...Is,R,J],Tu=t=>Pu.find(Os(t)),Ps=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class bu{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ke,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=K.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,w.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=o;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=Xt(n),this.isVariantNode=Ni(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:c,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in h){const d=h[f];l[f]!==void 0&&E(d)&&d.set(l[f],!1)}}mount(e){this.current=e,xs.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),qi.current||vu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Ve.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){xs.delete(this.current),this.projection&&this.projection.unmount(),q(this.notifyUpdate),q(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=Q.has(e),i=n.on("change",a=>{this.latestValues[e]=a,this.props.onUpdate&&w.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{i(),r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in pt){const n=pt[e];if(!n)continue;const{isEnabled:s,Feature:i}=n;if(!this.features[e]&&i&&s(this.props)&&(this.features[e]=new i(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):C()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Ps.length;s++){const i=Ps[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=e[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=xu(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=Vt(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){var s;let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(s=this.getBaseTargetFromProps(this.props,e))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(Fs(i)||Ls(i))?i=parseFloat(i):!Tu(i)&&J.test(n)&&(i=zs(e,n)),this.setBaseTarget(e,E(i)?i.get():i)),E(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Ce(this.props,s,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[e])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!E(r)?r:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new ze),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Zi extends bu{constructor(){super(...arguments),this.KeyframeResolver=Hs}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}}function Su(t){return window.getComputedStyle(t)}class Au extends Zi{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Ui}readValueFromInstance(e,n){if(Q.has(n)){const s=Ie(n);return s&&s.default||0}else{const s=Su(e),i=(Bs(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return bi(e,n)}build(e,n,s){Qe(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return Ze(e,n,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;E(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class wu extends Zi{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=C}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Q.has(n)){const s=Ie(n);return s&&s.default||0}return n=_i.has(n)?n:Gt(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return $i(e,n,s)}build(e,n,s){tn(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,i){Ki(e,n,s,i)}mount(e){this.isSVGTag=en(e.tagName),super.mount(e)}}const Vu=(t,e)=>qe(t)?new wu(e):new Au(e,{allowProjection:t!==T.Fragment}),Cu=yu({...pa,...jl,...wl,...Ol},Vu),ce=oo(Cu);function nn(){const t=no("root"),e=so().find(n=>{var s;return n.formAction==="/progress"&&((s=n.formData)==null?void 0:s.has("complete"))});return!e||!(t!=null&&t.progress)?(t==null?void 0:t.progress)??null:t.progress.map(n=>{var r,o;const s=((r=e.formData)==null?void 0:r.get("complete"))==="true";return((o=e.formData)==null?void 0:o.get("lessonSlug"))===n.epicLessonSlug?{...n,epicCompletedAt:s?Date.now():null}:n})}function Ou(){const t=Ts().pathname,e=nn();if(!e)return null;const n=a=>a.type==="workshop-instructions"?0:a.type==="workshop-finished"?1e4:a.type==="instructions"?a.exerciseNumber*100:a.type==="step"?a.exerciseNumber*100+a.stepNumber:a.type==="finished"?a.exerciseNumber*100+100:a.type==="unknown"?1e5:-1,i=e.sort((a,l)=>n(a)-n(l)).find(a=>!a.epicCompletedAt);if(!i||i.type==="unknown")return null;if(i.type==="workshop-instructions")return"/";if(i.type==="workshop-finished")return"/finished";const r=i.exerciseNumber.toString().padStart(2,"0");if(i.type==="instructions")return`/exercise/${r}`;if(i.type==="finished")return`/exercise/${r}/finished`;const o=i.stepNumber.toString().padStart(2,"0");if(i.type==="step"){const a=`/exercise/${r}/${o}/problem`,l=`/exercise/${r}/${o}/solution`;return t===a||t===l?l:a}return null}const Du={0:"",1:"before:h-[10%]",2:"before:h-[20%]",3:"before:h-[30%]",4:"before:h-[40%]",5:"before:h-[50%]",6:"before:h-[60%]",7:"before:h-[70%]",8:"before:h-[80%]",9:"before:h-[90%]",10:"before:h-[100%]"};function Iu(t){const e=nn();if(!(e!=null&&e.length))return null;const n=e.filter(r=>(r.type==="instructions"||r.type==="step"||r.type==="finished")&&r.exerciseNumber===t);if(!n.length)return null;const s=n.reduce((r,o)=>o.epicCompletedAt?r+1:r,0)/n.length,i=Math[s>.1?"floor":"ceil"](s*10);return`relative ${Du[i]} before:bg-highlight before:absolute before:left-0 before:top-0 before:w-[4px]`}function Nu(t){const e=Ji(t);return e!=null&&e.epicCompletedAt?"relative before:h-[100%] before:bg-highlight before:absolute before:left-0 before:top-0 before:w-[4px]":null}function Ji({exerciseNumber:t,stepNumber:e,type:n}){const s=nn();return s!=null&&s.length?n==="workshop-finished"||n==="workshop-instructions"?s.find(i=>i.type===n)??null:n==="instructions"||n==="finished"?s.find(i=>i.type===n&&i.exerciseNumber===t)??null:n==="step"?s.find(i=>i.type===n&&i.exerciseNumber===t&&i.stepNumber===e)??null:null:null}function Uu({className:t,...e}){var m,y,g,v;const n=io(),s=eo(),i=Ji(e),r=T.useRef(null),o=T.useRef(null),a=(m=n.formData)!=null&&m.has("complete")?n.formData.get("complete")==="true":!!(i!=null&&i.epicCompletedAt),[l,u]=T.useState(!1),c=Ts(),h=to(),f=(g=(y=h.location)==null?void 0:y.state)==null?void 0:g.from,d=(v=h.location)==null?void 0:v.pathname,p=c.pathname;return T.useEffect(()=>{var x;f==="continue next lesson button"&&p===d&&(u(!0),(x=o.current)==null||x.focus())},[c.key,p,d,f]),T.useEffect(()=>{let x=!0;if(l)return new Promise(b=>setTimeout(b,200)).then(async()=>{if(!x||!r.current)return;const b=r.current.getAnimations().map(({finished:S})=>S);return Promise.allSettled(b).then(()=>{x&&u(!1)})}),()=>{x=!1}},[l]),ENV.EPICSHOP_DEPLOYED||!i?null:U.jsxs(n.Form,{method:"POST",action:"/progress",children:[s,U.jsx("input",{type:"hidden",name:"lessonSlug",value:i.epicLessonSlug}),U.jsx("input",{type:"hidden",name:"complete",value:(!a).toString()}),U.jsxs(ce.button,{ref:o,onClick:()=>{u(!a)},type:"submit",className:rn("group relative flex w-full items-center justify-between overflow-hidden transition hover:bg-[hsl(var(--foreground)/0.02)] focus:bg-[hsl(var(--foreground)/0.02)]",t),children:[a?"Mark as incomplete":"Mark as complete",l?U.jsx(ce.div,{ref:r,className:"absolute right-0 h-20 w-20 rounded-full bg-foreground/20",initial:{scale:.5,opacity:0},animate:{scale:[.5,2],opacity:[0,1,0]},transition:{duration:1,ease:"easeInOut"}}):null,U.jsx(ce.div,{"aria-hidden":!0,className:rn("relative flex h-8 w-8 items-center justify-center overflow-hidden rounded-full border transition",{"bg-foreground text-background duration-1000":a,"duration-100 group-hover:bg-background":!a}),children:a?"✓":U.jsx("div",{className:"absolute -translate-y-10 opacity-25 transition group-hover:translate-y-0",children:"✓"})})]})]})}export{Uu as P,nn as a,ia as b,Zl as c,Il as d,Ou as e,Nu as f,ce as m,Jr as s,Iu as u};
|
|
2
|
-
//# sourceMappingURL=progress-DwE8EkAa.js.map
|