@nanoforge-dev/editor 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/client/_app/immutable/assets/0.562EP7L3.css +1 -0
- package/dist/client/_app/immutable/assets/0.562EP7L3.css.br +0 -0
- package/dist/client/_app/immutable/assets/0.562EP7L3.css.gz +0 -0
- package/dist/client/_app/immutable/assets/2.Dl9w-_FK.css +1 -0
- package/dist/client/_app/immutable/assets/2.Dl9w-_FK.css.br +0 -0
- package/dist/client/_app/immutable/assets/2.Dl9w-_FK.css.gz +0 -0
- package/dist/client/_app/immutable/assets/api.CD54FDqW.css +1 -0
- package/dist/client/_app/immutable/assets/api.CD54FDqW.css.br +0 -0
- package/dist/client/_app/immutable/assets/api.CD54FDqW.css.gz +0 -0
- package/dist/client/_app/immutable/assets/codicon.ngg6Pgfi.ttf +0 -0
- package/dist/client/_app/immutable/assets/defaultProjectCover.BHxYINJa.png +0 -0
- package/dist/client/_app/immutable/assets/editor.BuC0XPbM.css +1 -0
- package/dist/client/_app/immutable/assets/editor.BuC0XPbM.css.br +0 -0
- package/dist/client/_app/immutable/assets/editor.BuC0XPbM.css.gz +0 -0
- package/dist/client/_app/immutable/assets/logo.DMAgjcse.png +0 -0
- package/dist/client/_app/immutable/chunks/0wEXW2Hc2.js +1 -0
- package/dist/client/_app/immutable/chunks/0wEXW2Hc2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/0wEXW2Hc2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/1rG2eYdz2.js +1 -0
- package/dist/client/_app/immutable/chunks/1rG2eYdz2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/1rG2eYdz2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/5CAt0tAC.js +1 -0
- package/dist/client/_app/immutable/chunks/5CAt0tAC.js.br +0 -0
- package/dist/client/_app/immutable/chunks/5CAt0tAC.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/5TEFcS4X2.js +1 -0
- package/dist/client/_app/immutable/chunks/5TEFcS4X2.js.br +3 -0
- package/dist/client/_app/immutable/chunks/5TEFcS4X2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/5k3Q8YWH.js +1 -0
- package/dist/client/_app/immutable/chunks/5k3Q8YWH.js.br +0 -0
- package/dist/client/_app/immutable/chunks/5k3Q8YWH.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B0Q9zT_Q.js +1 -0
- package/dist/client/_app/immutable/chunks/B0Q9zT_Q.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B0Q9zT_Q.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B1GYE4NT.js +1 -0
- package/dist/client/_app/immutable/chunks/B1GYE4NT.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B1GYE4NT.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B1bBmRUz2.js +1 -0
- package/dist/client/_app/immutable/chunks/B1bBmRUz2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B1bBmRUz2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B3IjbASq.js +1 -0
- package/dist/client/_app/immutable/chunks/B3IjbASq.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B3IjbASq.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B3VOL0kZ.js +1 -0
- package/dist/client/_app/immutable/chunks/B3VOL0kZ.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B3VOL0kZ.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B5crfj0i.js +1 -0
- package/dist/client/_app/immutable/chunks/B5crfj0i.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B5crfj0i.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BAtlESPp.js +1 -0
- package/dist/client/_app/immutable/chunks/BAtlESPp.js.br +3 -0
- package/dist/client/_app/immutable/chunks/BAtlESPp.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BCAAnHTF2.js +1 -0
- package/dist/client/_app/immutable/chunks/BCAAnHTF2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BCAAnHTF2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BEN0jOJp.js +1 -0
- package/dist/client/_app/immutable/chunks/BEN0jOJp.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BEN0jOJp.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BHHccBgG2.js +1 -0
- package/dist/client/_app/immutable/chunks/BHHccBgG2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BHHccBgG2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BHxBHC3k.js +1 -0
- package/dist/client/_app/immutable/chunks/BHxBHC3k.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BHxBHC3k.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BK6ghPUh.js +1 -0
- package/dist/client/_app/immutable/chunks/BK6ghPUh.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BK6ghPUh.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BL9YzxJT.js +1 -0
- package/dist/client/_app/immutable/chunks/BL9YzxJT.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BL9YzxJT.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BNqbTcCU.js +1 -0
- package/dist/client/_app/immutable/chunks/BNqbTcCU.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BNqbTcCU.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BSRtLNCV.js +3 -0
- package/dist/client/_app/immutable/chunks/BSRtLNCV.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BSRtLNCV.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BSa9oWuP.js +1 -0
- package/dist/client/_app/immutable/chunks/BSa9oWuP.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BSa9oWuP.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BTEHXt4u.js +1 -0
- package/dist/client/_app/immutable/chunks/BTEHXt4u.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BTEHXt4u.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BUMhJFWc.js +2 -0
- package/dist/client/_app/immutable/chunks/BUMhJFWc.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BUMhJFWc.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BXNW00E2.js +1 -0
- package/dist/client/_app/immutable/chunks/BXNW00E2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BXNW00E2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B__0yjCH2.js +1 -0
- package/dist/client/_app/immutable/chunks/B__0yjCH2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B__0yjCH2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/B_rYXvqX.js +1 -0
- package/dist/client/_app/immutable/chunks/B_rYXvqX.js.br +0 -0
- package/dist/client/_app/immutable/chunks/B_rYXvqX.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BaORWDBQ.js +1 -0
- package/dist/client/_app/immutable/chunks/BaORWDBQ.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BaORWDBQ.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BeRB61Rp.js +1 -0
- package/dist/client/_app/immutable/chunks/BeRB61Rp.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BeRB61Rp.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Berct1R62.js +1 -0
- package/dist/client/_app/immutable/chunks/Berct1R62.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Berct1R62.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Bi01QGTh2.js +7 -0
- package/dist/client/_app/immutable/chunks/Bi01QGTh2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Bi01QGTh2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BnEty9Zf.js +3 -0
- package/dist/client/_app/immutable/chunks/BnEty9Zf.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BnEty9Zf.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Bp42GhE_.js +1 -0
- package/dist/client/_app/immutable/chunks/Bp42GhE_.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Bp42GhE_.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BqR20QL0.js +1 -0
- package/dist/client/_app/immutable/chunks/BqR20QL0.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BqR20QL0.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BuvsQ_0P.js +1 -0
- package/dist/client/_app/immutable/chunks/BuvsQ_0P.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BuvsQ_0P.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BwWFGvpp2.js +6 -0
- package/dist/client/_app/immutable/chunks/BwWFGvpp2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BwWFGvpp2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/BxyUv_372.js +1 -0
- package/dist/client/_app/immutable/chunks/BxyUv_372.js.br +0 -0
- package/dist/client/_app/immutable/chunks/BxyUv_372.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C459oz3p.js +1 -0
- package/dist/client/_app/immutable/chunks/C459oz3p.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C459oz3p.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C4oBl-ul.js +1 -0
- package/dist/client/_app/immutable/chunks/C4oBl-ul.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C4oBl-ul.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C5dBxjD0.js +1 -0
- package/dist/client/_app/immutable/chunks/C5dBxjD0.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C5dBxjD0.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C7TuqZTk.js +1 -0
- package/dist/client/_app/immutable/chunks/C7TuqZTk.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C7TuqZTk.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C84aX3eL2.js +2 -0
- package/dist/client/_app/immutable/chunks/C84aX3eL2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C84aX3eL2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CGFoxiJT2.js +1 -0
- package/dist/client/_app/immutable/chunks/CGFoxiJT2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CGFoxiJT2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CGdCAl_w2.js +1 -0
- package/dist/client/_app/immutable/chunks/CGdCAl_w2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CGdCAl_w2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CJL4GRLV2.js +1 -0
- package/dist/client/_app/immutable/chunks/CJL4GRLV2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CJL4GRLV2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CKihvhpr.js +1 -0
- package/dist/client/_app/immutable/chunks/CKihvhpr.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CKihvhpr.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CKybJfA6.js +1 -0
- package/dist/client/_app/immutable/chunks/CKybJfA6.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CKybJfA6.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CQai7aNJ.js +1 -0
- package/dist/client/_app/immutable/chunks/CQai7aNJ.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CQai7aNJ.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CQghOihB.js +1 -0
- package/dist/client/_app/immutable/chunks/CQghOihB.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CQghOihB.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CTK4WrGL2.js +1 -0
- package/dist/client/_app/immutable/chunks/CTK4WrGL2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CTK4WrGL2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CUVqITEW2.js +1 -0
- package/dist/client/_app/immutable/chunks/CUVqITEW2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CUVqITEW2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CVmNMiIj.js +1 -0
- package/dist/client/_app/immutable/chunks/CVmNMiIj.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CVmNMiIj.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CW_66Q8N.js +872 -0
- package/dist/client/_app/immutable/chunks/CW_66Q8N.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CW_66Q8N.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CXBbh9s-.js +1 -0
- package/dist/client/_app/immutable/chunks/CXBbh9s-.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CXBbh9s-.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CXlfFz7D2.js +1 -0
- package/dist/client/_app/immutable/chunks/CXlfFz7D2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CXlfFz7D2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/C_QqwttH.js +1 -0
- package/dist/client/_app/immutable/chunks/C_QqwttH.js.br +0 -0
- package/dist/client/_app/immutable/chunks/C_QqwttH.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CbFxQFBh.js +1 -0
- package/dist/client/_app/immutable/chunks/CbFxQFBh.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CbFxQFBh.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CmjNmBcK.js +1 -0
- package/dist/client/_app/immutable/chunks/CmjNmBcK.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CmjNmBcK.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CntDmp6G.js +1 -0
- package/dist/client/_app/immutable/chunks/CntDmp6G.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CntDmp6G.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CqqoQT4S.js +2 -0
- package/dist/client/_app/immutable/chunks/CqqoQT4S.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CqqoQT4S.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CtzzCjLE2.js +1 -0
- package/dist/client/_app/immutable/chunks/CtzzCjLE2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CtzzCjLE2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/CziQemry2.js +1 -0
- package/dist/client/_app/immutable/chunks/CziQemry2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/CziQemry2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Czovc13W.js +1 -0
- package/dist/client/_app/immutable/chunks/Czovc13W.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Czovc13W.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/D38BHtSY.js +298 -0
- package/dist/client/_app/immutable/chunks/D38BHtSY.js.br +0 -0
- package/dist/client/_app/immutable/chunks/D38BHtSY.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DBkS_L3S.js +1 -0
- package/dist/client/_app/immutable/chunks/DBkS_L3S.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DBkS_L3S.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DEoC-BX-.js +11 -0
- package/dist/client/_app/immutable/chunks/DEoC-BX-.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DEoC-BX-.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DHkiqSLl.js +1 -0
- package/dist/client/_app/immutable/chunks/DHkiqSLl.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DHkiqSLl.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DL7ZpfJd.js +1 -0
- package/dist/client/_app/immutable/chunks/DL7ZpfJd.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DL7ZpfJd.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DUC3NMun2.js +4 -0
- package/dist/client/_app/immutable/chunks/DUC3NMun2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DUC3NMun2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DWUlubL2.js +1 -0
- package/dist/client/_app/immutable/chunks/DWUlubL2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DWUlubL2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/D_HtEbjl.js +1 -0
- package/dist/client/_app/immutable/chunks/D_HtEbjl.js.br +0 -0
- package/dist/client/_app/immutable/chunks/D_HtEbjl.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DaCLQrfC.js +1 -0
- package/dist/client/_app/immutable/chunks/DaCLQrfC.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DaCLQrfC.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DbxPn-f9.js +1 -0
- package/dist/client/_app/immutable/chunks/DbxPn-f9.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DbxPn-f9.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DhPi0T7V2.js +1 -0
- package/dist/client/_app/immutable/chunks/DhPi0T7V2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DhPi0T7V2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DkZEX-tr.js +1 -0
- package/dist/client/_app/immutable/chunks/DkZEX-tr.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DkZEX-tr.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/Dqs1VwMg2.js +1 -0
- package/dist/client/_app/immutable/chunks/Dqs1VwMg2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/Dqs1VwMg2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DrDIkqkr2.js +1 -0
- package/dist/client/_app/immutable/chunks/DrDIkqkr2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DrDIkqkr2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DunPnEs5.js +1 -0
- package/dist/client/_app/immutable/chunks/DunPnEs5.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DunPnEs5.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/DxLN9Q9A.js +1 -0
- package/dist/client/_app/immutable/chunks/DxLN9Q9A.js.br +0 -0
- package/dist/client/_app/immutable/chunks/DxLN9Q9A.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/GhmjqkHA.js +1 -0
- package/dist/client/_app/immutable/chunks/GhmjqkHA.js.br +0 -0
- package/dist/client/_app/immutable/chunks/GhmjqkHA.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/H_bCfo1Z.js +1 -0
- package/dist/client/_app/immutable/chunks/H_bCfo1Z.js.br +1 -0
- package/dist/client/_app/immutable/chunks/H_bCfo1Z.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/KoMdYtDs2.js +1 -0
- package/dist/client/_app/immutable/chunks/KoMdYtDs2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/KoMdYtDs2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/OELm4xo1.js +1 -0
- package/dist/client/_app/immutable/chunks/OELm4xo1.js.br +0 -0
- package/dist/client/_app/immutable/chunks/OELm4xo1.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/OdxrjoDx.js +1 -0
- package/dist/client/_app/immutable/chunks/OdxrjoDx.js.br +0 -0
- package/dist/client/_app/immutable/chunks/OdxrjoDx.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/SlhV96tq.js +1 -0
- package/dist/client/_app/immutable/chunks/SlhV96tq.js.br +0 -0
- package/dist/client/_app/immutable/chunks/SlhV96tq.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/X9L1iai42.js +1 -0
- package/dist/client/_app/immutable/chunks/X9L1iai42.js.br +0 -0
- package/dist/client/_app/immutable/chunks/X9L1iai42.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/XIokwnxj2.js +11 -0
- package/dist/client/_app/immutable/chunks/XIokwnxj2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/XIokwnxj2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/ZmwXQQ8p.js +1 -0
- package/dist/client/_app/immutable/chunks/ZmwXQQ8p.js.br +0 -0
- package/dist/client/_app/immutable/chunks/ZmwXQQ8p.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/acVTcwNd.js +1 -0
- package/dist/client/_app/immutable/chunks/acVTcwNd.js.br +0 -0
- package/dist/client/_app/immutable/chunks/acVTcwNd.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/bLoc39kl.js +2 -0
- package/dist/client/_app/immutable/chunks/bLoc39kl.js.br +0 -0
- package/dist/client/_app/immutable/chunks/bLoc39kl.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/dm7qVrFn2.js +1 -0
- package/dist/client/_app/immutable/chunks/dm7qVrFn2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/dm7qVrFn2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/if7vWS9-.js +1 -0
- package/dist/client/_app/immutable/chunks/if7vWS9-.js.br +0 -0
- package/dist/client/_app/immutable/chunks/if7vWS9-.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/kAc38cH_.js +3 -0
- package/dist/client/_app/immutable/chunks/kAc38cH_.js.br +0 -0
- package/dist/client/_app/immutable/chunks/kAc38cH_.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/kks0AxFY2.js +1 -0
- package/dist/client/_app/immutable/chunks/kks0AxFY2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/kks0AxFY2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/mA7hbneB.js +3 -0
- package/dist/client/_app/immutable/chunks/mA7hbneB.js.br +0 -0
- package/dist/client/_app/immutable/chunks/mA7hbneB.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/qWHUp0PJ2.js +1 -0
- package/dist/client/_app/immutable/chunks/qWHUp0PJ2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/qWHUp0PJ2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/u6JPB_fg2.js +1 -0
- package/dist/client/_app/immutable/chunks/u6JPB_fg2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/u6JPB_fg2.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/v_jBEYI6.js +1 -0
- package/dist/client/_app/immutable/chunks/v_jBEYI6.js.br +1 -0
- package/dist/client/_app/immutable/chunks/v_jBEYI6.js.gz +0 -0
- package/dist/client/_app/immutable/chunks/x4VkYCou2.js +1 -0
- package/dist/client/_app/immutable/chunks/x4VkYCou2.js.br +0 -0
- package/dist/client/_app/immutable/chunks/x4VkYCou2.js.gz +0 -0
- package/dist/client/_app/immutable/entry/app.CrM2Umgq.js +2 -0
- package/dist/client/_app/immutable/entry/app.CrM2Umgq.js.br +0 -0
- package/dist/client/_app/immutable/entry/app.CrM2Umgq.js.gz +0 -0
- package/dist/client/_app/immutable/entry/start.25Vi3KZA.js +1 -0
- package/dist/client/_app/immutable/entry/start.25Vi3KZA.js.br +0 -0
- package/dist/client/_app/immutable/entry/start.25Vi3KZA.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/0.Ck5XUPzX.js +1 -0
- package/dist/client/_app/immutable/nodes/0.Ck5XUPzX.js.br +0 -0
- package/dist/client/_app/immutable/nodes/0.Ck5XUPzX.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/1.Dpx0WKl2.js +1 -0
- package/dist/client/_app/immutable/nodes/1.Dpx0WKl2.js.br +0 -0
- package/dist/client/_app/immutable/nodes/1.Dpx0WKl2.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/2.CwofzauD.js +4 -0
- package/dist/client/_app/immutable/nodes/2.CwofzauD.js.br +0 -0
- package/dist/client/_app/immutable/nodes/2.CwofzauD.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/3.CU9DPzka.js +1 -0
- package/dist/client/_app/immutable/nodes/3.CU9DPzka.js.br +0 -0
- package/dist/client/_app/immutable/nodes/3.CU9DPzka.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/4.P9ayzmJ4.js +5 -0
- package/dist/client/_app/immutable/nodes/4.P9ayzmJ4.js.br +0 -0
- package/dist/client/_app/immutable/nodes/4.P9ayzmJ4.js.gz +0 -0
- package/dist/client/_app/immutable/nodes/5.Dcsjm3Pq.js +1 -0
- package/dist/client/_app/immutable/nodes/5.Dcsjm3Pq.js.br +0 -0
- package/dist/client/_app/immutable/nodes/5.Dcsjm3Pq.js.gz +0 -0
- package/dist/client/_app/immutable/workers/css.worker-DRFWP4k7.js +89 -0
- package/dist/client/_app/immutable/workers/css.worker-DRFWP4k7.js.br +0 -0
- package/dist/client/_app/immutable/workers/css.worker-DRFWP4k7.js.gz +0 -0
- package/dist/client/_app/immutable/workers/html.worker-CXAEVlCI.js +502 -0
- package/dist/client/_app/immutable/workers/html.worker-CXAEVlCI.js.br +0 -0
- package/dist/client/_app/immutable/workers/html.worker-CXAEVlCI.js.gz +0 -0
- package/dist/client/_app/immutable/workers/json.worker-Dkwen84u.js +58 -0
- package/dist/client/_app/immutable/workers/json.worker-Dkwen84u.js.br +0 -0
- package/dist/client/_app/immutable/workers/json.worker-Dkwen84u.js.gz +0 -0
- package/dist/client/_app/immutable/workers/ts.worker-DJwDx_mp.js +67719 -0
- package/dist/client/_app/immutable/workers/ts.worker-DJwDx_mp.js.br +0 -0
- package/dist/client/_app/immutable/workers/ts.worker-DJwDx_mp.js.gz +0 -0
- package/dist/client/_app/version.json +1 -0
- package/dist/client/_app/version.json.br +0 -0
- package/dist/client/_app/version.json.gz +0 -0
- package/dist/client/favicon.svg +1 -0
- package/dist/client/favicon.svg.br +0 -0
- package/dist/client/favicon.svg.gz +0 -0
- package/dist/client/robots.txt +3 -0
- package/dist/client/robots.txt.br +0 -0
- package/dist/client/robots.txt.gz +0 -0
- package/dist/env.js +32 -0
- package/dist/handler.js +744 -0
- package/dist/index.js +49 -0
- package/dist/server/chunks/0-DmwMCtOF.js +16 -0
- package/dist/server/chunks/0-DmwMCtOF.js.map +1 -0
- package/dist/server/chunks/1-BgVLfks1.js +17 -0
- package/dist/server/chunks/1-BgVLfks1.js.map +1 -0
- package/dist/server/chunks/2-CzdRJh2P.js +30 -0
- package/dist/server/chunks/2-CzdRJh2P.js.map +1 -0
- package/dist/server/chunks/3-C6uctiU1.js +185 -0
- package/dist/server/chunks/3-C6uctiU1.js.map +1 -0
- package/dist/server/chunks/4-BO3KTp14.js +390 -0
- package/dist/server/chunks/4-BO3KTp14.js.map +1 -0
- package/dist/server/chunks/5-LbaHRTVX.js +259 -0
- package/dist/server/chunks/5-LbaHRTVX.js.map +1 -0
- package/dist/server/chunks/_layout.svelte-BzcRjvYO.js +11 -0
- package/dist/server/chunks/_layout.svelte-BzcRjvYO.js.map +1 -0
- package/dist/server/chunks/_page.svelte-CB5X_URD.js +197 -0
- package/dist/server/chunks/_page.svelte-CB5X_URD.js.map +1 -0
- package/dist/server/chunks/_page.svelte-DMwjXpw4.js +13 -0
- package/dist/server/chunks/_page.svelte-DMwjXpw4.js.map +1 -0
- package/dist/server/chunks/_page.svelte-XIYDQw7d.js +14 -0
- package/dist/server/chunks/_page.svelte-XIYDQw7d.js.map +1 -0
- package/dist/server/chunks/_page.svelte-paWD_HcG.js +4302 -0
- package/dist/server/chunks/_page.svelte-paWD_HcG.js.map +1 -0
- package/dist/server/chunks/api-9BLkbfaG.js +9126 -0
- package/dist/server/chunks/api-9BLkbfaG.js.map +1 -0
- package/dist/server/chunks/app-l-cuFP__.js +13 -0
- package/dist/server/chunks/app-l-cuFP__.js.map +1 -0
- package/dist/server/chunks/chunk-9PtDFT_4.js +37 -0
- package/dist/server/chunks/client-Dx0O-q6m.js +115 -0
- package/dist/server/chunks/client-Dx0O-q6m.js.map +1 -0
- package/dist/server/chunks/dev-7V6fUCff.js +4429 -0
- package/dist/server/chunks/dev-7V6fUCff.js.map +1 -0
- package/dist/server/chunks/error.svelte-C5CCEI9O.js +102 -0
- package/dist/server/chunks/error.svelte-C5CCEI9O.js.map +1 -0
- package/dist/server/chunks/exports-j3HcL9It.js +158 -0
- package/dist/server/chunks/exports-j3HcL9It.js.map +1 -0
- package/dist/server/chunks/forms-CffPpDq6.js +36 -0
- package/dist/server/chunks/forms-CffPpDq6.js.map +1 -0
- package/dist/server/chunks/hooks.server-DqaQ1y1I.js +858 -0
- package/dist/server/chunks/hooks.server-DqaQ1y1I.js.map +1 -0
- package/dist/server/chunks/hooks.universal-0JHSyeLw.js +7 -0
- package/dist/server/chunks/hooks.universal-0JHSyeLw.js.map +1 -0
- package/dist/server/chunks/internal-BgFVxXcc.js +66 -0
- package/dist/server/chunks/internal-BgFVxXcc.js.map +1 -0
- package/dist/server/chunks/internal-BqoJe00m.js +1671 -0
- package/dist/server/chunks/internal-BqoJe00m.js.map +1 -0
- package/dist/server/chunks/runtime-ISoc6PNh.js +703 -0
- package/dist/server/chunks/runtime-ISoc6PNh.js.map +1 -0
- package/dist/server/chunks/server-BlOy0jJl.js +91 -0
- package/dist/server/chunks/server-BlOy0jJl.js.map +1 -0
- package/dist/server/chunks/shared-server-D--cyMsO.js +23 -0
- package/dist/server/chunks/shared-server-D--cyMsO.js.map +1 -0
- package/dist/server/index.js +4183 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/manifest.js +102 -0
- package/dist/server/manifest.js.map +1 -0
- package/package.json +119 -0
|
@@ -0,0 +1,703 @@
|
|
|
1
|
+
//#region .svelte-kit/adapter-bun/chunks/runtime.js
|
|
2
|
+
/** @type {any} */
|
|
3
|
+
var URLPattern = {};
|
|
4
|
+
/**
|
|
5
|
+
* The project's locales that have been specified in the settings.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* if (locales.includes(userSelectedLocale) === false) {
|
|
9
|
+
* throw new Error('Locale is not available');
|
|
10
|
+
* }
|
|
11
|
+
*/
|
|
12
|
+
var locales = ["en", "fr"];
|
|
13
|
+
/** @type {string} */
|
|
14
|
+
var cookieName = "PARAGLIDE_LOCALE";
|
|
15
|
+
/**
|
|
16
|
+
* @type {Array<"cookie" | "baseLocale" | "globalVariable" | "url" | "preferredLanguage" | "localStorage" | `custom-${string}`>}
|
|
17
|
+
*/
|
|
18
|
+
var strategy = [
|
|
19
|
+
"cookie",
|
|
20
|
+
"globalVariable",
|
|
21
|
+
"baseLocale"
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Route-level strategy overrides.
|
|
25
|
+
*
|
|
26
|
+
* `match` uses URLPattern syntax.
|
|
27
|
+
*
|
|
28
|
+
* @type {Array<{
|
|
29
|
+
* match: string;
|
|
30
|
+
* strategy?: Array<"cookie" | "baseLocale" | "globalVariable" | "url" | "preferredLanguage" | "localStorage" | `custom-${string}`>;
|
|
31
|
+
* exclude?: boolean;
|
|
32
|
+
* }>}
|
|
33
|
+
*/
|
|
34
|
+
var routeStrategies = [];
|
|
35
|
+
/** @type {string | undefined} */
|
|
36
|
+
var cachedRouteStrategyUrl;
|
|
37
|
+
/** @type {{ match: string; strategy?: typeof strategy; exclude?: boolean } | undefined} */
|
|
38
|
+
var cachedRouteStrategy;
|
|
39
|
+
/**
|
|
40
|
+
* @param {string | URL} url
|
|
41
|
+
* @returns {{ match: string; strategy?: typeof strategy; exclude?: boolean } | undefined}
|
|
42
|
+
*/
|
|
43
|
+
function findMatchingRouteStrategy(url) {
|
|
44
|
+
if (routeStrategies.length === 0) return;
|
|
45
|
+
const urlString = typeof url === "string" ? url : url.href;
|
|
46
|
+
if (cachedRouteStrategyUrl === urlString) return cachedRouteStrategy;
|
|
47
|
+
const urlObject = new URL(urlString, "http://dummy.com");
|
|
48
|
+
let match;
|
|
49
|
+
for (const routeStrategy of routeStrategies) if (new URLPattern(routeStrategy.match, urlObject.href).exec(urlObject.href)) {
|
|
50
|
+
match = routeStrategy;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
cachedRouteStrategyUrl = urlString;
|
|
54
|
+
cachedRouteStrategy = match;
|
|
55
|
+
return match;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Returns the strategy to use for a specific URL.
|
|
59
|
+
*
|
|
60
|
+
* If no route strategy matches (or the matching rule is `exclude: true`),
|
|
61
|
+
* the global strategy is returned.
|
|
62
|
+
*
|
|
63
|
+
* @param {string | URL} url
|
|
64
|
+
* @returns {typeof strategy}
|
|
65
|
+
*/
|
|
66
|
+
function getStrategyForUrl(url) {
|
|
67
|
+
const routeStrategy = findMatchingRouteStrategy(url);
|
|
68
|
+
if (routeStrategy && routeStrategy.exclude !== true && Array.isArray(routeStrategy.strategy)) return routeStrategy.strategy;
|
|
69
|
+
return strategy;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Returns whether the given URL is excluded from middleware i18n processing.
|
|
73
|
+
*
|
|
74
|
+
* @param {string | URL} url
|
|
75
|
+
* @returns {boolean}
|
|
76
|
+
*/
|
|
77
|
+
function isExcludedByRouteStrategy(url) {
|
|
78
|
+
return findMatchingRouteStrategy(url)?.exclude === true;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @typedef {{
|
|
82
|
+
* getStore(): {
|
|
83
|
+
* locale?: Locale,
|
|
84
|
+
* origin?: string,
|
|
85
|
+
* messageCalls?: Set<string>
|
|
86
|
+
* } | undefined,
|
|
87
|
+
* run: (store: { locale?: Locale, origin?: string, messageCalls?: Set<string>},
|
|
88
|
+
* cb: any) => any
|
|
89
|
+
* }} ParaglideAsyncLocalStorage
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* Server side async local storage that is set by `serverMiddleware()`.
|
|
93
|
+
*
|
|
94
|
+
* The variable is used to retrieve the locale and origin in a server-side
|
|
95
|
+
* rendering context without effecting other requests.
|
|
96
|
+
*
|
|
97
|
+
* @type {ParaglideAsyncLocalStorage | undefined}
|
|
98
|
+
*/
|
|
99
|
+
var serverAsyncLocalStorage = void 0;
|
|
100
|
+
/**
|
|
101
|
+
* Sets the server side async local storage.
|
|
102
|
+
*
|
|
103
|
+
* The function is needed because the `runtime.js` file
|
|
104
|
+
* must define the `serverAsyncLocalStorage` variable to
|
|
105
|
+
* avoid a circular import between `runtime.js` and
|
|
106
|
+
* `server.js` files.
|
|
107
|
+
*
|
|
108
|
+
* @param {ParaglideAsyncLocalStorage | undefined} value
|
|
109
|
+
*/
|
|
110
|
+
function overwriteServerAsyncLocalStorage(value) {
|
|
111
|
+
serverAsyncLocalStorage = value;
|
|
112
|
+
}
|
|
113
|
+
/** @type {any} */ globalThis.__paraglide = globalThis.__paraglide ?? {};
|
|
114
|
+
/** @type {any} */ globalThis.__paraglide.ssr = globalThis.__paraglide.ssr ?? {};
|
|
115
|
+
/**
|
|
116
|
+
* This is a fallback to get started with a custom
|
|
117
|
+
* strategy and avoid type errors.
|
|
118
|
+
*
|
|
119
|
+
* The implementation is overwritten
|
|
120
|
+
* by `overwriteGetLocale()` and `defineSetLocale()`.
|
|
121
|
+
*
|
|
122
|
+
* @type {Locale | undefined}
|
|
123
|
+
*/
|
|
124
|
+
var _locale;
|
|
125
|
+
var localeInitiallySet = false;
|
|
126
|
+
/**
|
|
127
|
+
* Get the current locale.
|
|
128
|
+
*
|
|
129
|
+
* The locale is resolved using your configured strategies (URL, cookie, localStorage, etc.)
|
|
130
|
+
* in the order they are defined. In SSR contexts, the locale is retrieved from AsyncLocalStorage
|
|
131
|
+
* which is set by the `paraglideMiddleware()`.
|
|
132
|
+
*
|
|
133
|
+
* @see https://inlang.com/m/gerre34r/library-inlang-paraglideJs/strategy - Configure locale detection strategies
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* if (getLocale() === 'de') {
|
|
137
|
+
* console.log('Germany 🇩🇪');
|
|
138
|
+
* } else if (getLocale() === 'nl') {
|
|
139
|
+
* console.log('Netherlands 🇳🇱');
|
|
140
|
+
* }
|
|
141
|
+
*
|
|
142
|
+
* @returns {Locale} The current locale.
|
|
143
|
+
*/
|
|
144
|
+
var getLocale = () => {
|
|
145
|
+
if (serverAsyncLocalStorage) {
|
|
146
|
+
const locale = serverAsyncLocalStorage?.getStore()?.locale;
|
|
147
|
+
if (locale) return locale;
|
|
148
|
+
}
|
|
149
|
+
const resolved = resolveLocaleWithStrategies(strategy, typeof window !== "undefined" ? window.location?.href : void 0);
|
|
150
|
+
if (resolved) {
|
|
151
|
+
if (!localeInitiallySet) {
|
|
152
|
+
_locale = resolved;
|
|
153
|
+
localeInitiallySet = true;
|
|
154
|
+
setLocale(resolved, { reload: false });
|
|
155
|
+
}
|
|
156
|
+
return resolved;
|
|
157
|
+
}
|
|
158
|
+
throw new Error("No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Resolve locale for a given URL using route-aware strategies.
|
|
162
|
+
*
|
|
163
|
+
* @param {string | URL} url
|
|
164
|
+
* @returns {Locale}
|
|
165
|
+
*/
|
|
166
|
+
function getLocaleForUrl(url) {
|
|
167
|
+
const resolved = resolveLocaleWithStrategies(getStrategyForUrl(url), typeof url === "string" ? url : url.href);
|
|
168
|
+
if (resolved) return resolved;
|
|
169
|
+
throw new Error("No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* @param {typeof strategy} strategyToUse
|
|
173
|
+
* @param {string | undefined} urlForUrlStrategy
|
|
174
|
+
* @returns {Locale | undefined}
|
|
175
|
+
*/
|
|
176
|
+
function resolveLocaleWithStrategies(strategyToUse, urlForUrlStrategy) {
|
|
177
|
+
/** @type {string | undefined} */
|
|
178
|
+
let locale;
|
|
179
|
+
for (const strat of strategyToUse) {
|
|
180
|
+
if (strat === "cookie") locale = extractLocaleFromCookie();
|
|
181
|
+
else if (strat === "baseLocale") locale = "en";
|
|
182
|
+
else if (strat === "globalVariable" && _locale !== void 0) locale = _locale;
|
|
183
|
+
else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
|
|
184
|
+
const handler = customClientStrategies.get(strat);
|
|
185
|
+
if (handler) {
|
|
186
|
+
const result = handler.getLocale();
|
|
187
|
+
if (result instanceof Promise) continue;
|
|
188
|
+
if (result !== void 0) return assertIsLocale(result);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const matchedLocale = toLocale(locale);
|
|
192
|
+
if (matchedLocale) return matchedLocale;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* @typedef {(newLocale: Locale, options?: { reload?: boolean }) => void | Promise<void>} SetLocaleFn
|
|
197
|
+
*/
|
|
198
|
+
/**
|
|
199
|
+
* Set the locale.
|
|
200
|
+
*
|
|
201
|
+
* Updates the locale using your configured strategies (cookie, localStorage, URL, etc.).
|
|
202
|
+
* By default, this reloads the page on the client to reflect the new locale. Reloading
|
|
203
|
+
* can be disabled by passing `reload: false` as an option, but you'll need to ensure
|
|
204
|
+
* the UI updates to reflect the new locale.
|
|
205
|
+
*
|
|
206
|
+
* If any custom strategy's `setLocale` function is async, then this function
|
|
207
|
+
* will become async as well.
|
|
208
|
+
*
|
|
209
|
+
* @see https://inlang.com/m/gerre34r/library-inlang-paraglideJs/strategy
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* setLocale('en');
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* setLocale('en', { reload: false });
|
|
216
|
+
*
|
|
217
|
+
* @type {SetLocaleFn}
|
|
218
|
+
*/
|
|
219
|
+
var setLocale = (newLocale, options) => {
|
|
220
|
+
({ ...options });
|
|
221
|
+
try {
|
|
222
|
+
getLocale();
|
|
223
|
+
} catch {}
|
|
224
|
+
/** @type {Array<Promise<void>>} */
|
|
225
|
+
const customSetLocalePromises = [];
|
|
226
|
+
let strategyToUse = strategy;
|
|
227
|
+
for (const strat of strategyToUse) if (strat === "globalVariable") _locale = newLocale;
|
|
228
|
+
else if (strat === "cookie") continue;
|
|
229
|
+
else if (strat === "baseLocale") continue;
|
|
230
|
+
else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
|
|
231
|
+
const handler = customClientStrategies.get(strat);
|
|
232
|
+
if (handler) {
|
|
233
|
+
let result = handler.setLocale(newLocale);
|
|
234
|
+
if (result instanceof Promise) {
|
|
235
|
+
result = result.catch((error) => {
|
|
236
|
+
throw new Error(`Custom strategy "${strat}" setLocale failed.`, { cause: error });
|
|
237
|
+
});
|
|
238
|
+
customSetLocalePromises.push(result);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const runReload = () => {};
|
|
243
|
+
if (customSetLocalePromises.length) return Promise.all(customSetLocalePromises).then(() => {
|
|
244
|
+
runReload();
|
|
245
|
+
});
|
|
246
|
+
runReload();
|
|
247
|
+
};
|
|
248
|
+
/**
|
|
249
|
+
* The origin of the current URL.
|
|
250
|
+
*
|
|
251
|
+
* Defaults to "http://y.com" in non-browser environments. If this
|
|
252
|
+
* behavior is not desired, the implementation can be overwritten
|
|
253
|
+
* by `overwriteGetUrlOrigin()`.
|
|
254
|
+
*
|
|
255
|
+
* @type {() => string}
|
|
256
|
+
*/
|
|
257
|
+
var getUrlOrigin = () => {
|
|
258
|
+
if (serverAsyncLocalStorage) return serverAsyncLocalStorage.getStore()?.origin ?? "http://fallback.com";
|
|
259
|
+
else if (typeof window !== "undefined") return window.location.origin;
|
|
260
|
+
return "http://fallback.com";
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Coerces a locale-like string to the canonical locale value used by the runtime.
|
|
264
|
+
*
|
|
265
|
+
* @param {unknown} value
|
|
266
|
+
* @returns {Locale | undefined}
|
|
267
|
+
*/
|
|
268
|
+
function toLocale(value) {
|
|
269
|
+
if (typeof value !== "string") return;
|
|
270
|
+
const lowerValue = value.toLowerCase();
|
|
271
|
+
for (const locale of locales) if (locale.toLowerCase() === lowerValue) return locale;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Asserts that the input can be normalized to a locale.
|
|
275
|
+
*
|
|
276
|
+
* @param {unknown} input - The input to check.
|
|
277
|
+
* @returns {Locale} The input normalized to a Locale.
|
|
278
|
+
* @throws {Error} If the input is not a locale.
|
|
279
|
+
*/
|
|
280
|
+
function assertIsLocale(input) {
|
|
281
|
+
const locale = toLocale(input);
|
|
282
|
+
if (locale) return locale;
|
|
283
|
+
throw new Error(`Invalid locale: ${input}. Expected one of: ${locales.join(", ")}`);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Extracts a locale from a request using the provided strategy order.
|
|
287
|
+
*
|
|
288
|
+
* @param {Request} request
|
|
289
|
+
* @param {typeof strategy} strategies
|
|
290
|
+
* @param {string | URL} [url]
|
|
291
|
+
* @returns {Locale}
|
|
292
|
+
*/
|
|
293
|
+
var extractLocaleFromRequestWithStrategies = (request, strategies, url = request.url) => {
|
|
294
|
+
resolveEffectiveRequestUrl(request, url);
|
|
295
|
+
/** @type {string|undefined} */
|
|
296
|
+
let locale;
|
|
297
|
+
for (const strat of strategies) {
|
|
298
|
+
if (strat === "cookie") locale = request.headers.get("cookie")?.split("; ").find((c) => c.startsWith(cookieName + "="))?.split("=")[1];
|
|
299
|
+
else if (strat === "globalVariable") locale = _locale;
|
|
300
|
+
else if (strat === "baseLocale") return "en";
|
|
301
|
+
else if (strat === "localStorage") continue;
|
|
302
|
+
else if (isCustomStrategy(strat)) continue;
|
|
303
|
+
const matchedLocale = toLocale(locale);
|
|
304
|
+
if (matchedLocale) return matchedLocale;
|
|
305
|
+
}
|
|
306
|
+
throw new Error("No locale found. There is an error in your strategy. Try adding 'baseLocale' as the very last strategy. Read more here https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* @param {Request} request
|
|
310
|
+
* @param {string | URL | undefined} effectiveRequestUrl
|
|
311
|
+
* @returns {URL}
|
|
312
|
+
*/
|
|
313
|
+
function resolveEffectiveRequestUrl(request, effectiveRequestUrl = request.url) {
|
|
314
|
+
if (effectiveRequestUrl instanceof URL) return new URL(effectiveRequestUrl.href);
|
|
315
|
+
return new URL(effectiveRequestUrl, request.url);
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Asynchronously extracts a locale from a request.
|
|
319
|
+
*
|
|
320
|
+
* This function supports async custom server strategies, unlike the synchronous
|
|
321
|
+
* `extractLocaleFromRequest`. Use this function when you have custom server strategies
|
|
322
|
+
* that need to perform asynchronous operations (like database calls) in their getLocale method.
|
|
323
|
+
*
|
|
324
|
+
* The function first processes any custom server strategies asynchronously, then falls back
|
|
325
|
+
* to the synchronous `extractLocaleFromRequest` for all other strategies.
|
|
326
|
+
*
|
|
327
|
+
* @see {@link https://github.com/opral/inlang-paraglide-js/issues/527#issuecomment-2978151022}
|
|
328
|
+
*
|
|
329
|
+
* @example
|
|
330
|
+
* // Basic usage
|
|
331
|
+
* const locale = await extractLocaleFromRequestAsync(request);
|
|
332
|
+
*
|
|
333
|
+
* @example
|
|
334
|
+
* // With custom async server strategy
|
|
335
|
+
* defineCustomServerStrategy("custom-database", {
|
|
336
|
+
* getLocale: async (request) => {
|
|
337
|
+
* const userId = extractUserIdFromRequest(request);
|
|
338
|
+
* return await getUserLocaleFromDatabase(userId);
|
|
339
|
+
* }
|
|
340
|
+
* });
|
|
341
|
+
*
|
|
342
|
+
* const locale = await extractLocaleFromRequestAsync(request);
|
|
343
|
+
*
|
|
344
|
+
* @param {Request} request - The request object to extract the locale from.
|
|
345
|
+
* @param {{ effectiveRequestUrl?: string | URL }} [options] - Effective request URL to use for route matching and locale detection with the URL strategy.
|
|
346
|
+
* @returns {Promise<Locale>} The extracted locale.
|
|
347
|
+
*/
|
|
348
|
+
var extractLocaleFromRequestAsync = async (request, options = {}) => {
|
|
349
|
+
/** @type {string|undefined} */
|
|
350
|
+
let locale;
|
|
351
|
+
const effectiveRequestUrl = resolveEffectiveRequestUrlFromRequestAsync(request, options.effectiveRequestUrl);
|
|
352
|
+
const strategy = getStrategyForUrl(effectiveRequestUrl);
|
|
353
|
+
for (const strat of strategy) if (isCustomStrategy(strat) && customServerStrategies.has(strat)) {
|
|
354
|
+
const handler = customServerStrategies.get(strat);
|
|
355
|
+
if (handler)
|
|
356
|
+
/** @type {string|undefined} */
|
|
357
|
+
locale = await handler.getLocale(request);
|
|
358
|
+
const matchedLocale = toLocale(locale);
|
|
359
|
+
if (matchedLocale) return matchedLocale;
|
|
360
|
+
}
|
|
361
|
+
return extractLocaleFromRequestWithStrategies(request, strategy, effectiveRequestUrl);
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* @param {Request} request
|
|
365
|
+
* @param {string | URL | undefined} effectiveRequestUrl
|
|
366
|
+
* @returns {URL}
|
|
367
|
+
*/
|
|
368
|
+
function resolveEffectiveRequestUrlFromRequestAsync(request, effectiveRequestUrl = request.url) {
|
|
369
|
+
if (effectiveRequestUrl instanceof URL) return new URL(effectiveRequestUrl.href);
|
|
370
|
+
return new URL(effectiveRequestUrl, request.url);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Extracts a cookie from the document.
|
|
374
|
+
*
|
|
375
|
+
* Will return undefined if the document is not available or if the cookie is not set.
|
|
376
|
+
* The `document` object is not available in server-side rendering, so this function should not be called in that context.
|
|
377
|
+
*
|
|
378
|
+
* @returns {Locale | undefined}
|
|
379
|
+
*/
|
|
380
|
+
function extractLocaleFromCookie() {
|
|
381
|
+
if (typeof document === "undefined" || !document.cookie) return;
|
|
382
|
+
const locale = document.cookie.match(new RegExp(`(^| )${cookieName}=([^;]+)`))?.[2];
|
|
383
|
+
return toLocale(locale);
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* If extractLocaleFromUrl is called many times on the same page and the URL
|
|
387
|
+
* hasn't changed, we don't need to recompute it every time which can get expensive.
|
|
388
|
+
* We might use a LRU cache if needed, but for now storing only the last result is enough.
|
|
389
|
+
* https://github.com/opral/monorepo/pull/3575#discussion_r2066731243
|
|
390
|
+
*/
|
|
391
|
+
/** @type {string|undefined} */
|
|
392
|
+
var cachedUrl;
|
|
393
|
+
/** @type {Locale|undefined} */
|
|
394
|
+
var cachedLocale;
|
|
395
|
+
/**
|
|
396
|
+
* Extracts the locale from a given URL using native URLPattern.
|
|
397
|
+
*
|
|
398
|
+
* The built-in default `/:locale/...` routing is case-insensitive because it
|
|
399
|
+
* canonicalizes the first path segment with `toLocale()`. Custom `urlPatterns`
|
|
400
|
+
* keep URLPattern's normal exact matching semantics for path segments.
|
|
401
|
+
*
|
|
402
|
+
* @param {URL|string} url - The full URL from which to extract the locale.
|
|
403
|
+
* @returns {Locale|undefined} The extracted locale, or undefined if no locale is found.
|
|
404
|
+
*/
|
|
405
|
+
function extractLocaleFromUrl(url) {
|
|
406
|
+
const urlString = typeof url === "string" ? url : url.href;
|
|
407
|
+
if (cachedUrl === urlString) return cachedLocale;
|
|
408
|
+
/** @type {Locale | undefined} */
|
|
409
|
+
let result;
|
|
410
|
+
result = defaultUrlPatternExtractLocale(url);
|
|
411
|
+
cachedUrl = urlString;
|
|
412
|
+
cachedLocale = result;
|
|
413
|
+
return result;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* https://github.com/opral/inlang-paraglide-js/issues/381
|
|
417
|
+
*
|
|
418
|
+
* @param {URL | string} url - The full URL from which to extract the locale.
|
|
419
|
+
* @returns {Locale | undefined} The extracted locale, or undefined if no locale is found.
|
|
420
|
+
*/
|
|
421
|
+
function defaultUrlPatternExtractLocale(url) {
|
|
422
|
+
return toLocale(new URL(url, "http://dummy.com").pathname.split("/").filter(Boolean)[0]) || "en";
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Lower-level URL localization function, primarily used in server contexts.
|
|
426
|
+
*
|
|
427
|
+
* This function is designed for server-side usage where you need precise control
|
|
428
|
+
* over URL localization, such as in middleware or request handlers. It works with
|
|
429
|
+
* URL objects and always returns absolute URLs.
|
|
430
|
+
*
|
|
431
|
+
* For client-side UI components, use `localizeHref()` instead, which provides
|
|
432
|
+
* a more convenient API with relative paths and automatic locale detection.
|
|
433
|
+
*
|
|
434
|
+
* @see https://inlang.com/m/gerre34r/library-inlang-paraglideJs/i18n-routing
|
|
435
|
+
*
|
|
436
|
+
* @example
|
|
437
|
+
* ```typescript
|
|
438
|
+
* // Server middleware example
|
|
439
|
+
* app.use((req, res, next) => {
|
|
440
|
+
* const url = new URL(req.url, `${req.protocol}://${req.headers.host}`);
|
|
441
|
+
* const localized = localizeUrl(url, { locale: "de" });
|
|
442
|
+
*
|
|
443
|
+
* if (localized.href !== url.href) {
|
|
444
|
+
* return res.redirect(localized.href);
|
|
445
|
+
* }
|
|
446
|
+
* next();
|
|
447
|
+
* });
|
|
448
|
+
* ```
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* ```typescript
|
|
452
|
+
* // Using with URL patterns
|
|
453
|
+
* const url = new URL("https://example.com/about");
|
|
454
|
+
* localizeUrl(url, { locale: "de" });
|
|
455
|
+
* // => URL("https://example.com/de/about")
|
|
456
|
+
*
|
|
457
|
+
* // Using with domain-based localization
|
|
458
|
+
* const url = new URL("https://example.com/store");
|
|
459
|
+
* localizeUrl(url, { locale: "de" });
|
|
460
|
+
* // => URL("https://de.example.com/store")
|
|
461
|
+
* ```
|
|
462
|
+
*
|
|
463
|
+
* @param {string | URL} url - The URL to localize. If string, must be absolute.
|
|
464
|
+
* @param {object} [options] - Options for localization
|
|
465
|
+
* @param {Locale} [options.locale] - Target locale. If not provided, uses getLocale()
|
|
466
|
+
* @returns {URL} The localized URL, always absolute
|
|
467
|
+
*/
|
|
468
|
+
function localizeUrl(url, options) {
|
|
469
|
+
return localizeUrlDefaultPattern(url, options?.locale ? assertIsLocale(options?.locale) : getLocale());
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* https://github.com/opral/inlang-paraglide-js/issues/381
|
|
473
|
+
*
|
|
474
|
+
* @param {string | URL} url
|
|
475
|
+
* @param {Locale} locale
|
|
476
|
+
* @returns {URL}
|
|
477
|
+
*/
|
|
478
|
+
function localizeUrlDefaultPattern(url, locale) {
|
|
479
|
+
const urlObj = typeof url === "string" ? new URL(url, getUrlOrigin()) : new URL(url);
|
|
480
|
+
if (extractLocaleFromUrl(urlObj) === locale) return urlObj;
|
|
481
|
+
const pathSegments = urlObj.pathname.split("/").filter(Boolean);
|
|
482
|
+
if (pathSegments.length > 0 && toLocale(pathSegments[0])) pathSegments.shift();
|
|
483
|
+
if (locale === "en") urlObj.pathname = "/" + pathSegments.join("/");
|
|
484
|
+
else urlObj.pathname = "/" + locale + "/" + pathSegments.join("/");
|
|
485
|
+
return urlObj;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Low-level URL de-localization function, primarily used in server contexts.
|
|
489
|
+
*
|
|
490
|
+
* This function is designed for server-side usage where you need precise control
|
|
491
|
+
* over URL de-localization, such as in middleware or request handlers. It works with
|
|
492
|
+
* URL objects and always returns absolute URLs.
|
|
493
|
+
*
|
|
494
|
+
* For client-side UI components, use `deLocalizeHref()` instead, which provides
|
|
495
|
+
* a more convenient API with relative paths.
|
|
496
|
+
*
|
|
497
|
+
* @see https://inlang.com/m/gerre34r/library-inlang-paraglideJs/i18n-routing
|
|
498
|
+
*
|
|
499
|
+
* @example
|
|
500
|
+
* ```typescript
|
|
501
|
+
* // Server middleware example
|
|
502
|
+
* app.use((req, res, next) => {
|
|
503
|
+
* const url = new URL(req.url, `${req.protocol}://${req.headers.host}`);
|
|
504
|
+
* const baseUrl = deLocalizeUrl(url);
|
|
505
|
+
*
|
|
506
|
+
* // Store the base URL for later use
|
|
507
|
+
* req.baseUrl = baseUrl;
|
|
508
|
+
* next();
|
|
509
|
+
* });
|
|
510
|
+
* ```
|
|
511
|
+
*
|
|
512
|
+
* @example
|
|
513
|
+
* ```typescript
|
|
514
|
+
* // Using with URL patterns
|
|
515
|
+
* const url = new URL("https://example.com/de/about");
|
|
516
|
+
* deLocalizeUrl(url); // => URL("https://example.com/about")
|
|
517
|
+
*
|
|
518
|
+
* // Using with domain-based localization
|
|
519
|
+
* const url = new URL("https://de.example.com/store");
|
|
520
|
+
* deLocalizeUrl(url); // => URL("https://example.com/store")
|
|
521
|
+
* ```
|
|
522
|
+
*
|
|
523
|
+
* @param {string | URL} url - The URL to de-localize. If string, must be absolute.
|
|
524
|
+
* @returns {URL} The de-localized URL, always absolute
|
|
525
|
+
*/
|
|
526
|
+
function deLocalizeUrl(url) {
|
|
527
|
+
return deLocalizeUrlDefaultPattern(url);
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* De-localizes a URL using the default pattern (/:locale/*)
|
|
531
|
+
* @param {string|URL} url
|
|
532
|
+
* @returns {URL}
|
|
533
|
+
*/
|
|
534
|
+
function deLocalizeUrlDefaultPattern(url) {
|
|
535
|
+
const urlObj = typeof url === "string" ? new URL(url, getUrlOrigin()) : new URL(url);
|
|
536
|
+
const pathSegments = urlObj.pathname.split("/").filter(Boolean);
|
|
537
|
+
if (pathSegments.length > 0 && toLocale(pathSegments[0])) urlObj.pathname = "/" + pathSegments.slice(1).join("/");
|
|
538
|
+
return urlObj;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* @typedef {object} ShouldRedirectServerInput
|
|
542
|
+
* @property {Request} request
|
|
543
|
+
* @property {string | URL} [effectiveRequestUrl] - Effective request URL to use for route matching, locale detection with the URL strategy, and redirect targets.
|
|
544
|
+
* @property {Locale} [locale]
|
|
545
|
+
*
|
|
546
|
+
* @typedef {object} ShouldRedirectClientInput
|
|
547
|
+
* @property {undefined} [request]
|
|
548
|
+
* @property {string | URL} [url]
|
|
549
|
+
* @property {Locale} [locale]
|
|
550
|
+
*
|
|
551
|
+
* @typedef {ShouldRedirectServerInput | ShouldRedirectClientInput} ShouldRedirectInput
|
|
552
|
+
*
|
|
553
|
+
* @typedef {object} ShouldRedirectResult
|
|
554
|
+
* @property {boolean} shouldRedirect - Indicates whether the consumer should perform a redirect.
|
|
555
|
+
* @property {Locale} locale - Locale resolved using the configured strategies.
|
|
556
|
+
* @property {URL | undefined} redirectUrl - Destination URL when a redirect is required.
|
|
557
|
+
*/
|
|
558
|
+
/**
|
|
559
|
+
* Determines whether a redirect is required to align the current URL with the active locale.
|
|
560
|
+
*
|
|
561
|
+
* This helper mirrors the logic that powers `paraglideMiddleware`, but works in both server
|
|
562
|
+
* and client environments. It evaluates the configured strategies in order, computes the
|
|
563
|
+
* canonical localized URL, and reports when the current URL does not match.
|
|
564
|
+
*
|
|
565
|
+
* When called in the browser without arguments, the current `window.location.href` is used.
|
|
566
|
+
*
|
|
567
|
+
* @see https://inlang.com/m/gerre34r/library-inlang-paraglideJs/i18n-routing#client-side-redirects
|
|
568
|
+
*
|
|
569
|
+
* @example
|
|
570
|
+
* // Client side usage (e.g. TanStack Router beforeLoad hook)
|
|
571
|
+
* async function beforeLoad({ location }) {
|
|
572
|
+
* const decision = await shouldRedirect({ url: location.href });
|
|
573
|
+
*
|
|
574
|
+
* if (decision.shouldRedirect) {
|
|
575
|
+
* throw redirect({ to: decision.redirectUrl.href });
|
|
576
|
+
* }
|
|
577
|
+
* }
|
|
578
|
+
*
|
|
579
|
+
* @example
|
|
580
|
+
* // Server side usage with a Request
|
|
581
|
+
* export async function handle(request) {
|
|
582
|
+
* const decision = await shouldRedirect({ request });
|
|
583
|
+
*
|
|
584
|
+
* if (decision.shouldRedirect) {
|
|
585
|
+
* return Response.redirect(decision.redirectUrl, 307);
|
|
586
|
+
* }
|
|
587
|
+
*
|
|
588
|
+
* return render(request, decision.locale);
|
|
589
|
+
* }
|
|
590
|
+
*
|
|
591
|
+
* @example
|
|
592
|
+
* // Server side usage behind a proxy where request.url is not public-facing
|
|
593
|
+
* export async function handle(request) {
|
|
594
|
+
* const effectiveRequestUrl = new URL(request.url);
|
|
595
|
+
* effectiveRequestUrl.protocol = "https:";
|
|
596
|
+
* effectiveRequestUrl.host = "example.com";
|
|
597
|
+
*
|
|
598
|
+
* const decision = await shouldRedirect({
|
|
599
|
+
* request,
|
|
600
|
+
* effectiveRequestUrl,
|
|
601
|
+
* });
|
|
602
|
+
*
|
|
603
|
+
* if (decision.shouldRedirect) {
|
|
604
|
+
* return Response.redirect(decision.redirectUrl, 307);
|
|
605
|
+
* }
|
|
606
|
+
* }
|
|
607
|
+
*
|
|
608
|
+
* @param {ShouldRedirectInput} [input]
|
|
609
|
+
* @returns {Promise<ShouldRedirectResult>}
|
|
610
|
+
*/
|
|
611
|
+
async function shouldRedirect(input = {}) {
|
|
612
|
+
const currentUrl = resolveUrl(input);
|
|
613
|
+
const locale = await resolveLocale(input, currentUrl);
|
|
614
|
+
const strategy = getStrategyForUrl(currentUrl.href);
|
|
615
|
+
if (isExcludedByRouteStrategy(currentUrl.href) || !strategy.includes("url")) return {
|
|
616
|
+
shouldRedirect: false,
|
|
617
|
+
locale,
|
|
618
|
+
redirectUrl: void 0
|
|
619
|
+
};
|
|
620
|
+
const localizedUrl = localizeUrl(currentUrl.href, { locale });
|
|
621
|
+
const shouldRedirectToLocalizedUrl = normalizeUrl(localizedUrl.href) !== normalizeUrl(currentUrl.href);
|
|
622
|
+
return {
|
|
623
|
+
shouldRedirect: shouldRedirectToLocalizedUrl,
|
|
624
|
+
locale,
|
|
625
|
+
redirectUrl: shouldRedirectToLocalizedUrl ? localizedUrl : void 0
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Resolves the locale either from the provided input or by using the configured strategies.
|
|
630
|
+
*
|
|
631
|
+
* @param {ShouldRedirectInput} input
|
|
632
|
+
* @param {URL} currentUrl
|
|
633
|
+
* @returns {Promise<Locale>}
|
|
634
|
+
*/
|
|
635
|
+
async function resolveLocale(input, currentUrl) {
|
|
636
|
+
const locale = toLocale(input.locale);
|
|
637
|
+
if (locale) return locale;
|
|
638
|
+
if (input.request) return extractLocaleFromRequestAsync(input.request, { effectiveRequestUrl: currentUrl });
|
|
639
|
+
if ("url" in input && typeof input.url !== "undefined") return getLocaleForUrl(currentUrl.href);
|
|
640
|
+
return getLocale();
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Resolves the current URL from the provided input or runtime context.
|
|
644
|
+
*
|
|
645
|
+
* @param {ShouldRedirectInput} input
|
|
646
|
+
* @returns {URL}
|
|
647
|
+
*/
|
|
648
|
+
function resolveUrl(input) {
|
|
649
|
+
if ("effectiveRequestUrl" in input && input.effectiveRequestUrl instanceof URL) return new URL(input.effectiveRequestUrl.href);
|
|
650
|
+
if ("effectiveRequestUrl" in input && typeof input.effectiveRequestUrl === "string") return new URL(input.effectiveRequestUrl, input.request ? input.request.url : getUrlOrigin());
|
|
651
|
+
if (input.request) return new URL(input.request.url);
|
|
652
|
+
if ("url" in input && input.url instanceof URL) return new URL(input.url.href);
|
|
653
|
+
if ("url" in input && typeof input.url === "string") return new URL(input.url, getUrlOrigin());
|
|
654
|
+
if (typeof window !== "undefined" && window?.location?.href) return new URL(window.location.href);
|
|
655
|
+
throw new Error("shouldRedirect() requires either a request, an absolute URL, or must run in a browser environment.");
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Normalize url for comparison by stripping the trailing slash.
|
|
659
|
+
*
|
|
660
|
+
* @param {string} url
|
|
661
|
+
* @returns {string}
|
|
662
|
+
*/
|
|
663
|
+
function normalizeUrl(url) {
|
|
664
|
+
const urlObj = new URL(url);
|
|
665
|
+
urlObj.pathname = urlObj.pathname.replace(/\/$/, "");
|
|
666
|
+
return urlObj.href;
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* @typedef {"cookie" | "baseLocale" | "globalVariable" | "url" | "preferredLanguage" | "localStorage"} BuiltInStrategy
|
|
670
|
+
*/
|
|
671
|
+
/**
|
|
672
|
+
* @typedef {`custom_${string}`} CustomStrategy
|
|
673
|
+
*/
|
|
674
|
+
/**
|
|
675
|
+
* @typedef {BuiltInStrategy | CustomStrategy} Strategy
|
|
676
|
+
*/
|
|
677
|
+
/**
|
|
678
|
+
* @typedef {Array<Strategy>} Strategies
|
|
679
|
+
*/
|
|
680
|
+
/**
|
|
681
|
+
* @typedef {{ getLocale: (request?: Request) => Promise<string | undefined> | (string | undefined) }} CustomServerStrategyHandler
|
|
682
|
+
*/
|
|
683
|
+
/**
|
|
684
|
+
* @typedef {{ getLocale: () => Promise<string|undefined> | (string | undefined), setLocale: (locale: string) => Promise<void> | void }} CustomClientStrategyHandler
|
|
685
|
+
*/
|
|
686
|
+
/** @type {Map<string, CustomServerStrategyHandler>} */
|
|
687
|
+
var customServerStrategies = /* @__PURE__ */ new Map();
|
|
688
|
+
/** @type {Map<string, CustomClientStrategyHandler>} */
|
|
689
|
+
var customClientStrategies = /* @__PURE__ */ new Map();
|
|
690
|
+
/**
|
|
691
|
+
* Checks if the given strategy is a custom strategy.
|
|
692
|
+
*
|
|
693
|
+
* @param {unknown} strategy The name of the custom strategy to validate.
|
|
694
|
+
* Must be a string that starts with "custom-" followed by alphanumeric characters, hyphens, or underscores.
|
|
695
|
+
* @returns {boolean} Returns true if it is a custom strategy, false otherwise.
|
|
696
|
+
*/
|
|
697
|
+
function isCustomStrategy(strategy) {
|
|
698
|
+
return typeof strategy === "string" && /^custom-[A-Za-z0-9_-]+$/.test(strategy);
|
|
699
|
+
}
|
|
700
|
+
//#endregion
|
|
701
|
+
export { serverAsyncLocalStorage as a, overwriteServerAsyncLocalStorage as i, getStrategyForUrl as n, shouldRedirect as o, isExcludedByRouteStrategy as r, deLocalizeUrl as t };
|
|
702
|
+
|
|
703
|
+
//# sourceMappingURL=runtime-ISoc6PNh.js.map
|